diff --git a/assets/cname-Dd24JAlC.js b/assets/cname-Dd24JAlC.js new file mode 100644 index 0000000..4afa2ce --- /dev/null +++ b/assets/cname-Dd24JAlC.js @@ -0,0 +1 @@ +www.simplitrac.com; diff --git a/assets/main-BSpm7VGq.js b/assets/main-BSpm7VGq.js new file mode 100644 index 0000000..9d16005 --- /dev/null +++ b/assets/main-BSpm7VGq.js @@ -0,0 +1,1935 @@ +var i1=e=>{throw TypeError(e)};var Xk=(e,t,n)=>t.has(e)||i1("Cannot "+n);var o1=(e,t,n)=>t.has(e)?i1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var s1=(e,t,n)=>(Xk(e,t,"access private method"),n);function Qk(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var zg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ti(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nr(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var e_={exports:{}},Cd={},t_={exports:{}},Ue={};/** + * @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 vu=Symbol.for("react.element"),Jk=Symbol.for("react.portal"),Zk=Symbol.for("react.fragment"),eI=Symbol.for("react.strict_mode"),tI=Symbol.for("react.profiler"),nI=Symbol.for("react.provider"),rI=Symbol.for("react.context"),iI=Symbol.for("react.forward_ref"),oI=Symbol.for("react.suspense"),sI=Symbol.for("react.memo"),aI=Symbol.for("react.lazy"),a1=Symbol.iterator;function lI(e){return e===null||typeof e!="object"?null:(e=a1&&e[a1]||e["@@iterator"],typeof e=="function"?e:null)}var n_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},r_=Object.assign,i_={};function _a(e,t,n){this.props=e,this.context=t,this.refs=i_,this.updater=n||n_}_a.prototype.isReactComponent={};_a.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};_a.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function o_(){}o_.prototype=_a.prototype;function Vg(e,t,n){this.props=e,this.context=t,this.refs=i_,this.updater=n||n_}var Wg=Vg.prototype=new o_;Wg.constructor=Vg;r_(Wg,_a.prototype);Wg.isPureReactComponent=!0;var l1=Array.isArray,s_=Object.prototype.hasOwnProperty,Hg={current:null},a_={key:!0,ref:!0,__self:!0,__source:!0};function l_(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)s_.call(t,r)&&!a_.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,Se=W[we];if(0>>1;wei(ze,se))Fei(Ye,ze)?(W[we]=Ye,W[Fe]=se,we=Fe):(W[we]=ze,W[Be]=se,we=Be);else if(Fei(Ye,se))W[we]=Ye,W[Fe]=se,we=Fe;else break e}}return J}function i(W,J){var se=W.sortIndex-J.sortIndex;return se!==0?se:W.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],f=1,d=null,p=3,g=!1,m=!1,y=!1,E=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(W){for(var J=n(c);J!==null;){if(J.callback===null)r(c);else if(J.startTime<=W)r(c),J.sortIndex=J.expirationTime,t(l,J);else break;J=n(c)}}function P(W){if(y=!1,_(W),!m)if(n(l)!==null)m=!0,ee(R);else{var J=n(c);J!==null&&B(P,J.startTime-W)}}function R(W,J){m=!1,y&&(y=!1,w(x),x=-1),g=!0;var se=p;try{for(_(J),d=n(l);d!==null&&(!(d.expirationTime>J)||W&&!N());){var we=d.callback;if(typeof we=="function"){d.callback=null,p=d.priorityLevel;var Se=we(d.expirationTime<=J);J=e.unstable_now(),typeof Se=="function"?d.callback=Se:d===n(l)&&r(l),_(J)}else r(l);d=n(l)}if(d!==null)var Ie=!0;else{var Be=n(c);Be!==null&&B(P,Be.startTime-J),Ie=!1}return Ie}finally{d=null,p=se,g=!1}}var D=!1,S=null,x=-1,C=5,I=-1;function N(){return!(e.unstable_now()-IW||125we?(W.sortIndex=se,t(c,W),n(l)===null&&W===n(c)&&(y?(w(x),x=-1):y=!0,B(P,se-we))):(W.sortIndex=Se,t(l,W),m||g||(m=!0,ee(R))),W},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(W){var J=p;return function(){var se=p;p=J;try{return W.apply(this,arguments)}finally{p=se}}}})(p_);d_.exports=p_;var bI=d_.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 wI=j,Wn=bI;function ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),am=Object.prototype.hasOwnProperty,SI=/^[: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]*$/,c1={},f1={};function _I(e){return am.call(f1,e)?!0:am.call(c1,e)?!1:SI.test(e)?f1[e]=!0:(c1[e]=!0,!1)}function xI(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function EI(e,t,n,r){if(t===null||typeof t>"u"||xI(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function bn(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Kt[e]=new bn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Kt[t]=new bn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Kt[e]=new bn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Kt[e]=new bn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Kt[e]=new bn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Kt[e]=new bn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Kt[e]=new bn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Kt[e]=new bn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Kt[e]=new bn(e,5,!1,e.toLowerCase(),null,!1,!1)});var qg=/[\-:]([a-z])/g;function Kg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(qg,Kg);Kt[t]=new bn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(qg,Kg);Kt[t]=new bn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(qg,Kg);Kt[t]=new bn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Kt[e]=new bn(e,1,!1,e.toLowerCase(),null,!1,!1)});Kt.xlinkHref=new bn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Kt[e]=new bn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Yg(e,t,n,r){var i=Kt.hasOwnProperty(t)?Kt[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` +`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{lh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ml(e):""}function CI(e){switch(e.tag){case 5:return ml(e.type);case 16:return ml("Lazy");case 13:return ml("Suspense");case 19:return ml("SuspenseList");case 0:case 2:case 15:return e=uh(e.type,!1),e;case 11:return e=uh(e.type.render,!1),e;case 1:return e=uh(e.type,!0),e;default:return""}}function fm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ss:return"Fragment";case ws:return"Portal";case lm:return"Profiler";case Xg:return"StrictMode";case um:return"Suspense";case cm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g_:return(e.displayName||"Context")+".Consumer";case m_:return(e._context.displayName||"Context")+".Provider";case Qg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jg:return t=e.displayName||null,t!==null?t:fm(e.type)||"Memo";case ji:t=e._payload,e=e._init;try{return fm(e(t))}catch{}}return null}function OI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fm(t);case 8:return t===Xg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function uo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function y_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function TI(e){var t=y_(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function uc(e){e._valueTracker||(e._valueTracker=TI(e))}function b_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=y_(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function bf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function dm(e,t){var n=t.checked;return wt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function p1(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=uo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function w_(e,t){t=t.checked,t!=null&&Yg(e,"checked",t,!1)}function pm(e,t){w_(e,t);var n=uo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hm(e,t.type,n):t.hasOwnProperty("defaultValue")&&hm(e,t.type,uo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function h1(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function hm(e,t,n){(t!=="number"||bf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var gl=Array.isArray;function $s(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=cc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Sl={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},kI=["Webkit","ms","Moz","O"];Object.keys(Sl).forEach(function(e){kI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Sl[t]=Sl[e]})});function E_(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Sl.hasOwnProperty(e)&&Sl[e]?(""+t).trim():t+"px"}function C_(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=E_(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var II=wt({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 vm(e,t){if(t){if(II[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function ym(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bm=null;function Zg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wm=null,js=null,Ls=null;function v1(e){if(e=wu(e)){if(typeof wm!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=Pd(t),wm(e.stateNode,e.type,t))}}function O_(e){js?Ls?Ls.push(e):Ls=[e]:js=e}function T_(){if(js){var e=js,t=Ls;if(Ls=js=null,v1(e),t)for(e=0;e>>=0,e===0?32:31-(UI(e)/BI|0)|0}var fc=64,dc=4194304;function vl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function xf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=vl(a):(o&=s,o!==0&&(r=vl(o)))}else s=n&~i,s!==0?r=vl(s):o!==0&&(r=vl(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function yu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tr(t),e[t]=n}function HI(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=xl),O1=" ",T1=!1;function q_(e,t){switch(e){case"keyup":return bP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function K_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _s=!1;function SP(e,t){switch(e){case"compositionend":return K_(t);case"keypress":return t.which!==32?null:(T1=!0,O1);case"textInput":return e=t.data,e===O1&&T1?null:e;default:return null}}function _P(e,t){if(_s)return e==="compositionend"||!av&&q_(e,t)?(e=H_(),Wc=iv=Gi=null,_s=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=R1(n)}}function J_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?J_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Z_(){for(var e=window,t=bf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=bf(e.document)}return t}function lv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function RP(e){var t=Z_(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&J_(n.ownerDocument.documentElement,n)){if(r!==null&&lv(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=A1(n,o);var s=A1(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,xs=null,Om=null,Cl=null,Tm=!1;function N1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tm||xs==null||xs!==bf(r)||(r=xs,"selectionStart"in r&&lv(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}),Cl&&Hl(Cl,r)||(Cl=r,r=Of(Om,"onSelect"),0Os||(e.current=Nm[Os],Nm[Os]=null,Os--)}function ut(e,t){Os++,Nm[Os]=e.current,e.current=t}var co={},un=ho(co),Tn=ho(!1),Vo=co;function Qs(e,t){var n=e.type.contextTypes;if(!n)return co;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function kn(e){return e=e.childContextTypes,e!=null}function kf(){ht(Tn),ht(un)}function U1(e,t,n){if(un.current!==co)throw Error(ie(168));ut(un,t),ut(Tn,n)}function lx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ie(108,OI(e)||"Unknown",i));return wt({},n,r)}function If(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||co,Vo=un.current,ut(un,e),ut(Tn,Tn.current),!0}function B1(e,t,n){var r=e.stateNode;if(!r)throw Error(ie(169));n?(e=lx(e,t,Vo),r.__reactInternalMemoizedMergedChildContext=e,ht(Tn),ht(un),ut(un,e)):ht(Tn),ut(Tn,n)}var fi=null,Rd=!1,xh=!1;function ux(e){fi===null?fi=[e]:fi.push(e)}function VP(e){Rd=!0,ux(e)}function mo(){if(!xh&&fi!==null){xh=!0;var e=0,t=tt;try{var n=fi;for(tt=1;e>=s,i-=s,mi=1<<32-Tr(t)+i|n<x?(C=S,S=null):C=S.sibling;var I=p(w,S,_[x],P);if(I===null){S===null&&(S=C);break}e&&S&&I.alternate===null&&t(w,S),b=o(I,b,x),D===null?R=I:D.sibling=I,D=I,S=C}if(x===_.length)return n(w,S),vt&&xo(w,x),R;if(S===null){for(;x<_.length;x++)S=d(w,_[x],P),S!==null&&(b=o(S,b,x),D===null?R=S:D.sibling=S,D=S);return vt&&xo(w,x),R}for(S=r(w,S);x<_.length;x++)C=g(S,w,x,_[x],P),C!==null&&(e&&C.alternate!==null&&S.delete(C.key===null?x:C.key),b=o(C,b,x),D===null?R=C:D.sibling=C,D=C);return e&&S.forEach(function(N){return t(w,N)}),vt&&xo(w,x),R}function y(w,b,_,P){var R=Qa(_);if(typeof R!="function")throw Error(ie(150));if(_=R.call(_),_==null)throw Error(ie(151));for(var D=R=null,S=b,x=b=0,C=null,I=_.next();S!==null&&!I.done;x++,I=_.next()){S.index>x?(C=S,S=null):C=S.sibling;var N=p(w,S,I.value,P);if(N===null){S===null&&(S=C);break}e&&S&&N.alternate===null&&t(w,S),b=o(N,b,x),D===null?R=N:D.sibling=N,D=N,S=C}if(I.done)return n(w,S),vt&&xo(w,x),R;if(S===null){for(;!I.done;x++,I=_.next())I=d(w,I.value,P),I!==null&&(b=o(I,b,x),D===null?R=I:D.sibling=I,D=I);return vt&&xo(w,x),R}for(S=r(w,S);!I.done;x++,I=_.next())I=g(S,w,x,I.value,P),I!==null&&(e&&I.alternate!==null&&S.delete(I.key===null?x:I.key),b=o(I,b,x),D===null?R=I:D.sibling=I,D=I);return e&&S.forEach(function(A){return t(w,A)}),vt&&xo(w,x),R}function E(w,b,_,P){if(typeof _=="object"&&_!==null&&_.type===Ss&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case lc:e:{for(var R=_.key,D=b;D!==null;){if(D.key===R){if(R=_.type,R===Ss){if(D.tag===7){n(w,D.sibling),b=i(D,_.props.children),b.return=w,w=b;break e}}else if(D.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===ji&&W1(R)===D.type){n(w,D.sibling),b=i(D,_.props),b.ref=nl(w,D,_),b.return=w,w=b;break e}n(w,D);break}else t(w,D);D=D.sibling}_.type===Ss?(b=$o(_.props.children,w.mode,P,_.key),b.return=w,w=b):(P=Jc(_.type,_.key,_.props,null,w.mode,P),P.ref=nl(w,b,_),P.return=w,w=P)}return s(w);case ws:e:{for(D=_.key;b!==null;){if(b.key===D)if(b.tag===4&&b.stateNode.containerInfo===_.containerInfo&&b.stateNode.implementation===_.implementation){n(w,b.sibling),b=i(b,_.children||[]),b.return=w,w=b;break e}else{n(w,b);break}else t(w,b);b=b.sibling}b=Rh(_,w.mode,P),b.return=w,w=b}return s(w);case ji:return D=_._init,E(w,b,D(_._payload),P)}if(gl(_))return m(w,b,_,P);if(Qa(_))return y(w,b,_,P);bc(w,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,b!==null&&b.tag===6?(n(w,b.sibling),b=i(b,_),b.return=w,w=b):(n(w,b),b=Ph(_,w.mode,P),b.return=w,w=b),s(w)):n(w,b)}return E}var Zs=px(!0),hx=px(!1),Af=ho(null),Nf=null,Is=null,dv=null;function pv(){dv=Is=Nf=null}function hv(e){var t=Af.current;ht(Af),e._currentValue=t}function $m(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Us(e,t){Nf=e,dv=Is=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(xn=!0),e.firstContext=null)}function ar(e){var t=e._currentValue;if(dv!==e)if(e={context:e,memoizedValue:t,next:null},Is===null){if(Nf===null)throw Error(ie(308));Is=e,Nf.dependencies={lanes:0,firstContext:e}}else Is=Is.next=e;return t}var ko=null;function mv(e){ko===null?ko=[e]:ko.push(e)}function mx(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,mv(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ei(e,r)}function Ei(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Li=!1;function gv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gx(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Si(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function to(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,He&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ei(e,n)}return i=r.interleaved,i===null?(t.next=t,mv(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ei(e,n)}function Gc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tv(e,n)}}function H1(e,t){var n=e.updateQueue,r=e.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=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Mf(e,t,n,r){var i=e.updateQueue;Li=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;s=0,f=c=l=null,a=o;do{var p=a.lane,g=a.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,y=a;switch(p=t,g=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){d=m.call(g,d,p);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,p=typeof m=="function"?m.call(g,d,p):m,p==null)break e;d=wt({},d,p);break e;case 2:Li=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=g,l=d):f=f.next=g,s|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Go|=s,e.lanes=s,e.memoizedState=d}}function G1(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ch.transition;Ch.transition={};try{e(!1),t()}finally{tt=n,Ch.transition=r}}function Nx(){return lr().memoizedState}function qP(e,t,n){var r=ro(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Mx(e))Dx(t,n);else if(n=mx(e,t,n,r),n!==null){var i=vn();kr(n,e,r,i),$x(n,t,r)}}function KP(e,t,n){var r=ro(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Mx(e))Dx(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Ar(a,s)){var l=t.interleaved;l===null?(i.next=i,mv(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=mx(e,t,i,r),n!==null&&(i=vn(),kr(n,e,r,i),$x(n,t,r))}}function Mx(e){var t=e.alternate;return e===bt||t!==null&&t===bt}function Dx(e,t){Ol=$f=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $x(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tv(e,n)}}var jf={readContext:ar,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useInsertionEffect:Qt,useLayoutEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useMutableSource:Qt,useSyncExternalStore:Qt,useId:Qt,unstable_isNewReconciler:!1},YP={readContext:ar,useCallback:function(e,t){return Fr().memoizedState=[e,t===void 0?null:t],e},useContext:ar,useEffect:K1,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Kc(4194308,4,kx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Kc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Kc(4,2,e,t)},useMemo:function(e,t){var n=Fr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=qP.bind(null,bt,e),[r.memoizedState,e]},useRef:function(e){var t=Fr();return e={current:e},t.memoizedState=e},useState:q1,useDebugValue:Ev,useDeferredValue:function(e){return Fr().memoizedState=e},useTransition:function(){var e=q1(!1),t=e[0];return e=GP.bind(null,e[1]),Fr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=bt,i=Fr();if(vt){if(n===void 0)throw Error(ie(407));n=n()}else{if(n=t(),Ft===null)throw Error(ie(349));Ho&30||wx(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,K1(_x.bind(null,r,o,e),[e]),r.flags|=2048,Zl(9,Sx.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Fr(),t=Ft.identifierPrefix;if(vt){var n=gi,r=mi;n=(r&~(1<<32-Tr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ql++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Wr]=t,e[Kl]=r,Gx(e,t,!1,!1),t.stateNode=e;e:{switch(s=ym(n,r),n){case"dialog":dt("cancel",e),dt("close",e),i=r;break;case"iframe":case"object":case"embed":dt("load",e),i=r;break;case"video":case"audio":for(i=0;ina&&(t.flags|=128,r=!0,rl(o,!1),t.lanes=4194304)}else{if(!r)if(e=Df(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),rl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!vt)return Jt(t),null}else 2*Ot()-o.renderingStartTime>na&&n!==1073741824&&(t.flags|=128,r=!0,rl(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ot(),t.sibling=null,n=yt.current,ut(yt,r?n&1|2:n&1),t):(Jt(t),null);case 22:case 23:return Pv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?jn&1073741824&&(Jt(t),t.subtreeFlags&6&&(t.flags|=8192)):Jt(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function rR(e,t){switch(cv(t),t.tag){case 1:return kn(t.type)&&kf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(),ht(Tn),ht(un),bv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yv(t),null;case 13:if(ht(yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));Js()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ht(yt),null;case 4:return ea(),null;case 10:return hv(t.type._context),null;case 22:case 23:return Pv(),null;case 24:return null;default:return null}}var Sc=!1,on=!1,iR=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Ps(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xt(e,t,r)}else n.current=null}function Hm(e,t,n){try{n()}catch(r){xt(e,t,r)}}var ob=!1;function oR(e,t){if(km=Ef,e=Z_(),lv(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,f=0,d=e,p=null;t:for(;;){for(var g;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)p=d,d=g;for(;;){if(d===e)break t;if(p===n&&++c===i&&(a=s),p===o&&++f===r&&(l=s),(g=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Im={focusedElem:e,selectionRange:n},Ef=!1,ve=t;ve!==null;)if(t=ve,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ve=e;else for(;ve!==null;){t=ve;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,E=m.memoizedState,w=t.stateNode,b=w.getSnapshotBeforeUpdate(t.elementType===t.type?y:wr(t.type,y),E);w.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(P){xt(t,t.return,P)}if(e=t.sibling,e!==null){e.return=t.return,ve=e;break}ve=t.return}return m=ob,ob=!1,m}function Tl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Hm(t,n,o)}i=i.next}while(i!==r)}}function Md(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Gm(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Yx(e){var t=e.alternate;t!==null&&(e.alternate=null,Yx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wr],delete t[Kl],delete t[Am],delete t[BP],delete t[zP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Xx(e){return e.tag===5||e.tag===3||e.tag===4}function sb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qm(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Tf));else if(r!==4&&(e=e.child,e!==null))for(qm(e,t,n),e=e.sibling;e!==null;)qm(e,t,n),e=e.sibling}function Km(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Km(e,t,n),e=e.sibling;e!==null;)Km(e,t,n),e=e.sibling}var Ht=null,_r=!1;function Ni(e,t,n){for(n=n.child;n!==null;)Qx(e,t,n),n=n.sibling}function Qx(e,t,n){if(Xr&&typeof Xr.onCommitFiberUnmount=="function")try{Xr.onCommitFiberUnmount(Od,n)}catch{}switch(n.tag){case 5:on||Ps(n,t);case 6:var r=Ht,i=_r;Ht=null,Ni(e,t,n),Ht=r,_r=i,Ht!==null&&(_r?(e=Ht,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ht.removeChild(n.stateNode));break;case 18:Ht!==null&&(_r?(e=Ht,n=n.stateNode,e.nodeType===8?_h(e.parentNode,n):e.nodeType===1&&_h(e,n),Vl(e)):_h(Ht,n.stateNode));break;case 4:r=Ht,i=_r,Ht=n.stateNode.containerInfo,_r=!0,Ni(e,t,n),Ht=r,_r=i;break;case 0:case 11:case 14:case 15:if(!on&&(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)&&Hm(n,t,s),i=i.next}while(i!==r)}Ni(e,t,n);break;case 1:if(!on&&(Ps(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){xt(n,t,a)}Ni(e,t,n);break;case 21:Ni(e,t,n);break;case 22:n.mode&1?(on=(r=on)||n.memoizedState!==null,Ni(e,t,n),on=r):Ni(e,t,n);break;default:Ni(e,t,n)}}function ab(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new iR),t.forEach(function(r){var i=hR.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function br(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Ot()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*aR(r/1960))-r,10e?16:e,qi===null)var r=!1;else{if(e=qi,qi=null,Uf=0,He&6)throw Error(ie(331));var i=He;for(He|=4,ve=e.current;ve!==null;){var o=ve,s=o.child;if(ve.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lOt()-kv?Do(e,0):Tv|=n),In(e,t)}function oE(e,t){t===0&&(e.mode&1?(t=dc,dc<<=1,!(dc&130023424)&&(dc=4194304)):t=1);var n=vn();e=Ei(e,t),e!==null&&(yu(e,t,n),In(e,n))}function pR(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),oE(e,n)}function hR(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ie(314))}r!==null&&r.delete(t),oE(e,n)}var sE;sE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Tn.current)xn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xn=!1,tR(e,t,n);xn=!!(e.flags&131072)}else xn=!1,vt&&t.flags&1048576&&cx(t,Rf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Yc(e,t),e=t.pendingProps;var i=Qs(t,un.current);Us(t,n),i=Sv(null,t,r,e,i,n);var o=_v();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kn(r)?(o=!0,If(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,gv(t),i.updater=Nd,t.stateNode=i,i._reactInternals=t,Lm(t,r,e,n),t=Bm(null,t,r,!0,o,n)):(t.tag=0,vt&&o&&uv(t),pn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Yc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=gR(r),e=wr(r,e),i){case 0:t=Um(null,t,r,e,n);break e;case 1:t=nb(null,t,r,e,n);break e;case 11:t=eb(null,t,r,e,n);break e;case 14:t=tb(null,t,r,wr(r.type,e),n);break e}throw Error(ie(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:wr(r,i),Um(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:wr(r,i),nb(e,t,r,i,n);case 3:e:{if(Vx(t),e===null)throw Error(ie(387));r=t.pendingProps,o=t.memoizedState,i=o.element,gx(e,t),Mf(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=ta(Error(ie(423)),t),t=rb(e,t,r,n,i);break e}else if(r!==i){i=ta(Error(ie(424)),t),t=rb(e,t,r,n,i);break e}else for(Un=eo(t.stateNode.containerInfo.firstChild),zn=t,vt=!0,xr=null,n=hx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Js(),r===i){t=Ci(e,t,n);break e}pn(e,t,r,n)}t=t.child}return t;case 5:return vx(t),e===null&&Dm(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Pm(r,i)?s=null:o!==null&&Pm(r,o)&&(t.flags|=32),zx(e,t),pn(e,t,s,n),t.child;case 6:return e===null&&Dm(t),null;case 13:return Wx(e,t,n);case 4:return vv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zs(t,null,r,n):pn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:wr(r,i),eb(e,t,r,i,n);case 7:return pn(e,t,t.pendingProps,n),t.child;case 8:return pn(e,t,t.pendingProps.children,n),t.child;case 12:return pn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,ut(Af,r._currentValue),r._currentValue=s,o!==null)if(Ar(o.value,s)){if(o.children===i.children&&!Tn.current){t=Ci(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Si(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),$m(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(ie(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),$m(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}pn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Us(t,n),i=ar(i),r=r(i),t.flags|=1,pn(e,t,r,n),t.child;case 14:return r=t.type,i=wr(r,t.pendingProps),i=wr(r.type,i),tb(e,t,r,i,n);case 15:return Ux(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:wr(r,i),Yc(e,t),t.tag=1,kn(r)?(e=!0,If(t)):e=!1,Us(t,n),jx(t,r,i),Lm(t,r,i,n),Bm(null,t,r,!0,e,n);case 19:return Hx(e,t,n);case 22:return Bx(e,t,n)}throw Error(ie(156,t.tag))};function aE(e,t){return M_(e,t)}function mR(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rr(e,t,n,r){return new mR(e,t,n,r)}function Av(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gR(e){if(typeof e=="function")return Av(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qg)return 11;if(e===Jg)return 14}return 2}function io(e,t){var n=e.alternate;return n===null?(n=rr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Jc(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")Av(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ss:return $o(n.children,i,o,t);case Xg:s=8,i|=8;break;case lm:return e=rr(12,n,t,i|2),e.elementType=lm,e.lanes=o,e;case um:return e=rr(13,n,t,i),e.elementType=um,e.lanes=o,e;case cm:return e=rr(19,n,t,i),e.elementType=cm,e.lanes=o,e;case v_:return $d(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case m_:s=10;break e;case g_:s=9;break e;case Qg:s=11;break e;case Jg:s=14;break e;case ji:s=16,r=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=rr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function $o(e,t,n,r){return e=rr(7,e,r,t),e.lanes=n,e}function $d(e,t,n,r){return e=rr(22,e,r,t),e.elementType=v_,e.lanes=n,e.stateNode={isHidden:!1},e}function Ph(e,t,n){return e=rr(6,e,null,t),e.lanes=n,e}function Rh(e,t,n){return t=rr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vR(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fh(0),this.expirationTimes=fh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Nv(e,t,n,r,i,o,s,a,l){return e=new vR(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=rr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},gv(o),e}function yR(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fE)}catch(e){console.error(e)}}fE(),f_.exports=Hn;var jo=f_.exports;const Zc=ti(jo);var mb=jo;sm.createRoot=mb.createRoot,sm.hydrateRoot=mb.hydrateRoot;var _u=e=>e.type==="checkbox",As=e=>e instanceof Date,hn=e=>e==null;const dE=e=>typeof e=="object";var Dt=e=>!hn(e)&&!Array.isArray(e)&&dE(e)&&!As(e),pE=e=>Dt(e)&&e.target?_u(e.target)?e.target.checked:e.target.value:e,xR=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,hE=(e,t)=>e.has(xR(t)),ER=e=>{const t=e.constructor&&e.constructor.prototype;return Dt(t)&&t.hasOwnProperty("isPrototypeOf")},jv=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function wn(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(jv&&(e instanceof Blob||e instanceof FileList))&&(n||Dt(e)))if(t=n?[]:{},!n&&!ER(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=wn(e[r]));else return e;return t}var Bd=e=>Array.isArray(e)?e.filter(Boolean):[],Et=e=>e===void 0,de=(e,t,n)=>{if(!t||!Dt(e))return n;const r=Bd(t.split(/[,[\].]+?/)).reduce((i,o)=>hn(i)?i:i[o],e);return Et(r)||r===e?Et(e[t])?n:e[t]:r},Hr=e=>typeof e=="boolean",Lv=e=>/^\w*$/.test(e),mE=e=>Bd(e.replace(/["|']|\]/g,"").split(/\.|\[/)),st=(e,t,n)=>{let r=-1;const i=Lv(t)?[t]:mE(t),o=i.length,s=o-1;for(;++rZ.useContext(CR);var gE=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const s=o;return t._proxyFormState[s]!==Cr.all&&(t._proxyFormState[s]=!r||Cr.all),n&&(n[s]=!0),e[s]}});return i},$n=e=>Dt(e)&&!Object.keys(e).length,vE=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return $n(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(s=>t[s]===(!r||Cr.all))},Pl=e=>Array.isArray(e)?e:[e],yE=(e,t,n)=>!e||!t||e===t||Pl(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Uv(e){const t=Z.useRef(e);t.current=e,Z.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function OR(e){const t=Fv(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[s,a]=Z.useState(n._formState),l=Z.useRef(!0),c=Z.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=Z.useRef(i);return f.current=i,Uv({disabled:r,next:d=>l.current&&yE(f.current,d.name,o)&&vE(d,c.current,n._updateFormState)&&a({...n._formState,...d}),subject:n._subjects.state}),Z.useEffect(()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),gE(s,n,c.current,!1)}var qr=e=>typeof e=="string",bE=(e,t,n,r,i)=>qr(e)?(r&&t.watch.add(e),de(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),de(n,o))):(r&&(t.watchAll=!0),n);function TR(e){const t=Fv(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:s}=e||{},a=Z.useRef(r);a.current=r,Uv({disabled:o,subject:n._subjects.values,next:f=>{yE(a.current,f.name,s)&&c(wn(bE(a.current,n._names,f.values||n._formValues,!1,i)))}});const[l,c]=Z.useState(n._getWatch(r,i));return Z.useEffect(()=>n._removeUnmounted()),l}function kR(e){const t=Fv(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o}=e,s=hE(i._names.array,n),a=TR({control:i,name:n,defaultValue:de(i._formValues,n,de(i._defaultValues,n,e.defaultValue)),exact:!0}),l=OR({control:i,name:n}),c=Z.useRef(i.register(n,{...e.rules,value:a,...Hr(e.disabled)?{disabled:e.disabled}:{}}));return Z.useEffect(()=>{const f=i._options.shouldUnregister||o,d=(p,g)=>{const m=de(i._fields,p);m&&m._f&&(m._f.mount=g)};if(d(n,!0),f){const p=wn(de(i._options.defaultValues,n));st(i._defaultValues,n,p),Et(de(i._formValues,n))&&st(i._formValues,n,p)}return()=>{(s?f&&!i._state.action:f)?i.unregister(n):d(n,!1)}},[n,i,s,o]),Z.useEffect(()=>{de(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:de(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:a,...Hr(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:Z.useCallback(f=>c.current.onChange({target:{value:pE(f),name:n},type:Vf.CHANGE}),[n]),onBlur:Z.useCallback(()=>c.current.onBlur({target:{value:de(i._formValues,n),name:n},type:Vf.BLUR}),[n,i]),ref:f=>{const d=de(i._fields,n);d&&f&&(d._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:p=>f.setCustomValidity(p),reportValidity:()=>f.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!de(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!de(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!de(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!de(l.validatingFields,n)},error:{enumerable:!0,get:()=>de(l.errors,n)}})}}const Ki=e=>e.render(kR(e));var IR=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},gb=e=>({isOnSubmit:!e||e===Cr.onSubmit,isOnBlur:e===Cr.onBlur,isOnChange:e===Cr.onChange,isOnAll:e===Cr.all,isOnTouch:e===Cr.onTouched}),vb=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Rl=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=de(e,i);if(o){const{_f:s,...a}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],i)&&!r)break;if(s.ref&&t(s.ref,s.name)&&!r)break;Rl(a,t)}else Dt(a)&&Rl(a,t)}}};var PR=(e,t,n)=>{const r=Pl(de(e,n));return st(r,"root",t[n]),st(e,n,r),e},Bv=e=>e.type==="file",Yi=e=>typeof e=="function",Wf=e=>{if(!jv)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ef=e=>qr(e),zv=e=>e.type==="radio",Hf=e=>e instanceof RegExp;const yb={value:!1,isValid:!1},bb={value:!0,isValid:!0};var wE=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Et(e[0].attributes.value)?Et(e[0].value)||e[0].value===""?bb:{value:e[0].value,isValid:!0}:bb:yb}return yb};const wb={isValid:!1,value:null};var SE=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,wb):wb;function Sb(e,t,n="validate"){if(ef(e)||Array.isArray(e)&&e.every(ef)||Hr(e)&&!e)return{type:n,message:ef(e)?e:"",ref:t}}var cs=e=>Dt(e)&&!Hf(e)?e:{value:e,message:""},_b=async(e,t,n,r,i)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:c,min:f,max:d,pattern:p,validate:g,name:m,valueAsNumber:y,mount:E,disabled:w}=e._f,b=de(t,m);if(!E||w)return{};const _=s?s[0]:o,P=A=>{r&&_.reportValidity&&(_.setCustomValidity(Hr(A)?"":A||""),_.reportValidity())},R={},D=zv(o),S=_u(o),x=D||S,C=(y||Bv(o))&&Et(o.value)&&Et(b)||Wf(o)&&o.value===""||b===""||Array.isArray(b)&&!b.length,I=IR.bind(null,m,n,R),N=(A,k,X,G=si.maxLength,ee=si.minLength)=>{const B=A?k:X;R[m]={type:A?G:ee,message:B,ref:o,...I(A?G:ee,B)}};if(i?!Array.isArray(b)||!b.length:a&&(!x&&(C||hn(b))||Hr(b)&&!b||S&&!wE(s).isValid||D&&!SE(s).isValid)){const{value:A,message:k}=ef(a)?{value:!!a,message:a}:cs(a);if(A&&(R[m]={type:si.required,message:k,ref:_,...I(si.required,k)},!n))return P(k),R}if(!C&&(!hn(f)||!hn(d))){let A,k;const X=cs(d),G=cs(f);if(!hn(b)&&!isNaN(b)){const ee=o.valueAsNumber||b&&+b;hn(X.value)||(A=ee>X.value),hn(G.value)||(k=eenew Date(new Date().toDateString()+" "+se),W=o.type=="time",J=o.type=="week";qr(X.value)&&b&&(A=W?B(b)>B(X.value):J?b>X.value:ee>new Date(X.value)),qr(G.value)&&b&&(k=W?B(b)+A.value,G=!hn(k.value)&&b.length<+k.value;if((X||G)&&(N(X,A.message,k.message),!n))return P(R[m].message),R}if(p&&!C&&qr(b)){const{value:A,message:k}=cs(p);if(Hf(A)&&!b.match(A)&&(R[m]={type:si.pattern,message:k,ref:o,...I(si.pattern,k)},!n))return P(k),R}if(g){if(Yi(g)){const A=await g(b,t),k=Sb(A,_);if(k&&(R[m]={...k,...I(si.validate,k.message)},!n))return P(k.message),R}else if(Dt(g)){let A={};for(const k in g){if(!$n(A)&&!n)break;const X=Sb(await g[k](b,t),_,k);X&&(A={...X,...I(k,X.message)},P(X.message),n&&(R[m]=A))}if(!$n(A)&&(R[m]={ref:_,...A},!n))return R}}return P(!0),R};function RR(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},Gf=e=>hn(e)||!dE(e);function Po(e,t){if(Gf(e)||Gf(t))return e===t;if(As(e)&&As(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const s=t[i];if(As(o)&&As(s)||Dt(o)&&Dt(s)||Array.isArray(o)&&Array.isArray(s)?!Po(o,s):o!==s)return!1}}return!0}var _E=e=>e.type==="select-multiple",NR=e=>zv(e)||_u(e),Nh=e=>Wf(e)&&e.isConnected,xE=e=>{for(const t in e)if(Yi(e[t]))return!0;return!1};function qf(e,t={}){const n=Array.isArray(e);if(Dt(e)||n)for(const r in e)Array.isArray(e[r])||Dt(e[r])&&!xE(e[r])?(t[r]=Array.isArray(e[r])?[]:{},qf(e[r],t[r])):hn(e[r])||(t[r]=!0);return t}function EE(e,t,n){const r=Array.isArray(e);if(Dt(e)||r)for(const i in e)Array.isArray(e[i])||Dt(e[i])&&!xE(e[i])?Et(t)||Gf(n[i])?n[i]=Array.isArray(e[i])?qf(e[i],[]):{...qf(e[i])}:EE(e[i],hn(t)?{}:t[i],n[i]):n[i]=!Po(e[i],t[i]);return n}var Ec=(e,t)=>EE(e,t,qf(t)),CE=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Et(e)?e:t?e===""?NaN:e&&+e:n&&qr(e)?new Date(e):r?r(e):e;function Mh(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Bv(t)?t.files:zv(t)?SE(e.refs).value:_E(t)?[...t.selectedOptions].map(({value:n})=>n):_u(t)?wE(e.refs).value:CE(Et(t.value)?e.ref.value:t.value,e)}var MR=(e,t,n,r)=>{const i={};for(const o of e){const s=de(t,o);s&&st(i,o,s._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},ol=e=>Et(e)?e:Hf(e)?e.source:Dt(e)?Hf(e.value)?e.value.source:e.value:e,DR=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function xb(e,t,n){const r=de(e,n);if(r||Lv(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),s=de(t,o),a=de(e,o);if(s&&!Array.isArray(s)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};i.pop()}return{name:n}}var $R=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,jR=(e,t)=>!Bd(de(e,t)).length&&At(e,t);const LR={mode:Cr.onSubmit,reValidateMode:Cr.onChange,shouldFocusError:!0};function FR(e={}){let t={...LR,...e},n={submitCount:0,isDirty:!1,isLoading:Yi(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=Dt(t.defaultValues)||Dt(t.values)?wn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:wn(i),s={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:Ah(),array:Ah(),state:Ah()},p=gb(t.mode),g=gb(t.reValidateMode),m=t.criteriaMode===Cr.all,y=$=>z=>{clearTimeout(c),c=setTimeout($,z)},E=async $=>{if(f.isValid||$){const z=t.resolver?$n((await x()).errors):await I(r,!0);z!==n.isValid&&d.state.next({isValid:z})}},w=($,z)=>{(f.isValidating||f.validatingFields)&&(($||Array.from(a.mount)).forEach(H=>{H&&(z?st(n.validatingFields,H,z):At(n.validatingFields,H))}),d.state.next({validatingFields:n.validatingFields,isValidating:!$n(n.validatingFields)}))},b=($,z=[],H,ae,ne=!0,te=!0)=>{if(ae&&H){if(s.action=!0,te&&Array.isArray(de(r,$))){const pe=H(de(r,$),ae.argA,ae.argB);ne&&st(r,$,pe)}if(te&&Array.isArray(de(n.errors,$))){const pe=H(de(n.errors,$),ae.argA,ae.argB);ne&&st(n.errors,$,pe),jR(n.errors,$)}if(f.touchedFields&&te&&Array.isArray(de(n.touchedFields,$))){const pe=H(de(n.touchedFields,$),ae.argA,ae.argB);ne&&st(n.touchedFields,$,pe)}f.dirtyFields&&(n.dirtyFields=Ec(i,o)),d.state.next({name:$,isDirty:A($,z),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else st(o,$,z)},_=($,z)=>{st(n.errors,$,z),d.state.next({errors:n.errors})},P=$=>{n.errors=$,d.state.next({errors:n.errors,isValid:!1})},R=($,z,H,ae)=>{const ne=de(r,$);if(ne){const te=de(o,$,Et(H)?de(i,$):H);Et(te)||ae&&ae.defaultChecked||z?st(o,$,z?te:Mh(ne._f)):G($,te),s.mount&&E()}},D=($,z,H,ae,ne)=>{let te=!1,pe=!1;const le={name:$},he=!!(de(r,$)&&de(r,$)._f&&de(r,$)._f.disabled);if(!H||ae){f.isDirty&&(pe=n.isDirty,n.isDirty=le.isDirty=A(),te=pe!==le.isDirty);const ce=he||Po(de(i,$),z);pe=!!(!he&&de(n.dirtyFields,$)),ce||he?At(n.dirtyFields,$):st(n.dirtyFields,$,!0),le.dirtyFields=n.dirtyFields,te=te||f.dirtyFields&&pe!==!ce}if(H){const ce=de(n.touchedFields,$);ce||(st(n.touchedFields,$,H),le.touchedFields=n.touchedFields,te=te||f.touchedFields&&ce!==H)}return te&&ne&&d.state.next(le),te?le:{}},S=($,z,H,ae)=>{const ne=de(n.errors,$),te=f.isValid&&Hr(z)&&n.isValid!==z;if(e.delayError&&H?(l=y(()=>_($,H)),l(e.delayError)):(clearTimeout(c),l=null,H?st(n.errors,$,H):At(n.errors,$)),(H?!Po(ne,H):ne)||!$n(ae)||te){const pe={...ae,...te&&Hr(z)?{isValid:z}:{},errors:n.errors,name:$};n={...n,...pe},d.state.next(pe)}},x=async $=>{w($,!0);const z=await t.resolver(o,t.context,MR($||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w($),z},C=async $=>{const{errors:z}=await x($);if($)for(const H of $){const ae=de(z,H);ae?st(n.errors,H,ae):At(n.errors,H)}else n.errors=z;return z},I=async($,z,H={valid:!0})=>{for(const ae in $){const ne=$[ae];if(ne){const{_f:te,...pe}=ne;if(te){const le=a.array.has(te.name);w([ae],!0);const he=await _b(ne,o,m,t.shouldUseNativeValidation&&!z,le);if(w([ae]),he[te.name]&&(H.valid=!1,z))break;!z&&(de(he,te.name)?le?PR(n.errors,he,te.name):st(n.errors,te.name,he[te.name]):At(n.errors,te.name))}pe&&await I(pe,z,H)}}return H.valid},N=()=>{for(const $ of a.unMount){const z=de(r,$);z&&(z._f.refs?z._f.refs.every(H=>!Nh(H)):!Nh(z._f.ref))&&Fe($)}a.unMount=new Set},A=($,z)=>($&&z&&st(o,$,z),!Po(we(),i)),k=($,z,H)=>bE($,a,{...s.mount?o:Et(z)?i:qr($)?{[$]:z}:z},H,z),X=$=>Bd(de(s.mount?o:i,$,e.shouldUnregister?de(i,$,[]):[])),G=($,z,H={})=>{const ae=de(r,$);let ne=z;if(ae){const te=ae._f;te&&(!te.disabled&&st(o,$,CE(z,te)),ne=Wf(te.ref)&&hn(z)?"":z,_E(te.ref)?[...te.ref.options].forEach(pe=>pe.selected=ne.includes(pe.value)):te.refs?_u(te.ref)?te.refs.length>1?te.refs.forEach(pe=>(!pe.defaultChecked||!pe.disabled)&&(pe.checked=Array.isArray(ne)?!!ne.find(le=>le===pe.value):ne===pe.value)):te.refs[0]&&(te.refs[0].checked=!!ne):te.refs.forEach(pe=>pe.checked=pe.value===ne):Bv(te.ref)?te.ref.value="":(te.ref.value=ne,te.ref.type||d.values.next({name:$,values:{...o}})))}(H.shouldDirty||H.shouldTouch)&&D($,ne,H.shouldTouch,H.shouldDirty,!0),H.shouldValidate&&se($)},ee=($,z,H)=>{for(const ae in z){const ne=z[ae],te=`${$}.${ae}`,pe=de(r,te);(a.array.has($)||!Gf(ne)||pe&&!pe._f)&&!As(ne)?ee(te,ne,H):G(te,ne,H)}},B=($,z,H={})=>{const ae=de(r,$),ne=a.array.has($),te=wn(z);st(o,$,te),ne?(d.array.next({name:$,values:{...o}}),(f.isDirty||f.dirtyFields)&&H.shouldDirty&&d.state.next({name:$,dirtyFields:Ec(i,o),isDirty:A($,te)})):ae&&!ae._f&&!hn(te)?ee($,te,H):G($,te,H),vb($,a)&&d.state.next({...n}),d.values.next({name:s.mount?$:void 0,values:{...o}})},W=async $=>{s.mount=!0;const z=$.target;let H=z.name,ae=!0;const ne=de(r,H),te=()=>z.type?Mh(ne._f):pE($),pe=le=>{ae=Number.isNaN(le)||le===de(o,H,le)};if(ne){let le,he;const ce=te(),Ne=$.type===Vf.BLUR||$.type===Vf.FOCUS_OUT,Ce=!DR(ne._f)&&!t.resolver&&!de(n.errors,H)&&!ne._f.deps||$R(Ne,de(n.touchedFields,H),n.isSubmitted,g,p),lt=vb(H,a,Ne);st(o,H,ce),Ne?(ne._f.onBlur&&ne._f.onBlur($),l&&l(0)):ne._f.onChange&&ne._f.onChange($);const Pe=D(H,ce,Ne,!1),Ee=!$n(Pe)||lt;if(!Ne&&d.values.next({name:H,type:$.type,values:{...o}}),Ce)return f.isValid&&E(),Ee&&d.state.next({name:H,...lt?{}:Pe});if(!Ne&<&&d.state.next({...n}),t.resolver){const{errors:zt}=await x([H]);if(pe(ce),ae){const Ii=xb(n.errors,r,H),ri=xb(zt,r,Ii.name||H);le=ri.error,H=ri.name,he=$n(zt)}}else w([H],!0),le=(await _b(ne,o,m,t.shouldUseNativeValidation))[H],w([H]),pe(ce),ae&&(le?he=!1:f.isValid&&(he=await I(r,!0)));ae&&(ne._f.deps&&se(ne._f.deps),S(H,he,le,Pe))}},J=($,z)=>{if(de(n.errors,z)&&$.focus)return $.focus(),1},se=async($,z={})=>{let H,ae;const ne=Pl($);if(t.resolver){const te=await C(Et($)?$:ne);H=$n(te),ae=$?!ne.some(pe=>de(te,pe)):H}else $?(ae=(await Promise.all(ne.map(async te=>{const pe=de(r,te);return await I(pe&&pe._f?{[te]:pe}:pe)}))).every(Boolean),!(!ae&&!n.isValid)&&E()):ae=H=await I(r);return d.state.next({...!qr($)||f.isValid&&H!==n.isValid?{}:{name:$},...t.resolver||!$?{isValid:H}:{},errors:n.errors}),z.shouldFocus&&!ae&&Rl(r,J,$?ne:a.mount),ae},we=$=>{const z={...s.mount?o:i};return Et($)?z:qr($)?de(z,$):$.map(H=>de(z,H))},Se=($,z)=>({invalid:!!de((z||n).errors,$),isDirty:!!de((z||n).dirtyFields,$),error:de((z||n).errors,$),isValidating:!!de(n.validatingFields,$),isTouched:!!de((z||n).touchedFields,$)}),Ie=$=>{$&&Pl($).forEach(z=>At(n.errors,z)),d.state.next({errors:$?n.errors:{}})},Be=($,z,H)=>{const ae=(de(r,$,{_f:{}})._f||{}).ref,ne=de(n.errors,$)||{},{ref:te,message:pe,type:le,...he}=ne;st(n.errors,$,{...he,...z,ref:ae}),d.state.next({name:$,errors:n.errors,isValid:!1}),H&&H.shouldFocus&&ae&&ae.focus&&ae.focus()},ze=($,z)=>Yi($)?d.values.subscribe({next:H=>$(k(void 0,z),H)}):k($,z,!0),Fe=($,z={})=>{for(const H of $?Pl($):a.mount)a.mount.delete(H),a.array.delete(H),z.keepValue||(At(r,H),At(o,H)),!z.keepError&&At(n.errors,H),!z.keepDirty&&At(n.dirtyFields,H),!z.keepTouched&&At(n.touchedFields,H),!z.keepIsValidating&&At(n.validatingFields,H),!t.shouldUnregister&&!z.keepDefaultValue&&At(i,H);d.values.next({values:{...o}}),d.state.next({...n,...z.keepDirty?{isDirty:A()}:{}}),!z.keepIsValid&&E()},Ye=({disabled:$,name:z,field:H,fields:ae,value:ne})=>{if(Hr($)&&s.mount||$){const te=$?void 0:Et(ne)?Mh(H?H._f:de(ae,z)._f):ne;st(o,z,te),D(z,te,!1,!1,!0)}},M=($,z={})=>{let H=de(r,$);const ae=Hr(z.disabled);return st(r,$,{...H||{},_f:{...H&&H._f?H._f:{ref:{name:$}},name:$,mount:!0,...z}}),a.mount.add($),H?Ye({field:H,disabled:z.disabled,name:$,value:z.value}):R($,!0,z.value),{...ae?{disabled:z.disabled}:{},...t.progressive?{required:!!z.required,min:ol(z.min),max:ol(z.max),minLength:ol(z.minLength),maxLength:ol(z.maxLength),pattern:ol(z.pattern)}:{},name:$,onChange:W,onBlur:W,ref:ne=>{if(ne){M($,z),H=de(r,$);const te=Et(ne.value)&&ne.querySelectorAll&&ne.querySelectorAll("input,select,textarea")[0]||ne,pe=NR(te),le=H._f.refs||[];if(pe?le.find(he=>he===te):te===H._f.ref)return;st(r,$,{_f:{...H._f,...pe?{refs:[...le.filter(Nh),te,...Array.isArray(de(i,$))?[{}]:[]],ref:{type:te.type,name:$}}:{ref:te}}}),R($,!1,void 0,te)}else H=de(r,$,{}),H._f&&(H._f.mount=!1),(t.shouldUnregister||z.shouldUnregister)&&!(hE(a.array,$)&&s.action)&&a.unMount.add($)}}},L=()=>t.shouldFocusError&&Rl(r,J,a.mount),U=$=>{Hr($)&&(d.state.next({disabled:$}),Rl(r,(z,H)=>{const ae=de(r,H);ae&&(z.disabled=ae._f.disabled||$,Array.isArray(ae._f.refs)&&ae._f.refs.forEach(ne=>{ne.disabled=ae._f.disabled||$}))},0,!1))},F=($,z)=>async H=>{let ae;H&&(H.preventDefault&&H.preventDefault(),H.persist&&H.persist());let ne=wn(o);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:te,values:pe}=await x();n.errors=te,ne=pe}else await I(r);if(At(n.errors,"root"),$n(n.errors)){d.state.next({errors:{}});try{await $(ne,H)}catch(te){ae=te}}else z&&await z({...n.errors},H),L(),setTimeout(L);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:$n(n.errors)&&!ae,submitCount:n.submitCount+1,errors:n.errors}),ae)throw ae},ue=($,z={})=>{de(r,$)&&(Et(z.defaultValue)?B($,wn(de(i,$))):(B($,z.defaultValue),st(i,$,wn(z.defaultValue))),z.keepTouched||At(n.touchedFields,$),z.keepDirty||(At(n.dirtyFields,$),n.isDirty=z.defaultValue?A($,wn(de(i,$))):A()),z.keepError||(At(n.errors,$),f.isValid&&E()),d.state.next({...n}))},q=($,z={})=>{const H=$?wn($):i,ae=wn(H),ne=$n($),te=ne?i:ae;if(z.keepDefaultValues||(i=H),!z.keepValues){if(z.keepDirtyValues)for(const pe of a.mount)de(n.dirtyFields,pe)?st(te,pe,de(o,pe)):B(pe,de(te,pe));else{if(jv&&Et($))for(const pe of a.mount){const le=de(r,pe);if(le&&le._f){const he=Array.isArray(le._f.refs)?le._f.refs[0]:le._f.ref;if(Wf(he)){const ce=he.closest("form");if(ce){ce.reset();break}}}}r={}}o=e.shouldUnregister?z.keepDefaultValues?wn(i):{}:wn(te),d.array.next({values:{...te}}),d.values.next({values:{...te}})}a={mount:z.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!f.isValid||!!z.keepIsValid||!!z.keepDirtyValues,s.watch=!!e.shouldUnregister,d.state.next({submitCount:z.keepSubmitCount?n.submitCount:0,isDirty:ne?!1:z.keepDirty?n.isDirty:!!(z.keepDefaultValues&&!Po($,i)),isSubmitted:z.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ne?{}:z.keepDirtyValues?z.keepDefaultValues&&o?Ec(i,o):n.dirtyFields:z.keepDefaultValues&&$?Ec(i,$):z.keepDirty?n.dirtyFields:{},touchedFields:z.keepTouched?n.touchedFields:{},errors:z.keepErrors?n.errors:{},isSubmitSuccessful:z.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},oe=($,z)=>q(Yi($)?$(o):$,z);return{control:{register:M,unregister:Fe,getFieldState:Se,handleSubmit:F,setError:Be,_executeSchema:x,_getWatch:k,_getDirty:A,_updateValid:E,_removeUnmounted:N,_updateFieldArray:b,_updateDisabledField:Ye,_getFieldArray:X,_reset:q,_resetDefaultValues:()=>Yi(t.defaultValues)&&t.defaultValues().then($=>{oe($,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:$=>{n={...n,...$}},_disableForm:U,_subjects:d,_proxyFormState:f,_setErrors:P,get _fields(){return r},get _formValues(){return o},get _state(){return s},set _state($){s=$},get _defaultValues(){return i},get _names(){return a},set _names($){a=$},get _formState(){return n},set _formState($){n=$},get _options(){return t},set _options($){t={...t,...$}}},trigger:se,register:M,handleSubmit:F,watch:ze,setValue:B,getValues:we,reset:oe,resetField:ue,clearErrors:Ie,unregister:Fe,setError:Be,setFocus:($,z={})=>{const H=de(r,$),ae=H&&H._f;if(ae){const ne=ae.refs?ae.refs[0]:ae.ref;ne.focus&&(ne.focus(),z.shouldSelect&&ne.select())}},getFieldState:Se}}function OE(e={}){const t=Z.useRef(),n=Z.useRef(),[r,i]=Z.useState({isDirty:!1,isValidating:!1,isLoading:Yi(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Yi(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...FR(e),formState:r});const o=t.current.control;return o._options=e,Uv({subject:o._subjects.state,next:s=>{vE(s,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),Z.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Z.useEffect(()=>{if(o._proxyFormState.isDirty){const s=o._getDirty();s!==r.isDirty&&o._subjects.state.next({isDirty:s})}},[o,r.isDirty]),Z.useEffect(()=>{e.values&&!Po(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(s=>({...s}))):o._resetDefaultValues()},[e.values,o]),Z.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),Z.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),Z.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=gE(r,o),t.current}var ye={},Zm={exports:{}};(function(e,t){(function(n,r){var i="1.0.38",o="",s="?",a="function",l="undefined",c="object",f="string",d="major",p="model",g="name",m="type",y="vendor",E="version",w="architecture",b="console",_="mobile",P="tablet",R="smarttv",D="wearable",S="embedded",x=500,C="Amazon",I="Apple",N="ASUS",A="BlackBerry",k="Browser",X="Chrome",G="Edge",ee="Firefox",B="Google",W="Huawei",J="LG",se="Microsoft",we="Motorola",Se="Opera",Ie="Samsung",Be="Sharp",ze="Sony",Fe="Xiaomi",Ye="Zebra",M="Facebook",L="Chromium OS",U="Mac OS",F=function(le,he){var ce={};for(var Ne in le)he[Ne]&&he[Ne].length%2===0?ce[Ne]=he[Ne].concat(le[Ne]):ce[Ne]=le[Ne];return ce},ue=function(le){for(var he={},ce=0;ce0?Pe.length===2?typeof Pe[1]==a?this[Pe[0]]=Pe[1].call(this,zt):this[Pe[0]]=Pe[1]:Pe.length===3?typeof Pe[1]===a&&!(Pe[1].exec&&Pe[1].test)?this[Pe[0]]=zt?Pe[1].call(this,zt,Pe[2]):r:this[Pe[0]]=zt?zt.replace(Pe[1],Pe[2]):r:Pe.length===4&&(this[Pe[0]]=zt?Pe[3].call(this,zt.replace(Pe[1],Pe[2])):r):this[Pe]=zt||r;ce+=2}},$=function(le,he){for(var ce in he)if(typeof he[ce]===c&&he[ce].length>0){for(var Ne=0;Ne2&&(Ee[p]="iPad",Ee[m]=P),Ee},this.getEngine=function(){var Ee={};return Ee[g]=r,Ee[E]=r,xe.call(Ee,Ne,lt.engine),Ee},this.getOS=function(){var Ee={};return Ee[g]=r,Ee[E]=r,xe.call(Ee,Ne,lt.os),Pe&&!Ee[g]&&Ce&&Ce.platform&&Ce.platform!="Unknown"&&(Ee[g]=Ce.platform.replace(/chrome os/i,L).replace(/macos/i,U)),Ee},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 Ne},this.setUA=function(Ee){return Ne=typeof Ee===f&&Ee.length>x?Te(Ee,x):Ee,this},this.setUA(Ne),this};ne.VERSION=i,ne.BROWSER=ue([g,E,d]),ne.CPU=ue([w]),ne.DEVICE=ue([p,y,m,b,_,R,P,D,S]),ne.ENGINE=ne.OS=ue([g,E]),e.exports&&(t=e.exports=ne),t.UAParser=ne;var te=typeof n!==l&&(n.jQuery||n.Zepto);if(te&&!te.ua){var pe=new ne;te.ua=pe.getResult(),te.ua.get=function(){return pe.getUA()},te.ua.set=function(le){pe.setUA(le);var he=pe.getResult();for(var ce in he)te.ua[ce]=he[ce]}}})(typeof window=="object"?window:zg)})(Zm,Zm.exports);var UR=Zm.exports;Object.defineProperty(ye,"__esModule",{value:!0});function BR(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var ln=j,ct=BR(ln),TE=UR,go=new TE,fn=go.getBrowser(),zR=go.getCPU(),qn=go.getDevice(),Vv=go.getEngine(),vo=go.getOS(),xu=go.getUA(),kE=function(t){return go.setUA(t)},Eu=function(t){if(!t){console.error("No userAgent string was provided");return}var n=new TE(t);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)}}},IE=Object.freeze({ClientUAInstance:go,browser:fn,cpu:zR,device:qn,engine:Vv,os:vo,ua:xu,setUa:kE,parseUserAgent:Eu});function Eb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function VR(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function fr(e,t){if(e==null)return{};var n=YR(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XR(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tf(e)}function QR(e,t){return JR(e)||ZR(e,t)||eA(e,t)||tA()}function JR(e){if(Array.isArray(e))return e}function ZR(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function eA(e,t){if(e){if(typeof e=="string")return Cb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cb(e,t)}}function Cb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:"none";return t||n},Wv=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},Hv=function(t){var n=Wv();return n&&n.platform&&(n.platform.indexOf(t)!==-1||n.platform==="MacIntel"&&n.maxTouchPoints>1&&!window.MSStream)},oA=function(t,n,r,i,o){return{isBrowser:t,browserMajorVersion:Re(n.major),browserFullVersion:Re(n.version),browserName:Re(n.name),engineName:Re(r.name),engineVersion:Re(r.version),osName:Re(i.name),osVersion:Re(i.version),userAgent:Re(o)}},Ob=function(t,n,r,i){return VR({},t,{vendor:Re(n.vendor),model:Re(n.model),os:Re(r.name),osVersion:Re(r.version),ua:Re(i)})},sA=function(t,n,r,i){return{isSmartTV:t,engineName:Re(n.name),engineVersion:Re(n.version),osName:Re(r.name),osVersion:Re(r.version),userAgent:Re(i)}},aA=function(t,n,r,i){return{isConsole:t,engineName:Re(n.name),engineVersion:Re(n.version),osName:Re(r.name),osVersion:Re(r.version),userAgent:Re(i)}},lA=function(t,n,r,i){return{isWearable:t,engineName:Re(n.name),engineVersion:Re(n.version),osName:Re(r.name),osVersion:Re(r.version),userAgent:Re(i)}},uA=function(t,n,r,i,o){return{isEmbedded:t,vendor:Re(n.vendor),model:Re(n.model),engineName:Re(r.name),engineVersion:Re(r.version),osName:Re(i.name),osVersion:Re(i.version),userAgent:Re(o)}};function cA(e){var t=e?Eu(e):IE,n=t.device,r=t.browser,i=t.engine,o=t.os,s=t.ua,a=rA(n.type),l=a.isBrowser,c=a.isMobile,f=a.isTablet,d=a.isSmartTV,p=a.isConsole,g=a.isWearable,m=a.isEmbedded;if(l)return oA(l,r,i,o,s);if(d)return sA(d,i,o,s);if(p)return aA(p,i,o,s);if(c||f)return Ob(a,n,o,s);if(g)return lA(g,i,o,s);if(m)return uA(m,n,i,o,s)}var PE=function(t){var n=t.type;return n===rn.Mobile},RE=function(t){var n=t.type;return n===rn.Tablet},AE=function(t){var n=t.type;return n===rn.Mobile||n===rn.Tablet},NE=function(t){var n=t.type;return n===rn.SmartTv},Kf=function(t){var n=t.type;return n===rn.Browser},ME=function(t){var n=t.type;return n===rn.Wearable},DE=function(t){var n=t.type;return n===rn.Console},$E=function(t){var n=t.type;return n===rn.Embedded},jE=function(t){var n=t.vendor;return Re(n)},LE=function(t){var n=t.model;return Re(n)},FE=function(t){var n=t.type;return Re(n,"browser")},UE=function(t){var n=t.name;return n===Ca.Android},BE=function(t){var n=t.name;return n===Ca.Windows},zE=function(t){var n=t.name;return n===Ca.MAC_OS},VE=function(t){var n=t.name;return n===Ca.WindowsPhone},WE=function(t){var n=t.name;return n===Ca.IOS},HE=function(t){var n=t.version;return Re(n)},GE=function(t){var n=t.name;return Re(n)},qE=function(t){var n=t.name;return n===Pn.Chrome},KE=function(t){var n=t.name;return n===Pn.Firefox},YE=function(t){var n=t.name;return n===Pn.Chromium},Yf=function(t){var n=t.name;return n===Pn.Edge},XE=function(t){var n=t.name;return n===Pn.Yandex},QE=function(t){var n=t.name;return n===Pn.Safari||n===Pn.MobileSafari},JE=function(t){var n=t.name;return n===Pn.MobileSafari},ZE=function(t){var n=t.name;return n===Pn.Opera},eC=function(t){var n=t.name;return n===Pn.InternetExplorer||n===Pn.Ie},tC=function(t){var n=t.name;return n===Pn.MIUI},nC=function(t){var n=t.name;return n===Pn.SamsungBrowser},rC=function(t){var n=t.version;return Re(n)},iC=function(t){var n=t.major;return Re(n)},oC=function(t){var n=t.name;return Re(n)},sC=function(t){var n=t.name;return Re(n)},aC=function(t){var n=t.version;return Re(n)},lC=function(){var t=Wv(),n=t&&t.userAgent&&t.userAgent.toLowerCase();return typeof n=="string"?/electron/.test(n):!1},zs=function(t){return typeof t=="string"&&t.indexOf("Edg/")!==-1},uC=function(){var t=Wv();return t&&(/iPad|iPhone|iPod/.test(t.platform)||t.platform==="MacIntel"&&t.maxTouchPoints>1)&&!window.MSStream},Gr=function(){return Hv("iPad")},cC=function(){return Hv("iPhone")},fC=function(){return Hv("iPod")},dC=function(t){return Re(t)};function pC(e){var t=e||IE,n=t.device,r=t.browser,i=t.os,o=t.engine,s=t.ua;return{isSmartTV:NE(n),isConsole:DE(n),isWearable:ME(n),isEmbedded:$E(n),isMobileSafari:JE(r)||Gr(),isChromium:YE(r),isMobile:AE(n)||Gr(),isMobileOnly:PE(n),isTablet:RE(n)||Gr(),isBrowser:Kf(n),isDesktop:Kf(n),isAndroid:UE(i),isWinPhone:VE(i),isIOS:WE(i)||Gr(),isChrome:qE(r),isFirefox:KE(r),isSafari:QE(r),isOpera:ZE(r),isIE:eC(r),osVersion:HE(i),osName:GE(i),fullBrowserVersion:rC(r),browserVersion:iC(r),browserName:oC(r),mobileVendor:jE(n),mobileModel:LE(n),engineName:sC(o),engineVersion:aC(o),getUA:dC(s),isEdge:Yf(r)||zs(s),isYandex:XE(r),deviceType:FE(n),isIOS13:uC(),isIPad13:Gr(),isIPhone13:cC(),isIPod13:fC(),isElectron:lC(),isEdgeChromium:zs(s),isLegacyEdge:Yf(r)&&!zs(s),isWindows:BE(i),isMacOs:zE(i),isMIUI:tC(r),isSamsungBrowser:nC(r)}}var hC=NE(qn),mC=DE(qn),gC=ME(qn),fA=$E(qn),dA=JE(fn)||Gr(),pA=YE(fn),zd=AE(qn)||Gr(),vC=PE(qn),yC=RE(qn)||Gr(),bC=Kf(qn),hA=Kf(qn),wC=UE(vo),SC=VE(vo),_C=WE(vo)||Gr(),mA=qE(fn),gA=KE(fn),vA=QE(fn),yA=ZE(fn),xC=eC(fn),bA=HE(vo),wA=GE(vo),SA=rC(fn),_A=iC(fn),xA=oC(fn),EA=jE(qn),CA=LE(qn),OA=sC(Vv),TA=aC(Vv),kA=dC(xu),IA=Yf(fn)||zs(xu),PA=XE(fn),RA=FE(qn),AA=uC(),NA=Gr(),MA=cC(),DA=fC(),$A=lC(),jA=zs(xu),LA=Yf(fn)&&!zs(xu),FA=BE(vo),UA=zE(vo),BA=tC(fn),zA=nC(fn),VA=function(t){if(!t||typeof t!="string"){console.error("No valid user agent string was provided");return}var n=Eu(t),r=n.device,i=n.browser,o=n.os,s=n.engine,a=n.ua;return pC({device:r,browser:i,os:o,engine:s,ua:a})},WA=function(t){var n=t.renderWithFragment,r=t.children,i=fr(t,["renderWithFragment","children"]);return wC?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},HA=function(t){var n=t.renderWithFragment,r=t.children,i=fr(t,["renderWithFragment","children"]);return bC?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},GA=function(t){var n=t.renderWithFragment,r=t.children,i=fr(t,["renderWithFragment","children"]);return xC?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},qA=function(t){var n=t.renderWithFragment,r=t.children,i=fr(t,["renderWithFragment","children"]);return _C?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},KA=function(t){var n=t.renderWithFragment,r=t.children,i=fr(t,["renderWithFragment","children"]);return zd?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},YA=function(t){var n=t.renderWithFragment,r=t.children,i=fr(t,["renderWithFragment","children"]);return yC?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},XA=function(t){var n=t.renderWithFragment,r=t.children,i=fr(t,["renderWithFragment","children"]);return SC?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},QA=function(t){var n=t.renderWithFragment,r=t.children;t.viewClassName,t.style;var i=fr(t,["renderWithFragment","children","viewClassName","style"]);return vC?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},JA=function(t){var n=t.renderWithFragment,r=t.children,i=fr(t,["renderWithFragment","children"]);return hC?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},ZA=function(t){var n=t.renderWithFragment,r=t.children,i=fr(t,["renderWithFragment","children"]);return mC?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},e5=function(t){var n=t.renderWithFragment,r=t.children,i=fr(t,["renderWithFragment","children"]);return gC?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",i,r):null},t5=function(t){var n=t.renderWithFragment,r=t.children;t.viewClassName,t.style;var i=t.condition,o=fr(t,["renderWithFragment","children","viewClassName","style","condition"]);return i?n?ct.createElement(ln.Fragment,null,r):ct.createElement("div",o,r):null};function n5(e){return function(t){KR(n,t);function n(r){var i;return WR(this,n),i=XR(this,tg(n).call(this,r)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(tf(i)),i.onOrientationChange=i.onOrientationChange.bind(tf(i)),i.onPageLoad=i.onPageLoad.bind(tf(i)),i.state={isLandscape:!1,isPortrait:!1},i}return GR(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":Al(window))!==void 0&&zd&&(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 ct.createElement(e,eg({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),n}(ct.Component)}function r5(){var e=ln.useState(function(){var o=window.innerWidth>window.innerHeight?90:0;return{isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"}}),t=QR(e,2),n=t[0],r=t[1],i=ln.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 ln.useEffect(function(){return(typeof window>"u"?"undefined":Al(window))!==void 0&&zd&&(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 EC(e){var t=e||window.navigator.userAgent;return Eu(t)}function i5(e){var t=e||window.navigator.userAgent,n=EC(t),r=pC(n);return[r,n]}ye.AndroidView=WA;ye.BrowserTypes=Pn;ye.BrowserView=HA;ye.ConsoleView=ZA;ye.CustomView=t5;ye.IEView=GA;ye.IOSView=qA;ye.MobileOnlyView=QA;ye.MobileView=KA;ye.OsTypes=Ca;ye.SmartTVView=JA;ye.TabletView=YA;ye.WearableView=e5;ye.WinPhoneView=XA;ye.browserName=xA;ye.browserVersion=_A;ye.deviceDetect=cA;ye.deviceType=RA;ye.engineName=OA;ye.engineVersion=TA;ye.fullBrowserVersion=SA;ye.getSelectorsByUserAgent=VA;ye.getUA=kA;ye.isAndroid=wC;ye.isBrowser=bC;ye.isChrome=mA;ye.isChromium=pA;ye.isConsole=mC;var o5=ye.isDesktop=hA;ye.isEdge=IA;ye.isEdgeChromium=jA;ye.isElectron=$A;ye.isEmbedded=fA;ye.isFirefox=gA;ye.isIE=xC;ye.isIOS=_C;ye.isIOS13=AA;ye.isIPad13=NA;ye.isIPhone13=MA;ye.isIPod13=DA;ye.isLegacyEdge=LA;ye.isMIUI=BA;ye.isMacOs=UA;ye.isMobile=zd;ye.isMobileOnly=vC;ye.isMobileSafari=dA;ye.isOpera=yA;ye.isSafari=vA;ye.isSamsungBrowser=zA;ye.isSmartTV=hC;ye.isTablet=yC;ye.isWearable=gC;ye.isWinPhone=SC;ye.isWindows=FA;ye.isYandex=PA;ye.mobileModel=CA;ye.mobileVendor=EA;ye.osName=wA;ye.osVersion=bA;ye.parseUserAgent=Eu;ye.setUserAgent=iA;ye.useDeviceData=EC;ye.useDeviceSelectors=i5;ye.useMobileOrientation=r5;ye.withOrientationChange=n5;var Wt=[];for(var Dh=0;Dh<256;++Dh)Wt.push((Dh+256).toString(16).slice(1));function s5(e,t=0){return(Wt[e[t+0]]+Wt[e[t+1]]+Wt[e[t+2]]+Wt[e[t+3]]+"-"+Wt[e[t+4]]+Wt[e[t+5]]+"-"+Wt[e[t+6]]+Wt[e[t+7]]+"-"+Wt[e[t+8]]+Wt[e[t+9]]+"-"+Wt[e[t+10]]+Wt[e[t+11]]+Wt[e[t+12]]+Wt[e[t+13]]+Wt[e[t+14]]+Wt[e[t+15]]).toLowerCase()}var Cc,a5=new Uint8Array(16);function l5(){if(!Cc&&(Cc=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Cc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cc(a5)}var u5=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Tb={randomUUID:u5};function c5(e,t,n){if(Tb.randomUUID&&!t&&!e)return Tb.randomUUID();e=e||{};var r=e.random||(e.rng||l5)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,s5(r)}var Ed,CC;const h0=class h0{constructor(t={}){o1(this,Ed);if(typeof t=="string")try{t=JSON.parse(t)}catch(n){console.error("Invalid JSON string provided:",n),t={}}else t instanceof h0?Object.assign(this,t):(this.transactionId=t.transaction_id||s1(this,Ed,CC).call(this),this.createdAt=t.created_at||null,this.amount=t.amount||null,this.vendor=t.vendor||null,this.category_id=t.category_id||null,this.category_name=t.category_name||null,this.pictureId=t.pictureId||null,this.isSuccessful=t.isSuccessful||null)}isEmpty(){return this.vendor===null&&this.amount===null&&this.createdAt===null&&this.category_id===null&&this.category_name===null}isNotComplete(){return this.vendor===null||this.amount===null||this.createdAt===null||this.category_id===null||this.category_name===null}serialize(){return{transactionId:this.transactionId,transaction_id:this.transactionId,created_at:this.createdAt,amount:this.amount,vendor:this.vendor,category_id:this.category_id,category_name:this.category_name,pictureId:this.pictureId,isSuccessful:this.isSuccessful}}toString(){return JSON.stringify(this.serialize())}};Ed=new WeakSet,CC=function(){return c5()};let En=h0,rg=class{constructor(t){t instanceof En?(this.vendor=t.vendor,this.amount=t.amount,this.category_name=t.category_name,this.created_at=t.created_at):(this.vendor="",this.created_at="",this.amount="",this.category_name="")}returnNonEmptyValues(){return Object.entries(this).filter((t,n)=>t[n]!==null&&t[n]!==void 0)}};class ra{constructor(t){t instanceof Object?(this.category_id=t.category_id,this.category_name=t.category_name):t instanceof ra?Object.assign(this,t):(this.category_name=t,this.category_id="")}serialize(){return{category_id:this.category_id,category_name:this.category_name}}toString(){return JSON.stringify(this.serialize())}}var kb={VITE_KEY_FOR_FIREBASE_CONFIG:'{"apiKey": "AIzaSyCgzs_JIlAI5CE5EAOO8eQVJbqSI9YHNC4","authDomain": "simplitracapp.firebaseapp.com","databaseURL": "https://simplitracapp-default-rtdb.firebaseio.com","projectId": "simplitracapp","storageBucket": "simplitracapp.appspot.com","messagingSenderId": "242165323563","appId": "1:242165323563:web:5891ef2a45c8cf0183576e","measurementId": "G-3HSNQSS692"}',VITE_PROD_CREATE_USER_ENDPOINT:"https://us-central1-simplitracapp.cloudfunctions.net/create_new_user",VITE_DEV_CREATE_USER_ENDPOINT:"http://127.0.0.1:5001/simplitracapp/us-central1/create_new_user",VITE_PROD_GET_USER_ENDPOINT:"https://us-central1-simplitracapp.cloudfunctions.net/get_existing_user",VITE_DEV_GET_USER_ENDPOINT:"http://127.0.0.1:5001/simplitracapp/us-central1/get_existing_user",VITE_PROD_UPDATE_USER_ENDPOINT:"https://us-central1-simplitracapp.cloudfunctions.net/update_user",VITE_DEV_UPDATE_USER_ENDPOINT:"http://127.0.0.1:5001/simplitracapp/us-central1/update_user",VITE_PROD_OCR_ENDPOINT:"https://us-central1-simplitracapp.cloudfunctions.net/process_receipt",VITE_DEV_OCR_ENDPOINT:"http://127.0.0.1:5001/simplitracapp/us-central1/process_receipt",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let mn=class Di{constructor(t={}){var n,r,i,o;t instanceof Di?Object.assign(this,t):(this.user_id=(t==null?void 0:t.uid)??(t==null?void 0:t.user_id),this.access_token=t==null?void 0:t.accessToken,this.email=t==null?void 0:t.email,t!=null&&t.displayName?(this.first_name=t==null?void 0:t.displayName.split(" ")[0],this.last_name=t==null?void 0:t.displayName.split(" ").slice(1).join(" ")):(this.first_name=t==null?void 0:t.first_name,this.last_name=t==null?void 0:t.last_name),this.created_at=((n=t==null?void 0:t.metadata)==null?void 0:n.createdAt)||new Date().getTime(),this.last_login=((r=t==null?void 0:t.metadata)==null?void 0:r.lastLoginAt)||new Date().getTime(),this.admin=null,this.transactions=((i=t==null?void 0:t.transactions)==null?void 0:i.map(s=>new En(s)))||[],this.categories=((o=t==null?void 0:t.categories)==null?void 0:o.map(s=>new ra(s)))||[])}getCreatedAtString(){return new Date(this.created_at).toString()}getLastLoginString(){return new Date(this.last_login).toString()}isNewUser(){var t,n;return((t=this.categories)==null?void 0:t.length)===0||((n=this.categories)==null?void 0:n.length)===void 0}serialize(){return{user_id:this.user_id,access_token:this.access_token,email:this.email,first_name:this.first_name,last_name:this.last_name,created_at:this.created_at,last_login:this.last_login,admin:this.admin,transactions:this.transactions.map(t=>t.serialize()),categories:this.categories.map(t=>t.serialize())}}addCategory(t){this.categories.push(new ra(t))}toString(){return JSON.stringify(this.serialize())}addTransaction(t){t instanceof En?this.transactions.push(t):console.error("Invalid transaction provided:",t)}returnCategoryList(){return[...new Set(["Select category",...this.categories.map(t=>Ib(t.category_name))])]}returnVendorList(){return[...new Set(["Select vendor",...this.transactions.map(t=>Ib(t.vendor))])]}async updateFirebase(){const t={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(this.serialize())},n=`https://us-central1-simplitracapp.cloudfunctions.net/update_user/?user_id=${this.user_id}`,r=await fetch(n,t);let i;return i=await r.text(),new Di(JSON.parse(i))}async deleteTransactions(){const t={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(this.serialize())},n=`${kb.VITE_PROD_DELETE_TRANSACTIONS_ENDPOINT}/?user_id=${this.user_id}`,r=await fetch(n,t);let i;return i=await r.text(),new Di(JSON.parse(i))}async deleteCategory(t){try{const n=await fetch(`${kb.VITE_PROD_DELETE_CATEGORY_ENDPOINT}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:this.user_id,categoryId:t})});if(!n.ok)throw new Error("Failed to delete category");const r=await n.json();return new Di(r)}catch(n){return console.error("Error deleting category:",n),null}}static async getUserFromFirestore(t){const n={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}},r=`https://us-central1-simplitracapp.cloudfunctions.net/get_existing_user?user_id=${t}`;try{const o=await(await fetch(r,n)).json();return o instanceof Object?new Di(o):new Di}catch(i){return console.log(i),new Di}}};function Ib(e){if(!e)return;const t=e.toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}const dr=j.createContext({}),f5=({children:e})=>{const t=()=>o5?"desktop":"mobile",[n,r]=j.useState(),[i,o]=j.useState(new mn(JSON.parse(localStorage.getItem("user")))),[s,a]=j.useState(!0),[l,c]=j.useState(!1),[f,d]=j.useState(null),[p,g]=j.useState(new En),[m,y]=j.useState(t()),[E,w]=j.useState(),[b,_]=j.useState(!1),[P,R]=j.useState(new rg),[D,S]=j.useState(!1),x=async()=>{const N="http://127.0.0.1:5001/simplitracapp/us-central1/get_existing_user";try{const A=await fetch(N);if(!A.ok)throw new Error("Network response issue exists");const k=await A.json();o(k)}catch(A){console.error("Error fetching user data:",A)}},C=()=>{r("login"),o({first_name:"",last_name:"",categories:[]}),a(!0),c(!1),d(null),g(new En),y(t()),w(),_(!1),R(new rg),S(!1)};j.useEffect(()=>{x()},[]);const I={screen:n,setScreen:r,user:i,setUser:o,modalIsOpen:s,setModalIsOpen:a,show:l,setShow:c,capturedPhoto:f,setCapturedPhoto:d,ocrData:p,setOcrData:g,device:m,setDevice:y,serverResponse:E,setServerResponse:w,ocrModalOpen:b,setOcrModalOpen:_,fetchUserData:x,formData:P,setFormData:R,resetAppState:C,isUpdating:D,setIsUpdating:S};return O.jsx(dr.Provider,{value:I,children:e})};var Cn=function(){return Cn=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0?Lt(Oa,--ur):0,oa--,It===10&&(oa=1,Wd--),It}function Ir(){return It=ur2||og(It)>3?"":" "}function S5(e,t){for(;--t&&Ir()&&!(It<48||It>102||It>57&&It<65||It>70&&It<97););return Gd(e,rf()+(t<6&&Lo()==32&&Ir()==32))}function sg(e){for(;Ir();)switch(It){case e:return ur;case 34:case 39:e!==34&&e!==39&&sg(It);break;case 40:e===41&&sg(e);break;case 92:Ir();break}return ur}function _5(e,t){for(;Ir()&&e+It!==57;)if(e+It===84&&Lo()===47)break;return"/*"+Gd(t,ur-1)+"*"+qv(e===47?e:Ir())}function x5(e){for(;!og(Lo());)Ir();return Gd(e,ur)}function E5(e){return b5(of("",null,null,null,[""],e=y5(e),0,[0],e))}function of(e,t,n,r,i,o,s,a,l){for(var c=0,f=0,d=s,p=0,g=0,m=0,y=1,E=1,w=1,b=0,_="",P=i,R=o,D=r,S=_;E;)switch(m=b,b=Ir()){case 40:if(m!=108&&Lt(S,d-1)==58){nf(S+=je($h(b),"&","&\f"),"&\f",kC(c?a[c-1]:0))!=-1&&(w=-1);break}case 34:case 39:case 91:S+=$h(b);break;case 9:case 10:case 13:case 32:S+=w5(m);break;case 92:S+=S5(rf()-1,7);continue;case 47:switch(Lo()){case 42:case 47:bl(C5(_5(Ir(),rf()),t,n,l),l);break;default:S+="/"}break;case 123*y:a[c++]=Ur(S)*w;case 125*y:case 59:case 0:switch(b){case 0:case 125:E=0;case 59+f:w==-1&&(S=je(S,/\f/g,"")),g>0&&Ur(S)-d&&bl(g>32?Ab(S+";",r,n,d-1,l):Ab(je(S," ","")+";",r,n,d-2,l),l);break;case 59:S+=";";default:if(bl(D=Rb(S,t,n,c,f,i,a,_,P=[],R=[],d,o),o),b===123)if(f===0)of(S,t,D,D,P,o,d,a,R);else switch(p===99&&Lt(S,3)===110?100:p){case 100:case 108:case 109:case 115:of(e,D,D,r&&bl(Rb(e,D,D,0,0,i,a,_,i,P=[],d,R),R),i,R,d,a,r?P:R);break;default:of(S,D,D,D,[""],R,0,a,R)}}c=f=g=0,y=w=1,_=S="",d=s;break;case 58:d=1+Ur(S),g=m;default:if(y<1){if(b==123)--y;else if(b==125&&y++==0&&v5()==125)continue}switch(S+=qv(b),b*y){case 38:w=f>0?1:(S+="\f",-1);break;case 44:a[c++]=(Ur(S)-1)*w,w=1;break;case 64:Lo()===45&&(S+=$h(Ir())),p=Lo(),f=d=Ur(_=S+=x5(rf())),b++;break;case 45:m===45&&Ur(S)==2&&(y=0)}}return o}function Rb(e,t,n,r,i,o,s,a,l,c,f,d){for(var p=i-1,g=i===0?o:[""],m=PC(g),y=0,E=0,w=0;y0?g[b]+" "+_:je(_,/&\f/g,g[b])))&&(l[w++]=P);return Hd(e,t,n,i===0?Vd:a,l,c,f,d)}function C5(e,t,n,r){return Hd(e,t,n,OC,qv(g5()),ia(e,2,-2),0,r)}function Ab(e,t,n,r,i){return Hd(e,t,n,Gv,ia(e,0,r),ia(e,r+1,-1),r,i)}function AC(e,t,n){switch(h5(e,t)){case 5103:return Je+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Je+e+e;case 4789:return Nl+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Je+e+Nl+e+pt+e+e;case 5936:switch(Lt(e,t+11)){case 114:return Je+e+pt+je(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Je+e+pt+je(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Je+e+pt+je(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Je+e+pt+e+e;case 6165:return Je+e+pt+"flex-"+e+e;case 5187:return Je+e+je(e,/(\w+).+(:[^]+)/,Je+"box-$1$2"+pt+"flex-$1$2")+e;case 5443:return Je+e+pt+"flex-item-"+je(e,/flex-|-self/g,"")+(ci(e,/flex-|baseline/)?"":pt+"grid-row-"+je(e,/flex-|-self/g,""))+e;case 4675:return Je+e+pt+"flex-line-pack"+je(e,/align-content|flex-|-self/g,"")+e;case 5548:return Je+e+pt+je(e,"shrink","negative")+e;case 5292:return Je+e+pt+je(e,"basis","preferred-size")+e;case 6060:return Je+"box-"+je(e,"-grow","")+Je+e+pt+je(e,"grow","positive")+e;case 4554:return Je+je(e,/([^-])(transform)/g,"$1"+Je+"$2")+e;case 6187:return je(je(je(e,/(zoom-|grab)/,Je+"$1"),/(image-set)/,Je+"$1"),e,"")+e;case 5495:case 3959:return je(e,/(image-set\([^]*)/,Je+"$1$`$1");case 4968:return je(je(e,/(.+:)(flex-)?(.*)/,Je+"box-pack:$3"+pt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Je+e+e;case 4200:if(!ci(e,/flex-|baseline/))return pt+"grid-column-align"+ia(e,t)+e;break;case 2592:case 3360:return pt+je(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,ci(r.props,/grid-\w+-end/)})?~nf(e+(n=n[t].value),"span",0)?e:pt+je(e,"-start","")+e+pt+"grid-row-span:"+(~nf(n,"span",0)?ci(n,/\d+/):+ci(n,/\d+/)-+ci(e,/\d+/))+";":pt+je(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return ci(r.props,/grid-\w+-start/)})?e:pt+je(je(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return je(e,/(.+)-inline(.+)/,Je+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ur(e)-1-t>6)switch(Lt(e,t+1)){case 109:if(Lt(e,t+4)!==45)break;case 102:return je(e,/(.+:)(.+)-([^]+)/,"$1"+Je+"$2-$3$1"+Nl+(Lt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~nf(e,"stretch",0)?AC(je(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return je(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,s,a,l,c){return pt+i+":"+o+c+(s?pt+i+"-span:"+(a?l:+l-+o)+c:"")+e});case 4949:if(Lt(e,t+6)===121)return je(e,":",":"+Je)+e;break;case 6444:switch(Lt(e,Lt(e,14)===45?18:11)){case 120:return je(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Je+(Lt(e,14)===45?"inline-":"")+"box$3$1"+Je+"$2$3$1"+pt+"$2box$3")+e;case 100:return je(e,":",":"+pt)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return je(e,"scroll-","scroll-snap-")+e}return e}function Qf(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case Gv:e.return=AC(e.value,e.length,n);return;case TC:return Qf([$i(e,{value:je(e.value,"@","@"+Je)})],r);case Vd:if(e.length)return m5(n=e.props,function(i){switch(ci(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":fs($i(e,{props:[je(i,/:(read-\w+)/,":"+Nl+"$1")]})),fs($i(e,{props:[i]})),ig(e,{props:Pb(n,r)});break;case"::placeholder":fs($i(e,{props:[je(i,/:(plac\w+)/,":"+Je+"input-$1")]})),fs($i(e,{props:[je(i,/:(plac\w+)/,":"+Nl+"$1")]})),fs($i(e,{props:[je(i,/:(plac\w+)/,pt+"input-$1")]})),fs($i(e,{props:[i]})),ig(e,{props:Pb(n,r)});break}return""})}}var P5={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Dn={},sa=typeof process<"u"&&Dn!==void 0&&(Dn.REACT_APP_SC_ATTR||Dn.SC_ATTR)||"data-styled",NC="active",MC="data-styled-version",qd="6.1.12",Kv=`/*!sc*/ +`,Jf=typeof window<"u"&&"HTMLElement"in window,R5=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Dn!==void 0&&Dn.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Dn.REACT_APP_SC_DISABLE_SPEEDY!==""?Dn.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Dn.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Dn!==void 0&&Dn.SC_DISABLE_SPEEDY!==void 0&&Dn.SC_DISABLE_SPEEDY!==""&&Dn.SC_DISABLE_SPEEDY!=="false"&&Dn.SC_DISABLE_SPEEDY),Kd=Object.freeze([]),aa=Object.freeze({});function A5(e,t,n){return n===void 0&&(n=aa),e.theme!==n.theme&&e.theme||t||n.theme}var DC=new Set(["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","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","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),N5=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,M5=/(^-|-$)/g;function Nb(e){return e.replace(N5,"-").replace(M5,"")}var D5=/(a)(d)/gi,Oc=52,Mb=function(e){return String.fromCharCode(e+(e>25?39:97))};function ag(e){var t,n="";for(t=Math.abs(e);t>Oc;t=t/Oc|0)n=Mb(t%Oc)+n;return(Mb(t%Oc)+n).replace(D5,"$1-$2")}var jh,$C=5381,Ns=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},jC=function(e){return Ns($C,e)};function $5(e){return ag(jC(e)>>>0)}function j5(e){return e.displayName||e.name||"Component"}function Lh(e){return typeof e=="string"&&!0}var LC=typeof Symbol=="function"&&Symbol.for,FC=LC?Symbol.for("react.memo"):60115,L5=LC?Symbol.for("react.forward_ref"):60112,F5={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},U5={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},UC={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},B5=((jh={})[L5]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},jh[FC]=UC,jh);function Db(e){return("type"in(t=e)&&t.type.$$typeof)===FC?UC:"$$typeof"in e?B5[e.$$typeof]:F5;var t}var z5=Object.defineProperty,V5=Object.getOwnPropertyNames,$b=Object.getOwnPropertySymbols,W5=Object.getOwnPropertyDescriptor,H5=Object.getPrototypeOf,jb=Object.prototype;function BC(e,t,n){if(typeof t!="string"){if(jb){var r=H5(t);r&&r!==jb&&BC(e,r,n)}var i=V5(t);$b&&(i=i.concat($b(t)));for(var o=Db(e),s=Db(t),a=0;a0?" Args: ".concat(t.join(", ")):""))}var G5=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw Cu(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var s=i;s=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,s=i;s=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(E+="".concat(w,","))}),l+="".concat(m).concat(y,'{content:"').concat(E,'"}').concat(Kv)},f=0;f0?".".concat(t):p},f=l.slice();f.push(function(p){p.type===Vd&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(r4,n).replace(r,c))}),s.prefix&&f.push(I5),f.push(O5);var d=function(p,g,m,y){g===void 0&&(g=""),m===void 0&&(m=""),y===void 0&&(y="&"),t=y,n=g,r=new RegExp("\\".concat(n,"\\b"),"g");var E=p.replace(i4,""),w=E5(m||g?"".concat(m," ").concat(g," { ").concat(E," }"):E);s.namespace&&(w=WC(w,s.namespace));var b=[];return Qf(w,T5(f.concat(k5(function(_){return b.push(_)})))),b};return d.hash=l.length?l.reduce(function(p,g){return g.name||Cu(15),Ns(p,g.name)},$C).toString():"",d}var s4=new VC,ug=o4(),HC=Z.createContext({shouldForwardProp:void 0,styleSheet:s4,stylis:ug});HC.Consumer;Z.createContext(void 0);function Bb(){return j.useContext(HC)}var a4=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=ug);var s=r.name+o.hash;i.hasNameForId(r.id,s)||i.insertRules(r.id,s,o(r.rules,s,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,Xv(this,function(){throw Cu(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=ug),this.name+t.hash},e}(),l4=function(e){return e>="A"&&e<="Z"};function zb(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,s)){var a=r(o,".".concat(s),void 0,this.componentId);n.insertRules(this.componentId,s,a)}i=Ro(i,s),this.staticRulesId=s}else{for(var l=Ns(this.baseHash,r.hash),c="",f=0;f>>0);n.hasNameForId(this.componentId,g)||n.insertRules(this.componentId,g,r(c,".".concat(g),void 0,this.componentId)),i=Ro(i,g)}}return i},e}(),KC=Z.createContext(void 0);KC.Consumer;var Fh={};function d4(e,t,n){var r=Yv(e),i=e,o=!Lh(e),s=t.attrs,a=s===void 0?Kd:s,l=t.componentId,c=l===void 0?function(P,R){var D=typeof P!="string"?"sc":Nb(P);Fh[D]=(Fh[D]||0)+1;var S="".concat(D,"-").concat($5(qd+D+Fh[D]));return R?"".concat(R,"-").concat(S):S}(t.displayName,t.parentComponentId):l,f=t.displayName,d=f===void 0?function(P){return Lh(P)?"styled.".concat(P):"Styled(".concat(j5(P),")")}(e):f,p=t.displayName&&t.componentId?"".concat(Nb(t.displayName),"-").concat(t.componentId):t.componentId||c,g=r&&i.attrs?i.attrs.concat(a).filter(Boolean):a,m=t.shouldForwardProp;if(r&&i.shouldForwardProp){var y=i.shouldForwardProp;if(t.shouldForwardProp){var E=t.shouldForwardProp;m=function(P,R){return y(P,R)&&E(P,R)}}else m=y}var w=new f4(n,p,r?i.componentStyle:void 0);function b(P,R){return function(D,S,x){var C=D.attrs,I=D.componentStyle,N=D.defaultProps,A=D.foldedComponentIds,k=D.styledComponentId,X=D.target,G=Z.useContext(KC),ee=Bb(),B=D.shouldForwardProp||ee.shouldForwardProp,W=A5(S,G,N)||aa,J=function(ze,Fe,Ye){for(var M,L=Cn(Cn({},Fe),{className:void 0,theme:Ye}),U=0;UO.jsx(h4,{children:O.jsxs("div",{children:[O.jsx(g4,{}),O.jsx(m4,{children:e})]})}),v4=()=>{const{user:e,formData:t,setFormData:n,setUser:r,ocrData:i,setOcrData:o,setServerResponse:s,isUpdating:a,setIsUpdating:l}=j.useContext(dr),[c,f]=j.useState([]),[d,p]=j.useState([]),[g,m]=j.useState(""),[y,E]=j.useState("");j.useState("");const w=j.useRef(""),b=j.useRef(""),{control:_,handleSubmit:P,setValue:R,watch:D,reset:S,formState:{errors:x}}=OE({defaultValues:{vendor:"Select Vendor",category:"Select Category",date:new Date().toISOString().split("T")[0],amount:""}}),C=G=>{if(!G)return;const ee=G.toLowerCase();return ee.charAt(0).toUpperCase()+ee.slice(1)},I=()=>{if(e.transactions.length!==0){const G=new Set(["Select vendor",...e.returnVendorList()]);f([...G])}else f(["Select Vendor"])},N=()=>{if(e.categories.length!==0){const G=new Set(["Select Category",...e.categories.map(ee=>C(ee.category_name))]);p([...G])}else p(["Select Category"])},A=G=>{const ee=G.target.value,B=new En(i);B.vendor=ee,o(B),f(W=>[...new Set([...W,ee])]),m(""),R("vendor",ee)},k=G=>{if(G.target.value!==""){const ee=G.target.value,B=new En(i);B.category_name=ee,o(B),p(W=>[...new Set([...W,ee])]),E(""),R("category",ee)}};j.useEffect(()=>{if(i.isEmpty()&&(I(),N()),!t)return;const G=t.returnNonEmptyValues();let ee,B=!0;if(G.length){for(const W of G){const J=W[0],se=W[1];switch(J){case"vendor":f([...e.returnVendorList(),se]),w.current=C(se),R(J,se),ee=!1;break;case"category":e.addCategory(se),p([...e.returnCategoryList()]),b.current=C(se),R(J,se),B=!1;break;default:R(J,se);break}}n(),ee&&I(),B&&N()}},[w.current,b.current,e,t]);const X=async G=>{if(l(!0),Object.keys(x).length>0){alert("Please fill in all the inputs properly");return}const ee=new mn(e),B=new En(i);B.createdAt=G.date,B.vendor=G.vendor,B.amount=G.amount,B.category_name=G.category,ee.transactions.push(B),ee.addCategory(G.category);const W=await e.updateFirebase();W instanceof mn&&(s("User Successfully Updated"),r(W),S({vendor:"Select Vendor",category:"Select Category",date:new Date().toISOString().split("T")[0],amount:""}),o(new En)),l(!1)};return O.jsxs("form",{onSubmit:P(X),children:[a&&O.jsx(Qv,{})," ",O.jsxs("div",{children:[O.jsx("label",{children:"Date"}),O.jsx(Ki,{name:"date",control:_,render:({field:G})=>O.jsx("input",{type:"date",...G})})]}),O.jsxs("div",{children:[O.jsx("label",{children:"Vendor"}),O.jsx(Ki,{name:"vendor",control:_,rules:{required:"Please select a vendor",validate:G=>G==="Select vendor"||G===""||G==="Other(specify below)"?"Please select a vendor":!0},render:({field:G})=>O.jsxs("div",{children:[O.jsxs("select",{...G,onChange:ee=>{const B=ee.target.value;B==="other"?G.onChange(""):G.onChange(B)},children:[c.map(ee=>O.jsx("option",{value:ee,children:ee},ee)),O.jsx("option",{value:"other",children:"Other (specify below)"})]}),(G.value===""||G.value==="Select vendor"||G.value==="Other(specify below)")&&O.jsxs(O.Fragment,{children:[O.jsx("input",{id:"vendor",type:"text",value:g,onChange:ee=>{m(ee.target.value)},onBlur:ee=>{A(ee),G.onBlur()}}),x.vendor&&O.jsx("span",{role:"alert",style:{color:"red"},children:x.vendor.message})]})]})})]}),O.jsxs("div",{children:[O.jsx("label",{htmlFor:"amount",children:"Amount"}),O.jsx(Ki,{name:"amount",control:_,rules:{required:"Please enter a valid input (0-9 or . or -)",validate:G=>{const ee=/^-?\d*(\.\d*)?$/,B=G.replace(/(?!^-)[^\d.]/g,"").replace(/^([^.]*\.)|\./g,"$1");return ee.test(B)?!0:"Please enter a valid input (0-9 or . or -)"}},render:({field:{onChange:G,value:ee,...B},fieldState:{error:W}})=>O.jsxs(O.Fragment,{children:[O.jsx("input",{...B,value:ee,onChange:J=>{const se=J.target.value.replace(/(?!^-)[^\d.]/g,"").replace(/^([^.]*\.)|\./g,"$1");G(se)}}),W&&O.jsx("span",{role:"alert",style:{color:"red"},children:W.message})]})})]}),O.jsxs("div",{children:[O.jsx("label",{children:"Category"}),O.jsx(Ki,{name:"category",control:_,rules:{required:"Please select a category",validate:G=>G==="Select category"||G===""||G==="Other (specify below)"||G==="Select Category"?"Please select a category":!0},render:({field:G})=>O.jsxs("div",{children:[O.jsxs("select",{...G,onChange:ee=>{const B=ee.target.value;B==="other"?G.onChange(""):G.onChange(B)},children:[d.map(ee=>O.jsx("option",{value:ee,children:ee},ee)),O.jsx("option",{value:"other",children:"Other (specify below)"})]}),(G.value===""||G.value==="Select category"||G.value==="Select Category"||G.value==="Other (specify below)")&&O.jsxs(O.Fragment,{children:[O.jsx("input",{id:"category",type:"text",value:y,onChange:ee=>{E(ee.target.value)},onBlur:k}),x.category&&O.jsx("span",{role:"alert",style:{color:"red"},children:x.category.message})]})]})})]}),O.jsx("button",{type:"submit",children:"Submit"})]})},Jv=()=>{const{setScreen:e}=j.useContext(dr),t=()=>{e("landing")};return O.jsx("button",{onClick:t,children:"Back"})};var XC={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",s=0;s=0)continue;n[r]=e[r]}return n}function fg(e,t){return fg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},fg(e,t)}function b4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,fg(e,t)}function QC(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function JC(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r??null}this.setState(t.bind(this))}function ZC(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}QC.__suppressDeprecationWarning=!0;JC.__suppressDeprecationWarning=!0;ZC.__suppressDeprecationWarning=!0;function w4(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,i=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?i="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(i="UNSAFE_componentWillUpdate"),n!==null||r!==null||i!==null){var o=e.displayName||e.name,s=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. + +`+o+" uses "+s+" but also contains the following legacy lifecycles:"+(n!==null?` + `+n:"")+(r!==null?` + `+r:"")+(i!==null?` + `+i:"")+` + +The above lifecycles should be removed. Learn more about this warning here: +https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=QC,t.componentWillReceiveProps=JC),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=ZC;var a=t.componentDidUpdate;t.componentDidUpdate=function(c,f,d){var p=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:d;a.call(this,c,f,p)}}return e}const S4=Object.freeze(Object.defineProperty({__proto__:null,polyfill:w4},Symbol.toStringTag,{value:"Module"})),_4=["xxl","xl","lg","md","sm","xs"],x4="xs",Zv=j.createContext({prefixes:{},breakpoints:_4,minBreakpoint:x4});function Xd(e,t){const{prefixes:n}=j.useContext(Zv);return e||n[t]||t}function eO(){const{breakpoints:e}=j.useContext(Zv);return e}function tO(){const{minBreakpoint:e}=j.useContext(Zv);return e}var nO={exports:{}},E4="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",C4=E4,O4=C4;function rO(){}function iO(){}iO.resetWarningCache=rO;var T4=function(){function e(r,i,o,s,a,l){if(l!==O4){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:iO,resetWarningCache:rO};return n.PropTypes=n,n};nO.exports=T4();var ey=nO.exports;const re=ti(ey),Hb=Z.createContext(null);function k4({as:e,bsPrefix:t,className:n,...r}){t=Xd(t,"col");const i=eO(),o=tO(),s=[],a=[];return i.forEach(l=>{const c=r[l];delete r[l];let f,d,p;typeof c=="object"&&c!=null?{span:f,offset:d,order:p}=c:f=c;const g=l!==o?`-${l}`:"";f&&s.push(f===!0?`${t}${g}`:`${t}${g}-${f}`),p!=null&&a.push(`order${g}-${p}`),d!=null&&a.push(`offset${g}-${d}`)}),[{...r,className:Ou(n,...s,...a)},{as:e,bsPrefix:t,spans:s}]}const Qd=j.forwardRef((e,t)=>{const[{className:n,...r},{as:i="div",bsPrefix:o,spans:s}]=k4(e);return O.jsx(i,{...r,ref:t,className:Ou(n,!s.length&&o)})});Qd.displayName="Col";const Jd=j.forwardRef(({bsPrefix:e,fluid:t=!1,as:n="div",className:r,...i},o)=>{const s=Xd(e,"container"),a=typeof t=="string"?`-${t}`:"-fluid";return O.jsx(n,{ref:o,...i,className:Ou(r,t?`${s}${a}`:s)})});Jd.displayName="Container";var I4=function(){},P4=I4;re.string,re.bool,re.bool,re.bool,re.bool;const Zd=j.forwardRef(({bsPrefix:e,className:t,fluid:n=!1,rounded:r=!1,roundedCircle:i=!1,thumbnail:o=!1,...s},a)=>(e=Xd(e,"img"),O.jsx("img",{ref:a,...s,className:Ou(t,n&&`${e}-fluid`,r&&"rounded",i&&"rounded-circle",o&&`${e}-thumbnail`)})));Zd.displayName="Image";const ty=j.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},i)=>{const o=Xd(e,"row"),s=eO(),a=tO(),l=`${o}-cols`,c=[];return s.forEach(f=>{const d=r[f];delete r[f];let p;d!=null&&typeof d=="object"?{cols:p}=d:p=d;const g=f!==a?`-${f}`:"";p!=null&&c.push(`${l}${g}-${p}`)}),O.jsx(n,{ref:i,...r,className:Ou(t,o,...c)})});ty.displayName="Row";const R4=()=>{const{capturedPhoto:e,setCapturedPhoto:t,screen:n,setScreen:r,ocrData:i,setOcrData:o,device:s,setOcrModalOpen:a,isUpdating:l,setIsUpdating:c}=j.useContext(dr),[f,d]=j.useState(null),[p,g]=j.useState(null),m=j.useRef(null),y=j.useRef(null),E=j.useRef(null);j.useEffect(()=>{!e&&s==="mobile"&&E.current.click(),s==="desktop"&&!e&&(async()=>{var R;(R=m.current)!=null&&R.srcObject||await b()})()},[e,m,f]);const w=()=>{if(m.current&&y.current){y.current.getContext("2d").drawImage(m.current,0,0,y.current.width,y.current.height);const D=y.current.toDataURL("image/png");t(D),p.getTracks().forEach(S=>{S.stop()}),g(null),console.log("Camera light turned off")}},b=async()=>{t(null);try{let R;s==="desktop"&&(R=await navigator.mediaDevices.getUserMedia({video:!0})),g(R),m.current&&(m.current.srcObject=R,m.current.play(),d(!0))}catch(R){console.error("Error accessing camera:",R),d(!1)}},_=R=>{c(!0);const D=R.target.files[0];if(D){const S=new FileReader;S.onload=x=>{t(x.target.result),s==="mobile"&&P().then(()=>{t(null),c(!1)})},S.readAsDataURL(D)}},P=async()=>{try{c(!0);const R="https://us-central1-simplitracapp.cloudfunctions.net/process_receipt",S={method:"POST",body:N4(e)},x=await fetch(R,S);if(c(!1),!x.ok)throw new Error("Network response was not ok");const C=await x.json();if(C.error)console.error("Error from OCR service:",C.message),alert(C.message);else{const I=new En(C);o(I),r("landing"),t(!1),a(!0)}}catch(R){console.error("Error submitting photo:",R),alert("Text is unreadable, please take the photo again.")}};return O.jsxs("div",{style:ai.container,children:[l&&O.jsx(Qv,{})," ",s==="mobile"&&!e&&O.jsx("div",{children:O.jsx("input",{type:"file",accept:"image/*",capture:"environment",ref:E,onChange:_,style:ai.fileInput})}),s==="desktop"&&!e&&O.jsxs("div",{children:[O.jsx("video",{ref:m,style:ai.video}),O.jsx("button",{className:"custom-button",onClick:w,style:ai.button,children:"Capture Photo"})]}),e&&s!=="mobile"&&O.jsxs("div",{children:[O.jsxs("div",{style:ai.imageContainer,children:[O.jsx("p",{children:"Captured Photo:"}),O.jsx("img",{src:e,alt:"Captured",style:ai.image})]}),O.jsx("button",{className:"custom-button",onClick:P,style:ai.button,children:"Submit"}),O.jsx("button",{className:"custom-button",onClick:b,style:ai.button,children:"Retake"})]}),O.jsx(Jv,{}),O.jsx("canvas",{ref:y,style:ai.hiddenCanvas})]})},ai={container:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",padding:"20px"},video:{width:"100%",height:"auto"},button:{marginTop:"10px",padding:"10px 20px",fontSize:"16px"},imageContainer:{marginTop:"10px"},image:{width:"300px",height:"200px"},hiddenCanvas:{display:"none"},fileInput:{display:"none"}};function A4(e){const t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o=0)&&l(d,!g)}function f(d){var p=[].slice.call(d.querySelectorAll("*"),0).reduce(function(g,m){return g.concat(m.shadowRoot?f(m.shadowRoot):[m])},[]);return p.filter(c)}e.exports=t.default})(hg,hg.exports);var oO=hg.exports;Object.defineProperty(Mr,"__esModule",{value:!0});Mr.resetState=j4;Mr.log=L4;Mr.handleBlur=nu;Mr.handleFocus=ru;Mr.markForFocusLater=F4;Mr.returnFocus=U4;Mr.popWithoutFocus=B4;Mr.setupScopedFocus=z4;Mr.teardownScopedFocus=V4;var M4=oO,D4=$4(M4);function $4(e){return e&&e.__esModule?e:{default:e}}var ua=[],Ms=null,mg=!1;function j4(){ua=[]}function L4(){}function nu(){mg=!0}function ru(){if(mg){if(mg=!1,!Ms)return;setTimeout(function(){if(!Ms.contains(document.activeElement)){var e=(0,D4.default)(Ms)[0]||Ms;e.focus()}},0)}}function F4(){ua.push(document.activeElement)}function U4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=null;try{ua.length!==0&&(t=ua.pop(),t.focus({preventScroll:e}));return}catch{console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}}function B4(){ua.length>0&&ua.pop()}function z4(e){Ms=e,window.addEventListener?(window.addEventListener("blur",nu,!1),document.addEventListener("focus",ru,!0)):(window.attachEvent("onBlur",nu),document.attachEvent("onFocus",ru))}function V4(){Ms=null,window.addEventListener?(window.removeEventListener("blur",nu),document.removeEventListener("focus",ru)):(window.detachEvent("onBlur",nu),document.detachEvent("onFocus",ru))}var gg={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var n=oO,r=i(n);function i(a){return a&&a.__esModule?a:{default:a}}function o(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return a.activeElement.shadowRoot?o(a.activeElement.shadowRoot):a.activeElement}function s(a,l){var c=(0,r.default)(a);if(!c.length){l.preventDefault();return}var f=void 0,d=l.shiftKey,p=c[0],g=c[c.length-1],m=o();if(a===m){if(!d)return;f=g}if(g===m&&!d&&(f=p),p===m&&d&&(f=g),f){l.preventDefault(),f.focus();return}var y=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),E=y!=null&&y[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(E){var w=c.indexOf(m);if(w>-1&&(w+=d?-1:1),f=c[w],typeof f>"u"){l.preventDefault(),f=d?g:p,f.focus();return}l.preventDefault(),f.focus()}}e.exports=t.default})(gg,gg.exports);var W4=gg.exports,Dr={},Pr={},sO={exports:{}};/*! + Copyright (c) 2015 Jed Watson. + Based on code that is Copyright 2013-2015, Facebook, Inc. + All rights reserved. +*/(function(e){(function(){var t=!!(typeof window<"u"&&window.document&&window.document.createElement),n={canUseDOM:t,canUseWorkers:typeof Worker<"u",canUseEventListeners:t&&!!(window.addEventListener||window.attachEvent),canUseViewport:t&&!!window.screen};e.exports?e.exports=n:window.ExecutionEnvironment=n})()})(sO);var H4=sO.exports;Object.defineProperty(Pr,"__esModule",{value:!0});Pr.canUseDOM=Pr.SafeNodeList=Pr.SafeHTMLCollection=void 0;var G4=H4,q4=K4(G4);function K4(e){return e&&e.__esModule?e:{default:e}}var ep=q4.default,Y4=ep.canUseDOM?window.HTMLElement:{};Pr.SafeHTMLCollection=ep.canUseDOM?window.HTMLCollection:{};Pr.SafeNodeList=ep.canUseDOM?window.NodeList:{};Pr.canUseDOM=ep.canUseDOM;Pr.default=Y4;Object.defineProperty(Dr,"__esModule",{value:!0});Dr.resetState=e3;Dr.log=t3;Dr.assertNodeList=aO;Dr.setElement=n3;Dr.validateElement=ny;Dr.hide=r3;Dr.show=i3;Dr.documentNotReadyOrSSRTesting=o3;var X4=P4,Q4=Z4(X4),J4=Pr;function Z4(e){return e&&e.__esModule?e:{default:e}}var Jn=null;function e3(){Jn&&(Jn.removeAttribute?Jn.removeAttribute("aria-hidden"):Jn.length!=null?Jn.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(Jn).forEach(function(e){return e.removeAttribute("aria-hidden")})),Jn=null}function t3(){}function aO(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function n3(e){var t=e;if(typeof t=="string"&&J4.canUseDOM){var n=document.querySelectorAll(t);aO(n,t),t=n}return Jn=t||Jn,Jn}function ny(e){var t=e||Jn;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,Q4.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}function r3(e){var t=!0,n=!1,r=void 0;try{for(var i=ny(e)[Symbol.iterator](),o;!(t=(o=i.next()).done);t=!0){var s=o.value;s.setAttribute("aria-hidden","true")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}}function i3(e){var t=!0,n=!1,r=void 0;try{for(var i=ny(e)[Symbol.iterator](),o;!(t=(o=i.next()).done);t=!0){var s=o.value;s.removeAttribute("aria-hidden")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}}function o3(){Jn=null}var Ta={};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.resetState=s3;Ta.log=a3;var Ml={},Dl={};function Gb(e,t){e.classList.remove(t)}function s3(){var e=document.getElementsByTagName("html")[0];for(var t in Ml)Gb(e,Ml[t]);var n=document.body;for(var r in Dl)Gb(n,Dl[r]);Ml={},Dl={}}function a3(){}var l3=function(t,n){return t[n]||(t[n]=0),t[n]+=1,n},u3=function(t,n){return t[n]&&(t[n]-=1),n},c3=function(t,n,r){r.forEach(function(i){l3(n,i),t.add(i)})},f3=function(t,n,r){r.forEach(function(i){u3(n,i),n[i]===0&&t.remove(i)})};Ta.add=function(t,n){return c3(t.classList,t.nodeName.toLowerCase()=="html"?Ml:Dl,n.split(" "))};Ta.remove=function(t,n){return f3(t.classList,t.nodeName.toLowerCase()=="html"?Ml:Dl,n.split(" "))};var ka={};Object.defineProperty(ka,"__esModule",{value:!0});ka.log=p3;ka.resetState=h3;function d3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var lO=function e(){var t=this;d3(this,e),this.register=function(n){t.openInstances.indexOf(n)===-1&&(t.openInstances.push(n),t.emit("register"))},this.deregister=function(n){var r=t.openInstances.indexOf(n);r!==-1&&(t.openInstances.splice(r,1),t.emit("deregister"))},this.subscribe=function(n){t.subscribers.push(n)},this.emit=function(n){t.subscribers.forEach(function(r){return r(n,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},ed=new lO;function p3(){console.log("portalOpenInstances ----------"),console.log(ed.openInstances.length),ed.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")}function h3(){ed=new lO}ka.default=ed;var ry={};Object.defineProperty(ry,"__esModule",{value:!0});ry.resetState=y3;ry.log=b3;var m3=ka,g3=v3(m3);function v3(e){return e&&e.__esModule?e:{default:e}}var en=void 0,Sr=void 0,Uo=[];function y3(){for(var e=[en,Sr],t=0;t0?(document.body.firstChild!==en&&document.body.insertBefore(en,document.body.firstChild),document.body.lastChild!==Sr&&document.body.appendChild(Sr)):(en.parentElement&&en.parentElement.removeChild(en),Sr.parentElement&&Sr.parentElement.removeChild(Sr))}g3.default.subscribe(w3);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(X){for(var G=1;G0&&(A-=1,A===0&&g.show(J)),B.props.shouldFocusAfterRender&&(B.props.shouldReturnFocusAfterClose?(c.returnFocus(B.props.preventScroll),c.teardownScopedFocus()):c.popWithoutFocus()),B.props.onAfterClose&&B.props.onAfterClose(),_.default.deregister(B)},B.open=function(){B.beforeOpen(),B.state.afterOpen&&B.state.beforeClose?(clearTimeout(B.closeTimer),B.setState({beforeClose:!1})):(B.props.shouldFocusAfterRender&&(c.setupScopedFocus(B.node),c.markForFocusLater()),B.setState({isOpen:!0},function(){B.openAnimationFrame=requestAnimationFrame(function(){B.setState({afterOpen:!0}),B.props.isOpen&&B.props.onAfterOpen&&B.props.onAfterOpen({overlayEl:B.overlay,contentEl:B.content})})}))},B.close=function(){B.props.closeTimeoutMS>0?B.closeWithTimeout():B.closeWithoutTimeout()},B.focusContent=function(){return B.content&&!B.contentHasFocus()&&B.content.focus({preventScroll:!0})},B.closeWithTimeout=function(){var W=Date.now()+B.props.closeTimeoutMS;B.setState({beforeClose:!0,closesAt:W},function(){B.closeTimer=setTimeout(B.closeWithoutTimeout,B.state.closesAt-Date.now())})},B.closeWithoutTimeout=function(){B.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},B.afterClose)},B.handleKeyDown=function(W){I(W)&&(0,d.default)(B.content,W),B.props.shouldCloseOnEsc&&N(W)&&(W.stopPropagation(),B.requestClose(W))},B.handleOverlayOnClick=function(W){B.shouldClose===null&&(B.shouldClose=!0),B.shouldClose&&B.props.shouldCloseOnOverlayClick&&(B.ownerHandlesClose()?B.requestClose(W):B.focusContent()),B.shouldClose=null},B.handleContentOnMouseUp=function(){B.shouldClose=!1},B.handleOverlayOnMouseDown=function(W){!B.props.shouldCloseOnOverlayClick&&W.target==B.overlay&&W.preventDefault()},B.handleContentOnClick=function(){B.shouldClose=!1},B.handleContentOnMouseDown=function(){B.shouldClose=!1},B.requestClose=function(W){return B.ownerHandlesClose()&&B.props.onRequestClose(W)},B.ownerHandlesClose=function(){return B.props.onRequestClose},B.shouldBeClosed=function(){return!B.state.isOpen&&!B.state.beforeClose},B.contentHasFocus=function(){return document.activeElement===B.content||B.content.contains(document.activeElement)},B.buildClassName=function(W,J){var se=(typeof J>"u"?"undefined":r(J))==="object"?J:{base:C[W],afterOpen:C[W]+"--after-open",beforeClose:C[W]+"--before-close"},we=se.base;return B.state.afterOpen&&(we=we+" "+se.afterOpen),B.state.beforeClose&&(we=we+" "+se.beforeClose),typeof J=="string"&&J?we+" "+J:we},B.attributesFromObject=function(W,J){return Object.keys(J).reduce(function(se,we){return se[W+"-"+we]=J[we],se},{})},B.state={afterOpen:!1,beforeClose:!1},B.shouldClose=null,B.moveFromContentToOverlay=null,B}return i(G,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(B,W){this.props.isOpen&&!B.isOpen?this.open():!this.props.isOpen&&B.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!W.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var B=this.props,W=B.appElement,J=B.ariaHideApp,se=B.htmlOpenClassName,we=B.bodyOpenClassName,Se=B.parentSelector,Ie=Se&&Se().ownerDocument||document;we&&y.add(Ie.body,we),se&&y.add(Ie.getElementsByTagName("html")[0],se),J&&(A+=1,g.hide(W)),_.default.register(this)}},{key:"render",value:function(){var B=this.props,W=B.id,J=B.className,se=B.overlayClassName,we=B.defaultStyles,Se=B.children,Ie=J?{}:we.content,Be=se?{}:we.overlay;if(this.shouldBeClosed())return null;var ze={ref:this.setOverlayRef,className:this.buildClassName("overlay",se),style:n({},Be,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},Fe=n({id:W,ref:this.setContentRef,style:n({},Ie,this.props.style.content),className:this.buildClassName("content",J),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",n({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),Ye=this.props.contentElement(Fe,Se);return this.props.overlayElement(ze,Ye)}}]),G}(o.Component);k.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},k.propTypes={isOpen:a.default.bool.isRequired,defaultStyles:a.default.shape({content:a.default.object,overlay:a.default.object}),style:a.default.shape({content:a.default.object,overlay:a.default.object}),className:a.default.oneOfType([a.default.string,a.default.object]),overlayClassName:a.default.oneOfType([a.default.string,a.default.object]),parentSelector:a.default.func,bodyOpenClassName:a.default.string,htmlOpenClassName:a.default.string,ariaHideApp:a.default.bool,appElement:a.default.oneOfType([a.default.instanceOf(w.default),a.default.instanceOf(E.SafeHTMLCollection),a.default.instanceOf(E.SafeNodeList),a.default.arrayOf(a.default.instanceOf(w.default))]),onAfterOpen:a.default.func,onAfterClose:a.default.func,onRequestClose:a.default.func,closeTimeoutMS:a.default.number,shouldFocusAfterRender:a.default.bool,shouldCloseOnOverlayClick:a.default.bool,shouldReturnFocusAfterClose:a.default.bool,preventScroll:a.default.bool,role:a.default.string,contentLabel:a.default.string,aria:a.default.object,data:a.default.object,children:a.default.node,shouldCloseOnEsc:a.default.bool,overlayRef:a.default.func,contentRef:a.default.func,id:a.default.string,overlayElement:a.default.func,contentElement:a.default.func,testId:a.default.string},t.default=k,e.exports=t.default})(pg,pg.exports);var S3=pg.exports;const _3=Nr(S4);Object.defineProperty(Ko,"__esModule",{value:!0});Ko.bodyOpenClassName=Ko.portalClassName=void 0;var Kb=Object.assign||function(e){for(var t=1;t{ca.setAppElement("#root");const e=j.useRef(),{user:t,setUser:n}=j.useContext(dr),[r,i]=j.useState(!0),[o,s]=j.useState([]),a=f=>{i(!f),l()},l=f=>{const d=[...o];f!=null&&f.target&&(d.push(new ra({category_name:f.target.name,category_id:f.target.id})),s(d))},c=()=>{t.categories=o.map(d=>new ra(d));const f=new mn(t);n(f),a(r)};return O.jsx("div",{className:"source-type",children:O.jsxs(ca,{isOpen:r,className:"modal-content",overlayClassName:"modal-overlay","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var f;return(f=e.current)==null?void 0:f.focus()},0)},children:[O.jsx("h2",{id:"source-type-dialog-label",children:"Select Your Categories"})," ",O.jsx("header",{}),O.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:$3.map((f,d)=>O.jsx("li",{className:"source-type-modal__list-item",children:O.jsxs("label",{children:[O.jsx("input",{type:"checkbox",onChange:l,name:f.category_name,ref:d===0?e:null,id:f.category_id}),f.category_name]})},f.category_id))}),O.jsx("div",{className:"source-type-modal__controls",children:O.jsx("button",{value:"apply",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:c,children:"Apply"})})]})})};var ew={};/** + * @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 cO=function(e){const t=[];let n=0;for(let r=0;r>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},L3=function(e){const t=[];let n=0,r=0;for(;n191&&i<224){const o=e[n++];t[r++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){const o=e[n++],s=e[n++],a=e[n++],l=((i&7)<<18|(o&63)<<12|(s&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(l>>10)),t[r++]=String.fromCharCode(56320+(l&1023))}else{const o=e[n++],s=e[n++];t[r++]=String.fromCharCode((i&15)<<12|(o&63)<<6|s&63)}}return t.join("")},fO={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(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,d=(o&3)<<4|a>>4;let p=(a&15)<<2|c>>6,g=c&63;l||(g=64,s||(p=64)),r.push(n[f],n[d],n[p],n[g])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(cO(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):L3(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(p),c!==64){const g=a<<4&240|c>>2;if(r.push(g),d!==64){const m=c<<6&192|d;r.push(m)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class F3 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const U3=function(e){const t=cO(e);return fO.encodeByteArray(t,!0)},rd=function(e){return U3(e).replace(/\./g,"")},dO=function(e){try{return fO.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}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 B3(){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 z3=()=>B3().__FIREBASE_DEFAULTS__,V3=()=>{if(typeof process>"u"||typeof ew>"u")return;const e=ew.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},W3=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&dO(e[1]);return t&&JSON.parse(t)},iy=()=>{try{return z3()||V3()||W3()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},pO=e=>{var t,n;return(n=(t=iy())===null||t===void 0?void 0:t.emulatorHosts)===null||n===void 0?void 0:n[e]},H3=e=>{const t=pO(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const r=parseInt(t.substring(n+1),10);return t[0]==="["?[t.substring(1,n-1),r]:[t.substring(0,n),r]},hO=()=>{var e;return(e=iy())===null||e===void 0?void 0:e.config},mO=e=>{var t;return(t=iy())===null||t===void 0?void 0: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 G3{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,r))}}}/** + * @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 q3(e,t){if(e.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=t||"demo-project",i=e.iat||0,o=e.sub||e.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=Object.assign({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:{}}},e);return[rd(JSON.stringify(n)),rd(JSON.stringify(s)),""].join(".")}/** + * @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 cn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function K3(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(cn())}function Y3(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function X3(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Q3(){const e=cn();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function J3(){try{return typeof indexedDB=="object"}catch{return!1}}function Z3(){return new Promise((e,t)=>{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),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var o;t(((o=i.error)===null||o===void 0?void 0:o.message)||"")}}catch(n){t(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 eN="FirebaseError";class ki extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=eN,Object.setPrototypeOf(this,ki.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Iu.prototype.create)}}class Iu{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},i=`${this.service}/${t}`,o=this.errors[t],s=o?tN(o,r):"Error",a=`${this.serviceName}: ${s} (${i}).`;return new ki(i,a,r)}}function tN(e,t){return e.replace(nN,(n,r)=>{const i=t[r];return i!=null?String(i):`<${r}?>`})}const nN=/\{\$([^}]+)}/g;function rN(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function id(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const o=e[i],s=t[i];if(tw(o)&&tw(s)){if(!id(o,s))return!1}else if(o!==s)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function tw(e){return e!==null&&typeof e=="object"}/** + * @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 Pu(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(i=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function iN(e,t){const n=new oN(e,t);return n.subscribe.bind(n)}class oN{constructor(t,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{t(this)}).catch(r=>{this.error(r)})}next(t){this.forEachObserver(n=>{n.next(t)})}error(t){this.forEachObserver(n=>{n.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,n,r){let i;if(t===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");sN(t,["next","error","complete"])?i=t:i={next:t,error:n,complete:r},i.next===void 0&&(i.next=Uh),i.error===void 0&&(i.error=Uh),i.complete===void 0&&(i.complete=Uh);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),o}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let n=0;n{if(this.observers!==void 0&&this.observers[t]!==void 0)try{n(this.observers[t])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function sN(e,t){if(typeof e!="object"||e===null)return!1;for(const n of t)if(n in e&&typeof e[n]=="function")return!0;return!1}function Uh(){}/** + * @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 yo(e){return e&&e._delegate?e._delegate:e}class Yo{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,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 Oo="[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 aN{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const r=new G3;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(t){var n;const r=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),i=(n=t==null?void 0:t.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(o){if(i)return null;throw o}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(uN(t))try{this.getOrInitializeService({instanceIdentifier:Oo})}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(t=Oo){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=Oo){return this.instances.has(t)}getOptions(t=Oo){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,r=this.normalizeInstanceIdentifier(t.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 a=this.normalizeInstanceIdentifier(o);r===a&&s.resolve(i)}return i}onInit(t,n){var r;const i=this.normalizeInstanceIdentifier(n),o=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;o.add(t),this.onInitCallbacks.set(i,o);const s=this.instances.get(i);return s&&t(s,i),()=>{o.delete(t)}}invokeOnInitCallbacks(t,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:lN(t),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch{}return r||null}normalizeInstanceIdentifier(t=Oo){return this.component?this.component.multipleInstances?t:Oo:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function lN(e){return e===Oo?void 0:e}function uN(e){return e.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 cN{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new aN(t,this);return this.providers.set(t,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 Ze;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(Ze||(Ze={}));const fN={debug:Ze.DEBUG,verbose:Ze.VERBOSE,info:Ze.INFO,warn:Ze.WARN,error:Ze.ERROR,silent:Ze.SILENT},dN=Ze.INFO,pN={[Ze.DEBUG]:"log",[Ze.VERBOSE]:"log",[Ze.INFO]:"info",[Ze.WARN]:"warn",[Ze.ERROR]:"error"},hN=(e,t,...n)=>{if(tt.some(n=>e instanceof n);let nw,rw;function gN(){return nw||(nw=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function vN(){return rw||(rw=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const gO=new WeakMap,vg=new WeakMap,vO=new WeakMap,Bh=new WeakMap,sy=new WeakMap;function yN(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{n(oo(e.result)),i()},s=()=>{r(e.error),i()};e.addEventListener("success",o),e.addEventListener("error",s)});return t.then(n=>{n instanceof IDBCursor&&gO.set(n,e)}).catch(()=>{}),sy.set(t,e),t}function bN(e){if(vg.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{n(),i()},s=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)});vg.set(e,t)}let yg={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return vg.get(e);if(t==="objectStoreNames")return e.objectStoreNames||vO.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return oo(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function wN(e){yg=e(yg)}function SN(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(zh(this),t,...n);return vO.set(r,t.sort?t.sort():[t]),oo(r)}:vN().includes(e)?function(...t){return e.apply(zh(this),t),oo(gO.get(this))}:function(...t){return oo(e.apply(zh(this),t))}}function _N(e){return typeof e=="function"?SN(e):(e instanceof IDBTransaction&&bN(e),mN(e,gN())?new Proxy(e,yg):e)}function oo(e){if(e instanceof IDBRequest)return yN(e);if(Bh.has(e))return Bh.get(e);const t=_N(e);return t!==e&&(Bh.set(e,t),sy.set(t,e)),t}const zh=e=>sy.get(e);function xN(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const s=indexedDB.open(e,t),a=oo(s);return r&&s.addEventListener("upgradeneeded",l=>{r(oo(s.result),l.oldVersion,l.newVersion,oo(s.transaction),l)}),n&&s.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{o&&l.addEventListener("close",()=>o()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}const EN=["get","getKey","getAll","getAllKeys","count"],CN=["put","add","delete","clear"],Vh=new Map;function iw(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Vh.get(t))return Vh.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=CN.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||EN.includes(n)))return;const o=async function(s,...a){const l=this.transaction(s,i?"readwrite":"readonly");let c=l.store;return r&&(c=c.index(a.shift())),(await Promise.all([c[n](...a),i&&l.done]))[0]};return Vh.set(t,o),o}wN(e=>({...e,get:(t,n,r)=>iw(t,n)||e.get(t,n,r),has:(t,n)=>!!iw(t,n)||e.has(t,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 ON{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(TN(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function TN(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const bg="@firebase/app",ow="0.10.5";/** + * @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 Xo=new oy("@firebase/app"),kN="@firebase/app-compat",IN="@firebase/analytics-compat",PN="@firebase/analytics",RN="@firebase/app-check-compat",AN="@firebase/app-check",NN="@firebase/auth",MN="@firebase/auth-compat",DN="@firebase/database",$N="@firebase/database-compat",jN="@firebase/functions",LN="@firebase/functions-compat",FN="@firebase/installations",UN="@firebase/installations-compat",BN="@firebase/messaging",zN="@firebase/messaging-compat",VN="@firebase/performance",WN="@firebase/performance-compat",HN="@firebase/remote-config",GN="@firebase/remote-config-compat",qN="@firebase/storage",KN="@firebase/storage-compat",YN="@firebase/firestore",XN="@firebase/vertexai-preview",QN="@firebase/firestore-compat",JN="firebase",ZN="10.12.2";/** + * @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 wg="[DEFAULT]",eM={[bg]:"fire-core",[kN]:"fire-core-compat",[PN]:"fire-analytics",[IN]:"fire-analytics-compat",[AN]:"fire-app-check",[RN]:"fire-app-check-compat",[NN]:"fire-auth",[MN]:"fire-auth-compat",[DN]:"fire-rtdb",[$N]:"fire-rtdb-compat",[jN]:"fire-fn",[LN]:"fire-fn-compat",[FN]:"fire-iid",[UN]:"fire-iid-compat",[BN]:"fire-fcm",[zN]:"fire-fcm-compat",[VN]:"fire-perf",[WN]:"fire-perf-compat",[HN]:"fire-rc",[GN]:"fire-rc-compat",[qN]:"fire-gcs",[KN]:"fire-gcs-compat",[YN]:"fire-fst",[QN]:"fire-fst-compat",[XN]:"fire-vertex","fire-js":"fire-js",[JN]:"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 od=new Map,tM=new Map,Sg=new Map;function sw(e,t){try{e.container.addComponent(t)}catch(n){Xo.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function fa(e){const t=e.name;if(Sg.has(t))return Xo.debug(`There were multiple attempts to register component ${t}.`),!1;Sg.set(t,e);for(const n of od.values())sw(n,e);for(const n of tM.values())sw(n,e);return!0}function ay(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function vi(e){return e.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 nM={"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."},so=new Iu("app","Firebase",nM);/** + * @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 rM{constructor(t,n,r){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Yo("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}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(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw so.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 Ia=ZN;function yO(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r=Object.assign({name:wg,automaticDataCollectionEnabled:!1},t),i=r.name;if(typeof i!="string"||!i)throw so.create("bad-app-name",{appName:String(i)});if(n||(n=hO()),!n)throw so.create("no-options");const o=od.get(i);if(o){if(id(n,o.options)&&id(r,o.config))return o;throw so.create("duplicate-app",{appName:i})}const s=new cN(i);for(const l of Sg.values())s.addComponent(l);const a=new rM(n,r,s);return od.set(i,a),a}function bO(e=wg){const t=od.get(e);if(!t&&e===wg&&hO())return yO();if(!t)throw so.create("no-app",{appName:e});return t}function ao(e,t,n){var r;let i=(r=eM[e])!==null&&r!==void 0?r:e;n&&(i+=`-${n}`);const o=i.match(/\s|\//),s=t.match(/\s|\//);if(o||s){const a=[`Unable to register library "${i}" with version "${t}":`];o&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&s&&a.push("and"),s&&a.push(`version name "${t}" contains illegal characters (whitespace or "/")`),Xo.warn(a.join(" "));return}fa(new Yo(`${i}-version`,()=>({library:i,version:t}),"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 iM="firebase-heartbeat-database",oM=1,iu="firebase-heartbeat-store";let Wh=null;function wO(){return Wh||(Wh=xN(iM,oM,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(iu)}catch(n){console.warn(n)}}}}).catch(e=>{throw so.create("idb-open",{originalErrorMessage:e.message})})),Wh}async function sM(e){try{const n=(await wO()).transaction(iu),r=await n.objectStore(iu).get(SO(e));return await n.done,r}catch(t){if(t instanceof ki)Xo.warn(t.message);else{const n=so.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Xo.warn(n.message)}}}async function aw(e,t){try{const r=(await wO()).transaction(iu,"readwrite");await r.objectStore(iu).put(t,SO(e)),await r.done}catch(n){if(n instanceof ki)Xo.warn(n.message);else{const r=so.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Xo.warn(r.message)}}}function SO(e){return`${e.name}!${e.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 aM=1024,lM=30*24*60*60*1e3;class uM{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new fM(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var t,n;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=lw();if(!(((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(s=>s.date===o)))return this._heartbeatsCache.heartbeats.push({date:o,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(s=>{const a=new Date(s.date).valueOf();return Date.now()-a<=lM}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var t;if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=lw(),{heartbeatsToSend:r,unsentEntries:i}=cM(this._heartbeatsCache.heartbeats),o=rd(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}}function lw(){return new Date().toISOString().substring(0,10)}function cM(e,t=aM){const n=[];let r=e.slice();for(const i of e){const o=n.find(s=>s.agent===i.agent);if(o){if(o.dates.push(i.date),uw(n)>t){o.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),uw(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class fM{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return J3()?Z3().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await sM(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return aw(this.app,{lastSentHeartbeatDate:(n=t.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return aw(this.app,{lastSentHeartbeatDate:(n=t.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...t.heartbeats]})}else return}}function uw(e){return rd(JSON.stringify({version:2,heartbeats:e})).length}/** + * @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. + */function dM(e){fa(new Yo("platform-logger",t=>new ON(t),"PRIVATE")),fa(new Yo("heartbeat",t=>new uM(t),"PRIVATE")),ao(bg,ow,e),ao(bg,ow,"esm2017"),ao("fire-js","")}dM("");var pM="firebase",hM="10.12.2";/** + * @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. + */ao(pM,hM,"app");var cw=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 _O;(function(){var e;/** @license + + Copyright The Closure Library Authors. + SPDX-License-Identifier: Apache-2.0 +*/function t(S,x){function C(){}C.prototype=x.prototype,S.D=x.prototype,S.prototype=new C,S.prototype.constructor=S,S.C=function(I,N,A){for(var k=Array(arguments.length-2),X=2;XN;++N)I[N]=x.charCodeAt(C++)|x.charCodeAt(C++)<<8|x.charCodeAt(C++)<<16|x.charCodeAt(C++)<<24;else for(N=0;16>N;++N)I[N]=x[C++]|x[C++]<<8|x[C++]<<16|x[C++]<<24;x=S.g[0],C=S.g[1],N=S.g[2];var A=S.g[3],k=x+(A^C&(N^A))+I[0]+3614090360&4294967295;x=C+(k<<7&4294967295|k>>>25),k=A+(N^x&(C^N))+I[1]+3905402710&4294967295,A=x+(k<<12&4294967295|k>>>20),k=N+(C^A&(x^C))+I[2]+606105819&4294967295,N=A+(k<<17&4294967295|k>>>15),k=C+(x^N&(A^x))+I[3]+3250441966&4294967295,C=N+(k<<22&4294967295|k>>>10),k=x+(A^C&(N^A))+I[4]+4118548399&4294967295,x=C+(k<<7&4294967295|k>>>25),k=A+(N^x&(C^N))+I[5]+1200080426&4294967295,A=x+(k<<12&4294967295|k>>>20),k=N+(C^A&(x^C))+I[6]+2821735955&4294967295,N=A+(k<<17&4294967295|k>>>15),k=C+(x^N&(A^x))+I[7]+4249261313&4294967295,C=N+(k<<22&4294967295|k>>>10),k=x+(A^C&(N^A))+I[8]+1770035416&4294967295,x=C+(k<<7&4294967295|k>>>25),k=A+(N^x&(C^N))+I[9]+2336552879&4294967295,A=x+(k<<12&4294967295|k>>>20),k=N+(C^A&(x^C))+I[10]+4294925233&4294967295,N=A+(k<<17&4294967295|k>>>15),k=C+(x^N&(A^x))+I[11]+2304563134&4294967295,C=N+(k<<22&4294967295|k>>>10),k=x+(A^C&(N^A))+I[12]+1804603682&4294967295,x=C+(k<<7&4294967295|k>>>25),k=A+(N^x&(C^N))+I[13]+4254626195&4294967295,A=x+(k<<12&4294967295|k>>>20),k=N+(C^A&(x^C))+I[14]+2792965006&4294967295,N=A+(k<<17&4294967295|k>>>15),k=C+(x^N&(A^x))+I[15]+1236535329&4294967295,C=N+(k<<22&4294967295|k>>>10),k=x+(N^A&(C^N))+I[1]+4129170786&4294967295,x=C+(k<<5&4294967295|k>>>27),k=A+(C^N&(x^C))+I[6]+3225465664&4294967295,A=x+(k<<9&4294967295|k>>>23),k=N+(x^C&(A^x))+I[11]+643717713&4294967295,N=A+(k<<14&4294967295|k>>>18),k=C+(A^x&(N^A))+I[0]+3921069994&4294967295,C=N+(k<<20&4294967295|k>>>12),k=x+(N^A&(C^N))+I[5]+3593408605&4294967295,x=C+(k<<5&4294967295|k>>>27),k=A+(C^N&(x^C))+I[10]+38016083&4294967295,A=x+(k<<9&4294967295|k>>>23),k=N+(x^C&(A^x))+I[15]+3634488961&4294967295,N=A+(k<<14&4294967295|k>>>18),k=C+(A^x&(N^A))+I[4]+3889429448&4294967295,C=N+(k<<20&4294967295|k>>>12),k=x+(N^A&(C^N))+I[9]+568446438&4294967295,x=C+(k<<5&4294967295|k>>>27),k=A+(C^N&(x^C))+I[14]+3275163606&4294967295,A=x+(k<<9&4294967295|k>>>23),k=N+(x^C&(A^x))+I[3]+4107603335&4294967295,N=A+(k<<14&4294967295|k>>>18),k=C+(A^x&(N^A))+I[8]+1163531501&4294967295,C=N+(k<<20&4294967295|k>>>12),k=x+(N^A&(C^N))+I[13]+2850285829&4294967295,x=C+(k<<5&4294967295|k>>>27),k=A+(C^N&(x^C))+I[2]+4243563512&4294967295,A=x+(k<<9&4294967295|k>>>23),k=N+(x^C&(A^x))+I[7]+1735328473&4294967295,N=A+(k<<14&4294967295|k>>>18),k=C+(A^x&(N^A))+I[12]+2368359562&4294967295,C=N+(k<<20&4294967295|k>>>12),k=x+(C^N^A)+I[5]+4294588738&4294967295,x=C+(k<<4&4294967295|k>>>28),k=A+(x^C^N)+I[8]+2272392833&4294967295,A=x+(k<<11&4294967295|k>>>21),k=N+(A^x^C)+I[11]+1839030562&4294967295,N=A+(k<<16&4294967295|k>>>16),k=C+(N^A^x)+I[14]+4259657740&4294967295,C=N+(k<<23&4294967295|k>>>9),k=x+(C^N^A)+I[1]+2763975236&4294967295,x=C+(k<<4&4294967295|k>>>28),k=A+(x^C^N)+I[4]+1272893353&4294967295,A=x+(k<<11&4294967295|k>>>21),k=N+(A^x^C)+I[7]+4139469664&4294967295,N=A+(k<<16&4294967295|k>>>16),k=C+(N^A^x)+I[10]+3200236656&4294967295,C=N+(k<<23&4294967295|k>>>9),k=x+(C^N^A)+I[13]+681279174&4294967295,x=C+(k<<4&4294967295|k>>>28),k=A+(x^C^N)+I[0]+3936430074&4294967295,A=x+(k<<11&4294967295|k>>>21),k=N+(A^x^C)+I[3]+3572445317&4294967295,N=A+(k<<16&4294967295|k>>>16),k=C+(N^A^x)+I[6]+76029189&4294967295,C=N+(k<<23&4294967295|k>>>9),k=x+(C^N^A)+I[9]+3654602809&4294967295,x=C+(k<<4&4294967295|k>>>28),k=A+(x^C^N)+I[12]+3873151461&4294967295,A=x+(k<<11&4294967295|k>>>21),k=N+(A^x^C)+I[15]+530742520&4294967295,N=A+(k<<16&4294967295|k>>>16),k=C+(N^A^x)+I[2]+3299628645&4294967295,C=N+(k<<23&4294967295|k>>>9),k=x+(N^(C|~A))+I[0]+4096336452&4294967295,x=C+(k<<6&4294967295|k>>>26),k=A+(C^(x|~N))+I[7]+1126891415&4294967295,A=x+(k<<10&4294967295|k>>>22),k=N+(x^(A|~C))+I[14]+2878612391&4294967295,N=A+(k<<15&4294967295|k>>>17),k=C+(A^(N|~x))+I[5]+4237533241&4294967295,C=N+(k<<21&4294967295|k>>>11),k=x+(N^(C|~A))+I[12]+1700485571&4294967295,x=C+(k<<6&4294967295|k>>>26),k=A+(C^(x|~N))+I[3]+2399980690&4294967295,A=x+(k<<10&4294967295|k>>>22),k=N+(x^(A|~C))+I[10]+4293915773&4294967295,N=A+(k<<15&4294967295|k>>>17),k=C+(A^(N|~x))+I[1]+2240044497&4294967295,C=N+(k<<21&4294967295|k>>>11),k=x+(N^(C|~A))+I[8]+1873313359&4294967295,x=C+(k<<6&4294967295|k>>>26),k=A+(C^(x|~N))+I[15]+4264355552&4294967295,A=x+(k<<10&4294967295|k>>>22),k=N+(x^(A|~C))+I[6]+2734768916&4294967295,N=A+(k<<15&4294967295|k>>>17),k=C+(A^(N|~x))+I[13]+1309151649&4294967295,C=N+(k<<21&4294967295|k>>>11),k=x+(N^(C|~A))+I[4]+4149444226&4294967295,x=C+(k<<6&4294967295|k>>>26),k=A+(C^(x|~N))+I[11]+3174756917&4294967295,A=x+(k<<10&4294967295|k>>>22),k=N+(x^(A|~C))+I[2]+718787259&4294967295,N=A+(k<<15&4294967295|k>>>17),k=C+(A^(N|~x))+I[9]+3951481745&4294967295,S.g[0]=S.g[0]+x&4294967295,S.g[1]=S.g[1]+(N+(k<<21&4294967295|k>>>11))&4294967295,S.g[2]=S.g[2]+N&4294967295,S.g[3]=S.g[3]+A&4294967295}r.prototype.u=function(S,x){x===void 0&&(x=S.length);for(var C=x-this.blockSize,I=this.B,N=this.h,A=0;Athis.h?this.blockSize:2*this.blockSize)-this.h);S[0]=128;for(var x=1;xx;++x)for(var I=0;32>I;I+=8)S[C++]=this.g[x]>>>I&255;return S};function o(S,x){var C=a;return Object.prototype.hasOwnProperty.call(C,S)?C[S]:C[S]=x(S)}function s(S,x){this.h=x;for(var C=[],I=!0,N=S.length-1;0<=N;N--){var A=S[N]|0;I&&A==x||(C[N]=A,I=!1)}this.g=C}var a={};function l(S){return-128<=S&&128>S?o(S,function(x){return new s([x|0],0>x?-1:0)}):new s([S|0],0>S?-1:0)}function c(S){if(isNaN(S)||!isFinite(S))return d;if(0>S)return E(c(-S));for(var x=[],C=1,I=0;S>=C;I++)x[I]=S/C|0,C*=4294967296;return new s(x,0)}function f(S,x){if(S.length==0)throw Error("number format error: empty string");if(x=x||10,2>x||36A?(A=c(Math.pow(x,A)),I=I.j(A).add(c(k))):(I=I.j(C),I=I.add(c(k)))}return I}var d=l(0),p=l(1),g=l(16777216);e=s.prototype,e.m=function(){if(y(this))return-E(this).m();for(var S=0,x=1,C=0;CS||36>>0).toString(S);if(C=N,m(C))return A+I;for(;6>A.length;)A="0"+A;I=A+I}},e.i=function(S){return 0>S?0:S>>16)+(this.i(N)>>>16)+(S.i(N)>>>16);I=k>>>16,A&=65535,k&=65535,C[N]=k<<16|A}return new s(C,C[C.length-1]&-2147483648?-1:0)};function w(S,x){return S.add(E(x))}e.j=function(S){if(m(this)||m(S))return d;if(y(this))return y(S)?E(this).j(E(S)):E(E(this).j(S));if(y(S))return E(this.j(E(S)));if(0>this.l(g)&&0>S.l(g))return c(this.m()*S.m());for(var x=this.g.length+S.g.length,C=[],I=0;I<2*x;I++)C[I]=0;for(I=0;I>>16,k=this.i(I)&65535,X=S.i(N)>>>16,G=S.i(N)&65535;C[2*I+2*N]+=k*G,b(C,2*I+2*N),C[2*I+2*N+1]+=A*G,b(C,2*I+2*N+1),C[2*I+2*N+1]+=k*X,b(C,2*I+2*N+1),C[2*I+2*N+2]+=A*X,b(C,2*I+2*N+2)}for(I=0;I>>16,S[x]&=65535,x++}function _(S,x){this.g=S,this.h=x}function P(S,x){if(m(x))throw Error("division by zero");if(m(S))return new _(d,d);if(y(S))return x=P(E(S),x),new _(E(x.g),E(x.h));if(y(x))return x=P(S,E(x)),new _(E(x.g),x.h);if(30=I.l(S);)C=R(C),I=R(I);var N=D(C,1),A=D(I,1);for(I=D(I,2),C=D(C,2);!m(I);){var k=A.add(I);0>=k.l(S)&&(N=N.add(C),A=k),I=D(I,1),C=D(C,1)}return x=w(S,N.j(x)),new _(N,x)}for(N=d;0<=S.l(x);){for(C=Math.max(1,Math.floor(S.m()/x.m())),I=Math.ceil(Math.log(C)/Math.LN2),I=48>=I?1:Math.pow(2,I-48),A=c(C),k=A.j(x);y(k)||0>>31;return new s(C,S.h)}function D(S,x){var C=x>>5;x%=32;for(var I=S.g.length-C,N=[],A=0;A>>x|S.i(A+C+1)<<32-x:S.i(A+C);return new s(N,S.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.A,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=f,_O=s}).apply(typeof cw<"u"?cw:typeof self<"u"?self:typeof window<"u"?window:{});var Ic=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};(function(){var e,t=typeof Object.defineProperties=="function"?Object.defineProperty:function(u,h,v){return u==Array.prototype||u==Object.prototype||(u[h]=v.value),u};function n(u){u=[typeof globalThis=="object"&&globalThis,u,typeof window=="object"&&window,typeof self=="object"&&self,typeof Ic=="object"&&Ic];for(var h=0;h{throw u},0)}function k(){var u=J;let h=null;return u.g&&(h=u.g,u.g=u.g.next,u.g||(u.h=null),h.next=null),h}class X{constructor(){this.h=this.g=null}add(h,v){const T=G.get();T.set(h,v),this.h?this.h.next=T:this.g=T,this.h=T}}var G=new w(()=>new ee,u=>u.reset());class ee{constructor(){this.next=this.g=this.h=null}set(h,v){this.h=h,this.g=v,this.next=null}reset(){this.next=this.g=this.h=null}}let B,W=!1,J=new X,se=()=>{const u=a.Promise.resolve(void 0);B=()=>{u.then(we)}};var we=()=>{for(var u;u=k();){try{u.h.call(u.g)}catch(v){A(v)}var h=G;h.j(u),100>h.h&&(h.h++,u.next=h.g,h.g=u)}W=!1};function Se(){this.s=this.s,this.C=this.C}Se.prototype.s=!1,Se.prototype.ma=function(){this.s||(this.s=!0,this.N())},Se.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function Ie(u,h){this.type=u,this.g=this.target=h,this.defaultPrevented=!1}Ie.prototype.h=function(){this.defaultPrevented=!0};var Be=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var u=!1,h=Object.defineProperty({},"passive",{get:function(){u=!0}});try{const v=()=>{};a.addEventListener("test",v,h),a.removeEventListener("test",v,h)}catch{}return u}();function ze(u,h){if(Ie.call(this,u?u.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,u){var v=this.type=u.type,T=u.changedTouches&&u.changedTouches.length?u.changedTouches[0]:null;if(this.target=u.target||u.srcElement,this.g=h,h=u.relatedTarget){if(R){e:{try{P(h.nodeName);var V=!0;break e}catch{}V=!1}V||(h=null)}}else v=="mouseover"?h=u.fromElement:v=="mouseout"&&(h=u.toElement);this.relatedTarget=h,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=u.clientX!==void 0?u.clientX:u.pageX,this.clientY=u.clientY!==void 0?u.clientY:u.pageY,this.screenX=u.screenX||0,this.screenY=u.screenY||0),this.button=u.button,this.key=u.key||"",this.ctrlKey=u.ctrlKey,this.altKey=u.altKey,this.shiftKey=u.shiftKey,this.metaKey=u.metaKey,this.pointerId=u.pointerId||0,this.pointerType=typeof u.pointerType=="string"?u.pointerType:Fe[u.pointerType]||"",this.state=u.state,this.i=u,u.defaultPrevented&&ze.aa.h.call(this)}}m(ze,Ie);var Fe={2:"touch",3:"pen",4:"mouse"};ze.prototype.h=function(){ze.aa.h.call(this);var u=this.i;u.preventDefault?u.preventDefault():u.returnValue=!1};var Ye="closure_listenable_"+(1e6*Math.random()|0),M=0;function L(u,h,v,T,V){this.listener=u,this.proxy=null,this.src=h,this.type=v,this.capture=!!T,this.ha=V,this.key=++M,this.da=this.fa=!1}function U(u){u.da=!0,u.listener=null,u.proxy=null,u.src=null,u.ha=null}function F(u){this.src=u,this.g={},this.h=0}F.prototype.add=function(u,h,v,T,V){var K=u.toString();u=this.g[K],u||(u=this.g[K]=[],this.h++);var fe=q(u,h,T,V);return-1>>0);function le(u){return typeof u=="function"?u:(u[pe]||(u[pe]=function(h){return u.handleEvent(h)}),u[pe])}function he(){Se.call(this),this.i=new F(this),this.M=this,this.F=null}m(he,Se),he.prototype[Ye]=!0,he.prototype.removeEventListener=function(u,h,v,T){z(this,u,h,v,T)};function ce(u,h){var v,T=u.F;if(T)for(v=[];T;T=T.F)v.push(T);if(u=u.M,T=h.type||h,typeof h=="string")h=new Ie(h,u);else if(h instanceof Ie)h.target=h.target||u;else{var V=h;h=new Ie(T,u),I(h,V)}if(V=!0,v)for(var K=v.length-1;0<=K;K--){var fe=h.g=v[K];V=Ne(fe,T,!0,h)&&V}if(fe=h.g=u,V=Ne(fe,T,!0,h)&&V,V=Ne(fe,T,!1,h)&&V,v)for(K=0;K{u.g=null,u.i&&(u.i=!1,lt(u))},u.l);const h=u.h;u.h=null,u.m.apply(null,h)}class Pe extends Se{constructor(h,v){super(),this.m=h,this.l=v,this.h=null,this.i=!1,this.g=null}j(h){this.h=arguments,this.g?this.i=!0:lt(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Ee(u){Se.call(this),this.h=u,this.g={}}m(Ee,Se);var zt=[];function Ii(u){D(u.g,function(h,v){this.g.hasOwnProperty(v)&&H(h)},u),u.g={}}Ee.prototype.N=function(){Ee.aa.N.call(this),Ii(this)},Ee.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var ri=a.JSON.stringify,xk=a.JSON.parse,Ek=class{stringify(u){return a.JSON.stringify(u,void 0)}parse(u){return a.JSON.parse(u,void 0)}};function Vp(){}Vp.prototype.h=null;function m0(u){return u.h||(u.h=u.i())}function Ck(){}var Fa={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Wp(){Ie.call(this,"d")}m(Wp,Ie);function Hp(){Ie.call(this,"c")}m(Hp,Ie);var is={},g0=null;function Gp(){return g0=g0||new he}is.La="serverreachability";function v0(u){Ie.call(this,is.La,u)}m(v0,Ie);function Ua(u){const h=Gp();ce(h,new v0(h))}is.STAT_EVENT="statevent";function y0(u,h){Ie.call(this,is.STAT_EVENT,u),this.stat=h}m(y0,Ie);function dn(u){const h=Gp();ce(h,new y0(h,u))}is.Ma="timingevent";function b0(u,h){Ie.call(this,is.Ma,u),this.size=h}m(b0,Ie);function Ba(u,h){if(typeof u!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){u()},h)}function za(){this.g=!0}za.prototype.xa=function(){this.g=!1};function Ok(u,h,v,T,V,K){u.info(function(){if(u.g)if(K)for(var fe="",ot=K.split("&"),Vt=0;VtT.length)){var V=T[1];if(Array.isArray(V)&&!(1>V.length)){var K=V[0];if(K!="noop"&&K!="stop"&&K!="close")for(var fe=1;feXt)&&(Xt!=3||this.g&&(this.h.h||this.g.oa()||V0(this.g)))){this.J||Xt!=4||h==7||(h==8||0>=ls?Ua(3):Ua(2)),Qp(this);var v=this.g.Z();this.X=v;t:if(x0(this)){var T=V0(this.g);u="";var V=T.length,K=oi(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){bo(this),Va(this);var fe="";break t}this.h.i=new a.TextDecoder}for(h=0;hh.length?Yp:(h=h.slice(T,T+v),u.C=T+v,h)))}Pi.prototype.cancel=function(){this.J=!0,bo(this)};function Xu(u){u.S=Date.now()+u.I,E0(u,u.I)}function E0(u,h){if(u.B!=null)throw Error("WatchDog timer not null");u.B=Ba(p(u.ba,u),h)}function Qp(u){u.B&&(a.clearTimeout(u.B),u.B=null)}Pi.prototype.ba=function(){this.B=null;const u=Date.now();0<=u-this.S?(kk(this.i,this.A),this.L!=2&&(Ua(),dn(17)),bo(this),this.s=2,Va(this)):E0(this,this.S-u)};function Va(u){u.j.G==0||u.J||X0(u.j,u)}function bo(u){Qp(u);var h=u.M;h&&typeof h.ma=="function"&&h.ma(),u.M=null,Ii(u.U),u.g&&(h=u.g,u.g=null,h.abort(),h.ma())}function Jp(u,h){try{var v=u.j;if(v.G!=0&&(v.g==u||Zp(v.h,u))){if(!u.K&&Zp(v.h,u)&&v.G==3){try{var T=v.Da.g.parse(h)}catch{T=null}if(Array.isArray(T)&&T.length==3){var V=T;if(V[0]==0){e:if(!v.u){if(v.g)if(v.g.F+3e3V[2]&&v.F&&v.v==0&&!v.C&&(v.C=Ba(p(v.Za,v),6e3));if(1>=T0(v.h)&&v.ca){try{v.ca()}catch{}v.ca=void 0}}else So(v,11)}else if((u.K||v.g==u)&&oc(v),!b(h))for(V=v.Da.g.parse(h),h=0;h=u.j:!1}function T0(u){return u.h?1:u.g?u.g.size:0}function Zp(u,h){return u.h?u.h==h:u.g?u.g.has(h):!1}function eh(u,h){u.g?u.g.add(h):u.h=h}function k0(u,h){u.h&&u.h==h?u.h=null:u.g&&u.g.has(h)&&u.g.delete(h)}C0.prototype.cancel=function(){if(this.i=I0(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const u of this.g.values())u.cancel();this.g.clear()}};function I0(u){if(u.h!=null)return u.i.concat(u.h.D);if(u.g!=null&&u.g.size!==0){let h=u.i;for(const v of u.g.values())h=h.concat(v.D);return h}return y(u.i)}function Nk(u){if(u.V&&typeof u.V=="function")return u.V();if(typeof Map<"u"&&u instanceof Map||typeof Set<"u"&&u instanceof Set)return Array.from(u.values());if(typeof u=="string")return u.split("");if(l(u)){for(var h=[],v=u.length,T=0;Th)throw Error("Bad port number "+h);u.s=h}else u.s=null}function A0(u,h,v){h instanceof Ga?(u.i=h,Bk(u.i,u.h)):(v||(h=Ha(h,Fk)),u.i=new Ga(h,u.h))}function ft(u,h,v){u.i.set(h,v)}function Zu(u){return ft(u,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),u}function Wa(u,h){return u?h?decodeURI(u.replace(/%25/g,"%2525")):decodeURIComponent(u):""}function Ha(u,h,v){return typeof u=="string"?(u=encodeURI(u).replace(h,$k),v&&(u=u.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),u):null}function $k(u){return u=u.charCodeAt(0),"%"+(u>>4&15).toString(16)+(u&15).toString(16)}var N0=/[#\/\?@]/g,jk=/[#\?:]/g,Lk=/[#\?]/g,Fk=/[#\?@]/g,Uk=/#/g;function Ga(u,h){this.h=this.g=null,this.i=u||null,this.j=!!h}function Ri(u){u.g||(u.g=new Map,u.h=0,u.i&&Dk(u.i,function(h,v){u.add(decodeURIComponent(h.replace(/\+/g," ")),v)}))}e=Ga.prototype,e.add=function(u,h){Ri(this),this.i=null,u=ss(this,u);var v=this.g.get(u);return v||this.g.set(u,v=[]),v.push(h),this.h+=1,this};function M0(u,h){Ri(u),h=ss(u,h),u.g.has(h)&&(u.i=null,u.h-=u.g.get(h).length,u.g.delete(h))}function D0(u,h){return Ri(u),h=ss(u,h),u.g.has(h)}e.forEach=function(u,h){Ri(this),this.g.forEach(function(v,T){v.forEach(function(V){u.call(h,V,T,this)},this)},this)},e.na=function(){Ri(this);const u=Array.from(this.g.values()),h=Array.from(this.g.keys()),v=[];for(let T=0;T{T.abort(),Ai(v,"TestPingServer: timeout",!1,h)},1e4);fetch(u,{signal:T.signal}).then(K=>{clearTimeout(V),K.ok?Ai(v,"TestPingServer: ok",!0,h):Ai(v,"TestPingServer: server error",!1,h)}).catch(()=>{clearTimeout(V),Ai(v,"TestPingServer: error",!1,h)})}function Ai(u,h,v,T,V){try{V&&(V.onload=null,V.onerror=null,V.onabort=null,V.ontimeout=null),T(v)}catch{}}function Wk(){this.g=new Ek}function Hk(u,h,v){const T=v||"";try{P0(u,function(V,K){let fe=V;c(V)&&(fe=ri(V)),h.push(T+K+"="+encodeURIComponent(fe))})}catch(V){throw h.push(T+"type="+encodeURIComponent("_badmap")),V}}function ec(u){this.l=u.Ub||null,this.j=u.eb||!1}m(ec,Vp),ec.prototype.g=function(){return new tc(this.l,this.j)},ec.prototype.i=function(u){return function(){return u}}({});function tc(u,h){he.call(this),this.D=u,this.o=h,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}m(tc,he),e=tc.prototype,e.open=function(u,h){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=u,this.A=h,this.readyState=1,Ka(this)},e.send=function(u){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const h={headers:this.u,method:this.B,credentials:this.m,cache:void 0};u&&(h.body=u),(this.D||a).fetch(new Request(this.A,h)).then(this.Sa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,qa(this)),this.readyState=0},e.Sa=function(u){if(this.g&&(this.l=u,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=u.headers,this.readyState=2,Ka(this)),this.g&&(this.readyState=3,Ka(this),this.g)))if(this.responseType==="arraybuffer")u.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in u){if(this.j=u.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.v=new TextDecoder;j0(this)}else u.text().then(this.Ra.bind(this),this.ga.bind(this))};function j0(u){u.j.read().then(u.Pa.bind(u)).catch(u.ga.bind(u))}e.Pa=function(u){if(this.g){if(this.o&&u.value)this.response.push(u.value);else if(!this.o){var h=u.value?u.value:new Uint8Array(0);(h=this.v.decode(h,{stream:!u.done}))&&(this.response=this.responseText+=h)}u.done?qa(this):Ka(this),this.readyState==3&&j0(this)}},e.Ra=function(u){this.g&&(this.response=this.responseText=u,qa(this))},e.Qa=function(u){this.g&&(this.response=u,qa(this))},e.ga=function(){this.g&&qa(this)};function qa(u){u.readyState=4,u.l=null,u.j=null,u.v=null,Ka(u)}e.setRequestHeader=function(u,h){this.u.append(u,h)},e.getResponseHeader=function(u){return this.h&&this.h.get(u.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const u=[],h=this.h.entries();for(var v=h.next();!v.done;)v=v.value,u.push(v[0]+": "+v[1]),v=h.next();return u.join(`\r +`)};function Ka(u){u.onreadystatechange&&u.onreadystatechange.call(u)}Object.defineProperty(tc.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(u){this.m=u?"include":"same-origin"}});function L0(u){let h="";return D(u,function(v,T){h+=T,h+=":",h+=v,h+=`\r +`}),h}function th(u,h,v){e:{for(T in v){var T=!1;break e}T=!0}T||(v=L0(v),typeof u=="string"?v!=null&&encodeURIComponent(String(v)):ft(u,h,v))}function Ct(u){he.call(this),this.headers=new Map,this.o=u||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}m(Ct,he);var Gk=/^https?$/i,qk=["POST","PUT"];e=Ct.prototype,e.Ha=function(u){this.J=u},e.ea=function(u,h,v,T){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+u);h=h?h.toUpperCase():"GET",this.D=u,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():Kp.g(),this.v=this.o?m0(this.o):m0(Kp),this.g.onreadystatechange=p(this.Ea,this);try{this.B=!0,this.g.open(h,String(u),!0),this.B=!1}catch(K){F0(this,K);return}if(u=v||"",v=new Map(this.headers),T)if(Object.getPrototypeOf(T)===Object.prototype)for(var V in T)v.set(V,T[V]);else if(typeof T.keys=="function"&&typeof T.get=="function")for(const K of T.keys())v.set(K,T.get(K));else throw Error("Unknown input type for opt_headers: "+String(T));T=Array.from(v.keys()).find(K=>K.toLowerCase()=="content-type"),V=a.FormData&&u instanceof a.FormData,!(0<=Array.prototype.indexOf.call(qk,h,void 0))||T||V||v.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[K,fe]of v)this.g.setRequestHeader(K,fe);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{z0(this),this.u=!0,this.g.send(u),this.u=!1}catch(K){F0(this,K)}};function F0(u,h){u.h=!1,u.g&&(u.j=!0,u.g.abort(),u.j=!1),u.l=h,u.m=5,U0(u),nc(u)}function U0(u){u.A||(u.A=!0,ce(u,"complete"),ce(u,"error"))}e.abort=function(u){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=u||7,ce(this,"complete"),ce(this,"abort"),nc(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),nc(this,!0)),Ct.aa.N.call(this)},e.Ea=function(){this.s||(this.B||this.u||this.j?B0(this):this.bb())},e.bb=function(){B0(this)};function B0(u){if(u.h&&typeof s<"u"&&(!u.v[1]||oi(u)!=4||u.Z()!=2)){if(u.u&&oi(u)==4)Ce(u.Ea,0,u);else if(ce(u,"readystatechange"),oi(u)==4){u.h=!1;try{const fe=u.Z();e:switch(fe){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var h=!0;break e;default:h=!1}var v;if(!(v=h)){var T;if(T=fe===0){var V=String(u.D).match(R0)[1]||null;!V&&a.self&&a.self.location&&(V=a.self.location.protocol.slice(0,-1)),T=!Gk.test(V?V.toLowerCase():"")}v=T}if(v)ce(u,"complete"),ce(u,"success");else{u.m=6;try{var K=2{}:null;u.g=null,u.v=null,h||ce(u,"ready");try{v.onreadystatechange=T}catch{}}}function z0(u){u.I&&(a.clearTimeout(u.I),u.I=null)}e.isActive=function(){return!!this.g};function oi(u){return u.g?u.g.readyState:0}e.Z=function(){try{return 2=u.h.j-(u.s?1:0)?!1:u.s?(u.i=h.D.concat(u.i),!0):u.G==1||u.G==2||u.B>=(u.Va?0:u.Wa)?!1:(u.s=Ba(p(u.Ga,u,h),Q0(u,u.B)),u.B++,!0)}e.Ga=function(u){if(this.s)if(this.s=null,this.G==1){if(!u){this.U=Math.floor(1e5*Math.random()),u=this.U++;const V=new Pi(this,this.j,u);let K=this.o;if(this.S&&(K?(K=x(K),I(K,this.S)):K=this.S),this.m!==null||this.O||(V.H=K,K=null),this.P)e:{for(var h=0,v=0;vGe)K=Math.max(0,V[Vt].g-100),ot=!1;else try{Hk(Yt,fe,"req"+Ge+"_")}catch{T&&T(Yt)}}if(ot){T=fe.join("&");break e}}}return u=u.i.splice(0,v),h.D=u,T}function K0(u){if(!u.g&&!u.u){u.Y=1;var h=u.Fa;B||se(),W||(B(),W=!0),J.add(h,u),u.v=0}}function rh(u){return u.g||u.u||3<=u.v?!1:(u.Y++,u.u=Ba(p(u.Fa,u),Q0(u,u.v)),u.v++,!0)}e.Fa=function(){if(this.u=null,Y0(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var u=2*this.R;this.j.info("BP detection timer enabled: "+u),this.A=Ba(p(this.ab,this),u)}},e.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,dn(10),rc(this),Y0(this))};function ih(u){u.A!=null&&(a.clearTimeout(u.A),u.A=null)}function Y0(u){u.g=new Pi(u,u.j,"rpc",u.Y),u.m===null&&(u.g.H=u.o),u.g.O=0;var h=ii(u.qa);ft(h,"RID","rpc"),ft(h,"SID",u.K),ft(h,"AID",u.T),ft(h,"CI",u.F?"0":"1"),!u.F&&u.ja&&ft(h,"TO",u.ja),ft(h,"TYPE","xmlhttp"),Xa(u,h),u.m&&u.o&&th(h,u.m,u.o),u.L&&(u.g.I=u.L);var v=u.g;u=u.ia,v.L=1,v.v=Zu(ii(h)),v.m=null,v.P=!0,_0(v,u)}e.Za=function(){this.C!=null&&(this.C=null,rc(this),rh(this),dn(19))};function oc(u){u.C!=null&&(a.clearTimeout(u.C),u.C=null)}function X0(u,h){var v=null;if(u.g==h){oc(u),ih(u),u.g=null;var T=2}else if(Zp(u.h,h))v=h.D,k0(u.h,h),T=1;else return;if(u.G!=0){if(h.o)if(T==1){v=h.m?h.m.length:0,h=Date.now()-h.F;var V=u.B;T=Gp(),ce(T,new b0(T,v)),ic(u)}else K0(u);else if(V=h.s,V==3||V==0&&0`${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 Vs{constructor(){this.promise=new Promise((t,n)=>{this.resolve=t,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 xO{constructor(t,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${t}`)}}class gM{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,n){t.enqueueRetryable(()=>n(tn.UNAUTHENTICATED))}shutdown(){}}class vM{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,n){this.changeListener=n,t.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class yM{constructor(t){this.t=t,this.currentUser=tn.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(t,n){let r=this.i;const i=l=>this.i!==r?(r=this.i,n(l)):Promise.resolve();let o=new Vs;this.o=()=>{this.i++,this.currentUser=this.u(),o.resolve(),o=new Vs,t.enqueueRetryable(()=>i(this.currentUser))};const s=()=>{const l=o;t.enqueueRetryable(async()=>{await l.promise,await i(this.currentUser)})},a=l=>{Bn("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=l,this.auth.addAuthTokenListener(this.o),s()};this.t.onInit(l=>a(l)),setTimeout(()=>{if(!this.auth){const l=this.t.getImmediate({optional:!0});l?a(l):(Bn("FirebaseAuthCredentialsProvider","Auth not yet detected"),o.resolve(),o=new Vs)}},0),s()}getToken(){const t=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==t?(Bn("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(_g(typeof r.accessToken=="string"),new xO(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const t=this.auth&&this.auth.getUid();return _g(t===null||typeof t=="string"),new tn(t)}}class bM{constructor(t,n,r){this.l=t,this.h=n,this.P=r,this.type="FirstParty",this.user=tn.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const t=this.T();return t&&this.I.set("Authorization",t),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class wM{constructor(t,n,r){this.l=t,this.h=n,this.P=r}getToken(){return Promise.resolve(new bM(this.l,this.h,this.P))}start(t,n){t.enqueueRetryable(()=>n(tn.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class SM{constructor(t){this.value=t,this.type="AppCheck",this.headers=new Map,t&&t.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class _M{constructor(t){this.A=t,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(t,n){const r=o=>{o.error!=null&&Bn("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);const s=o.token!==this.R;return this.R=o.token,Bn("FirebaseAppCheckTokenProvider",`Received ${s?"new":"existing"} token.`),s?n(o.token):Promise.resolve()};this.o=o=>{t.enqueueRetryable(()=>r(o))};const i=o=>{Bn("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=o,this.appCheck.addTokenListener(this.o)};this.A.onInit(o=>i(o)),setTimeout(()=>{if(!this.appCheck){const o=this.A.getImmediate({optional:!0});o?i(o):Bn("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const t=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(t).then(n=>n?(_g(typeof n.token=="string"),this.R=n.token,new SM(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.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. + */function xM(e){const t=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&typeof t.getRandomValues=="function")t.getRandomValues(n);else for(let r=0;r0&&Bn("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.ko} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.qo=this.oi.enqueueAfterDelay(this.timerId,i,()=>(this.Qo=Date.now(),t())),this.ko*=this.Lo,this.kothis.Bo&&(this.ko=this.Bo)}Wo(){this.qo!==null&&(this.qo.skipDelay(),this.qo=null)}cancel(){this.qo!==null&&(this.qo.cancel(),this.qo=null)}Uo(){return(Math.random()-.5)*this.ko}}/** + * @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 fy{constructor(t,n,r,i,o){this.asyncQueue=t,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=o,this.deferred=new Vs,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(s=>{})}get promise(){return this.deferred.promise}static createAndSchedule(t,n,r,i,o){const s=Date.now()+r,a=new fy(t,n,s,i,o);return a.start(r),a}start(t){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new an(sn.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(t=>this.deferred.resolve(t))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function TM(e,t){if(ly("AsyncQueue",`${t}: ${e}`),EO(e))return new an(sn.UNAVAILABLE,`${t}: ${e}`);throw e}var pw,hw;(hw=pw||(pw={})).J_="default",hw.Cache="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 kM{constructor(t,n,r,i){this.authCredentials=t,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=tn.UNAUTHENTICATED,this.clientId=EM.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(r,async o=>{Bn("FirestoreClient","Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(Bn("FirestoreClient","Received new app check token=",o),this.appCheckCredentialListener(o,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(t){this.authCredentialListener=t}setAppCheckTokenChangeListener(t){this.appCheckCredentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new an(sn.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new Vs;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),t.resolve()}catch(n){const r=TM(n,"Failed to shutdown persistence");t.reject(r)}}),t.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 CO(e){const t={};return e.timeoutSeconds!==void 0&&(t.timeoutSeconds=e.timeoutSeconds),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. + */const mw=new Map;function IM(e,t,n,r){if(t===!0&&r===!0)throw new an(sn.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}function PM(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return""+e;if(typeof e=="object"){if(e instanceof Array)return"an array";{const t=function(r){return r.constructor?r.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return typeof e=="function"?"a function":cy()}function RM(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new an(sn.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=PM(e);throw new an(sn.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return 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. + */class gw{constructor(t){var n,r;if(t.host===void 0){if(t.ssl!==void 0)throw new an(sn.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=(n=t.ssl)===null||n===void 0||n;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,this.localCache=t.localCache,t.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(t.cacheSizeBytes!==-1&&t.cacheSizeBytes<1048576)throw new an(sn.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}IM("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:t.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=CO((r=t.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(o){if(o.timeoutSeconds!==void 0){if(isNaN(o.timeoutSeconds))throw new an(sn.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (must not be NaN)`);if(o.timeoutSeconds<5)throw new an(sn.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (minimum allowed value is 5)`);if(o.timeoutSeconds>30)throw new an(sn.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!t.useFetchStreams}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,t.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}}class OO{constructor(t,n,r,i){this._authCredentials=t,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new gw({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new an(sn.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!==void 0}_setSettings(t){if(this._settingsFrozen)throw new an(sn.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 gw(t),t.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new gM;switch(r.type){case"firstParty":return new wM(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new an(sn.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=mw.get(n);r&&(Bn("ComponentProvider","Removing Datastore"),mw.delete(n),r.terminate())}(this),Promise.resolve()}}function AM(e,t,n,r={}){var i;const o=(e=RM(e,OO))._getSettings(),s=`${t}:${n}`;if(o.host!=="firestore.googleapis.com"&&o.host!==s&&mM("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},o),{host:s,ssl:!1})),r.mockUserToken){let a,l;if(typeof r.mockUserToken=="string")a=r.mockUserToken,l=tn.MOCK_USER;else{a=q3(r.mockUserToken,(i=e._app)===null||i===void 0?void 0:i.options.projectId);const c=r.mockUserToken.sub||r.mockUserToken.user_id;if(!c)throw new an(sn.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");l=new tn(c)}e._authCredentials=new vM(new xO(a,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 NM{constructor(){this.iu=Promise.resolve(),this.su=[],this.ou=!1,this._u=[],this.au=null,this.uu=!1,this.cu=!1,this.lu=[],this.Yo=new OM(this,"async_queue_retry"),this.hu=()=>{const n=Hh();n&&Bn("AsyncQueue","Visibility state changed to "+n.visibilityState),this.Yo.Wo()};const t=Hh();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.hu)}get isShuttingDown(){return this.ou}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.Pu(),this.Iu(t)}enterRestrictedMode(t){if(!this.ou){this.ou=!0,this.cu=t||!1;const n=Hh();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.hu)}}enqueue(t){if(this.Pu(),this.ou)return new Promise(()=>{});const n=new Vs;return this.Iu(()=>this.ou&&this.cu?Promise.resolve():(t().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(t){this.enqueueAndForget(()=>(this.su.push(t),this.Tu()))}async Tu(){if(this.su.length!==0){try{await this.su[0](),this.su.shift(),this.Yo.reset()}catch(t){if(!EO(t))throw t;Bn("AsyncQueue","Operation failed with retryable error: "+t)}this.su.length>0&&this.Yo.$o(()=>this.Tu())}}Iu(t){const n=this.iu.then(()=>(this.uu=!0,t().catch(r=>{this.au=r,this.uu=!1;const i=function(s){let a=s.message||"";return s.stack&&(a=s.stack.includes(s.message)?s.stack:s.message+` +`+s.stack),a}(r);throw ly("INTERNAL UNHANDLED ERROR: ",i),r}).then(r=>(this.uu=!1,r))));return this.iu=n,n}enqueueAfterDelay(t,n,r){this.Pu(),this.lu.indexOf(t)>-1&&(n=0);const i=fy.createAndSchedule(this,t,n,r,o=>this.Eu(o));return this._u.push(i),i}Pu(){this.au&&cy()}verifyOperationInProgress(){}async du(){let t;do t=this.iu,await t;while(t!==this.iu)}Au(t){for(const n of this._u)if(n.timerId===t)return!0;return!1}Ru(t){return this.du().then(()=>{this._u.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this._u)if(n.skipDelay(),t!=="all"&&n.timerId===t)break;return this.du()})}Vu(t){this.lu.push(t)}Eu(t){const n=this._u.indexOf(t);this._u.splice(n,1)}}class MM extends OO{constructor(t,n,r,i){super(t,n,r,i),this.type="firestore",this._queue=function(){return new NM}(),this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||$M(this),this._firestoreClient.terminate()}}function DM(e,t){const n=typeof e=="object"?e:bO(),r=typeof e=="string"?e:"(default)",i=ay(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const o=H3("firestore");o&&AM(i,...o)}return i}function $M(e){var t,n,r;const i=e._freezeSettings(),o=function(a,l,c,f){return new CM(a,l,c,f.host,f.ssl,f.experimentalForceLongPolling,f.experimentalAutoDetectLongPolling,CO(f.experimentalLongPollingOptions),f.useFetchStreams)}(e._databaseId,((t=e._app)===null||t===void 0?void 0:t.options.appId)||"",e._persistenceKey,i);e._firestoreClient=new kM(e._authCredentials,e._appCheckCredentials,e._queue,o),!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.localCache.kind,_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider})}(function(t,n=!0){(function(i){Ru=i})(Ia),fa(new Yo("firestore",(r,{instanceIdentifier:i,options:o})=>{const s=r.getProvider("app").getImmediate(),a=new MM(new yM(r.getProvider("auth-internal")),new _M(r.getProvider("app-check-internal")),function(c,f){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new an(sn.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new sd(c.options.projectId,f)}(s,i),s);return o=Object.assign({useFetchStreams:n},o),a._setSettings(o),a},"PUBLIC").setMultipleInstances(!0)),ao(fw,"4.6.3",t),ao(fw,"4.6.3","esm2017")})();var xg=function(e,t){return xg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},xg(e,t)};function TO(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ad=function(){return ad=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,n,o):s(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function IO(e,t){return function(n,r){t(n,r,e)}}function jM(e,t,n,r,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=r.kind,l=a==="getter"?"get":a==="setter"?"set":"value",c=!t&&e?r.static?e:e.prototype:null,f=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),d,p=!1,g=n.length-1;g>=0;g--){var m={};for(var y in r)m[y]=y==="access"?{}:r[y];for(var y in r.access)m.access[y]=r.access[y];m.addInitializer=function(w){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var E=(0,n[g])(a==="accessor"?{get:f.get,set:f.set}:f[l],m);if(a==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(d=s(E.get))&&(f.get=d),(d=s(E.set))&&(f.set=d),(d=s(E.init))&&i.unshift(d)}else(d=s(E))&&(a==="field"?i.unshift(d):f[l]=d)}c&&Object.defineProperty(c,r.name,f),p=!0}function LM(e,t,n){for(var r=arguments.length>2,i=0;i0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function dy(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function MO(){for(var e=[],t=0;t1||l(g,y)})},m&&(i[g]=m(i[g])))}function l(g,m){try{c(r[g](m))}catch(y){p(o[0][3],y)}}function c(g){g.value instanceof pa?Promise.resolve(g.value.v).then(f,d):p(o[0][2],g)}function f(g){l("next",g)}function d(g){l("throw",g)}function p(g,m){g(m),o.shift(),o.length&&l(o[0][0],o[0][1])}}function LO(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(s){return(n=!n)?{value:pa(e[i](s)),done:!1}:o?o(s):s}:o}}function FO(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof ld=="function"?ld(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(s){return new Promise(function(a,l){s=e[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}}function UO(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var BM=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function BO(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&tp(t,e,n);return BM(t,e),t}function zO(e){return e&&e.__esModule?e:{default:e}}function VO(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function WO(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function HO(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function GO(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(i=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var zM=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function qO(e){function t(r){e.error=e.hasError?new zM(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}function n(){for(;e.stack.length;){var r=e.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,function(o){return t(o),n()})}catch(o){t(o)}}if(e.hasError)throw e.error}return n()}const VM={__extends:TO,__assign:ad,__rest:Au,__decorate:kO,__param:IO,__metadata:PO,__awaiter:RO,__generator:AO,__createBinding:tp,__exportStar:NO,__values:ld,__read:dy,__spread:MO,__spreadArrays:DO,__spreadArray:$O,__await:pa,__asyncGenerator:jO,__asyncDelegator:LO,__asyncValues:FO,__makeTemplateObject:UO,__importStar:BO,__importDefault:zO,__classPrivateFieldGet:VO,__classPrivateFieldSet:WO,__classPrivateFieldIn:HO,__addDisposableResource:GO,__disposeResources:qO},WM=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:GO,get __assign(){return ad},__asyncDelegator:LO,__asyncGenerator:jO,__asyncValues:FO,__await:pa,__awaiter:RO,__classPrivateFieldGet:VO,__classPrivateFieldIn:HO,__classPrivateFieldSet:WO,__createBinding:tp,__decorate:kO,__disposeResources:qO,__esDecorate:jM,__exportStar:NO,__extends:TO,__generator:AO,__importDefault:zO,__importStar:BO,__makeTemplateObject:UO,__metadata:PO,__param:IO,__propKey:FM,__read:dy,__rest:Au,__runInitializers:LM,__setFunctionName:UM,__spread:MO,__spreadArray:$O,__spreadArrays:DO,__values:ld,default:VM},Symbol.toStringTag,{value:"Module"}));function KO(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const HM=KO,YO=new Iu("auth","Firebase",KO());/** + * @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 ud=new oy("@firebase/auth");function GM(e,...t){ud.logLevel<=Ze.WARN&&ud.warn(`Auth (${Ia}): ${e}`,...t)}function lf(e,...t){ud.logLevel<=Ze.ERROR&&ud.error(`Auth (${Ia}): ${e}`,...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 ei(e,...t){throw hy(e,...t)}function Rr(e,...t){return hy(e,...t)}function py(e,t,n){const r=Object.assign(Object.assign({},HM()),{[t]:n});return new Iu("auth","Firebase",r).create(t,{appName:e.name})}function Bo(e){return py(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function qM(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&ei(e,"argument-error"),py(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function hy(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return YO.create(e,...t)}function Ae(e,t,...n){if(!e)throw hy(t,...n)}function yi(e){const t="INTERNAL ASSERTION FAILED: "+e;throw lf(t),new Error(t)}function Oi(e,t){e||yi(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 Eg(){var e;return typeof self<"u"&&((e=self.location)===null||e===void 0?void 0:e.href)||""}function KM(){return vw()==="http:"||vw()==="https:"}function vw(){var e;return typeof self<"u"&&((e=self.location)===null||e===void 0?void 0:e.protocol)||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 YM(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(KM()||Y3()||"connection"in navigator)?navigator.onLine:!0}function XM(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||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. + */class Nu{constructor(t,n){this.shortDelay=t,this.longDelay=n,Oi(n>t,"Short delay should be less than long delay!"),this.isMobile=K3()||X3()}get(){return YM()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** + * @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 my(e,t){Oi(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/** + * @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 XO{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;yi("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;yi("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;yi("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** + * @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 QM={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/** + * @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 JM=new Nu(3e4,6e4);function gy(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function Pa(e,t,n,r,i={}){return QO(e,i,async()=>{let o={},s={};r&&(t==="GET"?s=r:o={body:JSON.stringify(r)});const a=Pu(Object.assign({key:e.config.apiKey},s)).slice(1),l=await e._getAdditionalHeaders();return l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode),XO.fetch()(JO(e,e.config.apiHost,n,a),Object.assign({method:t,headers:l,referrerPolicy:"no-referrer"},o))})}async function QO(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},QM),t);try{const i=new e9(e),o=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const s=await o.json();if("needConfirmation"in s)throw Pc(e,"account-exists-with-different-credential",s);if(o.ok&&!("errorMessage"in s))return s;{const a=o.ok?s.errorMessage:s.error.message,[l,c]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw Pc(e,"credential-already-in-use",s);if(l==="EMAIL_EXISTS")throw Pc(e,"email-already-in-use",s);if(l==="USER_DISABLED")throw Pc(e,"user-disabled",s);const f=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw py(e,f,c);ei(e,f)}}catch(i){if(i instanceof ki)throw i;ei(e,"network-request-failed",{message:String(i)})}}async function ZM(e,t,n,r,i={}){const o=await Pa(e,t,n,r,i);return"mfaPendingCredential"in o&&ei(e,"multi-factor-auth-required",{_serverResponse:o}),o}function JO(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?my(e.config,i):`${e.config.apiScheme}://${i}`}class e9{constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(Rr(this.auth,"network-request-failed")),JM.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function Pc(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=Rr(e,t,r);return i.customData._tokenResponse=n,i}/** + * @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. + */async function t9(e,t){return Pa(e,"POST","/v1/accounts:delete",t)}async function ZO(e,t){return Pa(e,"POST","/v1/accounts:lookup",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 $l(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function n9(e,t=!1){const n=yo(e),r=await n.getIdToken(t),i=vy(r);Ae(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const o=typeof i.firebase=="object"?i.firebase:void 0,s=o==null?void 0:o.sign_in_provider;return{claims:i,token:r,authTime:$l(Gh(i.auth_time)),issuedAtTime:$l(Gh(i.iat)),expirationTime:$l(Gh(i.exp)),signInProvider:s||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function Gh(e){return Number(e)*1e3}function vy(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return lf("JWT malformed, contained fewer than 3 sections"),null;try{const i=dO(n);return i?JSON.parse(i):(lf("Failed to decode base64 JWT payload"),null)}catch(i){return lf("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function yw(e){const t=vy(e);return Ae(t,"internal-error"),Ae(typeof t.exp<"u","internal-error"),Ae(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/** + * @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. + */async function ou(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof ki&&r9(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function r9({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/** + * @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 i9{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){var n;if(t){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(t=!1){if(!this.isRunning)return;const n=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** + * @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 Cg{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=$l(this.lastLoginAt),this.creationTime=$l(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** + * @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. + */async function cd(e){var t;const n=e.auth,r=await e.getIdToken(),i=await ou(e,ZO(n,{idToken:r}));Ae(i==null?void 0:i.users.length,n,"internal-error");const o=i.users[0];e._notifyReloadListener(o);const s=!((t=o.providerUserInfo)===null||t===void 0)&&t.length?e2(o.providerUserInfo):[],a=s9(e.providerData,s),l=e.isAnonymous,c=!(e.email&&o.passwordHash)&&!(a!=null&&a.length),f=l?c:!1,d={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:a,metadata:new Cg(o.createdAt,o.lastLoginAt),isAnonymous:f};Object.assign(e,d)}async function o9(e){const t=yo(e);await cd(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function s9(e,t){return[...e.filter(r=>!t.some(i=>i.providerId===r.providerId)),...t]}function e2(e){return e.map(t=>{var{providerId:n}=t,r=Au(t,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||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. + */async function a9(e,t){const n=await QO(e,{},async()=>{const r=Pu({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:i,apiKey:o}=e.config,s=JO(e,i,"/v1/token",`key=${o}`),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",XO.fetch()(s,{method:"POST",headers:a,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function l9(e,t){return Pa(e,"POST","/v2/accounts:revokeToken",gy(e,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. + */class Ws{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Ae(t.idToken,"internal-error"),Ae(typeof t.idToken<"u","internal-error"),Ae(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):yw(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Ae(t.length!==0,"internal-error");const n=yw(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Ae(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,n){const{accessToken:r,refreshToken:i,expiresIn:o}=await a9(t,n);this.updateTokensAndExpiration(r,i,Number(o))}updateTokensAndExpiration(t,n,r){this.refreshToken=n||null,this.accessToken=t||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(t,n){const{refreshToken:r,accessToken:i,expirationTime:o}=n,s=new Ws;return r&&(Ae(typeof r=="string","internal-error",{appName:t}),s.refreshToken=r),i&&(Ae(typeof i=="string","internal-error",{appName:t}),s.accessToken=i),o&&(Ae(typeof o=="number","internal-error",{appName:t}),s.expirationTime=o),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new Ws,this.toJSON())}_performRefresh(){return yi("not implemented")}}/** + * @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 Mi(e,t){Ae(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class bi{constructor(t){var{uid:n,auth:r,stsTokenManager:i}=t,o=Au(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new i9(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new Cg(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(t){const n=await ou(this,this.stsTokenManager.getToken(this.auth,t));return Ae(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return n9(this,t)}reload(){return o9(this)}_assign(t){this!==t&&(Ae(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>Object.assign({},n)),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new bi(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(t){Ae(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await cd(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(vi(this.auth.app))return Promise.reject(Bo(this.auth));const t=await this.getIdToken();return await ou(this,t9(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>Object.assign({},t)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){var r,i,o,s,a,l,c,f;const d=(r=n.displayName)!==null&&r!==void 0?r:void 0,p=(i=n.email)!==null&&i!==void 0?i:void 0,g=(o=n.phoneNumber)!==null&&o!==void 0?o:void 0,m=(s=n.photoURL)!==null&&s!==void 0?s:void 0,y=(a=n.tenantId)!==null&&a!==void 0?a:void 0,E=(l=n._redirectEventId)!==null&&l!==void 0?l:void 0,w=(c=n.createdAt)!==null&&c!==void 0?c:void 0,b=(f=n.lastLoginAt)!==null&&f!==void 0?f:void 0,{uid:_,emailVerified:P,isAnonymous:R,providerData:D,stsTokenManager:S}=n;Ae(_&&S,t,"internal-error");const x=Ws.fromJSON(this.name,S);Ae(typeof _=="string",t,"internal-error"),Mi(d,t.name),Mi(p,t.name),Ae(typeof P=="boolean",t,"internal-error"),Ae(typeof R=="boolean",t,"internal-error"),Mi(g,t.name),Mi(m,t.name),Mi(y,t.name),Mi(E,t.name),Mi(w,t.name),Mi(b,t.name);const C=new bi({uid:_,auth:t,email:p,emailVerified:P,displayName:d,isAnonymous:R,photoURL:m,phoneNumber:g,tenantId:y,stsTokenManager:x,createdAt:w,lastLoginAt:b});return D&&Array.isArray(D)&&(C.providerData=D.map(I=>Object.assign({},I))),E&&(C._redirectEventId=E),C}static async _fromIdTokenResponse(t,n,r=!1){const i=new Ws;i.updateFromServerResponse(n);const o=new bi({uid:n.localId,auth:t,stsTokenManager:i,isAnonymous:r});return await cd(o),o}static async _fromGetAccountInfoResponse(t,n,r){const i=n.users[0];Ae(i.localId!==void 0,"internal-error");const o=i.providerUserInfo!==void 0?e2(i.providerUserInfo):[],s=!(i.email&&i.passwordHash)&&!(o!=null&&o.length),a=new Ws;a.updateFromIdToken(r);const l=new bi({uid:i.localId,auth:t,stsTokenManager:a,isAnonymous:s}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new Cg(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,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. + */const bw=new Map;function wi(e){Oi(e instanceof Function,"Expected a class definition");let t=bw.get(e);return t?(Oi(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,bw.set(e,t),t)}/** + * @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 t2{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,n){this.storage[t]=n}async _get(t){const n=this.storage[t];return n===void 0?null:n}async _remove(t){delete this.storage[t]}_addListener(t,n){}_removeListener(t,n){}}t2.type="NONE";const ww=t2;/** + * @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. + */function uf(e,t,n){return`firebase:${e}:${t}:${n}`}class Hs{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:i,name:o}=this.auth;this.fullUserKey=uf(this.userKey,i.apiKey,o),this.fullPersistenceKey=uf("persistence",i.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);return t?bi._fromJSON(this.auth,t):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,n,r="authUser"){if(!n.length)return new Hs(wi(ww),t,r);const i=(await Promise.all(n.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let o=i[0]||wi(ww);const s=uf(r,t.config.apiKey,t.name);let a=null;for(const c of n)try{const f=await c._get(s);if(f){const d=bi._fromJSON(t,f);c!==o&&(a=d),o=c;break}}catch{}const l=i.filter(c=>c._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new Hs(o,t,r):(o=l[0],a&&await o._set(s,a.toJSON()),await Promise.all(n.map(async c=>{if(c!==o)try{await c._remove(s)}catch{}})),new Hs(o,t,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. + */function Sw(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(i2(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(n2(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(s2(t))return"Blackberry";if(a2(t))return"Webos";if(yy(t))return"Safari";if((t.includes("chrome/")||r2(t))&&!t.includes("edge/"))return"Chrome";if(o2(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function n2(e=cn()){return/firefox\//i.test(e)}function yy(e=cn()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function r2(e=cn()){return/crios\//i.test(e)}function i2(e=cn()){return/iemobile/i.test(e)}function o2(e=cn()){return/android/i.test(e)}function s2(e=cn()){return/blackberry/i.test(e)}function a2(e=cn()){return/webos/i.test(e)}function np(e=cn()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function u9(e=cn()){var t;return np(e)&&!!(!((t=window.navigator)===null||t===void 0)&&t.standalone)}function c9(){return Q3()&&document.documentMode===10}function l2(e=cn()){return np(e)||o2(e)||a2(e)||s2(e)||/windows phone/i.test(e)||i2(e)}function f9(){try{return!!(window&&window!==window.top)}catch{return!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. + */function u2(e,t=[]){let n;switch(e){case"Browser":n=Sw(cn());break;case"Worker":n=`${Sw(cn())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${Ia}/${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 d9{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,n){const r=o=>new Promise((s,a)=>{try{const l=t(o);s(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const n=[];try{for(const r of this.queue)await r(t),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/** + * @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. + */async function p9(e,t={}){return Pa(e,"GET","/v2/passwordPolicy",gy(e,t))}/** + * @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. + */const h9=6;class m9{constructor(t){var n,r,i,o;const s=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=s.minPasswordLength)!==null&&n!==void 0?n:h9,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),s.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),s.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),s.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),s.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=t.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(o=t.forceUpgradeOnSignin)!==null&&o!==void 0?o:!1,this.schemaVersion=t.schemaVersion}validatePassword(t){var n,r,i,o,s,a;const l={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,l),this.validatePasswordCharacterOptions(t,l),l.isValid&&(l.isValid=(n=l.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),l.isValid&&(l.isValid=(r=l.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),l.isValid&&(l.isValid=(i=l.containsLowercaseLetter)!==null&&i!==void 0?i:!0),l.isValid&&(l.isValid=(o=l.containsUppercaseLetter)!==null&&o!==void 0?o:!0),l.isValid&&(l.isValid=(s=l.containsNumericCharacter)!==null&&s!==void 0?s:!0),l.isValid&&(l.isValid=(a=l.containsNonAlphanumericCharacter)!==null&&a!==void 0?a:!0),l}validatePasswordLengthOptions(t,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=t.length>=r),i&&(n.meetsMaxPasswordLength=t.length<=i)}validatePasswordCharacterOptions(t,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(t,n,r,i,o){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=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. + */class g9{constructor(t,n,r,i){this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new _w(this),this.idTokenSubscription=new _w(this),this.beforeStateQueue=new d9(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=YO,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=wi(n)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await Hs.create(this,t),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const n=await ZO(this,{idToken:t}),r=await bi._fromGetAccountInfoResponse(this,n,t);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var n;if(vi(this.app)){const s=this.app.settings.authIdToken;return s?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(a,a))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let i=r,o=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const s=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=i==null?void 0:i._redirectEventId,l=await this.tryRedirectSignIn(t);(!s||s===a)&&(l!=null&&l.user)&&(i=l.user,o=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(i)}catch(s){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return Ae(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(t){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(t){try{await cd(t)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=XM()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(vi(this.app))return Promise.reject(Bo(this));const n=t?yo(t):null;return n&&Ae(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(t,n=!1){if(!this._deleted)return t&&Ae(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return vi(this.app)?Promise.reject(Bo(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return vi(this.app)?Promise.reject(Bo(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(wi(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await p9(this),n=new m9(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(t){this._errorFactory=new Iu("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}async revokeAccessToken(t){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await l9(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)===null||t===void 0?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&wi(t)||this._popupRedirectResolver;Ae(n,this,"argument-error"),this.redirectPersistenceManager=await Hs.create(this,[wi(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(t=this.currentUser)===null||t===void 0?void 0:t.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,i){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let s=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Ae(a,this,"internal-error"),a.then(()=>{s||o(this.currentUser)}),typeof n=="function"){const l=t.addObserver(n,r,i);return()=>{s=!0,l()}}else{const l=t.addObserver(n);return()=>{s=!0,l()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Ae(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=u2(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var t;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((t=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var t;const n=await((t=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getToken());return n!=null&&n.error&&GM(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function rp(e){return yo(e)}class _w{constructor(t){this.auth=t,this.observer=null,this.addObserver=iN(n=>this.observer=n)}get next(){return Ae(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** + * @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. + */let by={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function v9(e){by=e}function y9(e){return by.loadJS(e)}function b9(){return by.gapiScript}function w9(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/** + * @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 S9(e,t){const n=ay(e,"auth");if(n.isInitialized()){const i=n.getImmediate(),o=n.getOptions();if(id(o,t??{}))return i;ei(i,"already-initialized")}return n.initialize({options:t})}function _9(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(wi);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function x9(e,t,n){const r=rp(e);Ae(r._canInitEmulator,r,"emulator-config-failed"),Ae(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!1,o=c2(t),{host:s,port:a}=E9(t),l=a===null?"":`:${a}`;r.config.emulator={url:`${o}//${s}${l}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:s,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),C9()}function c2(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function E9(e){const t=c2(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const o=i[1];return{host:o,port:xw(r.substr(o.length+1))}}else{const[o,s]=r.split(":");return{host:o,port:xw(s)}}}function xw(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function C9(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):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. + */class f2{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return yi("not implemented")}_getIdTokenResponse(t){return yi("not implemented")}_linkToIdToken(t,n){return yi("not implemented")}_getReauthenticationResolver(t){return yi("not implemented")}}/** + * @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. + */async function Gs(e,t){return ZM(e,"POST","/v1/accounts:signInWithIdp",gy(e,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. + */const O9="http://localhost";class Qo extends f2{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new Qo(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):ei("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:i}=n,o=Au(n,["providerId","signInMethod"]);if(!r||!i)return null;const s=new Qo(r,i);return s.idToken=o.idToken||void 0,s.accessToken=o.accessToken||void 0,s.secret=o.secret,s.nonce=o.nonce,s.pendingToken=o.pendingToken||null,s}_getIdTokenResponse(t){const n=this.buildRequest();return Gs(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,Gs(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,Gs(t,n)}buildRequest(){const t={requestUri:O9,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=Pu(n)}return 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. + */class wy{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/** + * @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 Mu extends wy{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/** + * @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 Bi extends Mu{constructor(){super("facebook.com")}static credential(t){return Qo._fromParams({providerId:Bi.PROVIDER_ID,signInMethod:Bi.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Bi.credentialFromTaggedObject(t)}static credentialFromError(t){return Bi.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Bi.credential(t.oauthAccessToken)}catch{return null}}}Bi.FACEBOOK_SIGN_IN_METHOD="facebook.com";Bi.PROVIDER_ID="facebook.com";/** + * @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 pi extends Mu{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return Qo._fromParams({providerId:pi.PROVIDER_ID,signInMethod:pi.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return pi.credentialFromTaggedObject(t)}static credentialFromError(t){return pi.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return pi.credential(n,r)}catch{return null}}}pi.GOOGLE_SIGN_IN_METHOD="google.com";pi.PROVIDER_ID="google.com";/** + * @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 zi extends Mu{constructor(){super("github.com")}static credential(t){return Qo._fromParams({providerId:zi.PROVIDER_ID,signInMethod:zi.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return zi.credentialFromTaggedObject(t)}static credentialFromError(t){return zi.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return zi.credential(t.oauthAccessToken)}catch{return null}}}zi.GITHUB_SIGN_IN_METHOD="github.com";zi.PROVIDER_ID="github.com";/** + * @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 Vi extends Mu{constructor(){super("twitter.com")}static credential(t,n){return Qo._fromParams({providerId:Vi.PROVIDER_ID,signInMethod:Vi.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return Vi.credentialFromTaggedObject(t)}static credentialFromError(t){return Vi.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return Vi.credential(n,r)}catch{return null}}}Vi.TWITTER_SIGN_IN_METHOD="twitter.com";Vi.PROVIDER_ID="twitter.com";/** + * @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 ha{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,n,r,i=!1){const o=await bi._fromIdTokenResponse(t,r,i),s=Ew(r);return new ha({user:o,providerId:s,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const i=Ew(r);return new ha({user:t,providerId:i,_tokenResponse:r,operationType:n})}}function Ew(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":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. + */class fd extends ki{constructor(t,n,r,i){var o;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,fd.prototype),this.customData={appName:t.name,tenantId:(o=t.tenantId)!==null&&o!==void 0?o:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,i){return new fd(t,n,r,i)}}function d2(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?fd._fromErrorAndOperation(e,o,t,r):o})}async function T9(e,t,n=!1){const r=await ou(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ha._forOperation(e,"link",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. + */async function k9(e,t,n=!1){const{auth:r}=e;if(vi(r.app))return Promise.reject(Bo(r));const i="reauthenticate";try{const o=await ou(e,d2(r,i,t,e),n);Ae(o.idToken,r,"internal-error");const s=vy(o.idToken);Ae(s,r,"internal-error");const{sub:a}=s;return Ae(e.uid===a,r,"user-mismatch"),ha._forOperation(e,i,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&ei(r,"user-mismatch"),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. + */async function I9(e,t,n=!1){if(vi(e.app))return Promise.reject(Bo(e));const r="signIn",i=await d2(e,r,t),o=await ha._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(o.user),o}function P9(e,t,n,r){return yo(e).onIdTokenChanged(t,n,r)}function R9(e,t,n){return yo(e).beforeAuthStateChanged(t,n)}function A9(e,t,n,r){return yo(e).onAuthStateChanged(t,n,r)}function N9(e){return yo(e).signOut()}const dd="__sak";/** + * @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 p2{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(dd,"1"),this.storage.removeItem(dd),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/** + * @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 M9(){const e=cn();return yy(e)||np(e)}const D9=1e3,$9=10;class h2 extends p2{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=M9()&&f9(),this.fallbackToPolling=l2(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&t(n,i,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((s,a,l)=>{this.notifyListeners(s,l)});return}const r=t.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const s=this.storage.getItem(r);if(t.newValue!==s)t.newValue!==null?this.storage.setItem(r,t.newValue):this.storage.removeItem(r);else if(this.localCache[r]===t.newValue&&!n)return}const i=()=>{const s=this.storage.getItem(r);!n&&this.localCache[r]===s||this.notifyListeners(r,s)},o=this.storage.getItem(r);c9()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(i,$9):i()}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},D9)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,n){await super._set(t,n),this.localCache[t]=JSON.stringify(n)}async _get(t){const n=await super._get(t);return this.localCache[t]=JSON.stringify(n),n}async _remove(t){await super._remove(t),delete this.localCache[t]}}h2.type="LOCAL";const j9=h2;/** + * @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 m2 extends p2{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}m2.type="SESSION";const g2=m2;/** + * @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. + */function L9(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason: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 ip{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const n=this.receivers.find(i=>i.isListeningto(t));if(n)return n;const r=new ip(t);return this.receivers.push(r),r}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const n=t,{eventId:r,eventType:i,data:o}=n.data,s=this.handlersMap[i];if(!(s!=null&&s.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(s).map(async c=>c(n.origin,o)),l=await L9(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:l})}_subscribe(t,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(n)}_unsubscribe(t,n){this.handlersMap[t]&&n&&this.handlersMap[t].delete(n),(!n||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}ip.receivers=[];/** + * @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 Sy(e="",t=10){let n="";for(let r=0;r{const c=Sy("",20);i.port1.start();const f=setTimeout(()=>{l(new Error("unsupported_event"))},r);s={messageChannel:i,onMessage(d){const p=d;if(p.data.eventId===c)switch(p.data.status){case"ack":clearTimeout(f),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(p.data.response);break;default:clearTimeout(f),clearTimeout(o),l(new Error("invalid_response"));break}}},this.handlers.add(s),i.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:t,eventId:c,data:n},[i.port2])}).finally(()=>{s&&this.removeMessageHandler(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. + */function Jr(){return window}function U9(e){Jr().location.href=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. + */function v2(){return typeof Jr().WorkerGlobalScope<"u"&&typeof Jr().importScripts=="function"}async function B9(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function z9(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)===null||e===void 0?void 0:e.controller)||null}function V9(){return v2()?self:null}/** + * @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 y2="firebaseLocalStorageDb",W9=1,pd="firebaseLocalStorage",b2="fbase_key";class Du{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function op(e,t){return e.transaction([pd],t?"readwrite":"readonly").objectStore(pd)}function H9(){const e=indexedDB.deleteDatabase(y2);return new Du(e).toPromise()}function Og(){const e=indexedDB.open(y2,W9);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(pd,{keyPath:b2})}catch(i){n(i)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(pd)?t(r):(r.close(),await H9(),t(await Og()))})})}async function Cw(e,t,n){const r=op(e,!0).put({[b2]:t,value:n});return new Du(r).toPromise()}async function G9(e,t){const n=op(e,!1).get(t),r=await new Du(n).toPromise();return r===void 0?null:r.value}function Ow(e,t){const n=op(e,!0).delete(t);return new Du(n).toPromise()}const q9=800,K9=3;class w2{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Og(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>K9)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return v2()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ip._getInstance(V9()),this.receiver._subscribe("keyChanged",async(t,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(t,n)=>["keyChanged"])}async initializeSender(){var t,n;if(this.activeServiceWorker=await B9(),!this.activeServiceWorker)return;this.sender=new F9(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((t=r[0])===null||t===void 0)&&t.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||z9()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Og();return await Cw(t,dd,"1"),await Ow(t,dd),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>Cw(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>G9(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>Ow(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(i=>{const o=op(i,!1).getAll();return new Du(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(t.length!==0)for(const{fbase_key:i,value:o}of t)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(o)&&(this.notifyListeners(i,o),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),q9)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}w2.type="LOCAL";const Y9=w2;new Nu(3e4,6e4);/** + * @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 S2(e,t){return t?wi(t):(Ae(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/** + * @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 _y extends f2{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Gs(t,this._buildIdpRequest())}_linkToIdToken(t,n){return Gs(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return Gs(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function X9(e){return I9(e.auth,new _y(e),e.bypassAuthState)}function Q9(e){const{auth:t,user:n}=e;return Ae(n,t,"internal-error"),k9(n,new _y(e),e.bypassAuthState)}async function J9(e){const{auth:t,user:n}=e;return Ae(n,t,"internal-error"),T9(n,new _y(e),e.bypassAuthState)}/** + * @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 _2{constructor(t,n,r,i,o=!1){this.auth=t,this.resolver=r,this.user=i,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(t,n)=>{this.pendingPromise={resolve:t,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(t){const{urlResponse:n,sessionId:r,postBody:i,tenantId:o,error:s,type:a}=t;if(s){this.reject(s);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:o||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(c){this.reject(c)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return X9;case"linkViaPopup":case"linkViaRedirect":return J9;case"reauthViaPopup":case"reauthViaRedirect":return Q9;default:ei(this.auth,"internal-error")}}resolve(t){Oi(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){Oi(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** + * @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 Z9=new Nu(2e3,1e4);async function Tw(e,t,n){if(vi(e.app))return Promise.reject(Rr(e,"operation-not-supported-in-this-environment"));const r=rp(e);qM(e,t,wy);const i=S2(r,n);return new Ao(r,"signInViaPopup",t,i).executeNotNull()}class Ao extends _2{constructor(t,n,r,i,o){super(t,n,i,o),this.provider=r,this.authWindow=null,this.pollId=null,Ao.currentPopupAction&&Ao.currentPopupAction.cancel(),Ao.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Ae(t,this.auth,"internal-error"),t}async onExecution(){Oi(this.filter.length===1,"Popup operations only handle one event");const t=Sy();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(Rr(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)===null||t===void 0?void 0:t.associatedEvent)||null}cancel(){this.reject(Rr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Ao.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Rr(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,Z9.get())};t()}}Ao.currentPopupAction=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. + */const eD="pendingRedirect",cf=new Map;class tD extends _2{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=cf.get(this.auth._key());if(!t){try{const r=await nD(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}cf.set(this.auth._key(),t)}return this.bypassAuthState||cf.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=await this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function nD(e,t){const n=oD(t),r=iD(e);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function rD(e,t){cf.set(e._key(),t)}function iD(e){return wi(e._redirectPersistence)}function oD(e){return uf(eD,e.config.apiKey,e.name)}async function sD(e,t,n=!1){if(vi(e.app))return Promise.reject(Bo(e));const r=rp(e),i=S2(r,t),s=await new tD(r,i,n).execute();return s&&!n&&(delete s.user._redirectEventId,await r._persistUserIfCurrent(s.user),await r._setRedirectUser(null,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. + */const aD=10*60*1e3;class lD{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(t,r)&&(n=!0,this.sendToConsumer(t,r),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!uD(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!x2(t)){const i=((r=t.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(Rr(this.auth,i))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=aD&&this.cachedEventUids.clear(),this.cachedEventUids.has(kw(t))}saveEventToCache(t){this.cachedEventUids.add(kw(t)),this.lastProcessedEventTime=Date.now()}}function kw(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function x2({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function uD(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return x2(e);default:return!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. + */async function cD(e,t={}){return Pa(e,"GET","/v1/projects",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. + */const fD=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,dD=/^https?/;async function pD(e){if(e.config.emulator)return;const{authorizedDomains:t}=await cD(e);for(const n of t)try{if(hD(n))return}catch{}ei(e,"unauthorized-domain")}function hD(e){const t=Eg(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const s=new URL(e);return s.hostname===""&&r===""?n==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):n==="chrome-extension:"&&s.hostname===r}if(!dD.test(n))return!1;if(fD.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(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 mD=new Nu(3e4,6e4);function Iw(){const e=Jr().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n{var r,i,o;function s(){Iw(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Iw(),n(Rr(e,"network-request-failed"))},timeout:mD.get()})}if(!((i=(r=Jr().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)t(gapi.iframes.getContext());else if(!((o=Jr().gapi)===null||o===void 0)&&o.load)s();else{const a=w9("iframefcb");return Jr()[a]=()=>{gapi.load?s():n(Rr(e,"network-request-failed"))},y9(`${b9()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw ff=null,t})}let ff=null;function vD(e){return ff=ff||gD(e),ff}/** + * @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 yD=new Nu(5e3,15e3),bD="__/auth/iframe",wD="emulator/auth/iframe",SD={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},_D=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function xD(e){const t=e.config;Ae(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?my(t,wD):`https://${e.config.authDomain}/${bD}`,r={apiKey:t.apiKey,appName:e.name,v:Ia},i=_D.get(e.config.apiHost);i&&(r.eid=i);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${Pu(r).slice(1)}`}async function ED(e){const t=await vD(e),n=Jr().gapi;return Ae(n,e,"internal-error"),t.open({where:document.body,url:xD(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:SD,dontclear:!0},r=>new Promise(async(i,o)=>{await r.restyle({setHideOnLeave:!1});const s=Rr(e,"network-request-failed"),a=Jr().setTimeout(()=>{o(s)},yD.get());function l(){Jr().clearTimeout(a),i(r)}r.ping(l).then(l,()=>{o(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. + */const CD={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},OD=500,TD=600,kD="_blank",ID="http://localhost";class Pw{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function PD(e,t,n,r=OD,i=TD){const o=Math.max((window.screen.availHeight-i)/2,0).toString(),s=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l=Object.assign(Object.assign({},CD),{width:r.toString(),height:i.toString(),top:o,left:s}),c=cn().toLowerCase();n&&(a=r2(c)?kD:n),n2(c)&&(t=t||ID,l.scrollbars="yes");const f=Object.entries(l).reduce((p,[g,m])=>`${p}${g}=${m},`,"");if(u9(c)&&a!=="_self")return RD(t||"",a),new Pw(null);const d=window.open(t||"",a,f);Ae(d,e,"popup-blocked");try{d.focus()}catch{}return new Pw(d)}function RD(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/** + * @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 AD="__/auth/handler",ND="emulator/auth/handler",MD=encodeURIComponent("fac");async function Rw(e,t,n,r,i,o){Ae(e.config.authDomain,e,"auth-domain-config-required"),Ae(e.config.apiKey,e,"invalid-api-key");const s={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:Ia,eventId:i};if(t instanceof wy){t.setDefaultLanguage(e.languageCode),s.providerId=t.providerId||"",rN(t.getCustomParameters())||(s.customParameters=JSON.stringify(t.getCustomParameters()));for(const[f,d]of Object.entries({}))s[f]=d}if(t instanceof Mu){const f=t.getScopes().filter(d=>d!=="");f.length>0&&(s.scopes=f.join(","))}e.tenantId&&(s.tid=e.tenantId);const a=s;for(const f of Object.keys(a))a[f]===void 0&&delete a[f];const l=await e._getAppCheckToken(),c=l?`#${MD}=${encodeURIComponent(l)}`:"";return`${DD(e)}?${Pu(a).slice(1)}${c}`}function DD({config:e}){return e.emulator?my(e,ND):`https://${e.authDomain}/${AD}`}/** + * @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 qh="webStorageSupport";class $D{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=g2,this._completeRedirectFn=sD,this._overrideRedirectResult=rD}async _openPopup(t,n,r,i){var o;Oi((o=this.eventManagers[t._key()])===null||o===void 0?void 0:o.manager,"_initialize() not called before _openPopup()");const s=await Rw(t,n,r,Eg(),i);return PD(t,s,Sy())}async _openRedirect(t,n,r,i){await this._originValidation(t);const o=await Rw(t,n,r,Eg(),i);return U9(o),new Promise(()=>{})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:i,promise:o}=this.eventManagers[n];return i?Promise.resolve(i):(Oi(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(t){const n=await ED(t),r=new lD(t);return n.register("authEvent",i=>(Ae(i==null?void 0:i.authEvent,t,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,r}_isIframeWebStorageSupported(t,n){this.iframes[t._key()].send(qh,{type:qh},i=>{var o;const s=(o=i==null?void 0:i[0])===null||o===void 0?void 0:o[qh];s!==void 0&&n(!!s),ei(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=pD(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return l2()||yy()||np()}}const jD=$D;var Aw="@firebase/auth",Nw="1.7.4";/** + * @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 LD{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)===null||t===void 0?void 0:t.uid)||null}async getToken(t){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(t)}:null}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const n=this.auth.onIdTokenChanged(r=>{t((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,n),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const n=this.internalListeners.get(t);n&&(this.internalListeners.delete(t),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Ae(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** + * @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 FD(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function UD(e){fa(new Yo("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),i=t.getProvider("heartbeat"),o=t.getProvider("app-check-internal"),{apiKey:s,authDomain:a}=r.options;Ae(s&&!s.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:s,authDomain:a,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:u2(e)},c=new g9(r,i,o,l);return _9(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),fa(new Yo("auth-internal",t=>{const n=rp(t.getProvider("auth").getImmediate());return(r=>new LD(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),ao(Aw,Nw,FD(e)),ao(Aw,Nw,"esm2017")}/** + * @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 BD=5*60,zD=mO("authIdTokenMaxAge")||BD;let Mw=null;const VD=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>zD)return;const i=n==null?void 0:n.token;Mw!==i&&(Mw=i,await fetch(e,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function WD(e=bO()){const t=ay(e,"auth");if(t.isInitialized())return t.getImmediate();const n=S9(e,{popupRedirectResolver:jD,persistence:[Y9,j9,g2]}),r=mO("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const s=VD(o.toString());R9(n,s,()=>s(n.currentUser)),P9(n,a=>s(a))}}const i=pO("auth");return i&&x9(n,`http://${i}`),n}function HD(){var e,t;return(t=(e=document.getElementsByTagName("head"))===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:document}v9({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=i=>{const o=Rr("internal-error");o.customData=i,n(o)},r.type="text/javascript",r.charset="UTF-8",HD().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});UD("Browser");let xy;(()=>{const t=JSON.parse('{"apiKey": "AIzaSyCgzs_JIlAI5CE5EAOO8eQVJbqSI9YHNC4","authDomain": "simplitracapp.firebaseapp.com","databaseURL": "https://simplitracapp-default-rtdb.firebaseio.com","projectId": "simplitracapp","storageBucket": "simplitracapp.appspot.com","messagingSenderId": "242165323563","appId": "1:242165323563:web:5891ef2a45c8cf0183576e","measurementId": "G-3HSNQSS692"}');xy=yO(t)})();DM(xy);const hd=WD(xy),Dw=new pi,GD=()=>{const{setScreen:e,setUser:t,resetAppState:n}=j.useContext(dr),r=async()=>{try{await N9(hd),localStorage.clear(),n()}catch(i){console.error("Error signing out: ",i)}};return O.jsx("button",{onClick:r,children:"Logout"})},qD=()=>{ca.setAppElement("#root");const e=j.useRef(),{ocrData:t,user:n,setFormData:r,ocrModalOpen:i,setOcrModalOpen:o}=j.useContext(dr),s=d=>{o(!d)},a=d=>(n.addTransaction(d),n.updateFirebase()),l=()=>new rg(t),c=d=>{switch(d.target.value){case"edit":r(l());break;case"submit":if(t.isNotComplete()){alert("Data not complete. Switching to edit mode"),r(l());break}t.error?alert(t.message):a(t);break;case"tryAgain":setScreen("camera");break}s(i)},f=d=>d.error?O.jsxs("li",{className:"source-type-modal__list-item",children:[O.jsx("label",{children:"Error"}),O.jsx("div",{children:d.message})]}):Object.entries(d).filter(p=>p[1]!==null&&p[1]!==void 0).map((p,g)=>{if(p[0]!=="transactionId")return O.jsxs("li",{className:"source-type-modal__list-item",children:[O.jsx("label",{children:p[0]}),O.jsx("div",{children:p[1]})]},g)});return O.jsx("div",{className:"source-type",children:O.jsxs(ca,{style:KD,isOpen:i,className:"source-type-modal","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var d;return(d=e.current)==null?void 0:d.focus()},0)},children:[O.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:f(t)}),O.jsx("div",{className:"source-type-modal__controls",children:t.error?O.jsx("button",{value:"tryAgain",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:c,children:"Try Again"}):O.jsxs(O.Fragment,{children:[O.jsx("button",{value:"edit",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:c,children:"Edit Info"}),O.jsx("button",{value:"submit",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:c,children:"Submit"})]})})]})})},KD={content:{position:"relative",width:"300px",maxWidth:"80%",padding:"20px",background:"#fff",borderRadius:"8px",outline:"none",margin:"auto",inset:"auto"},overlay:{display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.75)"}};var E2={exports:{}};(function(e,t){(function(n,r){e.exports=r(j)})(typeof self<"u"?self:zg,function(n){return function(r){var i={};function o(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return r[s].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=r,o.c=i,o.d=function(s,a,l){o.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:l})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.t=function(s,a){if(1&a&&(s=o(s)),8&a||4&a&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(o.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),2&a&&typeof s!="string")for(var c in s)o.d(l,c,(function(f){return s[f]}).bind(null,c));return l},o.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(a,"a",a),a},o.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},o.p="",o(o.s=2)}([function(r,i){r.exports=n},function(r,i,o){var s={linear:function(a,l,c,f){return(c-l)*a/f+l},easeInQuad:function(a,l,c,f){return(c-l)*(a/=f)*a+l},easeOutQuad:function(a,l,c,f){return-(c-l)*(a/=f)*(a-2)+l},easeInOutQuad:function(a,l,c,f){var d=c-l;return(a/=f/2)<1?d/2*a*a+l:-d/2*(--a*(a-2)-1)+l},easeInCubic:function(a,l,c,f){return(c-l)*(a/=f)*a*a+l},easeOutCubic:function(a,l,c,f){return(c-l)*((a=a/f-1)*a*a+1)+l},easeInOutCubic:function(a,l,c,f){var d=c-l;return(a/=f/2)<1?d/2*a*a*a+l:d/2*((a-=2)*a*a+2)+l},easeInQuart:function(a,l,c,f){return(c-l)*(a/=f)*a*a*a+l},easeOutQuart:function(a,l,c,f){return-(c-l)*((a=a/f-1)*a*a*a-1)+l},easeInOutQuart:function(a,l,c,f){var d=c-l;return(a/=f/2)<1?d/2*a*a*a*a+l:-d/2*((a-=2)*a*a*a-2)+l},easeInQuint:function(a,l,c,f){return(c-l)*(a/=f)*a*a*a*a+l},easeOutQuint:function(a,l,c,f){return(c-l)*((a=a/f-1)*a*a*a*a+1)+l},easeInOutQuint:function(a,l,c,f){var d=c-l;return(a/=f/2)<1?d/2*a*a*a*a*a+l:d/2*((a-=2)*a*a*a*a+2)+l},easeInSine:function(a,l,c,f){var d=c-l;return-d*Math.cos(a/f*(Math.PI/2))+d+l},easeOutSine:function(a,l,c,f){return(c-l)*Math.sin(a/f*(Math.PI/2))+l},easeInOutSine:function(a,l,c,f){return-(c-l)/2*(Math.cos(Math.PI*a/f)-1)+l},easeInExpo:function(a,l,c,f){return a==0?l:(c-l)*Math.pow(2,10*(a/f-1))+l},easeOutExpo:function(a,l,c,f){var d=c-l;return a==f?l+d:d*(1-Math.pow(2,-10*a/f))+l},easeInOutExpo:function(a,l,c,f){var d=c-l;return a===0?l:a===f?l+d:(a/=f/2)<1?d/2*Math.pow(2,10*(a-1))+l:d/2*(2-Math.pow(2,-10*--a))+l},easeInCirc:function(a,l,c,f){return-(c-l)*(Math.sqrt(1-(a/=f)*a)-1)+l},easeOutCirc:function(a,l,c,f){return(c-l)*Math.sqrt(1-(a=a/f-1)*a)+l},easeInOutCirc:function(a,l,c,f){var d=c-l;return(a/=f/2)<1?-d/2*(Math.sqrt(1-a*a)-1)+l:d/2*(Math.sqrt(1-(a-=2)*a)+1)+l},easeInElastic:function(a,l,c,f){var d,p,g,m=c-l;return g=1.70158,a===0?l:(a/=f)==1?l+m:((p=0)||(p=.3*f),(d=m)=1&&this.rotationDirection===a.Positive?this.rotationDirection=a.Negative:this.rotateY<=-1&&this.rotationDirection===a.Negative&&(this.rotationDirection=a.Positive);var xe=.1*this.rotationDirection;if(this.rotateY+=xe,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=Oe,this.context.lineCap="round",this.context.lineWidth=2,Te&&typeof Te=="function")Te.call(this,this.context);else switch(this.shape){case s.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case s.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case s.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}])&&g(L.prototype,U),M}();function E(M,L,U){return L in M?Object.defineProperty(M,L,{value:U,enumerable:!0,configurable:!0,writable:!0}):M[L]=U,M}var w=function M(L,U){var F=this;(function(q,oe){if(!(q instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,M),E(this,"canvas",void 0),E(this,"context",void 0),E(this,"getOptions",void 0),E(this,"x",0),E(this,"y",0),E(this,"w",0),E(this,"h",0),E(this,"lastNumberOfPieces",0),E(this,"tweenInitTime",Date.now()),E(this,"particles",[]),E(this,"particlesGenerated",0),E(this,"removeParticleAt",function(q){F.particles.splice(q,1)}),E(this,"getParticle",function(){var q=p(F.x,F.w+F.x),oe=p(F.y,F.h+F.y);return new y(F.context,F.getOptions,q,oe)}),E(this,"animate",function(){var q=F.canvas,oe=F.context,Oe=F.particlesGenerated,Te=F.lastNumberOfPieces,xe=F.getOptions(),$=xe.run,z=xe.recycle,H=xe.numberOfPieces,ae=xe.debug,ne=xe.tweenFunction,te=xe.tweenDuration;if(!$)return!1;var pe=F.particles.length,le=z?pe:Oe,he=Date.now();if(lete?te:Math.max(0,he-ce),le,H,te),Ce=Math.round(Ne-le),lt=0;ltq.height||Pe.y<-100||Pe.x>q.width+100||Pe.x<-100)&&(z&&le<=H?F.particles[Ee]=F.getParticle():F.removeParticleAt(Ee))}),pe>0||le0&&xe.call(q,q),q._options.run=!1)}),R(this,"reset",function(){q.generator&&q.generator.particlesGenerated>0&&(q.generator.particlesGenerated=0,q.generator.particles=[],q.generator.lastNumberOfPieces=0)}),R(this,"stop",function(){q.options={run:!1},q.rafId&&(cancelAnimationFrame(q.rafId),q.rafId=void 0)}),this.canvas=F;var oe=this.canvas.getContext("2d");if(!oe)throw new Error("Could not get canvas context");this.context=oe,this.generator=new w(this.canvas,function(){return q.options}),this.options=ue,this.update()}var L,U;return L=M,(U=[{key:"options",get:function(){return this._options},set:function(F){var ue=this._options&&this._options.run,q=this._options&&this._options.recycle;this.setOptionsWithDefaults(F),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof F.recycle=="boolean"&&F.recycle&&q===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof F.run=="boolean"&&F.run&&ue===!1&&this.update()}}])&&P(L.prototype,U),M}();function x(M){return function(L){if(Array.isArray(L))return G(L)}(M)||function(L){if(typeof Symbol<"u"&&Symbol.iterator in Object(L))return Array.from(L)}(M)||X(M)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function C(M){return(C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L})(M)}function I(){return(I=Object.assign||function(M){for(var L=1;L"u"||!(Symbol.iterator in Object(U)))){var ue=[],q=!0,oe=!1,Oe=void 0;try{for(var Te,xe=U[Symbol.iterator]();!(q=(Te=xe.next()).done)&&(ue.push(Te.value),!F||ue.length!==F);q=!0);}catch($){oe=!0,Oe=$}finally{try{q||xe.return==null||xe.return()}finally{if(oe)throw Oe}}return ue}}(M,L)||X(M,L)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function X(M,L){if(M){if(typeof M=="string")return G(M,L);var U=Object.prototype.toString.call(M).slice(8,-1);return U==="Object"&&M.constructor&&(U=M.constructor.name),U==="Map"||U==="Set"?Array.from(M):U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U)?G(M,L):void 0}}function G(M,L){(L==null||L>M.length)&&(L=M.length);for(var U=0,F=new Array(L);U"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var U,F=Se(M);if(L){var ue=Se(this).constructor;U=Reflect.construct(F,arguments,ue)}else U=F.apply(this,arguments);return se(this,U)}}function se(M,L){return!L||C(L)!=="object"&&typeof L!="function"?we(M):L}function we(M){if(M===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M}function Se(M){return(Se=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)})(M)}function Ie(M,L,U){return L in M?Object.defineProperty(M,L,{value:U,enumerable:!0,configurable:!0,writable:!0}):M[L]=U,M}var Be=c.a.createRef(),ze=function(M){(function(q,oe){if(typeof oe!="function"&&oe!==null)throw new TypeError("Super expression must either be null or a function");q.prototype=Object.create(oe&&oe.prototype,{constructor:{value:q,writable:!0,configurable:!0}}),oe&&W(q,oe)})(ue,M);var L,U,F=J(ue);function ue(q){var oe;ee(this,ue);for(var Oe=arguments.length,Te=new Array(Oe>1?Oe-1:0),xe=1;xe{ca.setAppElement("#root");const e=j.useRef(),{serverResponse:t,setServerResponse:n,setOcrData:r}=j.useContext(dr),[i,o]=j.useState(!!t),{width:s,height:a}=o$(),l=d=>{o(!d)},c=d=>{l(i),n(""),r(new En)},f=()=>[t].map((p,g)=>O.jsx("li",{className:"source-type-modal__list-item",children:O.jsx("label",{children:p})},g));return O.jsxs("div",{className:"source-type",children:[O.jsxs(ca,{style:a$,isOpen:i,className:"source-type-modal","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var d;return(d=e.current)==null?void 0:d.focus()},0)},children:[O.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:f()}),O.jsx("div",{className:"source-type-modal__controls",children:O.jsx("button",{value:"Okay",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:c,children:"Okay"})})]}),i&&O.jsx(XD,{width:s,height:a})]})},a$={content:{position:"relative",width:"300px",maxWidth:"80%",padding:"20px",background:"#fff",borderRadius:"8px",outline:"none",margin:"auto",inset:"auto"},overlay:{display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.75)"}},l$=({show:e,achievement:t,onClose:n})=>{if(!e||!t)return null;const r={position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#fff",padding:"20px",borderRadius:"8px",boxShadow:"0 0 10px rgba(0,0,0,0.1)",zIndex:1e3},i={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",zIndex:999};return Z.createElement(Z.Fragment,null,Z.createElement("div",{style:i,onClick:n}),Z.createElement("div",{style:r,role:"dialog","aria-modal":"true","aria-labelledby":"achievement-title"},Z.createElement("h2",{id:"achievement-title"},"Achievement Unlocked!"),Z.createElement("img",{src:t.icon,alt:t.title,style:{width:"50px",height:"50px"}}),Z.createElement("h3",null,t.title),Z.createElement("p",null,t.description),Z.createElement("button",{onClick:n},"Okay")))};var u$=Z.memo(l$);const c$=({show:e,achievements:t,onClose:n})=>{if(!e)return null;const r={position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#fff",padding:"20px",borderRadius:"8px",boxShadow:"0 0 10px rgba(0,0,0,0.1)",zIndex:1e3,maxWidth:"80%",maxHeight:"80%",overflow:"auto"},i={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",zIndex:999};return Z.createElement(Z.Fragment,null,Z.createElement("div",{style:i,onClick:n}),Z.createElement("div",{style:r,role:"dialog","aria-modal":"true","aria-labelledby":"badges-title"},Z.createElement("h2",{id:"badges-title"},"Your Achievements"),Z.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"center"}},t.map(o=>Z.createElement("div",{key:o.id,style:{margin:"10px",textAlign:"center"}},Z.createElement("img",{src:o.icon,alt:o.title,style:{width:"50px",height:"50px"}}),Z.createElement("h4",null,o.title)))),Z.createElement("button",{onClick:n,style:{marginTop:"20px"}},"Close")))};var f$=Z.memo(c$);const d$=({onClick:e,position:t})=>{const n={position:"fixed",[t.split("-")[0]]:"20px",[t.split("-")[1]]:"20px",padding:"10px 20px",backgroundColor:"#007bff",color:"#fff",border:"none",borderRadius:"5px",cursor:"pointer",zIndex:998};return Z.createElement("button",{style:n,onClick:e},"View Achievements")};var p$=Z.memo(d$),h$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function m$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O2={exports:{}};(function(e,t){(function(n,r){e.exports=r(Z)})(typeof self<"u"?self:h$,function(n){return function(r){var i={};function o(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return r[s].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=r,o.c=i,o.d=function(s,a,l){o.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:l})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.t=function(s,a){if(1&a&&(s=o(s)),8&a||4&a&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(o.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),2&a&&typeof s!="string")for(var c in s)o.d(l,c,(function(f){return s[f]}).bind(null,c));return l},o.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(a,"a",a),a},o.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},o.p="",o(o.s=2)}([function(r,i){r.exports=n},function(r,i,o){var s={linear:function(a,l,c,f){return(c-l)*a/f+l},easeInQuad:function(a,l,c,f){return(c-l)*(a/=f)*a+l},easeOutQuad:function(a,l,c,f){return-(c-l)*(a/=f)*(a-2)+l},easeInOutQuad:function(a,l,c,f){var d=c-l;return(a/=f/2)<1?d/2*a*a+l:-d/2*(--a*(a-2)-1)+l},easeInCubic:function(a,l,c,f){return(c-l)*(a/=f)*a*a+l},easeOutCubic:function(a,l,c,f){return(c-l)*((a=a/f-1)*a*a+1)+l},easeInOutCubic:function(a,l,c,f){var d=c-l;return(a/=f/2)<1?d/2*a*a*a+l:d/2*((a-=2)*a*a+2)+l},easeInQuart:function(a,l,c,f){return(c-l)*(a/=f)*a*a*a+l},easeOutQuart:function(a,l,c,f){return-(c-l)*((a=a/f-1)*a*a*a-1)+l},easeInOutQuart:function(a,l,c,f){var d=c-l;return(a/=f/2)<1?d/2*a*a*a*a+l:-d/2*((a-=2)*a*a*a-2)+l},easeInQuint:function(a,l,c,f){return(c-l)*(a/=f)*a*a*a*a+l},easeOutQuint:function(a,l,c,f){return(c-l)*((a=a/f-1)*a*a*a*a+1)+l},easeInOutQuint:function(a,l,c,f){var d=c-l;return(a/=f/2)<1?d/2*a*a*a*a*a+l:d/2*((a-=2)*a*a*a*a+2)+l},easeInSine:function(a,l,c,f){var d=c-l;return-d*Math.cos(a/f*(Math.PI/2))+d+l},easeOutSine:function(a,l,c,f){return(c-l)*Math.sin(a/f*(Math.PI/2))+l},easeInOutSine:function(a,l,c,f){return-(c-l)/2*(Math.cos(Math.PI*a/f)-1)+l},easeInExpo:function(a,l,c,f){return a==0?l:(c-l)*Math.pow(2,10*(a/f-1))+l},easeOutExpo:function(a,l,c,f){var d=c-l;return a==f?l+d:d*(1-Math.pow(2,-10*a/f))+l},easeInOutExpo:function(a,l,c,f){var d=c-l;return a===0?l:a===f?l+d:(a/=f/2)<1?d/2*Math.pow(2,10*(a-1))+l:d/2*(2-Math.pow(2,-10*--a))+l},easeInCirc:function(a,l,c,f){return-(c-l)*(Math.sqrt(1-(a/=f)*a)-1)+l},easeOutCirc:function(a,l,c,f){return(c-l)*Math.sqrt(1-(a=a/f-1)*a)+l},easeInOutCirc:function(a,l,c,f){var d=c-l;return(a/=f/2)<1?-d/2*(Math.sqrt(1-a*a)-1)+l:d/2*(Math.sqrt(1-(a-=2)*a)+1)+l},easeInElastic:function(a,l,c,f){var d,p,g,m=c-l;return g=1.70158,a===0?l:(a/=f)==1?l+m:((p=0)||(p=.3*f),(d=m)=1&&this.rotationDirection===a.Positive?this.rotationDirection=a.Negative:this.rotateY<=-1&&this.rotationDirection===a.Negative&&(this.rotationDirection=a.Positive);var xe=.1*this.rotationDirection;if(this.rotateY+=xe,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=Oe,this.context.lineCap="round",this.context.lineWidth=2,Te&&typeof Te=="function")Te.call(this,this.context);else switch(this.shape){case s.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case s.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case s.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}])&&g(L.prototype,U),M}();function E(M,L,U){return L in M?Object.defineProperty(M,L,{value:U,enumerable:!0,configurable:!0,writable:!0}):M[L]=U,M}var w=function M(L,U){var F=this;(function(q,oe){if(!(q instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,M),E(this,"canvas",void 0),E(this,"context",void 0),E(this,"getOptions",void 0),E(this,"x",0),E(this,"y",0),E(this,"w",0),E(this,"h",0),E(this,"lastNumberOfPieces",0),E(this,"tweenInitTime",Date.now()),E(this,"particles",[]),E(this,"particlesGenerated",0),E(this,"removeParticleAt",function(q){F.particles.splice(q,1)}),E(this,"getParticle",function(){var q=p(F.x,F.w+F.x),oe=p(F.y,F.h+F.y);return new y(F.context,F.getOptions,q,oe)}),E(this,"animate",function(){var q=F.canvas,oe=F.context,Oe=F.particlesGenerated,Te=F.lastNumberOfPieces,xe=F.getOptions(),$=xe.run,z=xe.recycle,H=xe.numberOfPieces,ae=xe.debug,ne=xe.tweenFunction,te=xe.tweenDuration;if(!$)return!1;var pe=F.particles.length,le=z?pe:Oe,he=Date.now();if(lete?te:Math.max(0,he-ce),le,H,te),Ce=Math.round(Ne-le),lt=0;ltq.height||Pe.y<-100||Pe.x>q.width+100||Pe.x<-100)&&(z&&le<=H?F.particles[Ee]=F.getParticle():F.removeParticleAt(Ee))}),pe>0||le0&&xe.call(q,q),q._options.run=!1)}),R(this,"reset",function(){q.generator&&q.generator.particlesGenerated>0&&(q.generator.particlesGenerated=0,q.generator.particles=[],q.generator.lastNumberOfPieces=0)}),R(this,"stop",function(){q.options={run:!1},q.rafId&&(cancelAnimationFrame(q.rafId),q.rafId=void 0)}),this.canvas=F;var oe=this.canvas.getContext("2d");if(!oe)throw new Error("Could not get canvas context");this.context=oe,this.generator=new w(this.canvas,function(){return q.options}),this.options=ue,this.update()}var L,U;return L=M,(U=[{key:"options",get:function(){return this._options},set:function(F){var ue=this._options&&this._options.run,q=this._options&&this._options.recycle;this.setOptionsWithDefaults(F),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof F.recycle=="boolean"&&F.recycle&&q===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof F.run=="boolean"&&F.run&&ue===!1&&this.update()}}])&&P(L.prototype,U),M}();function x(M){return function(L){if(Array.isArray(L))return G(L)}(M)||function(L){if(typeof Symbol<"u"&&Symbol.iterator in Object(L))return Array.from(L)}(M)||X(M)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function C(M){return(C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L})(M)}function I(){return(I=Object.assign||function(M){for(var L=1;L"u"||!(Symbol.iterator in Object(U)))){var ue=[],q=!0,oe=!1,Oe=void 0;try{for(var Te,xe=U[Symbol.iterator]();!(q=(Te=xe.next()).done)&&(ue.push(Te.value),!F||ue.length!==F);q=!0);}catch($){oe=!0,Oe=$}finally{try{q||xe.return==null||xe.return()}finally{if(oe)throw Oe}}return ue}}(M,L)||X(M,L)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function X(M,L){if(M){if(typeof M=="string")return G(M,L);var U=Object.prototype.toString.call(M).slice(8,-1);return U==="Object"&&M.constructor&&(U=M.constructor.name),U==="Map"||U==="Set"?Array.from(M):U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U)?G(M,L):void 0}}function G(M,L){(L==null||L>M.length)&&(L=M.length);for(var U=0,F=new Array(L);U"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var U,F=Se(M);if(L){var ue=Se(this).constructor;U=Reflect.construct(F,arguments,ue)}else U=F.apply(this,arguments);return se(this,U)}}function se(M,L){return!L||C(L)!=="object"&&typeof L!="function"?we(M):L}function we(M){if(M===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M}function Se(M){return(Se=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)})(M)}function Ie(M,L,U){return L in M?Object.defineProperty(M,L,{value:U,enumerable:!0,configurable:!0,writable:!0}):M[L]=U,M}var Be=c.a.createRef(),ze=function(M){(function(q,oe){if(typeof oe!="function"&&oe!==null)throw new TypeError("Super expression must either be null or a function");q.prototype=Object.create(oe&&oe.prototype,{constructor:{value:q,writable:!0,configurable:!0}}),oe&&W(q,oe)})(ue,M);var L,U,F=J(ue);function ue(q){var oe;ee(this,ue);for(var Oe=arguments.length,Te=new Array(Oe>1?Oe-1:0),xe=1;xe{const{width:n,height:r}=x$();return e?Z.createElement(v$,Object.assign({width:n,height:r},t)):null},C$=j.createContext(void 0),O$=({children:e,config:t,initialState:n={},storageKey:r="react-achievements",badgesButtonPosition:i="top-right"})=>{const o=P=>Object.keys(t).reduce((R,D)=>(D in P?R[D]=P[D]:R[D]=[],R),{}),s=()=>{const P=Object.values(t).flatMap(R=>R.filter(D=>c.includes(D.data.id)).map(D=>D.data));return console.log(P),P},[a,l]=j.useState(()=>{const P=localStorage.getItem(`${r}-metrics`);return P?JSON.parse(P):o(n)}),[c,f]=j.useState(()=>{const P=localStorage.getItem(`${r}-achievements`);return P?JSON.parse(P):[]}),[d,p]=j.useState(null),[g,m]=j.useState(!1),[y,E]=j.useState(!1);j.useEffect(()=>{localStorage.setItem(`${r}-metrics`,JSON.stringify(a))},[a,r]);const w=j.useCallback(()=>{const P=[];if(Object.entries(t).forEach(([R,D])=>{const S=a[R];D.forEach(x=>{x.check(S)&&!c.includes(x.data.id)&&P.push(x.data)})}),P.length>0){const R=[...c,...P.map(D=>D.id)];f(R),localStorage.setItem(`${r}-achievements`,JSON.stringify(R)),p(P[0]),E(!0)}},[t,a,c,r]);j.useEffect(()=>{w()},[w]);const b=()=>{m(!0)},_={metrics:a,setMetrics:P=>{l(R=>typeof P=="function"?P(R):P)},achievedAchievements:c,checkAchievements:w,showBadgesModal:b};return Z.createElement(C$.Provider,{value:_},e,Z.createElement(u$,{show:!!d,achievement:d,onClose:()=>{p(null),E(!1)}}),Z.createElement(f$,{show:g,achievements:s(),onClose:()=>m(!1)}),Z.createElement(p$,{onClick:b,position:i}),Z.createElement(E$,{show:y}))},Mc="/assets/badge_1-C-eV18Km.png",T$={transactions:[{check:e=>e.length>=1,data:{id:"first_transaction",title:"First Transaction",description:"Completed your first transaction",icon:Mc}},{check:e=>e.length>=10,data:{id:"ten_transactions",title:"Ten Transactions",description:"Completed ten transactions",icon:Mc}}],categories:[{check:e=>e.length>=1,data:{id:"first_category",title:"First Category",description:"Created your first category",icon:Mc}},{check:e=>e.length>=5,data:{id:"five_categories",title:"Five Categories",description:"Created five categories",icon:Mc}}]};function T2(e){return t=>typeof t===e}var k$=T2("function"),I$=e=>e===null,Uw=e=>Object.prototype.toString.call(e).slice(8,-1)==="RegExp",Bw=e=>!P$(e)&&!I$(e)&&(k$(e)||typeof e=="object"),P$=T2("undefined");function R$(e,t){const{length:n}=e;if(n!==t.length)return!1;for(let r=n;r--!==0;)if(!gn(e[r],t[r]))return!1;return!0}function A$(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new DataView(e.buffer),r=new DataView(t.buffer);let i=e.byteLength;for(;i--;)if(n.getUint8(i)!==r.getUint8(i))return!1;return!0}function N$(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!gn(n[1],t.get(n[0])))return!1;return!0}function M$(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}function gn(e,t){if(e===t)return!0;if(e&&Bw(e)&&t&&Bw(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return R$(e,t);if(e instanceof Map&&t instanceof Map)return N$(e,t);if(e instanceof Set&&t instanceof Set)return M$(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return A$(e,t);if(Uw(e)&&Uw(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=n.length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[i]))return!1;for(let i=n.length;i--!==0;){const o=n[i];if(!(o==="_owner"&&e.$$typeof)&&!gn(e[o],t[o]))return!1}return!0}return Number.isNaN(e)&&Number.isNaN(t)?!0:e===t}var D$=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],$$=["bigint","boolean","null","number","string","symbol","undefined"];function sp(e){const t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(j$(t))return t}function $r(e){return t=>sp(t)===e}function j$(e){return D$.includes(e)}function Ra(e){return t=>typeof t===e}function L$(e){return $$.includes(e)}var F$=["innerHTML","ownerDocument","style","attributes","nodeValue"];function ge(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(ge.array(e))return"Array";if(ge.plainFunction(e))return"Function";const t=sp(e);return t||"Object"}ge.array=Array.isArray;ge.arrayOf=(e,t)=>!ge.array(e)&&!ge.function(t)?!1:e.every(n=>t(n));ge.asyncGeneratorFunction=e=>sp(e)==="AsyncGeneratorFunction";ge.asyncFunction=$r("AsyncFunction");ge.bigint=Ra("bigint");ge.boolean=e=>e===!0||e===!1;ge.date=$r("Date");ge.defined=e=>!ge.undefined(e);ge.domElement=e=>ge.object(e)&&!ge.plainObject(e)&&e.nodeType===1&&ge.string(e.nodeName)&&F$.every(t=>t in e);ge.empty=e=>ge.string(e)&&e.length===0||ge.array(e)&&e.length===0||ge.object(e)&&!ge.map(e)&&!ge.set(e)&&Object.keys(e).length===0||ge.set(e)&&e.size===0||ge.map(e)&&e.size===0;ge.error=$r("Error");ge.function=Ra("function");ge.generator=e=>ge.iterable(e)&&ge.function(e.next)&&ge.function(e.throw);ge.generatorFunction=$r("GeneratorFunction");ge.instanceOf=(e,t)=>!e||!t?!1:Object.getPrototypeOf(e)===t.prototype;ge.iterable=e=>!ge.nullOrUndefined(e)&&ge.function(e[Symbol.iterator]);ge.map=$r("Map");ge.nan=e=>Number.isNaN(e);ge.null=e=>e===null;ge.nullOrUndefined=e=>ge.null(e)||ge.undefined(e);ge.number=e=>Ra("number")(e)&&!ge.nan(e);ge.numericString=e=>ge.string(e)&&e.length>0&&!Number.isNaN(Number(e));ge.object=e=>!ge.nullOrUndefined(e)&&(ge.function(e)||typeof e=="object");ge.oneOf=(e,t)=>ge.array(e)?e.indexOf(t)>-1:!1;ge.plainFunction=$r("Function");ge.plainObject=e=>{if(sp(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};ge.primitive=e=>ge.null(e)||L$(typeof e);ge.promise=$r("Promise");ge.propertyOf=(e,t,n)=>{if(!ge.object(e)||!t)return!1;const r=e[t];return ge.function(n)?n(r):ge.defined(r)};ge.regexp=$r("RegExp");ge.set=$r("Set");ge.string=Ra("string");ge.symbol=Ra("symbol");ge.undefined=Ra("undefined");ge.weakMap=$r("WeakMap");ge.weakSet=$r("WeakSet");var be=ge;function U$(...e){return e.every(t=>be.string(t)||be.array(t)||be.plainObject(t))}function B$(e,t,n){return k2(e,t)?[e,t].every(be.array)?!e.some(Gw(n))&&t.some(Gw(n)):[e,t].every(be.plainObject)?!Object.entries(e).some(Hw(n))&&Object.entries(t).some(Hw(n)):t===n:!1}function zw(e,t,n){const{actual:r,key:i,previous:o,type:s}=n,a=Kr(e,i),l=Kr(t,i);let c=[a,l].every(be.number)&&(s==="increased"?al);return be.undefined(r)||(c=c&&l===r),be.undefined(o)||(c=c&&a===o),c}function Vw(e,t,n){const{key:r,type:i,value:o}=n,s=Kr(e,r),a=Kr(t,r),l=i==="added"?s:a,c=i==="added"?a:s;if(!be.nullOrUndefined(o)){if(be.defined(l)){if(be.array(l)||be.plainObject(l))return B$(l,c,o)}else return gn(c,o);return!1}return[s,a].every(be.array)?!c.every(Cy(l)):[s,a].every(be.plainObject)?z$(Object.keys(l),Object.keys(c)):![s,a].every(f=>be.primitive(f)&&be.defined(f))&&(i==="added"?!be.defined(s)&&be.defined(a):be.defined(s)&&!be.defined(a))}function Ww(e,t,{key:n}={}){let r=Kr(e,n),i=Kr(t,n);if(!k2(r,i))throw new TypeError("Inputs have different types");if(!U$(r,i))throw new TypeError("Inputs don't have length");return[r,i].every(be.plainObject)&&(r=Object.keys(r),i=Object.keys(i)),[r,i]}function Hw(e){return([t,n])=>be.array(e)?gn(e,n)||e.some(r=>gn(r,n)||be.array(n)&&Cy(n)(r)):be.plainObject(e)&&e[t]?!!e[t]&&gn(e[t],n):gn(e,n)}function z$(e,t){return t.some(n=>!e.includes(n))}function Gw(e){return t=>be.array(e)?e.some(n=>gn(n,t)||be.array(t)&&Cy(t)(n)):gn(e,t)}function al(e,t){return be.array(e)?e.some(n=>gn(n,t)):gn(e,t)}function Cy(e){return t=>e.some(n=>gn(n,t))}function k2(...e){return e.every(be.array)||e.every(be.number)||e.every(be.plainObject)||e.every(be.string)}function Kr(e,t){return be.plainObject(e)||be.array(e)?be.string(t)?t.split(".").reduce((r,i)=>r&&r[i],e):be.number(t)?e[t]:e:e}function md(e,t){if([e,t].some(be.nullOrUndefined))throw new Error("Missing required parameters");if(![e,t].every(f=>be.plainObject(f)||be.array(f)))throw new Error("Expected plain objects or array");return{added:(f,d)=>{try{return Vw(e,t,{key:f,type:"added",value:d})}catch{return!1}},changed:(f,d,p)=>{try{const g=Kr(e,f),m=Kr(t,f),y=be.defined(d),E=be.defined(p);if(y||E){const w=E?al(p,g):!al(d,g),b=al(d,m);return w&&b}return[g,m].every(be.array)||[g,m].every(be.plainObject)?!gn(g,m):g!==m}catch{return!1}},changedFrom:(f,d,p)=>{if(!be.defined(f))return!1;try{const g=Kr(e,f),m=Kr(t,f),y=be.defined(p);return al(d,g)&&(y?al(p,m):!y)}catch{return!1}},decreased:(f,d,p)=>{if(!be.defined(f))return!1;try{return zw(e,t,{key:f,actual:d,previous:p,type:"decreased"})}catch{return!1}},emptied:f=>{try{const[d,p]=Ww(e,t,{key:f});return!!d.length&&!p.length}catch{return!1}},filled:f=>{try{const[d,p]=Ww(e,t,{key:f});return!d.length&&!!p.length}catch{return!1}},increased:(f,d,p)=>{if(!be.defined(f))return!1;try{return zw(e,t,{key:f,actual:d,previous:p,type:"increased"})}catch{return!1}},removed:(f,d)=>{try{return Vw(e,t,{key:f,type:"removed",value:d})}catch{return!1}}}}var V$=new Error("Element already at target scroll position"),W$=new Error("Scroll cancelled"),H$=Math.min,qw=Date.now,G$={left:Kw("scrollLeft"),top:Kw("scrollTop")};function Kw(e){return function(n,r,i,o){i=i||{},typeof i=="function"&&(o=i,i={}),typeof o!="function"&&(o=K$);var s=qw(),a=n[e],l=i.ease||q$,c=isNaN(i.duration)?350:+i.duration,f=!1;return a===r?o(V$,n[e]):requestAnimationFrame(p),d;function d(){f=!0}function p(g){if(f)return o(W$,n[e]);var m=qw(),y=H$(1,(m-s)/c),E=l(y);n[e]=E*(r-a)+a,y<1?requestAnimationFrame(p):requestAnimationFrame(function(){o(null,n[e])})}}}function q$(e){return .5*(1-Math.cos(Math.PI*e))}function K$(){}const Y$=ti(G$);var I2={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.Scrollparent=n()})(zg,function(){function t(r){var i=getComputedStyle(r,null).getPropertyValue("overflow");return i.indexOf("scroll")>-1||i.indexOf("auto")>-1}function n(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var i=r.parentNode;i.parentNode;){if(t(i))return i;i=i.parentNode}return document.scrollingElement||document.documentElement}}return n})})(I2);var X$=I2.exports;const P2=ti(X$);var Q$=function(t){return J$(t)&&!Z$(t)};function J$(e){return!!e&&typeof e=="object"}function Z$(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||nj(e)}var ej=typeof Symbol=="function"&&Symbol.for,tj=ej?Symbol.for("react.element"):60103;function nj(e){return e.$$typeof===tj}function rj(e){return Array.isArray(e)?[]:{}}function su(e,t){return t.clone!==!1&&t.isMergeableObject(e)?ma(rj(e),e,t):e}function ij(e,t,n){return e.concat(t).map(function(r){return su(r,n)})}function oj(e,t){if(!t.customMerge)return ma;var n=t.customMerge(e);return typeof n=="function"?n:ma}function sj(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Yw(e){return Object.keys(e).concat(sj(e))}function R2(e,t){try{return t in e}catch{return!1}}function aj(e,t){return R2(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function lj(e,t,n){var r={};return n.isMergeableObject(e)&&Yw(e).forEach(function(i){r[i]=su(e[i],n)}),Yw(t).forEach(function(i){aj(e,i)||(R2(e,i)&&n.isMergeableObject(t[i])?r[i]=oj(i,n)(e[i],t[i],n):r[i]=su(t[i],n))}),r}function ma(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||ij,n.isMergeableObject=n.isMergeableObject||Q$,n.cloneUnlessOtherwiseSpecified=su;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):lj(e,t,n):su(t,n)}ma.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return ma(r,i,n)},{})};var uj=ma,cj=uj;const Or=ti(cj);/**! + * @fileOverview Kickass library to create and place poppers near their reference elements. + * @version 1.16.1 + * @license + * Copyright (c) 2016 Federico Zivolo and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */var $u=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",fj=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();function dj(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function pj(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},fj))}}var hj=$u&&window.Promise,mj=hj?dj:pj;function A2(e){var t={};return e&&t.toString.call(e)==="[object Function]"}function rs(e,t){if(e.nodeType!==1)return[];var n=e.ownerDocument.defaultView,r=n.getComputedStyle(e,null);return t?r[t]:r}function Oy(e){return e.nodeName==="HTML"?e:e.parentNode||e.host}function ju(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=rs(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:ju(Oy(e))}function N2(e){return e&&e.referenceNode?e.referenceNode:e}var Xw=$u&&!!(window.MSInputMethodContext&&document.documentMode),Qw=$u&&/MSIE 10/.test(navigator.userAgent);function Aa(e){return e===11?Xw:e===10?Qw:Xw||Qw}function ga(e){if(!e)return document.documentElement;for(var t=Aa(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?e?e.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&rs(n,"position")==="static"?ga(n):n}function gj(e){var t=e.nodeName;return t==="BODY"?!1:t==="HTML"||ga(e.firstElementChild)===e}function Tg(e){return e.parentNode!==null?Tg(e.parentNode):e}function gd(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var s=o.commonAncestorContainer;if(e!==s&&t!==s||r.contains(i))return gj(s)?s:ga(s);var a=Tg(e);return a.host?gd(a.host,t):gd(e,Tg(t).host)}function va(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=t==="top"?"scrollTop":"scrollLeft",r=e.nodeName;if(r==="BODY"||r==="HTML"){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function vj(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=va(t,"top"),i=va(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function Jw(e,t){var n=t==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function Zw(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],Aa(10)?parseInt(n["offset"+e])+parseInt(r["margin"+(e==="Height"?"Top":"Left")])+parseInt(r["margin"+(e==="Height"?"Bottom":"Right")]):0)}function M2(e){var t=e.body,n=e.documentElement,r=Aa(10)&&getComputedStyle(n);return{height:Zw("Height",t,n,r),width:Zw("Width",t,n,r)}}var yj=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},bj=function(){function e(t,n){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=Aa(10),i=t.nodeName==="HTML",o=kg(e),s=kg(t),a=ju(e),l=rs(t),c=parseFloat(l.borderTopWidth),f=parseFloat(l.borderLeftWidth);n&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var d=fo({top:o.top-s.top-c,left:o.left-s.left-f,width:o.width,height:o.height});if(d.marginTop=0,d.marginLeft=0,!r&&i){var p=parseFloat(l.marginTop),g=parseFloat(l.marginLeft);d.top-=c-p,d.bottom-=c-p,d.left-=f-g,d.right-=f-g,d.marginTop=p,d.marginLeft=g}return(r&&!n?t.contains(a):t===a&&a.nodeName!=="BODY")&&(d=vj(d,t)),d}function wj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=e.ownerDocument.documentElement,r=Ty(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),s=t?0:va(n),a=t?0:va(n,"left"),l={top:s-r.top+r.marginTop,left:a-r.left+r.marginLeft,width:i,height:o};return fo(l)}function D2(e){var t=e.nodeName;if(t==="BODY"||t==="HTML")return!1;if(rs(e,"position")==="fixed")return!0;var n=Oy(e);return n?D2(n):!1}function $2(e){if(!e||!e.parentElement||Aa())return document.documentElement;for(var t=e.parentElement;t&&rs(t,"transform")==="none";)t=t.parentElement;return t||document.documentElement}function ky(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,o={top:0,left:0},s=i?$2(e):gd(e,N2(t));if(r==="viewport")o=wj(s,i);else{var a=void 0;r==="scrollParent"?(a=ju(Oy(t)),a.nodeName==="BODY"&&(a=e.ownerDocument.documentElement)):r==="window"?a=e.ownerDocument.documentElement:a=r;var l=Ty(a,s,i);if(a.nodeName==="HTML"&&!D2(s)){var c=M2(e.ownerDocument),f=c.height,d=c.width;o.top+=l.top-l.marginTop,o.bottom=f+l.top,o.left+=l.left-l.marginLeft,o.right=d+l.left}else o=l}n=n||0;var p=typeof n=="number";return o.left+=p?n:n.left||0,o.top+=p?n:n.top||0,o.right-=p?n:n.right||0,o.bottom-=p?n:n.bottom||0,o}function Sj(e){var t=e.width,n=e.height;return t*n}function j2(e,t,n,r,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(e.indexOf("auto")===-1)return e;var s=ky(n,r,o,i),a={top:{width:s.width,height:t.top-s.top},right:{width:s.right-t.right,height:s.height},bottom:{width:s.width,height:s.bottom-t.bottom},left:{width:t.left-s.left,height:s.height}},l=Object.keys(a).map(function(p){return ir({key:p},a[p],{area:Sj(a[p])})}).sort(function(p,g){return g.area-p.area}),c=l.filter(function(p){var g=p.width,m=p.height;return g>=n.clientWidth&&m>=n.clientHeight}),f=c.length>0?c[0].key:l[0].key,d=e.split("-")[1];return f+(d?"-"+d:"")}function L2(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=r?$2(t):gd(t,N2(n));return Ty(n,i,r)}function F2(e){var t=e.ownerDocument.defaultView,n=t.getComputedStyle(e),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),i=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),o={width:e.offsetWidth+i,height:e.offsetHeight+r};return o}function vd(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(n){return t[n]})}function U2(e,t,n){n=n.split("-")[0];var r=F2(e),i={width:r.width,height:r.height},o=["right","left"].indexOf(n)!==-1,s=o?"top":"left",a=o?"left":"top",l=o?"height":"width",c=o?"width":"height";return i[s]=t[s]+t[l]/2-r[l]/2,n===a?i[a]=t[a]-r[c]:i[a]=t[vd(a)],i}function Lu(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function _j(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(i){return i[t]===n});var r=Lu(e,function(i){return i[t]===n});return e.indexOf(r)}function B2(e,t,n){var r=n===void 0?e:e.slice(0,_j(e,"name",n));return r.forEach(function(i){i.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var o=i.function||i.fn;i.enabled&&A2(o)&&(t.offsets.popper=fo(t.offsets.popper),t.offsets.reference=fo(t.offsets.reference),t=o(t,i))}),t}function xj(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=L2(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=j2(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=U2(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=B2(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function z2(e,t){return e.some(function(n){var r=n.name,i=n.enabled;return i&&r===t})}function Iy(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;rs[g]&&(e.offsets.popper[d]+=a[d]+m-s[g]),e.offsets.popper=fo(e.offsets.popper);var y=a[d]+a[c]/2-m/2,E=rs(e.instance.popper),w=parseFloat(E["margin"+f]),b=parseFloat(E["border"+f+"Width"]),_=y-e.offsets.popper[d]-w-b;return _=Math.max(Math.min(s[c]-m,_),0),e.arrowElement=r,e.offsets.arrow=(n={},ya(n,d,Math.round(_)),ya(n,p,""),n),e}function $j(e){return e==="end"?"start":e==="start"?"end":e}var G2=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Yh=G2.slice(3);function eS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Yh.indexOf(e),r=Yh.slice(n+1).concat(Yh.slice(0,n));return t?r.reverse():r}var Xh={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function jj(e,t){if(z2(e.instance.modifiers,"inner")||e.flipped&&e.placement===e.originalPlacement)return e;var n=ky(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=vd(r),o=e.placement.split("-")[1]||"",s=[];switch(t.behavior){case Xh.FLIP:s=[r,i];break;case Xh.CLOCKWISE:s=eS(r);break;case Xh.COUNTERCLOCKWISE:s=eS(r,!0);break;default:s=t.behavior}return s.forEach(function(a,l){if(r!==a||s.length===l+1)return e;r=e.placement.split("-")[0],i=vd(r);var c=e.offsets.popper,f=e.offsets.reference,d=Math.floor,p=r==="left"&&d(c.right)>d(f.left)||r==="right"&&d(c.left)d(f.top)||r==="bottom"&&d(c.top)d(n.right),y=d(c.top)d(n.bottom),w=r==="left"&&g||r==="right"&&m||r==="top"&&y||r==="bottom"&&E,b=["top","bottom"].indexOf(r)!==-1,_=!!t.flipVariations&&(b&&o==="start"&&g||b&&o==="end"&&m||!b&&o==="start"&&y||!b&&o==="end"&&E),P=!!t.flipVariationsByContent&&(b&&o==="start"&&m||b&&o==="end"&&g||!b&&o==="start"&&E||!b&&o==="end"&&y),R=_||P;(p||w||R)&&(e.flipped=!0,(p||w)&&(r=s[l+1]),R&&(o=$j(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=ir({},e.offsets.popper,U2(e.instance.popper,e.offsets.reference,e.placement)),e=B2(e.instance.modifiers,e,"flip"))}),e}function Lj(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,s=["top","bottom"].indexOf(i)!==-1,a=s?"right":"bottom",l=s?"left":"top",c=s?"width":"height";return n[a]o(r[a])&&(e.offsets.popper[l]=o(r[a])),e}function Fj(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],s=i[2];if(!o)return e;if(s.indexOf("%")===0){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=r}var l=fo(a);return l[t]/100*o}else if(s==="vh"||s==="vw"){var c=void 0;return s==="vh"?c=Math.max(document.documentElement.clientHeight,window.innerHeight||0):c=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c/100*o}else return o}function Uj(e,t,n,r){var i=[0,0],o=["right","left"].indexOf(r)!==-1,s=e.split(/(\+|\-)/).map(function(f){return f.trim()}),a=s.indexOf(Lu(s,function(f){return f.search(/,|\s/)!==-1}));s[a]&&s[a].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=a!==-1?[s.slice(0,a).concat([s[a].split(l)[0]]),[s[a].split(l)[1]].concat(s.slice(a+1))]:[s];return c=c.map(function(f,d){var p=(d===1?!o:o)?"height":"width",g=!1;return f.reduce(function(m,y){return m[m.length-1]===""&&["+","-"].indexOf(y)!==-1?(m[m.length-1]=y,g=!0,m):g?(m[m.length-1]+=y,g=!1,m):m.concat(y)},[]).map(function(m){return Fj(m,p,t,n)})}),c.forEach(function(f,d){f.forEach(function(p,g){Py(p)&&(i[d]+=p*(f[g-1]==="-"?-1:1))})}),i}function Bj(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,s=i.reference,a=r.split("-")[0],l=void 0;return Py(+n)?l=[+n,0]:l=Uj(n,o,s,a),a==="left"?(o.top+=l[0],o.left-=l[1]):a==="right"?(o.top+=l[0],o.left+=l[1]):a==="top"?(o.left+=l[0],o.top-=l[1]):a==="bottom"&&(o.left+=l[0],o.top+=l[1]),e.popper=o,e}function zj(e,t){var n=t.boundariesElement||ga(e.instance.popper);e.instance.reference===n&&(n=ga(n));var r=Iy("transform"),i=e.instance.popper.style,o=i.top,s=i.left,a=i[r];i.top="",i.left="",i[r]="";var l=ky(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=s,i[r]=a,t.boundaries=l;var c=t.priority,f=e.offsets.popper,d={primary:function(g){var m=f[g];return f[g]l[g]&&!t.escapeWithReference&&(y=Math.min(f[m],l[g]-(g==="right"?f.width:f.height))),ya({},m,y)}};return c.forEach(function(p){var g=["left","top"].indexOf(p)!==-1?"primary":"secondary";f=ir({},f,d[g](p))}),e.offsets.popper=f,e}function Vj(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,s=i.popper,a=["bottom","top"].indexOf(n)!==-1,l=a?"left":"top",c=a?"width":"height",f={start:ya({},l,o[l]),end:ya({},l,o[l]+o[c]-s[c])};e.offsets.popper=ir({},s,f[r])}return e}function Wj(e){if(!H2(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=Lu(e.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&arguments[2]!==void 0?arguments[2]:{};yj(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=mj(this.update.bind(this)),this.options=ir({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(ir({},e.Defaults.modifiers,i.modifiers)).forEach(function(s){r.options.modifiers[s]=ir({},e.Defaults.modifiers[s]||{},i.modifiers?i.modifiers[s]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(s){return ir({name:s},r.options.modifiers[s])}).sort(function(s,a){return s.order-a.order}),this.modifiers.forEach(function(s){s.enabled&&A2(s.onLoad)&&s.onLoad(r.reference,r.popper,r.options,s,r.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return bj(e,[{key:"update",value:function(){return xj.call(this)}},{key:"destroy",value:function(){return Ej.call(this)}},{key:"enableEventListeners",value:function(){return Oj.call(this)}},{key:"disableEventListeners",value:function(){return kj.call(this)}}]),e}();au.Utils=(typeof window<"u"?window:global).PopperUtils;au.placements=G2;au.Defaults=qj;var Kj=["innerHTML","ownerDocument","style","attributes","nodeValue"],Yj=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],Xj=["bigint","boolean","null","number","string","symbol","undefined"];function ap(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(Qj(t))return t}function jr(e){return function(t){return ap(t)===e}}function Qj(e){return Yj.includes(e)}function Na(e){return function(t){return typeof t===e}}function Jj(e){return Xj.includes(e)}function Y(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(Y.array(e))return"Array";if(Y.plainFunction(e))return"Function";var t=ap(e);return t||"Object"}Y.array=Array.isArray;Y.arrayOf=function(e,t){return!Y.array(e)&&!Y.function(t)?!1:e.every(function(n){return t(n)})};Y.asyncGeneratorFunction=function(e){return ap(e)==="AsyncGeneratorFunction"};Y.asyncFunction=jr("AsyncFunction");Y.bigint=Na("bigint");Y.boolean=function(e){return e===!0||e===!1};Y.date=jr("Date");Y.defined=function(e){return!Y.undefined(e)};Y.domElement=function(e){return Y.object(e)&&!Y.plainObject(e)&&e.nodeType===1&&Y.string(e.nodeName)&&Kj.every(function(t){return t in e})};Y.empty=function(e){return Y.string(e)&&e.length===0||Y.array(e)&&e.length===0||Y.object(e)&&!Y.map(e)&&!Y.set(e)&&Object.keys(e).length===0||Y.set(e)&&e.size===0||Y.map(e)&&e.size===0};Y.error=jr("Error");Y.function=Na("function");Y.generator=function(e){return Y.iterable(e)&&Y.function(e.next)&&Y.function(e.throw)};Y.generatorFunction=jr("GeneratorFunction");Y.instanceOf=function(e,t){return!e||!t?!1:Object.getPrototypeOf(e)===t.prototype};Y.iterable=function(e){return!Y.nullOrUndefined(e)&&Y.function(e[Symbol.iterator])};Y.map=jr("Map");Y.nan=function(e){return Number.isNaN(e)};Y.null=function(e){return e===null};Y.nullOrUndefined=function(e){return Y.null(e)||Y.undefined(e)};Y.number=function(e){return Na("number")(e)&&!Y.nan(e)};Y.numericString=function(e){return Y.string(e)&&e.length>0&&!Number.isNaN(Number(e))};Y.object=function(e){return!Y.nullOrUndefined(e)&&(Y.function(e)||typeof e=="object")};Y.oneOf=function(e,t){return Y.array(e)?e.indexOf(t)>-1:!1};Y.plainFunction=jr("Function");Y.plainObject=function(e){if(ap(e)!=="Object")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};Y.primitive=function(e){return Y.null(e)||Jj(typeof e)};Y.promise=jr("Promise");Y.propertyOf=function(e,t,n){if(!Y.object(e)||!t)return!1;var r=e[t];return Y.function(n)?n(r):Y.defined(r)};Y.regexp=jr("RegExp");Y.set=jr("Set");Y.string=Na("string");Y.symbol=Na("symbol");Y.undefined=Na("undefined");Y.weakMap=jr("WeakMap");Y.weakSet=jr("WeakSet");function q2(e){return function(t){return typeof t===e}}var Zj=q2("function"),e6=function(e){return e===null},tS=function(e){return Object.prototype.toString.call(e).slice(8,-1)==="RegExp"},nS=function(e){return!t6(e)&&!e6(e)&&(Zj(e)||typeof e=="object")},t6=q2("undefined"),Pg=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function n6(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=n;r--!==0;)if(!On(e[r],t[r]))return!1;return!0}function r6(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=new DataView(e.buffer),r=new DataView(t.buffer),i=e.byteLength;i--;)if(n.getUint8(i)!==r.getUint8(i))return!1;return!0}function i6(e,t){var n,r,i,o;if(e.size!==t.size)return!1;try{for(var s=Pg(e.entries()),a=s.next();!a.done;a=s.next()){var l=a.value;if(!t.has(l[0]))return!1}}catch(d){n={error:d}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}try{for(var c=Pg(e.entries()),f=c.next();!f.done;f=c.next()){var l=f.value;if(!On(l[1],t.get(l[0])))return!1}}catch(d){i={error:d}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}return!0}function o6(e,t){var n,r;if(e.size!==t.size)return!1;try{for(var i=Pg(e.entries()),o=i.next();!o.done;o=i.next()){var s=o.value;if(!t.has(s[0]))return!1}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0}function On(e,t){if(e===t)return!0;if(e&&nS(e)&&t&&nS(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return n6(e,t);if(e instanceof Map&&t instanceof Map)return i6(e,t);if(e instanceof Set&&t instanceof Set)return o6(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return r6(e,t);if(tS(e)&&tS(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=n.length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[i]))return!1;for(var i=n.length;i--!==0;){var o=n[i];if(!(o==="_owner"&&e.$$typeof)&&!On(e[o],t[o]))return!1}return!0}return Number.isNaN(e)&&Number.isNaN(t)?!0:e===t}function s6(){for(var e=[],t=0;tl);return Y.undefined(r)||(c=c&&l===r),Y.undefined(o)||(c=c&&a===o),c}function iS(e,t,n){var r=n.key,i=n.type,o=n.value,s=Yr(e,r),a=Yr(t,r),l=i==="added"?s:a,c=i==="added"?a:s;if(!Y.nullOrUndefined(o)){if(Y.defined(l)){if(Y.array(l)||Y.plainObject(l))return a6(l,c,o)}else return On(c,o);return!1}return[s,a].every(Y.array)?!c.every(Ry(l)):[s,a].every(Y.plainObject)?l6(Object.keys(l),Object.keys(c)):![s,a].every(function(f){return Y.primitive(f)&&Y.defined(f)})&&(i==="added"?!Y.defined(s)&&Y.defined(a):Y.defined(s)&&!Y.defined(a))}function oS(e,t,n){var r=n===void 0?{}:n,i=r.key,o=Yr(e,i),s=Yr(t,i);if(!K2(o,s))throw new TypeError("Inputs have different types");if(!s6(o,s))throw new TypeError("Inputs don't have length");return[o,s].every(Y.plainObject)&&(o=Object.keys(o),s=Object.keys(s)),[o,s]}function sS(e){return function(t){var n=t[0],r=t[1];return Y.array(e)?On(e,r)||e.some(function(i){return On(i,r)||Y.array(r)&&Ry(r)(i)}):Y.plainObject(e)&&e[n]?!!e[n]&&On(e[n],r):On(e,r)}}function l6(e,t){return t.some(function(n){return!e.includes(n)})}function aS(e){return function(t){return Y.array(e)?e.some(function(n){return On(n,t)||Y.array(t)&&Ry(t)(n)}):On(e,t)}}function ll(e,t){return Y.array(e)?e.some(function(n){return On(n,t)}):On(e,t)}function Ry(e){return function(t){return e.some(function(n){return On(n,t)})}}function K2(){for(var e=[],t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function d6(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function Y2(e,t){if(e==null)return{};var n=d6(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function li(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p6(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return li(e)}function zu(e){var t=f6();return function(){var r=yd(e),i;if(t){var o=yd(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return p6(this,i)}}function h6(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function X2(e){var t=h6(e,"string");return typeof t=="symbol"?t:String(t)}var m6={flip:{padding:20},preventOverflow:{padding:10}},g6="The typeValidator argument must be a function with the signature function(props, propName, componentName).",v6="The error message is optional, but must be a string if provided.";function y6(e,t,n,r){return typeof e=="boolean"?e:typeof e=="function"?e(t,n,r):e?!!e:!1}function b6(e,t){return Object.hasOwnProperty.call(e,t)}function w6(e,t,n,r){return new Error("Required ".concat(e[t]," `").concat(t,"` was not specified in `").concat(n,"`."))}function S6(e,t){if(typeof e!="function")throw new TypeError(g6);if(t&&typeof t!="string")throw new TypeError(v6)}function uS(e,t,n){return S6(e,n),function(r,i,o){for(var s=arguments.length,a=new Array(s>3?s-3:0),l=3;l3&&arguments[3]!==void 0?arguments[3]:!1;e.addEventListener(t,n,r)}function x6(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;e.removeEventListener(t,n,r)}function E6(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i;i=function(s){n(s),x6(e,t,i)},_6(e,t,i,r)}function cS(){}var Q2=function(e){Bu(n,e);var t=zu(n);function n(){return Fu(this,n),t.apply(this,arguments)}return Uu(n,[{key:"componentDidMount",value:function(){Br()&&(this.node||this.appendNode(),ul||this.renderPortal())}},{key:"componentDidUpdate",value:function(){Br()&&(ul||this.renderPortal())}},{key:"componentWillUnmount",value:function(){!Br()||!this.node||(ul||Zc.unmountComponentAtNode(this.node),this.node&&this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=void 0))}},{key:"appendNode",value:function(){var i=this.props,o=i.id,s=i.zIndex;this.node||(this.node=document.createElement("div"),o&&(this.node.id=o),s&&(this.node.style.zIndex=s),document.body.appendChild(this.node))}},{key:"renderPortal",value:function(){if(!Br())return null;var i=this.props,o=i.children,s=i.setRef;if(this.node||this.appendNode(),ul)return Zc.createPortal(o,this.node);var a=Zc.unstable_renderSubtreeIntoContainer(this,o.length>1?Z.createElement("div",null,o):o[0],this.node);return s(a),null}},{key:"renderReact16",value:function(){var i=this.props,o=i.hasChildren,s=i.placement,a=i.target;return o?this.renderPortal():a||s==="center"?this.renderPortal():null}},{key:"render",value:function(){return ul?this.renderReact16():null}}]),n}(Z.Component);nn(Q2,"propTypes",{children:re.oneOfType([re.element,re.array]),hasChildren:re.bool,id:re.oneOfType([re.string,re.number]),placement:re.string,setRef:re.func.isRequired,target:re.oneOfType([re.object,re.string]),zIndex:re.number});var J2=function(e){Bu(n,e);var t=zu(n);function n(){return Fu(this,n),t.apply(this,arguments)}return Uu(n,[{key:"parentStyle",get:function(){var i=this.props,o=i.placement,s=i.styles,a=s.arrow.length,l={pointerEvents:"none",position:"absolute",width:"100%"};return o.startsWith("top")?(l.bottom=0,l.left=0,l.right=0,l.height=a):o.startsWith("bottom")?(l.left=0,l.right=0,l.top=0,l.height=a):o.startsWith("left")?(l.right=0,l.top=0,l.bottom=0):o.startsWith("right")&&(l.left=0,l.top=0),l}},{key:"render",value:function(){var i=this.props,o=i.placement,s=i.setArrowRef,a=i.styles,l=a.arrow,c=l.color,f=l.display,d=l.length,p=l.margin,g=l.position,m=l.spread,y={display:f,position:g},E,w=m,b=d;return o.startsWith("top")?(E="0,0 ".concat(w/2,",").concat(b," ").concat(w,",0"),y.bottom=0,y.marginLeft=p,y.marginRight=p):o.startsWith("bottom")?(E="".concat(w,",").concat(b," ").concat(w/2,",0 0,").concat(b),y.top=0,y.marginLeft=p,y.marginRight=p):o.startsWith("left")?(b=m,w=d,E="0,0 ".concat(w,",").concat(b/2," 0,").concat(b),y.right=0,y.marginTop=p,y.marginBottom=p):o.startsWith("right")&&(b=m,w=d,E="".concat(w,",").concat(b," ").concat(w,",0 0,").concat(b/2),y.left=0,y.marginTop=p,y.marginBottom=p),Z.createElement("div",{className:"__floater__arrow",style:this.parentStyle},Z.createElement("span",{ref:s,style:y},Z.createElement("svg",{width:w,height:b,version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Z.createElement("polygon",{points:E,fill:c}))))}}]),n}(Z.Component);nn(J2,"propTypes",{placement:re.string.isRequired,setArrowRef:re.func.isRequired,styles:re.object.isRequired});var C6=["color","height","width"];function Z2(e){var t=e.handleClick,n=e.styles,r=n.color,i=n.height,o=n.width,s=Y2(n,C6);return Z.createElement("button",{"aria-label":"close",onClick:t,style:s,type:"button"},Z.createElement("svg",{width:"".concat(o,"px"),height:"".concat(i,"px"),viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},Z.createElement("g",null,Z.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))}Z2.propTypes={handleClick:re.func.isRequired,styles:re.object.isRequired};function eT(e){var t=e.content,n=e.footer,r=e.handleClick,i=e.open,o=e.positionWrapper,s=e.showCloseButton,a=e.title,l=e.styles,c={content:Z.isValidElement(t)?t:Z.createElement("div",{className:"__floater__content",style:l.content},t)};return a&&(c.title=Z.isValidElement(a)?a:Z.createElement("div",{className:"__floater__title",style:l.title},a)),n&&(c.footer=Z.isValidElement(n)?n:Z.createElement("div",{className:"__floater__footer",style:l.footer},n)),(s||o)&&!Y.boolean(i)&&(c.close=Z.createElement(Z2,{styles:l.close,handleClick:r})),Z.createElement("div",{className:"__floater__container",style:l.container},c.close,c.title,c.content,c.footer)}eT.propTypes={content:re.node.isRequired,footer:re.node,handleClick:re.func.isRequired,open:re.bool,positionWrapper:re.bool.isRequired,showCloseButton:re.bool.isRequired,styles:re.object.isRequired,title:re.node};var tT=function(e){Bu(n,e);var t=zu(n);function n(){return Fu(this,n),t.apply(this,arguments)}return Uu(n,[{key:"style",get:function(){var i=this.props,o=i.disableAnimation,s=i.component,a=i.placement,l=i.hideArrow,c=i.status,f=i.styles,d=f.arrow.length,p=f.floater,g=f.floaterCentered,m=f.floaterClosing,y=f.floaterOpening,E=f.floaterWithAnimation,w=f.floaterWithComponent,b={};return l||(a.startsWith("top")?b.padding="0 0 ".concat(d,"px"):a.startsWith("bottom")?b.padding="".concat(d,"px 0 0"):a.startsWith("left")?b.padding="0 ".concat(d,"px 0 0"):a.startsWith("right")&&(b.padding="0 0 0 ".concat(d,"px"))),[We.OPENING,We.OPEN].indexOf(c)!==-1&&(b=gt(gt({},b),y)),c===We.CLOSING&&(b=gt(gt({},b),m)),c===We.OPEN&&!o&&(b=gt(gt({},b),E)),a==="center"&&(b=gt(gt({},b),g)),s&&(b=gt(gt({},b),w)),gt(gt({},p),b)}},{key:"render",value:function(){var i=this.props,o=i.component,s=i.handleClick,a=i.hideArrow,l=i.setFloaterRef,c=i.status,f={},d=["__floater"];return o?Z.isValidElement(o)?f.content=Z.cloneElement(o,{closeFn:s}):f.content=o({closeFn:s}):f.content=Z.createElement(eT,this.props),c===We.OPEN&&d.push("__floater__open"),a||(f.arrow=Z.createElement(J2,this.props)),Z.createElement("div",{ref:l,className:d.join(" "),style:this.style},Z.createElement("div",{className:"__floater__body"},f.content,f.arrow))}}]),n}(Z.Component);nn(tT,"propTypes",{component:re.oneOfType([re.func,re.element]),content:re.node,disableAnimation:re.bool.isRequired,footer:re.node,handleClick:re.func.isRequired,hideArrow:re.bool.isRequired,open:re.bool,placement:re.string.isRequired,positionWrapper:re.bool.isRequired,setArrowRef:re.func.isRequired,setFloaterRef:re.func.isRequired,showCloseButton:re.bool,status:re.string.isRequired,styles:re.object.isRequired,title:re.node});var nT=function(e){Bu(n,e);var t=zu(n);function n(){return Fu(this,n),t.apply(this,arguments)}return Uu(n,[{key:"render",value:function(){var i=this.props,o=i.children,s=i.handleClick,a=i.handleMouseEnter,l=i.handleMouseLeave,c=i.setChildRef,f=i.setWrapperRef,d=i.style,p=i.styles,g;if(o)if(Z.Children.count(o)===1)if(!Z.isValidElement(o))g=Z.createElement("span",null,o);else{var m=Y.function(o.type)?"innerRef":"ref";g=Z.cloneElement(Z.Children.only(o),nn({},m,c))}else g=o;return g?Z.createElement("span",{ref:f,style:gt(gt({},p),d),onClick:s,onMouseEnter:a,onMouseLeave:l},g):null}}]),n}(Z.Component);nn(nT,"propTypes",{children:re.node,handleClick:re.func.isRequired,handleMouseEnter:re.func.isRequired,handleMouseLeave:re.func.isRequired,setChildRef:re.func.isRequired,setWrapperRef:re.func.isRequired,style:re.object,styles:re.object.isRequired});var O6={zIndex:100};function T6(e){var t=Or(O6,e.options||{});return{wrapper:{cursor:"help",display:"inline-flex",flexDirection:"column",zIndex:t.zIndex},wrapperPosition:{left:-1e3,position:"absolute",top:-1e3,visibility:"hidden"},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:300,opacity:0,position:"relative",transition:"opacity 0.3s",visibility:"hidden",zIndex:t.zIndex},floaterOpening:{opacity:1,visibility:"visible"},floaterWithAnimation:{opacity:1,transition:"opacity 0.3s, transform 0.2s",visibility:"visible"},floaterWithComponent:{maxWidth:"100%"},floaterClosing:{opacity:0,visibility:"visible"},floaterCentered:{left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)"},container:{backgroundColor:"#fff",color:"#666",minHeight:60,minWidth:200,padding:20,position:"relative",zIndex:10},title:{borderBottom:"1px solid #555",color:"#555",fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",fontSize:0,height:15,outline:"none",padding:10,position:"absolute",right:0,top:0,width:15,WebkitAppearance:"none"},footer:{borderTop:"1px solid #ccc",fontSize:13,marginTop:10,paddingTop:5},arrow:{color:"#fff",display:"inline-flex",length:16,margin:8,position:"absolute",spread:32},options:t}}var k6=["arrow","flip","offset"],I6=["position","top","right","bottom","left"],Ay=function(e){Bu(n,e);var t=zu(n);function n(r){var i;return Fu(this,n),i=t.call(this,r),nn(li(i),"setArrowRef",function(o){i.arrowRef=o}),nn(li(i),"setChildRef",function(o){i.childRef=o}),nn(li(i),"setFloaterRef",function(o){i.floaterRef=o}),nn(li(i),"setWrapperRef",function(o){i.wrapperRef=o}),nn(li(i),"handleTransitionEnd",function(){var o=i.state.status,s=i.props.callback;i.wrapperPopper&&i.wrapperPopper.instance.update(),i.setState({status:o===We.OPENING?We.OPEN:We.IDLE},function(){var a=i.state.status;s(a===We.OPEN?"open":"close",i.props)})}),nn(li(i),"handleClick",function(){var o=i.props,s=o.event,a=o.open;if(!Y.boolean(a)){var l=i.state,c=l.positionWrapper,f=l.status;(i.event==="click"||i.event==="hover"&&c)&&(Dc({title:"click",data:[{event:s,status:f===We.OPEN?"closing":"opening"}],debug:i.debug}),i.toggle())}}),nn(li(i),"handleMouseEnter",function(){var o=i.props,s=o.event,a=o.open;if(!(Y.boolean(a)||Qh())){var l=i.state.status;i.event==="hover"&&l===We.IDLE&&(Dc({title:"mouseEnter",data:[{key:"originalEvent",value:s}],debug:i.debug}),clearTimeout(i.eventDelayTimeout),i.toggle())}}),nn(li(i),"handleMouseLeave",function(){var o=i.props,s=o.event,a=o.eventDelay,l=o.open;if(!(Y.boolean(l)||Qh())){var c=i.state,f=c.status,d=c.positionWrapper;i.event==="hover"&&(Dc({title:"mouseLeave",data:[{key:"originalEvent",value:s}],debug:i.debug}),a?[We.OPENING,We.OPEN].indexOf(f)!==-1&&!d&&!i.eventDelayTimeout&&(i.eventDelayTimeout=setTimeout(function(){delete i.eventDelayTimeout,i.toggle()},a*1e3)):i.toggle(We.IDLE))}}),i.state={currentPlacement:r.placement,needsUpdate:!1,positionWrapper:r.wrapperOptions.position&&!!r.target,status:We.INIT,statusWrapper:We.INIT},i._isMounted=!1,i.hasMounted=!1,Br()&&window.addEventListener("load",function(){i.popper&&i.popper.instance.update(),i.wrapperPopper&&i.wrapperPopper.instance.update()}),i}return Uu(n,[{key:"componentDidMount",value:function(){if(Br()){var i=this.state.positionWrapper,o=this.props,s=o.children,a=o.open,l=o.target;this._isMounted=!0,Dc({title:"init",data:{hasChildren:!!s,hasTarget:!!l,isControlled:Y.boolean(a),positionWrapper:i,target:this.target,floater:this.floaterRef},debug:this.debug}),this.hasMounted||(this.initPopper(),this.hasMounted=!0),!s&&l&&Y.boolean(a)}}},{key:"componentDidUpdate",value:function(i,o){if(Br()){var s=this.props,a=s.autoOpen,l=s.open,c=s.target,f=s.wrapperOptions,d=u6(o,this.state),p=d.changedFrom,g=d.changed;if(i.open!==l){var m;Y.boolean(l)&&(m=l?We.OPENING:We.CLOSING),this.toggle(m)}(i.wrapperOptions.position!==f.position||i.target!==c)&&this.changeWrapperPosition(this.props),g("status",We.IDLE)&&l?this.toggle(We.OPEN):p("status",We.INIT,We.IDLE)&&a&&this.toggle(We.OPEN),this.popper&&g("status",We.OPENING)&&this.popper.instance.update(),this.floaterRef&&(g("status",We.OPENING)||g("status",We.CLOSING))&&E6(this.floaterRef,"transitionend",this.handleTransitionEnd),g("needsUpdate",!0)&&this.rebuildPopper()}}},{key:"componentWillUnmount",value:function(){Br()&&(this._isMounted=!1,this.popper&&this.popper.instance.destroy(),this.wrapperPopper&&this.wrapperPopper.instance.destroy())}},{key:"initPopper",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.target,s=this.state.positionWrapper,a=this.props,l=a.disableFlip,c=a.getPopper,f=a.hideArrow,d=a.offset,p=a.placement,g=a.wrapperOptions,m=p==="top"||p==="bottom"?"flip":["right","bottom-end","top-end","left","top-start","bottom-start"];if(p==="center")this.setState({status:We.IDLE});else if(o&&this.floaterRef){var y=this.options,E=y.arrow,w=y.flip,b=y.offset,_=Y2(y,k6);new au(o,this.floaterRef,{placement:p,modifiers:gt({arrow:gt({enabled:!f,element:this.arrowRef},E),flip:gt({enabled:!l,behavior:m},w),offset:gt({offset:"0, ".concat(d,"px")},b)},_),onCreate:function(D){var S;if(i.popper=D,!((S=i.floaterRef)!==null&&S!==void 0&&S.isConnected)){i.setState({needsUpdate:!0});return}c(D,"floater"),i._isMounted&&i.setState({currentPlacement:D.placement,status:We.IDLE}),p!==D.placement&&setTimeout(function(){D.instance.update()},1)},onUpdate:function(D){i.popper=D;var S=i.state.currentPlacement;i._isMounted&&D.placement!==S&&i.setState({currentPlacement:D.placement})}})}if(s){var P=Y.undefined(g.offset)?0:g.offset;new au(this.target,this.wrapperRef,{placement:g.placement||p,modifiers:{arrow:{enabled:!1},offset:{offset:"0, ".concat(P,"px")},flip:{enabled:!1}},onCreate:function(D){i.wrapperPopper=D,i._isMounted&&i.setState({statusWrapper:We.IDLE}),c(D,"wrapper"),p!==D.placement&&setTimeout(function(){D.instance.update()},1)}})}}},{key:"rebuildPopper",value:function(){var i=this;this.floaterRefInterval=setInterval(function(){var o;(o=i.floaterRef)!==null&&o!==void 0&&o.isConnected&&(clearInterval(i.floaterRefInterval),i.setState({needsUpdate:!1}),i.initPopper())},50)}},{key:"changeWrapperPosition",value:function(i){var o=i.target,s=i.wrapperOptions;this.setState({positionWrapper:s.position&&!!o})}},{key:"toggle",value:function(i){var o=this.state.status,s=o===We.OPEN?We.CLOSING:We.OPENING;Y.undefined(i)||(s=i),this.setState({status:s})}},{key:"debug",get:function(){var i=this.props.debug;return i||Br()&&"ReactFloaterDebug"in window&&!!window.ReactFloaterDebug}},{key:"event",get:function(){var i=this.props,o=i.disableHoverToClick,s=i.event;return s==="hover"&&Qh()&&!o?"click":s}},{key:"options",get:function(){var i=this.props.options;return Or(m6,i||{})}},{key:"styles",get:function(){var i=this,o=this.state,s=o.status,a=o.positionWrapper,l=o.statusWrapper,c=this.props.styles,f=Or(T6(c),c);if(a){var d;[We.IDLE].indexOf(s)===-1||[We.IDLE].indexOf(l)===-1?d=f.wrapperPosition:d=this.wrapperPopper.styles,f.wrapper=gt(gt({},f.wrapper),d)}if(this.target){var p=window.getComputedStyle(this.target);this.wrapperStyles?f.wrapper=gt(gt({},f.wrapper),this.wrapperStyles):["relative","static"].indexOf(p.position)===-1&&(this.wrapperStyles={},a||(I6.forEach(function(g){i.wrapperStyles[g]=p[g]}),f.wrapper=gt(gt({},f.wrapper),this.wrapperStyles),this.target.style.position="relative",this.target.style.top="auto",this.target.style.right="auto",this.target.style.bottom="auto",this.target.style.left="auto"))}return f}},{key:"target",get:function(){if(!Br())return null;var i=this.props.target;return i?Y.domElement(i)?i:document.querySelector(i):this.childRef||this.wrapperRef}},{key:"render",value:function(){var i=this.state,o=i.currentPlacement,s=i.positionWrapper,a=i.status,l=this.props,c=l.children,f=l.component,d=l.content,p=l.disableAnimation,g=l.footer,m=l.hideArrow,y=l.id,E=l.open,w=l.showCloseButton,b=l.style,_=l.target,P=l.title,R=Z.createElement(nT,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:b,styles:this.styles.wrapper},c),D={};return s?D.wrapperInPortal=R:D.wrapperAsChildren=R,Z.createElement("span",null,Z.createElement(Q2,{hasChildren:!!c,id:y,placement:o,setRef:this.setFloaterRef,target:_,zIndex:this.styles.options.zIndex},Z.createElement(tT,{component:f,content:d,disableAnimation:p,footer:g,handleClick:this.handleClick,hideArrow:m||o==="center",open:E,placement:o,positionWrapper:s,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:w,status:a,styles:this.styles,title:P}),D.wrapperInPortal),D.wrapperAsChildren)}}]),n}(Z.Component);nn(Ay,"propTypes",{autoOpen:re.bool,callback:re.func,children:re.node,component:uS(re.oneOfType([re.func,re.element]),function(e){return!e.content}),content:uS(re.node,function(e){return!e.component}),debug:re.bool,disableAnimation:re.bool,disableFlip:re.bool,disableHoverToClick:re.bool,event:re.oneOf(["hover","click"]),eventDelay:re.number,footer:re.node,getPopper:re.func,hideArrow:re.bool,id:re.oneOfType([re.string,re.number]),offset:re.number,open:re.bool,options:re.object,placement:re.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto","center"]),showCloseButton:re.bool,style:re.object,styles:re.object,target:re.oneOfType([re.object,re.string]),title:re.node,wrapperOptions:re.shape({offset:re.number,placement:re.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto"]),position:re.bool})});nn(Ay,"defaultProps",{autoOpen:!1,callback:cS,debug:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:"click",eventDelay:.4,getPopper:cS,hideArrow:!1,offset:15,placement:"bottom",showCloseButton:!1,styles:{},target:null,wrapperOptions:{position:!1}});var P6=function(e){return Object.prototype.hasOwnProperty.call(e,"props")},R6=function(e,t){return e+lu(t)},lu=function(e){return e===null||typeof e=="boolean"||typeof e>"u"?"":typeof e=="number"?e.toString():typeof e=="string"?e:Array.isArray(e)?e.reduce(R6,""):P6(e)&&Object.prototype.hasOwnProperty.call(e.props,"children")?lu(e.props.children):""};lu.default=lu;var A6=lu;const N6=ti(A6);var M6=Object.defineProperty,D6=(e,t,n)=>t in e?M6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_e=(e,t,n)=>(D6(e,typeof t!="symbol"?t+"":t,n),n),et={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",UPDATE:"update"},Er={TOUR_START:"tour:start",STEP_BEFORE:"step:before",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found",ERROR:"error"},De={INIT:"init",READY:"ready",BEACON:"beacon",TOOLTIP:"tooltip",COMPLETE:"complete",ERROR:"error"},Le={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished",ERROR:"error"};function Wi(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function rT(e){return e?e.getBoundingClientRect():null}function $6(e=!0){const{body:t,documentElement:n}=document;if(!t||!n)return 0;if(e){const r=[t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((o,s)=>o-s),i=Math.floor(r.length/2);return r.length%2===0?(r[i-1]+r[i])/2:r[i]}return Math.max(t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function lo(e){return typeof e=="string"?document.querySelector(e):e}function j6(e){return!e||e.nodeType!==1?null:getComputedStyle(e)}function lp(e,t,n){if(!e)return No();const r=P2(e);if(r){if(r.isSameNode(No()))return n?document:No();if(!(r.scrollHeight>r.offsetHeight)&&!t)return r.style.overflow="initial",No()}return r}function up(e,t){if(!e)return!1;const n=lp(e,t);return n?!n.isSameNode(No()):!1}function L6(e){return e.offsetParent!==document.body}function uu(e,t="fixed"){if(!e||!(e instanceof HTMLElement))return!1;const{nodeName:n}=e,r=j6(e);return n==="BODY"||n==="HTML"?!1:r&&r.position===t?!0:e.parentNode?uu(e.parentNode,t):!1}function F6(e){var t;if(!e)return!1;let n=e;for(;n&&n!==document.body;){if(n instanceof HTMLElement){const{display:r,visibility:i}=getComputedStyle(n);if(r==="none"||i==="hidden")return!1}n=(t=n.parentElement)!=null?t:null}return!0}function U6(e,t,n){var r;const i=rT(e),o=lp(e,n),s=up(e,n);let a=0,l=(r=i==null?void 0:i.top)!=null?r:0;return o instanceof HTMLElement&&(a=o.scrollTop,!s&&!uu(e)&&(l+=a),o.isSameNode(No())||(l+=No().scrollTop)),Math.floor(l-t)}function B6(e,t,n){var r;if(!e)return 0;const{offsetTop:i=0,scrollTop:o=0}=(r=P2(e))!=null?r:{};let s=e.getBoundingClientRect().top+o;i&&(up(e,n)||L6(e))&&(s-=i);const a=Math.floor(s-t);return a<0?0:a}function No(){var e;return(e=document.scrollingElement)!=null?e:document.documentElement}function z6(e,t){const{duration:n,element:r}=t;return new Promise((i,o)=>{const{scrollTop:s}=r,a=e>s?e-s:s-e;Y$.top(r,e,{duration:a<100?50:n},l=>l&&l.message!=="Element already at target scroll position"?o(l):i())})}var cl=jo.createPortal!==void 0;function iT(e=navigator.userAgent){let t=e;return typeof window>"u"?t="node":document.documentMode?t="ie":/Edge/.test(e)?t="edge":window.opera||e.includes(" OPR/")?t="opera":typeof window.InstallTrigger<"u"?t="firefox":window.chrome?t="chrome":/(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(e)&&(t="safari"),t}function Hi(e){const t=[],n=r=>{if(typeof r=="string"||typeof r=="number")t.push(r);else if(Array.isArray(r))r.forEach(i=>n(i));else if(j.isValidElement(r)){const{children:i}=r.props;Array.isArray(i)?i.forEach(o=>n(o)):n(i)}};return n(e),t.join(" ").trim()}function V6(e,t){return!be.plainObject(e)||!be.array(t)?!1:Object.keys(e).every(n=>t.includes(n))}function W6(e){const t=/^#?([\da-f])([\da-f])([\da-f])$/i,n=e.replace(t,(i,o,s,a)=>o+o+s+s+a+a),r=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(n);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:[]}function fS(e){return e.disableBeacon||e.placement==="center"}function dS(){return!["chrome","safari","firefox","opera"].includes(iT())}function Jo({data:e,debug:t=!1,title:n,warn:r=!1}){const i=r?console.warn||console.error:console.log;t&&(n&&e?(console.groupCollapsed(`%creact-joyride: ${n}`,"color: #ff0044; font-weight: bold; font-size: 12px;"),Array.isArray(e)?e.forEach(o=>{be.plainObject(o)&&o.key?i.apply(console,[o.key,o.value]):i.apply(console,[o])}):i.apply(console,[e]),console.groupEnd()):console.error("Missing title or data props"))}function H6(e){return Object.keys(e)}function oT(e,...t){if(!be.plainObject(e))throw new TypeError("Expected an object");const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&(t.includes(r)||(n[r]=e[r]));return n}function G6(e,...t){if(!be.plainObject(e))throw new TypeError("Expected an object");if(!t.length)return e;const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&t.includes(r)&&(n[r]=e[r]);return n}function q6(e){const{isFirstStep:t,lifecycle:n,previousLifecycle:r,scrollToFirstStep:i,step:o,target:s}=e;return!o.disableScrolling&&(!t||i||n===De.TOOLTIP)&&o.placement!=="center"&&(!o.isFixed||!uu(s))&&r!==n&&[De.BEACON,De.TOOLTIP].includes(n)}var K6={options:{preventOverflow:{boundariesElement:"scrollParent"}},wrapperOptions:{offset:-18,position:!0}},sT={back:"Back",close:"Close",last:"Last",next:"Next",open:"Open the dialog",skip:"Skip"},Y6={event:"click",placement:"bottom",offset:10,disableBeacon:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrollParentFix:!1,disableScrolling:!1,hideBackButton:!1,hideCloseButton:!1,hideFooter:!1,isFixed:!1,locale:sT,showProgress:!1,showSkipButton:!1,spotlightClicks:!1,spotlightPadding:10},X6={continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:void 0,hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]},Q6={arrowColor:"#fff",backgroundColor:"#fff",beaconSize:36,overlayColor:"rgba(0, 0, 0, 0.5)",primaryColor:"#f04",spotlightShadow:"0 0 15px rgba(0, 0, 0, 0.5)",textColor:"#333",width:380,zIndex:100},fl={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",cursor:"pointer",fontSize:16,lineHeight:1,padding:8,WebkitAppearance:"none"},pS={borderRadius:4,position:"absolute"};function J6(e,t){var n,r,i,o,s;const{floaterProps:a,styles:l}=e,c=Or((n=t.floaterProps)!=null?n:{},a??{}),f=Or(l??{},(r=t.styles)!=null?r:{}),d=Or(Q6,f.options||{}),p=t.placement==="center"||t.disableBeacon;let{width:g}=d;window.innerWidth>480&&(g=380),"width"in d&&(g=typeof d.width=="number"&&window.innerWidthaT(n,t)):(Jo({title:"validateSteps",data:"steps must be an array",warn:!0,debug:t}),!1)}var lT={action:"init",controlled:!1,index:0,lifecycle:De.INIT,origin:null,size:0,status:Le.IDLE},mS=H6(oT(lT,"controlled","size")),eL=class{constructor(e){_e(this,"beaconPopper"),_e(this,"tooltipPopper"),_e(this,"data",new Map),_e(this,"listener"),_e(this,"store",new Map),_e(this,"addListener",i=>{this.listener=i}),_e(this,"setSteps",i=>{const{size:o,status:s}=this.getState(),a={size:i.length,status:s};this.data.set("steps",i),s===Le.WAITING&&!o&&i.length&&(a.status=Le.RUNNING),this.setState(a)}),_e(this,"getPopper",i=>i==="beacon"?this.beaconPopper:this.tooltipPopper),_e(this,"setPopper",(i,o)=>{i==="beacon"?this.beaconPopper=o:this.tooltipPopper=o}),_e(this,"cleanupPoppers",()=>{this.beaconPopper=null,this.tooltipPopper=null}),_e(this,"close",(i=null)=>{const{index:o,status:s}=this.getState();s===Le.RUNNING&&this.setState({...this.getNextState({action:et.CLOSE,index:o+1,origin:i})})}),_e(this,"go",i=>{const{controlled:o,status:s}=this.getState();if(o||s!==Le.RUNNING)return;const a=this.getSteps()[i];this.setState({...this.getNextState({action:et.GO,index:i}),status:a?s:Le.FINISHED})}),_e(this,"info",()=>this.getState()),_e(this,"next",()=>{const{index:i,status:o}=this.getState();o===Le.RUNNING&&this.setState(this.getNextState({action:et.NEXT,index:i+1}))}),_e(this,"open",()=>{const{status:i}=this.getState();i===Le.RUNNING&&this.setState({...this.getNextState({action:et.UPDATE,lifecycle:De.TOOLTIP})})}),_e(this,"prev",()=>{const{index:i,status:o}=this.getState();o===Le.RUNNING&&this.setState({...this.getNextState({action:et.PREV,index:i-1})})}),_e(this,"reset",(i=!1)=>{const{controlled:o}=this.getState();o||this.setState({...this.getNextState({action:et.RESET,index:0}),status:i?Le.RUNNING:Le.READY})}),_e(this,"skip",()=>{const{status:i}=this.getState();i===Le.RUNNING&&this.setState({action:et.SKIP,lifecycle:De.INIT,status:Le.SKIPPED})}),_e(this,"start",i=>{const{index:o,size:s}=this.getState();this.setState({...this.getNextState({action:et.START,index:be.number(i)?i:o},!0),status:s?Le.RUNNING:Le.WAITING})}),_e(this,"stop",(i=!1)=>{const{index:o,status:s}=this.getState();[Le.FINISHED,Le.SKIPPED].includes(s)||this.setState({...this.getNextState({action:et.STOP,index:o+(i?1:0)}),status:Le.PAUSED})}),_e(this,"update",i=>{var o,s;if(!V6(i,mS))throw new Error(`State is not valid. Valid keys: ${mS.join(", ")}`);this.setState({...this.getNextState({...this.getState(),...i,action:(o=i.action)!=null?o:et.UPDATE,origin:(s=i.origin)!=null?s:null},!0)})});const{continuous:t=!1,stepIndex:n,steps:r=[]}=e??{};this.setState({action:et.INIT,controlled:be.number(n),continuous:t,index:be.number(n)?n:0,lifecycle:De.INIT,origin:null,status:r.length?Le.READY:Le.IDLE},!0),this.beaconPopper=null,this.tooltipPopper=null,this.listener=null,this.setSteps(r)}getState(){return this.store.size?{action:this.store.get("action")||"",controlled:this.store.get("controlled")||!1,index:parseInt(this.store.get("index"),10),lifecycle:this.store.get("lifecycle")||"",origin:this.store.get("origin")||null,size:this.store.get("size")||0,status:this.store.get("status")||""}:{...lT}}getNextState(e,t=!1){var n,r,i,o,s;const{action:a,controlled:l,index:c,size:f,status:d}=this.getState(),p=be.number(e.index)?e.index:c,g=l&&!t?c:Math.min(Math.max(p,0),f);return{action:(n=e.action)!=null?n:a,controlled:l,index:g,lifecycle:(r=e.lifecycle)!=null?r:De.INIT,origin:(i=e.origin)!=null?i:null,size:(o=e.size)!=null?o:f,status:g===f?Le.FINISHED:(s=e.status)!=null?s:d}}getSteps(){const e=this.data.get("steps");return Array.isArray(e)?e:[]}hasUpdatedState(e){const t=JSON.stringify(e),n=JSON.stringify(this.getState());return t!==n}setState(e,t=!1){const n=this.getState(),{action:r,index:i,lifecycle:o,origin:s=null,size:a,status:l}={...n,...e};this.store.set("action",r),this.store.set("index",i),this.store.set("lifecycle",o),this.store.set("origin",s),this.store.set("size",a),this.store.set("status",l),t&&(this.store.set("controlled",e.controlled),this.store.set("continuous",e.continuous)),this.listener&&this.hasUpdatedState(n)&&this.listener(this.getState())}getHelpers(){return{close:this.close,go:this.go,info:this.info,next:this.next,open:this.open,prev:this.prev,reset:this.reset,skip:this.skip}}};function tL(e){return new eL(e)}function nL({styles:e}){return j.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:e})}var rL=nL,iL=class extends j.Component{constructor(){super(...arguments),_e(this,"isActive",!1),_e(this,"resizeTimeout"),_e(this,"scrollTimeout"),_e(this,"scrollParent"),_e(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),_e(this,"hideSpotlight",()=>{const{continuous:e,disableOverlay:t,lifecycle:n}=this.props,r=[De.BEACON,De.COMPLETE,De.ERROR];return t||(e?r.includes(n):n!==De.TOOLTIP)}),_e(this,"handleMouseMove",e=>{const{mouseOverSpotlight:t}=this.state,{height:n,left:r,position:i,top:o,width:s}=this.spotlightStyles,a=i==="fixed"?e.clientY:e.pageY,l=i==="fixed"?e.clientX:e.pageX,c=a>=o&&a<=o+n,d=l>=r&&l<=r+s&&c;d!==t&&this.updateState({mouseOverSpotlight:d})}),_e(this,"handleScroll",()=>{const{target:e}=this.props,t=lo(e);if(this.scrollParent!==document){const{isScrolling:n}=this.state;n||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else uu(t,"sticky")&&this.updateState({})}),_e(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){const{debug:e,disableScrolling:t,disableScrollParentFix:n=!1,target:r}=this.props,i=lo(r);this.scrollParent=lp(i??document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(e){var t;const{lifecycle:n,spotlightClicks:r}=this.props,{changed:i}=md(e,this.props);i("lifecycle",De.TOOLTIP)&&((t=this.scrollParent)==null||t.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{const{isScrolling:o}=this.state;o||this.updateState({showSpotlight:!0})},100)),(i("spotlightClicks")||i("disableOverlay")||i("lifecycle"))&&(r&&n===De.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):n!==De.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var e;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),(e=this.scrollParent)==null||e.removeEventListener("scroll",this.handleScroll)}get overlayStyles(){const{mouseOverSpotlight:e}=this.state,{disableOverlayClose:t,placement:n,styles:r}=this.props;let i=r.overlay;return dS()&&(i=n==="center"?r.overlayLegacyCenter:r.overlayLegacy),{cursor:t?"default":"pointer",height:$6(),pointerEvents:e?"none":"auto",...i}}get spotlightStyles(){var e,t,n;const{showSpotlight:r}=this.state,{disableScrollParentFix:i=!1,spotlightClicks:o,spotlightPadding:s=0,styles:a,target:l}=this.props,c=lo(l),f=rT(c),d=uu(c),p=U6(c,s,i);return{...dS()?a.spotlightLegacy:a.spotlight,height:Math.round(((e=f==null?void 0:f.height)!=null?e:0)+s*2),left:Math.round(((t=f==null?void 0:f.left)!=null?t:0)-s),opacity:r?1:0,pointerEvents:o?"none":"auto",position:d?"fixed":"absolute",top:p,transition:"opacity 0.2s",width:Math.round(((n=f==null?void 0:f.width)!=null?n:0)+s*2)}}updateState(e){this.isActive&&this.setState(t=>({...t,...e}))}render(){const{showSpotlight:e}=this.state,{onClickOverlay:t,placement:n}=this.props,{hideSpotlight:r,overlayStyles:i,spotlightStyles:o}=this;if(r())return null;let s=n!=="center"&&e&&j.createElement(rL,{styles:o});if(iT()==="safari"){const{mixBlendMode:a,zIndex:l,...c}=i;s=j.createElement("div",{style:{...c}},s),delete i.backgroundColor}return j.createElement("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:t,role:"presentation",style:i},s)}},oL=class extends j.Component{constructor(){super(...arguments),_e(this,"node",null)}componentDidMount(){const{id:e}=this.props;Wi()&&(this.node=document.createElement("div"),this.node.id=e,document.body.appendChild(this.node),cl||this.renderReact15())}componentDidUpdate(){Wi()&&(cl||this.renderReact15())}componentWillUnmount(){!Wi()||!this.node||(cl||jo.unmountComponentAtNode(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!Wi())return;const{children:e}=this.props;this.node&&jo.unstable_renderSubtreeIntoContainer(this,e,this.node)}renderReact16(){if(!Wi()||!cl)return null;const{children:e}=this.props;return this.node?jo.createPortal(e,this.node):null}render(){return cl?this.renderReact16():null}},sL=class{constructor(e,t){if(_e(this,"element"),_e(this,"options"),_e(this,"canBeTabbed",n=>{const{tabIndex:r}=n;return r===null||r<0?!1:this.canHaveFocus(n)}),_e(this,"canHaveFocus",n=>{const r=/input|select|textarea|button|object/,i=n.nodeName.toLowerCase();return(r.test(i)&&!n.getAttribute("disabled")||i==="a"&&!!n.getAttribute("href"))&&this.isVisible(n)}),_e(this,"findValidTabElements",()=>[].slice.call(this.element.querySelectorAll("*"),0).filter(this.canBeTabbed)),_e(this,"handleKeyDown",n=>{const{code:r="Tab"}=this.options;n.code===r&&this.interceptTab(n)}),_e(this,"interceptTab",n=>{n.preventDefault();const r=this.findValidTabElements(),{shiftKey:i}=n;if(!r.length)return;let o=document.activeElement?r.indexOf(document.activeElement):0;o===-1||!i&&o+1===r.length?o=0:i&&o===0?o=r.length-1:o+=i?-1:1,r[o].focus()}),_e(this,"isHidden",n=>{const r=n.offsetWidth<=0&&n.offsetHeight<=0,i=window.getComputedStyle(n);return r&&!n.innerHTML?!0:r&&i.getPropertyValue("overflow")!=="visible"||i.getPropertyValue("display")==="none"}),_e(this,"isVisible",n=>{let r=n;for(;r;)if(r instanceof HTMLElement){if(r===document.body)break;if(this.isHidden(r))return!1;r=r.parentNode}return!0}),_e(this,"removeScope",()=>{window.removeEventListener("keydown",this.handleKeyDown)}),_e(this,"checkFocus",n=>{document.activeElement!==n&&(n.focus(),window.requestAnimationFrame(()=>this.checkFocus(n)))}),_e(this,"setFocus",()=>{const{selector:n}=this.options;if(!n)return;const r=this.element.querySelector(n);r&&window.requestAnimationFrame(()=>this.checkFocus(r))}),!(e instanceof HTMLElement))throw new TypeError("Invalid parameter: element must be an HTMLElement");this.element=e,this.options=t,window.addEventListener("keydown",this.handleKeyDown,!1),this.setFocus()}},aL=class extends j.Component{constructor(e){if(super(e),_e(this,"beacon",null),_e(this,"setBeaconRef",i=>{this.beacon=i}),e.beaconComponent)return;const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id="joyride-beacon-animation",e.nonce&&n.setAttribute("nonce",e.nonce),n.appendChild(document.createTextNode(` + @keyframes joyride-beacon-inner { + 20% { + opacity: 0.9; + } + + 90% { + opacity: 0.7; + } + } + + @keyframes joyride-beacon-outer { + 0% { + transform: scale(1); + } + + 45% { + opacity: 0.7; + transform: scale(0.75); + } + + 100% { + opacity: 0.9; + transform: scale(1); + } + } + `)),t.appendChild(n)}componentDidMount(){const{shouldFocus:e}=this.props;setTimeout(()=>{be.domElement(this.beacon)&&e&&this.beacon.focus()},0)}componentWillUnmount(){const e=document.getElementById("joyride-beacon-animation");e!=null&&e.parentNode&&e.parentNode.removeChild(e)}render(){const{beaconComponent:e,continuous:t,index:n,isLastStep:r,locale:i,onClickOrHover:o,size:s,step:a,styles:l}=this.props,c=be.string(i.open)?i.open:N6(i.open),f={"aria-label":c,onClick:o,onMouseEnter:o,ref:this.setBeaconRef,title:c};let d;if(e){const p=e;d=j.createElement(p,{continuous:t,index:n,isLastStep:r,size:s,step:a,...f})}else d=j.createElement("button",{key:"JoyrideBeacon",className:"react-joyride__beacon","data-test-id":"button-beacon",style:l.beacon,type:"button",...f},j.createElement("span",{style:l.beaconInner}),j.createElement("span",{style:l.beaconOuter}));return d}};function lL({styles:e,...t}){const{color:n,height:r,width:i,...o}=e;return Z.createElement("button",{style:o,type:"button",...t},Z.createElement("svg",{height:typeof r=="number"?`${r}px`:r,preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 18 18",width:typeof i=="number"?`${i}px`:i,xmlns:"http://www.w3.org/2000/svg"},Z.createElement("g",null,Z.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:n}))))}var uL=lL;function cL(e){const{backProps:t,closeProps:n,continuous:r,index:i,isLastStep:o,primaryProps:s,size:a,skipProps:l,step:c,tooltipProps:f}=e,{content:d,hideBackButton:p,hideCloseButton:g,hideFooter:m,locale:y,showProgress:E,showSkipButton:w,styles:b,title:_}=c,{back:P,close:R,last:D,next:S,skip:x}=y,C={primary:R};return r&&(C.primary=o?D:S,E&&(C.primary=j.createElement("span",null,C.primary," (",i+1,"/",a,")"))),C.primary&&(C.primary=j.createElement("button",{"data-test-id":"button-primary",style:b.buttonNext,type:"button",...s},C.primary)),w&&!o&&(C.skip=j.createElement("button",{"aria-live":"off","data-test-id":"button-skip",style:b.buttonSkip,type:"button",...l},x)),!p&&i>0&&(C.back=j.createElement("button",{"data-test-id":"button-back",style:b.buttonBack,type:"button",...t},P)),C.close=!g&&j.createElement(uL,{"data-test-id":"button-close",styles:b.buttonClose,...n}),j.createElement("div",{key:"JoyrideTooltip","aria-label":Hi(_)||Hi(d),className:"react-joyride__tooltip",style:b.tooltip,...f},j.createElement("div",{style:b.tooltipContainer},_&&j.createElement("h1",{"aria-label":Hi(_),style:b.tooltipTitle},_),j.createElement("div",{style:b.tooltipContent},d)),!m&&j.createElement("div",{style:b.tooltipFooter},j.createElement("div",{style:b.tooltipFooterSpacer},C.skip),C.back,C.primary),C.close)}var fL=cL,dL=class extends j.Component{constructor(){super(...arguments),_e(this,"handleClickBack",e=>{e.preventDefault();const{helpers:t}=this.props;t.prev()}),_e(this,"handleClickClose",e=>{e.preventDefault();const{helpers:t}=this.props;t.close("button_close")}),_e(this,"handleClickPrimary",e=>{e.preventDefault();const{continuous:t,helpers:n}=this.props;if(!t){n.close("button_primary");return}n.next()}),_e(this,"handleClickSkip",e=>{e.preventDefault();const{helpers:t}=this.props;t.skip()}),_e(this,"getElementsProps",()=>{const{continuous:e,isLastStep:t,setTooltipRef:n,step:r}=this.props,i=Hi(r.locale.back),o=Hi(r.locale.close),s=Hi(r.locale.last),a=Hi(r.locale.next),l=Hi(r.locale.skip);let c=e?a:o;return t&&(c=s),{backProps:{"aria-label":i,"data-action":"back",onClick:this.handleClickBack,role:"button",title:i},closeProps:{"aria-label":o,"data-action":"close",onClick:this.handleClickClose,role:"button",title:o},primaryProps:{"aria-label":c,"data-action":"primary",onClick:this.handleClickPrimary,role:"button",title:c},skipProps:{"aria-label":l,"data-action":"skip",onClick:this.handleClickSkip,role:"button",title:l},tooltipProps:{"aria-modal":!0,ref:n,role:"alertdialog"}}})}render(){const{continuous:e,index:t,isLastStep:n,setTooltipRef:r,size:i,step:o}=this.props,{beaconComponent:s,tooltipComponent:a,...l}=o;let c;if(a){const f={...this.getElementsProps(),continuous:e,index:t,isLastStep:n,size:i,step:l,setTooltipRef:r},d=a;c=j.createElement(d,{...f})}else c=j.createElement(fL,{...this.getElementsProps(),continuous:e,index:t,isLastStep:n,size:i,step:o});return c}},pL=class extends j.Component{constructor(){super(...arguments),_e(this,"scope",null),_e(this,"tooltip",null),_e(this,"handleClickHoverBeacon",e=>{const{step:t,store:n}=this.props;e.type==="mouseenter"&&t.event!=="hover"||n.update({lifecycle:De.TOOLTIP})}),_e(this,"setTooltipRef",e=>{this.tooltip=e}),_e(this,"setPopper",(e,t)=>{var n;const{action:r,lifecycle:i,step:o,store:s}=this.props;t==="wrapper"?s.setPopper("beacon",e):s.setPopper("tooltip",e),s.getPopper("beacon")&&s.getPopper("tooltip")&&i===De.INIT&&s.update({action:r,lifecycle:De.READY}),(n=o.floaterProps)!=null&&n.getPopper&&o.floaterProps.getPopper(e,t)}),_e(this,"renderTooltip",e=>{const{continuous:t,helpers:n,index:r,size:i,step:o}=this.props;return j.createElement(dL,{continuous:t,helpers:n,index:r,isLastStep:r+1===i,setTooltipRef:this.setTooltipRef,size:i,step:o,...e})})}componentDidMount(){const{debug:e,index:t}=this.props;Jo({title:`step:${t}`,data:[{key:"props",value:this.props}],debug:e})}componentDidUpdate(e){var t;const{action:n,callback:r,continuous:i,controlled:o,debug:s,helpers:a,index:l,lifecycle:c,status:f,step:d,store:p}=this.props,{changed:g,changedFrom:m}=md(e,this.props),y=a.info(),E=i&&n!==et.CLOSE&&(l>0||n===et.PREV),w=g("action")||g("index")||g("lifecycle")||g("status"),b=m("lifecycle",[De.TOOLTIP,De.INIT],De.INIT),_=g("action",[et.NEXT,et.PREV,et.SKIP,et.CLOSE]),P=o&&l===e.index;if(_&&(b||P)&&r({...y,index:e.index,lifecycle:De.COMPLETE,step:e.step,type:Er.STEP_AFTER}),d.placement==="center"&&f===Le.RUNNING&&g("index")&&n!==et.START&&c===De.INIT&&p.update({lifecycle:De.READY}),w){const R=lo(d.target),D=!!R;D&&F6(R)?(m("status",Le.READY,Le.RUNNING)||m("lifecycle",De.INIT,De.READY))&&r({...y,step:d,type:Er.STEP_BEFORE}):(console.warn(D?"Target not visible":"Target not mounted",d),r({...y,type:Er.TARGET_NOT_FOUND,step:d}),o||p.update({index:l+(n===et.PREV?-1:1)}))}m("lifecycle",De.INIT,De.READY)&&p.update({lifecycle:fS(d)||E?De.TOOLTIP:De.BEACON}),g("index")&&Jo({title:`step:${c}`,data:[{key:"props",value:this.props}],debug:s}),g("lifecycle",De.BEACON)&&r({...y,step:d,type:Er.BEACON}),g("lifecycle",De.TOOLTIP)&&(r({...y,step:d,type:Er.TOOLTIP}),this.tooltip&&(this.scope=new sL(this.tooltip,{selector:"[data-action=primary]"}),this.scope.setFocus())),m("lifecycle",[De.TOOLTIP,De.INIT],De.INIT)&&((t=this.scope)==null||t.removeScope(),p.cleanupPoppers())}componentWillUnmount(){var e;(e=this.scope)==null||e.removeScope()}get open(){const{lifecycle:e,step:t}=this.props;return fS(t)||e===De.TOOLTIP}render(){const{continuous:e,debug:t,index:n,nonce:r,shouldScroll:i,size:o,step:s}=this.props,a=lo(s.target);return!aT(s)||!be.domElement(a)?null:j.createElement("div",{key:`JoyrideStep-${n}`,className:"react-joyride__step"},j.createElement(Ay,{...s.floaterProps,component:this.renderTooltip,debug:t,getPopper:this.setPopper,id:`react-joyride-step-${n}`,open:this.open,placement:s.placement,target:s.target},j.createElement(aL,{beaconComponent:s.beaconComponent,continuous:e,index:n,isLastStep:n+1===o,locale:s.locale,nonce:r,onClickOrHover:this.handleClickHoverBeacon,shouldFocus:i,size:o,step:s,styles:s.styles})))}},uT=class extends j.Component{constructor(e){super(e),_e(this,"helpers"),_e(this,"store"),_e(this,"callback",s=>{const{callback:a}=this.props;be.function(a)&&a(s)}),_e(this,"handleKeyboard",s=>{const{index:a,lifecycle:l}=this.state,{steps:c}=this.props,f=c[a];l===De.TOOLTIP&&s.code==="Escape"&&f&&!f.disableCloseOnEsc&&this.store.close("keyboard")}),_e(this,"handleClickOverlay",()=>{const{index:s}=this.state,{steps:a}=this.props;ds(this.props,a[s]).disableOverlayClose||this.helpers.close("overlay")}),_e(this,"syncState",s=>{this.setState(s)});const{debug:t,getHelpers:n,run:r,stepIndex:i}=e;this.store=tL({...e,controlled:r&&be.number(i)}),this.helpers=this.store.getHelpers();const{addListener:o}=this.store;Jo({title:"init",data:[{key:"props",value:this.props},{key:"state",value:this.state}],debug:t}),o(this.syncState),n&&n(this.helpers),this.state=this.store.getState()}componentDidMount(){if(!Wi())return;const{debug:e,disableCloseOnEsc:t,run:n,steps:r}=this.props,{start:i}=this.store;hS(r,e)&&n&&i(),t||document.body.addEventListener("keydown",this.handleKeyboard,{passive:!0})}componentDidUpdate(e,t){if(!Wi())return;const{action:n,controlled:r,index:i,lifecycle:o,status:s}=this.state,{debug:a,run:l,stepIndex:c,steps:f}=this.props,{stepIndex:d,steps:p}=e,{reset:g,setSteps:m,start:y,stop:E,update:w}=this.store,{changed:b}=md(e,this.props),{changed:_,changedFrom:P}=md(t,this.state),R=ds(this.props,f[i]),D=!gn(p,f),S=be.number(c)&&b("stepIndex"),x=lo(R.target);if(D&&(hS(f,a)?m(f):console.warn("Steps are not valid",f)),b("run")&&(l?y(c):E()),S){let N=be.number(d)&&d=0?y:0,r===Le.RUNNING&&z6(y,{element:m,duration:s}).then(()=>{setTimeout(()=>{var b;(b=this.store.getPopper("tooltip"))==null||b.instance.update()},10)})}}render(){if(!Wi())return null;const{index:e,lifecycle:t,status:n}=this.state,{continuous:r=!1,debug:i=!1,nonce:o,scrollToFirstStep:s=!1,steps:a}=this.props,l=n===Le.RUNNING,c={};if(l&&a[e]){const f=ds(this.props,a[e]);c.step=j.createElement(pL,{...this.state,callback:this.callback,continuous:r,debug:i,helpers:this.helpers,nonce:o,shouldScroll:!f.disableScrolling&&(e!==0||s),step:f,store:this.store}),c.overlay=j.createElement(oL,{id:"react-joyride-portal"},j.createElement(iL,{...f,continuous:r,debug:i,lifecycle:t,onClickOverlay:this.handleClickOverlay}))}return j.createElement("div",{className:"react-joyride"},c.step,c.overlay)}};_e(uT,"defaultProps",X6);var hL=uT;const mL=[{target:".landing-header",content:"Welcome to SimpliTrac! This is a simple to use financial tracker that allows you to record expenses on the go.",disableBeacon:!0},{target:".buttons-container button:nth-child(2)",content:"With our intuitive AI-driven camera setup, you can snap pictures of your receipts on the fly and record your daily expenses."},{target:".landing-content",content:"You can manually enter your expenses on the main page with our easy to use Expense Table."},{target:".buttons-container button:nth-child(3)",content:"See where your money is going in real time with our handy Chart feature."},{target:".buttons-container button:nth-child(4)",content:"Use the Edit Transaction function to correct any errors in your expense processing."},{target:"body",content:"Be sure to check your achievements tab to see how you rank among other users and earn badges while maintaining financial peace of mind!",placement:"center"}],gL=({run:e,setRun:t})=>{const n=r=>{const{status:i}=r;[Le.FINISHED,Le.SKIPPED].includes(i)&&t(!1)};return O.jsx(hL,{steps:mL,run:e,continuous:!0,showSkipButton:!0,showProgress:!0,styles:{options:{zIndex:1e4}},callback:n})},Ny="/assets/simplitrac_logo-CakUhnBD.png",vL=()=>{const{setScreen:e,ocrData:t,serverResponse:n,setServerResponse:r,user:i,setIsUpdating:o}=j.useContext(dr),[s,a]=j.useState(!1),[l,c]=j.useState(!1);j.useEffect(()=>{i.isNewUser&&i.isNewUser()&&c(!0)},[i]);const f=g=>{g!==void 0&&e(g)};j.useEffect(()=>{n&&r(null)},[i]);const d=()=>{a(!s)},p=async g=>{if(window.confirm("Are you sure you want to delete this category?")){o(!0);const y=await new mn(i).deleteCategory(g);y instanceof mn?(setUser(y),r("Category Successfully Deleted")):r("Failed to delete category")}o(!1)};return O.jsx(O$,{config:T$,initialState:i.serialize(),badgesButtonPosition:"top-right",children:O.jsxs(Jd,{fluid:!0,className:"landing-container",children:[O.jsx(gL,{run:l,setRun:c}),i.first_name&&O.jsxs(O.Fragment,{children:[O.jsxs("p",{children:["Welcome ",i.first_name," ",i.last_name]}),i.isNewUser()&&O.jsx(j3,{}),t&&O.jsx(qD,{}),n&&O.jsx(s$,{})]}),O.jsx("div",{className:"landing-header",children:O.jsx("h1",{children:O.jsx(Qd,{xs:1,md:1,children:O.jsx(Zd,{src:Ny,role:"logo",style:{width:"300px",height:"300px"},roundedCircle:!0})})})}),O.jsx("div",{className:"landing-content",children:O.jsx(v4,{})}),O.jsxs("div",{className:"buttons-container",children:[O.jsx("button",{className:"custom-button",onClick:()=>c(!0),children:"Start Tour"}),O.jsx("button",{className:"custom-button",onClick:()=>f("camera"),children:"Camera"}),O.jsx("button",{className:"custom-button",onClick:()=>f("chart"),children:"Chart"}),O.jsx("button",{className:"custom-button",onClick:()=>f("edit"),children:"Edit Transactions"}),O.jsx("button",{className:"custom-button",onClick:d,children:s?"Hide Categories":"Show Categories"})]}),s&&O.jsxs("div",{className:"categories-list",children:[O.jsx("h3",{children:"Your Categories"}),O.jsx("ul",{className:"category-list",children:i.categories.map(g=>O.jsxs("li",{className:"category-item",children:[O.jsx("span",{children:g.category_name}),O.jsx("button",{className:"delete-button custom-button",onClick:()=>p(g.category_id),children:"Delete"})]},g.category_id))})]}),O.jsx("div",{className:"landing-content",children:O.jsx(GD,{})})]})})};function cu(e,t){const n=Q({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=Q({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=e[r]||{},o=t[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=Q({},o),Object.keys(i).forEach(s=>{n[r][s]=cu(i[s],o[s])}))}else n[r]===void 0&&(n[r]=e[r])}),n}const cT=j.createContext(void 0);function yL({value:e,children:t}){return O.jsx(cT.Provider,{value:e,children:t})}function bL(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?cu(i.defaultProps,r):!i.styleOverrides&&!i.variants?cu(i,r):r}function wL({props:e,name:t}){const n=j.useContext(cT);return bL({props:e,name:t,theme:{components:n}})}function Nn(e){return wL(e)}function Zo(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n0?Gt(Ma,--Rn):0,ba--,Pt===10&&(ba=1,fp--),Pt}function Vn(){return Pt=Rn2||du(Pt)>3?"":" "}function FL(e,t){for(;--t&&Vn()&&!(Pt<48||Pt>102||Pt>57&&Pt<65||Pt>70&&Pt<97););return Vu(e,df()+(t<6&&Zr()==32&&Vn()==32))}function Ng(e){for(;Vn();)switch(Pt){case e:return Rn;case 34:case 39:e!==34&&e!==39&&Ng(Pt);break;case 40:e===41&&Ng(e);break;case 92:Vn();break}return Rn}function UL(e,t){for(;Vn()&&e+Pt!==57;)if(e+Pt===84&&Zr()===47)break;return"/*"+Vu(t,Rn-1)+"*"+cp(e===47?e:Vn())}function BL(e){for(;!du(Zr());)Vn();return Vu(e,Rn)}function zL(e){return gT(hf("",null,null,null,[""],e=mT(e),0,[0],e))}function hf(e,t,n,r,i,o,s,a,l){for(var c=0,f=0,d=s,p=0,g=0,m=0,y=1,E=1,w=1,b=0,_="",P=i,R=o,D=r,S=_;E;)switch(m=b,b=Vn()){case 40:if(m!=108&&Gt(S,d-1)==58){Ag(S+=Qe(pf(b),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:S+=pf(b);break;case 9:case 10:case 13:case 32:S+=LL(m);break;case 92:S+=FL(df()-1,7);continue;case 47:switch(Zr()){case 42:case 47:$c(VL(UL(Vn(),df()),t,n),l);break;default:S+="/"}break;case 123*y:a[c++]=zr(S)*w;case 125*y:case 59:case 0:switch(b){case 0:case 125:E=0;case 59+f:w==-1&&(S=Qe(S,/\f/g,"")),g>0&&zr(S)-d&&$c(g>32?vS(S+";",r,n,d-1):vS(Qe(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if($c(D=gS(S,t,n,c,f,i,a,_,P=[],R=[],d),o),b===123)if(f===0)hf(S,t,D,D,P,o,d,a,R);else switch(p===99&&Gt(S,3)===110?100:p){case 100:case 108:case 109:case 115:hf(e,D,D,r&&$c(gS(e,D,D,0,0,i,a,_,i,P=[],d),R),i,R,d,a,r?P:R);break;default:hf(S,D,D,D,[""],R,0,a,R)}}c=f=g=0,y=w=1,_=S="",d=s;break;case 58:d=1+zr(S),g=m;default:if(y<1){if(b==123)--y;else if(b==125&&y++==0&&jL()==125)continue}switch(S+=cp(b),b*y){case 38:w=f>0?1:(S+="\f",-1);break;case 44:a[c++]=(zr(S)-1)*w,w=1;break;case 64:Zr()===45&&(S+=pf(Vn())),p=Zr(),f=d=zr(_=S+=BL(df())),b++;break;case 45:m===45&&zr(S)==2&&(y=0)}}return o}function gS(e,t,n,r,i,o,s,a,l,c,f){for(var d=i-1,p=i===0?o:[""],g=$y(p),m=0,y=0,E=0;m0?p[w]+" "+b:Qe(b,/&\f/g,p[w])))&&(l[E++]=_);return dp(e,t,n,i===0?My:a,l,c,f)}function VL(e,t,n){return dp(e,t,n,fT,cp($L()),fu(e,2,-2),0)}function vS(e,t,n,r){return dp(e,t,n,Dy,fu(e,0,r),fu(e,r+1,-1),r)}function qs(e,t){for(var n="",r=$y(e),i=0;i6)switch(Gt(e,t+1)){case 109:if(Gt(e,t+4)!==45)break;case 102:return Qe(e,/(.+:)(.+)-([^]+)/,"$1"+Xe+"$2-$3$1"+bd+(Gt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ag(e,"stretch")?vT(Qe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Gt(e,t+1)!==115)break;case 6444:switch(Gt(e,zr(e)-3-(~Ag(e,"!important")&&10))){case 107:return Qe(e,":",":"+Xe)+e;case 101:return Qe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Xe+(Gt(e,14)===45?"inline-":"")+"box$3$1"+Xe+"$2$3$1"+Zt+"$2box$3")+e}break;case 5936:switch(Gt(e,t+11)){case 114:return Xe+e+Zt+Qe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Xe+e+Zt+Qe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Xe+e+Zt+Qe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Xe+e+Zt+e+e}return e}var JL=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Dy:t.return=vT(t.value,t.length);break;case dT:return qs([dl(t,{value:Qe(t.value,"@","@"+Xe)})],i);case My:if(t.length)return DL(t.props,function(o){switch(ML(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return qs([dl(t,{props:[Qe(o,/:(read-\w+)/,":"+bd+"$1")]})],i);case"::placeholder":return qs([dl(t,{props:[Qe(o,/:(plac\w+)/,":"+Xe+"input-$1")]}),dl(t,{props:[Qe(o,/:(plac\w+)/,":"+bd+"$1")]}),dl(t,{props:[Qe(o,/:(plac\w+)/,Zt+"input-$1")]})],i)}return""})}},ZL=[JL],yT=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var E=y.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=t.stylisPlugins||ZL,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(y){for(var E=y.getAttribute("data-emotion").split(" "),w=1;w=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var fF={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function dF(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var pF=!1,hF=/[A-Z]|^ms/g,mF=/_EMO_([^_]+?)_([^]*?)_EMO_/g,CT=function(t){return t.charCodeAt(1)===45},bS=function(t){return t!=null&&typeof t!="boolean"},Jh=dF(function(e){return CT(e)?e:e.replace(hF,"-$&").toLowerCase()}),wS=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(mF,function(r,i,o){return Vr={name:i,styles:o,next:Vr},i})}return fF[t]!==1&&!CT(t)&&typeof n=="number"&&n!==0?n+"px":n},gF="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function pu(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Vr={name:i.name,styles:i.styles,next:Vr},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Vr={name:s.name,styles:s.styles,next:Vr},s=s.next;var a=o.styles+";";return a}return vF(e,t,n)}case"function":{if(e!==void 0){var l=Vr,c=n(e);return Vr=l,pu(e,t,c)}break}}var f=n;if(t==null)return f;var d=t[f];return d!==void 0?d:f}function vF(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i96?_F:xF},CS=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(s){return t.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},EF=!1,CF=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return xT(n,r,i),bF(function(){return ET(n,r,i)}),null},OF=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,s;n!==void 0&&(o=n.label,s=n.target);var a=CS(t,n,r),l=a||ES(i),c=!l("as");return function(){var f=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),f[0]==null||f[0].raw===void 0)d.push.apply(d,f);else{d.push(f[0][0]);for(var p=f.length,g=1;gt(IF(i)?n:i):t;return O.jsx(SF,{styles:r})}function By(e,t){return Mg(e,t)}const AT=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},PF=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:RT,StyledEngineProvider:kF,ThemeContext:Wu,css:PT,default:By,internal_processStyles:AT,keyframes:xp},Symbol.toStringTag,{value:"Module"}));function hi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function NT(e){if(!hi(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=NT(e[n])}),t}function sr(e,t,n={clone:!0}){const r=n.clone?Q({},e):e;return hi(e)&&hi(t)&&Object.keys(t).forEach(i=>{hi(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&hi(e[i])?r[i]=sr(e[i],t[i],n):n.clone?r[i]=hi(t[i])?NT(t[i]):t[i]:r[i]=t[i]}),r}const RF=Object.freeze(Object.defineProperty({__proto__:null,default:sr,isPlainObject:hi},Symbol.toStringTag,{value:"Module"})),AF=["values","unit","step"],NF=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>Q({},n,{[r.key]:r.val}),{})};function MT(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,i=at(e,AF),o=NF(t),s=Object.keys(o);function a(p){return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n})`}function l(p){return`@media (max-width:${(typeof t[p]=="number"?t[p]:p)-r/100}${n})`}function c(p,g){const m=s.indexOf(g);return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n}) and (max-width:${(m!==-1&&typeof t[s[m]]=="number"?t[s[m]]:g)-r/100}${n})`}function f(p){return s.indexOf(p)+1`@media (min-width:${zy[e]}px)`};function An(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||OS;return t.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const o=r.breakpoints||OS;return Object.keys(t).reduce((s,a)=>{if(Object.keys(o.values||zy).indexOf(a)!==-1){const l=o.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function DT(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function $T(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function DF(e,...t){const n=DT(e),r=[n,...t].reduce((i,o)=>sr(i,o),{});return $T(Object.keys(n),r)}function $F(e,t){if(typeof e!="object")return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((i,o)=>{o{e[i]!=null&&(n[i]=!0)}),n}function zo({values:e,breakpoints:t,base:n}){const r=n||$F(e,t),i=Object.keys(r);if(i.length===0)return e;let o;return i.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[o],o=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[o],o=a):s[a]=e,s),{})}function ke(e){if(typeof e!="string")throw new Error(Zo(7));return e.charAt(0).toUpperCase()+e.slice(1)}const jF=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));function wa(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function wd(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=wa(e,n)||r,t&&(i=t(i,r,e)),i}function Tt(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=wa(l,r)||{};return An(s,a,d=>{let p=wd(c,i,d);return d===p&&typeof d=="string"&&(p=wd(c,i,`${t}${d==="default"?"":ke(d)}`,d)),n===!1?p:{[n]:p}})};return o.propTypes={},o.filterProps=[t],o}function LF(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const FF={m:"margin",p:"padding"},UF={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},TS={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},BF=LF(e=>{if(e.length>2)if(TS[e])e=TS[e];else return[e];const[t,n]=e.split(""),r=FF[t],i=UF[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Vy=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Wy=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Vy,...Wy];function Hu(e,t,n,r){var i;const o=(i=wa(e,t,!1))!=null?i:n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}function Hy(e){return Hu(e,"spacing",8)}function es(e,t){if(typeof t=="string"||t==null)return t;const n=Math.abs(t),r=e(n);return t>=0?r:typeof r=="number"?-r:`-${r}`}function zF(e,t){return n=>e.reduce((r,i)=>(r[i]=es(t,n),r),{})}function VF(e,t,n,r){if(t.indexOf(n)===-1)return null;const i=BF(n),o=zF(i,r),s=e[n];return An(e,s,o)}function jT(e,t){const n=Hy(e.theme);return Object.keys(e).map(r=>VF(e,t,r,n)).reduce(jl,{})}function St(e){return jT(e,Vy)}St.propTypes={};St.filterProps=Vy;function _t(e){return jT(e,Wy)}_t.propTypes={};_t.filterProps=Wy;function WF(e=8){if(e.mui)return e;const t=Hy({spacing:e}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=t(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function Ep(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?jl(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function nr(e){return typeof e!="number"?e:`${e}px solid`}function pr(e,t){return Tt({prop:e,themeKey:"borders",transform:t})}const HF=pr("border",nr),GF=pr("borderTop",nr),qF=pr("borderRight",nr),KF=pr("borderBottom",nr),YF=pr("borderLeft",nr),XF=pr("borderColor"),QF=pr("borderTopColor"),JF=pr("borderRightColor"),ZF=pr("borderBottomColor"),e7=pr("borderLeftColor"),t7=pr("outline",nr),n7=pr("outlineColor"),Cp=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Hu(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:es(t,r)});return An(e,e.borderRadius,n)}return null};Cp.propTypes={};Cp.filterProps=["borderRadius"];Ep(HF,GF,qF,KF,YF,XF,QF,JF,ZF,e7,Cp,t7,n7);const Op=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Hu(e.theme,"spacing",8),n=r=>({gap:es(t,r)});return An(e,e.gap,n)}return null};Op.propTypes={};Op.filterProps=["gap"];const Tp=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Hu(e.theme,"spacing",8),n=r=>({columnGap:es(t,r)});return An(e,e.columnGap,n)}return null};Tp.propTypes={};Tp.filterProps=["columnGap"];const kp=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Hu(e.theme,"spacing",8),n=r=>({rowGap:es(t,r)});return An(e,e.rowGap,n)}return null};kp.propTypes={};kp.filterProps=["rowGap"];const r7=Tt({prop:"gridColumn"}),i7=Tt({prop:"gridRow"}),o7=Tt({prop:"gridAutoFlow"}),s7=Tt({prop:"gridAutoColumns"}),a7=Tt({prop:"gridAutoRows"}),l7=Tt({prop:"gridTemplateColumns"}),u7=Tt({prop:"gridTemplateRows"}),c7=Tt({prop:"gridTemplateAreas"}),f7=Tt({prop:"gridArea"});Ep(Op,Tp,kp,r7,i7,o7,s7,a7,l7,u7,c7,f7);function Ks(e,t){return t==="grey"?t:e}const d7=Tt({prop:"color",themeKey:"palette",transform:Ks}),p7=Tt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Ks}),h7=Tt({prop:"backgroundColor",themeKey:"palette",transform:Ks});Ep(d7,p7,h7);function Fn(e){return e<=1&&e!==0?`${e*100}%`:e}const m7=Tt({prop:"width",transform:Fn}),Gy=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var r,i;const o=((r=e.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||zy[n];return o?((i=e.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:Fn(n)}};return An(e,e.maxWidth,t)}return null};Gy.filterProps=["maxWidth"];const g7=Tt({prop:"minWidth",transform:Fn}),v7=Tt({prop:"height",transform:Fn}),y7=Tt({prop:"maxHeight",transform:Fn}),b7=Tt({prop:"minHeight",transform:Fn});Tt({prop:"size",cssProperty:"width",transform:Fn});Tt({prop:"size",cssProperty:"height",transform:Fn});const w7=Tt({prop:"boxSizing"});Ep(m7,Gy,g7,v7,y7,b7,w7);const Gu={border:{themeKey:"borders",transform:nr},borderTop:{themeKey:"borders",transform:nr},borderRight:{themeKey:"borders",transform:nr},borderBottom:{themeKey:"borders",transform:nr},borderLeft:{themeKey:"borders",transform:nr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:nr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Cp},color:{themeKey:"palette",transform:Ks},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Ks},backgroundColor:{themeKey:"palette",transform:Ks},p:{style:_t},pt:{style:_t},pr:{style:_t},pb:{style:_t},pl:{style:_t},px:{style:_t},py:{style:_t},padding:{style:_t},paddingTop:{style:_t},paddingRight:{style:_t},paddingBottom:{style:_t},paddingLeft:{style:_t},paddingX:{style:_t},paddingY:{style:_t},paddingInline:{style:_t},paddingInlineStart:{style:_t},paddingInlineEnd:{style:_t},paddingBlock:{style:_t},paddingBlockStart:{style:_t},paddingBlockEnd:{style:_t},m:{style:St},mt:{style:St},mr:{style:St},mb:{style:St},ml:{style:St},mx:{style:St},my:{style:St},margin:{style:St},marginTop:{style:St},marginRight:{style:St},marginBottom:{style:St},marginLeft:{style:St},marginX:{style:St},marginY:{style:St},marginInline:{style:St},marginInlineStart:{style:St},marginInlineEnd:{style:St},marginBlock:{style:St},marginBlockStart:{style:St},marginBlockEnd:{style:St},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Op},rowGap:{style:kp},columnGap:{style:Tp},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Fn},maxWidth:{style:Gy},minWidth:{transform:Fn},height:{transform:Fn},maxHeight:{transform:Fn},minHeight:{transform:Fn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function S7(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function _7(e,t){return typeof e=="function"?e(t):e}function LT(){function e(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:f,style:d}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const p=wa(i,c)||{};return d?d(s):An(s,r,m=>{let y=wd(p,f,m);return m===y&&typeof m=="string"&&(y=wd(p,f,`${n}${m==="default"?"":ke(m)}`,m)),l===!1?y:{[l]:y}})}function t(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const s=(r=o.unstable_sxConfig)!=null?r:Gu;function a(l){let c=l;if(typeof l=="function")c=l(o);else if(typeof l!="object")return l;if(!c)return null;const f=DT(o.breakpoints),d=Object.keys(f);let p=f;return Object.keys(c).forEach(g=>{const m=_7(c[g],o);if(m!=null)if(typeof m=="object")if(s[g])p=jl(p,e(g,m,o,s));else{const y=An({theme:o},m,E=>({[g]:E}));S7(y,m)?p[g]=t({sx:m,theme:o}):p=jl(p,y)}else p=jl(p,e(g,m,o,s))}),$T(d,p)}return Array.isArray(i)?i.map(a):a(i)}return t}const Da=LT();Da.filterProps=["sx"];function FT(e,t){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:t}:n.palette.mode===e?t:{}}const x7=["breakpoints","palette","spacing","shape"];function $a(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=e,s=at(e,x7),a=MT(n),l=WF(i);let c=sr({breakpoints:a,direction:"ltr",components:{},palette:Q({mode:"light"},r),spacing:l,shape:Q({},MF,o)},s);return c.applyStyles=FT,c=t.reduce((f,d)=>sr(f,d),c),c.unstable_sxConfig=Q({},Gu,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return Da({sx:d,theme:this})},c}const E7=Object.freeze(Object.defineProperty({__proto__:null,default:$a,private_createBreakpoints:MT,unstable_applyStyles:FT},Symbol.toStringTag,{value:"Module"}));function C7(e){return Object.keys(e).length===0}function UT(e=null){const t=j.useContext(Wu);return!t||C7(t)?e:t}const O7=$a();function Ip(e=O7){return UT(e)}function T7({styles:e,themeId:t,defaultTheme:n={}}){const r=Ip(n),i=typeof e=="function"?e(t&&r[t]||r):e;return O.jsx(RT,{styles:i})}const k7=["sx"],I7=e=>{var t,n;const r={systemProps:{},otherProps:{}},i=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:Gu;return Object.keys(e).forEach(o=>{i[o]?r.systemProps[o]=e[o]:r.otherProps[o]=e[o]}),r};function qu(e){const{sx:t}=e,n=at(e,k7),{systemProps:r,otherProps:i}=I7(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...s)=>{const a=t(...s);return hi(a)?Q({},r,a):r}:o=Q({},r,t),Q({},i,{sx:o})}const P7=Object.freeze(Object.defineProperty({__proto__:null,default:Da,extendSxProp:qu,unstable_createStyleFunctionSx:LT,unstable_defaultSxConfig:Gu},Symbol.toStringTag,{value:"Module"})),kS=e=>e,R7=()=>{let e=kS;return{configure(t){e=t},generate(t){return e(t)},reset(){e=kS}}},qy=R7();function BT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(Da);return j.forwardRef(function(l,c){const f=Ip(n),d=qu(l),{className:p,component:g="div"}=d,m=at(d,A7);return O.jsx(o,Q({as:g,ref:c,className:it(p,i?i(r):r),theme:t&&f[t]||f},m))})}const M7={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Yn(e,t,n="Mui"){const r=M7[t];return r?`${n}-${r}`:`${qy.generate(e)}-${t}`}function hr(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=Yn(e,i,n)}),r}var zT={exports:{}},rt={};/** + * @license React + * react-is.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 Ky=Symbol.for("react.element"),Yy=Symbol.for("react.portal"),Pp=Symbol.for("react.fragment"),Rp=Symbol.for("react.strict_mode"),Ap=Symbol.for("react.profiler"),Np=Symbol.for("react.provider"),Mp=Symbol.for("react.context"),D7=Symbol.for("react.server_context"),Dp=Symbol.for("react.forward_ref"),$p=Symbol.for("react.suspense"),jp=Symbol.for("react.suspense_list"),Lp=Symbol.for("react.memo"),Fp=Symbol.for("react.lazy"),$7=Symbol.for("react.offscreen"),VT;VT=Symbol.for("react.module.reference");function mr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Ky:switch(e=e.type,e){case Pp:case Ap:case Rp:case $p:case jp:return e;default:switch(e=e&&e.$$typeof,e){case D7:case Mp:case Dp:case Fp:case Lp:case Np:return e;default:return t}}case Yy:return t}}}rt.ContextConsumer=Mp;rt.ContextProvider=Np;rt.Element=Ky;rt.ForwardRef=Dp;rt.Fragment=Pp;rt.Lazy=Fp;rt.Memo=Lp;rt.Portal=Yy;rt.Profiler=Ap;rt.StrictMode=Rp;rt.Suspense=$p;rt.SuspenseList=jp;rt.isAsyncMode=function(){return!1};rt.isConcurrentMode=function(){return!1};rt.isContextConsumer=function(e){return mr(e)===Mp};rt.isContextProvider=function(e){return mr(e)===Np};rt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ky};rt.isForwardRef=function(e){return mr(e)===Dp};rt.isFragment=function(e){return mr(e)===Pp};rt.isLazy=function(e){return mr(e)===Fp};rt.isMemo=function(e){return mr(e)===Lp};rt.isPortal=function(e){return mr(e)===Yy};rt.isProfiler=function(e){return mr(e)===Ap};rt.isStrictMode=function(e){return mr(e)===Rp};rt.isSuspense=function(e){return mr(e)===$p};rt.isSuspenseList=function(e){return mr(e)===jp};rt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Pp||e===Ap||e===Rp||e===$p||e===jp||e===$7||typeof e=="object"&&e!==null&&(e.$$typeof===Fp||e.$$typeof===Lp||e.$$typeof===Np||e.$$typeof===Mp||e.$$typeof===Dp||e.$$typeof===VT||e.getModuleId!==void 0)};rt.typeOf=mr;zT.exports=rt;var IS=zT.exports;const j7=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function WT(e){const t=`${e}`.match(j7);return t&&t[1]||""}function HT(e,t=""){return e.displayName||e.name||WT(e)||t}function PS(e,t,n){const r=HT(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function L7(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return HT(e,"Component");if(typeof e=="object")switch(e.$$typeof){case IS.ForwardRef:return PS(e,e.render,"ForwardRef");case IS.Memo:return PS(e,e.type,"memo");default:return}}}const F7=Object.freeze(Object.defineProperty({__proto__:null,default:L7,getFunctionName:WT},Symbol.toStringTag,{value:"Module"})),U7=["ownerState"],B7=["variants"],z7=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function V7(e){return Object.keys(e).length===0}function W7(e){return typeof e=="string"&&e.charCodeAt(0)>96}function em(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const H7=$a(),G7=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function jc({defaultTheme:e,theme:t,themeId:n}){return V7(t)?e:t[n]||t}function q7(e){return e?(t,n)=>n[e]:null}function mf(e,t){let{ownerState:n}=t,r=at(t,U7);const i=typeof e=="function"?e(Q({ownerState:n},r)):e;if(Array.isArray(i))return i.flatMap(o=>mf(o,Q({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=at(i,B7);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props(Q({ownerState:n},r,n)):Object.keys(l.props).forEach(f=>{(n==null?void 0:n[f])!==l.props[f]&&r[f]!==l.props[f]&&(c=!1)}),c&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style(Q({ownerState:n},r,n)):l.style))}),a}return i}function K7(e={}){const{themeId:t,defaultTheme:n=H7,rootShouldForwardProp:r=em,slotShouldForwardProp:i=em}=e,o=s=>Da(Q({},s,{theme:jc(Q({},s,{defaultTheme:n,themeId:t}))}));return o.__mui_systemSx=!0,(s,a={})=>{AT(s,R=>R.filter(D=>!(D!=null&&D.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:f,skipSx:d,overridesResolver:p=q7(G7(c))}=a,g=at(a,z7),m=f!==void 0?f:c&&c!=="Root"&&c!=="root"||!1,y=d||!1;let E,w=em;c==="Root"||c==="root"?w=r:c?w=i:W7(s)&&(w=void 0);const b=By(s,Q({shouldForwardProp:w,label:E},g)),_=R=>typeof R=="function"&&R.__emotion_real!==R||hi(R)?D=>mf(R,Q({},D,{theme:jc({theme:D.theme,defaultTheme:n,themeId:t})})):R,P=(R,...D)=>{let S=_(R);const x=D?D.map(_):[];l&&p&&x.push(N=>{const A=jc(Q({},N,{defaultTheme:n,themeId:t}));if(!A.components||!A.components[l]||!A.components[l].styleOverrides)return null;const k=A.components[l].styleOverrides,X={};return Object.entries(k).forEach(([G,ee])=>{X[G]=mf(ee,Q({},N,{theme:A}))}),p(N,X)}),l&&!m&&x.push(N=>{var A;const k=jc(Q({},N,{defaultTheme:n,themeId:t})),X=k==null||(A=k.components)==null||(A=A[l])==null?void 0:A.variants;return mf({variants:X},Q({},N,{theme:k}))}),y||x.push(o);const C=x.length-D.length;if(Array.isArray(R)&&C>0){const N=new Array(C).fill("");S=[...R,...N],S.raw=[...R.raw,...N]}const I=b(S,...x);return s.muiName&&(I.muiName=s.muiName),I};return b.withConfig&&(P.withConfig=b.withConfig),P}}const GT=K7();function Y7(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:cu(t.components[n].defaultProps,r)}function qT({props:e,name:t,defaultTheme:n,themeId:r}){let i=Ip(n);return r&&(i=i[r]||i),Y7({theme:i,name:t,props:e})}const KT=typeof window<"u"?j.useLayoutEffect:j.useEffect;function YT(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const X7=Object.freeze(Object.defineProperty({__proto__:null,default:YT},Symbol.toStringTag,{value:"Module"}));function Q7(e,t=0,n=1){return YT(e,t,n)}function J7(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function XT(e){if(e.type)return e;if(e.charAt(0)==="#")return XT(J7(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(Zo(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error(Zo(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function Z7(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function Ke(e,t){return e=XT(e),t=Q7(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Z7(e)}function e8(...e){return e.reduce((t,n)=>n==null?t:function(...i){t.apply(this,i),n.apply(this,i)},()=>{})}function t8(e,t=166){let n;function r(...i){const o=()=>{e.apply(this,i)};clearTimeout(n),n=setTimeout(o,t)}return r.clear=()=>{clearTimeout(n)},r}function n8(e,t){return()=>null}function r8(e,t){var n,r;return j.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(r=e.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function QT(e){return e&&e.ownerDocument||document}function i8(e){return QT(e).defaultView||window}function o8(e,t){return()=>null}function JT(e,t){typeof e=="function"?e(t):e&&(e.current=t)}let RS=0;function s8(e){const[t,n]=j.useState(e),r=e||t;return j.useEffect(()=>{t==null&&(RS+=1,n(`mui-${RS}`))},[t]),r}const AS=om.useId;function a8(e){if(AS!==void 0){const t=AS();return e??t}return s8(e)}function l8(e,t,n,r,i){return null}function u8({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=j.useRef(e!==void 0),[o,s]=j.useState(t),a=i?e:o,l=j.useCallback(c=>{i||s(c)},[]);return[a,l]}function wl(e){const t=j.useRef(e);return KT(()=>{t.current=e}),j.useRef((...n)=>(0,t.current)(...n)).current}function hu(...e){return j.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{JT(n,t)})},e)}const NS={};function c8(e,t){const n=j.useRef(NS);return n.current===NS&&(n.current=e(t)),n}const f8=[];function d8(e){j.useEffect(e,f8)}class Up{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Up}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function p8(){const e=c8(Up.create).current;return d8(e.disposeEffect),e}let Bp=!0,$g=!1;const h8=new Up,m8={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function g8(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&m8[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function v8(e){e.metaKey||e.altKey||e.ctrlKey||(Bp=!0)}function tm(){Bp=!1}function y8(){this.visibilityState==="hidden"&&$g&&(Bp=!0)}function b8(e){e.addEventListener("keydown",v8,!0),e.addEventListener("mousedown",tm,!0),e.addEventListener("pointerdown",tm,!0),e.addEventListener("touchstart",tm,!0),e.addEventListener("visibilitychange",y8,!0)}function w8(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return Bp||g8(t)}function Xy(){const e=j.useCallback(i=>{i!=null&&b8(i.ownerDocument)},[]),t=j.useRef(!1);function n(){return t.current?($g=!0,h8.start(100,()=>{$g=!1}),t.current=!1,!0):!1}function r(i){return w8(i)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}function gr(e,t,n=void 0){const r={};return Object.keys(e).forEach(i=>{r[i]=e[i].reduce((o,s)=>{if(s){const a=t(s);a!==""&&o.push(a),n&&n[s]&&o.push(n[s])}return o},[]).join(" ")}),r}const ZT=j.createContext(null);function ek(){return j.useContext(ZT)}const S8=typeof Symbol=="function"&&Symbol.for,_8=S8?Symbol.for("mui.nested"):"__THEME_NESTED__";function x8(e,t){return typeof t=="function"?t(e):Q({},e,t)}function E8(e){const{children:t,theme:n}=e,r=ek(),i=j.useMemo(()=>{const o=r===null?n:x8(r,n);return o!=null&&(o[_8]=r!==null),o},[n,r]);return O.jsx(ZT.Provider,{value:i,children:t})}const C8=["value"],O8=j.createContext();function T8(e){let{value:t}=e,n=at(e,C8);return O.jsx(O8.Provider,Q({value:t??!0},n))}const MS={};function DS(e,t,n,r=!1){return j.useMemo(()=>{const i=e&&t[e]||t;if(typeof n=="function"){const o=n(i),s=e?Q({},t,{[e]:o}):o;return r?()=>s:s}return e?Q({},t,{[e]:n}):Q({},t,n)},[e,t,n,r])}function k8(e){const{children:t,theme:n,themeId:r}=e,i=UT(MS),o=ek()||MS,s=DS(r,i,n),a=DS(r,o,n,!0),l=s.direction==="rtl";return O.jsx(E8,{theme:a,children:O.jsx(Wu.Provider,{value:s,children:O.jsx(T8,{value:l,children:O.jsx(yL,{value:s==null?void 0:s.components,children:t})})})})}const I8=["className","component","disableGutters","fixed","maxWidth","classes"],P8=$a(),R8=GT("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${ke(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),A8=e=>qT({props:e,name:"MuiContainer",defaultTheme:P8}),N8=(e,t)=>{const n=l=>Yn(t,l),{classes:r,fixed:i,disableGutters:o,maxWidth:s}=e,a={root:["root",s&&`maxWidth${ke(String(s))}`,i&&"fixed",o&&"disableGutters"]};return gr(a,n,r)};function M8(e={}){const{createStyledComponent:t=R8,useThemeProps:n=A8,componentName:r="MuiContainer"}=e,i=t(({theme:s,ownerState:a})=>Q({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:s.spacing(2),paddingRight:s.spacing(2),[s.breakpoints.up("sm")]:{paddingLeft:s.spacing(3),paddingRight:s.spacing(3)}}),({theme:s,ownerState:a})=>a.fixed&&Object.keys(s.breakpoints.values).reduce((l,c)=>{const f=c,d=s.breakpoints.values[f];return d!==0&&(l[s.breakpoints.up(f)]={maxWidth:`${d}${s.breakpoints.unit}`}),l},{}),({theme:s,ownerState:a})=>Q({},a.maxWidth==="xs"&&{[s.breakpoints.up("xs")]:{maxWidth:Math.max(s.breakpoints.values.xs,444)}},a.maxWidth&&a.maxWidth!=="xs"&&{[s.breakpoints.up(a.maxWidth)]:{maxWidth:`${s.breakpoints.values[a.maxWidth]}${s.breakpoints.unit}`}}));return j.forwardRef(function(a,l){const c=n(a),{className:f,component:d="div",disableGutters:p=!1,fixed:g=!1,maxWidth:m="lg"}=c,y=at(c,I8),E=Q({},c,{component:d,disableGutters:p,fixed:g,maxWidth:m}),w=N8(E,r);return O.jsx(i,Q({as:d,ownerState:E,className:it(w.root,f),ref:l},y))})}const D8=["component","direction","spacing","divider","children","className","useFlexGap"],$8=$a(),j8=GT("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function L8(e){return qT({props:e,name:"MuiStack",defaultTheme:$8})}function F8(e,t){const n=j.Children.toArray(e).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],B8=({ownerState:e,theme:t})=>{let n=Q({display:"flex",flexDirection:"column"},An({theme:t},zo({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r})));if(e.spacing){const r=Hy(t),i=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),o=zo({values:e.direction,base:i}),s=zo({values:e.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,c,f)=>{if(!o[l]){const p=c>0?o[f[c-1]]:"column";o[l]=p}}),n=sr(n,An({theme:t},s,(l,c)=>e.useFlexGap?{gap:es(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${U8(c?o[c]:e.direction)}`]:es(r,l)}}))}return n=DF(t.breakpoints,n),n};function z8(e={}){const{createStyledComponent:t=j8,useThemeProps:n=L8,componentName:r="MuiStack"}=e,i=()=>gr({root:["root"]},l=>Yn(r,l),{}),o=t(B8);return j.forwardRef(function(l,c){const f=n(l),d=qu(f),{component:p="div",direction:g="column",spacing:m=0,divider:y,children:E,className:w,useFlexGap:b=!1}=d,_=at(d,D8),P={direction:g,spacing:m,useFlexGap:b},R=i();return O.jsx(o,Q({as:p,ownerState:P,ref:c,className:it(R.root,w)},_,{children:y?F8(E,y):E}))})}function V8(e,t){return Q({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}var kt={},tk={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(tk);var vr=tk.exports;const W8=Nr(SL),H8=Nr(X7);var nk=vr;Object.defineProperty(kt,"__esModule",{value:!0});var $t=kt.alpha=sk;kt.blend=iU;kt.colorChannel=void 0;var G8=kt.darken=Jy;kt.decomposeColor=cr;kt.emphasize=ak;var q8=kt.getContrastRatio=Z8;kt.getLuminance=Sd;kt.hexToRgb=rk;kt.hslToRgb=ok;var K8=kt.lighten=Zy;kt.private_safeAlpha=eU;kt.private_safeColorChannel=void 0;kt.private_safeDarken=tU;kt.private_safeEmphasize=rU;kt.private_safeLighten=nU;kt.recomposeColor=ja;kt.rgbToHex=J8;var $S=nk(W8),Y8=nk(H8);function Qy(e,t=0,n=1){return(0,Y8.default)(e,t,n)}function rk(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function X8(e){const t=e.toString(16);return t.length===1?`0${t}`:t}function cr(e){if(e.type)return e;if(e.charAt(0)==="#")return cr(rk(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,$S.default)(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,$S.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const ik=e=>{const t=cr(e);return t.values.slice(0,3).map((n,r)=>t.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};kt.colorChannel=ik;const Q8=(e,t)=>{try{return ik(e)}catch{return e}};kt.private_safeColorChannel=Q8;function ja(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function J8(e){if(e.indexOf("#")===0)return e;const{values:t}=cr(e);return`#${t.map((n,r)=>X8(r===3?Math.round(255*n):n)).join("")}`}function ok(e){e=cr(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),s=(c,f=(c+n/30)%12)=>i-o*Math.max(Math.min(f-3,9-f,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),ja({type:a,values:l})}function Sd(e){e=cr(e);let t=e.type==="hsl"||e.type==="hsla"?cr(ok(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Z8(e,t){const n=Sd(e),r=Sd(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function sk(e,t){return e=cr(e),t=Qy(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,ja(e)}function eU(e,t,n){try{return sk(e,t)}catch{return e}}function Jy(e,t){if(e=cr(e),t=Qy(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]*=1-t;return ja(e)}function tU(e,t,n){try{return Jy(e,t)}catch{return e}}function Zy(e,t){if(e=cr(e),t=Qy(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return ja(e)}function nU(e,t,n){try{return Zy(e,t)}catch{return e}}function ak(e,t=.15){return Sd(e)>.5?Jy(e,t):Zy(e,t)}function rU(e,t,n){try{return ak(e,t)}catch{return e}}function iU(e,t,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=cr(e),s=cr(t),a=[i(o.values[0],s.values[0]),i(o.values[1],s.values[1]),i(o.values[2],s.values[2])];return ja({type:"rgb",values:a})}const mu={black:"#000",white:"#fff"},oU={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},ps={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},di={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},pl={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},hs={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},ms={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},gs={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},sU=["mode","contrastThreshold","tonalOffset"],jS={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:mu.white,default:mu.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},nm={text:{primary:mu.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:mu.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function LS(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=K8(e.main,i):t==="dark"&&(e.dark=G8(e.main,o)))}function aU(e="light"){return e==="dark"?{main:hs[200],light:hs[50],dark:hs[400]}:{main:hs[700],light:hs[400],dark:hs[800]}}function lU(e="light"){return e==="dark"?{main:ps[200],light:ps[50],dark:ps[400]}:{main:ps[500],light:ps[300],dark:ps[700]}}function uU(e="light"){return e==="dark"?{main:di[500],light:di[300],dark:di[700]}:{main:di[700],light:di[400],dark:di[800]}}function cU(e="light"){return e==="dark"?{main:ms[400],light:ms[300],dark:ms[700]}:{main:ms[700],light:ms[500],dark:ms[900]}}function fU(e="light"){return e==="dark"?{main:gs[400],light:gs[300],dark:gs[700]}:{main:gs[800],light:gs[500],dark:gs[900]}}function dU(e="light"){return e==="dark"?{main:pl[400],light:pl[300],dark:pl[700]}:{main:"#ed6c02",light:pl[500],dark:pl[900]}}function pU(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=e,i=at(e,sU),o=e.primary||aU(t),s=e.secondary||lU(t),a=e.error||uU(t),l=e.info||cU(t),c=e.success||fU(t),f=e.warning||dU(t);function d(y){return q8(y,nm.text.primary)>=n?nm.text.primary:jS.text.primary}const p=({color:y,name:E,mainShade:w=500,lightShade:b=300,darkShade:_=700})=>{if(y=Q({},y),!y.main&&y[w]&&(y.main=y[w]),!y.hasOwnProperty("main"))throw new Error(Zo(11,E?` (${E})`:"",w));if(typeof y.main!="string")throw new Error(Zo(12,E?` (${E})`:"",JSON.stringify(y.main)));return LS(y,"light",b,r),LS(y,"dark",_,r),y.contrastText||(y.contrastText=d(y.main)),y},g={dark:nm,light:jS};return sr(Q({common:Q({},mu),mode:t,primary:p({color:o,name:"primary"}),secondary:p({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:a,name:"error"}),warning:p({color:f,name:"warning"}),info:p({color:l,name:"info"}),success:p({color:c,name:"success"}),grey:oU,contrastThreshold:n,getContrastText:d,augmentColor:p,tonalOffset:r},g[t]),i)}const hU=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function mU(e){return Math.round(e*1e5)/1e5}const FS={textTransform:"uppercase"},US='"Roboto", "Helvetica", "Arial", sans-serif';function gU(e,t){const n=typeof t=="function"?t(e):t,{fontFamily:r=US,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:f,pxToRem:d}=n,p=at(n,hU),g=i/14,m=d||(w=>`${w/c*g}rem`),y=(w,b,_,P,R)=>Q({fontFamily:r,fontWeight:w,fontSize:m(b),lineHeight:_},r===US?{letterSpacing:`${mU(P/b)}em`}:{},R,f),E={h1:y(o,96,1.167,-1.5),h2:y(o,60,1.2,-.5),h3:y(s,48,1.167,0),h4:y(s,34,1.235,.25),h5:y(s,24,1.334,0),h6:y(a,20,1.6,.15),subtitle1:y(s,16,1.75,.15),subtitle2:y(a,14,1.57,.1),body1:y(s,16,1.5,.15),body2:y(s,14,1.43,.15),button:y(a,14,1.75,.4,FS),caption:y(s,12,1.66,.4),overline:y(s,12,2.66,1,FS),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return sr(Q({htmlFontSize:c,pxToRem:m,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},E),p,{clone:!1})}const vU=.2,yU=.14,bU=.12;function mt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${vU})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${yU})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${bU})`].join(",")}const wU=["none",mt(0,2,1,-1,0,1,1,0,0,1,3,0),mt(0,3,1,-2,0,2,2,0,0,1,5,0),mt(0,3,3,-2,0,3,4,0,0,1,8,0),mt(0,2,4,-1,0,4,5,0,0,1,10,0),mt(0,3,5,-1,0,5,8,0,0,1,14,0),mt(0,3,5,-1,0,6,10,0,0,1,18,0),mt(0,4,5,-2,0,7,10,1,0,2,16,1),mt(0,5,5,-3,0,8,10,1,0,3,14,2),mt(0,5,6,-3,0,9,12,1,0,3,16,2),mt(0,6,6,-3,0,10,14,1,0,4,18,3),mt(0,6,7,-4,0,11,15,1,0,4,20,3),mt(0,7,8,-4,0,12,17,2,0,5,22,4),mt(0,7,8,-4,0,13,19,2,0,5,24,4),mt(0,7,9,-4,0,14,21,2,0,5,26,4),mt(0,8,9,-5,0,15,22,2,0,6,28,5),mt(0,8,10,-5,0,16,24,2,0,6,30,5),mt(0,8,11,-5,0,17,26,2,0,6,32,5),mt(0,9,11,-5,0,18,28,2,0,7,34,6),mt(0,9,12,-6,0,19,29,2,0,7,36,6),mt(0,10,13,-6,0,20,31,3,0,8,38,7),mt(0,10,13,-6,0,21,33,3,0,8,40,7),mt(0,10,14,-6,0,22,35,3,0,8,42,7),mt(0,11,14,-7,0,23,36,3,0,9,44,8),mt(0,11,15,-7,0,24,38,3,0,9,46,8)],SU=["duration","easing","delay"],_U={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},xU={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function BS(e){return`${Math.round(e)}ms`}function EU(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function CU(e){const t=Q({},_U,e.easing),n=Q({},xU,e.duration);return Q({getAutoHeightDuration:EU,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0}=o;return at(o,SU),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof s=="string"?s:BS(s)} ${a} ${typeof l=="string"?l:BS(l)}`).join(",")}},e,{easing:t,duration:n})}const OU={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},TU=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function _d(e={},...t){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=e,s=at(e,TU);if(e.vars)throw new Error(Zo(18));const a=pU(r),l=$a(e);let c=sr(l,{mixins:V8(l.breakpoints,n),palette:a,shadows:wU.slice(),typography:gU(a,o),transitions:CU(i),zIndex:Q({},OU)});return c=sr(c,s),c=t.reduce((f,d)=>sr(f,d),c),c.unstable_sxConfig=Q({},Gu,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return Da({sx:d,theme:this})},c}const e0=_d(),Sa="$$material";function kU(e){return O.jsx(T7,Q({},e,{defaultTheme:e0,themeId:Sa}))}const IU=(e,t)=>Q({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},t&&!e.vars&&{colorScheme:e.palette.mode}),PU=e=>Q({color:(e.vars||e).palette.text.primary},e.typography.body1,{backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),RU=(e,t=!1)=>{var n;const r={};t&&e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([s,a])=>{var l;r[e.getColorSchemeSelector(s).replace(/\s*&/,"")]={colorScheme:(l=a.palette)==null?void 0:l.mode}});let i=Q({html:IU(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:Q({margin:0},PU(e),{"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}})},r);const o=(n=e.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return o&&(i=[i,o]),i};function AU(e){const t=Nn({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=t;return O.jsxs(j.Fragment,{children:[O.jsx(kU,{styles:i=>RU(i,r)}),n]})}function NU(){const e=Ip(e0);return e[Sa]||e}var Ku={},rm={exports:{}},zS;function MU(){return zS||(zS=1,function(e){function t(n,r){if(n==null)return{};var i={};for(var o in n)if({}.hasOwnProperty.call(n,o)){if(r.indexOf(o)>=0)continue;i[o]=n[o]}return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(rm)),rm.exports}const DU=Nr(PF),$U=Nr(RF),jU=Nr(jF),LU=Nr(F7),FU=Nr(E7),UU=Nr(P7);var La=vr;Object.defineProperty(Ku,"__esModule",{value:!0});var BU=Ku.default=eB;Ku.shouldForwardProp=gf;Ku.systemDefaultTheme=void 0;var Qn=La(IT()),jg=La(MU()),VS=KU(DU),zU=$U;La(jU);La(LU);var VU=La(FU),WU=La(UU);const HU=["ownerState"],GU=["variants"],qU=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function lk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(lk=function(r){return r?n:t})(e)}function KU(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=lk(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function YU(e){return Object.keys(e).length===0}function XU(e){return typeof e=="string"&&e.charCodeAt(0)>96}function gf(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const QU=Ku.systemDefaultTheme=(0,VU.default)(),JU=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function Lc({defaultTheme:e,theme:t,themeId:n}){return YU(t)?e:t[n]||t}function ZU(e){return e?(t,n)=>n[e]:null}function vf(e,t){let{ownerState:n}=t,r=(0,jg.default)(t,HU);const i=typeof e=="function"?e((0,Qn.default)({ownerState:n},r)):e;if(Array.isArray(i))return i.flatMap(o=>vf(o,(0,Qn.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=(0,jg.default)(i,GU);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,Qn.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(f=>{(n==null?void 0:n[f])!==l.props[f]&&r[f]!==l.props[f]&&(c=!1)}),c&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style((0,Qn.default)({ownerState:n},r,n)):l.style))}),a}return i}function eB(e={}){const{themeId:t,defaultTheme:n=QU,rootShouldForwardProp:r=gf,slotShouldForwardProp:i=gf}=e,o=s=>(0,WU.default)((0,Qn.default)({},s,{theme:Lc((0,Qn.default)({},s,{defaultTheme:n,themeId:t}))}));return o.__mui_systemSx=!0,(s,a={})=>{(0,VS.internal_processStyles)(s,R=>R.filter(D=>!(D!=null&&D.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:f,skipSx:d,overridesResolver:p=ZU(JU(c))}=a,g=(0,jg.default)(a,qU),m=f!==void 0?f:c&&c!=="Root"&&c!=="root"||!1,y=d||!1;let E,w=gf;c==="Root"||c==="root"?w=r:c?w=i:XU(s)&&(w=void 0);const b=(0,VS.default)(s,(0,Qn.default)({shouldForwardProp:w,label:E},g)),_=R=>typeof R=="function"&&R.__emotion_real!==R||(0,zU.isPlainObject)(R)?D=>vf(R,(0,Qn.default)({},D,{theme:Lc({theme:D.theme,defaultTheme:n,themeId:t})})):R,P=(R,...D)=>{let S=_(R);const x=D?D.map(_):[];l&&p&&x.push(N=>{const A=Lc((0,Qn.default)({},N,{defaultTheme:n,themeId:t}));if(!A.components||!A.components[l]||!A.components[l].styleOverrides)return null;const k=A.components[l].styleOverrides,X={};return Object.entries(k).forEach(([G,ee])=>{X[G]=vf(ee,(0,Qn.default)({},N,{theme:A}))}),p(N,X)}),l&&!m&&x.push(N=>{var A;const k=Lc((0,Qn.default)({},N,{defaultTheme:n,themeId:t})),X=k==null||(A=k.components)==null||(A=A[l])==null?void 0:A.variants;return vf({variants:X},(0,Qn.default)({},N,{theme:k}))}),y||x.push(o);const C=x.length-D.length;if(Array.isArray(R)&&C>0){const N=new Array(C).fill("");S=[...R,...N],S.raw=[...R.raw,...N]}const I=b(S,...x);return s.muiName&&(I.muiName=s.muiName),I};return b.withConfig&&(P.withConfig=b.withConfig),P}}function tB(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const uk=e=>tB(e)&&e!=="classes",Bt=BU({themeId:Sa,defaultTheme:e0,rootShouldForwardProp:uk}),nB=["theme"];function rB(e){let{theme:t}=e,n=at(e,nB);const r=t[Sa];return O.jsx(k8,Q({},n,{themeId:r?Sa:void 0,theme:r||t}))}const WS=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},iB=hr("MuiBox",["root"]),oB=_d(),Ln=N7({themeId:Sa,defaultTheme:oB,defaultClassName:iB.root,generateClassName:qy.generate});function sB(e){return Yn("MuiDivider",e)}hr("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);const aB=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],lB=e=>{const{absolute:t,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=e;return gr({root:["root",t&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},sB,r)},uB=Bt("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(({theme:e,ownerState:t})=>Q({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},t.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},t.light&&{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:$t(e.palette.divider,.08)},t.variant==="inset"&&{marginLeft:72},t.variant==="middle"&&t.orientation==="horizontal"&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},t.variant==="middle"&&t.orientation==="vertical"&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},t.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},t.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:e})=>Q({},e.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:e,ownerState:t})=>Q({},t.children&&t.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}),({theme:e,ownerState:t})=>Q({},t.children&&t.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}),({ownerState:e})=>Q({},e.textAlign==="right"&&e.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},e.textAlign==="left"&&e.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),cB=Bt("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(({theme:e,ownerState:t})=>Q({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`},t.orientation==="vertical"&&{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`})),bs=j.forwardRef(function(t,n){const r=Nn({props:t,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,component:a=o?"div":"hr",flexItem:l=!1,light:c=!1,orientation:f="horizontal",role:d=a!=="hr"?"separator":void 0,textAlign:p="center",variant:g="fullWidth"}=r,m=at(r,aB),y=Q({},r,{absolute:i,component:a,flexItem:l,light:c,orientation:f,role:d,textAlign:p,variant:g}),E=lB(y);return O.jsx(uB,Q({as:a,className:it(E.root,s),role:d,ref:n,ownerState:y},m,{children:o?O.jsx(cB,{className:E.wrapper,ownerState:y,children:o}):null}))});bs.muiSkipListHighlight=!0;function fB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t0(e,t){var n=function(o){return t&&j.isValidElement(o)?t(o):o},r=Object.create(null);return e&&j.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function dB(e,t){e=e||{},t=t||{};function n(f){return f in t?t[f]:e[f]}var r=Object.create(null),i=[];for(var o in e)o in t?i.length&&(r[o]=i,i=[]):i.push(o);var s,a={};for(var l in t){if(r[l])for(s=0;s{if(!a&&l!=null){const y=setTimeout(l,c);return()=>{clearTimeout(y)}}},[l,a,c]),O.jsx("span",{className:p,style:g,children:O.jsx("span",{className:m})})}const Zn=hr("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),yB=["center","classes","className"];let zp=e=>e,HS,GS,qS,KS;const Lg=550,bB=80,wB=xp(HS||(HS=zp` + 0% { + transform: scale(0); + opacity: 0.1; + } + + 100% { + transform: scale(1); + opacity: 0.3; + } +`)),SB=xp(GS||(GS=zp` + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +`)),_B=xp(qS||(qS=zp` + 0% { + transform: scale(1); + } + + 50% { + transform: scale(0.92); + } + + 100% { + transform: scale(1); + } +`)),xB=Bt("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),EB=Bt(vB,{name:"MuiTouchRipple",slot:"Ripple"})(KS||(KS=zp` + opacity: 0; + position: absolute; + + &.${0} { + opacity: 0.3; + transform: scale(1); + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + &.${0} { + animation-duration: ${0}ms; + } + + & .${0} { + opacity: 1; + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: currentColor; + } + + & .${0} { + opacity: 0; + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + & .${0} { + position: absolute; + /* @noflip */ + left: 0px; + top: 0; + animation-name: ${0}; + animation-duration: 2500ms; + animation-timing-function: ${0}; + animation-iteration-count: infinite; + animation-delay: 200ms; + } +`),Zn.rippleVisible,wB,Lg,({theme:e})=>e.transitions.easing.easeInOut,Zn.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,Zn.child,Zn.childLeaving,SB,Lg,({theme:e})=>e.transitions.easing.easeInOut,Zn.childPulsate,_B,({theme:e})=>e.transitions.easing.easeInOut),CB=j.forwardRef(function(t,n){const r=Nn({props:t,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s}=r,a=at(r,yB),[l,c]=j.useState([]),f=j.useRef(0),d=j.useRef(null);j.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const p=j.useRef(!1),g=p8(),m=j.useRef(null),y=j.useRef(null),E=j.useCallback(P=>{const{pulsate:R,rippleX:D,rippleY:S,rippleSize:x,cb:C}=P;c(I=>[...I,O.jsx(EB,{classes:{ripple:it(o.ripple,Zn.ripple),rippleVisible:it(o.rippleVisible,Zn.rippleVisible),ripplePulsate:it(o.ripplePulsate,Zn.ripplePulsate),child:it(o.child,Zn.child),childLeaving:it(o.childLeaving,Zn.childLeaving),childPulsate:it(o.childPulsate,Zn.childPulsate)},timeout:Lg,pulsate:R,rippleX:D,rippleY:S,rippleSize:x},f.current)]),f.current+=1,d.current=C},[o]),w=j.useCallback((P={},R={},D=()=>{})=>{const{pulsate:S=!1,center:x=i||R.pulsate,fakeElement:C=!1}=R;if((P==null?void 0:P.type)==="mousedown"&&p.current){p.current=!1;return}(P==null?void 0:P.type)==="touchstart"&&(p.current=!0);const I=C?null:y.current,N=I?I.getBoundingClientRect():{width:0,height:0,left:0,top:0};let A,k,X;if(x||P===void 0||P.clientX===0&&P.clientY===0||!P.clientX&&!P.touches)A=Math.round(N.width/2),k=Math.round(N.height/2);else{const{clientX:G,clientY:ee}=P.touches&&P.touches.length>0?P.touches[0]:P;A=Math.round(G-N.left),k=Math.round(ee-N.top)}if(x)X=Math.sqrt((2*N.width**2+N.height**2)/3),X%2===0&&(X+=1);else{const G=Math.max(Math.abs((I?I.clientWidth:0)-A),A)*2+2,ee=Math.max(Math.abs((I?I.clientHeight:0)-k),k)*2+2;X=Math.sqrt(G**2+ee**2)}P!=null&&P.touches?m.current===null&&(m.current=()=>{E({pulsate:S,rippleX:A,rippleY:k,rippleSize:X,cb:D})},g.start(bB,()=>{m.current&&(m.current(),m.current=null)})):E({pulsate:S,rippleX:A,rippleY:k,rippleSize:X,cb:D})},[i,E,g]),b=j.useCallback(()=>{w({},{pulsate:!0})},[w]),_=j.useCallback((P,R)=>{if(g.clear(),(P==null?void 0:P.type)==="touchend"&&m.current){m.current(),m.current=null,g.start(0,()=>{_(P,R)});return}m.current=null,c(D=>D.length>0?D.slice(1):D),d.current=R},[g]);return j.useImperativeHandle(n,()=>({pulsate:b,start:w,stop:_}),[b,w,_]),O.jsx(xB,Q({className:it(Zn.root,o.root,s),ref:y},a,{children:O.jsx(n0,{component:null,exit:!0,children:l})}))});function OB(e){return Yn("MuiButtonBase",e)}const TB=hr("MuiButtonBase",["root","disabled","focusVisible"]),kB=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],IB=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,s=gr({root:["root",t&&"disabled",n&&"focusVisible"]},OB,i);return n&&r&&(s.root+=` ${r}`),s},PB=Bt("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${TB.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Fg=j.forwardRef(function(t,n){const r=Nn({props:t,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:f=!1,disableTouchRipple:d=!1,focusRipple:p=!1,LinkComponent:g="a",onBlur:m,onClick:y,onContextMenu:E,onDragLeave:w,onFocus:b,onFocusVisible:_,onKeyDown:P,onKeyUp:R,onMouseDown:D,onMouseLeave:S,onMouseUp:x,onTouchEnd:C,onTouchMove:I,onTouchStart:N,tabIndex:A=0,TouchRippleProps:k,touchRippleRef:X,type:G}=r,ee=at(r,kB),B=j.useRef(null),W=j.useRef(null),J=hu(W,X),{isFocusVisibleRef:se,onFocus:we,onBlur:Se,ref:Ie}=Xy(),[Be,ze]=j.useState(!1);c&&Be&&ze(!1),j.useImperativeHandle(i,()=>({focusVisible:()=>{ze(!0),B.current.focus()}}),[]);const[Fe,Ye]=j.useState(!1);j.useEffect(()=>{Ye(!0)},[]);const M=Fe&&!f&&!c;j.useEffect(()=>{Be&&p&&!f&&Fe&&W.current.pulsate()},[f,p,Be,Fe]);function L(Ce,lt,Pe=d){return wl(Ee=>(lt&<(Ee),!Pe&&W.current&&W.current[Ce](Ee),!0))}const U=L("start",D),F=L("stop",E),ue=L("stop",w),q=L("stop",x),oe=L("stop",Ce=>{Be&&Ce.preventDefault(),S&&S(Ce)}),Oe=L("start",N),Te=L("stop",C),xe=L("stop",I),$=L("stop",Ce=>{Se(Ce),se.current===!1&&ze(!1),m&&m(Ce)},!1),z=wl(Ce=>{B.current||(B.current=Ce.currentTarget),we(Ce),se.current===!0&&(ze(!0),_&&_(Ce)),b&&b(Ce)}),H=()=>{const Ce=B.current;return l&&l!=="button"&&!(Ce.tagName==="A"&&Ce.href)},ae=j.useRef(!1),ne=wl(Ce=>{p&&!ae.current&&Be&&W.current&&Ce.key===" "&&(ae.current=!0,W.current.stop(Ce,()=>{W.current.start(Ce)})),Ce.target===Ce.currentTarget&&H()&&Ce.key===" "&&Ce.preventDefault(),P&&P(Ce),Ce.target===Ce.currentTarget&&H()&&Ce.key==="Enter"&&!c&&(Ce.preventDefault(),y&&y(Ce))}),te=wl(Ce=>{p&&Ce.key===" "&&W.current&&Be&&!Ce.defaultPrevented&&(ae.current=!1,W.current.stop(Ce,()=>{W.current.pulsate(Ce)})),R&&R(Ce),y&&Ce.target===Ce.currentTarget&&H()&&Ce.key===" "&&!Ce.defaultPrevented&&y(Ce)});let pe=l;pe==="button"&&(ee.href||ee.to)&&(pe=g);const le={};pe==="button"?(le.type=G===void 0?"button":G,le.disabled=c):(!ee.href&&!ee.to&&(le.role="button"),c&&(le["aria-disabled"]=c));const he=hu(n,Ie,B),ce=Q({},r,{centerRipple:o,component:l,disabled:c,disableRipple:f,disableTouchRipple:d,focusRipple:p,tabIndex:A,focusVisible:Be}),Ne=IB(ce);return O.jsxs(PB,Q({as:pe,className:it(Ne.root,a),ownerState:ce,onBlur:$,onClick:y,onContextMenu:F,onFocus:z,onKeyDown:ne,onKeyUp:te,onMouseDown:U,onMouseLeave:oe,onMouseUp:q,onDragLeave:ue,onTouchEnd:Te,onTouchMove:xe,onTouchStart:Oe,ref:he,tabIndex:c?-1:A,type:G},le,ee,{children:[s,M?O.jsx(CB,Q({ref:J,center:o},k)):null]}))});var im={};function RB(e){return Yn("MuiSvgIcon",e)}hr("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const AB=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],NB=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${ke(t)}`,`fontSize${ke(n)}`]};return gr(i,RB,r)},MB=Bt("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${ke(n.color)}`],t[`fontSize${ke(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,i,o,s,a,l,c,f,d,p,g,m;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=e.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((o=e.typography)==null||(s=o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem",medium:((a=e.typography)==null||(l=a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem",large:((c=e.typography)==null||(f=c.pxToRem)==null?void 0:f.call(c,35))||"2.1875rem"}[t.fontSize],color:(d=(p=(e.vars||e).palette)==null||(p=p[t.color])==null?void 0:p.main)!=null?d:{action:(g=(e.vars||e).palette)==null||(g=g.action)==null?void 0:g.active,disabled:(m=(e.vars||e).palette)==null||(m=m.action)==null?void 0:m.disabled,inherit:void 0}[t.color]}}),Ug=j.forwardRef(function(t,n){const r=Nn({props:t,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:f=!1,titleAccess:d,viewBox:p="0 0 24 24"}=r,g=at(r,AB),m=j.isValidElement(i)&&i.type==="svg",y=Q({},r,{color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:f,viewBox:p,hasSvgAsChild:m}),E={};f||(E.viewBox=p);const w=NB(y);return O.jsxs(MB,Q({as:a,className:it(w.root,o),focusable:"false",color:c,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n},E,g,m&&i.props,{ownerState:y,children:[m?i.props.children:i,d?O.jsx("title",{children:d}):null]}))});Ug.muiName="SvgIcon";function ck(e,t){function n(r,i){return O.jsx(Ug,Q({"data-testid":`${t}Icon`,ref:i},r,{children:e}))}return n.muiName=Ug.muiName,j.memo(j.forwardRef(n))}const DB={configure:e=>{qy.configure(e)}},$B=Object.freeze(Object.defineProperty({__proto__:null,capitalize:ke,createChainedFunction:e8,createSvgIcon:ck,debounce:t8,deprecatedPropType:n8,isMuiElement:r8,ownerDocument:QT,ownerWindow:i8,requirePropFactory:o8,setRef:JT,unstable_ClassNameGenerator:DB,unstable_useEnhancedEffect:KT,unstable_useId:a8,unsupportedProp:l8,useControlled:u8,useEventCallback:wl,useForkRef:hu,useIsFocusVisible:Xy},Symbol.toStringTag,{value:"Module"})),jB=Nr($B);var YS;function ni(){return YS||(YS=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=jB}(im)),im}function LB(e){return Yn("MuiPaper",e)}hr("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const FB=["className","component","elevation","square","variant"],UB=e=>{const{square:t,elevation:n,variant:r,classes:i}=e,o={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return gr(o,LB,i)},BB=Bt("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return Q({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&Q({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${$t("#fff",WS(t.elevation))}, ${$t("#fff",WS(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),zB=j.forwardRef(function(t,n){const r=Nn({props:t,name:"MuiPaper"}),{className:i,component:o="div",elevation:s=1,square:a=!1,variant:l="elevation"}=r,c=at(r,FB),f=Q({},r,{component:o,elevation:s,square:a,variant:l}),d=UB(f);return O.jsx(BB,Q({as:o,ownerState:f,className:it(d.root,i),ref:n},c))});function VB(e){return Yn("MuiButton",e)}const Fc=hr("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),WB=j.createContext({}),HB=j.createContext(void 0),GB=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],qB=e=>{const{color:t,disableElevation:n,fullWidth:r,size:i,variant:o,classes:s}=e,a={root:["root",o,`${o}${ke(t)}`,`size${ke(i)}`,`${o}Size${ke(i)}`,`color${ke(t)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${ke(i)}`],endIcon:["icon","endIcon",`iconSize${ke(i)}`]},l=gr(a,VB,s);return Q({},s,l)},fk=e=>Q({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),KB=Bt(Fg,{shouldForwardProp:e=>uk(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ke(n.color)}`],t[`size${ke(n.size)}`],t[`${n.variant}Size${ke(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const i=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],o=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return Q({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":Q({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:$t(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:$t(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:$t(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":Q({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Fc.focusVisible}`]:Q({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Fc.disabled}`]:Q({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${$t(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(r=e.palette).getContrastText)==null?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:i,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Fc.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Fc.disabled}`]:{boxShadow:"none"}}),YB=Bt("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${ke(n.size)}`]]}})(({ownerState:e})=>Q({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},fk(e))),XB=Bt("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${ke(n.size)}`]]}})(({ownerState:e})=>Q({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},fk(e))),QB=j.forwardRef(function(t,n){const r=j.useContext(WB),i=j.useContext(HB),o=cu(r,t),s=Nn({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:f,disabled:d=!1,disableElevation:p=!1,disableFocusRipple:g=!1,endIcon:m,focusVisibleClassName:y,fullWidth:E=!1,size:w="medium",startIcon:b,type:_,variant:P="text"}=s,R=at(s,GB),D=Q({},s,{color:l,component:c,disabled:d,disableElevation:p,disableFocusRipple:g,fullWidth:E,size:w,type:_,variant:P}),S=qB(D),x=b&&O.jsx(YB,{className:S.startIcon,ownerState:D,children:b}),C=m&&O.jsx(XB,{className:S.endIcon,ownerState:D,children:m}),I=i||"";return O.jsxs(KB,Q({ownerState:D,className:it(r.className,S.root,f,I),component:c,disabled:d,focusRipple:!g,focusVisibleClassName:it(S.focusVisible,y),ref:n,type:_},R,{classes:S,children:[x,a,C]}))}),r0=M8({createStyledComponent:Bt("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${ke(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>Nn({props:e,name:"MuiContainer"})});function JB(e){return Yn("MuiTypography",e)}hr("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const ZB=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],ez=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=e,a={root:["root",o,e.align!=="inherit"&&`align${ke(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return gr(a,JB,s)},tz=Bt("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${ke(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>Q({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),XS={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},nz={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},rz=e=>nz[e]||e,_n=j.forwardRef(function(t,n){const r=Nn({props:t,name:"MuiTypography"}),i=rz(r.color),o=qu(Q({},r,{color:i})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:f=!1,paragraph:d=!1,variant:p="body1",variantMapping:g=XS}=o,m=at(o,ZB),y=Q({},o,{align:s,color:i,className:a,component:l,gutterBottom:c,noWrap:f,paragraph:d,variant:p,variantMapping:g}),E=l||(d?"p":g[p]||XS[p])||"span",w=ez(y);return O.jsx(tz,Q({as:E,ref:n,ownerState:y,className:it(w.root,a)},m))});re.oneOf(["dark","light"]).isRequired,re.func.isRequired;re.oneOf(["dark","light"]).isRequired,re.func.isRequired;const iz=ck(O.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function oz(e){return Yn("MuiChip",e)}const qe=hr("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),sz=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],az=e=>{const{classes:t,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=e,c={root:["root",l,n&&"disabled",`size${ke(r)}`,`color${ke(i)}`,a&&"clickable",a&&`clickableColor${ke(i)}`,s&&"deletable",s&&`deletableColor${ke(i)}`,`${l}${ke(i)}`],label:["label",`label${ke(r)}`],avatar:["avatar",`avatar${ke(r)}`,`avatarColor${ke(i)}`],icon:["icon",`icon${ke(r)}`,`iconColor${ke(o)}`],deleteIcon:["deleteIcon",`deleteIcon${ke(r)}`,`deleteIconColor${ke(i)}`,`deleteIcon${ke(l)}Color${ke(i)}`]};return gr(c,oz,t)},lz=Bt("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${qe.avatar}`]:t.avatar},{[`& .${qe.avatar}`]:t[`avatar${ke(a)}`]},{[`& .${qe.avatar}`]:t[`avatarColor${ke(r)}`]},{[`& .${qe.icon}`]:t.icon},{[`& .${qe.icon}`]:t[`icon${ke(a)}`]},{[`& .${qe.icon}`]:t[`iconColor${ke(i)}`]},{[`& .${qe.deleteIcon}`]:t.deleteIcon},{[`& .${qe.deleteIcon}`]:t[`deleteIcon${ke(a)}`]},{[`& .${qe.deleteIcon}`]:t[`deleteIconColor${ke(r)}`]},{[`& .${qe.deleteIcon}`]:t[`deleteIcon${ke(l)}Color${ke(r)}`]},t.root,t[`size${ke(a)}`],t[`color${ke(r)}`],o&&t.clickable,o&&r!=="default"&&t[`clickableColor${ke(r)})`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${ke(r)}`],t[l],t[`${l}${ke(r)}`]]}})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return Q({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${qe.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${qe.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:n,fontSize:e.typography.pxToRem(12)},[`& .${qe.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${qe.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${qe.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${qe.icon}`]:Q({marginLeft:5,marginRight:-6},t.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},t.iconColor===t.color&&Q({color:e.vars?e.vars.palette.Chip.defaultIconColor:n},t.color!=="default"&&{color:"inherit"})),[`& .${qe.deleteIcon}`]:Q({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:$t(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:$t(e.palette.text.primary,.4)}},t.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},t.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[t.color].contrastTextChannel} / 0.7)`:$t(e.palette[t.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].contrastText}})},t.size==="small"&&{height:24},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.onDelete&&{[`&.${qe.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:$t(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},t.onDelete&&t.color!=="default"&&{[`&.${qe.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}})},({theme:e,ownerState:t})=>Q({},t.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:$t(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${qe.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:$t(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},t.clickable&&t.color!=="default"&&{[`&:hover, &.${qe.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}}),({theme:e,ownerState:t})=>Q({},t.variant==="outlined"&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${qe.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${qe.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${qe.avatar}`]:{marginLeft:4},[`& .${qe.avatarSmall}`]:{marginLeft:2},[`& .${qe.icon}`]:{marginLeft:4},[`& .${qe.iconSmall}`]:{marginLeft:2},[`& .${qe.deleteIcon}`]:{marginRight:5},[`& .${qe.deleteIconSmall}`]:{marginRight:3}},t.variant==="outlined"&&t.color!=="default"&&{color:(e.vars||e).palette[t.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:$t(e.palette[t.color].main,.7)}`,[`&.${qe.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:$t(e.palette[t.color].main,e.palette.action.hoverOpacity)},[`&.${qe.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:$t(e.palette[t.color].main,e.palette.action.focusOpacity)},[`& .${qe.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:$t(e.palette[t.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].main}}})),uz=Bt("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${ke(r)}`]]}})(({ownerState:e})=>Q({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},e.variant==="outlined"&&{paddingLeft:11,paddingRight:11},e.size==="small"&&{paddingLeft:8,paddingRight:8},e.size==="small"&&e.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function QS(e){return e.key==="Backspace"||e.key==="Delete"}const cz=j.forwardRef(function(t,n){const r=Nn({props:t,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:c,disabled:f=!1,icon:d,label:p,onClick:g,onDelete:m,onKeyDown:y,onKeyUp:E,size:w="medium",variant:b="filled",tabIndex:_,skipFocusWhenDisabled:P=!1}=r,R=at(r,sz),D=j.useRef(null),S=hu(D,n),x=J=>{J.stopPropagation(),m&&m(J)},C=J=>{J.currentTarget===J.target&&QS(J)&&J.preventDefault(),y&&y(J)},I=J=>{J.currentTarget===J.target&&(m&&QS(J)?m(J):J.key==="Escape"&&D.current&&D.current.blur()),E&&E(J)},N=s!==!1&&g?!0:s,A=N||m?Fg:l||"div",k=Q({},r,{component:A,disabled:f,size:w,color:a,iconColor:j.isValidElement(d)&&d.props.color||a,onDelete:!!m,clickable:N,variant:b}),X=az(k),G=A===Fg?Q({component:l||"div",focusVisibleClassName:X.focusVisible},m&&{disableRipple:!0}):{};let ee=null;m&&(ee=c&&j.isValidElement(c)?j.cloneElement(c,{className:it(c.props.className,X.deleteIcon),onClick:x}):O.jsx(iz,{className:it(X.deleteIcon),onClick:x}));let B=null;i&&j.isValidElement(i)&&(B=j.cloneElement(i,{className:it(X.avatar,i.props.className)}));let W=null;return d&&j.isValidElement(d)&&(W=j.cloneElement(d,{className:it(X.icon,d.props.className)})),O.jsxs(lz,Q({as:A,className:it(X.root,o),disabled:N&&f?!0:void 0,onClick:g,onKeyDown:C,onKeyUp:I,ref:S,tabIndex:P&&f?-1:_,ownerState:k},G,R,{children:[B||W,O.jsx(uz,{className:it(X.label),ownerState:k,children:p}),ee]}))});function fz(e){return Yn("MuiCard",e)}hr("MuiCard",["root"]);const dz=["className","raised"],pz=e=>{const{classes:t}=e;return gr({root:["root"]},fz,t)},hz=Bt(zB,{name:"MuiCard",slot:"Root",overridesResolver:(e,t)=>t.root})(()=>({overflow:"hidden"})),yf=j.forwardRef(function(t,n){const r=Nn({props:t,name:"MuiCard"}),{className:i,raised:o=!1}=r,s=at(r,dz),a=Q({},r,{raised:o}),l=pz(a);return O.jsx(hz,Q({className:it(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a},s))}),xd=z8({createStyledComponent:Bt("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Nn({props:e,name:"MuiStack"})}),JS=j.createContext();function mz(e){return Yn("MuiGrid",e)}const gz=[0,1,2,3,4,5,6,7,8,9,10],vz=["column-reverse","column","row-reverse","row"],yz=["nowrap","wrap-reverse","wrap"],hl=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],gu=hr("MuiGrid",["root","container","item","zeroMinWidth",...gz.map(e=>`spacing-xs-${e}`),...vz.map(e=>`direction-xs-${e}`),...yz.map(e=>`wrap-xs-${e}`),...hl.map(e=>`grid-xs-${e}`),...hl.map(e=>`grid-sm-${e}`),...hl.map(e=>`grid-md-${e}`),...hl.map(e=>`grid-lg-${e}`),...hl.map(e=>`grid-xl-${e}`)]),bz=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function Ys(e){const t=parseFloat(e);return`${t}${String(e).replace(String(t),"")||"px"}`}function wz({theme:e,ownerState:t}){let n;return e.breakpoints.keys.reduce((r,i)=>{let o={};if(t[i]&&(n=t[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=zo({values:t.columns,breakpoints:e.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let c={};if(t.container&&t.item&&t.columnSpacing!==0){const f=e.spacing(t.columnSpacing);if(f!=="0px"){const d=`calc(${l} + ${Ys(f)})`;c={flexBasis:d,maxWidth:d}}}o=Q({flexBasis:l,flexGrow:0,maxWidth:l},c)}return e.breakpoints.values[i]===0?Object.assign(r,o):r[e.breakpoints.up(i)]=o,r},{})}function Sz({theme:e,ownerState:t}){const n=zo({values:t.direction,breakpoints:e.breakpoints.values});return An({theme:e},n,r=>{const i={flexDirection:r};return r.indexOf("column")===0&&(i[`& > .${gu.item}`]={maxWidth:"none"}),i})}function dk({breakpoints:e,values:t}){let n="";Object.keys(t).forEach(i=>{n===""&&t[i]!==0&&(n=i)});const r=Object.keys(e).sort((i,o)=>e[i]-e[o]);return r.slice(0,r.indexOf(n))}function _z({theme:e,ownerState:t}){const{container:n,rowSpacing:r}=t;let i={};if(n&&r!==0){const o=zo({values:r,breakpoints:e.breakpoints.values});let s;typeof o=="object"&&(s=dk({breakpoints:e.breakpoints.values,values:o})),i=An({theme:e},o,(a,l)=>{var c;const f=e.spacing(a);return f!=="0px"?{marginTop:`-${Ys(f)}`,[`& > .${gu.item}`]:{paddingTop:Ys(f)}}:(c=s)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${gu.item}`]:{paddingTop:0}}})}return i}function xz({theme:e,ownerState:t}){const{container:n,columnSpacing:r}=t;let i={};if(n&&r!==0){const o=zo({values:r,breakpoints:e.breakpoints.values});let s;typeof o=="object"&&(s=dk({breakpoints:e.breakpoints.values,values:o})),i=An({theme:e},o,(a,l)=>{var c;const f=e.spacing(a);return f!=="0px"?{width:`calc(100% + ${Ys(f)})`,marginLeft:`-${Ys(f)}`,[`& > .${gu.item}`]:{paddingLeft:Ys(f)}}:(c=s)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${gu.item}`]:{paddingLeft:0}}})}return i}function Ez(e,t,n={}){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[n[`spacing-xs-${String(e)}`]];const r=[];return t.forEach(i=>{const o=e[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const Cz=Bt("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let f=[];r&&(f=Ez(s,c,t));const d=[];return c.forEach(p=>{const g=n[p];g&&d.push(t[`grid-${p}-${String(g)}`])}),[t.root,r&&t.container,o&&t.item,l&&t.zeroMinWidth,...f,i!=="row"&&t[`direction-xs-${String(i)}`],a!=="wrap"&&t[`wrap-xs-${String(a)}`],...d]}})(({ownerState:e})=>Q({boxSizing:"border-box"},e.container&&{display:"flex",flexWrap:"wrap",width:"100%"},e.item&&{margin:0},e.zeroMinWidth&&{minWidth:0},e.wrap!=="wrap"&&{flexWrap:e.wrap}),Sz,_z,xz,wz);function Oz(e,t){if(!e||e<=0)return[];if(typeof e=="string"&&!Number.isNaN(Number(e))||typeof e=="number")return[`spacing-xs-${String(e)}`];const n=[];return t.forEach(r=>{const i=e[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const Tz=e=>{const{classes:t,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=e;let c=[];n&&(c=Oz(o,l));const f=[];l.forEach(p=>{const g=e[p];g&&f.push(`grid-${p}-${String(g)}`)});const d={root:["root",n&&"container",i&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...f]};return gr(d,mz,t)},Ds=j.forwardRef(function(t,n){const r=Nn({props:t,name:"MuiGrid"}),{breakpoints:i}=NU(),o=qu(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:f=!1,direction:d="row",item:p=!1,rowSpacing:g,spacing:m=0,wrap:y="wrap",zeroMinWidth:E=!1}=o,w=at(o,bz),b=g||m,_=l||m,P=j.useContext(JS),R=f?a||12:P,D={},S=Q({},w);i.keys.forEach(I=>{w[I]!=null&&(D[I]=w[I],delete S[I])});const x=Q({},o,{columns:R,container:f,direction:d,item:p,rowSpacing:b,columnSpacing:_,wrap:y,zeroMinWidth:E,spacing:m},D,{breakpoints:i.keys}),C=Tz(x);return O.jsx(JS.Provider,{value:R,children:O.jsx(Cz,Q({ownerState:x,className:it(C.root,s),as:c,ref:n},S))})});function kz(e){return Yn("MuiLink",e)}const Iz=hr("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),pk={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Pz=e=>pk[e]||e,Rz=({theme:e,ownerState:t})=>{const n=Pz(t.color),r=wa(e,`palette.${n}`,!1)||t.color,i=wa(e,`palette.${n}Channel`);return"vars"in e&&i?`rgba(${i} / 0.4)`:$t(r,.4)},Az=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Nz=e=>{const{classes:t,component:n,focusVisible:r,underline:i}=e,o={root:["root",`underline${ke(i)}`,n==="button"&&"button",r&&"focusVisible"]};return gr(o,kz,t)},Mz=Bt(_n,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`underline${ke(n.underline)}`],n.component==="button"&&t.button]}})(({theme:e,ownerState:t})=>Q({},t.underline==="none"&&{textDecoration:"none"},t.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},t.underline==="always"&&Q({textDecoration:"underline"},t.color!=="inherit"&&{textDecorationColor:Rz({theme:e,ownerState:t})},{"&:hover":{textDecorationColor:"inherit"}}),t.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Iz.focusVisible}`]:{outline:"auto"}})),ZS=j.forwardRef(function(t,n){const r=Nn({props:t,name:"MuiLink"}),{className:i,color:o="primary",component:s="a",onBlur:a,onFocus:l,TypographyClasses:c,underline:f="always",variant:d="inherit",sx:p}=r,g=at(r,Az),{isFocusVisibleRef:m,onBlur:y,onFocus:E,ref:w}=Xy(),[b,_]=j.useState(!1),P=hu(n,w),R=C=>{y(C),m.current===!1&&_(!1),a&&a(C)},D=C=>{E(C),m.current===!0&&_(!0),l&&l(C)},S=Q({},r,{color:o,component:s,focusVisible:b,underline:f,variant:d}),x=Nz(S);return O.jsx(Mz,Q({color:o,className:it(x.root,i),classes:c,component:s,onBlur:R,onFocus:D,ref:P,ownerState:S,variant:d,sx:[...Object.keys(pk).includes(o)?[]:[{color:o}],...Array.isArray(p)?p:[p]]},g))});function Dz(){return O.jsx(Ln,{id:"hero",sx:e=>({width:"100%",backgroundImage:e.palette.mode==="light"?"linear-gradient(180deg, #CEE5FD, #FFF)":`linear-gradient(#02294F, ${Ke("#090E10",0)})`,backgroundSize:"100% 20%",backgroundRepeat:"no-repeat"}),children:O.jsxs(r0,{sx:{display:"flex",flexDirection:"column",alignItems:"center",pt:{xs:14,sm:20},pb:{xs:8,sm:12}},children:[O.jsxs(xd,{spacing:2,useFlexGap:!0,sx:{width:{xs:"100%",sm:"70%"}},children:[O.jsxs(_n,{variant:"h1",sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignSelf:"center",textAlign:"center",fontSize:"clamp(3.5rem, 10vw, 4rem)"},children:["One Stop ",O.jsx(_n,{component:"span",variant:"h1",sx:{fontSize:"clamp(3rem, 10vw, 4rem)",color:e=>e.palette.mode==="light"?"primary.main":"primary.light"},children:"Finance App"})]}),O.jsx(_n,{textAlign:"center",color:"text.secondary",sx:{alignSelf:"center",width:{sm:"100%",md:"80%"}},children:"Explore our state of the art finance application with tools to help you keep financial peace of mind."}),O.jsx(xd,{direction:{xs:"column",sm:"row"},alignSelf:"center",spacing:1,useFlexGap:!0,sx:{pt:2,width:{xs:"100%",sm:"auto"}}})]}),O.jsx(Ln,{id:"image",sx:e=>({mt:{xs:8,sm:10},alignSelf:"center",height:{xs:200,sm:700},width:"100%",backgroundImage:e.palette.mode==="light"?'url("/static/images/templates/templates-images/hero-light.png")':'url("/static/images/templates/templates-images/hero-dark.png")',backgroundSize:"cover",borderRadius:"10px",outline:"1px solid",outlineColor:e.palette.mode==="light"?Ke("#BFCCD9",.5):Ke("#9CCCFC",.1),boxShadow:e.palette.mode==="light"?`0 0 12px 8px ${Ke("#9CCCFC",.2)}`:`0 0 24px 12px ${Ke("#033363",.2)}`})})]})})}var i0={},$z=vr;Object.defineProperty(i0,"__esModule",{value:!0});var hk=i0.default=void 0,jz=$z(ni()),Lz=O;hk=i0.default=(0,jz.default)((0,Lz.jsx)("path",{d:"m20.45 6 .49-1.06L22 4.45c.39-.18.39-.73 0-.91l-1.06-.49L20.45 2c-.18-.39-.73-.39-.91 0l-.49 1.06-1.05.49c-.39.18-.39.73 0 .91l1.06.49.49 1.05c.17.39.73.39.9 0M8.95 6l.49-1.06 1.06-.49c.39-.18.39-.73 0-.91l-1.06-.48L8.95 2c-.17-.39-.73-.39-.9 0l-.49 1.06-1.06.49c-.39.18-.39.73 0 .91l1.06.49L8.05 6c.17.39.73.39.9 0m10.6 7.5-.49 1.06-1.06.49c-.39.18-.39.73 0 .91l1.06.49.49 1.06c.18.39.73.39.91 0l.49-1.06 1.05-.5c.39-.18.39-.73 0-.91l-1.06-.49-.49-1.06c-.17-.38-.73-.38-.9.01m-1.84-4.38-2.83-2.83a.9959.9959 0 0 0-1.41 0L2.29 17.46c-.39.39-.39 1.02 0 1.41l2.83 2.83c.39.39 1.02.39 1.41 0L17.7 10.53c.4-.38.4-1.02.01-1.41m-3.5 2.09L12.8 9.8l1.38-1.38 1.41 1.41z"}),"AutoFixHighRounded");var o0={},Fz=vr;Object.defineProperty(o0,"__esModule",{value:!0});var mk=o0.default=void 0,Uz=Fz(ni()),Bz=O;mk=o0.default=(0,Uz.default)((0,Bz.jsx)("path",{d:"m20.99 17.99-4.94-4.94-2.12 2.12 4.94 4.94c.59.59 1.54.59 2.12 0 .58-.59.58-1.54 0-2.12M17.65 10c1.93 0 3.5-1.57 3.5-3.5 0-.58-.16-1.12-.41-1.6l-2.7 2.7-1.49-1.49 2.7-2.7c-.48-.25-1.02-.41-1.6-.41-1.93 0-3.5 1.57-3.5 3.5 0 .41.08.8.21 1.16l-1.85 1.85-1.78-1.78c.39-.39.39-1.02 0-1.41l-.71-.71 2.12-2.12c-1.17-1.17-3.07-1.17-4.24 0L5.08 6.32c-.39.39-.39 1.02 0 1.41l.71.71H3.25c-.19 0-.37.07-.5.21-.28.28-.28.72 0 1l2.54 2.54c.28.28.72.28 1 0 .13-.13.21-.31.21-.5V9.15l.7.7c.39.39 1.02.39 1.41 0l1.78 1.78-6.35 6.35c-.59.59-.59 1.54 0 2.12.59.59 1.54.59 2.12 0L16.48 9.79c.37.13.76.21 1.17.21"}),"ConstructionRounded");var s0={},zz=vr;Object.defineProperty(s0,"__esModule",{value:!0});var gk=s0.default=void 0,Vz=zz(ni()),Wz=O;gk=s0.default=(0,Vz.default)((0,Wz.jsx)("path",{d:"M19.88 18.47c.48-.77.75-1.67.69-2.66-.13-2.15-1.84-3.97-3.97-4.2-2.72-.3-5.02 1.81-5.02 4.47 0 2.49 2.01 4.5 4.49 4.5.88 0 1.7-.26 2.39-.7l2.41 2.41c.39.39 1.03.39 1.42 0 .39-.39.39-1.03 0-1.42zm-3.8.11c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5m-.36-8.5c-.74.02-1.45.18-2.1.45l-.55-.83-3.08 5.01c-.36.58-1.17.64-1.61.13l-2.12-2.47-3.06 4.9c-.31.49-.97.62-1.44.28-.42-.31-.54-.89-.26-1.34l3.78-6.05c.36-.57 1.17-.63 1.61-.12L9 12.5l3.18-5.17c.38-.62 1.28-.64 1.68-.03zm2.59.5c-.64-.28-1.33-.45-2.05-.49L20.8 2.9c.31-.49.97-.61 1.43-.27.43.31.54.9.26 1.34z"}),"QueryStatsRounded");var a0={},Hz=vr;Object.defineProperty(a0,"__esModule",{value:!0});var vk=a0.default=void 0,Gz=Hz(ni()),qz=O;vk=a0.default=(0,Gz.default)((0,qz.jsx)("path",{d:"m18.04 7.99-.63-1.4-1.4-.63c-.39-.18-.39-.73 0-.91l1.4-.63.63-1.4c.18-.39.73-.39.91 0l.63 1.4 1.4.63c.39.18.39.73 0 .91l-1.4.63-.63 1.4c-.17.39-.73.39-.91 0m3.24 4.73-.32-.72c-.18-.39-.73-.39-.91 0l-.32.72-.73.32c-.39.18-.39.73 0 .91l.72.32.32.73c.18.39.73.39.91 0l.32-.72.73-.32c.39-.18.39-.73 0-.91zm-5.04 1.65 1.23.93c.4.3.51.86.26 1.3l-1.62 2.8c-.25.44-.79.62-1.25.42l-1.43-.6c-.2.13-.42.26-.64.37l-.19 1.54c-.06.5-.49.88-.99.88H8.38c-.5 0-.93-.38-.99-.88l-.19-1.54c-.22-.11-.43-.23-.64-.37l-1.43.6c-.46.2-1 .02-1.25-.42l-1.62-2.8c-.25-.44-.14-.99.26-1.3l1.23-.93V14c0-.12 0-.25.01-.37l-1.23-.93c-.4-.3-.51-.86-.26-1.3l1.62-2.8c.25-.44.79-.62 1.25-.42l1.43.6c.2-.13.42-.26.64-.37l.19-1.54c.05-.49.48-.87.98-.87h3.23c.5 0 .93.38.99.88l.19 1.54c.22.11.43.23.64.37l1.43-.6c.46-.2 1-.02 1.25.42l1.62 2.8c.25.44.14.99-.26 1.3l-1.23.93c.01.12.01.24.01.37s0 .24-.01.36M13 14c0-1.66-1.34-3-3-3s-3 1.34-3 3 1.34 3 3 3 3-1.34 3-3"}),"SettingsSuggestRounded");var l0={},Kz=vr;Object.defineProperty(l0,"__esModule",{value:!0});var yk=l0.default=void 0,Yz=Kz(ni()),Uc=O;yk=l0.default=(0,Yz.default)([(0,Uc.jsx)("path",{d:"M21 12.22C21 6.73 16.74 3 12 3c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2 .55 0 1-.45 1-1v-4.81c0-3.83 2.95-7.18 6.78-7.29 3.96-.12 7.22 3.06 7.22 7V19h-7c-.55 0-1 .45-1 1s.45 1 1 1h7c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62"},"0"),(0,Uc.jsx)("circle",{cx:"9",cy:"13",r:"1"},"1"),(0,Uc.jsx)("circle",{cx:"15",cy:"13",r:"1"},"2"),(0,Uc.jsx)("path",{d:"M18 11.03C17.52 8.18 15.04 6 12.05 6c-3.03 0-6.29 2.51-6.03 6.45 2.47-1.01 4.33-3.21 4.86-5.89 1.31 2.63 4 4.44 7.12 4.47"},"3")],"SupportAgentRounded");var u0={},Xz=vr;Object.defineProperty(u0,"__esModule",{value:!0});var bk=u0.default=void 0,Qz=Xz(ni()),Jz=O;bk=u0.default=(0,Qz.default)((0,Jz.jsx)("path",{d:"M13.12 2.06 7.58 7.6c-.37.37-.58.88-.58 1.41V19c0 1.1.9 2 2 2h9c.8 0 1.52-.48 1.84-1.21l3.26-7.61C23.94 10.2 22.49 8 20.34 8h-5.65l.95-4.58c.1-.5-.05-1.01-.41-1.37-.59-.58-1.53-.58-2.11.01M3 21c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2s-2 .9-2 2v8c0 1.1.9 2 2 2"}),"ThumbUpAltRounded");const Zz=[{icon:O.jsx(vk,{}),title:"Adaptable performance",description:"Our product effortlessly adjusts to your needs, boosting efficiency and simplifying your tasks."},{icon:O.jsx(mk,{}),title:"Built to last",description:"SimpliTrac was built with longevity in mind and will be your finance partner for years to come."},{icon:O.jsx(bk,{}),title:"Great user experience",description:"Our product is easy to learn and will be a valuable tool to anyones daily routine."},{icon:O.jsx(hk,{}),title:"Innovative functionality",description:"Using up-to-date AI technology to integrate key features and ensure constant innovation."},{icon:O.jsx(yk,{}),title:"User Feedback",description:"New features will be added based on user suggestions and to keep up with market trends."},{icon:O.jsx(gk,{}),title:"Precision in every detail",description:"Enjoy a meticulously crafted product where small touches make a significant impact on your overall experience."}];function eV(){return O.jsx(Ln,{id:"highlights",sx:{pt:{xs:4,sm:12},pb:{xs:8,sm:16},color:"white",bgcolor:"#06090a"},children:O.jsxs(r0,{sx:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:{xs:3,sm:6}},children:[O.jsxs(Ln,{sx:{width:{sm:"100%",md:"60%"},textAlign:{sm:"left",md:"center"}},children:[O.jsx(_n,{component:"h2",variant:"h4",children:"SimpliTrac Highlights"}),O.jsx(_n,{variant:"body1",sx:{color:"grey.400"},children:"Explore why our product stands out: adaptability, durability, user-friendly design, and innovation."})]}),O.jsx(Ds,{container:!0,spacing:2.5,children:Zz.map((e,t)=>O.jsx(Ds,{item:!0,xs:12,sm:6,md:4,children:O.jsxs(xd,{direction:"column",color:"inherit",component:yf,spacing:1,useFlexGap:!0,sx:{p:3,height:"100%",border:"1px solid",borderColor:"grey.800",background:"transparent",backgroundColor:"grey.900"},children:[O.jsx(Ln,{sx:{opacity:"50%"},children:e.icon}),O.jsxs("div",{children:[O.jsx(_n,{fontWeight:"medium",gutterBottom:!0,children:e.title}),O.jsx(_n,{variant:"body2",sx:{color:"grey.400"},children:e.description})]})]})},t))})]})})}var c0={},tV=vr;Object.defineProperty(c0,"__esModule",{value:!0});var Bg=c0.default=void 0,nV=tV(ni()),rV=O;Bg=c0.default=(0,nV.default)((0,rV.jsx)("path",{d:"M9.29 6.71c-.39.39-.39 1.02 0 1.41L13.17 12l-3.88 3.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01"}),"ChevronRightRounded");var f0={},iV=vr;Object.defineProperty(f0,"__esModule",{value:!0});var wk=f0.default=void 0,oV=iV(ni()),sV=O;wk=f0.default=(0,oV.default)((0,sV.jsx)("path",{d:"M4 7c0-.55.45-1 1-1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-1.1 0-2 .9-2 2v11h-.5c-.83 0-1.5.67-1.5 1.5S.67 20 1.5 20H14v-3H4zm19 1h-6c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1m-1 9h-4v-7h4z"}),"DevicesRounded");var d0={},aV=vr;Object.defineProperty(d0,"__esModule",{value:!0});var Sk=d0.default=void 0,lV=aV(ni()),uV=O;Sk=d0.default=(0,lV.default)((0,uV.jsx)("path",{d:"M4 7c.55 0 1 .45 1 1v5c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1m-3 3c.55 0 1 .45 1 1v5c0 .55-.45 1-1 1s-1-.45-1-1v-5c0-.55.45-1 1-1m22-3c.55 0 1 .45 1 1v5c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1m-3 3c.55 0 1 .45 1 1v5c0 .55-.45 1-1 1s-1-.45-1-1v-5c0-.55.45-1 1-1m-4-7.99L8 2c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V4c0-1.1-.9-1.99-2-1.99M16 17H8V7h8z"}),"EdgesensorHighRounded");var p0={},cV=vr;Object.defineProperty(p0,"__esModule",{value:!0});var _k=p0.default=void 0,fV=cV(ni()),dV=O;_k=p0.default=(0,fV.default)((0,dV.jsx)("path",{d:"M21 6v4.5c0 .55-.45 1-1 1h-9.67c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1H20c.55 0 1 .45 1 1m-6.33 12v-4.5c0-.55-.45-1-1-1h-3.33c-.55 0-1 .45-1 1V18c0 .55.45 1 1 1h3.33c.55 0 1-.45 1-1m1-4.5V18c0 .55.45 1 1 1H20c.55 0 1-.45 1-1v-4.5c0-.55-.45-1-1-1h-3.33c-.56 0-1 .45-1 1M8.33 18V6c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3.33c.56 0 1-.45 1-1"}),"ViewQuiltRounded");const _o=[{icon:O.jsx(_k,{}),title:"Camera Support",description:"Our AI-drive receipt reader can translate your daily receipts to financial entries.",imageLight:'url("/static/images/templates/templates-images/dash-light.png")',imageDark:'url("/static/images/templates/templates-images/dash-dark.png")'},{icon:O.jsx(Sk,{}),title:"Advanced Tracking Metrics",description:"Be able to see your spending in real time with our state of the art tracking metrics.",imageLight:'url("/static/images/templates/templates-images/mobile-light.png")',imageDark:'url("/static/images/templates/templates-images/mobile-dark.png")'},{icon:O.jsx(wk,{}),title:"Achievement Progression",description:"Check the Achievements tab to see your progession and how you measure up to other users.",imageLight:'url("/static/images/templates/templates-images/devices-light.png")',imageDark:'url("/static/images/templates/templates-images/devices-dark.png")'}];function pV(){const[e,t]=j.useState(0),n=i=>{t(i)},r=_o[e];return O.jsx(r0,{id:"features",sx:{py:{xs:8,sm:16}},children:O.jsxs(Ds,{container:!0,spacing:6,children:[O.jsxs(Ds,{item:!0,xs:12,md:6,children:[O.jsxs("div",{children:[O.jsx(_n,{component:"h2",variant:"h4",color:"text.primary",children:"Product features"}),O.jsx(_n,{variant:"body1",color:"text.secondary",sx:{mb:{xs:2,sm:4}},children:"SimpliTrac uses a number of different features to enhance the user experience and ensure accurate recording of day-to-day expenses while providing ample feedback on user activity and giving financial peace of mind."})]}),O.jsx(Ds,{container:!0,item:!0,gap:1,sx:{display:{xs:"auto",sm:"none"}},children:_o.map(({title:i},o)=>O.jsx(cz,{label:i,onClick:()=>n(o),sx:{borderColor:s=>(s.palette.mode==="light",e===o?"primary.light":""),background:s=>(s.palette.mode==="light",e===o?"none":""),backgroundColor:e===o?"primary.main":"","& .MuiChip-label":{color:e===o?"#fff":""}}},o))}),O.jsxs(Ln,{component:yf,variant:"outlined",sx:{display:{xs:"auto",sm:"none"},mt:4},children:[O.jsx(Ln,{sx:{backgroundImage:i=>i.palette.mode==="light"?_o[e].imageLight:_o[e].imageDark,backgroundSize:"cover",backgroundPosition:"center",minHeight:280}}),O.jsxs(Ln,{sx:{px:2,pb:2},children:[O.jsx(_n,{color:"text.primary",variant:"body2",fontWeight:"bold",children:r.title}),O.jsx(_n,{color:"text.secondary",variant:"body2",sx:{my:.5},children:r.description}),O.jsxs(ZS,{color:"primary",variant:"body2",fontWeight:"bold",sx:{display:"inline-flex",alignItems:"center","& > svg":{transition:"0.2s"},"&:hover > svg":{transform:"translateX(2px)"}},children:[O.jsx("span",{children:"Learn more"}),O.jsx(Bg,{fontSize:"small",sx:{mt:"1px",ml:"2px"}})]})]})]}),O.jsx(xd,{direction:"column",justifyContent:"center",alignItems:"flex-start",spacing:2,useFlexGap:!0,sx:{width:"100%",display:{xs:"none",sm:"flex"}},children:_o.map(({icon:i,title:o,description:s},a)=>O.jsx(yf,{variant:"outlined",component:QB,onClick:()=>n(a),sx:{p:3,height:"fit-content",width:"100%",background:"none",backgroundColor:e===a?"action.selected":void 0,borderColor:l=>l.palette.mode==="light"?e===a?"primary.light":"grey.200":e===a?"primary.dark":"grey.800"},children:O.jsxs(Ln,{sx:{width:"100%",display:"flex",textAlign:"left",flexDirection:{xs:"column",md:"row"},alignItems:{md:"center"},gap:2.5},children:[O.jsx(Ln,{sx:{color:l=>l.palette.mode==="light"?e===a?"primary.main":"grey.300":e===a?"primary.main":"grey.700"},children:i}),O.jsxs(Ln,{sx:{textTransform:"none"},children:[O.jsx(_n,{color:"text.primary",variant:"body2",fontWeight:"bold",children:o}),O.jsx(_n,{color:"text.secondary",variant:"body2",sx:{my:.5},children:s}),O.jsxs(ZS,{color:"primary",variant:"body2",fontWeight:"bold",sx:{display:"inline-flex",alignItems:"center","& > svg":{transition:"0.2s"},"&:hover > svg":{transform:"translateX(2px)"}},onClick:l=>{l.stopPropagation()},children:[O.jsx("span",{children:"Learn more"}),O.jsx(Bg,{fontSize:"small",sx:{mt:"1px",ml:"2px"}})]})]})]})},a))})]}),O.jsx(Ds,{item:!0,xs:12,md:6,sx:{display:{xs:"none",sm:"flex"},width:"100%"},children:O.jsx(yf,{variant:"outlined",sx:{height:"100%",width:"100%",display:{xs:"none",sm:"flex"},pointerEvents:"none"},children:O.jsx(Ln,{sx:{m:"auto",width:420,height:500,backgroundSize:"contain",backgroundImage:i=>i.palette.mode==="light"?_o[e].imageLight:_o[e].imageDark}})})})]})})}const me={50:"#F0F7FF",100:"#CEE5FD",200:"#9CCCFC",300:"#55A6F6",400:"#0A66C2",500:"#0959AA",600:"#064079",700:"#033363",800:"#02294F",900:"#021F3B"},vs={50:"#F9F0FF",100:"#E9CEFD",200:"#D49CFC",300:"#B355F6",400:"#750AC2",500:"#6709AA",600:"#490679",700:"#3B0363",800:"#2F024F",900:"#23023B"},$e={50:"#FBFCFE",100:"#EAF0F5",200:"#D6E2EB",300:"#BFCCD9",400:"#94A6B8",500:"#5B6B7C",600:"#4C5967",700:"#364049",800:"#131B20",900:"#090E10"},ys={50:"#F6FEF6",100:"#E3FBE3",200:"#C7F7C7",300:"#A1E8A1",400:"#51BC51",500:"#1F7A1F",600:"#136C13",700:"#0A470A",800:"#042F04",900:"#021D02"},hV=e=>({palette:{mode:e,primary:{light:me[200],main:me[500],dark:me[800],contrastText:me[50],...e==="dark"&&{contrastText:me[100],light:me[300],main:me[400],dark:me[800]}},secondary:{light:vs[300],main:vs[500],dark:vs[800],...e==="dark"&&{light:vs[400],main:vs[500],dark:vs[900]}},warning:{main:"#F7B538",dark:"#F79F00",...e==="dark"&&{main:"#F7B538",dark:"#F79F00"}},error:{light:di[50],main:di[500],dark:di[700],...e==="dark"&&{light:"#D32F2F",main:"#D32F2F",dark:"#B22A2A"}},success:{light:ys[300],main:ys[400],dark:ys[800],...e==="dark"&&{light:ys[400],main:ys[500],dark:ys[700]}},grey:{50:$e[50],100:$e[100],200:$e[200],300:$e[300],400:$e[400],500:$e[500],600:$e[600],700:$e[700],800:$e[800],900:$e[900]},divider:e==="dark"?Ke($e[600],.3):Ke($e[300],.5),background:{default:"#fff",paper:$e[50],...e==="dark"&&{default:$e[900],paper:$e[800]}},text:{primary:$e[800],secondary:$e[600],...e==="dark"&&{primary:"#fff",secondary:$e[400]}},action:{selected:`${Ke(me[200],.2)}`,...e==="dark"&&{selected:Ke(me[800],.2)}}},typography:{fontFamily:['"Inter", "sans-serif"'].join(","),h1:{fontSize:60,fontWeight:600,lineHeight:78/70,letterSpacing:-.2},h2:{fontSize:48,fontWeight:600,lineHeight:1.2},h3:{fontSize:42,lineHeight:1.2},h4:{fontSize:36,fontWeight:500,lineHeight:1.5},h5:{fontSize:20,fontWeight:600},h6:{fontSize:18},subtitle1:{fontSize:18},subtitle2:{fontSize:16},body1:{fontWeight:400,fontSize:15},body2:{fontWeight:400,fontSize:14},caption:{fontWeight:400,fontSize:12}}});function mV(e){return{...hV(e),components:{MuiAccordion:{defaultProps:{elevation:0,disableGutters:!0},styleOverrides:{root:({theme:t})=>({padding:8,overflow:"clip",backgroundColor:"#fff",border:"1px solid",borderColor:$e[100],":before":{backgroundColor:"transparent"},"&:first-of-type":{borderTopLeftRadius:10,borderTopRightRadius:10},"&:last-of-type":{borderBottomLeftRadius:10,borderBottomRightRadius:10},...t.palette.mode==="dark"&&{backgroundColor:$e[900],borderColor:$e[800]}})}},MuiAccordionSummary:{styleOverrides:{root:({theme:t})=>({border:"none",borderRadius:8,"&:hover":{backgroundColor:$e[100]},...t.palette.mode==="dark"&&{"&:hover":{backgroundColor:$e[800]}}})}},MuiAccordionDetails:{styleOverrides:{root:{mb:20,border:"none"}}},MuiToggleButtonGroup:{styleOverrides:{root:({theme:t})=>({borderRadius:"10px",boxShadow:`0 4px 16px ${Ke($e[400],.2)}`,"& .Mui-selected":{color:me[500]},...t.palette.mode==="dark"&&{"& .Mui-selected":{color:"#fff"},boxShadow:`0 4px 16px ${Ke(me[700],.5)}`}})}},MuiToggleButton:{styleOverrides:{root:({theme:t})=>({padding:"12px 16px",textTransform:"none",borderRadius:"10px",fontWeight:500,...t.palette.mode==="dark"&&{color:$e[400],boxShadow:"0 4px 16px rgba(0, 0, 0, 0.5)","&.Mui-selected":{color:me[300]}}})}},MuiButtonBase:{defaultProps:{disableTouchRipple:!0,disableRipple:!0},styleOverrides:{root:{boxSizing:"border-box",transition:"all 100ms ease-in","&:focus-visible":{outline:`3px solid ${Ke(me[500],.5)}`,outlineOffset:"2px"}}}},MuiButton:{styleOverrides:{root:({theme:t,ownerState:n})=>({boxSizing:"border-box",boxShadow:"none",borderRadius:"10px",textTransform:"none","&:active":{transform:"scale(0.98)"},...n.size==="small"&&{maxHeight:"32px"},...n.size==="medium"&&{height:"40px"},...n.variant==="contained"&&n.color==="primary"&&{color:me[50],background:me[500],backgroundImage:`linear-gradient(to bottom, ${me[400]}, ${me[600]})`,boxShadow:`inset 0 1px ${Ke(me[300],.4)}`,outline:`1px solid ${me[700]}`,"&:hover":{background:me[400],backgroundImage:"none",boxShadow:`0 0 0 1px ${Ke(me[300],.5)}`}},...n.variant==="outlined"&&{backgroundColor:Ke(me[300],.1),borderColor:me[300],color:me[500],"&:hover":{backgroundColor:Ke(me[300],.3),borderColor:me[200]}},...n.variant==="text"&&{color:me[500],"&:hover":{backgroundColor:Ke(me[300],.3),borderColor:me[200]}},...t.palette.mode==="dark"&&{...n.variant==="outlined"&&{backgroundColor:Ke(me[600],.1),borderColor:me[700],color:me[300],"&:hover":{backgroundColor:Ke(me[600],.3),borderColor:me[700]}},...n.variant==="text"&&{color:me[300],"&:hover":{backgroundColor:Ke(me[600],.3),borderColor:me[700]}}}})}},MuiCard:{styleOverrides:{root:({theme:t,ownerState:n})=>({backgroundColor:$e[50],borderRadius:10,border:`1px solid ${Ke($e[200],.8)}`,boxShadow:"none",transition:"background-color, border, 80ms ease",...n.variant==="outlined"&&{background:`linear-gradient(to bottom, #FFF, ${$e[50]})`,"&:hover":{borderColor:me[300],boxShadow:`0 0 24px ${me[100]}`}},...t.palette.mode==="dark"&&{backgroundColor:Ke($e[800],.6),border:`1px solid ${Ke($e[700],.3)}`,...n.variant==="outlined"&&{background:`linear-gradient(to bottom, ${$e[900]}, ${Ke($e[800],.5)})`,"&:hover":{borderColor:me[700],boxShadow:`0 0 24px ${me[800]}`}}}})}},MuiChip:{styleOverrides:{root:({theme:t})=>({alignSelf:"center",py:1.5,px:.5,background:`linear-gradient(to bottom right, ${me[50]}, ${me[100]})`,border:"1px solid",borderColor:`${Ke(me[500],.3)}`,fontWeight:"600","&:hover":{backgroundColor:me[500]},"&:focus-visible":{borderColor:me[800],backgroundColor:me[200]},"& .MuiChip-label":{color:me[500]},"& .MuiChip-icon":{color:me[500]},...t.palette.mode==="dark"&&{background:`linear-gradient(to bottom right, ${me[700]}, ${me[900]})`,borderColor:`${Ke(me[500],.5)}`,"&:hover":{backgroundColor:me[600]},"&:focus-visible":{borderColor:me[200],backgroundColor:me[600]},"& .MuiChip-label":{color:me[200]},"& .MuiChip-icon":{color:me[200]}}})}},MuiDivider:{styleOverrides:{root:({theme:t})=>({borderColor:`${Ke($e[200],.8)}`,...t.palette.mode==="dark"&&{borderColor:`${Ke($e[700],.4)}`}})}},MuiLink:{defaultProps:{underline:"none"},styleOverrides:{root:({theme:t})=>({color:me[600],fontWeight:500,position:"relative",textDecoration:"none","&::before":{content:'""',position:"absolute",width:0,height:"1px",bottom:0,left:0,backgroundColor:me[200],opacity:.7,transition:"width 0.3s ease, opacity 0.3s ease"},"&:hover::before":{width:"100%",opacity:1},...t.palette.mode==="dark"&&{color:me[200]}})}},MuiMenuItem:{styleOverrides:{root:({theme:t})=>({borderRadius:"99px",color:$e[500],fontWeight:500,...t.palette.mode==="dark"&&{color:$e[300]}})}},MuiPaper:{styleOverrides:{root:({theme:t})=>({backgroundImage:"none",backgroundColor:$e[100],...t.palette.mode==="dark"&&{backgroundColor:Ke($e[900],.6)}})}},MuiSwitch:{styleOverrides:{root:({theme:t})=>({boxSizing:"border-box",width:36,height:24,padding:0,transition:"background-color 100ms ease-in","&:hover":{"& .MuiSwitch-track":{backgroundColor:me[600]}},"& .MuiSwitch-switchBase":{"&.Mui-checked":{transform:"translateX(13px)"}},"& .MuiSwitch-track":{borderRadius:50},"& .MuiSwitch-thumb":{boxShadow:"0 0 2px 2px rgba(0, 0, 0, 0.2)",backgroundColor:"#FFF",width:16,height:16,margin:2},...t.palette.mode==="dark"&&{width:36,height:24,padding:0,transition:"background-color 100ms ease-in","&:hover":{"& .MuiSwitch-track":{backgroundColor:me[600]}},"& .MuiSwitch-switchBase":{"&.Mui-checked":{transform:"translateX(13px)"}},"& .MuiSwitch-thumb":{boxShadow:"0 0 2px 2px rgba(0, 0, 0, 0.2)",backgroundColor:"#FFF",width:16,height:16,margin:2}}}),switchBase:{height:24,width:24,padding:0,color:"#fff","&.Mui-checked + .MuiSwitch-track":{opacity:1}}}},MuiTextField:{styleOverrides:{root:({theme:t})=>({"& label .Mui-focused":{color:"white"},"& .MuiInputBase-input":{boxSizing:"border-box","&::placeholder":{opacity:.7}},"& .MuiOutlinedInput-root":{boxSizing:"border-box",minWidth:280,minHeight:40,height:"100%",borderRadius:"10px",border:"1px solid",borderColor:$e[200],transition:"border-color 120ms ease-in","& fieldset":{border:"none",boxShadow:"0px 2px 4px rgba(0, 0, 0, 0.1)",background:`${Ke("#FFF",.3)}`},"&:hover":{borderColor:me[300]},"&.Mui-focused":{borderColor:me[400],outline:"4px solid",outlineColor:me[200]}},...t.palette.mode==="dark"&&{"& .MuiOutlinedInput-root":{boxSizing:"border-box",minWidth:280,minHeight:40,height:"100%",borderRadius:"10px",border:"1px solid",borderColor:$e[600],transition:"border-color 120ms ease-in","& fieldset":{border:"none",boxShadow:" 0px 2px 4px rgba(0, 0, 0, 0.4)",background:`${Ke($e[800],.4)}`},"&:hover":{borderColor:me[300]},"&.Mui-focused":{borderColor:me[400],outline:"4px solid",outlineColor:Ke(me[500],.5)}}}})}}}}}re.shape({valueOf:re.func.isRequired}).isRequired,re.func.isRequired;function gV(){const[e,t]=j.useState("light"),[n,r]=j.useState(!0),i=_d(mV(e)),o=_d({palette:{mode:e}});return O.jsxs(rB,{theme:n?i:o,children:[O.jsx(AU,{}),O.jsx(Dz,{}),O.jsxs(Ln,{sx:{bgcolor:"background.default"},children:[O.jsx(pV,{}),O.jsx(bs,{}),O.jsx(bs,{}),O.jsx(eV,{}),O.jsx(bs,{}),O.jsx(bs,{}),O.jsx(bs,{})]})]})}const vV=()=>{const{setScreen:e,setUser:t,isUpdating:n,setIsUpdating:r}=j.useContext(dr);let i=new mn(JSON.parse(localStorage.getItem("user")));if(localStorage.length!==0){t(i),e("landing");return}const o=async()=>{try{r(!0);const l=await Tw(hd,Dw),c=l.user.uid;let f=await mn.getUserFromFirestore(c);if(!f.isNewUser()){alert("Sorry, you already have an account."),e(),r(!1);return}f=new mn(l.user),await a(new mn(f)),t(f),localStorage.setItem("user",f),e("landing"),r(!1)}catch(l){console.log(l)}},s=async()=>{try{r(!0);const c=(await Tw(hd,Dw)).user.uid;let f=await mn.getUserFromFirestore(c);if(f.isNewUser()){alert("Sorry. You do not have an account."),e(""),r(!1);return}t(f),localStorage.setItem("user",f),e("landing"),r(!1)}catch(l){console.error(l)}};async function a(l){const c={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(l)},d=await fetch("https://us-central1-simplitracapp.cloudfunctions.net/create_new_user",c);console.log(d)}return O.jsxs(O.Fragment,{children:[O.jsx(Jd,{children:O.jsx(ty,{children:O.jsx(Qd,{xs:1,md:1,children:O.jsx(Zd,{src:Ny,role:"logo",style:{width:"300px",height:"300px"},roundedCircle:!0})})})}),O.jsxs("div",{children:[n&&O.jsx(Qv,{})," ",O.jsx("button",{onClick:o,children:" New User Sign Up"}),O.jsx("div",{}),O.jsx("button",{onClick:s,children:" Existing User Sign In"}),O.jsx("div",{children:O.jsx(gV,{})})]})]})},yV=()=>{const[e,t]=j.useState("");return j.useEffect(()=>{const n=A9(hd,r=>{r?(t(r.email),console.log(`User Email set: ${r.email}`)):(t(""),console.log("No user is signed in"))});return()=>n()},[]),O.jsxs("div",{className:"App",children:[O.jsx("h1",{children:"SimpliTrac"}),e?O.jsx(bV,{user_email:e}):O.jsx("p",{children:"Please Enter in an Expense."}),O.jsx(Jv,{})]})},bV=({user_email:e})=>{const t=`https://lookerstudio.google.com/embed/reporting/ae330055-31b8-4e65-a1a9-f0bbd1cda92f/page/87O5D?params=${encodeURIComponent(`{"user_email": "${e}","filter": {"user_email": "${e}"} }`)}`;return j.useEffect(()=>{console.log(`Report URL: ${t}`)},[t]),O.jsx("div",{className:"report-container",children:O.jsx("iframe",{id:"report-frame",width:"900",height:"600",src:t,style:{border:0},allowFullScreen:!0})})},wV=()=>{const{user:e,setUser:t,setScreen:n,setServerResponse:r}=j.useContext(dr),[i,o]=j.useState([]),[s,a]=j.useState([]),[l,c]=j.useState([]);j.useEffect(()=>{e&&e.transactions&&o(e.transactions),e&&e.categories&&a(["Select Category",...e.categories.map(E=>E.category_name)])},[e]);const{control:f,handleSubmit:d,watch:p}=OE(),g=async E=>{const w=i.map((P,R)=>{const D=new En(P);return D.vendor=E[`vendor-${R}`],D.amount=parseFloat(E[`amount-${R}`]),D.category={name:E[`category-${R}`]},D.createdAt=E[`date-${R}`],D}),b=new mn(e);b.transactions=w;const _=await b.deleteTransactions();_ instanceof mn&&(t(_),r("Transactions Successfully Updated"),localStorage.clear(),localStorage.setItem("user",_),n("landing"))},m=()=>{n("landing")},y=async E=>{if(window.confirm("Are you sure you want to delete this transaction?")){const w=i.filter(P=>P.transactionId!==E);o(w),c();const b=new mn(e);b.transactions=w;const _=await b.updateFirebase();_ instanceof mn&&(t(_),r("Transaction Successfully Deleted"))}};return O.jsxs("form",{onSubmit:d(g),children:[O.jsx("h2",{children:"Edit Transactions"}),i.map((E,w)=>O.jsxs("div",{className:"transaction-edit-row",children:[O.jsx("label",{children:"Date"}),O.jsx(Ki,{name:`date-${w}`,control:f,defaultValue:E.createdAt,render:({field:b})=>O.jsx("input",{type:"date",...b})}),O.jsx("label",{children:"Vendor"}),O.jsx(Ki,{name:`vendor-${w}`,control:f,defaultValue:E.vendor,render:({field:b})=>O.jsx("input",{type:"text",...b})}),O.jsx("label",{children:"Amount"}),O.jsx(Ki,{name:`amount-${w}`,control:f,defaultValue:E.amount,render:({field:b})=>O.jsx("input",{type:"number",step:"0.01",...b})}),O.jsx("label",{children:"Category"}),O.jsx(Ki,{name:`category-${w}`,control:f,defaultValue:E.category_name||"Select Category",render:({field:b})=>O.jsx("select",{...b,children:s.map(_=>O.jsx("option",{value:_,children:_},_))})}),O.jsx("button",{type:"button",className:"custom-button delete-button",onClick:()=>y(E.transactionId),children:"Delete"})]},E.transactionId)),O.jsxs("div",{className:"edit-buttons",children:[O.jsx("button",{type:"submit",className:"custom-button",children:"Save Changes"}),O.jsx("button",{type:"button",className:"custom-button",onClick:m,children:"Cancel"}),O.jsx("button",{type:"button",className:"custom-button",onClick:m,children:"Back"})]})]})},SV=()=>O.jsxs(O.Fragment,{children:[O.jsx(Jd,{children:O.jsx(ty,{children:O.jsx(Qd,{xs:1,md:1,children:O.jsx(Zd,{src:Ny,role:"logo",style:{width:"300px",height:"300px"},roundedCircle:!0})})})}),O.jsxs("div",{children:[O.jsx("p",{children:"Welcome to the SimpliTrac User Guide!"}),O.jsx("p",{children:"Our application is a simple to use financial tracker that allows you to record expenses on the go."}),O.jsx("p",{children:" -------------------------------------------- "}),O.jsx("p",{children:"With our intuitive AI-driven camera setup, you can snap pictures of your receipts on the fly and record your daily expenses."}),O.jsx("p",{children:" -------------------------------------------- "}),O.jsx("p",{children:"Or you can manually enter your expenses on the main page with our easy to use Expense Table."}),O.jsx("p",{children:" -------------------------------------------- "}),O.jsx("p",{children:"See where your money is going in real time with our handy Chart feature."}),O.jsx("p",{children:" -------------------------------------------- "}),O.jsx("p",{children:"And use the Edit Transaction function to correct any errors in your expense processing."}),O.jsx("p",{children:" -------------------------------------------- "}),O.jsx("p",{children:"Be sure to check your achievements tab to see how you rank among other users and earn badges while maintaining financial peace of mind!"}),O.jsx(Jv,{})]})]});function _V(){const{screen:e,setScreen:t,user:n}=j.useContext(dr);return(()=>{switch(e){case"landing":return O.jsx(vL,{});case"chart":return O.jsx(yV,{});case"camera":return O.jsx(R4,{});case"edit":return O.jsx(wV,{});case"userguide":return O.jsx(SV,{});default:return O.jsx(vV,{})}})()}sm.createRoot(document.getElementById("root")).render(O.jsx(Z.StrictMode,{children:O.jsx(f5,{children:O.jsx(_V,{})})})); diff --git a/assets/main-LYtRrps6.js b/assets/main-LYtRrps6.js deleted file mode 100644 index c40efed..0000000 --- a/assets/main-LYtRrps6.js +++ /dev/null @@ -1,1847 +0,0 @@ -var Ig=e=>{throw TypeError(e)};var SO=(e,t,n)=>t.has(e)||Ig("Cannot "+n);var kg=(e,t,n)=>t.has(e)?Ig("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var Pg=(e,t,n)=>(SO(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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 Hh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ur(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function F0(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var U0={exports:{}},Tc={},$0={exports:{}},De={};/** - * @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 $a=Symbol.for("react.element"),EO=Symbol.for("react.portal"),OO=Symbol.for("react.fragment"),TO=Symbol.for("react.strict_mode"),CO=Symbol.for("react.profiler"),IO=Symbol.for("react.provider"),kO=Symbol.for("react.context"),PO=Symbol.for("react.forward_ref"),xO=Symbol.for("react.suspense"),AO=Symbol.for("react.memo"),RO=Symbol.for("react.lazy"),xg=Symbol.iterator;function NO(e){return e===null||typeof e!="object"?null:(e=xg&&e[xg]||e["@@iterator"],typeof e=="function"?e:null)}var V0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B0=Object.assign,z0={};function ls(e,t,n){this.props=e,this.context=t,this.refs=z0,this.updater=n||V0}ls.prototype.isReactComponent={};ls.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ls.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function W0(){}W0.prototype=ls.prototype;function Gh(e,t,n){this.props=e,this.context=t,this.refs=z0,this.updater=n||V0}var qh=Gh.prototype=new W0;qh.constructor=Gh;B0(qh,ls.prototype);qh.isPureReactComponent=!0;var Ag=Array.isArray,H0=Object.prototype.hasOwnProperty,Kh={current:null},G0={key:!0,ref:!0,__self:!0,__source:!0};function q0(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)H0.call(t,r)&&!G0.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,be=W[we];if(0>>1;wei($e,oe))jei(We,$e)?(W[we]=We,W[je]=oe,we=je):(W[we]=$e,W[Ge]=oe,we=Ge);else if(jei(We,oe))W[we]=We,W[je]=oe,we=je;else break e}}return Z}function i(W,Z){var oe=W.sortIndex-Z.sortIndex;return oe!==0?oe:W.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var u=[],c=[],f=1,d=null,p=3,v=!1,m=!1,w=!1,I=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,y=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(W){for(var Z=n(c);Z!==null;){if(Z.callback===null)r(c);else if(Z.startTime<=W)r(c),Z.sortIndex=Z.expirationTime,t(u,Z);else break;Z=n(c)}}function x(W){if(w=!1,S(W),!m)if(n(u)!==null)m=!0,te(M);else{var Z=n(c);Z!==null&&$(x,Z.startTime-W)}}function M(W,Z){m=!1,w&&(w=!1,O(b),b=-1),v=!0;var oe=p;try{for(S(Z),d=n(u);d!==null&&(!(d.expirationTime>Z)||W&&!L());){var we=d.callback;if(typeof we=="function"){d.callback=null,p=d.priorityLevel;var be=we(d.expirationTime<=Z);Z=e.unstable_now(),typeof be=="function"?d.callback=be:d===n(u)&&r(u),S(Z)}else r(u);d=n(u)}if(d!==null)var Te=!0;else{var Ge=n(c);Ge!==null&&$(x,Ge.startTime-Z),Te=!1}return Te}finally{d=null,p=oe,v=!1}}var U=!1,E=null,b=-1,T=5,k=-1;function L(){return!(e.unstable_now()-kW||125we?(W.sortIndex=oe,t(c,W),n(u)===null&&W===n(c)&&(w?(O(b),b=-1):w=!0,$(x,oe-we))):(W.sortIndex=be,t(u,W),m||v||(m=!0,te(M))),W},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(W){var Z=p;return function(){var oe=p;p=Z;try{return W.apply(this,arguments)}finally{p=oe}}}})(X0);J0.exports=X0;var WO=J0.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 HO=K,pn=WO;function ee(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_d=Object.prototype.hasOwnProperty,GO=/^[: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]*$/,Ng={},Dg={};function qO(e){return _d.call(Dg,e)?!0:_d.call(Ng,e)?!1:GO.test(e)?Dg[e]=!0:(Ng[e]=!0,!1)}function KO(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function YO(e,t,n,r){if(t===null||typeof t>"u"||KO(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Yt(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Tt[e]=new Yt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Tt[t]=new Yt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Tt[e]=new Yt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Tt[e]=new Yt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Tt[e]=new Yt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Tt[e]=new Yt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Tt[e]=new Yt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Tt[e]=new Yt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Tt[e]=new Yt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qh=/[\-:]([a-z])/g;function Jh(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Qh,Jh);Tt[t]=new Yt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qh,Jh);Tt[t]=new Yt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qh,Jh);Tt[t]=new Yt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Tt[e]=new Yt(e,1,!1,e.toLowerCase(),null,!1,!1)});Tt.xlinkHref=new Yt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Tt[e]=new Yt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xh(e,t,n,r){var i=Tt.hasOwnProperty(t)?Tt[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var u=` -`+i[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=s);break}}}finally{xf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qs(e):""}function QO(e){switch(e.tag){case 5:return qs(e.type);case 16:return qs("Lazy");case 13:return qs("Suspense");case 19:return qs("SuspenseList");case 0:case 2:case 15:return e=Af(e.type,!1),e;case 11:return e=Af(e.type.render,!1),e;case 1:return e=Af(e.type,!0),e;default:return""}}function Td(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case po:return"Fragment";case ho:return"Portal";case Sd:return"Profiler";case Zh:return"StrictMode";case Ed:return"Suspense";case Od:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case tw:return(e.displayName||"Context")+".Consumer";case ew:return(e._context.displayName||"Context")+".Provider";case ep:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case tp:return t=e.displayName||null,t!==null?t:Td(e.type)||"Memo";case Br:t=e._payload,e=e._init;try{return Td(e(t))}catch{}}return null}function JO(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Td(t);case 8:return t===Zh?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function pi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function rw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function XO(e){var t=rw(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cl(e){e._valueTracker||(e._valueTracker=XO(e))}function iw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=rw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ou(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Cd(e,t){var n=t.checked;return st({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Lg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=pi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ow(e,t){t=t.checked,t!=null&&Xh(e,"checked",t,!1)}function Id(e,t){ow(e,t);var n=pi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?kd(e,t.type,n):t.hasOwnProperty("defaultValue")&&kd(e,t.type,pi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jg(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function kd(e,t,n){(t!=="number"||Ou(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ks=Array.isArray;function ko(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Il.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ma(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xs={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},ZO=["Webkit","ms","Moz","O"];Object.keys(Xs).forEach(function(e){ZO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xs[t]=Xs[e]})});function uw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xs.hasOwnProperty(e)&&Xs[e]?(""+t).trim():t+"px"}function cw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=uw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var eT=st({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 Ad(e,t){if(t){if(eT[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function Rd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Nd=null;function np(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dd=null,Po=null,xo=null;function $g(e){if(e=za(e)){if(typeof Dd!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=xc(t),Dd(e.stateNode,e.type,t))}}function fw(e){Po?xo?xo.push(e):xo=[e]:Po=e}function dw(){if(Po){var e=Po,t=xo;if(xo=Po=null,$g(e),t)for(e=0;e>>=0,e===0?32:31-(fT(e)/dT|0)|0}var kl=64,Pl=4194304;function Ys(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ku(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Ys(s):(o&=a,o!==0&&(r=Ys(o)))}else a=n&~i,a!==0?r=Ys(a):o!==0&&(r=Ys(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Va(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Un(t),e[t]=n}function gT(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ea),Yg=" ",Qg=!1;function Rw(e,t){switch(e){case"keyup":return WT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mo=!1;function GT(e,t){switch(e){case"compositionend":return Nw(t);case"keypress":return t.which!==32?null:(Qg=!0,Yg);case"textInput":return e=t.data,e===Yg&&Qg?null:e;default:return null}}function qT(e,t){if(mo)return e==="compositionend"||!cp&&Rw(e,t)?(e=xw(),ru=ap=Jr=null,mo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ev(n)}}function jw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fw(){for(var e=window,t=Ou();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ou(e.document)}return t}function fp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function nC(e){var t=Fw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&jw(n.ownerDocument.documentElement,n)){if(r!==null&&fp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=tv(n,o);var a=tv(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,go=null,$d=null,na=null,Vd=!1;function nv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vd||go==null||go!==Ou(r)||(r=go,"selectionStart"in r&&fp(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}),na&&_a(na,r)||(na=r,r=Au($d,"onSelect"),0wo||(e.current=qd[wo],qd[wo]=null,wo--)}function Ye(e,t){wo++,qd[wo]=e.current,e.current=t}var mi={},Ut=yi(mi),nn=yi(!1),Wi=mi;function $o(e,t){var n=e.type.contextTypes;if(!n)return mi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function rn(e){return e=e.childContextTypes,e!=null}function Nu(){et(nn),et(Ut)}function uv(e,t,n){if(Ut.current!==mi)throw Error(ee(168));Ye(Ut,t),Ye(nn,n)}function qw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ee(108,JO(e)||"Unknown",i));return st({},n,r)}function Du(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mi,Wi=Ut.current,Ye(Ut,e),Ye(nn,nn.current),!0}function cv(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=qw(e,t,Wi),r.__reactInternalMemoizedMergedChildContext=e,et(nn),et(Ut),Ye(Ut,e)):et(nn),Ye(nn,n)}var yr=null,Ac=!1,Hf=!1;function Kw(e){yr===null?yr=[e]:yr.push(e)}function pC(e){Ac=!0,Kw(e)}function wi(){if(!Hf&&yr!==null){Hf=!0;var e=0,t=He;try{var n=yr;for(He=1;e>=a,i-=a,br=1<<32-Un(t)+i|n<b?(T=E,E=null):T=E.sibling;var k=p(O,E,S[b],x);if(k===null){E===null&&(E=T);break}e&&E&&k.alternate===null&&t(O,E),y=o(k,y,b),U===null?M=k:U.sibling=k,U=k,E=T}if(b===S.length)return n(O,E),nt&&Ci(O,b),M;if(E===null){for(;bb?(T=E,E=null):T=E.sibling;var L=p(O,E,k.value,x);if(L===null){E===null&&(E=T);break}e&&E&&L.alternate===null&&t(O,E),y=o(L,y,b),U===null?M=L:U.sibling=L,U=L,E=T}if(k.done)return n(O,E),nt&&Ci(O,b),M;if(E===null){for(;!k.done;b++,k=S.next())k=d(O,k.value,x),k!==null&&(y=o(k,y,b),U===null?M=k:U.sibling=k,U=k);return nt&&Ci(O,b),M}for(E=r(O,E);!k.done;b++,k=S.next())k=v(E,O,b,k.value,x),k!==null&&(e&&k.alternate!==null&&E.delete(k.key===null?b:k.key),y=o(k,y,b),U===null?M=k:U.sibling=k,U=k);return e&&E.forEach(function(N){return t(O,N)}),nt&&Ci(O,b),M}function I(O,y,S,x){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 Tl:e:{for(var M=S.key,U=y;U!==null;){if(U.key===M){if(M=S.type,M===po){if(U.tag===7){n(O,U.sibling),y=i(U,S.props.children),y.return=O,O=y;break e}}else if(U.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Br&&hv(M)===U.type){n(O,U.sibling),y=i(U,S.props),y.ref=js(O,U,S),y.return=O,O=y;break e}n(O,U);break}else t(O,U);U=U.sibling}S.type===po?(y=Fi(S.props.children,O.mode,x,S.key),y.return=O,O=y):(x=fu(S.type,S.key,S.props,null,O.mode,x),x.ref=js(O,y,S),x.return=O,O=x)}return a(O);case ho:e:{for(U=S.key;y!==null;){if(y.key===U)if(y.tag===4&&y.stateNode.containerInfo===S.containerInfo&&y.stateNode.implementation===S.implementation){n(O,y.sibling),y=i(y,S.children||[]),y.return=O,O=y;break e}else{n(O,y);break}else t(O,y);y=y.sibling}y=Zf(S,O.mode,x),y.return=O,O=y}return a(O);case Br:return U=S._init,I(O,y,U(S._payload),x)}if(Ks(S))return m(O,y,S,x);if(Rs(S))return w(O,y,S,x);Ll(O,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,y!==null&&y.tag===6?(n(O,y.sibling),y=i(y,S),y.return=O,O=y):(n(O,y),y=Xf(S,O.mode,x),y.return=O,O=y),a(O)):n(O,y)}return I}var Bo=Xw(!0),Zw=Xw(!1),ju=yi(null),Fu=null,So=null,mp=null;function gp(){mp=So=Fu=null}function vp(e){var t=ju.current;et(ju),e._currentValue=t}function Qd(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ro(e,t){Fu=e,mp=So=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xt=!0),e.firstContext=null)}function Tn(e){var t=e._currentValue;if(mp!==e)if(e={context:e,memoizedValue:t,next:null},So===null){if(Fu===null)throw Error(ee(308));So=e,Fu.dependencies={lanes:0,firstContext:e}}else So=So.next=e;return t}var Ai=null;function yp(e){Ai===null?Ai=[e]:Ai.push(e)}function e1(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,yp(t)):(n.next=i.next,i.next=n),t.interleaved=n,Pr(e,r)}function Pr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var zr=!1;function wp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function t1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Cr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Pr(e,n)}return i=r.interleaved,i===null?(t.next=t,yp(r)):(t.next=i.next,i.next=t),r.interleaved=t,Pr(e,n)}function ou(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ip(e,n)}}function pv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Uu(e,t,n,r){var i=e.updateQueue;zr=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var u=s,c=u.next;u.next=null,a===null?o=c:a.next=c,a=u;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==a&&(s===null?f.firstBaseUpdate=c:s.next=c,f.lastBaseUpdate=u))}if(o!==null){var d=i.baseState;a=0,f=c=u=null,s=o;do{var p=s.lane,v=s.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:v,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var m=e,w=s;switch(p=t,v=n,w.tag){case 1:if(m=w.payload,typeof m=="function"){d=m.call(v,d,p);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=w.payload,p=typeof m=="function"?m.call(v,d,p):m,p==null)break e;d=st({},d,p);break e;case 2:zr=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else v={eventTime:v,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(c=f=v,u=d):f=f.next=v,a|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(u=d),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);qi|=a,e.lanes=a,e.memoizedState=d}}function mv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=qf.transition;qf.transition={};try{e(!1),t()}finally{He=n,qf.transition=r}}function y1(){return Cn().memoizedState}function yC(e,t,n){var r=li(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},w1(e))b1(t,n);else if(n=e1(e,t,n,r),n!==null){var i=qt();$n(n,e,r,i),_1(n,t,r)}}function wC(e,t,n){var r=li(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(w1(e))b1(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Wn(s,a)){var u=t.interleaved;u===null?(i.next=i,yp(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=e1(e,t,i,r),n!==null&&(i=qt(),$n(n,e,r,i),_1(n,t,r))}}function w1(e){var t=e.alternate;return e===ot||t!==null&&t===ot}function b1(e,t){ra=Vu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ip(e,n)}}var Bu={readContext:Tn,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useInsertionEffect:Pt,useLayoutEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useMutableSource:Pt,useSyncExternalStore:Pt,useId:Pt,unstable_isNewReconciler:!1},bC={readContext:Tn,useCallback:function(e,t){return Qn().memoizedState=[e,t===void 0?null:t],e},useContext:Tn,useEffect:vv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,au(4194308,4,h1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return au(4194308,4,e,t)},useInsertionEffect:function(e,t){return au(4,2,e,t)},useMemo:function(e,t){var n=Qn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Qn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yC.bind(null,ot,e),[r.memoizedState,e]},useRef:function(e){var t=Qn();return e={current:e},t.memoizedState=e},useState:gv,useDebugValue:Ip,useDeferredValue:function(e){return Qn().memoizedState=e},useTransition:function(){var e=gv(!1),t=e[0];return e=vC.bind(null,e[1]),Qn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ot,i=Qn();if(nt){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),bt===null)throw Error(ee(349));Gi&30||o1(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,vv(a1.bind(null,r,o,e),[e]),r.flags|=2048,Pa(9,s1.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Qn(),t=bt.identifierPrefix;if(nt){var n=_r,r=br;n=(r&~(1<<32-Un(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ia++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Zn]=t,e[Oa]=r,A1(e,t,!1,!1),t.stateNode=e;e:{switch(a=Rd(n,r),n){case"dialog":Xe("cancel",e),Xe("close",e),i=r;break;case"iframe":case"object":case"embed":Xe("load",e),i=r;break;case"video":case"audio":for(i=0;iHo&&(t.flags|=128,r=!0,Fs(o,!1),t.lanes=4194304)}else{if(!r)if(e=$u(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!nt)return xt(t),null}else 2*ct()-o.renderingStartTime>Ho&&n!==1073741824&&(t.flags|=128,r=!0,Fs(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ct(),t.sibling=null,n=it.current,Ye(it,r?n&1|2:n&1),t):(xt(t),null);case 22:case 23:return Np(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?cn&1073741824&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function kC(e,t){switch(hp(t),t.tag){case 1:return rn(t.type)&&Nu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zo(),et(nn),et(Ut),Sp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _p(t),null;case 13:if(et(it),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));Vo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return et(it),null;case 4:return zo(),null;case 10:return vp(t.type._context),null;case 22:case 23:return Np(),null;case 24:return null;default:return null}}var Fl=!1,Mt=!1,PC=typeof WeakSet=="function"?WeakSet:Set,me=null;function Eo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){at(e,t,r)}else n.current=null}function oh(e,t,n){try{n()}catch(r){at(e,t,r)}}var kv=!1;function xC(e,t){if(Bd=Pu,e=Fw(),fp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,u=-1,c=0,f=0,d=e,p=null;t:for(;;){for(var v;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(u=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(v=d.firstChild)!==null;)p=d,d=v;for(;;){if(d===e)break t;if(p===n&&++c===i&&(s=a),p===o&&++f===r&&(u=a),(v=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=v}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},Pu=!1,me=t;me!==null;)if(t=me,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,me=e;else for(;me!==null;){t=me;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var w=m.memoizedProps,I=m.memoizedState,O=t.stateNode,y=O.getSnapshotBeforeUpdate(t.elementType===t.type?w:Rn(t.type,w),I);O.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var S=t.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(ee(163))}}catch(x){at(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,me=e;break}me=t.return}return m=kv,kv=!1,m}function ia(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&oh(t,n,o)}i=i.next}while(i!==r)}}function Dc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function sh(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function D1(e){var t=e.alternate;t!==null&&(e.alternate=null,D1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zn],delete t[Oa],delete t[Gd],delete t[dC],delete t[hC])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function M1(e){return e.tag===5||e.tag===3||e.tag===4}function Pv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||M1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ah(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ru));else if(r!==4&&(e=e.child,e!==null))for(ah(e,t,n),e=e.sibling;e!==null;)ah(e,t,n),e=e.sibling}function lh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(lh(e,t,n),e=e.sibling;e!==null;)lh(e,t,n),e=e.sibling}var Et=null,Dn=!1;function Fr(e,t,n){for(n=n.child;n!==null;)L1(e,t,n),n=n.sibling}function L1(e,t,n){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(Cc,n)}catch{}switch(n.tag){case 5:Mt||Eo(n,t);case 6:var r=Et,i=Dn;Et=null,Fr(e,t,n),Et=r,Dn=i,Et!==null&&(Dn?(e=Et,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Et.removeChild(n.stateNode));break;case 18:Et!==null&&(Dn?(e=Et,n=n.stateNode,e.nodeType===8?Wf(e.parentNode,n):e.nodeType===1&&Wf(e,n),wa(e)):Wf(Et,n.stateNode));break;case 4:r=Et,i=Dn,Et=n.stateNode.containerInfo,Dn=!0,Fr(e,t,n),Et=r,Dn=i;break;case 0:case 11:case 14:case 15:if(!Mt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&oh(n,t,a),i=i.next}while(i!==r)}Fr(e,t,n);break;case 1:if(!Mt&&(Eo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){at(n,t,s)}Fr(e,t,n);break;case 21:Fr(e,t,n);break;case 22:n.mode&1?(Mt=(r=Mt)||n.memoizedState!==null,Fr(e,t,n),Mt=r):Fr(e,t,n);break;default:Fr(e,t,n)}}function xv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new PC),t.forEach(function(r){var i=UC.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function An(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=ct()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*RC(r/1960))-r,10e?16:e,Xr===null)var r=!1;else{if(e=Xr,Xr=null,Hu=0,Fe&6)throw Error(ee(331));var i=Fe;for(Fe|=4,me=e.current;me!==null;){var o=me,a=o.child;if(me.flags&16){var s=o.deletions;if(s!==null){for(var u=0;uct()-Ap?ji(e,0):xp|=n),on(e,t)}function W1(e,t){t===0&&(e.mode&1?(t=Pl,Pl<<=1,!(Pl&130023424)&&(Pl=4194304)):t=1);var n=qt();e=Pr(e,t),e!==null&&(Va(e,t,n),on(e,n))}function FC(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),W1(e,n)}function UC(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ee(314))}r!==null&&r.delete(t),W1(e,n)}var H1;H1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nn.current)Xt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xt=!1,CC(e,t,n);Xt=!!(e.flags&131072)}else Xt=!1,nt&&t.flags&1048576&&Yw(t,Lu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;lu(e,t),e=t.pendingProps;var i=$o(t,Ut.current);Ro(t,n),i=Op(null,t,r,e,i,n);var o=Tp();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rn(r)?(o=!0,Du(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,wp(t),i.updater=Nc,t.stateNode=i,i._reactInternals=t,Xd(t,r,e,n),t=th(null,t,r,!0,o,n)):(t.tag=0,nt&&o&&dp(t),zt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(lu(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=VC(r),e=Rn(r,e),i){case 0:t=eh(null,t,r,e,n);break e;case 1:t=Tv(null,t,r,e,n);break e;case 11:t=Ev(null,t,r,e,n);break e;case 14:t=Ov(null,t,r,Rn(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rn(r,i),eh(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rn(r,i),Tv(e,t,r,i,n);case 3:e:{if(k1(t),e===null)throw Error(ee(387));r=t.pendingProps,o=t.memoizedState,i=o.element,t1(e,t),Uu(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Wo(Error(ee(423)),t),t=Cv(e,t,r,n,i);break e}else if(r!==i){i=Wo(Error(ee(424)),t),t=Cv(e,t,r,n,i);break e}else for(fn=oi(t.stateNode.containerInfo.firstChild),hn=t,nt=!0,Mn=null,n=Zw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vo(),r===i){t=xr(e,t,n);break e}zt(e,t,r,n)}t=t.child}return t;case 5:return n1(t),e===null&&Yd(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,Wd(r,i)?a=null:o!==null&&Wd(r,o)&&(t.flags|=32),I1(e,t),zt(e,t,a,n),t.child;case 6:return e===null&&Yd(t),null;case 13:return P1(e,t,n);case 4:return bp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Bo(t,null,r,n):zt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rn(r,i),Ev(e,t,r,i,n);case 7:return zt(e,t,t.pendingProps,n),t.child;case 8:return zt(e,t,t.pendingProps.children,n),t.child;case 12:return zt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,Ye(ju,r._currentValue),r._currentValue=a,o!==null)if(Wn(o.value,a)){if(o.children===i.children&&!nn.current){t=xr(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=Cr(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Qd(o.return,n,t),s.lanes|=n;break}u=u.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(ee(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Qd(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}zt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Ro(t,n),i=Tn(i),r=r(i),t.flags|=1,zt(e,t,r,n),t.child;case 14:return r=t.type,i=Rn(r,t.pendingProps),i=Rn(r.type,i),Ov(e,t,r,i,n);case 15:return T1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rn(r,i),lu(e,t),t.tag=1,rn(r)?(e=!0,Du(t)):e=!1,Ro(t,n),S1(t,r,i),Xd(t,r,i,n),th(null,t,r,!0,e,n);case 19:return x1(e,t,n);case 22:return C1(e,t,n)}throw Error(ee(156,t.tag))};function G1(e,t){return ww(e,t)}function $C(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sn(e,t,n,r){return new $C(e,t,n,r)}function Mp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function VC(e){if(typeof e=="function")return Mp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ep)return 11;if(e===tp)return 14}return 2}function ui(e,t){var n=e.alternate;return n===null?(n=Sn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function fu(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")Mp(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case po:return Fi(n.children,i,o,t);case Zh:a=8,i|=8;break;case Sd:return e=Sn(12,n,t,i|2),e.elementType=Sd,e.lanes=o,e;case Ed:return e=Sn(13,n,t,i),e.elementType=Ed,e.lanes=o,e;case Od:return e=Sn(19,n,t,i),e.elementType=Od,e.lanes=o,e;case nw:return Lc(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ew:a=10;break e;case tw:a=9;break e;case ep:a=11;break e;case tp:a=14;break e;case Br:a=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=Sn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Fi(e,t,n,r){return e=Sn(7,e,r,t),e.lanes=n,e}function Lc(e,t,n,r){return e=Sn(22,e,r,t),e.elementType=nw,e.lanes=n,e.stateNode={isHidden:!1},e}function Xf(e,t,n){return e=Sn(6,e,null,t),e.lanes=n,e}function Zf(e,t,n){return t=Sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function BC(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nf(0),this.expirationTimes=Nf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Lp(e,t,n,r,i,o,a,s,u){return e=new BC(e,t,n,s,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Sn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wp(o),e}function zC(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Q1)}catch(e){console.error(e)}}Q1(),Q0.exports=mn;var Ui=Q0.exports;const du=ur(Ui);var Fv=Ui;bd.createRoot=Fv.createRoot,bd.hydrateRoot=Fv.hydrateRoot;var Ha=e=>e.type==="checkbox",To=e=>e instanceof Date,Wt=e=>e==null;const J1=e=>typeof e=="object";var vt=e=>!Wt(e)&&!Array.isArray(e)&&J1(e)&&!To(e),X1=e=>vt(e)&&e.target?Ha(e.target)?e.target.checked:e.target.value:e,KC=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Z1=(e,t)=>e.has(KC(t)),YC=e=>{const t=e.constructor&&e.constructor.prototype;return vt(t)&&t.hasOwnProperty("isPrototypeOf")},$p=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qt(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!($p&&(e instanceof Blob||e instanceof FileList))&&(n||vt(e)))if(t=n?[]:{},!n&&!YC(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Qt(e[r]));else return e;return t}var Vc=e=>Array.isArray(e)?e.filter(Boolean):[],lt=e=>e===void 0,fe=(e,t,n)=>{if(!t||!vt(e))return n;const r=Vc(t.split(/[,[\].]+?/)).reduce((i,o)=>Wt(i)?i:i[o],e);return lt(r)||r===e?lt(e[t])?n:e[t]:r},er=e=>typeof e=="boolean",Vp=e=>/^\w*$/.test(e),eb=e=>Vc(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ke=(e,t,n)=>{let r=-1;const i=Vp(t)?[t]:eb(t),o=i.length,a=o-1;for(;++rJ.useContext(QC);var tb=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==jn.all&&(t._proxyFormState[a]=!r||jn.all),n&&(n[a]=!0),e[a]}});return i},un=e=>vt(e)&&!Object.keys(e).length,nb=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return un(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||jn.all))},aa=e=>Array.isArray(e)?e:[e],rb=(e,t,n)=>!e||!t||e===t||aa(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function zp(e){const t=J.useRef(e);t.current=e,J.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function JC(e){const t=Bp(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[a,s]=J.useState(n._formState),u=J.useRef(!0),c=J.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=J.useRef(i);return f.current=i,zp({disabled:r,next:d=>u.current&&rb(f.current,d.name,o)&&nb(d,c.current,n._updateFormState)&&s({...n._formState,...d}),subject:n._subjects.state}),J.useEffect(()=>(u.current=!0,c.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),tb(a,n,c.current,!1)}var nr=e=>typeof e=="string",ib=(e,t,n,r,i)=>nr(e)?(r&&t.watch.add(e),fe(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),fe(n,o))):(r&&(t.watchAll=!0),n);function XC(e){const t=Bp(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a}=e||{},s=J.useRef(r);s.current=r,zp({disabled:o,subject:n._subjects.values,next:f=>{rb(s.current,f.name,a)&&c(Qt(ib(s.current,n._names,f.values||n._formValues,!1,i)))}});const[u,c]=J.useState(n._getWatch(r,i));return J.useEffect(()=>n._removeUnmounted()),u}function ZC(e){const t=Bp(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o}=e,a=Z1(i._names.array,n),s=XC({control:i,name:n,defaultValue:fe(i._formValues,n,fe(i._defaultValues,n,e.defaultValue)),exact:!0}),u=JC({control:i,name:n}),c=J.useRef(i.register(n,{...e.rules,value:s,...er(e.disabled)?{disabled:e.disabled}:{}}));return J.useEffect(()=>{const f=i._options.shouldUnregister||o,d=(p,v)=>{const m=fe(i._fields,p);m&&m._f&&(m._f.mount=v)};if(d(n,!0),f){const p=Qt(fe(i._options.defaultValues,n));Ke(i._defaultValues,n,p),lt(fe(i._formValues,n))&&Ke(i._formValues,n,p)}return()=>{(a?f&&!i._state.action:f)?i.unregister(n):d(n,!1)}},[n,i,a,o]),J.useEffect(()=>{fe(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:fe(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:s,...er(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:J.useCallback(f=>c.current.onChange({target:{value:X1(f),name:n},type:Ku.CHANGE}),[n]),onBlur:J.useCallback(()=>c.current.onBlur({target:{value:fe(i._formValues,n),name:n},type:Ku.BLUR}),[n,i]),ref:f=>{const d=fe(i._fields,n);d&&f&&(d._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:p=>f.setCustomValidity(p),reportValidity:()=>f.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!fe(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!fe(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!fe(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!fe(u.validatingFields,n)},error:{enumerable:!0,get:()=>fe(u.errors,n)}})}}const Zr=e=>e.render(ZC(e));var eI=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Uv=e=>({isOnSubmit:!e||e===jn.onSubmit,isOnBlur:e===jn.onBlur,isOnChange:e===jn.onChange,isOnAll:e===jn.all,isOnTouch:e===jn.onTouched}),$v=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const la=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=fe(e,i);if(o){const{_f:a,...s}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)break;if(a.ref&&t(a.ref,a.name)&&!r)break;la(s,t)}else vt(s)&&la(s,t)}}};var tI=(e,t,n)=>{const r=aa(fe(e,n));return Ke(r,"root",t[n]),Ke(e,n,r),e},Wp=e=>e.type==="file",ei=e=>typeof e=="function",Yu=e=>{if(!$p)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},hu=e=>nr(e),Hp=e=>e.type==="radio",Qu=e=>e instanceof RegExp;const Vv={value:!1,isValid:!1},Bv={value:!0,isValid:!0};var ob=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!lt(e[0].attributes.value)?lt(e[0].value)||e[0].value===""?Bv:{value:e[0].value,isValid:!0}:Bv:Vv}return Vv};const zv={isValid:!1,value:null};var sb=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,zv):zv;function Wv(e,t,n="validate"){if(hu(e)||Array.isArray(e)&&e.every(hu)||er(e)&&!e)return{type:n,message:hu(e)?e:"",ref:t}}var uo=e=>vt(e)&&!Qu(e)?e:{value:e,message:""},Hv=async(e,t,n,r,i)=>{const{ref:o,refs:a,required:s,maxLength:u,minLength:c,min:f,max:d,pattern:p,validate:v,name:m,valueAsNumber:w,mount:I,disabled:O}=e._f,y=fe(t,m);if(!I||O)return{};const S=a?a[0]:o,x=N=>{r&&S.reportValidity&&(S.setCustomValidity(er(N)?"":N||""),S.reportValidity())},M={},U=Hp(o),E=Ha(o),b=U||E,T=(w||Wp(o))&<(o.value)&<(y)||Yu(o)&&o.value===""||y===""||Array.isArray(y)&&!y.length,k=eI.bind(null,m,n,M),L=(N,C,ie,q=hr.maxLength,te=hr.minLength)=>{const $=N?C:ie;M[m]={type:N?q:te,message:$,ref:o,...k(N?q:te,$)}};if(i?!Array.isArray(y)||!y.length:s&&(!b&&(T||Wt(y))||er(y)&&!y||E&&!ob(a).isValid||U&&!sb(a).isValid)){const{value:N,message:C}=hu(s)?{value:!!s,message:s}:uo(s);if(N&&(M[m]={type:hr.required,message:C,ref:S,...k(hr.required,C)},!n))return x(C),M}if(!T&&(!Wt(f)||!Wt(d))){let N,C;const ie=uo(d),q=uo(f);if(!Wt(y)&&!isNaN(y)){const te=o.valueAsNumber||y&&+y;Wt(ie.value)||(N=te>ie.value),Wt(q.value)||(C=tenew Date(new Date().toDateString()+" "+oe),W=o.type=="time",Z=o.type=="week";nr(ie.value)&&y&&(N=W?$(y)>$(ie.value):Z?y>ie.value:te>new Date(ie.value)),nr(q.value)&&y&&(C=W?$(y)<$(q.value):Z?y+N.value,q=!Wt(C.value)&&y.length<+C.value;if((ie||q)&&(L(ie,N.message,C.message),!n))return x(M[m].message),M}if(p&&!T&&nr(y)){const{value:N,message:C}=uo(p);if(Qu(N)&&!y.match(N)&&(M[m]={type:hr.pattern,message:C,ref:o,...k(hr.pattern,C)},!n))return x(C),M}if(v){if(ei(v)){const N=await v(y,t),C=Wv(N,S);if(C&&(M[m]={...C,...k(hr.validate,C.message)},!n))return x(C.message),M}else if(vt(v)){let N={};for(const C in v){if(!un(N)&&!n)break;const ie=Wv(await v[C](y,t),S,C);ie&&(N={...ie,...k(C,ie.message)},x(ie.message),n&&(M[m]=N))}if(!un(N)&&(M[m]={ref:S,...N},!n))return M}}return x(!0),M};function nI(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},Ju=e=>Wt(e)||!J1(e);function Ni(e,t){if(Ju(e)||Ju(t))return e===t;if(To(e)&&To(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const a=t[i];if(To(o)&&To(a)||vt(o)&&vt(a)||Array.isArray(o)&&Array.isArray(a)?!Ni(o,a):o!==a)return!1}}return!0}var ab=e=>e.type==="select-multiple",iI=e=>Hp(e)||Ha(e),td=e=>Yu(e)&&e.isConnected,lb=e=>{for(const t in e)if(ei(e[t]))return!0;return!1};function Xu(e,t={}){const n=Array.isArray(e);if(vt(e)||n)for(const r in e)Array.isArray(e[r])||vt(e[r])&&!lb(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Xu(e[r],t[r])):Wt(e[r])||(t[r]=!0);return t}function ub(e,t,n){const r=Array.isArray(e);if(vt(e)||r)for(const i in e)Array.isArray(e[i])||vt(e[i])&&!lb(e[i])?lt(t)||Ju(n[i])?n[i]=Array.isArray(e[i])?Xu(e[i],[]):{...Xu(e[i])}:ub(e[i],Wt(t)?{}:t[i],n[i]):n[i]=!Ni(e[i],t[i]);return n}var Vl=(e,t)=>ub(e,t,Xu(t)),cb=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>lt(e)?e:t?e===""?NaN:e&&+e:n&&nr(e)?new Date(e):r?r(e):e;function nd(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Wp(t)?t.files:Hp(t)?sb(e.refs).value:ab(t)?[...t.selectedOptions].map(({value:n})=>n):Ha(t)?ob(e.refs).value:cb(lt(t.value)?e.ref.value:t.value,e)}var oI=(e,t,n,r)=>{const i={};for(const o of e){const a=fe(t,o);a&&Ke(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},$s=e=>lt(e)?e:Qu(e)?e.source:vt(e)?Qu(e.value)?e.value.source:e.value:e,sI=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Gv(e,t,n){const r=fe(e,n);if(r||Vp(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=fe(t,o),s=fe(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(s&&s.type)return{name:o,error:s};i.pop()}return{name:n}}var aI=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,lI=(e,t)=>!Vc(fe(e,t)).length&&pt(e,t);const uI={mode:jn.onSubmit,reValidateMode:jn.onChange,shouldFocusError:!0};function cI(e={}){let t={...uI,...e},n={submitCount:0,isDirty:!1,isLoading:ei(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=vt(t.defaultValues)||vt(t.values)?Qt(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Qt(i),a={action:!1,mount:!1,watch:!1},s={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:ed(),array:ed(),state:ed()},p=Uv(t.mode),v=Uv(t.reValidateMode),m=t.criteriaMode===jn.all,w=A=>V=>{clearTimeout(c),c=setTimeout(A,V)},I=async A=>{if(f.isValid||A){const V=t.resolver?un((await b()).errors):await k(r,!0);V!==n.isValid&&d.state.next({isValid:V})}},O=(A,V)=>{(f.isValidating||f.validatingFields)&&((A||Array.from(s.mount)).forEach(z=>{z&&(V?Ke(n.validatingFields,z,V):pt(n.validatingFields,z))}),d.state.next({validatingFields:n.validatingFields,isValidating:!un(n.validatingFields)}))},y=(A,V=[],z,se,X=!0,Q=!0)=>{if(se&&z){if(a.action=!0,Q&&Array.isArray(fe(r,A))){const he=z(fe(r,A),se.argA,se.argB);X&&Ke(r,A,he)}if(Q&&Array.isArray(fe(n.errors,A))){const he=z(fe(n.errors,A),se.argA,se.argB);X&&Ke(n.errors,A,he),lI(n.errors,A)}if(f.touchedFields&&Q&&Array.isArray(fe(n.touchedFields,A))){const he=z(fe(n.touchedFields,A),se.argA,se.argB);X&&Ke(n.touchedFields,A,he)}f.dirtyFields&&(n.dirtyFields=Vl(i,o)),d.state.next({name:A,isDirty:N(A,V),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ke(o,A,V)},S=(A,V)=>{Ke(n.errors,A,V),d.state.next({errors:n.errors})},x=A=>{n.errors=A,d.state.next({errors:n.errors,isValid:!1})},M=(A,V,z,se)=>{const X=fe(r,A);if(X){const Q=fe(o,A,lt(z)?fe(i,A):z);lt(Q)||se&&se.defaultChecked||V?Ke(o,A,V?Q:nd(X._f)):q(A,Q),a.mount&&I()}},U=(A,V,z,se,X)=>{let Q=!1,he=!1;const ae={name:A},de=!!(fe(r,A)&&fe(r,A)._f&&fe(r,A)._f.disabled);if(!z||se){f.isDirty&&(he=n.isDirty,n.isDirty=ae.isDirty=N(),Q=he!==ae.isDirty);const ce=de||Ni(fe(i,A),V);he=!!(!de&&fe(n.dirtyFields,A)),ce||de?pt(n.dirtyFields,A):Ke(n.dirtyFields,A,!0),ae.dirtyFields=n.dirtyFields,Q=Q||f.dirtyFields&&he!==!ce}if(z){const ce=fe(n.touchedFields,A);ce||(Ke(n.touchedFields,A,z),ae.touchedFields=n.touchedFields,Q=Q||f.touchedFields&&ce!==z)}return Q&&X&&d.state.next(ae),Q?ae:{}},E=(A,V,z,se)=>{const X=fe(n.errors,A),Q=f.isValid&&er(V)&&n.isValid!==V;if(e.delayError&&z?(u=w(()=>S(A,z)),u(e.delayError)):(clearTimeout(c),u=null,z?Ke(n.errors,A,z):pt(n.errors,A)),(z?!Ni(X,z):X)||!un(se)||Q){const he={...se,...Q&&er(V)?{isValid:V}:{},errors:n.errors,name:A};n={...n,...he},d.state.next(he)}},b=async A=>{O(A,!0);const V=await t.resolver(o,t.context,oI(A||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return O(A),V},T=async A=>{const{errors:V}=await b(A);if(A)for(const z of A){const se=fe(V,z);se?Ke(n.errors,z,se):pt(n.errors,z)}else n.errors=V;return V},k=async(A,V,z={valid:!0})=>{for(const se in A){const X=A[se];if(X){const{_f:Q,...he}=X;if(Q){const ae=s.array.has(Q.name);O([se],!0);const de=await Hv(X,o,m,t.shouldUseNativeValidation&&!V,ae);if(O([se]),de[Q.name]&&(z.valid=!1,V))break;!V&&(fe(de,Q.name)?ae?tI(n.errors,de,Q.name):Ke(n.errors,Q.name,de[Q.name]):pt(n.errors,Q.name))}he&&await k(he,V,z)}}return z.valid},L=()=>{for(const A of s.unMount){const V=fe(r,A);V&&(V._f.refs?V._f.refs.every(z=>!td(z)):!td(V._f.ref))&&je(A)}s.unMount=new Set},N=(A,V)=>(A&&V&&Ke(o,A,V),!Ni(we(),i)),C=(A,V,z)=>ib(A,s,{...a.mount?o:lt(V)?i:nr(A)?{[A]:V}:V},z,V),ie=A=>Vc(fe(a.mount?o:i,A,e.shouldUnregister?fe(i,A,[]):[])),q=(A,V,z={})=>{const se=fe(r,A);let X=V;if(se){const Q=se._f;Q&&(!Q.disabled&&Ke(o,A,cb(V,Q)),X=Yu(Q.ref)&&Wt(V)?"":V,ab(Q.ref)?[...Q.ref.options].forEach(he=>he.selected=X.includes(he.value)):Q.refs?Ha(Q.ref)?Q.refs.length>1?Q.refs.forEach(he=>(!he.defaultChecked||!he.disabled)&&(he.checked=Array.isArray(X)?!!X.find(ae=>ae===he.value):X===he.value)):Q.refs[0]&&(Q.refs[0].checked=!!X):Q.refs.forEach(he=>he.checked=he.value===X):Wp(Q.ref)?Q.ref.value="":(Q.ref.value=X,Q.ref.type||d.values.next({name:A,values:{...o}})))}(z.shouldDirty||z.shouldTouch)&&U(A,X,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&oe(A)},te=(A,V,z)=>{for(const se in V){const X=V[se],Q=`${A}.${se}`,he=fe(r,Q);(s.array.has(A)||!Ju(X)||he&&!he._f)&&!To(X)?te(Q,X,z):q(Q,X,z)}},$=(A,V,z={})=>{const se=fe(r,A),X=s.array.has(A),Q=Qt(V);Ke(o,A,Q),X?(d.array.next({name:A,values:{...o}}),(f.isDirty||f.dirtyFields)&&z.shouldDirty&&d.state.next({name:A,dirtyFields:Vl(i,o),isDirty:N(A,Q)})):se&&!se._f&&!Wt(Q)?te(A,Q,z):q(A,Q,z),$v(A,s)&&d.state.next({...n}),d.values.next({name:a.mount?A:void 0,values:{...o}})},W=async A=>{a.mount=!0;const V=A.target;let z=V.name,se=!0;const X=fe(r,z),Q=()=>V.type?nd(X._f):X1(A),he=ae=>{se=Number.isNaN(ae)||ae===fe(o,z,ae)};if(X){let ae,de;const ce=Q(),Ae=A.type===Ku.BLUR||A.type===Ku.FOCUS_OUT,ft=!sI(X._f)&&!t.resolver&&!fe(n.errors,z)&&!X._f.deps||aI(Ae,fe(n.touchedFields,z),n.isSubmitted,v,p),rt=$v(z,s,Ae);Ke(o,z,ce),Ae?(X._f.onBlur&&X._f.onBlur(A),u&&u(0)):X._f.onChange&&X._f.onChange(A);const Ce=U(z,ce,Ae,!1),Se=!un(Ce)||rt;if(!Ae&&d.values.next({name:z,type:A.type,values:{...o}}),ft)return f.isValid&&I(),Se&&d.state.next({name:z,...rt?{}:Ce});if(!Ae&&rt&&d.state.next({...n}),t.resolver){const{errors:Ct}=await b([z]);if(he(ce),se){const Dr=Gv(n.errors,r,z),cr=Gv(Ct,r,Dr.name||z);ae=cr.error,z=cr.name,de=un(Ct)}}else O([z],!0),ae=(await Hv(X,o,m,t.shouldUseNativeValidation))[z],O([z]),he(ce),se&&(ae?de=!1:f.isValid&&(de=await k(r,!0)));se&&(X._f.deps&&oe(X._f.deps),E(z,de,ae,Ce))}},Z=(A,V)=>{if(fe(n.errors,V)&&A.focus)return A.focus(),1},oe=async(A,V={})=>{let z,se;const X=aa(A);if(t.resolver){const Q=await T(lt(A)?A:X);z=un(Q),se=A?!X.some(he=>fe(Q,he)):z}else A?(se=(await Promise.all(X.map(async Q=>{const he=fe(r,Q);return await k(he&&he._f?{[Q]:he}:he)}))).every(Boolean),!(!se&&!n.isValid)&&I()):se=z=await k(r);return d.state.next({...!nr(A)||f.isValid&&z!==n.isValid?{}:{name:A},...t.resolver||!A?{isValid:z}:{},errors:n.errors}),V.shouldFocus&&!se&&la(r,Z,A?X:s.mount),se},we=A=>{const V={...a.mount?o:i};return lt(A)?V:nr(A)?fe(V,A):A.map(z=>fe(V,z))},be=(A,V)=>({invalid:!!fe((V||n).errors,A),isDirty:!!fe((V||n).dirtyFields,A),error:fe((V||n).errors,A),isValidating:!!fe(n.validatingFields,A),isTouched:!!fe((V||n).touchedFields,A)}),Te=A=>{A&&aa(A).forEach(V=>pt(n.errors,V)),d.state.next({errors:A?n.errors:{}})},Ge=(A,V,z)=>{const se=(fe(r,A,{_f:{}})._f||{}).ref,X=fe(n.errors,A)||{},{ref:Q,message:he,type:ae,...de}=X;Ke(n.errors,A,{...de,...V,ref:se}),d.state.next({name:A,errors:n.errors,isValid:!1}),z&&z.shouldFocus&&se&&se.focus&&se.focus()},$e=(A,V)=>ei(A)?d.values.subscribe({next:z=>A(C(void 0,V),z)}):C(A,V,!0),je=(A,V={})=>{for(const z of A?aa(A):s.mount)s.mount.delete(z),s.array.delete(z),V.keepValue||(pt(r,z),pt(o,z)),!V.keepError&&pt(n.errors,z),!V.keepDirty&&pt(n.dirtyFields,z),!V.keepTouched&&pt(n.touchedFields,z),!V.keepIsValidating&&pt(n.validatingFields,z),!t.shouldUnregister&&!V.keepDefaultValue&&pt(i,z);d.values.next({values:{...o}}),d.state.next({...n,...V.keepDirty?{isDirty:N()}:{}}),!V.keepIsValid&&I()},We=({disabled:A,name:V,field:z,fields:se,value:X})=>{if(er(A)&&a.mount||A){const Q=A?void 0:lt(X)?nd(z?z._f:fe(se,V)._f):X;Ke(o,V,Q),U(V,Q,!1,!1,!0)}},P=(A,V={})=>{let z=fe(r,A);const se=er(V.disabled);return Ke(r,A,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:A}},name:A,mount:!0,...V}}),s.mount.add(A),z?We({field:z,disabled:V.disabled,name:A,value:V.value}):M(A,!0,V.value),{...se?{disabled:V.disabled}:{},...t.progressive?{required:!!V.required,min:$s(V.min),max:$s(V.max),minLength:$s(V.minLength),maxLength:$s(V.maxLength),pattern:$s(V.pattern)}:{},name:A,onChange:W,onBlur:W,ref:X=>{if(X){P(A,V),z=fe(r,A);const Q=lt(X.value)&&X.querySelectorAll&&X.querySelectorAll("input,select,textarea")[0]||X,he=iI(Q),ae=z._f.refs||[];if(he?ae.find(de=>de===Q):Q===z._f.ref)return;Ke(r,A,{_f:{...z._f,...he?{refs:[...ae.filter(td),Q,...Array.isArray(fe(i,A))?[{}]:[]],ref:{type:Q.type,name:A}}:{ref:Q}}}),M(A,!1,void 0,Q)}else z=fe(r,A,{}),z._f&&(z._f.mount=!1),(t.shouldUnregister||V.shouldUnregister)&&!(Z1(s.array,A)&&a.action)&&s.unMount.add(A)}}},D=()=>t.shouldFocusError&&la(r,Z,s.mount),F=A=>{er(A)&&(d.state.next({disabled:A}),la(r,(V,z)=>{const se=fe(r,z);se&&(V.disabled=se._f.disabled||A,Array.isArray(se._f.refs)&&se._f.refs.forEach(X=>{X.disabled=se._f.disabled||A}))},0,!1))},R=(A,V)=>async z=>{let se;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let X=Qt(o);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:Q,values:he}=await b();n.errors=Q,X=he}else await k(r);if(pt(n.errors,"root"),un(n.errors)){d.state.next({errors:{}});try{await A(X,z)}catch(Q){se=Q}}else V&&await V({...n.errors},z),D(),setTimeout(D);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:un(n.errors)&&!se,submitCount:n.submitCount+1,errors:n.errors}),se)throw se},ue=(A,V={})=>{fe(r,A)&&(lt(V.defaultValue)?$(A,Qt(fe(i,A))):($(A,V.defaultValue),Ke(i,A,Qt(V.defaultValue))),V.keepTouched||pt(n.touchedFields,A),V.keepDirty||(pt(n.dirtyFields,A),n.isDirty=V.defaultValue?N(A,Qt(fe(i,A))):N()),V.keepError||(pt(n.errors,A),f.isValid&&I()),d.state.next({...n}))},H=(A,V={})=>{const z=A?Qt(A):i,se=Qt(z),X=un(A),Q=X?i:se;if(V.keepDefaultValues||(i=z),!V.keepValues){if(V.keepDirtyValues)for(const he of s.mount)fe(n.dirtyFields,he)?Ke(Q,he,fe(o,he)):$(he,fe(Q,he));else{if($p&<(A))for(const he of s.mount){const ae=fe(r,he);if(ae&&ae._f){const de=Array.isArray(ae._f.refs)?ae._f.refs[0]:ae._f.ref;if(Yu(de)){const ce=de.closest("form");if(ce){ce.reset();break}}}}r={}}o=e.shouldUnregister?V.keepDefaultValues?Qt(i):{}:Qt(Q),d.array.next({values:{...Q}}),d.values.next({values:{...Q}})}s={mount:V.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!f.isValid||!!V.keepIsValid||!!V.keepDirtyValues,a.watch=!!e.shouldUnregister,d.state.next({submitCount:V.keepSubmitCount?n.submitCount:0,isDirty:X?!1:V.keepDirty?n.isDirty:!!(V.keepDefaultValues&&!Ni(A,i)),isSubmitted:V.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:X?{}:V.keepDirtyValues?V.keepDefaultValues&&o?Vl(i,o):n.dirtyFields:V.keepDefaultValues&&A?Vl(i,A):V.keepDirty?n.dirtyFields:{},touchedFields:V.keepTouched?n.touchedFields:{},errors:V.keepErrors?n.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},ne=(A,V)=>H(ei(A)?A(o):A,V);return{control:{register:P,unregister:je,getFieldState:be,handleSubmit:R,setError:Ge,_executeSchema:b,_getWatch:C,_getDirty:N,_updateValid:I,_removeUnmounted:L,_updateFieldArray:y,_updateDisabledField:We,_getFieldArray:ie,_reset:H,_resetDefaultValues:()=>ei(t.defaultValues)&&t.defaultValues().then(A=>{ne(A,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:A=>{n={...n,...A}},_disableForm:F,_subjects:d,_proxyFormState:f,_setErrors:x,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(A){a=A},get _defaultValues(){return i},get _names(){return s},set _names(A){s=A},get _formState(){return n},set _formState(A){n=A},get _options(){return t},set _options(A){t={...t,...A}}},trigger:oe,register:P,handleSubmit:R,watch:$e,setValue:$,getValues:we,reset:ne,resetField:ue,clearErrors:Te,unregister:je,setError:Ge,setFocus:(A,V={})=>{const z=fe(r,A),se=z&&z._f;if(se){const X=se.refs?se.refs[0]:se.ref;X.focus&&(X.focus(),V.shouldSelect&&X.select())}},getFieldState:be}}function fb(e={}){const t=J.useRef(),n=J.useRef(),[r,i]=J.useState({isDirty:!1,isValidating:!1,isLoading:ei(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ei(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...cI(e),formState:r});const o=t.current.control;return o._options=e,zp({subject:o._subjects.state,next:a=>{nb(a,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),J.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),J.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),J.useEffect(()=>{e.values&&!Ni(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(a=>({...a}))):o._resetDefaultValues()},[e.values,o]),J.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),J.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),J.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=tb(r,o),t.current}var ge={},hh={exports:{}};(function(e,t){(function(n,r){var i="1.0.38",o="",a="?",s="function",u="undefined",c="object",f="string",d="major",p="model",v="name",m="type",w="vendor",I="version",O="architecture",y="console",S="mobile",x="tablet",M="smarttv",U="wearable",E="embedded",b=500,T="Amazon",k="Apple",L="ASUS",N="BlackBerry",C="Browser",ie="Chrome",q="Edge",te="Firefox",$="Google",W="Huawei",Z="LG",oe="Microsoft",we="Motorola",be="Opera",Te="Samsung",Ge="Sharp",$e="Sony",je="Xiaomi",We="Zebra",P="Facebook",D="Chromium OS",F="Mac OS",R=function(ae,de){var ce={};for(var Ae in ae)de[Ae]&&de[Ae].length%2===0?ce[Ae]=de[Ae].concat(ae[Ae]):ce[Ae]=ae[Ae];return ce},ue=function(ae){for(var de={},ce=0;ce0?Ce.length===2?typeof Ce[1]==s?this[Ce[0]]=Ce[1].call(this,Ct):this[Ce[0]]=Ce[1]:Ce.length===3?typeof Ce[1]===s&&!(Ce[1].exec&&Ce[1].test)?this[Ce[0]]=Ct?Ce[1].call(this,Ct,Ce[2]):r:this[Ce[0]]=Ct?Ct.replace(Ce[1],Ce[2]):r:Ce.length===4&&(this[Ce[0]]=Ct?Ce[3].call(this,Ct.replace(Ce[1],Ce[2])):r):this[Ce]=Ct||r;ce+=2}},A=function(ae,de){for(var ce in de)if(typeof de[ce]===c&&de[ce].length>0){for(var Ae=0;Ae2&&(Se[p]="iPad",Se[m]=x),Se},this.getEngine=function(){var Se={};return Se[v]=r,Se[I]=r,_e.call(Se,Ae,rt.engine),Se},this.getOS=function(){var Se={};return Se[v]=r,Se[I]=r,_e.call(Se,Ae,rt.os),Ce&&!Se[v]&&ft&&ft.platform&&ft.platform!="Unknown"&&(Se[v]=ft.platform.replace(/chrome os/i,D).replace(/macos/i,F)),Se},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 Ae},this.setUA=function(Se){return Ae=typeof Se===f&&Se.length>b?Oe(Se,b):Se,this},this.setUA(Ae),this};X.VERSION=i,X.BROWSER=ue([v,I,d]),X.CPU=ue([O]),X.DEVICE=ue([p,w,m,y,S,M,x,U,E]),X.ENGINE=X.OS=ue([v,I]),e.exports&&(t=e.exports=X),t.UAParser=X;var Q=typeof n!==u&&(n.jQuery||n.Zepto);if(Q&&!Q.ua){var he=new X;Q.ua=he.getResult(),Q.ua.get=function(){return he.getUA()},Q.ua.set=function(ae){he.setUA(ae);var de=he.getResult();for(var ce in de)Q.ua[ce]=de[ce]}}})(typeof window=="object"?window:Hh)})(hh,hh.exports);var fI=hh.exports;Object.defineProperty(ge,"__esModule",{value:!0});function dI(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Ft=K,Qe=dI(Ft),db=fI,bi=new db,Vt=bi.getBrowser(),hI=bi.getCPU(),vn=bi.getDevice(),Gp=bi.getEngine(),_i=bi.getOS(),Ga=bi.getUA(),hb=function(t){return bi.setUA(t)},qa=function(t){if(!t){console.error("No userAgent string was provided");return}var n=new db(t);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)}}},pb=Object.freeze({ClientUAInstance:bi,browser:Vt,cpu:hI,device:vn,engine:Gp,os:_i,ua:Ga,setUa:hb,parseUserAgent:qa});function qv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pI(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function kn(e,t){if(e==null)return{};var n=bI(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _I(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pu(e)}function SI(e,t){return EI(e)||OI(e,t)||TI(e,t)||CI()}function EI(e){if(Array.isArray(e))return e}function OI(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function TI(e,t){if(e){if(typeof e=="string")return Kv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kv(e,t)}}function Kv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:"none";return t||n},qp=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},Kp=function(t){var n=qp();return n&&n.platform&&(n.platform.indexOf(t)!==-1||n.platform==="MacIntel"&&n.maxTouchPoints>1&&!window.MSStream)},xI=function(t,n,r,i,o){return{isBrowser:t,browserMajorVersion:Ie(n.major),browserFullVersion:Ie(n.version),browserName:Ie(n.name),engineName:Ie(r.name),engineVersion:Ie(r.version),osName:Ie(i.name),osVersion:Ie(i.version),userAgent:Ie(o)}},Yv=function(t,n,r,i){return pI({},t,{vendor:Ie(n.vendor),model:Ie(n.model),os:Ie(r.name),osVersion:Ie(r.version),ua:Ie(i)})},AI=function(t,n,r,i){return{isSmartTV:t,engineName:Ie(n.name),engineVersion:Ie(n.version),osName:Ie(r.name),osVersion:Ie(r.version),userAgent:Ie(i)}},RI=function(t,n,r,i){return{isConsole:t,engineName:Ie(n.name),engineVersion:Ie(n.version),osName:Ie(r.name),osVersion:Ie(r.version),userAgent:Ie(i)}},NI=function(t,n,r,i){return{isWearable:t,engineName:Ie(n.name),engineVersion:Ie(n.version),osName:Ie(r.name),osVersion:Ie(r.version),userAgent:Ie(i)}},DI=function(t,n,r,i,o){return{isEmbedded:t,vendor:Ie(n.vendor),model:Ie(n.model),engineName:Ie(r.name),engineVersion:Ie(r.version),osName:Ie(i.name),osVersion:Ie(i.version),userAgent:Ie(o)}};function MI(e){var t=e?qa(e):pb,n=t.device,r=t.browser,i=t.engine,o=t.os,a=t.ua,s=kI(n.type),u=s.isBrowser,c=s.isMobile,f=s.isTablet,d=s.isSmartTV,p=s.isConsole,v=s.isWearable,m=s.isEmbedded;if(u)return xI(u,r,i,o,a);if(d)return AI(d,i,o,a);if(p)return RI(p,i,o,a);if(c||f)return Yv(s,n,o,a);if(v)return NI(v,i,o,a);if(m)return DI(m,n,i,o,a)}var mb=function(t){var n=t.type;return n===Dt.Mobile},gb=function(t){var n=t.type;return n===Dt.Tablet},vb=function(t){var n=t.type;return n===Dt.Mobile||n===Dt.Tablet},yb=function(t){var n=t.type;return n===Dt.SmartTv},Zu=function(t){var n=t.type;return n===Dt.Browser},wb=function(t){var n=t.type;return n===Dt.Wearable},bb=function(t){var n=t.type;return n===Dt.Console},_b=function(t){var n=t.type;return n===Dt.Embedded},Sb=function(t){var n=t.vendor;return Ie(n)},Eb=function(t){var n=t.model;return Ie(n)},Ob=function(t){var n=t.type;return Ie(n,"browser")},Tb=function(t){var n=t.name;return n===fs.Android},Cb=function(t){var n=t.name;return n===fs.Windows},Ib=function(t){var n=t.name;return n===fs.MAC_OS},kb=function(t){var n=t.name;return n===fs.WindowsPhone},Pb=function(t){var n=t.name;return n===fs.IOS},xb=function(t){var n=t.version;return Ie(n)},Ab=function(t){var n=t.name;return Ie(n)},Rb=function(t){var n=t.name;return n===sn.Chrome},Nb=function(t){var n=t.name;return n===sn.Firefox},Db=function(t){var n=t.name;return n===sn.Chromium},ec=function(t){var n=t.name;return n===sn.Edge},Mb=function(t){var n=t.name;return n===sn.Yandex},Lb=function(t){var n=t.name;return n===sn.Safari||n===sn.MobileSafari},jb=function(t){var n=t.name;return n===sn.MobileSafari},Fb=function(t){var n=t.name;return n===sn.Opera},Ub=function(t){var n=t.name;return n===sn.InternetExplorer||n===sn.Ie},$b=function(t){var n=t.name;return n===sn.MIUI},Vb=function(t){var n=t.name;return n===sn.SamsungBrowser},Bb=function(t){var n=t.version;return Ie(n)},zb=function(t){var n=t.major;return Ie(n)},Wb=function(t){var n=t.name;return Ie(n)},Hb=function(t){var n=t.name;return Ie(n)},Gb=function(t){var n=t.version;return Ie(n)},qb=function(){var t=qp(),n=t&&t.userAgent&&t.userAgent.toLowerCase();return typeof n=="string"?/electron/.test(n):!1},Do=function(t){return typeof t=="string"&&t.indexOf("Edg/")!==-1},Kb=function(){var t=qp();return t&&(/iPad|iPhone|iPod/.test(t.platform)||t.platform==="MacIntel"&&t.maxTouchPoints>1)&&!window.MSStream},tr=function(){return Kp("iPad")},Yb=function(){return Kp("iPhone")},Qb=function(){return Kp("iPod")},Jb=function(t){return Ie(t)};function Xb(e){var t=e||pb,n=t.device,r=t.browser,i=t.os,o=t.engine,a=t.ua;return{isSmartTV:yb(n),isConsole:bb(n),isWearable:wb(n),isEmbedded:_b(n),isMobileSafari:jb(r)||tr(),isChromium:Db(r),isMobile:vb(n)||tr(),isMobileOnly:mb(n),isTablet:gb(n)||tr(),isBrowser:Zu(n),isDesktop:Zu(n),isAndroid:Tb(i),isWinPhone:kb(i),isIOS:Pb(i)||tr(),isChrome:Rb(r),isFirefox:Nb(r),isSafari:Lb(r),isOpera:Fb(r),isIE:Ub(r),osVersion:xb(i),osName:Ab(i),fullBrowserVersion:Bb(r),browserVersion:zb(r),browserName:Wb(r),mobileVendor:Sb(n),mobileModel:Eb(n),engineName:Hb(o),engineVersion:Gb(o),getUA:Jb(a),isEdge:ec(r)||Do(a),isYandex:Mb(r),deviceType:Ob(n),isIOS13:Kb(),isIPad13:tr(),isIPhone13:Yb(),isIPod13:Qb(),isElectron:qb(),isEdgeChromium:Do(a),isLegacyEdge:ec(r)&&!Do(a),isWindows:Cb(i),isMacOs:Ib(i),isMIUI:$b(r),isSamsungBrowser:Vb(r)}}var Zb=yb(vn),e_=bb(vn),t_=wb(vn),LI=_b(vn),jI=jb(Vt)||tr(),FI=Db(Vt),Bc=vb(vn)||tr(),n_=mb(vn),r_=gb(vn)||tr(),i_=Zu(vn),UI=Zu(vn),o_=Tb(_i),s_=kb(_i),a_=Pb(_i)||tr(),$I=Rb(Vt),VI=Nb(Vt),BI=Lb(Vt),zI=Fb(Vt),l_=Ub(Vt),WI=xb(_i),HI=Ab(_i),GI=Bb(Vt),qI=zb(Vt),KI=Wb(Vt),YI=Sb(vn),QI=Eb(vn),JI=Hb(Gp),XI=Gb(Gp),ZI=Jb(Ga),ek=ec(Vt)||Do(Ga),tk=Mb(Vt),nk=Ob(vn),rk=Kb(),ik=tr(),ok=Yb(),sk=Qb(),ak=qb(),lk=Do(Ga),uk=ec(Vt)&&!Do(Ga),ck=Cb(_i),fk=Ib(_i),dk=$b(Vt),hk=Vb(Vt),pk=function(t){if(!t||typeof t!="string"){console.error("No valid user agent string was provided");return}var n=qa(t),r=n.device,i=n.browser,o=n.os,a=n.engine,s=n.ua;return Xb({device:r,browser:i,os:o,engine:a,ua:s})},mk=function(t){var n=t.renderWithFragment,r=t.children,i=kn(t,["renderWithFragment","children"]);return o_?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},gk=function(t){var n=t.renderWithFragment,r=t.children,i=kn(t,["renderWithFragment","children"]);return i_?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},vk=function(t){var n=t.renderWithFragment,r=t.children,i=kn(t,["renderWithFragment","children"]);return l_?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},yk=function(t){var n=t.renderWithFragment,r=t.children,i=kn(t,["renderWithFragment","children"]);return a_?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},wk=function(t){var n=t.renderWithFragment,r=t.children,i=kn(t,["renderWithFragment","children"]);return Bc?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},bk=function(t){var n=t.renderWithFragment,r=t.children,i=kn(t,["renderWithFragment","children"]);return r_?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},_k=function(t){var n=t.renderWithFragment,r=t.children,i=kn(t,["renderWithFragment","children"]);return s_?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},Sk=function(t){var n=t.renderWithFragment,r=t.children;t.viewClassName,t.style;var i=kn(t,["renderWithFragment","children","viewClassName","style"]);return n_?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},Ek=function(t){var n=t.renderWithFragment,r=t.children,i=kn(t,["renderWithFragment","children"]);return Zb?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},Ok=function(t){var n=t.renderWithFragment,r=t.children,i=kn(t,["renderWithFragment","children"]);return e_?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},Tk=function(t){var n=t.renderWithFragment,r=t.children,i=kn(t,["renderWithFragment","children"]);return t_?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",i,r):null},Ck=function(t){var n=t.renderWithFragment,r=t.children;t.viewClassName,t.style;var i=t.condition,o=kn(t,["renderWithFragment","children","viewClassName","style","condition"]);return i?n?Qe.createElement(Ft.Fragment,null,r):Qe.createElement("div",o,r):null};function Ik(e){return function(t){wI(n,t);function n(r){var i;return mI(this,n),i=_I(this,mh(n).call(this,r)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(pu(i)),i.onOrientationChange=i.onOrientationChange.bind(pu(i)),i.onPageLoad=i.onPageLoad.bind(pu(i)),i.state={isLandscape:!1,isPortrait:!1},i}return vI(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":ua(window))!==void 0&&Bc&&(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 Qe.createElement(e,ph({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),n}(Qe.Component)}function kk(){var e=Ft.useState(function(){var o=window.innerWidth>window.innerHeight?90:0;return{isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"}}),t=SI(e,2),n=t[0],r=t[1],i=Ft.useCallback(function(){var o=window.innerWidth>window.innerHeight?90:0,a={isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"};n.orientation!==a.orientation&&r(a)},[n.orientation]);return Ft.useEffect(function(){return(typeof window>"u"?"undefined":ua(window))!==void 0&&Bc&&(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 u_(e){var t=e||window.navigator.userAgent;return qa(t)}function Pk(e){var t=e||window.navigator.userAgent,n=u_(t),r=Xb(n);return[r,n]}ge.AndroidView=mk;ge.BrowserTypes=sn;ge.BrowserView=gk;ge.ConsoleView=Ok;ge.CustomView=Ck;ge.IEView=vk;ge.IOSView=yk;ge.MobileOnlyView=Sk;ge.MobileView=wk;ge.OsTypes=fs;ge.SmartTVView=Ek;ge.TabletView=bk;ge.WearableView=Tk;ge.WinPhoneView=_k;ge.browserName=KI;ge.browserVersion=qI;ge.deviceDetect=MI;ge.deviceType=nk;ge.engineName=JI;ge.engineVersion=XI;ge.fullBrowserVersion=GI;ge.getSelectorsByUserAgent=pk;ge.getUA=ZI;ge.isAndroid=o_;ge.isBrowser=i_;ge.isChrome=$I;ge.isChromium=FI;ge.isConsole=e_;var xk=ge.isDesktop=UI;ge.isEdge=ek;ge.isEdgeChromium=lk;ge.isElectron=ak;ge.isEmbedded=LI;ge.isFirefox=VI;ge.isIE=l_;ge.isIOS=a_;ge.isIOS13=rk;ge.isIPad13=ik;ge.isIPhone13=ok;ge.isIPod13=sk;ge.isLegacyEdge=uk;ge.isMIUI=dk;ge.isMacOs=fk;ge.isMobile=Bc;ge.isMobileOnly=n_;ge.isMobileSafari=jI;ge.isOpera=zI;ge.isSafari=BI;ge.isSamsungBrowser=hk;ge.isSmartTV=Zb;ge.isTablet=r_;ge.isWearable=t_;ge.isWinPhone=s_;ge.isWindows=ck;ge.isYandex=tk;ge.mobileModel=QI;ge.mobileVendor=YI;ge.osName=HI;ge.osVersion=WI;ge.parseUserAgent=qa;ge.setUserAgent=PI;ge.useDeviceData=u_;ge.useDeviceSelectors=Pk;ge.useMobileOrientation=kk;ge.withOrientationChange=Ik;var St=[];for(var rd=0;rd<256;++rd)St.push((rd+256).toString(16).slice(1));function Ak(e,t=0){return(St[e[t+0]]+St[e[t+1]]+St[e[t+2]]+St[e[t+3]]+"-"+St[e[t+4]]+St[e[t+5]]+"-"+St[e[t+6]]+St[e[t+7]]+"-"+St[e[t+8]]+St[e[t+9]]+"-"+St[e[t+10]]+St[e[t+11]]+St[e[t+12]]+St[e[t+13]]+St[e[t+14]]+St[e[t+15]]).toLowerCase()}var Bl,Rk=new Uint8Array(16);function Nk(){if(!Bl&&(Bl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bl(Rk)}var Dk=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Qv={randomUUID:Dk};function Mk(e,t,n){if(Qv.randomUUID&&!t&&!e)return Qv.randomUUID();e=e||{};var r=e.random||(e.rng||Nk)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ak(r)}var Oc,c_;const jm=class jm{constructor(t={}){kg(this,Oc);if(typeof t=="string")try{t=JSON.parse(t)}catch(n){console.error("Invalid JSON string provided:",n),t={}}else t instanceof jm?Object.assign(this,t):(this.transactionId=t.transaction_id||Pg(this,Oc,c_).call(this),this.createdAt=t.created_at||null,this.amount=t.amount||null,this.vendor=t.vendor||null,this.category_id=t.category_id||null,this.category_name=t.category_name||null,this.pictureId=t.pictureId||null,this.isSuccessful=t.isSuccessful||null)}isEmpty(){return this.vendor===null&&this.amount===null&&this.createdAt===null&&this.category_id===null&&this.category_name===null}isNotComplete(){return this.vendor===null||this.amount===null||this.createdAt===null||this.category_id===null||this.category_name===null}serialize(){return{transactionId:this.transactionId,transaction_id:this.transactionId,created_at:this.createdAt,amount:this.amount,vendor:this.vendor,category_id:this.category_id,category_name:this.category_name,pictureId:this.pictureId,isSuccessful:this.isSuccessful}}toString(){return JSON.stringify(this.serialize())}};Oc=new WeakSet,c_=function(){return Mk()};let Zt=jm,vh=class{constructor(t){t instanceof Zt?(this.vendor=t.vendor,this.amount=t.amount,this.category_name=t.category_name,this.created_at=t.created_at):(this.vendor="",this.created_at="",this.amount="",this.category_name="")}returnNonEmptyValues(){return Object.entries(this).filter((t,n)=>t[n]!==null&&t[n]!==void 0)}};class Go{constructor(t){t instanceof Object?(this.category_id=t.category_id,this.category_name=t.category_name):t instanceof Go?Object.assign(this,t):(this.category_name=t,this.category_id="")}serialize(){return{category_id:this.category_id,category_name:this.category_name}}toString(){return JSON.stringify(this.serialize())}}var Jv={VITE_KEY_FOR_FIREBASE_CONFIG:'{"apiKey": "AIzaSyCgzs_JIlAI5CE5EAOO8eQVJbqSI9YHNC4","authDomain": "simplitracapp.firebaseapp.com","databaseURL": "https://simplitracapp-default-rtdb.firebaseio.com","projectId": "simplitracapp","storageBucket": "simplitracapp.appspot.com","messagingSenderId": "242165323563","appId": "1:242165323563:web:5891ef2a45c8cf0183576e","measurementId": "G-3HSNQSS692"}',VITE_PROD_CREATE_USER_ENDPOINT:"https://us-central1-simplitracapp.cloudfunctions.net/create_new_user",VITE_DEV_CREATE_USER_ENDPOINT:"http://127.0.0.1:5001/simplitracapp/us-central1/create_new_user",VITE_PROD_GET_USER_ENDPOINT:"https://us-central1-simplitracapp.cloudfunctions.net/get_existing_user",VITE_DEV_GET_USER_ENDPOINT:"http://127.0.0.1:5001/simplitracapp/us-central1/get_existing_user",VITE_PROD_UPDATE_USER_ENDPOINT:"https://us-central1-simplitracapp.cloudfunctions.net/update_user",VITE_DEV_UPDATE_USER_ENDPOINT:"http://127.0.0.1:5001/simplitracapp/us-central1/update_user",VITE_PROD_OCR_ENDPOINT:"https://us-central1-simplitracapp.cloudfunctions.net/process_receipt",VITE_DEV_OCR_ENDPOINT:"http://127.0.0.1:5001/simplitracapp/us-central1/process_receipt",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let Ht=class $r{constructor(t={}){var n,r,i,o;t instanceof $r?Object.assign(this,t):(this.user_id=(t==null?void 0:t.uid)??(t==null?void 0:t.user_id),this.access_token=t==null?void 0:t.accessToken,this.email=t==null?void 0:t.email,t!=null&&t.displayName?(this.first_name=t==null?void 0:t.displayName.split(" ")[0],this.last_name=t==null?void 0:t.displayName.split(" ").slice(1).join(" ")):(this.first_name=t==null?void 0:t.first_name,this.last_name=t==null?void 0:t.last_name),this.created_at=((n=t==null?void 0:t.metadata)==null?void 0:n.createdAt)||new Date().getTime(),this.last_login=((r=t==null?void 0:t.metadata)==null?void 0:r.lastLoginAt)||new Date().getTime(),this.admin=null,this.transactions=((i=t==null?void 0:t.transactions)==null?void 0:i.map(a=>new Zt(a)))||[],this.categories=((o=t==null?void 0:t.categories)==null?void 0:o.map(a=>new Go(a)))||[])}getCreatedAtString(){return new Date(this.created_at).toString()}getLastLoginString(){return new Date(this.last_login).toString()}isNewUser(){var t,n;return((t=this.categories)==null?void 0:t.length)===0||((n=this.categories)==null?void 0:n.length)===void 0}serialize(){return{user_id:this.user_id,access_token:this.access_token,email:this.email,first_name:this.first_name,last_name:this.last_name,created_at:this.created_at,last_login:this.last_login,admin:this.admin,transactions:this.transactions.map(t=>t.serialize()),categories:this.categories.map(t=>t.serialize())}}addCategory(t){this.categories.push(new Go(t))}toString(){return JSON.stringify(this.serialize())}addTransaction(t){t instanceof Zt?this.transactions.push(t):console.error("Invalid transaction provided:",t)}returnCategoryList(){return[...new Set(["Select category",...this.categories.map(t=>Xv(t.category_name))])]}returnVendorList(){return[...new Set(["Select vendor",...this.transactions.map(t=>Xv(t.vendor))])]}async updateFirebase(){const t={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(this.serialize())},n=`https://us-central1-simplitracapp.cloudfunctions.net/update_user/?user_id=${this.user_id}`,r=await fetch(n,t);let i;return i=await r.text(),new $r(JSON.parse(i))}async deleteTransactions(){const t={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(this.serialize())},n=`${Jv.VITE_PROD_DELETE_TRANSACTIONS_ENDPOINT}/?user_id=${this.user_id}`,r=await fetch(n,t);let i;return i=await r.text(),new $r(JSON.parse(i))}async deleteCategory(t){try{const n=await fetch(`${Jv.VITE_PROD_DELETE_CATEGORY_ENDPOINT}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:this.user_id,categoryId:t})});if(!n.ok)throw new Error("Failed to delete category");const r=await n.json();return new $r(r)}catch(n){return console.error("Error deleting category:",n),null}}static async getUserFromFirestore(t){const n={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}},r=`https://us-central1-simplitracapp.cloudfunctions.net/get_existing_user?user_id=${t}`;try{const o=await(await fetch(r,n)).json();return o instanceof Object?new $r(o):new $r}catch(i){return console.log(i),new $r}}};function Xv(e){if(!e)return;const t=e.toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}const Pn=K.createContext({}),Lk=({children:e})=>{const t=()=>xk?"desktop":"mobile",[n,r]=K.useState(),[i,o]=K.useState(new Ht(JSON.parse(localStorage.getItem("user")))),[a,s]=K.useState(!0),[u,c]=K.useState(!1),[f,d]=K.useState(null),[p,v]=K.useState(new Zt),[m,w]=K.useState(t()),[I,O]=K.useState(),[y,S]=K.useState(!1),[x,M]=K.useState(new vh),[U,E]=K.useState(!1),b=async()=>{const L="http://127.0.0.1:5001/simplitracapp/us-central1/get_existing_user";try{const N=await fetch(L);if(!N.ok)throw new Error("Network response issue exists");const C=await N.json();o(C)}catch(N){console.error("Error fetching user data:",N)}},T=()=>{r("login"),o({first_name:"",last_name:"",categories:[]}),s(!0),c(!1),d(null),v(new Zt),w(t()),O(),S(!1),M(new vh),E(!1)};K.useEffect(()=>{b()},[]);const k={screen:n,setScreen:r,user:i,setUser:o,modalIsOpen:a,setModalIsOpen:s,show:u,setShow:c,capturedPhoto:f,setCapturedPhoto:d,ocrData:p,setOcrData:v,device:m,setDevice:w,serverResponse:I,setServerResponse:O,ocrModalOpen:y,setOcrModalOpen:S,fetchUserData:b,formData:x,setFormData:M,resetAppState:T,isUpdating:U,setIsUpdating:E};return j.jsx(Pn.Provider,{value:k,children:e})};var en=function(){return en=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0?wt(ds,--In):0,Ko--,dt===10&&(Ko=1,Wc--),dt}function Vn(){return dt=In2||wh(dt)>3?"":" "}function Gk(e,t){for(;--t&&Vn()&&!(dt<48||dt>102||dt>57&&dt<65||dt>70&&dt<97););return Gc(e,gu()+(t<6&&$i()==32&&Vn()==32))}function bh(e){for(;Vn();)switch(dt){case e:return In;case 34:case 39:e!==34&&e!==39&&bh(dt);break;case 40:e===41&&bh(e);break;case 92:Vn();break}return In}function qk(e,t){for(;Vn()&&e+dt!==57;)if(e+dt===84&&$i()===47)break;return"/*"+Gc(t,In-1)+"*"+Qp(e===47?e:Vn())}function Kk(e){for(;!wh($i());)Vn();return Gc(e,In)}function Yk(e){return Wk(vu("",null,null,null,[""],e=zk(e),0,[0],e))}function vu(e,t,n,r,i,o,a,s,u){for(var c=0,f=0,d=a,p=0,v=0,m=0,w=1,I=1,O=1,y=0,S="",x=i,M=o,U=r,E=S;I;)switch(m=y,y=Vn()){case 40:if(m!=108&&wt(E,d-1)==58){mu(E+=Re(id(y),"&","&\f"),"&\f",h_(c?s[c-1]:0))!=-1&&(O=-1);break}case 34:case 39:case 91:E+=id(y);break;case 9:case 10:case 13:case 32:E+=Hk(m);break;case 92:E+=Gk(gu()-1,7);continue;case 47:switch($i()){case 42:case 47:Js(Qk(qk(Vn(),gu()),t,n,u),u);break;default:E+="/"}break;case 123*w:s[c++]=Jn(E)*O;case 125*w:case 59:case 0:switch(y){case 0:case 125:I=0;case 59+f:O==-1&&(E=Re(E,/\f/g,"")),v>0&&Jn(E)-d&&Js(v>32?ty(E+";",r,n,d-1,u):ty(Re(E," ","")+";",r,n,d-2,u),u);break;case 59:E+=";";default:if(Js(U=ey(E,t,n,c,f,i,s,S,x=[],M=[],d,o),o),y===123)if(f===0)vu(E,t,U,U,x,o,d,s,M);else switch(p===99&&wt(E,3)===110?100:p){case 100:case 108:case 109:case 115:vu(e,U,U,r&&Js(ey(e,U,U,0,0,i,s,S,i,x=[],d,M),M),i,M,d,s,r?x:M);break;default:vu(E,U,U,U,[""],M,0,s,M)}}c=f=v=0,w=O=1,S=E="",d=a;break;case 58:d=1+Jn(E),v=m;default:if(w<1){if(y==123)--w;else if(y==125&&w++==0&&Bk()==125)continue}switch(E+=Qp(y),y*w){case 38:O=f>0?1:(E+="\f",-1);break;case 44:s[c++]=(Jn(E)-1)*O,O=1;break;case 64:$i()===45&&(E+=id(Vn())),p=$i(),f=d=Jn(S=E+=Kk(gu())),y++;break;case 45:m===45&&Jn(E)==2&&(w=0)}}return o}function ey(e,t,n,r,i,o,a,s,u,c,f,d){for(var p=i-1,v=i===0?o:[""],m=m_(v),w=0,I=0,O=0;w0?v[y]+" "+S:Re(S,/&\f/g,v[y])))&&(u[O++]=x);return Hc(e,t,n,i===0?zc:s,u,c,f,d)}function Qk(e,t,n,r){return Hc(e,t,n,f_,Qp(Vk()),qo(e,2,-2),0,r)}function ty(e,t,n,r,i){return Hc(e,t,n,Yp,qo(e,0,r),qo(e,r+1,-1),r,i)}function v_(e,t,n){switch(Uk(e,t)){case 5103:return Ve+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ve+e+e;case 4789:return ca+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ve+e+ca+e+Ze+e+e;case 5936:switch(wt(e,t+11)){case 114:return Ve+e+Ze+Re(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ve+e+Ze+Re(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ve+e+Ze+Re(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Ve+e+Ze+e+e;case 6165:return Ve+e+Ze+"flex-"+e+e;case 5187:return Ve+e+Re(e,/(\w+).+(:[^]+)/,Ve+"box-$1$2"+Ze+"flex-$1$2")+e;case 5443:return Ve+e+Ze+"flex-item-"+Re(e,/flex-|-self/g,"")+(vr(e,/flex-|baseline/)?"":Ze+"grid-row-"+Re(e,/flex-|-self/g,""))+e;case 4675:return Ve+e+Ze+"flex-line-pack"+Re(e,/align-content|flex-|-self/g,"")+e;case 5548:return Ve+e+Ze+Re(e,"shrink","negative")+e;case 5292:return Ve+e+Ze+Re(e,"basis","preferred-size")+e;case 6060:return Ve+"box-"+Re(e,"-grow","")+Ve+e+Ze+Re(e,"grow","positive")+e;case 4554:return Ve+Re(e,/([^-])(transform)/g,"$1"+Ve+"$2")+e;case 6187:return Re(Re(Re(e,/(zoom-|grab)/,Ve+"$1"),/(image-set)/,Ve+"$1"),e,"")+e;case 5495:case 3959:return Re(e,/(image-set\([^]*)/,Ve+"$1$`$1");case 4968:return Re(Re(e,/(.+:)(flex-)?(.*)/,Ve+"box-pack:$3"+Ze+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ve+e+e;case 4200:if(!vr(e,/flex-|baseline/))return Ze+"grid-column-align"+qo(e,t)+e;break;case 2592:case 3360:return Ze+Re(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,vr(r.props,/grid-\w+-end/)})?~mu(e+(n=n[t].value),"span",0)?e:Ze+Re(e,"-start","")+e+Ze+"grid-row-span:"+(~mu(n,"span",0)?vr(n,/\d+/):+vr(n,/\d+/)-+vr(e,/\d+/))+";":Ze+Re(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return vr(r.props,/grid-\w+-start/)})?e:Ze+Re(Re(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Re(e,/(.+)-inline(.+)/,Ve+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Jn(e)-1-t>6)switch(wt(e,t+1)){case 109:if(wt(e,t+4)!==45)break;case 102:return Re(e,/(.+:)(.+)-([^]+)/,"$1"+Ve+"$2-$3$1"+ca+(wt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~mu(e,"stretch",0)?v_(Re(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Re(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,c){return Ze+i+":"+o+c+(a?Ze+i+"-span:"+(s?u:+u-+o)+c:"")+e});case 4949:if(wt(e,t+6)===121)return Re(e,":",":"+Ve)+e;break;case 6444:switch(wt(e,wt(e,14)===45?18:11)){case 120:return Re(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ve+(wt(e,14)===45?"inline-":"")+"box$3$1"+Ve+"$2$3$1"+Ze+"$2box$3")+e;case 100:return Re(e,":",":"+Ze)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Re(e,"scroll-","scroll-snap-")+e}return e}function nc(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case Yp:e.return=v_(e.value,e.length,n);return;case d_:return nc([Vr(e,{value:Re(e.value,"@","@"+Ve)})],r);case zc:if(e.length)return $k(n=e.props,function(i){switch(vr(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":co(Vr(e,{props:[Re(i,/:(read-\w+)/,":"+ca+"$1")]})),co(Vr(e,{props:[i]})),yh(e,{props:Zv(n,r)});break;case"::placeholder":co(Vr(e,{props:[Re(i,/:(plac\w+)/,":"+Ve+"input-$1")]})),co(Vr(e,{props:[Re(i,/:(plac\w+)/,":"+ca+"$1")]})),co(Vr(e,{props:[Re(i,/:(plac\w+)/,Ze+"input-$1")]})),co(Vr(e,{props:[i]})),yh(e,{props:Zv(n,r)});break}return""})}}var tP={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ln={},Yo=typeof process<"u"&&ln!==void 0&&(ln.REACT_APP_SC_ATTR||ln.SC_ATTR)||"data-styled",y_="active",w_="data-styled-version",qc="6.1.12",Jp=`/*!sc*/ -`,rc=typeof window<"u"&&"HTMLElement"in window,nP=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&ln!==void 0&&ln.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&ln.REACT_APP_SC_DISABLE_SPEEDY!==""?ln.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&ln.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&ln!==void 0&&ln.SC_DISABLE_SPEEDY!==void 0&&ln.SC_DISABLE_SPEEDY!==""&&ln.SC_DISABLE_SPEEDY!=="false"&&ln.SC_DISABLE_SPEEDY),Kc=Object.freeze([]),Qo=Object.freeze({});function rP(e,t,n){return n===void 0&&(n=Qo),e.theme!==n.theme&&e.theme||t||n.theme}var b_=new Set(["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","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","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),iP=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,oP=/(^-|-$)/g;function ny(e){return e.replace(iP,"-").replace(oP,"")}var sP=/(a)(d)/gi,zl=52,ry=function(e){return String.fromCharCode(e+(e>25?39:97))};function _h(e){var t,n="";for(t=Math.abs(e);t>zl;t=t/zl|0)n=ry(t%zl)+n;return(ry(t%zl)+n).replace(sP,"$1-$2")}var od,__=5381,Co=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},S_=function(e){return Co(__,e)};function aP(e){return _h(S_(e)>>>0)}function lP(e){return e.displayName||e.name||"Component"}function sd(e){return typeof e=="string"&&!0}var E_=typeof Symbol=="function"&&Symbol.for,O_=E_?Symbol.for("react.memo"):60115,uP=E_?Symbol.for("react.forward_ref"):60112,cP={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},fP={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},T_={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},dP=((od={})[uP]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},od[O_]=T_,od);function iy(e){return("type"in(t=e)&&t.type.$$typeof)===O_?T_:"$$typeof"in e?dP[e.$$typeof]:cP;var t}var hP=Object.defineProperty,pP=Object.getOwnPropertyNames,oy=Object.getOwnPropertySymbols,mP=Object.getOwnPropertyDescriptor,gP=Object.getPrototypeOf,sy=Object.prototype;function C_(e,t,n){if(typeof t!="string"){if(sy){var r=gP(t);r&&r!==sy&&C_(e,r,n)}var i=pP(t);oy&&(i=i.concat(oy(t)));for(var o=iy(e),a=iy(t),s=0;s0?" Args: ".concat(t.join(", ")):""))}var vP=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw Ka(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=i;a=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,a=i;a=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(I+="".concat(O,","))}),u+="".concat(m).concat(w,'{content:"').concat(I,'"}').concat(Jp)},f=0;f0?".".concat(t):p},f=u.slice();f.push(function(p){p.type===zc&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(kP,n).replace(r,c))}),a.prefix&&f.push(eP),f.push(Jk);var d=function(p,v,m,w){v===void 0&&(v=""),m===void 0&&(m=""),w===void 0&&(w="&"),t=w,n=v,r=new RegExp("\\".concat(n,"\\b"),"g");var I=p.replace(PP,""),O=Yk(m||v?"".concat(m," ").concat(v," { ").concat(I," }"):I);a.namespace&&(O=P_(O,a.namespace));var y=[];return nc(O,Xk(f.concat(Zk(function(S){return y.push(S)})))),y};return d.hash=u.length?u.reduce(function(p,v){return v.name||Ka(15),Co(p,v.name)},__).toString():"",d}var AP=new k_,Eh=xP(),x_=J.createContext({shouldForwardProp:void 0,styleSheet:AP,stylis:Eh});x_.Consumer;J.createContext(void 0);function cy(){return K.useContext(x_)}var RP=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=Eh);var a=r.name+o.hash;i.hasNameForId(r.id,a)||i.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,Zp(this,function(){throw Ka(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Eh),this.name+t.hash},e}(),NP=function(e){return e>="A"&&e<="Z"};function fy(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,a)){var s=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,s)}i=Di(i,a),this.staticRulesId=a}else{for(var u=Co(this.baseHash,r.hash),c="",f=0;f>>0);n.hasNameForId(this.componentId,v)||n.insertRules(this.componentId,v,r(c,".".concat(v),void 0,this.componentId)),i=Di(i,v)}}return i},e}(),N_=J.createContext(void 0);N_.Consumer;var ad={};function jP(e,t,n){var r=Xp(e),i=e,o=!sd(e),a=t.attrs,s=a===void 0?Kc:a,u=t.componentId,c=u===void 0?function(x,M){var U=typeof x!="string"?"sc":ny(x);ad[U]=(ad[U]||0)+1;var E="".concat(U,"-").concat(aP(qc+U+ad[U]));return M?"".concat(M,"-").concat(E):E}(t.displayName,t.parentComponentId):u,f=t.displayName,d=f===void 0?function(x){return sd(x)?"styled.".concat(x):"Styled(".concat(lP(x),")")}(e):f,p=t.displayName&&t.componentId?"".concat(ny(t.displayName),"-").concat(t.componentId):t.componentId||c,v=r&&i.attrs?i.attrs.concat(s).filter(Boolean):s,m=t.shouldForwardProp;if(r&&i.shouldForwardProp){var w=i.shouldForwardProp;if(t.shouldForwardProp){var I=t.shouldForwardProp;m=function(x,M){return w(x,M)&&I(x,M)}}else m=w}var O=new LP(n,p,r?i.componentStyle:void 0);function y(x,M){return function(U,E,b){var T=U.attrs,k=U.componentStyle,L=U.defaultProps,N=U.foldedComponentIds,C=U.styledComponentId,ie=U.target,q=J.useContext(N_),te=cy(),$=U.shouldForwardProp||te.shouldForwardProp,W=rP(E,q,L)||Qo,Z=function($e,je,We){for(var P,D=en(en({},je),{className:void 0,theme:We}),F=0;F<$e.length;F+=1){var R=Jo(P=$e[F])?P(D):P;for(var ue in R)D[ue]=ue==="className"?Di(D[ue],R[ue]):ue==="style"?en(en({},D[ue]),R[ue]):R[ue]}return je.className&&(D.className=Di(D.className,je.className)),D}(T,E,W),oe=Z.as||ie,we={};for(var be in Z)Z[be]===void 0||be[0]==="$"||be==="as"||be==="theme"&&Z.theme===W||(be==="forwardedAs"?we.as=Z.forwardedAs:$&&!$(be,oe)||(we[be]=Z[be]));var Te=function($e,je){var We=cy(),P=$e.generateAndInjectStyles(je,We.styleSheet,We.stylis);return P}(k,Z),Ge=Di(N,C);return Te&&(Ge+=" "+Te),Z.className&&(Ge+=" "+Z.className),we[sd(oe)&&!b_.has(oe)?"class":"className"]=Ge,we.ref=b,K.createElement(oe,we)}(S,x,M)}y.displayName=d;var S=J.forwardRef(y);return S.attrs=v,S.componentStyle=O,S.displayName=d,S.shouldForwardProp=m,S.foldedComponentIds=r?Di(i.foldedComponentIds,i.styledComponentId):"",S.styledComponentId=p,S.target=r?i.target:e,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(x){this._foldedDefaultProps=r?function(M){for(var U=[],E=1;Ej.jsx(UP,{children:j.jsxs("div",{children:[j.jsx(VP,{}),j.jsx($P,{children:e})]})}),BP=()=>{const{user:e,formData:t,setFormData:n,setUser:r,ocrData:i,setOcrData:o,setServerResponse:a,isUpdating:s,setIsUpdating:u}=K.useContext(Pn),[c,f]=K.useState([]),[d,p]=K.useState([]),[v,m]=K.useState(""),[w,I]=K.useState("");K.useState("");const O=K.useRef(""),y=K.useRef(""),{control:S,handleSubmit:x,setValue:M,watch:U,reset:E,formState:{errors:b}}=fb({defaultValues:{vendor:"Select Vendor",category:"Select Category",date:new Date().toISOString().split("T")[0],amount:""}}),T=q=>{if(!q)return;const te=q.toLowerCase();return te.charAt(0).toUpperCase()+te.slice(1)},k=()=>{if(e.transactions.length!==0){const q=new Set(["Select vendor",...e.returnVendorList()]);f([...q])}else f(["Select Vendor"])},L=()=>{if(e.categories.length!==0){const q=new Set(["Select Category",...e.categories.map(te=>T(te.category_name))]);p([...q])}else p(["Select Category"])},N=q=>{const te=q.target.value,$=new Zt(i);$.vendor=te,o($),f(W=>[...new Set([...W,te])]),m(""),M("vendor",te)},C=q=>{if(q.target.value!==""){const te=q.target.value,$=new Zt(i);$.category_name=te,o($),p(W=>[...new Set([...W,te])]),I(""),M("category",te)}};K.useEffect(()=>{if(i.isEmpty()&&(k(),L()),!t)return;const q=t.returnNonEmptyValues();let te,$=!0;if(q.length){for(const W of q){const Z=W[0],oe=W[1];switch(Z){case"vendor":f([...e.returnVendorList(),oe]),O.current=T(oe),M(Z,oe),te=!1;break;case"category":e.addCategory(oe),p([...e.returnCategoryList()]),y.current=T(oe),M(Z,oe),$=!1;break;default:M(Z,oe);break}}n(),te&&k(),$&&L()}},[O.current,y.current,e,t]);const ie=async q=>{if(u(!0),Object.keys(b).length>0){alert("Please fill in all the inputs properly");return}const te=new Ht(e),$=new Zt(i);$.createdAt=q.date,$.vendor=q.vendor,$.amount=q.amount,$.category_name=q.category,te.transactions.push($),te.addCategory(q.category);const W=await e.updateFirebase();W instanceof Ht&&(a("User Successfully Updated"),r(W),E({vendor:"Select Vendor",category:"Select Category",date:new Date().toISOString().split("T")[0],amount:""}),o(new Zt)),u(!1)};return j.jsxs("form",{onSubmit:x(ie),children:[s&&j.jsx(em,{})," ",j.jsxs("div",{children:[j.jsx("label",{children:"Date"}),j.jsx(Zr,{name:"date",control:S,render:({field:q})=>j.jsx("input",{type:"date",...q})})]}),j.jsxs("div",{children:[j.jsx("label",{children:"Vendor"}),j.jsx(Zr,{name:"vendor",control:S,rules:{required:"Please select a vendor",validate:q=>q==="Select vendor"||q===""||q==="Other(specify below)"?"Please select a vendor":!0},render:({field:q})=>j.jsxs("div",{children:[j.jsxs("select",{...q,onChange:te=>{const $=te.target.value;$==="other"?q.onChange(""):q.onChange($)},children:[c.map(te=>j.jsx("option",{value:te,children:te},te)),j.jsx("option",{value:"other",children:"Other (specify below)"})]}),(q.value===""||q.value==="Select vendor"||q.value==="Other(specify below)")&&j.jsxs(j.Fragment,{children:[j.jsx("input",{id:"vendor",type:"text",value:v,onChange:te=>{m(te.target.value)},onBlur:te=>{N(te),q.onBlur()}}),b.vendor&&j.jsx("span",{role:"alert",style:{color:"red"},children:b.vendor.message})]})]})})]}),j.jsxs("div",{children:[j.jsx("label",{htmlFor:"amount",children:"Amount"}),j.jsx(Zr,{name:"amount",control:S,rules:{required:"Please enter a valid input (0-9 or . or -)",validate:q=>{const te=/^-?\d*(\.\d*)?$/,$=q.replace(/(?!^-)[^\d.]/g,"").replace(/^([^.]*\.)|\./g,"$1");return te.test($)?!0:"Please enter a valid input (0-9 or . or -)"}},render:({field:{onChange:q,value:te,...$},fieldState:{error:W}})=>j.jsxs(j.Fragment,{children:[j.jsx("input",{...$,value:te,onChange:Z=>{const oe=Z.target.value.replace(/(?!^-)[^\d.]/g,"").replace(/^([^.]*\.)|\./g,"$1");q(oe)}}),W&&j.jsx("span",{role:"alert",style:{color:"red"},children:W.message})]})})]}),j.jsxs("div",{children:[j.jsx("label",{children:"Category"}),j.jsx(Zr,{name:"category",control:S,rules:{required:"Please select a category",validate:q=>q==="Select category"||q===""||q==="Other (specify below)"||q==="Select Category"?"Please select a category":!0},render:({field:q})=>j.jsxs("div",{children:[j.jsxs("select",{...q,onChange:te=>{const $=te.target.value;$==="other"?q.onChange(""):q.onChange($)},children:[d.map(te=>j.jsx("option",{value:te,children:te},te)),j.jsx("option",{value:"other",children:"Other (specify below)"})]}),(q.value===""||q.value==="Select category"||q.value==="Select Category"||q.value==="Other (specify below)")&&j.jsxs(j.Fragment,{children:[j.jsx("input",{id:"category",type:"text",value:w,onChange:te=>{I(te.target.value)},onBlur:C}),b.category&&j.jsx("span",{role:"alert",style:{color:"red"},children:b.category.message})]})]})})]}),j.jsx("button",{type:"submit",children:"Submit"})]})},tm=()=>{const{setScreen:e}=K.useContext(Pn),t=()=>{e("landing")};return j.jsx("button",{onClick:t,children:"Back"})};var M_={exports:{}};/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",a=0;a{const c=r[u];delete r[u];let f,d,p;typeof c=="object"&&c!=null?{span:f,offset:d,order:p}=c:f=c;const v=u!==o?`-${u}`:"";f&&a.push(f===!0?`${t}${v}`:`${t}${v}-${f}`),p!=null&&s.push(`order${v}-${p}`),d!=null&&s.push(`offset${v}-${d}`)}),[{...r,className:Ya(n,...a,...s)},{as:e,bsPrefix:t,spans:a}]}const Jc=K.forwardRef((e,t)=>{const[{className:n,...r},{as:i="div",bsPrefix:o,spans:a}]=XP(e);return j.jsx(i,{...r,ref:t,className:Ya(n,!a.length&&o)})});Jc.displayName="Col";const Xc=K.forwardRef(({bsPrefix:e,fluid:t=!1,as:n="div",className:r,...i},o)=>{const a=Qc(e,"container"),s=typeof t=="string"?`-${t}`:"-fluid";return j.jsx(n,{ref:o,...i,className:Ya(r,t?`${a}${s}`:a)})});Xc.displayName="Container";var ZP=function(){},ex=ZP;re.string,re.bool,re.bool,re.bool,re.bool;const Zc=K.forwardRef(({bsPrefix:e,className:t,fluid:n=!1,rounded:r=!1,roundedCircle:i=!1,thumbnail:o=!1,...a},s)=>(e=Qc(e,"img"),j.jsx("img",{ref:s,...a,className:Ya(t,n&&`${e}-fluid`,r&&"rounded",i&&"rounded-circle",o&&`${e}-thumbnail`)})));Zc.displayName="Image";const im=K.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},i)=>{const o=Qc(e,"row"),a=U_(),s=$_(),u=`${o}-cols`,c=[];return a.forEach(f=>{const d=r[f];delete r[f];let p;d!=null&&typeof d=="object"?{cols:p}=d:p=d;const v=f!==s?`-${f}`:"";p!=null&&c.push(`${u}${v}-${p}`)}),j.jsx(n,{ref:i,...r,className:Ya(t,o,...c)})});im.displayName="Row";const tx=()=>{const{capturedPhoto:e,setCapturedPhoto:t,screen:n,setScreen:r,ocrData:i,setOcrData:o,device:a,setOcrModalOpen:s,isUpdating:u,setIsUpdating:c}=K.useContext(Pn),[f,d]=K.useState(null),[p,v]=K.useState(null),m=K.useRef(null),w=K.useRef(null),I=K.useRef(null);K.useEffect(()=>{!e&&a==="mobile"&&I.current.click(),a==="desktop"&&!e&&(async()=>{var M;(M=m.current)!=null&&M.srcObject||await y()})()},[e,m,f]);const O=()=>{if(m.current&&w.current){w.current.getContext("2d").drawImage(m.current,0,0,w.current.width,w.current.height);const U=w.current.toDataURL("image/png");t(U),p.getTracks().forEach(E=>{E.stop()}),v(null),console.log("Camera light turned off")}},y=async()=>{t(null);try{let M;a==="desktop"&&(M=await navigator.mediaDevices.getUserMedia({video:!0})),v(M),m.current&&(m.current.srcObject=M,m.current.play(),d(!0))}catch(M){console.error("Error accessing camera:",M),d(!1)}},S=M=>{c(!0);const U=M.target.files[0];if(U){const E=new FileReader;E.onload=b=>{t(b.target.result),a==="mobile"&&x().then(()=>{t(null),c(!1)})},E.readAsDataURL(U)}},x=async()=>{try{c(!0);const M="https://us-central1-simplitracapp.cloudfunctions.net/process_receipt",E={method:"POST",body:rx(e)},b=await fetch(M,E);if(c(!1),!b.ok)throw new Error("Network response was not ok");const T=await b.json();if(T.error)console.error("Error from OCR service:",T.message),alert(T.message);else{const k=new Zt(T);o(k),r("landing"),t(!1),s(!0)}}catch(M){console.error("Error submitting photo:",M),alert("Text is unreadable, please take the photo again.")}};return j.jsxs("div",{style:pr.container,children:[u&&j.jsx(em,{})," ",a==="mobile"&&!e&&j.jsx("div",{children:j.jsx("input",{type:"file",accept:"image/*",capture:"environment",ref:I,onChange:S,style:pr.fileInput})}),a==="desktop"&&!e&&j.jsxs("div",{children:[j.jsx("video",{ref:m,style:pr.video}),j.jsx("button",{className:"custom-button",onClick:O,style:pr.button,children:"Capture Photo"})]}),e&&a!=="mobile"&&j.jsxs("div",{children:[j.jsxs("div",{style:pr.imageContainer,children:[j.jsx("p",{children:"Captured Photo:"}),j.jsx("img",{src:e,alt:"Captured",style:pr.image})]}),j.jsx("button",{className:"custom-button",onClick:x,style:pr.button,children:"Submit"}),j.jsx("button",{className:"custom-button",onClick:y,style:pr.button,children:"Retake"})]}),j.jsx(tm,{}),j.jsx("canvas",{ref:w,style:pr.hiddenCanvas})]})},pr={container:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",padding:"20px"},video:{width:"100%",height:"auto"},button:{marginTop:"10px",padding:"10px 20px",fontSize:"16px"},imageContainer:{marginTop:"10px"},image:{width:"300px",height:"200px"},hiddenCanvas:{display:"none"},fileInput:{display:"none"}};function nx(e){const t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o=0)&&u(d,!v)}function f(d){var p=[].slice.call(d.querySelectorAll("*"),0).reduce(function(v,m){return v.concat(m.shadowRoot?f(m.shadowRoot):[m])},[]);return p.filter(c)}e.exports=t.default})(Ih,Ih.exports);var W_=Ih.exports;Object.defineProperty(Hn,"__esModule",{value:!0});Hn.resetState=ax;Hn.log=lx;Hn.handleBlur=Ra;Hn.handleFocus=Na;Hn.markForFocusLater=ux;Hn.returnFocus=cx;Hn.popWithoutFocus=fx;Hn.setupScopedFocus=dx;Hn.teardownScopedFocus=hx;var ix=W_,ox=sx(ix);function sx(e){return e&&e.__esModule?e:{default:e}}var Xo=[],Io=null,kh=!1;function ax(){Xo=[]}function lx(){}function Ra(){kh=!0}function Na(){if(kh){if(kh=!1,!Io)return;setTimeout(function(){if(!Io.contains(document.activeElement)){var e=(0,ox.default)(Io)[0]||Io;e.focus()}},0)}}function ux(){Xo.push(document.activeElement)}function cx(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=null;try{Xo.length!==0&&(t=Xo.pop(),t.focus({preventScroll:e}));return}catch{console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}}function fx(){Xo.length>0&&Xo.pop()}function dx(e){Io=e,window.addEventListener?(window.addEventListener("blur",Ra,!1),document.addEventListener("focus",Na,!0)):(window.attachEvent("onBlur",Ra),document.attachEvent("onFocus",Na))}function hx(){Io=null,window.addEventListener?(window.removeEventListener("blur",Ra),document.removeEventListener("focus",Na)):(window.detachEvent("onBlur",Ra),document.detachEvent("onFocus",Na))}var Ph={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=W_,r=i(n);function i(s){return s&&s.__esModule?s:{default:s}}function o(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return s.activeElement.shadowRoot?o(s.activeElement.shadowRoot):s.activeElement}function a(s,u){var c=(0,r.default)(s);if(!c.length){u.preventDefault();return}var f=void 0,d=u.shiftKey,p=c[0],v=c[c.length-1],m=o();if(s===m){if(!d)return;f=v}if(v===m&&!d&&(f=p),p===m&&d&&(f=v),f){u.preventDefault(),f.focus();return}var w=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),I=w!=null&&w[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(I){var O=c.indexOf(m);if(O>-1&&(O+=d?-1:1),f=c[O],typeof f>"u"){u.preventDefault(),f=d?v:p,f.focus();return}u.preventDefault(),f.focus()}}e.exports=t.default})(Ph,Ph.exports);var px=Ph.exports,Gn={},Bn={},H_={exports:{}};/*! - Copyright (c) 2015 Jed Watson. - Based on code that is Copyright 2013-2015, Facebook, Inc. - All rights reserved. -*/(function(e){(function(){var t=!!(typeof window<"u"&&window.document&&window.document.createElement),n={canUseDOM:t,canUseWorkers:typeof Worker<"u",canUseEventListeners:t&&!!(window.addEventListener||window.attachEvent),canUseViewport:t&&!!window.screen};e.exports?e.exports=n:window.ExecutionEnvironment=n})()})(H_);var mx=H_.exports;Object.defineProperty(Bn,"__esModule",{value:!0});Bn.canUseDOM=Bn.SafeNodeList=Bn.SafeHTMLCollection=void 0;var gx=mx,vx=yx(gx);function yx(e){return e&&e.__esModule?e:{default:e}}var ef=vx.default,wx=ef.canUseDOM?window.HTMLElement:{};Bn.SafeHTMLCollection=ef.canUseDOM?window.HTMLCollection:{};Bn.SafeNodeList=ef.canUseDOM?window.NodeList:{};Bn.canUseDOM=ef.canUseDOM;Bn.default=wx;Object.defineProperty(Gn,"__esModule",{value:!0});Gn.resetState=Ox;Gn.log=Tx;Gn.assertNodeList=G_;Gn.setElement=Cx;Gn.validateElement=om;Gn.hide=Ix;Gn.show=kx;Gn.documentNotReadyOrSSRTesting=Px;var bx=ex,_x=Ex(bx),Sx=Bn;function Ex(e){return e&&e.__esModule?e:{default:e}}var wn=null;function Ox(){wn&&(wn.removeAttribute?wn.removeAttribute("aria-hidden"):wn.length!=null?wn.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(wn).forEach(function(e){return e.removeAttribute("aria-hidden")})),wn=null}function Tx(){}function G_(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function Cx(e){var t=e;if(typeof t=="string"&&Sx.canUseDOM){var n=document.querySelectorAll(t);G_(n,t),t=n}return wn=t||wn,wn}function om(e){var t=e||wn;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,_x.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}function Ix(e){var t=!0,n=!1,r=void 0;try{for(var i=om(e)[Symbol.iterator](),o;!(t=(o=i.next()).done);t=!0){var a=o.value;a.setAttribute("aria-hidden","true")}}catch(s){n=!0,r=s}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}}function kx(e){var t=!0,n=!1,r=void 0;try{for(var i=om(e)[Symbol.iterator](),o;!(t=(o=i.next()).done);t=!0){var a=o.value;a.removeAttribute("aria-hidden")}}catch(s){n=!0,r=s}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}}function Px(){wn=null}var hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.resetState=xx;hs.log=Ax;var fa={},da={};function py(e,t){e.classList.remove(t)}function xx(){var e=document.getElementsByTagName("html")[0];for(var t in fa)py(e,fa[t]);var n=document.body;for(var r in da)py(n,da[r]);fa={},da={}}function Ax(){}var Rx=function(t,n){return t[n]||(t[n]=0),t[n]+=1,n},Nx=function(t,n){return t[n]&&(t[n]-=1),n},Dx=function(t,n,r){r.forEach(function(i){Rx(n,i),t.add(i)})},Mx=function(t,n,r){r.forEach(function(i){Nx(n,i),n[i]===0&&t.remove(i)})};hs.add=function(t,n){return Dx(t.classList,t.nodeName.toLowerCase()=="html"?fa:da,n.split(" "))};hs.remove=function(t,n){return Mx(t.classList,t.nodeName.toLowerCase()=="html"?fa:da,n.split(" "))};var ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.log=jx;ps.resetState=Fx;function Lx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var q_=function e(){var t=this;Lx(this,e),this.register=function(n){t.openInstances.indexOf(n)===-1&&(t.openInstances.push(n),t.emit("register"))},this.deregister=function(n){var r=t.openInstances.indexOf(n);r!==-1&&(t.openInstances.splice(r,1),t.emit("deregister"))},this.subscribe=function(n){t.subscribers.push(n)},this.emit=function(n){t.subscribers.forEach(function(r){return r(n,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},oc=new q_;function jx(){console.log("portalOpenInstances ----------"),console.log(oc.openInstances.length),oc.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")}function Fx(){oc=new q_}ps.default=oc;var sm={};Object.defineProperty(sm,"__esModule",{value:!0});sm.resetState=Bx;sm.log=zx;var Ux=ps,$x=Vx(Ux);function Vx(e){return e&&e.__esModule?e:{default:e}}var At=void 0,Nn=void 0,Bi=[];function Bx(){for(var e=[At,Nn],t=0;t0?(document.body.firstChild!==At&&document.body.insertBefore(At,document.body.firstChild),document.body.lastChild!==Nn&&document.body.appendChild(Nn)):(At.parentElement&&At.parentElement.removeChild(At),Nn.parentElement&&Nn.parentElement.removeChild(Nn))}$x.default.subscribe(Wx);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(ie){for(var q=1;q0&&(N-=1,N===0&&v.show(Z)),$.props.shouldFocusAfterRender&&($.props.shouldReturnFocusAfterClose?(c.returnFocus($.props.preventScroll),c.teardownScopedFocus()):c.popWithoutFocus()),$.props.onAfterClose&&$.props.onAfterClose(),S.default.deregister($)},$.open=function(){$.beforeOpen(),$.state.afterOpen&&$.state.beforeClose?(clearTimeout($.closeTimer),$.setState({beforeClose:!1})):($.props.shouldFocusAfterRender&&(c.setupScopedFocus($.node),c.markForFocusLater()),$.setState({isOpen:!0},function(){$.openAnimationFrame=requestAnimationFrame(function(){$.setState({afterOpen:!0}),$.props.isOpen&&$.props.onAfterOpen&&$.props.onAfterOpen({overlayEl:$.overlay,contentEl:$.content})})}))},$.close=function(){$.props.closeTimeoutMS>0?$.closeWithTimeout():$.closeWithoutTimeout()},$.focusContent=function(){return $.content&&!$.contentHasFocus()&&$.content.focus({preventScroll:!0})},$.closeWithTimeout=function(){var W=Date.now()+$.props.closeTimeoutMS;$.setState({beforeClose:!0,closesAt:W},function(){$.closeTimer=setTimeout($.closeWithoutTimeout,$.state.closesAt-Date.now())})},$.closeWithoutTimeout=function(){$.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},$.afterClose)},$.handleKeyDown=function(W){k(W)&&(0,d.default)($.content,W),$.props.shouldCloseOnEsc&&L(W)&&(W.stopPropagation(),$.requestClose(W))},$.handleOverlayOnClick=function(W){$.shouldClose===null&&($.shouldClose=!0),$.shouldClose&&$.props.shouldCloseOnOverlayClick&&($.ownerHandlesClose()?$.requestClose(W):$.focusContent()),$.shouldClose=null},$.handleContentOnMouseUp=function(){$.shouldClose=!1},$.handleOverlayOnMouseDown=function(W){!$.props.shouldCloseOnOverlayClick&&W.target==$.overlay&&W.preventDefault()},$.handleContentOnClick=function(){$.shouldClose=!1},$.handleContentOnMouseDown=function(){$.shouldClose=!1},$.requestClose=function(W){return $.ownerHandlesClose()&&$.props.onRequestClose(W)},$.ownerHandlesClose=function(){return $.props.onRequestClose},$.shouldBeClosed=function(){return!$.state.isOpen&&!$.state.beforeClose},$.contentHasFocus=function(){return document.activeElement===$.content||$.content.contains(document.activeElement)},$.buildClassName=function(W,Z){var oe=(typeof Z>"u"?"undefined":r(Z))==="object"?Z:{base:T[W],afterOpen:T[W]+"--after-open",beforeClose:T[W]+"--before-close"},we=oe.base;return $.state.afterOpen&&(we=we+" "+oe.afterOpen),$.state.beforeClose&&(we=we+" "+oe.beforeClose),typeof Z=="string"&&Z?we+" "+Z:we},$.attributesFromObject=function(W,Z){return Object.keys(Z).reduce(function(oe,we){return oe[W+"-"+we]=Z[we],oe},{})},$.state={afterOpen:!1,beforeClose:!1},$.shouldClose=null,$.moveFromContentToOverlay=null,$}return i(q,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function($,W){this.props.isOpen&&!$.isOpen?this.open():!this.props.isOpen&&$.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!W.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var $=this.props,W=$.appElement,Z=$.ariaHideApp,oe=$.htmlOpenClassName,we=$.bodyOpenClassName,be=$.parentSelector,Te=be&&be().ownerDocument||document;we&&w.add(Te.body,we),oe&&w.add(Te.getElementsByTagName("html")[0],oe),Z&&(N+=1,v.hide(W)),S.default.register(this)}},{key:"render",value:function(){var $=this.props,W=$.id,Z=$.className,oe=$.overlayClassName,we=$.defaultStyles,be=$.children,Te=Z?{}:we.content,Ge=oe?{}:we.overlay;if(this.shouldBeClosed())return null;var $e={ref:this.setOverlayRef,className:this.buildClassName("overlay",oe),style:n({},Ge,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},je=n({id:W,ref:this.setContentRef,style:n({},Te,this.props.style.content),className:this.buildClassName("content",Z),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",n({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),We=this.props.contentElement(je,be);return this.props.overlayElement($e,We)}}]),q}(o.Component);C.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},C.propTypes={isOpen:s.default.bool.isRequired,defaultStyles:s.default.shape({content:s.default.object,overlay:s.default.object}),style:s.default.shape({content:s.default.object,overlay:s.default.object}),className:s.default.oneOfType([s.default.string,s.default.object]),overlayClassName:s.default.oneOfType([s.default.string,s.default.object]),parentSelector:s.default.func,bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,ariaHideApp:s.default.bool,appElement:s.default.oneOfType([s.default.instanceOf(O.default),s.default.instanceOf(I.SafeHTMLCollection),s.default.instanceOf(I.SafeNodeList),s.default.arrayOf(s.default.instanceOf(O.default))]),onAfterOpen:s.default.func,onAfterClose:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,role:s.default.string,contentLabel:s.default.string,aria:s.default.object,data:s.default.object,children:s.default.node,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func,testId:s.default.string},t.default=C,e.exports=t.default})(Ch,Ch.exports);var Hx=Ch.exports;const Gx=F0(HP);Object.defineProperty(Yi,"__esModule",{value:!0});Yi.bodyOpenClassName=Yi.portalClassName=void 0;var gy=Object.assign||function(e){for(var t=1;t{Zo.setAppElement("#root");const e=K.useRef(),{user:t,setUser:n}=K.useContext(Pn),[r,i]=K.useState(!0),[o,a]=K.useState([]),s=f=>{i(!f),u()},u=f=>{const d=[...o];f!=null&&f.target&&(d.push(new Go({category_name:f.target.name,category_id:f.target.id})),a(d))},c=()=>{t.categories=o.map(d=>new Go(d));const f=new Ht(t);n(f),s(r)};return j.jsx("div",{className:"source-type",children:j.jsxs(Zo,{isOpen:r,className:"modal-content",overlayClassName:"modal-overlay","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var f;return(f=e.current)==null?void 0:f.focus()},0)},children:[j.jsx("h2",{id:"source-type-dialog-label",children:"Select Your Categories"})," ",j.jsx("header",{}),j.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:sA.map((f,d)=>j.jsx("li",{className:"source-type-modal__list-item",children:j.jsxs("label",{children:[j.jsx("input",{type:"checkbox",onChange:u,name:f.category_name,ref:d===0?e:null,id:f.category_id}),f.category_name]})},f.category_id))}),j.jsx("div",{className:"source-type-modal__controls",children:j.jsx("button",{value:"apply",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:c,children:"Apply"})})]})})};var Sy={};/** - * @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 Y_=function(e){const t=[];let n=0;for(let r=0;r>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},lA=function(e){const t=[];let n=0,r=0;for(;n191&&i<224){const o=e[n++];t[r++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){const o=e[n++],a=e[n++],s=e[n++],u=((i&7)<<18|(o&63)<<12|(a&63)<<6|s&63)-65536;t[r++]=String.fromCharCode(55296+(u>>10)),t[r++]=String.fromCharCode(56320+(u&1023))}else{const o=e[n++],a=e[n++];t[r++]=String.fromCharCode((i&15)<<12|(o&63)<<6|a&63)}}return t.join("")},Q_={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(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,d=(o&3)<<4|s>>4;let p=(s&15)<<2|c>>6,v=c&63;u||(v=64,a||(p=64)),r.push(n[f],n[d],n[p],n[v])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Y_(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):lA(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(p),c!==64){const v=s<<4&240|c>>2;if(r.push(v),d!==64){const m=c<<6&192|d;r.push(m)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class uA extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const cA=function(e){const t=Y_(e);return Q_.encodeByteArray(t,!0)},lc=function(e){return cA(e).replace(/\./g,"")},J_=function(e){try{return Q_.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}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 fA(){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 dA=()=>fA().__FIREBASE_DEFAULTS__,hA=()=>{if(typeof process>"u"||typeof Sy>"u")return;const e=Sy.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},pA=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&J_(e[1]);return t&&JSON.parse(t)},am=()=>{try{return dA()||hA()||pA()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},X_=e=>{var t,n;return(n=(t=am())===null||t===void 0?void 0:t.emulatorHosts)===null||n===void 0?void 0:n[e]},mA=e=>{const t=X_(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const r=parseInt(t.substring(n+1),10);return t[0]==="["?[t.substring(1,n-1),r]:[t.substring(0,n),r]},Z_=()=>{var e;return(e=am())===null||e===void 0?void 0:e.config},eS=e=>{var t;return(t=am())===null||t===void 0?void 0: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 gA{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,r))}}}/** - * @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 vA(e,t){if(e.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=t||"demo-project",i=e.iat||0,o=e.sub||e.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const a=Object.assign({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:{}}},e);return[lc(JSON.stringify(n)),lc(JSON.stringify(a)),""].join(".")}/** - * @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 $t(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function yA(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test($t())}function wA(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function bA(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function _A(){const e=$t();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function SA(){try{return typeof indexedDB=="object"}catch{return!1}}function EA(){return new Promise((e,t)=>{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),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var o;t(((o=i.error)===null||o===void 0?void 0:o.message)||"")}}catch(n){t(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 OA="FirebaseError";class Nr extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=OA,Object.setPrototypeOf(this,Nr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Xa.prototype.create)}}class Xa{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},i=`${this.service}/${t}`,o=this.errors[t],a=o?TA(o,r):"Error",s=`${this.serviceName}: ${a} (${i}).`;return new Nr(i,s,r)}}function TA(e,t){return e.replace(CA,(n,r)=>{const i=t[r];return i!=null?String(i):`<${r}?>`})}const CA=/\{\$([^}]+)}/g;function IA(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function uc(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const o=e[i],a=t[i];if(Ey(o)&&Ey(a)){if(!uc(o,a))return!1}else if(o!==a)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function Ey(e){return e!==null&&typeof e=="object"}/** - * @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 Za(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(i=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function kA(e,t){const n=new PA(e,t);return n.subscribe.bind(n)}class PA{constructor(t,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{t(this)}).catch(r=>{this.error(r)})}next(t){this.forEachObserver(n=>{n.next(t)})}error(t){this.forEachObserver(n=>{n.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,n,r){let i;if(t===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");xA(t,["next","error","complete"])?i=t:i={next:t,error:n,complete:r},i.next===void 0&&(i.next=ld),i.error===void 0&&(i.error=ld),i.complete===void 0&&(i.complete=ld);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),o}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let n=0;n{if(this.observers!==void 0&&this.observers[t]!==void 0)try{n(this.observers[t])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function xA(e,t){if(typeof e!="object"||e===null)return!1;for(const n of t)if(n in e&&typeof e[n]=="function")return!0;return!1}function ld(){}/** - * @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 Si(e){return e&&e._delegate?e._delegate:e}class Qi{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,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 Pi="[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 AA{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const r=new gA;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(t){var n;const r=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),i=(n=t==null?void 0:t.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(o){if(i)return null;throw o}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(NA(t))try{this.getOrInitializeService({instanceIdentifier:Pi})}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(t=Pi){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=Pi){return this.instances.has(t)}getOptions(t=Pi){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,r=this.normalizeInstanceIdentifier(t.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,a]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(o);r===s&&a.resolve(i)}return i}onInit(t,n){var r;const i=this.normalizeInstanceIdentifier(n),o=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;o.add(t),this.onInitCallbacks.set(i,o);const a=this.instances.get(i);return a&&t(a,i),()=>{o.delete(t)}}invokeOnInitCallbacks(t,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:RA(t),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch{}return r||null}normalizeInstanceIdentifier(t=Pi){return this.component?this.component.multipleInstances?t:Pi:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function RA(e){return e===Pi?void 0:e}function NA(e){return e.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 DA{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new AA(t,this);return this.providers.set(t,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 Be;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(Be||(Be={}));const MA={debug:Be.DEBUG,verbose:Be.VERBOSE,info:Be.INFO,warn:Be.WARN,error:Be.ERROR,silent:Be.SILENT},LA=Be.INFO,jA={[Be.DEBUG]:"log",[Be.VERBOSE]:"log",[Be.INFO]:"info",[Be.WARN]:"warn",[Be.ERROR]:"error"},FA=(e,t,...n)=>{if(tt.some(n=>e instanceof n);let Oy,Ty;function $A(){return Oy||(Oy=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function VA(){return Ty||(Ty=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const tS=new WeakMap,xh=new WeakMap,nS=new WeakMap,ud=new WeakMap,um=new WeakMap;function BA(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",o),e.removeEventListener("error",a)},o=()=>{n(ci(e.result)),i()},a=()=>{r(e.error),i()};e.addEventListener("success",o),e.addEventListener("error",a)});return t.then(n=>{n instanceof IDBCursor&&tS.set(n,e)}).catch(()=>{}),um.set(t,e),t}function zA(e){if(xh.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",a),e.removeEventListener("abort",a)},o=()=>{n(),i()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",o),e.addEventListener("error",a),e.addEventListener("abort",a)});xh.set(e,t)}let Ah={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return xh.get(e);if(t==="objectStoreNames")return e.objectStoreNames||nS.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ci(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function WA(e){Ah=e(Ah)}function HA(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(cd(this),t,...n);return nS.set(r,t.sort?t.sort():[t]),ci(r)}:VA().includes(e)?function(...t){return e.apply(cd(this),t),ci(tS.get(this))}:function(...t){return ci(e.apply(cd(this),t))}}function GA(e){return typeof e=="function"?HA(e):(e instanceof IDBTransaction&&zA(e),UA(e,$A())?new Proxy(e,Ah):e)}function ci(e){if(e instanceof IDBRequest)return BA(e);if(ud.has(e))return ud.get(e);const t=GA(e);return t!==e&&(ud.set(e,t),um.set(t,e)),t}const cd=e=>um.get(e);function qA(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const a=indexedDB.open(e,t),s=ci(a);return r&&a.addEventListener("upgradeneeded",u=>{r(ci(a.result),u.oldVersion,u.newVersion,ci(a.transaction),u)}),n&&a.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),s.then(u=>{o&&u.addEventListener("close",()=>o()),i&&u.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),s}const KA=["get","getKey","getAll","getAllKeys","count"],YA=["put","add","delete","clear"],fd=new Map;function Cy(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(fd.get(t))return fd.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=YA.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||KA.includes(n)))return;const o=async function(a,...s){const u=this.transaction(a,i?"readwrite":"readonly");let c=u.store;return r&&(c=c.index(s.shift())),(await Promise.all([c[n](...s),i&&u.done]))[0]};return fd.set(t,o),o}WA(e=>({...e,get:(t,n,r)=>Cy(t,n)||e.get(t,n,r),has:(t,n)=>!!Cy(t,n)||e.has(t,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 QA{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(JA(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function JA(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const Rh="@firebase/app",Iy="0.10.5";/** - * @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 Ji=new lm("@firebase/app"),XA="@firebase/app-compat",ZA="@firebase/analytics-compat",e2="@firebase/analytics",t2="@firebase/app-check-compat",n2="@firebase/app-check",r2="@firebase/auth",i2="@firebase/auth-compat",o2="@firebase/database",s2="@firebase/database-compat",a2="@firebase/functions",l2="@firebase/functions-compat",u2="@firebase/installations",c2="@firebase/installations-compat",f2="@firebase/messaging",d2="@firebase/messaging-compat",h2="@firebase/performance",p2="@firebase/performance-compat",m2="@firebase/remote-config",g2="@firebase/remote-config-compat",v2="@firebase/storage",y2="@firebase/storage-compat",w2="@firebase/firestore",b2="@firebase/vertexai-preview",_2="@firebase/firestore-compat",S2="firebase",E2="10.12.2";/** - * @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 Nh="[DEFAULT]",O2={[Rh]:"fire-core",[XA]:"fire-core-compat",[e2]:"fire-analytics",[ZA]:"fire-analytics-compat",[n2]:"fire-app-check",[t2]:"fire-app-check-compat",[r2]:"fire-auth",[i2]:"fire-auth-compat",[o2]:"fire-rtdb",[s2]:"fire-rtdb-compat",[a2]:"fire-fn",[l2]:"fire-fn-compat",[u2]:"fire-iid",[c2]:"fire-iid-compat",[f2]:"fire-fcm",[d2]:"fire-fcm-compat",[h2]:"fire-perf",[p2]:"fire-perf-compat",[m2]:"fire-rc",[g2]:"fire-rc-compat",[v2]:"fire-gcs",[y2]:"fire-gcs-compat",[w2]:"fire-fst",[_2]:"fire-fst-compat",[b2]:"fire-vertex","fire-js":"fire-js",[S2]:"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 cc=new Map,T2=new Map,Dh=new Map;function ky(e,t){try{e.container.addComponent(t)}catch(n){Ji.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function es(e){const t=e.name;if(Dh.has(t))return Ji.debug(`There were multiple attempts to register component ${t}.`),!1;Dh.set(t,e);for(const n of cc.values())ky(n,e);for(const n of T2.values())ky(n,e);return!0}function cm(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function Sr(e){return e.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 C2={"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."},fi=new Xa("app","Firebase",C2);/** - * @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 I2{constructor(t,n,r){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Qi("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}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(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw fi.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 ms=E2;function rS(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r=Object.assign({name:Nh,automaticDataCollectionEnabled:!1},t),i=r.name;if(typeof i!="string"||!i)throw fi.create("bad-app-name",{appName:String(i)});if(n||(n=Z_()),!n)throw fi.create("no-options");const o=cc.get(i);if(o){if(uc(n,o.options)&&uc(r,o.config))return o;throw fi.create("duplicate-app",{appName:i})}const a=new DA(i);for(const u of Dh.values())a.addComponent(u);const s=new I2(n,r,a);return cc.set(i,s),s}function iS(e=Nh){const t=cc.get(e);if(!t&&e===Nh&&Z_())return rS();if(!t)throw fi.create("no-app",{appName:e});return t}function di(e,t,n){var r;let i=(r=O2[e])!==null&&r!==void 0?r:e;n&&(i+=`-${n}`);const o=i.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const s=[`Unable to register library "${i}" with version "${t}":`];o&&s.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&a&&s.push("and"),a&&s.push(`version name "${t}" contains illegal characters (whitespace or "/")`),Ji.warn(s.join(" "));return}es(new Qi(`${i}-version`,()=>({library:i,version:t}),"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 k2="firebase-heartbeat-database",P2=1,Da="firebase-heartbeat-store";let dd=null;function oS(){return dd||(dd=qA(k2,P2,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Da)}catch(n){console.warn(n)}}}}).catch(e=>{throw fi.create("idb-open",{originalErrorMessage:e.message})})),dd}async function x2(e){try{const n=(await oS()).transaction(Da),r=await n.objectStore(Da).get(sS(e));return await n.done,r}catch(t){if(t instanceof Nr)Ji.warn(t.message);else{const n=fi.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Ji.warn(n.message)}}}async function Py(e,t){try{const r=(await oS()).transaction(Da,"readwrite");await r.objectStore(Da).put(t,sS(e)),await r.done}catch(n){if(n instanceof Nr)Ji.warn(n.message);else{const r=fi.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Ji.warn(r.message)}}}function sS(e){return`${e.name}!${e.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 A2=1024,R2=30*24*60*60*1e3;class N2{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new M2(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var t,n;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=xy();if(!(((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(a=>a.date===o)))return this._heartbeatsCache.heartbeats.push({date:o,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(a=>{const s=new Date(a.date).valueOf();return Date.now()-s<=R2}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var t;if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=xy(),{heartbeatsToSend:r,unsentEntries:i}=D2(this._heartbeatsCache.heartbeats),o=lc(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}}function xy(){return new Date().toISOString().substring(0,10)}function D2(e,t=A2){const n=[];let r=e.slice();for(const i of e){const o=n.find(a=>a.agent===i.agent);if(o){if(o.dates.push(i.date),Ay(n)>t){o.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Ay(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class M2{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return SA()?EA().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await x2(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return Py(this.app,{lastSentHeartbeatDate:(n=t.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return Py(this.app,{lastSentHeartbeatDate:(n=t.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...t.heartbeats]})}else return}}function Ay(e){return lc(JSON.stringify({version:2,heartbeats:e})).length}/** - * @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. - */function L2(e){es(new Qi("platform-logger",t=>new QA(t),"PRIVATE")),es(new Qi("heartbeat",t=>new N2(t),"PRIVATE")),di(Rh,Iy,e),di(Rh,Iy,"esm2017"),di("fire-js","")}L2("");var j2="firebase",F2="10.12.2";/** - * @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. - */di(j2,F2,"app");var Ry=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 aS;(function(){var e;/** @license - - Copyright The Closure Library Authors. - SPDX-License-Identifier: Apache-2.0 -*/function t(E,b){function T(){}T.prototype=b.prototype,E.D=b.prototype,E.prototype=new T,E.prototype.constructor=E,E.C=function(k,L,N){for(var C=Array(arguments.length-2),ie=2;ieL;++L)k[L]=b.charCodeAt(T++)|b.charCodeAt(T++)<<8|b.charCodeAt(T++)<<16|b.charCodeAt(T++)<<24;else for(L=0;16>L;++L)k[L]=b[T++]|b[T++]<<8|b[T++]<<16|b[T++]<<24;b=E.g[0],T=E.g[1],L=E.g[2];var N=E.g[3],C=b+(N^T&(L^N))+k[0]+3614090360&4294967295;b=T+(C<<7&4294967295|C>>>25),C=N+(L^b&(T^L))+k[1]+3905402710&4294967295,N=b+(C<<12&4294967295|C>>>20),C=L+(T^N&(b^T))+k[2]+606105819&4294967295,L=N+(C<<17&4294967295|C>>>15),C=T+(b^L&(N^b))+k[3]+3250441966&4294967295,T=L+(C<<22&4294967295|C>>>10),C=b+(N^T&(L^N))+k[4]+4118548399&4294967295,b=T+(C<<7&4294967295|C>>>25),C=N+(L^b&(T^L))+k[5]+1200080426&4294967295,N=b+(C<<12&4294967295|C>>>20),C=L+(T^N&(b^T))+k[6]+2821735955&4294967295,L=N+(C<<17&4294967295|C>>>15),C=T+(b^L&(N^b))+k[7]+4249261313&4294967295,T=L+(C<<22&4294967295|C>>>10),C=b+(N^T&(L^N))+k[8]+1770035416&4294967295,b=T+(C<<7&4294967295|C>>>25),C=N+(L^b&(T^L))+k[9]+2336552879&4294967295,N=b+(C<<12&4294967295|C>>>20),C=L+(T^N&(b^T))+k[10]+4294925233&4294967295,L=N+(C<<17&4294967295|C>>>15),C=T+(b^L&(N^b))+k[11]+2304563134&4294967295,T=L+(C<<22&4294967295|C>>>10),C=b+(N^T&(L^N))+k[12]+1804603682&4294967295,b=T+(C<<7&4294967295|C>>>25),C=N+(L^b&(T^L))+k[13]+4254626195&4294967295,N=b+(C<<12&4294967295|C>>>20),C=L+(T^N&(b^T))+k[14]+2792965006&4294967295,L=N+(C<<17&4294967295|C>>>15),C=T+(b^L&(N^b))+k[15]+1236535329&4294967295,T=L+(C<<22&4294967295|C>>>10),C=b+(L^N&(T^L))+k[1]+4129170786&4294967295,b=T+(C<<5&4294967295|C>>>27),C=N+(T^L&(b^T))+k[6]+3225465664&4294967295,N=b+(C<<9&4294967295|C>>>23),C=L+(b^T&(N^b))+k[11]+643717713&4294967295,L=N+(C<<14&4294967295|C>>>18),C=T+(N^b&(L^N))+k[0]+3921069994&4294967295,T=L+(C<<20&4294967295|C>>>12),C=b+(L^N&(T^L))+k[5]+3593408605&4294967295,b=T+(C<<5&4294967295|C>>>27),C=N+(T^L&(b^T))+k[10]+38016083&4294967295,N=b+(C<<9&4294967295|C>>>23),C=L+(b^T&(N^b))+k[15]+3634488961&4294967295,L=N+(C<<14&4294967295|C>>>18),C=T+(N^b&(L^N))+k[4]+3889429448&4294967295,T=L+(C<<20&4294967295|C>>>12),C=b+(L^N&(T^L))+k[9]+568446438&4294967295,b=T+(C<<5&4294967295|C>>>27),C=N+(T^L&(b^T))+k[14]+3275163606&4294967295,N=b+(C<<9&4294967295|C>>>23),C=L+(b^T&(N^b))+k[3]+4107603335&4294967295,L=N+(C<<14&4294967295|C>>>18),C=T+(N^b&(L^N))+k[8]+1163531501&4294967295,T=L+(C<<20&4294967295|C>>>12),C=b+(L^N&(T^L))+k[13]+2850285829&4294967295,b=T+(C<<5&4294967295|C>>>27),C=N+(T^L&(b^T))+k[2]+4243563512&4294967295,N=b+(C<<9&4294967295|C>>>23),C=L+(b^T&(N^b))+k[7]+1735328473&4294967295,L=N+(C<<14&4294967295|C>>>18),C=T+(N^b&(L^N))+k[12]+2368359562&4294967295,T=L+(C<<20&4294967295|C>>>12),C=b+(T^L^N)+k[5]+4294588738&4294967295,b=T+(C<<4&4294967295|C>>>28),C=N+(b^T^L)+k[8]+2272392833&4294967295,N=b+(C<<11&4294967295|C>>>21),C=L+(N^b^T)+k[11]+1839030562&4294967295,L=N+(C<<16&4294967295|C>>>16),C=T+(L^N^b)+k[14]+4259657740&4294967295,T=L+(C<<23&4294967295|C>>>9),C=b+(T^L^N)+k[1]+2763975236&4294967295,b=T+(C<<4&4294967295|C>>>28),C=N+(b^T^L)+k[4]+1272893353&4294967295,N=b+(C<<11&4294967295|C>>>21),C=L+(N^b^T)+k[7]+4139469664&4294967295,L=N+(C<<16&4294967295|C>>>16),C=T+(L^N^b)+k[10]+3200236656&4294967295,T=L+(C<<23&4294967295|C>>>9),C=b+(T^L^N)+k[13]+681279174&4294967295,b=T+(C<<4&4294967295|C>>>28),C=N+(b^T^L)+k[0]+3936430074&4294967295,N=b+(C<<11&4294967295|C>>>21),C=L+(N^b^T)+k[3]+3572445317&4294967295,L=N+(C<<16&4294967295|C>>>16),C=T+(L^N^b)+k[6]+76029189&4294967295,T=L+(C<<23&4294967295|C>>>9),C=b+(T^L^N)+k[9]+3654602809&4294967295,b=T+(C<<4&4294967295|C>>>28),C=N+(b^T^L)+k[12]+3873151461&4294967295,N=b+(C<<11&4294967295|C>>>21),C=L+(N^b^T)+k[15]+530742520&4294967295,L=N+(C<<16&4294967295|C>>>16),C=T+(L^N^b)+k[2]+3299628645&4294967295,T=L+(C<<23&4294967295|C>>>9),C=b+(L^(T|~N))+k[0]+4096336452&4294967295,b=T+(C<<6&4294967295|C>>>26),C=N+(T^(b|~L))+k[7]+1126891415&4294967295,N=b+(C<<10&4294967295|C>>>22),C=L+(b^(N|~T))+k[14]+2878612391&4294967295,L=N+(C<<15&4294967295|C>>>17),C=T+(N^(L|~b))+k[5]+4237533241&4294967295,T=L+(C<<21&4294967295|C>>>11),C=b+(L^(T|~N))+k[12]+1700485571&4294967295,b=T+(C<<6&4294967295|C>>>26),C=N+(T^(b|~L))+k[3]+2399980690&4294967295,N=b+(C<<10&4294967295|C>>>22),C=L+(b^(N|~T))+k[10]+4293915773&4294967295,L=N+(C<<15&4294967295|C>>>17),C=T+(N^(L|~b))+k[1]+2240044497&4294967295,T=L+(C<<21&4294967295|C>>>11),C=b+(L^(T|~N))+k[8]+1873313359&4294967295,b=T+(C<<6&4294967295|C>>>26),C=N+(T^(b|~L))+k[15]+4264355552&4294967295,N=b+(C<<10&4294967295|C>>>22),C=L+(b^(N|~T))+k[6]+2734768916&4294967295,L=N+(C<<15&4294967295|C>>>17),C=T+(N^(L|~b))+k[13]+1309151649&4294967295,T=L+(C<<21&4294967295|C>>>11),C=b+(L^(T|~N))+k[4]+4149444226&4294967295,b=T+(C<<6&4294967295|C>>>26),C=N+(T^(b|~L))+k[11]+3174756917&4294967295,N=b+(C<<10&4294967295|C>>>22),C=L+(b^(N|~T))+k[2]+718787259&4294967295,L=N+(C<<15&4294967295|C>>>17),C=T+(N^(L|~b))+k[9]+3951481745&4294967295,E.g[0]=E.g[0]+b&4294967295,E.g[1]=E.g[1]+(L+(C<<21&4294967295|C>>>11))&4294967295,E.g[2]=E.g[2]+L&4294967295,E.g[3]=E.g[3]+N&4294967295}r.prototype.u=function(E,b){b===void 0&&(b=E.length);for(var T=b-this.blockSize,k=this.B,L=this.h,N=0;Nthis.h?this.blockSize:2*this.blockSize)-this.h);E[0]=128;for(var b=1;bb;++b)for(var k=0;32>k;k+=8)E[T++]=this.g[b]>>>k&255;return E};function o(E,b){var T=s;return Object.prototype.hasOwnProperty.call(T,E)?T[E]:T[E]=b(E)}function a(E,b){this.h=b;for(var T=[],k=!0,L=E.length-1;0<=L;L--){var N=E[L]|0;k&&N==b||(T[L]=N,k=!1)}this.g=T}var s={};function u(E){return-128<=E&&128>E?o(E,function(b){return new a([b|0],0>b?-1:0)}):new a([E|0],0>E?-1:0)}function c(E){if(isNaN(E)||!isFinite(E))return d;if(0>E)return I(c(-E));for(var b=[],T=1,k=0;E>=T;k++)b[k]=E/T|0,T*=4294967296;return new a(b,0)}function f(E,b){if(E.length==0)throw Error("number format error: empty string");if(b=b||10,2>b||36N?(N=c(Math.pow(b,N)),k=k.j(N).add(c(C))):(k=k.j(T),k=k.add(c(C)))}return k}var d=u(0),p=u(1),v=u(16777216);e=a.prototype,e.m=function(){if(w(this))return-I(this).m();for(var E=0,b=1,T=0;TE||36>>0).toString(E);if(T=L,m(T))return N+k;for(;6>N.length;)N="0"+N;k=N+k}},e.i=function(E){return 0>E?0:E>>16)+(this.i(L)>>>16)+(E.i(L)>>>16);k=C>>>16,N&=65535,C&=65535,T[L]=C<<16|N}return new a(T,T[T.length-1]&-2147483648?-1:0)};function O(E,b){return E.add(I(b))}e.j=function(E){if(m(this)||m(E))return d;if(w(this))return w(E)?I(this).j(I(E)):I(I(this).j(E));if(w(E))return I(this.j(I(E)));if(0>this.l(v)&&0>E.l(v))return c(this.m()*E.m());for(var b=this.g.length+E.g.length,T=[],k=0;k<2*b;k++)T[k]=0;for(k=0;k>>16,C=this.i(k)&65535,ie=E.i(L)>>>16,q=E.i(L)&65535;T[2*k+2*L]+=C*q,y(T,2*k+2*L),T[2*k+2*L+1]+=N*q,y(T,2*k+2*L+1),T[2*k+2*L+1]+=C*ie,y(T,2*k+2*L+1),T[2*k+2*L+2]+=N*ie,y(T,2*k+2*L+2)}for(k=0;k>>16,E[b]&=65535,b++}function S(E,b){this.g=E,this.h=b}function x(E,b){if(m(b))throw Error("division by zero");if(m(E))return new S(d,d);if(w(E))return b=x(I(E),b),new S(I(b.g),I(b.h));if(w(b))return b=x(E,I(b)),new S(I(b.g),b.h);if(30=k.l(E);)T=M(T),k=M(k);var L=U(T,1),N=U(k,1);for(k=U(k,2),T=U(T,2);!m(k);){var C=N.add(k);0>=C.l(E)&&(L=L.add(T),N=C),k=U(k,1),T=U(T,1)}return b=O(E,L.j(b)),new S(L,b)}for(L=d;0<=E.l(b);){for(T=Math.max(1,Math.floor(E.m()/b.m())),k=Math.ceil(Math.log(T)/Math.LN2),k=48>=k?1:Math.pow(2,k-48),N=c(T),C=N.j(b);w(C)||0>>31;return new a(T,E.h)}function U(E,b){var T=b>>5;b%=32;for(var k=E.g.length-T,L=[],N=0;N>>b|E.i(N+T+1)<<32-b:E.i(N+T);return new a(L,E.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,a.prototype.add=a.prototype.add,a.prototype.multiply=a.prototype.j,a.prototype.modulo=a.prototype.A,a.prototype.compare=a.prototype.l,a.prototype.toNumber=a.prototype.m,a.prototype.toString=a.prototype.toString,a.prototype.getBits=a.prototype.i,a.fromNumber=c,a.fromString=f,aS=a}).apply(typeof Ry<"u"?Ry:typeof self<"u"?self:typeof window<"u"?window:{});var Gl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};(function(){var e,t=typeof Object.defineProperties=="function"?Object.defineProperty:function(l,h,g){return l==Array.prototype||l==Object.prototype||(l[h]=g.value),l};function n(l){l=[typeof globalThis=="object"&&globalThis,l,typeof window=="object"&&window,typeof self=="object"&&self,typeof Gl=="object"&&Gl];for(var h=0;h{throw l},0)}function C(){var l=Z;let h=null;return l.g&&(h=l.g,l.g=l.g.next,l.g||(l.h=null),h.next=null),h}class ie{constructor(){this.h=this.g=null}add(h,g){const _=q.get();_.set(h,g),this.h?this.h.next=_:this.g=_,this.h=_}}var q=new O(()=>new te,l=>l.reset());class te{constructor(){this.next=this.g=this.h=null}set(h,g){this.h=h,this.g=g,this.next=null}reset(){this.next=this.g=this.h=null}}let $,W=!1,Z=new ie,oe=()=>{const l=s.Promise.resolve(void 0);$=()=>{l.then(we)}};var we=()=>{for(var l;l=C();){try{l.h.call(l.g)}catch(g){N(g)}var h=q;h.j(l),100>h.h&&(h.h++,l.next=h.g,h.g=l)}W=!1};function be(){this.s=this.s,this.C=this.C}be.prototype.s=!1,be.prototype.ma=function(){this.s||(this.s=!0,this.N())},be.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function Te(l,h){this.type=l,this.g=this.target=h,this.defaultPrevented=!1}Te.prototype.h=function(){this.defaultPrevented=!0};var Ge=function(){if(!s.addEventListener||!Object.defineProperty)return!1;var l=!1,h=Object.defineProperty({},"passive",{get:function(){l=!0}});try{const g=()=>{};s.addEventListener("test",g,h),s.removeEventListener("test",g,h)}catch{}return l}();function $e(l,h){if(Te.call(this,l?l.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,l){var g=this.type=l.type,_=l.changedTouches&&l.changedTouches.length?l.changedTouches[0]:null;if(this.target=l.target||l.srcElement,this.g=h,h=l.relatedTarget){if(M){e:{try{x(h.nodeName);var B=!0;break e}catch{}B=!1}B||(h=null)}}else g=="mouseover"?h=l.fromElement:g=="mouseout"&&(h=l.toElement);this.relatedTarget=h,_?(this.clientX=_.clientX!==void 0?_.clientX:_.pageX,this.clientY=_.clientY!==void 0?_.clientY:_.pageY,this.screenX=_.screenX||0,this.screenY=_.screenY||0):(this.clientX=l.clientX!==void 0?l.clientX:l.pageX,this.clientY=l.clientY!==void 0?l.clientY:l.pageY,this.screenX=l.screenX||0,this.screenY=l.screenY||0),this.button=l.button,this.key=l.key||"",this.ctrlKey=l.ctrlKey,this.altKey=l.altKey,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.pointerId=l.pointerId||0,this.pointerType=typeof l.pointerType=="string"?l.pointerType:je[l.pointerType]||"",this.state=l.state,this.i=l,l.defaultPrevented&&$e.aa.h.call(this)}}m($e,Te);var je={2:"touch",3:"pen",4:"mouse"};$e.prototype.h=function(){$e.aa.h.call(this);var l=this.i;l.preventDefault?l.preventDefault():l.returnValue=!1};var We="closure_listenable_"+(1e6*Math.random()|0),P=0;function D(l,h,g,_,B){this.listener=l,this.proxy=null,this.src=h,this.type=g,this.capture=!!_,this.ha=B,this.key=++P,this.da=this.fa=!1}function F(l){l.da=!0,l.listener=null,l.proxy=null,l.src=null,l.ha=null}function R(l){this.src=l,this.g={},this.h=0}R.prototype.add=function(l,h,g,_,B){var G=l.toString();l=this.g[G],l||(l=this.g[G]=[],this.h++);var le=H(l,h,_,B);return-1>>0);function ae(l){return typeof l=="function"?l:(l[he]||(l[he]=function(h){return l.handleEvent(h)}),l[he])}function de(){be.call(this),this.i=new R(this),this.M=this,this.F=null}m(de,be),de.prototype[We]=!0,de.prototype.removeEventListener=function(l,h,g,_){V(this,l,h,g,_)};function ce(l,h){var g,_=l.F;if(_)for(g=[];_;_=_.F)g.push(_);if(l=l.M,_=h.type||h,typeof h=="string")h=new Te(h,l);else if(h instanceof Te)h.target=h.target||l;else{var B=h;h=new Te(_,l),k(h,B)}if(B=!0,g)for(var G=g.length-1;0<=G;G--){var le=h.g=g[G];B=Ae(le,_,!0,h)&&B}if(le=h.g=l,B=Ae(le,_,!0,h)&&B,B=Ae(le,_,!1,h)&&B,g)for(G=0;G{l.g=null,l.i&&(l.i=!1,rt(l))},l.l);const h=l.h;l.h=null,l.m.apply(null,h)}class Ce extends be{constructor(h,g){super(),this.m=h,this.l=g,this.h=null,this.i=!1,this.g=null}j(h){this.h=arguments,this.g?this.i=!0:rt(this)}N(){super.N(),this.g&&(s.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Se(l){be.call(this),this.h=l,this.g={}}m(Se,be);var Ct=[];function Dr(l){U(l.g,function(h,g){this.g.hasOwnProperty(g)&&z(h)},l),l.g={}}Se.prototype.N=function(){Se.aa.N.call(this),Dr(this)},Se.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var cr=s.JSON.stringify,YE=s.JSON.parse,QE=class{stringify(l){return s.JSON.stringify(l,void 0)}parse(l){return s.JSON.parse(l,void 0)}};function ff(){}ff.prototype.h=null;function Fm(l){return l.h||(l.h=l.i())}function JE(){}var bs={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function df(){Te.call(this,"d")}m(df,Te);function hf(){Te.call(this,"c")}m(hf,Te);var ro={},Um=null;function pf(){return Um=Um||new de}ro.La="serverreachability";function $m(l){Te.call(this,ro.La,l)}m($m,Te);function _s(l){const h=pf();ce(h,new $m(h))}ro.STAT_EVENT="statevent";function Vm(l,h){Te.call(this,ro.STAT_EVENT,l),this.stat=h}m(Vm,Te);function Bt(l){const h=pf();ce(h,new Vm(h,l))}ro.Ma="timingevent";function Bm(l,h){Te.call(this,ro.Ma,l),this.size=h}m(Bm,Te);function Ss(l,h){if(typeof l!="function")throw Error("Fn must not be null and must be a function");return s.setTimeout(function(){l()},h)}function Es(){this.g=!0}Es.prototype.xa=function(){this.g=!1};function XE(l,h,g,_,B,G){l.info(function(){if(l.g)if(G)for(var le="",qe=G.split("&"),_t=0;_t_.length)){var B=_[1];if(Array.isArray(B)&&!(1>B.length)){var G=B[0];if(G!="noop"&&G!="stop"&&G!="close")for(var le=1;lekt)&&(kt!=3||this.g&&(this.h.h||this.g.oa()||dg(this.g)))){this.J||kt!=4||h==7||(h==8||0>=ao?_s(3):_s(2)),wf(this);var g=this.g.Z();this.X=g;t:if(Gm(this)){var _=dg(this.g);l="";var B=_.length,G=dr(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Ei(this),Os(this);var le="";break t}this.h.i=new s.TextDecoder}for(h=0;hh.length?vf:(h=h.slice(_,_+g),l.C=_+g,h)))}Mr.prototype.cancel=function(){this.J=!0,Ei(this)};function hl(l){l.S=Date.now()+l.I,qm(l,l.I)}function qm(l,h){if(l.B!=null)throw Error("WatchDog timer not null");l.B=Ss(p(l.ba,l),h)}function wf(l){l.B&&(s.clearTimeout(l.B),l.B=null)}Mr.prototype.ba=function(){this.B=null;const l=Date.now();0<=l-this.S?(eO(this.i,this.A),this.L!=2&&(_s(),Bt(17)),Ei(this),this.s=2,Os(this)):qm(this,this.S-l)};function Os(l){l.j.G==0||l.J||wg(l.j,l)}function Ei(l){wf(l);var h=l.M;h&&typeof h.ma=="function"&&h.ma(),l.M=null,Dr(l.U),l.g&&(h=l.g,l.g=null,h.abort(),h.ma())}function bf(l,h){try{var g=l.j;if(g.G!=0&&(g.g==l||_f(g.h,l))){if(!l.K&&_f(g.h,l)&&g.G==3){try{var _=g.Da.g.parse(h)}catch{_=null}if(Array.isArray(_)&&_.length==3){var B=_;if(B[0]==0){e:if(!g.u){if(g.g)if(g.g.F+3e3B[2]&&g.F&&g.v==0&&!g.C&&(g.C=Ss(p(g.Za,g),6e3));if(1>=Qm(g.h)&&g.ca){try{g.ca()}catch{}g.ca=void 0}}else Ti(g,11)}else if((l.K||g.g==l)&&Sl(g),!y(h))for(B=g.Da.g.parse(h),h=0;h=l.j:!1}function Qm(l){return l.h?1:l.g?l.g.size:0}function _f(l,h){return l.h?l.h==h:l.g?l.g.has(h):!1}function Sf(l,h){l.g?l.g.add(h):l.h=h}function Jm(l,h){l.h&&l.h==h?l.h=null:l.g&&l.g.has(h)&&l.g.delete(h)}Km.prototype.cancel=function(){if(this.i=Xm(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const l of this.g.values())l.cancel();this.g.clear()}};function Xm(l){if(l.h!=null)return l.i.concat(l.h.D);if(l.g!=null&&l.g.size!==0){let h=l.i;for(const g of l.g.values())h=h.concat(g.D);return h}return w(l.i)}function oO(l){if(l.V&&typeof l.V=="function")return l.V();if(typeof Map<"u"&&l instanceof Map||typeof Set<"u"&&l instanceof Set)return Array.from(l.values());if(typeof l=="string")return l.split("");if(u(l)){for(var h=[],g=l.length,_=0;_h)throw Error("Bad port number "+h);l.s=h}else l.s=null}function tg(l,h,g){h instanceof Is?(l.i=h,hO(l.i,l.h)):(g||(h=Cs(h,fO)),l.i=new Is(h,l.h))}function Je(l,h,g){l.i.set(h,g)}function gl(l){return Je(l,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),l}function Ts(l,h){return l?h?decodeURI(l.replace(/%25/g,"%2525")):decodeURIComponent(l):""}function Cs(l,h,g){return typeof l=="string"?(l=encodeURI(l).replace(h,lO),g&&(l=l.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),l):null}function lO(l){return l=l.charCodeAt(0),"%"+(l>>4&15).toString(16)+(l&15).toString(16)}var ng=/[#\/\?@]/g,uO=/[#\?:]/g,cO=/[#\?]/g,fO=/[#\?@]/g,dO=/#/g;function Is(l,h){this.h=this.g=null,this.i=l||null,this.j=!!h}function Lr(l){l.g||(l.g=new Map,l.h=0,l.i&&aO(l.i,function(h,g){l.add(decodeURIComponent(h.replace(/\+/g," ")),g)}))}e=Is.prototype,e.add=function(l,h){Lr(this),this.i=null,l=oo(this,l);var g=this.g.get(l);return g||this.g.set(l,g=[]),g.push(h),this.h+=1,this};function rg(l,h){Lr(l),h=oo(l,h),l.g.has(h)&&(l.i=null,l.h-=l.g.get(h).length,l.g.delete(h))}function ig(l,h){return Lr(l),h=oo(l,h),l.g.has(h)}e.forEach=function(l,h){Lr(this),this.g.forEach(function(g,_){g.forEach(function(B){l.call(h,B,_,this)},this)},this)},e.na=function(){Lr(this);const l=Array.from(this.g.values()),h=Array.from(this.g.keys()),g=[];for(let _=0;_{_.abort(),jr(g,"TestPingServer: timeout",!1,h)},1e4);fetch(l,{signal:_.signal}).then(G=>{clearTimeout(B),G.ok?jr(g,"TestPingServer: ok",!0,h):jr(g,"TestPingServer: server error",!1,h)}).catch(()=>{clearTimeout(B),jr(g,"TestPingServer: error",!1,h)})}function jr(l,h,g,_,B){try{B&&(B.onload=null,B.onerror=null,B.onabort=null,B.ontimeout=null),_(g)}catch{}}function gO(){this.g=new QE}function vO(l,h,g){const _=g||"";try{Zm(l,function(B,G){let le=B;c(B)&&(le=cr(B)),h.push(_+G+"="+encodeURIComponent(le))})}catch(B){throw h.push(_+"type="+encodeURIComponent("_badmap")),B}}function vl(l){this.l=l.Ub||null,this.j=l.eb||!1}m(vl,ff),vl.prototype.g=function(){return new yl(this.l,this.j)},vl.prototype.i=function(l){return function(){return l}}({});function yl(l,h){de.call(this),this.D=l,this.o=h,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}m(yl,de),e=yl.prototype,e.open=function(l,h){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=l,this.A=h,this.readyState=1,Ps(this)},e.send=function(l){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const h={headers:this.u,method:this.B,credentials:this.m,cache:void 0};l&&(h.body=l),(this.D||s).fetch(new Request(this.A,h)).then(this.Sa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,ks(this)),this.readyState=0},e.Sa=function(l){if(this.g&&(this.l=l,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=l.headers,this.readyState=2,Ps(this)),this.g&&(this.readyState=3,Ps(this),this.g)))if(this.responseType==="arraybuffer")l.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof s.ReadableStream<"u"&&"body"in l){if(this.j=l.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.v=new TextDecoder;sg(this)}else l.text().then(this.Ra.bind(this),this.ga.bind(this))};function sg(l){l.j.read().then(l.Pa.bind(l)).catch(l.ga.bind(l))}e.Pa=function(l){if(this.g){if(this.o&&l.value)this.response.push(l.value);else if(!this.o){var h=l.value?l.value:new Uint8Array(0);(h=this.v.decode(h,{stream:!l.done}))&&(this.response=this.responseText+=h)}l.done?ks(this):Ps(this),this.readyState==3&&sg(this)}},e.Ra=function(l){this.g&&(this.response=this.responseText=l,ks(this))},e.Qa=function(l){this.g&&(this.response=l,ks(this))},e.ga=function(){this.g&&ks(this)};function ks(l){l.readyState=4,l.l=null,l.j=null,l.v=null,Ps(l)}e.setRequestHeader=function(l,h){this.u.append(l,h)},e.getResponseHeader=function(l){return this.h&&this.h.get(l.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const l=[],h=this.h.entries();for(var g=h.next();!g.done;)g=g.value,l.push(g[0]+": "+g[1]),g=h.next();return l.join(`\r -`)};function Ps(l){l.onreadystatechange&&l.onreadystatechange.call(l)}Object.defineProperty(yl.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(l){this.m=l?"include":"same-origin"}});function ag(l){let h="";return U(l,function(g,_){h+=_,h+=":",h+=g,h+=`\r -`}),h}function Ef(l,h,g){e:{for(_ in g){var _=!1;break e}_=!0}_||(g=ag(g),typeof l=="string"?g!=null&&encodeURIComponent(String(g)):Je(l,h,g))}function ut(l){de.call(this),this.headers=new Map,this.o=l||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}m(ut,de);var yO=/^https?$/i,wO=["POST","PUT"];e=ut.prototype,e.Ha=function(l){this.J=l},e.ea=function(l,h,g,_){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+l);h=h?h.toUpperCase():"GET",this.D=l,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():gf.g(),this.v=this.o?Fm(this.o):Fm(gf),this.g.onreadystatechange=p(this.Ea,this);try{this.B=!0,this.g.open(h,String(l),!0),this.B=!1}catch(G){lg(this,G);return}if(l=g||"",g=new Map(this.headers),_)if(Object.getPrototypeOf(_)===Object.prototype)for(var B in _)g.set(B,_[B]);else if(typeof _.keys=="function"&&typeof _.get=="function")for(const G of _.keys())g.set(G,_.get(G));else throw Error("Unknown input type for opt_headers: "+String(_));_=Array.from(g.keys()).find(G=>G.toLowerCase()=="content-type"),B=s.FormData&&l instanceof s.FormData,!(0<=Array.prototype.indexOf.call(wO,h,void 0))||_||B||g.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[G,le]of g)this.g.setRequestHeader(G,le);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{fg(this),this.u=!0,this.g.send(l),this.u=!1}catch(G){lg(this,G)}};function lg(l,h){l.h=!1,l.g&&(l.j=!0,l.g.abort(),l.j=!1),l.l=h,l.m=5,ug(l),wl(l)}function ug(l){l.A||(l.A=!0,ce(l,"complete"),ce(l,"error"))}e.abort=function(l){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=l||7,ce(this,"complete"),ce(this,"abort"),wl(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),wl(this,!0)),ut.aa.N.call(this)},e.Ea=function(){this.s||(this.B||this.u||this.j?cg(this):this.bb())},e.bb=function(){cg(this)};function cg(l){if(l.h&&typeof a<"u"&&(!l.v[1]||dr(l)!=4||l.Z()!=2)){if(l.u&&dr(l)==4)ft(l.Ea,0,l);else if(ce(l,"readystatechange"),dr(l)==4){l.h=!1;try{const le=l.Z();e:switch(le){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var h=!0;break e;default:h=!1}var g;if(!(g=h)){var _;if(_=le===0){var B=String(l.D).match(eg)[1]||null;!B&&s.self&&s.self.location&&(B=s.self.location.protocol.slice(0,-1)),_=!yO.test(B?B.toLowerCase():"")}g=_}if(g)ce(l,"complete"),ce(l,"success");else{l.m=6;try{var G=2{}:null;l.g=null,l.v=null,h||ce(l,"ready");try{g.onreadystatechange=_}catch{}}}function fg(l){l.I&&(s.clearTimeout(l.I),l.I=null)}e.isActive=function(){return!!this.g};function dr(l){return l.g?l.g.readyState:0}e.Z=function(){try{return 2=l.h.j-(l.s?1:0)?!1:l.s?(l.i=h.D.concat(l.i),!0):l.G==1||l.G==2||l.B>=(l.Va?0:l.Wa)?!1:(l.s=Ss(p(l.Ga,l,h),bg(l,l.B)),l.B++,!0)}e.Ga=function(l){if(this.s)if(this.s=null,this.G==1){if(!l){this.U=Math.floor(1e5*Math.random()),l=this.U++;const B=new Mr(this,this.j,l);let G=this.o;if(this.S&&(G?(G=b(G),k(G,this.S)):G=this.S),this.m!==null||this.O||(B.H=G,G=null),this.P)e:{for(var h=0,g=0;gUe)G=Math.max(0,B[_t].g-100),qe=!1;else try{vO(It,le,"req"+Ue+"_")}catch{_&&_(It)}}if(qe){_=le.join("&");break e}}}return l=l.i.splice(0,g),h.D=l,_}function vg(l){if(!l.g&&!l.u){l.Y=1;var h=l.Fa;$||oe(),W||($(),W=!0),Z.add(h,l),l.v=0}}function Tf(l){return l.g||l.u||3<=l.v?!1:(l.Y++,l.u=Ss(p(l.Fa,l),bg(l,l.v)),l.v++,!0)}e.Fa=function(){if(this.u=null,yg(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var l=2*this.R;this.j.info("BP detection timer enabled: "+l),this.A=Ss(p(this.ab,this),l)}},e.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Bt(10),bl(this),yg(this))};function Cf(l){l.A!=null&&(s.clearTimeout(l.A),l.A=null)}function yg(l){l.g=new Mr(l,l.j,"rpc",l.Y),l.m===null&&(l.g.H=l.o),l.g.O=0;var h=fr(l.qa);Je(h,"RID","rpc"),Je(h,"SID",l.K),Je(h,"AID",l.T),Je(h,"CI",l.F?"0":"1"),!l.F&&l.ja&&Je(h,"TO",l.ja),Je(h,"TYPE","xmlhttp"),As(l,h),l.m&&l.o&&Ef(h,l.m,l.o),l.L&&(l.g.I=l.L);var g=l.g;l=l.ia,g.L=1,g.v=gl(fr(h)),g.m=null,g.P=!0,Hm(g,l)}e.Za=function(){this.C!=null&&(this.C=null,bl(this),Tf(this),Bt(19))};function Sl(l){l.C!=null&&(s.clearTimeout(l.C),l.C=null)}function wg(l,h){var g=null;if(l.g==h){Sl(l),Cf(l),l.g=null;var _=2}else if(_f(l.h,h))g=h.D,Jm(l.h,h),_=1;else return;if(l.G!=0){if(h.o)if(_==1){g=h.m?h.m.length:0,h=Date.now()-h.F;var B=l.B;_=pf(),ce(_,new Bm(_,g)),_l(l)}else vg(l);else if(B=h.s,B==3||B==0&&0`${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 Mo{constructor(){this.promise=new Promise((t,n)=>{this.resolve=t,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 lS{constructor(t,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${t}`)}}class $2{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,n){t.enqueueRetryable(()=>n(Rt.UNAUTHENTICATED))}shutdown(){}}class V2{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,n){this.changeListener=n,t.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class B2{constructor(t){this.t=t,this.currentUser=Rt.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(t,n){let r=this.i;const i=u=>this.i!==r?(r=this.i,n(u)):Promise.resolve();let o=new Mo;this.o=()=>{this.i++,this.currentUser=this.u(),o.resolve(),o=new Mo,t.enqueueRetryable(()=>i(this.currentUser))};const a=()=>{const u=o;t.enqueueRetryable(async()=>{await u.promise,await i(this.currentUser)})},s=u=>{dn("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.auth.addAuthTokenListener(this.o),a()};this.t.onInit(u=>s(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?s(u):(dn("FirebaseAuthCredentialsProvider","Auth not yet detected"),o.resolve(),o=new Mo)}},0),a()}getToken(){const t=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==t?(dn("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Mh(typeof r.accessToken=="string"),new lS(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const t=this.auth&&this.auth.getUid();return Mh(t===null||typeof t=="string"),new Rt(t)}}class z2{constructor(t,n,r){this.l=t,this.h=n,this.P=r,this.type="FirstParty",this.user=Rt.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const t=this.T();return t&&this.I.set("Authorization",t),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class W2{constructor(t,n,r){this.l=t,this.h=n,this.P=r}getToken(){return Promise.resolve(new z2(this.l,this.h,this.P))}start(t,n){t.enqueueRetryable(()=>n(Rt.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class H2{constructor(t){this.value=t,this.type="AppCheck",this.headers=new Map,t&&t.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class G2{constructor(t){this.A=t,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(t,n){const r=o=>{o.error!=null&&dn("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);const a=o.token!==this.R;return this.R=o.token,dn("FirebaseAppCheckTokenProvider",`Received ${a?"new":"existing"} token.`),a?n(o.token):Promise.resolve()};this.o=o=>{t.enqueueRetryable(()=>r(o))};const i=o=>{dn("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=o,this.appCheck.addTokenListener(this.o)};this.A.onInit(o=>i(o)),setTimeout(()=>{if(!this.appCheck){const o=this.A.getImmediate({optional:!0});o?i(o):dn("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const t=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(t).then(n=>n?(Mh(typeof n.token=="string"),this.R=n.token,new H2(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.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. - */function q2(e){const t=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&typeof t.getRandomValues=="function")t.getRandomValues(n);else for(let r=0;r0&&dn("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.ko} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.qo=this.oi.enqueueAfterDelay(this.timerId,i,()=>(this.Qo=Date.now(),t())),this.ko*=this.Lo,this.kothis.Bo&&(this.ko=this.Bo)}Wo(){this.qo!==null&&(this.qo.skipDelay(),this.qo=null)}cancel(){this.qo!==null&&(this.qo.cancel(),this.qo=null)}Uo(){return(Math.random()-.5)*this.ko}}/** - * @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 pm{constructor(t,n,r,i,o){this.asyncQueue=t,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=o,this.deferred=new Mo,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(a=>{})}get promise(){return this.deferred.promise}static createAndSchedule(t,n,r,i,o){const a=Date.now()+r,s=new pm(t,n,a,i,o);return s.start(r),s}start(t){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new jt(Lt.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(t=>this.deferred.resolve(t))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function J2(e,t){if(fm("AsyncQueue",`${t}: ${e}`),uS(e))return new jt(Lt.UNAVAILABLE,`${t}: ${e}`);throw e}var My,Ly;(Ly=My||(My={})).J_="default",Ly.Cache="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 X2{constructor(t,n,r,i){this.authCredentials=t,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=Rt.UNAUTHENTICATED,this.clientId=K2.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(r,async o=>{dn("FirestoreClient","Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(dn("FirestoreClient","Received new app check token=",o),this.appCheckCredentialListener(o,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(t){this.authCredentialListener=t}setAppCheckTokenChangeListener(t){this.appCheckCredentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new jt(Lt.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new Mo;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),t.resolve()}catch(n){const r=J2(n,"Failed to shutdown persistence");t.reject(r)}}),t.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 cS(e){const t={};return e.timeoutSeconds!==void 0&&(t.timeoutSeconds=e.timeoutSeconds),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. - */const jy=new Map;function Z2(e,t,n,r){if(t===!0&&r===!0)throw new jt(Lt.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}function eR(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return""+e;if(typeof e=="object"){if(e instanceof Array)return"an array";{const t=function(r){return r.constructor?r.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return typeof e=="function"?"a function":hm()}function tR(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new jt(Lt.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=eR(e);throw new jt(Lt.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return 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. - */class Fy{constructor(t){var n,r;if(t.host===void 0){if(t.ssl!==void 0)throw new jt(Lt.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=(n=t.ssl)===null||n===void 0||n;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,this.localCache=t.localCache,t.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(t.cacheSizeBytes!==-1&&t.cacheSizeBytes<1048576)throw new jt(Lt.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}Z2("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:t.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=cS((r=t.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(o){if(o.timeoutSeconds!==void 0){if(isNaN(o.timeoutSeconds))throw new jt(Lt.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (must not be NaN)`);if(o.timeoutSeconds<5)throw new jt(Lt.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (minimum allowed value is 5)`);if(o.timeoutSeconds>30)throw new jt(Lt.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!t.useFetchStreams}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,t.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}}class fS{constructor(t,n,r,i){this._authCredentials=t,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Fy({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new jt(Lt.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!==void 0}_setSettings(t){if(this._settingsFrozen)throw new jt(Lt.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 Fy(t),t.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new $2;switch(r.type){case"firstParty":return new W2(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new jt(Lt.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=jy.get(n);r&&(dn("ComponentProvider","Removing Datastore"),jy.delete(n),r.terminate())}(this),Promise.resolve()}}function nR(e,t,n,r={}){var i;const o=(e=tR(e,fS))._getSettings(),a=`${t}:${n}`;if(o.host!=="firestore.googleapis.com"&&o.host!==a&&U2("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},o),{host:a,ssl:!1})),r.mockUserToken){let s,u;if(typeof r.mockUserToken=="string")s=r.mockUserToken,u=Rt.MOCK_USER;else{s=vA(r.mockUserToken,(i=e._app)===null||i===void 0?void 0:i.options.projectId);const c=r.mockUserToken.sub||r.mockUserToken.user_id;if(!c)throw new jt(Lt.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");u=new Rt(c)}e._authCredentials=new V2(new lS(s,u))}}/** - * @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 rR{constructor(){this.iu=Promise.resolve(),this.su=[],this.ou=!1,this._u=[],this.au=null,this.uu=!1,this.cu=!1,this.lu=[],this.Yo=new Q2(this,"async_queue_retry"),this.hu=()=>{const n=hd();n&&dn("AsyncQueue","Visibility state changed to "+n.visibilityState),this.Yo.Wo()};const t=hd();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.hu)}get isShuttingDown(){return this.ou}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.Pu(),this.Iu(t)}enterRestrictedMode(t){if(!this.ou){this.ou=!0,this.cu=t||!1;const n=hd();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.hu)}}enqueue(t){if(this.Pu(),this.ou)return new Promise(()=>{});const n=new Mo;return this.Iu(()=>this.ou&&this.cu?Promise.resolve():(t().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(t){this.enqueueAndForget(()=>(this.su.push(t),this.Tu()))}async Tu(){if(this.su.length!==0){try{await this.su[0](),this.su.shift(),this.Yo.reset()}catch(t){if(!uS(t))throw t;dn("AsyncQueue","Operation failed with retryable error: "+t)}this.su.length>0&&this.Yo.$o(()=>this.Tu())}}Iu(t){const n=this.iu.then(()=>(this.uu=!0,t().catch(r=>{this.au=r,this.uu=!1;const i=function(a){let s=a.message||"";return a.stack&&(s=a.stack.includes(a.message)?a.stack:a.message+` -`+a.stack),s}(r);throw fm("INTERNAL UNHANDLED ERROR: ",i),r}).then(r=>(this.uu=!1,r))));return this.iu=n,n}enqueueAfterDelay(t,n,r){this.Pu(),this.lu.indexOf(t)>-1&&(n=0);const i=pm.createAndSchedule(this,t,n,r,o=>this.Eu(o));return this._u.push(i),i}Pu(){this.au&&hm()}verifyOperationInProgress(){}async du(){let t;do t=this.iu,await t;while(t!==this.iu)}Au(t){for(const n of this._u)if(n.timerId===t)return!0;return!1}Ru(t){return this.du().then(()=>{this._u.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this._u)if(n.skipDelay(),t!=="all"&&n.timerId===t)break;return this.du()})}Vu(t){this.lu.push(t)}Eu(t){const n=this._u.indexOf(t);this._u.splice(n,1)}}class iR extends fS{constructor(t,n,r,i){super(t,n,r,i),this.type="firestore",this._queue=function(){return new rR}(),this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||sR(this),this._firestoreClient.terminate()}}function oR(e,t){const n=typeof e=="object"?e:iS(),r=typeof e=="string"?e:"(default)",i=cm(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const o=mA("firestore");o&&nR(i,...o)}return i}function sR(e){var t,n,r;const i=e._freezeSettings(),o=function(s,u,c,f){return new Y2(s,u,c,f.host,f.ssl,f.experimentalForceLongPolling,f.experimentalAutoDetectLongPolling,cS(f.experimentalLongPollingOptions),f.useFetchStreams)}(e._databaseId,((t=e._app)===null||t===void 0?void 0:t.options.appId)||"",e._persistenceKey,i);e._firestoreClient=new X2(e._authCredentials,e._appCheckCredentials,e._queue,o),!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.localCache.kind,_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider})}(function(t,n=!0){(function(i){el=i})(ms),es(new Qi("firestore",(r,{instanceIdentifier:i,options:o})=>{const a=r.getProvider("app").getImmediate(),s=new iR(new B2(r.getProvider("auth-internal")),new G2(r.getProvider("app-check-internal")),function(c,f){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new jt(Lt.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new fc(c.options.projectId,f)}(a,i),a);return o=Object.assign({useFetchStreams:n},o),s._setSettings(o),s},"PUBLIC").setMultipleInstances(!0)),di(Ny,"4.6.3",t),di(Ny,"4.6.3","esm2017")})();var Lh=function(e,t){return Lh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Lh(e,t)};function dS(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Lh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var dc=function(){return dc=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o}function pS(e,t){return function(n,r){t(n,r,e)}}function aR(e,t,n,r,i,o){function a(O){if(O!==void 0&&typeof O!="function")throw new TypeError("Function expected");return O}for(var s=r.kind,u=s==="getter"?"get":s==="setter"?"set":"value",c=!t&&e?r.static?e:e.prototype:null,f=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),d,p=!1,v=n.length-1;v>=0;v--){var m={};for(var w in r)m[w]=w==="access"?{}:r[w];for(var w in r.access)m.access[w]=r.access[w];m.addInitializer=function(O){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(O||null))};var I=(0,n[v])(s==="accessor"?{get:f.get,set:f.set}:f[u],m);if(s==="accessor"){if(I===void 0)continue;if(I===null||typeof I!="object")throw new TypeError("Object expected");(d=a(I.get))&&(f.get=d),(d=a(I.set))&&(f.set=d),(d=a(I.init))&&i.unshift(d)}else(d=a(I))&&(s==="field"?i.unshift(d):f[u]=d)}c&&Object.defineProperty(c,r.name,f),p=!0}function lR(e,t,n){for(var r=arguments.length>2,i=0;i0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function mm(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function wS(){for(var e=[],t=0;t1||u(v,w)})},m&&(i[v]=m(i[v])))}function u(v,m){try{c(r[v](m))}catch(w){p(o[0][3],w)}}function c(v){v.value instanceof ns?Promise.resolve(v.value.v).then(f,d):p(o[0][2],v)}function f(v){u("next",v)}function d(v){u("throw",v)}function p(v,m){v(m),o.shift(),o.length&&u(o[0][0],o[0][1])}}function ES(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(a){return(n=!n)?{value:ns(e[i](a)),done:!1}:o?o(a):a}:o}}function OS(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof hc=="function"?hc(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(s,u){a=e[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(c){o({value:c,done:s})},a)}}function TS(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var fR=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function CS(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&tf(t,e,n);return fR(t,e),t}function IS(e){return e&&e.__esModule?e:{default:e}}function kS(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function PS(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n}function xS(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function AS(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(i=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var dR=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function RS(e){function t(r){e.error=e.hasError?new dR(r,e.error,"An error was suppressed during disposal."):r,e.hasError=!0}function n(){for(;e.stack.length;){var r=e.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,function(o){return t(o),n()})}catch(o){t(o)}}if(e.hasError)throw e.error}return n()}const hR={__extends:dS,__assign:dc,__rest:tl,__decorate:hS,__param:pS,__metadata:mS,__awaiter:gS,__generator:vS,__createBinding:tf,__exportStar:yS,__values:hc,__read:mm,__spread:wS,__spreadArrays:bS,__spreadArray:_S,__await:ns,__asyncGenerator:SS,__asyncDelegator:ES,__asyncValues:OS,__makeTemplateObject:TS,__importStar:CS,__importDefault:IS,__classPrivateFieldGet:kS,__classPrivateFieldSet:PS,__classPrivateFieldIn:xS,__addDisposableResource:AS,__disposeResources:RS},pR=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:AS,get __assign(){return dc},__asyncDelegator:ES,__asyncGenerator:SS,__asyncValues:OS,__await:ns,__awaiter:gS,__classPrivateFieldGet:kS,__classPrivateFieldIn:xS,__classPrivateFieldSet:PS,__createBinding:tf,__decorate:hS,__disposeResources:RS,__esDecorate:aR,__exportStar:yS,__extends:dS,__generator:vS,__importDefault:IS,__importStar:CS,__makeTemplateObject:TS,__metadata:mS,__param:pS,__propKey:uR,__read:mm,__rest:tl,__runInitializers:lR,__setFunctionName:cR,__spread:wS,__spreadArray:_S,__spreadArrays:bS,__values:hc,default:hR},Symbol.toStringTag,{value:"Module"}));function NS(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const mR=NS,DS=new Xa("auth","Firebase",NS());/** - * @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 pc=new lm("@firebase/auth");function gR(e,...t){pc.logLevel<=Be.WARN&&pc.warn(`Auth (${ms}): ${e}`,...t)}function bu(e,...t){pc.logLevel<=Be.ERROR&&pc.error(`Auth (${ms}): ${e}`,...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 lr(e,...t){throw vm(e,...t)}function zn(e,...t){return vm(e,...t)}function gm(e,t,n){const r=Object.assign(Object.assign({},mR()),{[t]:n});return new Xa("auth","Firebase",r).create(t,{appName:e.name})}function zi(e){return gm(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function vR(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&lr(e,"argument-error"),gm(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function vm(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return DS.create(e,...t)}function ke(e,t,...n){if(!e)throw vm(t,...n)}function Er(e){const t="INTERNAL ASSERTION FAILED: "+e;throw bu(t),new Error(t)}function Ar(e,t){e||Er(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 jh(){var e;return typeof self<"u"&&((e=self.location)===null||e===void 0?void 0:e.href)||""}function yR(){return Uy()==="http:"||Uy()==="https:"}function Uy(){var e;return typeof self<"u"&&((e=self.location)===null||e===void 0?void 0:e.protocol)||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 wR(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(yR()||wA()||"connection"in navigator)?navigator.onLine:!0}function bR(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||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. - */class nl{constructor(t,n){this.shortDelay=t,this.longDelay=n,Ar(n>t,"Short delay should be less than long delay!"),this.isMobile=yA()||bA()}get(){return wR()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** - * @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 ym(e,t){Ar(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/** - * @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 MS{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Er("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Er("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Er("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** - * @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 _R={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/** - * @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 SR=new nl(3e4,6e4);function wm(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function gs(e,t,n,r,i={}){return LS(e,i,async()=>{let o={},a={};r&&(t==="GET"?a=r:o={body:JSON.stringify(r)});const s=Za(Object.assign({key:e.config.apiKey},a)).slice(1),u=await e._getAdditionalHeaders();return u["Content-Type"]="application/json",e.languageCode&&(u["X-Firebase-Locale"]=e.languageCode),MS.fetch()(jS(e,e.config.apiHost,n,s),Object.assign({method:t,headers:u,referrerPolicy:"no-referrer"},o))})}async function LS(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},_R),t);try{const i=new OR(e),o=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const a=await o.json();if("needConfirmation"in a)throw ql(e,"account-exists-with-different-credential",a);if(o.ok&&!("errorMessage"in a))return a;{const s=o.ok?a.errorMessage:a.error.message,[u,c]=s.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw ql(e,"credential-already-in-use",a);if(u==="EMAIL_EXISTS")throw ql(e,"email-already-in-use",a);if(u==="USER_DISABLED")throw ql(e,"user-disabled",a);const f=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw gm(e,f,c);lr(e,f)}}catch(i){if(i instanceof Nr)throw i;lr(e,"network-request-failed",{message:String(i)})}}async function ER(e,t,n,r,i={}){const o=await gs(e,t,n,r,i);return"mfaPendingCredential"in o&&lr(e,"multi-factor-auth-required",{_serverResponse:o}),o}function jS(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?ym(e.config,i):`${e.config.apiScheme}://${i}`}class OR{constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(zn(this.auth,"network-request-failed")),SR.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function ql(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=zn(e,t,r);return i.customData._tokenResponse=n,i}/** - * @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. - */async function TR(e,t){return gs(e,"POST","/v1/accounts:delete",t)}async function FS(e,t){return gs(e,"POST","/v1/accounts:lookup",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 ha(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function CR(e,t=!1){const n=Si(e),r=await n.getIdToken(t),i=bm(r);ke(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const o=typeof i.firebase=="object"?i.firebase:void 0,a=o==null?void 0:o.sign_in_provider;return{claims:i,token:r,authTime:ha(pd(i.auth_time)),issuedAtTime:ha(pd(i.iat)),expirationTime:ha(pd(i.exp)),signInProvider:a||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function pd(e){return Number(e)*1e3}function bm(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return bu("JWT malformed, contained fewer than 3 sections"),null;try{const i=J_(n);return i?JSON.parse(i):(bu("Failed to decode base64 JWT payload"),null)}catch(i){return bu("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function $y(e){const t=bm(e);return ke(t,"internal-error"),ke(typeof t.exp<"u","internal-error"),ke(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/** - * @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. - */async function Ma(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Nr&&IR(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function IR({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/** - * @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 kR{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){var n;if(t){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(t=!1){if(!this.isRunning)return;const n=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** - * @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 Fh{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=ha(this.lastLoginAt),this.creationTime=ha(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** - * @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. - */async function mc(e){var t;const n=e.auth,r=await e.getIdToken(),i=await Ma(e,FS(n,{idToken:r}));ke(i==null?void 0:i.users.length,n,"internal-error");const o=i.users[0];e._notifyReloadListener(o);const a=!((t=o.providerUserInfo)===null||t===void 0)&&t.length?US(o.providerUserInfo):[],s=xR(e.providerData,a),u=e.isAnonymous,c=!(e.email&&o.passwordHash)&&!(s!=null&&s.length),f=u?c:!1,d={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:s,metadata:new Fh(o.createdAt,o.lastLoginAt),isAnonymous:f};Object.assign(e,d)}async function PR(e){const t=Si(e);await mc(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function xR(e,t){return[...e.filter(r=>!t.some(i=>i.providerId===r.providerId)),...t]}function US(e){return e.map(t=>{var{providerId:n}=t,r=tl(t,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||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. - */async function AR(e,t){const n=await LS(e,{},async()=>{const r=Za({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:i,apiKey:o}=e.config,a=jS(e,i,"/v1/token",`key=${o}`),s=await e._getAdditionalHeaders();return s["Content-Type"]="application/x-www-form-urlencoded",MS.fetch()(a,{method:"POST",headers:s,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function RR(e,t){return gs(e,"POST","/v2/accounts:revokeToken",wm(e,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. - */class Lo{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){ke(t.idToken,"internal-error"),ke(typeof t.idToken<"u","internal-error"),ke(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):$y(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){ke(t.length!==0,"internal-error");const n=$y(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(ke(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,n){const{accessToken:r,refreshToken:i,expiresIn:o}=await AR(t,n);this.updateTokensAndExpiration(r,i,Number(o))}updateTokensAndExpiration(t,n,r){this.refreshToken=n||null,this.accessToken=t||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(t,n){const{refreshToken:r,accessToken:i,expirationTime:o}=n,a=new Lo;return r&&(ke(typeof r=="string","internal-error",{appName:t}),a.refreshToken=r),i&&(ke(typeof i=="string","internal-error",{appName:t}),a.accessToken=i),o&&(ke(typeof o=="number","internal-error",{appName:t}),a.expirationTime=o),a}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new Lo,this.toJSON())}_performRefresh(){return Er("not implemented")}}/** - * @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 Ur(e,t){ke(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class Or{constructor(t){var{uid:n,auth:r,stsTokenManager:i}=t,o=tl(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new kR(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new Fh(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(t){const n=await Ma(this,this.stsTokenManager.getToken(this.auth,t));return ke(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return CR(this,t)}reload(){return PR(this)}_assign(t){this!==t&&(ke(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>Object.assign({},n)),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new Or(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(t){ke(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await mc(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Sr(this.auth.app))return Promise.reject(zi(this.auth));const t=await this.getIdToken();return await Ma(this,TR(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>Object.assign({},t)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){var r,i,o,a,s,u,c,f;const d=(r=n.displayName)!==null&&r!==void 0?r:void 0,p=(i=n.email)!==null&&i!==void 0?i:void 0,v=(o=n.phoneNumber)!==null&&o!==void 0?o:void 0,m=(a=n.photoURL)!==null&&a!==void 0?a:void 0,w=(s=n.tenantId)!==null&&s!==void 0?s:void 0,I=(u=n._redirectEventId)!==null&&u!==void 0?u:void 0,O=(c=n.createdAt)!==null&&c!==void 0?c:void 0,y=(f=n.lastLoginAt)!==null&&f!==void 0?f:void 0,{uid:S,emailVerified:x,isAnonymous:M,providerData:U,stsTokenManager:E}=n;ke(S&&E,t,"internal-error");const b=Lo.fromJSON(this.name,E);ke(typeof S=="string",t,"internal-error"),Ur(d,t.name),Ur(p,t.name),ke(typeof x=="boolean",t,"internal-error"),ke(typeof M=="boolean",t,"internal-error"),Ur(v,t.name),Ur(m,t.name),Ur(w,t.name),Ur(I,t.name),Ur(O,t.name),Ur(y,t.name);const T=new Or({uid:S,auth:t,email:p,emailVerified:x,displayName:d,isAnonymous:M,photoURL:m,phoneNumber:v,tenantId:w,stsTokenManager:b,createdAt:O,lastLoginAt:y});return U&&Array.isArray(U)&&(T.providerData=U.map(k=>Object.assign({},k))),I&&(T._redirectEventId=I),T}static async _fromIdTokenResponse(t,n,r=!1){const i=new Lo;i.updateFromServerResponse(n);const o=new Or({uid:n.localId,auth:t,stsTokenManager:i,isAnonymous:r});return await mc(o),o}static async _fromGetAccountInfoResponse(t,n,r){const i=n.users[0];ke(i.localId!==void 0,"internal-error");const o=i.providerUserInfo!==void 0?US(i.providerUserInfo):[],a=!(i.email&&i.passwordHash)&&!(o!=null&&o.length),s=new Lo;s.updateFromIdToken(r);const u=new Or({uid:i.localId,auth:t,stsTokenManager:s,isAnonymous:a}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new Fh(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(o!=null&&o.length)};return Object.assign(u,c),u}}/** - * @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 Vy=new Map;function Tr(e){Ar(e instanceof Function,"Expected a class definition");let t=Vy.get(e);return t?(Ar(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Vy.set(e,t),t)}/** - * @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 $S{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,n){this.storage[t]=n}async _get(t){const n=this.storage[t];return n===void 0?null:n}async _remove(t){delete this.storage[t]}_addListener(t,n){}_removeListener(t,n){}}$S.type="NONE";const By=$S;/** - * @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. - */function _u(e,t,n){return`firebase:${e}:${t}:${n}`}class jo{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:i,name:o}=this.auth;this.fullUserKey=_u(this.userKey,i.apiKey,o),this.fullPersistenceKey=_u("persistence",i.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);return t?Or._fromJSON(this.auth,t):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,n,r="authUser"){if(!n.length)return new jo(Tr(By),t,r);const i=(await Promise.all(n.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let o=i[0]||Tr(By);const a=_u(r,t.config.apiKey,t.name);let s=null;for(const c of n)try{const f=await c._get(a);if(f){const d=Or._fromJSON(t,f);c!==o&&(s=d),o=c;break}}catch{}const u=i.filter(c=>c._shouldAllowMigration);return!o._shouldAllowMigration||!u.length?new jo(o,t,r):(o=u[0],s&&await o._set(a,s.toJSON()),await Promise.all(n.map(async c=>{if(c!==o)try{await c._remove(a)}catch{}})),new jo(o,t,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. - */function zy(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(zS(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(VS(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(HS(t))return"Blackberry";if(GS(t))return"Webos";if(_m(t))return"Safari";if((t.includes("chrome/")||BS(t))&&!t.includes("edge/"))return"Chrome";if(WS(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function VS(e=$t()){return/firefox\//i.test(e)}function _m(e=$t()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function BS(e=$t()){return/crios\//i.test(e)}function zS(e=$t()){return/iemobile/i.test(e)}function WS(e=$t()){return/android/i.test(e)}function HS(e=$t()){return/blackberry/i.test(e)}function GS(e=$t()){return/webos/i.test(e)}function nf(e=$t()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function NR(e=$t()){var t;return nf(e)&&!!(!((t=window.navigator)===null||t===void 0)&&t.standalone)}function DR(){return _A()&&document.documentMode===10}function qS(e=$t()){return nf(e)||WS(e)||GS(e)||HS(e)||/windows phone/i.test(e)||zS(e)}function MR(){try{return!!(window&&window!==window.top)}catch{return!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. - */function KS(e,t=[]){let n;switch(e){case"Browser":n=zy($t());break;case"Worker":n=`${zy($t())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${ms}/${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 LR{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,n){const r=o=>new Promise((a,s)=>{try{const u=t(o);a(u)}catch(u){s(u)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const n=[];try{for(const r of this.queue)await r(t),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/** - * @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. - */async function jR(e,t={}){return gs(e,"GET","/v2/passwordPolicy",wm(e,t))}/** - * @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. - */const FR=6;class UR{constructor(t){var n,r,i,o;const a=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=a.minPasswordLength)!==null&&n!==void 0?n:FR,a.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=a.maxPasswordLength),a.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=a.containsLowercaseCharacter),a.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=a.containsUppercaseCharacter),a.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=a.containsNumericCharacter),a.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=a.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=t.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(o=t.forceUpgradeOnSignin)!==null&&o!==void 0?o:!1,this.schemaVersion=t.schemaVersion}validatePassword(t){var n,r,i,o,a,s;const u={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,u),this.validatePasswordCharacterOptions(t,u),u.isValid&&(u.isValid=(n=u.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),u.isValid&&(u.isValid=(r=u.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),u.isValid&&(u.isValid=(i=u.containsLowercaseLetter)!==null&&i!==void 0?i:!0),u.isValid&&(u.isValid=(o=u.containsUppercaseLetter)!==null&&o!==void 0?o:!0),u.isValid&&(u.isValid=(a=u.containsNumericCharacter)!==null&&a!==void 0?a:!0),u.isValid&&(u.isValid=(s=u.containsNonAlphanumericCharacter)!==null&&s!==void 0?s:!0),u}validatePasswordLengthOptions(t,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=t.length>=r),i&&(n.meetsMaxPasswordLength=t.length<=i)}validatePasswordCharacterOptions(t,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(t,n,r,i,o){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=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. - */class $R{constructor(t,n,r,i){this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Wy(this),this.idTokenSubscription=new Wy(this),this.beforeStateQueue=new LR(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=DS,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=Tr(n)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await jo.create(this,t),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const n=await FS(this,{idToken:t}),r=await Or._fromGetAccountInfoResponse(this,n,t);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var n;if(Sr(this.app)){const a=this.app.settings.authIdToken;return a?new Promise(s=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(a).then(s,s))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let i=r,o=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const a=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,s=i==null?void 0:i._redirectEventId,u=await this.tryRedirectSignIn(t);(!a||a===s)&&(u!=null&&u.user)&&(i=u.user,o=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(i)}catch(a){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(a))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return ke(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(t){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(t){try{await mc(t)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=bR()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(Sr(this.app))return Promise.reject(zi(this));const n=t?Si(t):null;return n&&ke(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(t,n=!1){if(!this._deleted)return t&&ke(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return Sr(this.app)?Promise.reject(zi(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return Sr(this.app)?Promise.reject(zi(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Tr(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await jR(this),n=new UR(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(t){this._errorFactory=new Xa("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}async revokeAccessToken(t){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await RR(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)===null||t===void 0?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&Tr(t)||this._popupRedirectResolver;ke(n,this,"argument-error"),this.redirectPersistenceManager=await jo.create(this,[Tr(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(t=this.currentUser)===null||t===void 0?void 0:t.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,i){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let a=!1;const s=this._isInitialized?Promise.resolve():this._initializationPromise;if(ke(s,this,"internal-error"),s.then(()=>{a||o(this.currentUser)}),typeof n=="function"){const u=t.addObserver(n,r,i);return()=>{a=!0,u()}}else{const u=t.addObserver(n);return()=>{a=!0,u()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return ke(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=KS(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var t;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((t=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var t;const n=await((t=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getToken());return n!=null&&n.error&&gR(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function rf(e){return Si(e)}class Wy{constructor(t){this.auth=t,this.observer=null,this.addObserver=kA(n=>this.observer=n)}get next(){return ke(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** - * @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. - */let Sm={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function VR(e){Sm=e}function BR(e){return Sm.loadJS(e)}function zR(){return Sm.gapiScript}function WR(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/** - * @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 HR(e,t){const n=cm(e,"auth");if(n.isInitialized()){const i=n.getImmediate(),o=n.getOptions();if(uc(o,t??{}))return i;lr(i,"already-initialized")}return n.initialize({options:t})}function GR(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Tr);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function qR(e,t,n){const r=rf(e);ke(r._canInitEmulator,r,"emulator-config-failed"),ke(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!1,o=YS(t),{host:a,port:s}=KR(t),u=s===null?"":`:${s}`;r.config.emulator={url:`${o}//${a}${u}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:a,port:s,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),YR()}function YS(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function KR(e){const t=YS(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const o=i[1];return{host:o,port:Hy(r.substr(o.length+1))}}else{const[o,a]=r.split(":");return{host:o,port:Hy(a)}}}function Hy(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function YR(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):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. - */class QS{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return Er("not implemented")}_getIdTokenResponse(t){return Er("not implemented")}_linkToIdToken(t,n){return Er("not implemented")}_getReauthenticationResolver(t){return Er("not implemented")}}/** - * @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. - */async function Fo(e,t){return ER(e,"POST","/v1/accounts:signInWithIdp",wm(e,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. - */const QR="http://localhost";class Xi extends QS{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new Xi(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):lr("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:i}=n,o=tl(n,["providerId","signInMethod"]);if(!r||!i)return null;const a=new Xi(r,i);return a.idToken=o.idToken||void 0,a.accessToken=o.accessToken||void 0,a.secret=o.secret,a.nonce=o.nonce,a.pendingToken=o.pendingToken||null,a}_getIdTokenResponse(t){const n=this.buildRequest();return Fo(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,Fo(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,Fo(t,n)}buildRequest(){const t={requestUri:QR,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=Za(n)}return 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. - */class Em{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/** - * @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 rl extends Em{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/** - * @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 Gr extends rl{constructor(){super("facebook.com")}static credential(t){return Xi._fromParams({providerId:Gr.PROVIDER_ID,signInMethod:Gr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Gr.credentialFromTaggedObject(t)}static credentialFromError(t){return Gr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Gr.credential(t.oauthAccessToken)}catch{return null}}}Gr.FACEBOOK_SIGN_IN_METHOD="facebook.com";Gr.PROVIDER_ID="facebook.com";/** - * @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 wr extends rl{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return Xi._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return wr.credentialFromTaggedObject(t)}static credentialFromError(t){return wr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return wr.credential(n,r)}catch{return null}}}wr.GOOGLE_SIGN_IN_METHOD="google.com";wr.PROVIDER_ID="google.com";/** - * @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 qr extends rl{constructor(){super("github.com")}static credential(t){return Xi._fromParams({providerId:qr.PROVIDER_ID,signInMethod:qr.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return qr.credentialFromTaggedObject(t)}static credentialFromError(t){return qr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return qr.credential(t.oauthAccessToken)}catch{return null}}}qr.GITHUB_SIGN_IN_METHOD="github.com";qr.PROVIDER_ID="github.com";/** - * @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 Kr extends rl{constructor(){super("twitter.com")}static credential(t,n){return Xi._fromParams({providerId:Kr.PROVIDER_ID,signInMethod:Kr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return Kr.credentialFromTaggedObject(t)}static credentialFromError(t){return Kr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return Kr.credential(n,r)}catch{return null}}}Kr.TWITTER_SIGN_IN_METHOD="twitter.com";Kr.PROVIDER_ID="twitter.com";/** - * @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 rs{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,n,r,i=!1){const o=await Or._fromIdTokenResponse(t,r,i),a=Gy(r);return new rs({user:o,providerId:a,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const i=Gy(r);return new rs({user:t,providerId:i,_tokenResponse:r,operationType:n})}}function Gy(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":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. - */class gc extends Nr{constructor(t,n,r,i){var o;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,gc.prototype),this.customData={appName:t.name,tenantId:(o=t.tenantId)!==null&&o!==void 0?o:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,i){return new gc(t,n,r,i)}}function JS(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?gc._fromErrorAndOperation(e,o,t,r):o})}async function JR(e,t,n=!1){const r=await Ma(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return rs._forOperation(e,"link",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. - */async function XR(e,t,n=!1){const{auth:r}=e;if(Sr(r.app))return Promise.reject(zi(r));const i="reauthenticate";try{const o=await Ma(e,JS(r,i,t,e),n);ke(o.idToken,r,"internal-error");const a=bm(o.idToken);ke(a,r,"internal-error");const{sub:s}=a;return ke(e.uid===s,r,"user-mismatch"),rs._forOperation(e,i,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&lr(r,"user-mismatch"),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. - */async function ZR(e,t,n=!1){if(Sr(e.app))return Promise.reject(zi(e));const r="signIn",i=await JS(e,r,t),o=await rs._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(o.user),o}function eN(e,t,n,r){return Si(e).onIdTokenChanged(t,n,r)}function tN(e,t,n){return Si(e).beforeAuthStateChanged(t,n)}function nN(e,t,n,r){return Si(e).onAuthStateChanged(t,n,r)}function rN(e){return Si(e).signOut()}const vc="__sak";/** - * @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 XS{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(vc,"1"),this.storage.removeItem(vc),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/** - * @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 iN(){const e=$t();return _m(e)||nf(e)}const oN=1e3,sN=10;class ZS extends XS{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=iN()&&MR(),this.fallbackToPolling=qS(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&t(n,i,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((a,s,u)=>{this.notifyListeners(a,u)});return}const r=t.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const a=this.storage.getItem(r);if(t.newValue!==a)t.newValue!==null?this.storage.setItem(r,t.newValue):this.storage.removeItem(r);else if(this.localCache[r]===t.newValue&&!n)return}const i=()=>{const a=this.storage.getItem(r);!n&&this.localCache[r]===a||this.notifyListeners(r,a)},o=this.storage.getItem(r);DR()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(i,sN):i()}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},oN)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,n){await super._set(t,n),this.localCache[t]=JSON.stringify(n)}async _get(t){const n=await super._get(t);return this.localCache[t]=JSON.stringify(n),n}async _remove(t){await super._remove(t),delete this.localCache[t]}}ZS.type="LOCAL";const aN=ZS;/** - * @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 eE extends XS{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}eE.type="SESSION";const tE=eE;/** - * @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. - */function lN(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason: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 of{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const n=this.receivers.find(i=>i.isListeningto(t));if(n)return n;const r=new of(t);return this.receivers.push(r),r}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const n=t,{eventId:r,eventType:i,data:o}=n.data,a=this.handlersMap[i];if(!(a!=null&&a.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const s=Array.from(a).map(async c=>c(n.origin,o)),u=await lN(s);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:u})}_subscribe(t,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(n)}_unsubscribe(t,n){this.handlersMap[t]&&n&&this.handlersMap[t].delete(n),(!n||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}of.receivers=[];/** - * @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 Om(e="",t=10){let n="";for(let r=0;r{const c=Om("",20);i.port1.start();const f=setTimeout(()=>{u(new Error("unsupported_event"))},r);a={messageChannel:i,onMessage(d){const p=d;if(p.data.eventId===c)switch(p.data.status){case"ack":clearTimeout(f),o=setTimeout(()=>{u(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),s(p.data.response);break;default:clearTimeout(f),clearTimeout(o),u(new Error("invalid_response"));break}}},this.handlers.add(a),i.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:t,eventId:c,data:n},[i.port2])}).finally(()=>{a&&this.removeMessageHandler(a)})}}/** - * @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 ar(){return window}function cN(e){ar().location.href=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. - */function nE(){return typeof ar().WorkerGlobalScope<"u"&&typeof ar().importScripts=="function"}async function fN(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function dN(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)===null||e===void 0?void 0:e.controller)||null}function hN(){return nE()?self:null}/** - * @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 rE="firebaseLocalStorageDb",pN=1,yc="firebaseLocalStorage",iE="fbase_key";class il{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function sf(e,t){return e.transaction([yc],t?"readwrite":"readonly").objectStore(yc)}function mN(){const e=indexedDB.deleteDatabase(rE);return new il(e).toPromise()}function Uh(){const e=indexedDB.open(rE,pN);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(yc,{keyPath:iE})}catch(i){n(i)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(yc)?t(r):(r.close(),await mN(),t(await Uh()))})})}async function qy(e,t,n){const r=sf(e,!0).put({[iE]:t,value:n});return new il(r).toPromise()}async function gN(e,t){const n=sf(e,!1).get(t),r=await new il(n).toPromise();return r===void 0?null:r.value}function Ky(e,t){const n=sf(e,!0).delete(t);return new il(n).toPromise()}const vN=800,yN=3;class oE{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Uh(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>yN)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return nE()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=of._getInstance(hN()),this.receiver._subscribe("keyChanged",async(t,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(t,n)=>["keyChanged"])}async initializeSender(){var t,n;if(this.activeServiceWorker=await fN(),!this.activeServiceWorker)return;this.sender=new uN(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((t=r[0])===null||t===void 0)&&t.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||dN()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Uh();return await qy(t,vc,"1"),await Ky(t,vc),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>qy(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>gN(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>Ky(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(i=>{const o=sf(i,!1).getAll();return new il(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(t.length!==0)for(const{fbase_key:i,value:o}of t)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(o)&&(this.notifyListeners(i,o),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),vN)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}oE.type="LOCAL";const wN=oE;new nl(3e4,6e4);/** - * @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 sE(e,t){return t?Tr(t):(ke(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/** - * @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 Tm extends QS{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Fo(t,this._buildIdpRequest())}_linkToIdToken(t,n){return Fo(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return Fo(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function bN(e){return ZR(e.auth,new Tm(e),e.bypassAuthState)}function _N(e){const{auth:t,user:n}=e;return ke(n,t,"internal-error"),XR(n,new Tm(e),e.bypassAuthState)}async function SN(e){const{auth:t,user:n}=e;return ke(n,t,"internal-error"),JR(n,new Tm(e),e.bypassAuthState)}/** - * @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 aE{constructor(t,n,r,i,o=!1){this.auth=t,this.resolver=r,this.user=i,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(t,n)=>{this.pendingPromise={resolve:t,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(t){const{urlResponse:n,sessionId:r,postBody:i,tenantId:o,error:a,type:s}=t;if(a){this.reject(a);return}const u={auth:this.auth,requestUri:n,sessionId:r,tenantId:o||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(s)(u))}catch(c){this.reject(c)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return bN;case"linkViaPopup":case"linkViaRedirect":return SN;case"reauthViaPopup":case"reauthViaRedirect":return _N;default:lr(this.auth,"internal-error")}}resolve(t){Ar(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){Ar(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** - * @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 EN=new nl(2e3,1e4);async function Yy(e,t,n){if(Sr(e.app))return Promise.reject(zn(e,"operation-not-supported-in-this-environment"));const r=rf(e);vR(e,t,Em);const i=sE(r,n);return new Mi(r,"signInViaPopup",t,i).executeNotNull()}class Mi extends aE{constructor(t,n,r,i,o){super(t,n,i,o),this.provider=r,this.authWindow=null,this.pollId=null,Mi.currentPopupAction&&Mi.currentPopupAction.cancel(),Mi.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return ke(t,this.auth,"internal-error"),t}async onExecution(){Ar(this.filter.length===1,"Popup operations only handle one event");const t=Om();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(zn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)===null||t===void 0?void 0:t.associatedEvent)||null}cancel(){this.reject(zn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Mi.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(zn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,EN.get())};t()}}Mi.currentPopupAction=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. - */const ON="pendingRedirect",Su=new Map;class TN extends aE{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Su.get(this.auth._key());if(!t){try{const r=await CN(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Su.set(this.auth._key(),t)}return this.bypassAuthState||Su.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=await this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function CN(e,t){const n=PN(t),r=kN(e);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function IN(e,t){Su.set(e._key(),t)}function kN(e){return Tr(e._redirectPersistence)}function PN(e){return _u(ON,e.config.apiKey,e.name)}async function xN(e,t,n=!1){if(Sr(e.app))return Promise.reject(zi(e));const r=rf(e),i=sE(r,t),a=await new TN(r,i,n).execute();return a&&!n&&(delete a.user._redirectEventId,await r._persistUserIfCurrent(a.user),await r._setRedirectUser(null,t)),a}/** - * @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 AN=10*60*1e3;class RN{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(t,r)&&(n=!0,this.sendToConsumer(t,r),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!NN(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!lE(t)){const i=((r=t.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(zn(this.auth,i))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=AN&&this.cachedEventUids.clear(),this.cachedEventUids.has(Qy(t))}saveEventToCache(t){this.cachedEventUids.add(Qy(t)),this.lastProcessedEventTime=Date.now()}}function Qy(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function lE({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function NN(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return lE(e);default:return!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. - */async function DN(e,t={}){return gs(e,"GET","/v1/projects",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. - */const MN=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,LN=/^https?/;async function jN(e){if(e.config.emulator)return;const{authorizedDomains:t}=await DN(e);for(const n of t)try{if(FN(n))return}catch{}lr(e,"unauthorized-domain")}function FN(e){const t=jh(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const a=new URL(e);return a.hostname===""&&r===""?n==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):n==="chrome-extension:"&&a.hostname===r}if(!LN.test(n))return!1;if(MN.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(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 UN=new nl(3e4,6e4);function Jy(){const e=ar().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n{var r,i,o;function a(){Jy(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Jy(),n(zn(e,"network-request-failed"))},timeout:UN.get()})}if(!((i=(r=ar().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)t(gapi.iframes.getContext());else if(!((o=ar().gapi)===null||o===void 0)&&o.load)a();else{const s=WR("iframefcb");return ar()[s]=()=>{gapi.load?a():n(zn(e,"network-request-failed"))},BR(`${zR()}?onload=${s}`).catch(u=>n(u))}}).catch(t=>{throw Eu=null,t})}let Eu=null;function VN(e){return Eu=Eu||$N(e),Eu}/** - * @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 BN=new nl(5e3,15e3),zN="__/auth/iframe",WN="emulator/auth/iframe",HN={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},GN=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function qN(e){const t=e.config;ke(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?ym(t,WN):`https://${e.config.authDomain}/${zN}`,r={apiKey:t.apiKey,appName:e.name,v:ms},i=GN.get(e.config.apiHost);i&&(r.eid=i);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${Za(r).slice(1)}`}async function KN(e){const t=await VN(e),n=ar().gapi;return ke(n,e,"internal-error"),t.open({where:document.body,url:qN(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:HN,dontclear:!0},r=>new Promise(async(i,o)=>{await r.restyle({setHideOnLeave:!1});const a=zn(e,"network-request-failed"),s=ar().setTimeout(()=>{o(a)},BN.get());function u(){ar().clearTimeout(s),i(r)}r.ping(u).then(u,()=>{o(a)})}))}/** - * @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 YN={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},QN=500,JN=600,XN="_blank",ZN="http://localhost";class Xy{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function eD(e,t,n,r=QN,i=JN){const o=Math.max((window.screen.availHeight-i)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString();let s="";const u=Object.assign(Object.assign({},YN),{width:r.toString(),height:i.toString(),top:o,left:a}),c=$t().toLowerCase();n&&(s=BS(c)?XN:n),VS(c)&&(t=t||ZN,u.scrollbars="yes");const f=Object.entries(u).reduce((p,[v,m])=>`${p}${v}=${m},`,"");if(NR(c)&&s!=="_self")return tD(t||"",s),new Xy(null);const d=window.open(t||"",s,f);ke(d,e,"popup-blocked");try{d.focus()}catch{}return new Xy(d)}function tD(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/** - * @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 nD="__/auth/handler",rD="emulator/auth/handler",iD=encodeURIComponent("fac");async function Zy(e,t,n,r,i,o){ke(e.config.authDomain,e,"auth-domain-config-required"),ke(e.config.apiKey,e,"invalid-api-key");const a={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:ms,eventId:i};if(t instanceof Em){t.setDefaultLanguage(e.languageCode),a.providerId=t.providerId||"",IA(t.getCustomParameters())||(a.customParameters=JSON.stringify(t.getCustomParameters()));for(const[f,d]of Object.entries({}))a[f]=d}if(t instanceof rl){const f=t.getScopes().filter(d=>d!=="");f.length>0&&(a.scopes=f.join(","))}e.tenantId&&(a.tid=e.tenantId);const s=a;for(const f of Object.keys(s))s[f]===void 0&&delete s[f];const u=await e._getAppCheckToken(),c=u?`#${iD}=${encodeURIComponent(u)}`:"";return`${oD(e)}?${Za(s).slice(1)}${c}`}function oD({config:e}){return e.emulator?ym(e,rD):`https://${e.authDomain}/${nD}`}/** - * @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 md="webStorageSupport";class sD{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=tE,this._completeRedirectFn=xN,this._overrideRedirectResult=IN}async _openPopup(t,n,r,i){var o;Ar((o=this.eventManagers[t._key()])===null||o===void 0?void 0:o.manager,"_initialize() not called before _openPopup()");const a=await Zy(t,n,r,jh(),i);return eD(t,a,Om())}async _openRedirect(t,n,r,i){await this._originValidation(t);const o=await Zy(t,n,r,jh(),i);return cN(o),new Promise(()=>{})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:i,promise:o}=this.eventManagers[n];return i?Promise.resolve(i):(Ar(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(t){const n=await KN(t),r=new RN(t);return n.register("authEvent",i=>(ke(i==null?void 0:i.authEvent,t,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,r}_isIframeWebStorageSupported(t,n){this.iframes[t._key()].send(md,{type:md},i=>{var o;const a=(o=i==null?void 0:i[0])===null||o===void 0?void 0:o[md];a!==void 0&&n(!!a),lr(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=jN(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return qS()||_m()||nf()}}const aD=sD;var e0="@firebase/auth",t0="1.7.4";/** - * @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 lD{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)===null||t===void 0?void 0:t.uid)||null}async getToken(t){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(t)}:null}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const n=this.auth.onIdTokenChanged(r=>{t((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,n),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const n=this.internalListeners.get(t);n&&(this.internalListeners.delete(t),n(),this.updateProactiveRefresh())}assertAuthConfigured(){ke(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** - * @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 uD(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function cD(e){es(new Qi("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),i=t.getProvider("heartbeat"),o=t.getProvider("app-check-internal"),{apiKey:a,authDomain:s}=r.options;ke(a&&!a.includes(":"),"invalid-api-key",{appName:r.name});const u={apiKey:a,authDomain:s,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:KS(e)},c=new $R(r,i,o,u);return GR(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),es(new Qi("auth-internal",t=>{const n=rf(t.getProvider("auth").getImmediate());return(r=>new lD(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),di(e0,t0,uD(e)),di(e0,t0,"esm2017")}/** - * @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 fD=5*60,dD=eS("authIdTokenMaxAge")||fD;let n0=null;const hD=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>dD)return;const i=n==null?void 0:n.token;n0!==i&&(n0=i,await fetch(e,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function pD(e=iS()){const t=cm(e,"auth");if(t.isInitialized())return t.getImmediate();const n=HR(e,{popupRedirectResolver:aD,persistence:[wN,aN,tE]}),r=eS("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const a=hD(o.toString());tN(n,a,()=>a(n.currentUser)),eN(n,s=>a(s))}}const i=X_("auth");return i&&qR(n,`http://${i}`),n}function mD(){var e,t;return(t=(e=document.getElementsByTagName("head"))===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:document}VR({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=i=>{const o=zn("internal-error");o.customData=i,n(o)},r.type="text/javascript",r.charset="UTF-8",mD().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});cD("Browser");let Cm;(()=>{const t=JSON.parse('{"apiKey": "AIzaSyCgzs_JIlAI5CE5EAOO8eQVJbqSI9YHNC4","authDomain": "simplitracapp.firebaseapp.com","databaseURL": "https://simplitracapp-default-rtdb.firebaseio.com","projectId": "simplitracapp","storageBucket": "simplitracapp.appspot.com","messagingSenderId": "242165323563","appId": "1:242165323563:web:5891ef2a45c8cf0183576e","measurementId": "G-3HSNQSS692"}');Cm=rS(t)})();oR(Cm);const wc=pD(Cm),r0=new wr,gD=()=>{const{setScreen:e,setUser:t,resetAppState:n}=K.useContext(Pn),r=async()=>{try{await rN(wc),localStorage.clear(),n()}catch(i){console.error("Error signing out: ",i)}};return j.jsx("button",{onClick:r,children:"Logout"})},vD=()=>{Zo.setAppElement("#root");const e=K.useRef(),{ocrData:t,user:n,setFormData:r,ocrModalOpen:i,setOcrModalOpen:o}=K.useContext(Pn),a=d=>{o(!d)},s=d=>(n.addTransaction(d),n.updateFirebase()),u=()=>new vh(t),c=d=>{switch(d.target.value){case"edit":r(u());break;case"submit":if(t.isNotComplete()){alert("Data not complete. Switching to edit mode"),r(u());break}t.error?alert(t.message):s(t);break;case"tryAgain":setScreen("camera");break}a(i)},f=d=>d.error?j.jsxs("li",{className:"source-type-modal__list-item",children:[j.jsx("label",{children:"Error"}),j.jsx("div",{children:d.message})]}):Object.entries(d).filter(p=>p[1]!==null&&p[1]!==void 0).map((p,v)=>{if(p[0]!=="transactionId")return j.jsxs("li",{className:"source-type-modal__list-item",children:[j.jsx("label",{children:p[0]}),j.jsx("div",{children:p[1]})]},v)});return j.jsx("div",{className:"source-type",children:j.jsxs(Zo,{style:yD,isOpen:i,className:"source-type-modal","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var d;return(d=e.current)==null?void 0:d.focus()},0)},children:[j.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:f(t)}),j.jsx("div",{className:"source-type-modal__controls",children:t.error?j.jsx("button",{value:"tryAgain",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:c,children:"Try Again"}):j.jsxs(j.Fragment,{children:[j.jsx("button",{value:"edit",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:c,children:"Edit Info"}),j.jsx("button",{value:"submit",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:c,children:"Submit"})]})})]})})},yD={content:{position:"relative",width:"300px",maxWidth:"80%",padding:"20px",background:"#fff",borderRadius:"8px",outline:"none",margin:"auto",inset:"auto"},overlay:{display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.75)"}};var uE={exports:{}};(function(e,t){(function(n,r){e.exports=r(K)})(typeof self<"u"?self:Hh,function(n){return function(r){var i={};function o(a){if(i[a])return i[a].exports;var s=i[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=r,o.c=i,o.d=function(a,s,u){o.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:u})},o.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},o.t=function(a,s){if(1&s&&(a=o(a)),8&s||4&s&&typeof a=="object"&&a&&a.__esModule)return a;var u=Object.create(null);if(o.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:a}),2&s&&typeof a!="string")for(var c in a)o.d(u,c,(function(f){return a[f]}).bind(null,c));return u},o.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return o.d(s,"a",s),s},o.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},o.p="",o(o.s=2)}([function(r,i){r.exports=n},function(r,i,o){var a={linear:function(s,u,c,f){return(c-u)*s/f+u},easeInQuad:function(s,u,c,f){return(c-u)*(s/=f)*s+u},easeOutQuad:function(s,u,c,f){return-(c-u)*(s/=f)*(s-2)+u},easeInOutQuad:function(s,u,c,f){var d=c-u;return(s/=f/2)<1?d/2*s*s+u:-d/2*(--s*(s-2)-1)+u},easeInCubic:function(s,u,c,f){return(c-u)*(s/=f)*s*s+u},easeOutCubic:function(s,u,c,f){return(c-u)*((s=s/f-1)*s*s+1)+u},easeInOutCubic:function(s,u,c,f){var d=c-u;return(s/=f/2)<1?d/2*s*s*s+u:d/2*((s-=2)*s*s+2)+u},easeInQuart:function(s,u,c,f){return(c-u)*(s/=f)*s*s*s+u},easeOutQuart:function(s,u,c,f){return-(c-u)*((s=s/f-1)*s*s*s-1)+u},easeInOutQuart:function(s,u,c,f){var d=c-u;return(s/=f/2)<1?d/2*s*s*s*s+u:-d/2*((s-=2)*s*s*s-2)+u},easeInQuint:function(s,u,c,f){return(c-u)*(s/=f)*s*s*s*s+u},easeOutQuint:function(s,u,c,f){return(c-u)*((s=s/f-1)*s*s*s*s+1)+u},easeInOutQuint:function(s,u,c,f){var d=c-u;return(s/=f/2)<1?d/2*s*s*s*s*s+u:d/2*((s-=2)*s*s*s*s+2)+u},easeInSine:function(s,u,c,f){var d=c-u;return-d*Math.cos(s/f*(Math.PI/2))+d+u},easeOutSine:function(s,u,c,f){return(c-u)*Math.sin(s/f*(Math.PI/2))+u},easeInOutSine:function(s,u,c,f){return-(c-u)/2*(Math.cos(Math.PI*s/f)-1)+u},easeInExpo:function(s,u,c,f){return s==0?u:(c-u)*Math.pow(2,10*(s/f-1))+u},easeOutExpo:function(s,u,c,f){var d=c-u;return s==f?u+d:d*(1-Math.pow(2,-10*s/f))+u},easeInOutExpo:function(s,u,c,f){var d=c-u;return s===0?u:s===f?u+d:(s/=f/2)<1?d/2*Math.pow(2,10*(s-1))+u:d/2*(2-Math.pow(2,-10*--s))+u},easeInCirc:function(s,u,c,f){return-(c-u)*(Math.sqrt(1-(s/=f)*s)-1)+u},easeOutCirc:function(s,u,c,f){return(c-u)*Math.sqrt(1-(s=s/f-1)*s)+u},easeInOutCirc:function(s,u,c,f){var d=c-u;return(s/=f/2)<1?-d/2*(Math.sqrt(1-s*s)-1)+u:d/2*(Math.sqrt(1-(s-=2)*s)+1)+u},easeInElastic:function(s,u,c,f){var d,p,v,m=c-u;return v=1.70158,s===0?u:(s/=f)==1?u+m:((p=0)||(p=.3*f),(d=m)=1&&this.rotationDirection===s.Positive?this.rotationDirection=s.Negative:this.rotateY<=-1&&this.rotationDirection===s.Negative&&(this.rotationDirection=s.Positive);var _e=.1*this.rotationDirection;if(this.rotateY+=_e,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=Ee,this.context.lineCap="round",this.context.lineWidth=2,Oe&&typeof Oe=="function")Oe.call(this,this.context);else switch(this.shape){case a.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case a.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case a.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}])&&v(D.prototype,F),P}();function I(P,D,F){return D in P?Object.defineProperty(P,D,{value:F,enumerable:!0,configurable:!0,writable:!0}):P[D]=F,P}var O=function P(D,F){var R=this;(function(H,ne){if(!(H instanceof ne))throw new TypeError("Cannot call a class as a function")})(this,P),I(this,"canvas",void 0),I(this,"context",void 0),I(this,"getOptions",void 0),I(this,"x",0),I(this,"y",0),I(this,"w",0),I(this,"h",0),I(this,"lastNumberOfPieces",0),I(this,"tweenInitTime",Date.now()),I(this,"particles",[]),I(this,"particlesGenerated",0),I(this,"removeParticleAt",function(H){R.particles.splice(H,1)}),I(this,"getParticle",function(){var H=p(R.x,R.w+R.x),ne=p(R.y,R.h+R.y);return new w(R.context,R.getOptions,H,ne)}),I(this,"animate",function(){var H=R.canvas,ne=R.context,Ee=R.particlesGenerated,Oe=R.lastNumberOfPieces,_e=R.getOptions(),A=_e.run,V=_e.recycle,z=_e.numberOfPieces,se=_e.debug,X=_e.tweenFunction,Q=_e.tweenDuration;if(!A)return!1;var he=R.particles.length,ae=V?he:Ee,de=Date.now();if(aeQ?Q:Math.max(0,de-ce),ae,z,Q),ft=Math.round(Ae-ae),rt=0;rtH.height||Ce.y<-100||Ce.x>H.width+100||Ce.x<-100)&&(V&&ae<=z?R.particles[Se]=R.getParticle():R.removeParticleAt(Se))}),he>0||ae0&&_e.call(H,H),H._options.run=!1)}),M(this,"reset",function(){H.generator&&H.generator.particlesGenerated>0&&(H.generator.particlesGenerated=0,H.generator.particles=[],H.generator.lastNumberOfPieces=0)}),M(this,"stop",function(){H.options={run:!1},H.rafId&&(cancelAnimationFrame(H.rafId),H.rafId=void 0)}),this.canvas=R;var ne=this.canvas.getContext("2d");if(!ne)throw new Error("Could not get canvas context");this.context=ne,this.generator=new O(this.canvas,function(){return H.options}),this.options=ue,this.update()}var D,F;return D=P,(F=[{key:"options",get:function(){return this._options},set:function(R){var ue=this._options&&this._options.run,H=this._options&&this._options.recycle;this.setOptionsWithDefaults(R),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof R.recycle=="boolean"&&R.recycle&&H===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof R.run=="boolean"&&R.run&&ue===!1&&this.update()}}])&&x(D.prototype,F),P}();function b(P){return function(D){if(Array.isArray(D))return q(D)}(P)||function(D){if(typeof Symbol<"u"&&Symbol.iterator in Object(D))return Array.from(D)}(P)||ie(P)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function T(P){return(T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D})(P)}function k(){return(k=Object.assign||function(P){for(var D=1;D"u"||!(Symbol.iterator in Object(F)))){var ue=[],H=!0,ne=!1,Ee=void 0;try{for(var Oe,_e=F[Symbol.iterator]();!(H=(Oe=_e.next()).done)&&(ue.push(Oe.value),!R||ue.length!==R);H=!0);}catch(A){ne=!0,Ee=A}finally{try{H||_e.return==null||_e.return()}finally{if(ne)throw Ee}}return ue}}(P,D)||ie(P,D)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ie(P,D){if(P){if(typeof P=="string")return q(P,D);var F=Object.prototype.toString.call(P).slice(8,-1);return F==="Object"&&P.constructor&&(F=P.constructor.name),F==="Map"||F==="Set"?Array.from(P):F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F)?q(P,D):void 0}}function q(P,D){(D==null||D>P.length)&&(D=P.length);for(var F=0,R=new Array(D);F"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var F,R=be(P);if(D){var ue=be(this).constructor;F=Reflect.construct(R,arguments,ue)}else F=R.apply(this,arguments);return oe(this,F)}}function oe(P,D){return!D||T(D)!=="object"&&typeof D!="function"?we(P):D}function we(P){if(P===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P}function be(P){return(be=Object.setPrototypeOf?Object.getPrototypeOf:function(D){return D.__proto__||Object.getPrototypeOf(D)})(P)}function Te(P,D,F){return D in P?Object.defineProperty(P,D,{value:F,enumerable:!0,configurable:!0,writable:!0}):P[D]=F,P}var Ge=c.a.createRef(),$e=function(P){(function(H,ne){if(typeof ne!="function"&&ne!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(ne&&ne.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),ne&&W(H,ne)})(ue,P);var D,F,R=Z(ue);function ue(H){var ne;te(this,ue);for(var Ee=arguments.length,Oe=new Array(Ee>1?Ee-1:0),_e=1;_e{Zo.setAppElement("#root");const e=K.useRef(),{serverResponse:t,setServerResponse:n,setOcrData:r}=K.useContext(Pn),[i,o]=K.useState(!!t),{width:a,height:s}=PD(),u=d=>{o(!d)},c=d=>{u(i),n(""),r(new Zt)},f=()=>[t].map((p,v)=>j.jsx("li",{className:"source-type-modal__list-item",children:j.jsx("label",{children:p})},v));return j.jsxs("div",{className:"source-type",children:[j.jsxs(Zo,{style:AD,isOpen:i,className:"source-type-modal","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var d;return(d=e.current)==null?void 0:d.focus()},0)},children:[j.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:f()}),j.jsx("div",{className:"source-type-modal__controls",children:j.jsx("button",{value:"Okay",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:c,children:"Okay"})})]}),i&&j.jsx(bD,{width:a,height:s})]})},AD={content:{position:"relative",width:"300px",maxWidth:"80%",padding:"20px",background:"#fff",borderRadius:"8px",outline:"none",margin:"auto",inset:"auto"},overlay:{display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.75)"}},RD=({show:e,achievement:t,onClose:n})=>{if(!e||!t)return null;const r={position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#fff",padding:"20px",borderRadius:"8px",boxShadow:"0 0 10px rgba(0,0,0,0.1)",zIndex:1e3},i={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",zIndex:999};return J.createElement(J.Fragment,null,J.createElement("div",{style:i,onClick:n}),J.createElement("div",{style:r,role:"dialog","aria-modal":"true","aria-labelledby":"achievement-title"},J.createElement("h2",{id:"achievement-title"},"Achievement Unlocked!"),J.createElement("img",{src:t.icon,alt:t.title,style:{width:"50px",height:"50px"}}),J.createElement("h3",null,t.title),J.createElement("p",null,t.description),J.createElement("button",{onClick:n},"Okay")))};var ND=J.memo(RD);const DD=({show:e,achievements:t,onClose:n})=>{if(!e)return null;const r={position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#fff",padding:"20px",borderRadius:"8px",boxShadow:"0 0 10px rgba(0,0,0,0.1)",zIndex:1e3,maxWidth:"80%",maxHeight:"80%",overflow:"auto"},i={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",zIndex:999};return J.createElement(J.Fragment,null,J.createElement("div",{style:i,onClick:n}),J.createElement("div",{style:r,role:"dialog","aria-modal":"true","aria-labelledby":"badges-title"},J.createElement("h2",{id:"badges-title"},"Your Achievements"),J.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"center"}},t.map(o=>J.createElement("div",{key:o.id,style:{margin:"10px",textAlign:"center"}},J.createElement("img",{src:o.icon,alt:o.title,style:{width:"50px",height:"50px"}}),J.createElement("h4",null,o.title)))),J.createElement("button",{onClick:n,style:{marginTop:"20px"}},"Close")))};var MD=J.memo(DD);const LD=({onClick:e,position:t})=>{const n={position:"fixed",[t.split("-")[0]]:"20px",[t.split("-")[1]]:"20px",padding:"10px 20px",backgroundColor:"#007bff",color:"#fff",border:"none",borderRadius:"5px",cursor:"pointer",zIndex:998};return J.createElement("button",{style:n,onClick:e},"View Achievements")};var jD=J.memo(LD),FD=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function UD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fE={exports:{}};(function(e,t){(function(n,r){e.exports=r(J)})(typeof self<"u"?self:FD,function(n){return function(r){var i={};function o(a){if(i[a])return i[a].exports;var s=i[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=r,o.c=i,o.d=function(a,s,u){o.o(a,s)||Object.defineProperty(a,s,{enumerable:!0,get:u})},o.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},o.t=function(a,s){if(1&s&&(a=o(a)),8&s||4&s&&typeof a=="object"&&a&&a.__esModule)return a;var u=Object.create(null);if(o.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:a}),2&s&&typeof a!="string")for(var c in a)o.d(u,c,(function(f){return a[f]}).bind(null,c));return u},o.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return o.d(s,"a",s),s},o.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},o.p="",o(o.s=2)}([function(r,i){r.exports=n},function(r,i,o){var a={linear:function(s,u,c,f){return(c-u)*s/f+u},easeInQuad:function(s,u,c,f){return(c-u)*(s/=f)*s+u},easeOutQuad:function(s,u,c,f){return-(c-u)*(s/=f)*(s-2)+u},easeInOutQuad:function(s,u,c,f){var d=c-u;return(s/=f/2)<1?d/2*s*s+u:-d/2*(--s*(s-2)-1)+u},easeInCubic:function(s,u,c,f){return(c-u)*(s/=f)*s*s+u},easeOutCubic:function(s,u,c,f){return(c-u)*((s=s/f-1)*s*s+1)+u},easeInOutCubic:function(s,u,c,f){var d=c-u;return(s/=f/2)<1?d/2*s*s*s+u:d/2*((s-=2)*s*s+2)+u},easeInQuart:function(s,u,c,f){return(c-u)*(s/=f)*s*s*s+u},easeOutQuart:function(s,u,c,f){return-(c-u)*((s=s/f-1)*s*s*s-1)+u},easeInOutQuart:function(s,u,c,f){var d=c-u;return(s/=f/2)<1?d/2*s*s*s*s+u:-d/2*((s-=2)*s*s*s-2)+u},easeInQuint:function(s,u,c,f){return(c-u)*(s/=f)*s*s*s*s+u},easeOutQuint:function(s,u,c,f){return(c-u)*((s=s/f-1)*s*s*s*s+1)+u},easeInOutQuint:function(s,u,c,f){var d=c-u;return(s/=f/2)<1?d/2*s*s*s*s*s+u:d/2*((s-=2)*s*s*s*s+2)+u},easeInSine:function(s,u,c,f){var d=c-u;return-d*Math.cos(s/f*(Math.PI/2))+d+u},easeOutSine:function(s,u,c,f){return(c-u)*Math.sin(s/f*(Math.PI/2))+u},easeInOutSine:function(s,u,c,f){return-(c-u)/2*(Math.cos(Math.PI*s/f)-1)+u},easeInExpo:function(s,u,c,f){return s==0?u:(c-u)*Math.pow(2,10*(s/f-1))+u},easeOutExpo:function(s,u,c,f){var d=c-u;return s==f?u+d:d*(1-Math.pow(2,-10*s/f))+u},easeInOutExpo:function(s,u,c,f){var d=c-u;return s===0?u:s===f?u+d:(s/=f/2)<1?d/2*Math.pow(2,10*(s-1))+u:d/2*(2-Math.pow(2,-10*--s))+u},easeInCirc:function(s,u,c,f){return-(c-u)*(Math.sqrt(1-(s/=f)*s)-1)+u},easeOutCirc:function(s,u,c,f){return(c-u)*Math.sqrt(1-(s=s/f-1)*s)+u},easeInOutCirc:function(s,u,c,f){var d=c-u;return(s/=f/2)<1?-d/2*(Math.sqrt(1-s*s)-1)+u:d/2*(Math.sqrt(1-(s-=2)*s)+1)+u},easeInElastic:function(s,u,c,f){var d,p,v,m=c-u;return v=1.70158,s===0?u:(s/=f)==1?u+m:((p=0)||(p=.3*f),(d=m)=1&&this.rotationDirection===s.Positive?this.rotationDirection=s.Negative:this.rotateY<=-1&&this.rotationDirection===s.Negative&&(this.rotationDirection=s.Positive);var _e=.1*this.rotationDirection;if(this.rotateY+=_e,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=Ee,this.context.lineCap="round",this.context.lineWidth=2,Oe&&typeof Oe=="function")Oe.call(this,this.context);else switch(this.shape){case a.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case a.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case a.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}])&&v(D.prototype,F),P}();function I(P,D,F){return D in P?Object.defineProperty(P,D,{value:F,enumerable:!0,configurable:!0,writable:!0}):P[D]=F,P}var O=function P(D,F){var R=this;(function(H,ne){if(!(H instanceof ne))throw new TypeError("Cannot call a class as a function")})(this,P),I(this,"canvas",void 0),I(this,"context",void 0),I(this,"getOptions",void 0),I(this,"x",0),I(this,"y",0),I(this,"w",0),I(this,"h",0),I(this,"lastNumberOfPieces",0),I(this,"tweenInitTime",Date.now()),I(this,"particles",[]),I(this,"particlesGenerated",0),I(this,"removeParticleAt",function(H){R.particles.splice(H,1)}),I(this,"getParticle",function(){var H=p(R.x,R.w+R.x),ne=p(R.y,R.h+R.y);return new w(R.context,R.getOptions,H,ne)}),I(this,"animate",function(){var H=R.canvas,ne=R.context,Ee=R.particlesGenerated,Oe=R.lastNumberOfPieces,_e=R.getOptions(),A=_e.run,V=_e.recycle,z=_e.numberOfPieces,se=_e.debug,X=_e.tweenFunction,Q=_e.tweenDuration;if(!A)return!1;var he=R.particles.length,ae=V?he:Ee,de=Date.now();if(aeQ?Q:Math.max(0,de-ce),ae,z,Q),ft=Math.round(Ae-ae),rt=0;rtH.height||Ce.y<-100||Ce.x>H.width+100||Ce.x<-100)&&(V&&ae<=z?R.particles[Se]=R.getParticle():R.removeParticleAt(Se))}),he>0||ae0&&_e.call(H,H),H._options.run=!1)}),M(this,"reset",function(){H.generator&&H.generator.particlesGenerated>0&&(H.generator.particlesGenerated=0,H.generator.particles=[],H.generator.lastNumberOfPieces=0)}),M(this,"stop",function(){H.options={run:!1},H.rafId&&(cancelAnimationFrame(H.rafId),H.rafId=void 0)}),this.canvas=R;var ne=this.canvas.getContext("2d");if(!ne)throw new Error("Could not get canvas context");this.context=ne,this.generator=new O(this.canvas,function(){return H.options}),this.options=ue,this.update()}var D,F;return D=P,(F=[{key:"options",get:function(){return this._options},set:function(R){var ue=this._options&&this._options.run,H=this._options&&this._options.recycle;this.setOptionsWithDefaults(R),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof R.recycle=="boolean"&&R.recycle&&H===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof R.run=="boolean"&&R.run&&ue===!1&&this.update()}}])&&x(D.prototype,F),P}();function b(P){return function(D){if(Array.isArray(D))return q(D)}(P)||function(D){if(typeof Symbol<"u"&&Symbol.iterator in Object(D))return Array.from(D)}(P)||ie(P)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function T(P){return(T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D})(P)}function k(){return(k=Object.assign||function(P){for(var D=1;D"u"||!(Symbol.iterator in Object(F)))){var ue=[],H=!0,ne=!1,Ee=void 0;try{for(var Oe,_e=F[Symbol.iterator]();!(H=(Oe=_e.next()).done)&&(ue.push(Oe.value),!R||ue.length!==R);H=!0);}catch(A){ne=!0,Ee=A}finally{try{H||_e.return==null||_e.return()}finally{if(ne)throw Ee}}return ue}}(P,D)||ie(P,D)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ie(P,D){if(P){if(typeof P=="string")return q(P,D);var F=Object.prototype.toString.call(P).slice(8,-1);return F==="Object"&&P.constructor&&(F=P.constructor.name),F==="Map"||F==="Set"?Array.from(P):F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F)?q(P,D):void 0}}function q(P,D){(D==null||D>P.length)&&(D=P.length);for(var F=0,R=new Array(D);F"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var F,R=be(P);if(D){var ue=be(this).constructor;F=Reflect.construct(R,arguments,ue)}else F=R.apply(this,arguments);return oe(this,F)}}function oe(P,D){return!D||T(D)!=="object"&&typeof D!="function"?we(P):D}function we(P){if(P===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P}function be(P){return(be=Object.setPrototypeOf?Object.getPrototypeOf:function(D){return D.__proto__||Object.getPrototypeOf(D)})(P)}function Te(P,D,F){return D in P?Object.defineProperty(P,D,{value:F,enumerable:!0,configurable:!0,writable:!0}):P[D]=F,P}var Ge=c.a.createRef(),$e=function(P){(function(H,ne){if(typeof ne!="function"&&ne!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(ne&&ne.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),ne&&W(H,ne)})(ue,P);var D,F,R=Z(ue);function ue(H){var ne;te(this,ue);for(var Ee=arguments.length,Oe=new Array(Ee>1?Ee-1:0),_e=1;_e{const{width:n,height:r}=qD();return e?J.createElement(VD,Object.assign({width:n,height:r},t)):null},YD=K.createContext(void 0),QD=({children:e,config:t,initialState:n={},storageKey:r="react-achievements",badgesButtonPosition:i="top-right"})=>{const o=x=>Object.keys(t).reduce((M,U)=>(U in x?M[U]=x[U]:M[U]=[],M),{}),a=()=>{const x=Object.values(t).flatMap(M=>M.filter(U=>c.includes(U.data.id)).map(U=>U.data));return console.log(x),x},[s,u]=K.useState(()=>{const x=localStorage.getItem(`${r}-metrics`);return x?JSON.parse(x):o(n)}),[c,f]=K.useState(()=>{const x=localStorage.getItem(`${r}-achievements`);return x?JSON.parse(x):[]}),[d,p]=K.useState(null),[v,m]=K.useState(!1),[w,I]=K.useState(!1);K.useEffect(()=>{localStorage.setItem(`${r}-metrics`,JSON.stringify(s))},[s,r]);const O=K.useCallback(()=>{const x=[];if(Object.entries(t).forEach(([M,U])=>{const E=s[M];U.forEach(b=>{b.check(E)&&!c.includes(b.data.id)&&x.push(b.data)})}),x.length>0){const M=[...c,...x.map(U=>U.id)];f(M),localStorage.setItem(`${r}-achievements`,JSON.stringify(M)),p(x[0]),I(!0)}},[t,s,c,r]);K.useEffect(()=>{O()},[O]);const y=()=>{m(!0)},S={metrics:s,setMetrics:x=>{u(M=>typeof x=="function"?x(M):x)},achievedAchievements:c,checkAchievements:O,showBadgesModal:y};return J.createElement(YD.Provider,{value:S},e,J.createElement(ND,{show:!!d,achievement:d,onClose:()=>{p(null),I(!1)}}),J.createElement(MD,{show:v,achievements:a(),onClose:()=>m(!1)}),J.createElement(jD,{onClick:y,position:i}),J.createElement(KD,{show:w}))},Jl="/assets/badge_1-C-eV18Km.png",JD={transactions:[{check:e=>e.length>=1,data:{id:"first_transaction",title:"First Transaction",description:"Completed your first transaction",icon:Jl}},{check:e=>e.length>=10,data:{id:"ten_transactions",title:"Ten Transactions",description:"Completed ten transactions",icon:Jl}}],categories:[{check:e=>e.length>=1,data:{id:"first_category",title:"First Category",description:"Created your first category",icon:Jl}},{check:e=>e.length>=5,data:{id:"five_categories",title:"Five Categories",description:"Created five categories",icon:Jl}}]};function dE(e){return t=>typeof t===e}var XD=dE("function"),ZD=e=>e===null,l0=e=>Object.prototype.toString.call(e).slice(8,-1)==="RegExp",u0=e=>!eM(e)&&!ZD(e)&&(XD(e)||typeof e=="object"),eM=dE("undefined");function tM(e,t){const{length:n}=e;if(n!==t.length)return!1;for(let r=n;r--!==0;)if(!Gt(e[r],t[r]))return!1;return!0}function nM(e,t){if(e.byteLength!==t.byteLength)return!1;const n=new DataView(e.buffer),r=new DataView(t.buffer);let i=e.byteLength;for(;i--;)if(n.getUint8(i)!==r.getUint8(i))return!1;return!0}function rM(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!Gt(n[1],t.get(n[0])))return!1;return!0}function iM(e,t){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}function Gt(e,t){if(e===t)return!0;if(e&&u0(e)&&t&&u0(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return tM(e,t);if(e instanceof Map&&t instanceof Map)return rM(e,t);if(e instanceof Set&&t instanceof Set)return iM(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return nM(e,t);if(l0(e)&&l0(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=n.length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[i]))return!1;for(let i=n.length;i--!==0;){const o=n[i];if(!(o==="_owner"&&e.$$typeof)&&!Gt(e[o],t[o]))return!1}return!0}return Number.isNaN(e)&&Number.isNaN(t)?!0:e===t}var oM=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],sM=["bigint","boolean","null","number","string","symbol","undefined"];function af(e){const t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(aM(t))return t}function qn(e){return t=>af(t)===e}function aM(e){return oM.includes(e)}function vs(e){return t=>typeof t===e}function lM(e){return sM.includes(e)}var uM=["innerHTML","ownerDocument","style","attributes","nodeValue"];function pe(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(pe.array(e))return"Array";if(pe.plainFunction(e))return"Function";const t=af(e);return t||"Object"}pe.array=Array.isArray;pe.arrayOf=(e,t)=>!pe.array(e)&&!pe.function(t)?!1:e.every(n=>t(n));pe.asyncGeneratorFunction=e=>af(e)==="AsyncGeneratorFunction";pe.asyncFunction=qn("AsyncFunction");pe.bigint=vs("bigint");pe.boolean=e=>e===!0||e===!1;pe.date=qn("Date");pe.defined=e=>!pe.undefined(e);pe.domElement=e=>pe.object(e)&&!pe.plainObject(e)&&e.nodeType===1&&pe.string(e.nodeName)&&uM.every(t=>t in e);pe.empty=e=>pe.string(e)&&e.length===0||pe.array(e)&&e.length===0||pe.object(e)&&!pe.map(e)&&!pe.set(e)&&Object.keys(e).length===0||pe.set(e)&&e.size===0||pe.map(e)&&e.size===0;pe.error=qn("Error");pe.function=vs("function");pe.generator=e=>pe.iterable(e)&&pe.function(e.next)&&pe.function(e.throw);pe.generatorFunction=qn("GeneratorFunction");pe.instanceOf=(e,t)=>!e||!t?!1:Object.getPrototypeOf(e)===t.prototype;pe.iterable=e=>!pe.nullOrUndefined(e)&&pe.function(e[Symbol.iterator]);pe.map=qn("Map");pe.nan=e=>Number.isNaN(e);pe.null=e=>e===null;pe.nullOrUndefined=e=>pe.null(e)||pe.undefined(e);pe.number=e=>vs("number")(e)&&!pe.nan(e);pe.numericString=e=>pe.string(e)&&e.length>0&&!Number.isNaN(Number(e));pe.object=e=>!pe.nullOrUndefined(e)&&(pe.function(e)||typeof e=="object");pe.oneOf=(e,t)=>pe.array(e)?e.indexOf(t)>-1:!1;pe.plainFunction=qn("Function");pe.plainObject=e=>{if(af(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};pe.primitive=e=>pe.null(e)||lM(typeof e);pe.promise=qn("Promise");pe.propertyOf=(e,t,n)=>{if(!pe.object(e)||!t)return!1;const r=e[t];return pe.function(n)?n(r):pe.defined(r)};pe.regexp=qn("RegExp");pe.set=qn("Set");pe.string=vs("string");pe.symbol=vs("symbol");pe.undefined=vs("undefined");pe.weakMap=qn("WeakMap");pe.weakSet=qn("WeakSet");var ve=pe;function cM(...e){return e.every(t=>ve.string(t)||ve.array(t)||ve.plainObject(t))}function fM(e,t,n){return hE(e,t)?[e,t].every(ve.array)?!e.some(p0(n))&&t.some(p0(n)):[e,t].every(ve.plainObject)?!Object.entries(e).some(h0(n))&&Object.entries(t).some(h0(n)):t===n:!1}function c0(e,t,n){const{actual:r,key:i,previous:o,type:a}=n,s=rr(e,i),u=rr(t,i);let c=[s,u].every(ve.number)&&(a==="increased"?su);return ve.undefined(r)||(c=c&&u===r),ve.undefined(o)||(c=c&&s===o),c}function f0(e,t,n){const{key:r,type:i,value:o}=n,a=rr(e,r),s=rr(t,r),u=i==="added"?a:s,c=i==="added"?s:a;if(!ve.nullOrUndefined(o)){if(ve.defined(u)){if(ve.array(u)||ve.plainObject(u))return fM(u,c,o)}else return Gt(c,o);return!1}return[a,s].every(ve.array)?!c.every(km(u)):[a,s].every(ve.plainObject)?dM(Object.keys(u),Object.keys(c)):![a,s].every(f=>ve.primitive(f)&&ve.defined(f))&&(i==="added"?!ve.defined(a)&&ve.defined(s):ve.defined(a)&&!ve.defined(s))}function d0(e,t,{key:n}={}){let r=rr(e,n),i=rr(t,n);if(!hE(r,i))throw new TypeError("Inputs have different types");if(!cM(r,i))throw new TypeError("Inputs don't have length");return[r,i].every(ve.plainObject)&&(r=Object.keys(r),i=Object.keys(i)),[r,i]}function h0(e){return([t,n])=>ve.array(e)?Gt(e,n)||e.some(r=>Gt(r,n)||ve.array(n)&&km(n)(r)):ve.plainObject(e)&&e[t]?!!e[t]&&Gt(e[t],n):Gt(e,n)}function dM(e,t){return t.some(n=>!e.includes(n))}function p0(e){return t=>ve.array(e)?e.some(n=>Gt(n,t)||ve.array(t)&&km(t)(n)):Gt(e,t)}function Bs(e,t){return ve.array(e)?e.some(n=>Gt(n,t)):Gt(e,t)}function km(e){return t=>e.some(n=>Gt(n,t))}function hE(...e){return e.every(ve.array)||e.every(ve.number)||e.every(ve.plainObject)||e.every(ve.string)}function rr(e,t){return ve.plainObject(e)||ve.array(e)?ve.string(t)?t.split(".").reduce((r,i)=>r&&r[i],e):ve.number(t)?e[t]:e:e}function bc(e,t){if([e,t].some(ve.nullOrUndefined))throw new Error("Missing required parameters");if(![e,t].every(f=>ve.plainObject(f)||ve.array(f)))throw new Error("Expected plain objects or array");return{added:(f,d)=>{try{return f0(e,t,{key:f,type:"added",value:d})}catch{return!1}},changed:(f,d,p)=>{try{const v=rr(e,f),m=rr(t,f),w=ve.defined(d),I=ve.defined(p);if(w||I){const O=I?Bs(p,v):!Bs(d,v),y=Bs(d,m);return O&&y}return[v,m].every(ve.array)||[v,m].every(ve.plainObject)?!Gt(v,m):v!==m}catch{return!1}},changedFrom:(f,d,p)=>{if(!ve.defined(f))return!1;try{const v=rr(e,f),m=rr(t,f),w=ve.defined(p);return Bs(d,v)&&(w?Bs(p,m):!w)}catch{return!1}},decreased:(f,d,p)=>{if(!ve.defined(f))return!1;try{return c0(e,t,{key:f,actual:d,previous:p,type:"decreased"})}catch{return!1}},emptied:f=>{try{const[d,p]=d0(e,t,{key:f});return!!d.length&&!p.length}catch{return!1}},filled:f=>{try{const[d,p]=d0(e,t,{key:f});return!d.length&&!!p.length}catch{return!1}},increased:(f,d,p)=>{if(!ve.defined(f))return!1;try{return c0(e,t,{key:f,actual:d,previous:p,type:"increased"})}catch{return!1}},removed:(f,d)=>{try{return f0(e,t,{key:f,type:"removed",value:d})}catch{return!1}}}}var hM=new Error("Element already at target scroll position"),pM=new Error("Scroll cancelled"),mM=Math.min,m0=Date.now,gM={left:g0("scrollLeft"),top:g0("scrollTop")};function g0(e){return function(n,r,i,o){i=i||{},typeof i=="function"&&(o=i,i={}),typeof o!="function"&&(o=yM);var a=m0(),s=n[e],u=i.ease||vM,c=isNaN(i.duration)?350:+i.duration,f=!1;return s===r?o(hM,n[e]):requestAnimationFrame(p),d;function d(){f=!0}function p(v){if(f)return o(pM,n[e]);var m=m0(),w=mM(1,(m-a)/c),I=u(w);n[e]=I*(r-s)+s,w<1?requestAnimationFrame(p):requestAnimationFrame(function(){o(null,n[e])})}}}function vM(e){return .5*(1-Math.cos(Math.PI*e))}function yM(){}const wM=ur(gM);var pE={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.Scrollparent=n()})(Hh,function(){function t(r){var i=getComputedStyle(r,null).getPropertyValue("overflow");return i.indexOf("scroll")>-1||i.indexOf("auto")>-1}function n(r){if(r instanceof HTMLElement||r instanceof SVGElement){for(var i=r.parentNode;i.parentNode;){if(t(i))return i;i=i.parentNode}return document.scrollingElement||document.documentElement}}return n})})(pE);var bM=pE.exports;const mE=ur(bM);var _M=function(t){return SM(t)&&!EM(t)};function SM(e){return!!e&&typeof e=="object"}function EM(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||CM(e)}var OM=typeof Symbol=="function"&&Symbol.for,TM=OM?Symbol.for("react.element"):60103;function CM(e){return e.$$typeof===TM}function IM(e){return Array.isArray(e)?[]:{}}function La(e,t){return t.clone!==!1&&t.isMergeableObject(e)?is(IM(e),e,t):e}function kM(e,t,n){return e.concat(t).map(function(r){return La(r,n)})}function PM(e,t){if(!t.customMerge)return is;var n=t.customMerge(e);return typeof n=="function"?n:is}function xM(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function v0(e){return Object.keys(e).concat(xM(e))}function gE(e,t){try{return t in e}catch{return!1}}function AM(e,t){return gE(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function RM(e,t,n){var r={};return n.isMergeableObject(e)&&v0(e).forEach(function(i){r[i]=La(e[i],n)}),v0(t).forEach(function(i){AM(e,i)||(gE(e,i)&&n.isMergeableObject(t[i])?r[i]=PM(i,n)(e[i],t[i],n):r[i]=La(t[i],n))}),r}function is(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||kM,n.isMergeableObject=n.isMergeableObject||_M,n.cloneUnlessOtherwiseSpecified=La;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):RM(e,t,n):La(t,n)}is.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return is(r,i,n)},{})};var NM=is,DM=NM;const Fn=ur(DM);/**! - * @fileOverview Kickass library to create and place poppers near their reference elements. - * @version 1.16.1 - * @license - * Copyright (c) 2016 Federico Zivolo and contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */var ol=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",MM=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();function LM(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function jM(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},MM))}}var FM=ol&&window.Promise,UM=FM?LM:jM;function vE(e){var t={};return e&&t.toString.call(e)==="[object Function]"}function no(e,t){if(e.nodeType!==1)return[];var n=e.ownerDocument.defaultView,r=n.getComputedStyle(e,null);return t?r[t]:r}function Pm(e){return e.nodeName==="HTML"?e:e.parentNode||e.host}function sl(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=no(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:sl(Pm(e))}function yE(e){return e&&e.referenceNode?e.referenceNode:e}var y0=ol&&!!(window.MSInputMethodContext&&document.documentMode),w0=ol&&/MSIE 10/.test(navigator.userAgent);function ys(e){return e===11?y0:e===10?w0:y0||w0}function os(e){if(!e)return document.documentElement;for(var t=ys(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?e?e.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&no(n,"position")==="static"?os(n):n}function $M(e){var t=e.nodeName;return t==="BODY"?!1:t==="HTML"||os(e.firstElementChild)===e}function $h(e){return e.parentNode!==null?$h(e.parentNode):e}function _c(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a=o.commonAncestorContainer;if(e!==a&&t!==a||r.contains(i))return $M(a)?a:os(a);var s=$h(e);return s.host?_c(s.host,t):_c(e,$h(t).host)}function ss(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=t==="top"?"scrollTop":"scrollLeft",r=e.nodeName;if(r==="BODY"||r==="HTML"){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function VM(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=ss(t,"top"),i=ss(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function b0(e,t){var n=t==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function _0(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],ys(10)?parseInt(n["offset"+e])+parseInt(r["margin"+(e==="Height"?"Top":"Left")])+parseInt(r["margin"+(e==="Height"?"Bottom":"Right")]):0)}function wE(e){var t=e.body,n=e.documentElement,r=ys(10)&&getComputedStyle(n);return{height:_0("Height",t,n,r),width:_0("Width",t,n,r)}}var BM=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},zM=function(){function e(t,n){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=ys(10),i=t.nodeName==="HTML",o=Vh(e),a=Vh(t),s=sl(e),u=no(t),c=parseFloat(u.borderTopWidth),f=parseFloat(u.borderLeftWidth);n&&i&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var d=gi({top:o.top-a.top-c,left:o.left-a.left-f,width:o.width,height:o.height});if(d.marginTop=0,d.marginLeft=0,!r&&i){var p=parseFloat(u.marginTop),v=parseFloat(u.marginLeft);d.top-=c-p,d.bottom-=c-p,d.left-=f-v,d.right-=f-v,d.marginTop=p,d.marginLeft=v}return(r&&!n?t.contains(s):t===s&&s.nodeName!=="BODY")&&(d=VM(d,t)),d}function WM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=e.ownerDocument.documentElement,r=xm(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:ss(n),s=t?0:ss(n,"left"),u={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o};return gi(u)}function bE(e){var t=e.nodeName;if(t==="BODY"||t==="HTML")return!1;if(no(e,"position")==="fixed")return!0;var n=Pm(e);return n?bE(n):!1}function _E(e){if(!e||!e.parentElement||ys())return document.documentElement;for(var t=e.parentElement;t&&no(t,"transform")==="none";)t=t.parentElement;return t||document.documentElement}function Am(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,o={top:0,left:0},a=i?_E(e):_c(e,yE(t));if(r==="viewport")o=WM(a,i);else{var s=void 0;r==="scrollParent"?(s=sl(Pm(t)),s.nodeName==="BODY"&&(s=e.ownerDocument.documentElement)):r==="window"?s=e.ownerDocument.documentElement:s=r;var u=xm(s,a,i);if(s.nodeName==="HTML"&&!bE(a)){var c=wE(e.ownerDocument),f=c.height,d=c.width;o.top+=u.top-u.marginTop,o.bottom=f+u.top,o.left+=u.left-u.marginLeft,o.right=d+u.left}else o=u}n=n||0;var p=typeof n=="number";return o.left+=p?n:n.left||0,o.top+=p?n:n.top||0,o.right-=p?n:n.right||0,o.bottom-=p?n:n.bottom||0,o}function HM(e){var t=e.width,n=e.height;return t*n}function SE(e,t,n,r,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(e.indexOf("auto")===-1)return e;var a=Am(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},u=Object.keys(s).map(function(p){return En({key:p},s[p],{area:HM(s[p])})}).sort(function(p,v){return v.area-p.area}),c=u.filter(function(p){var v=p.width,m=p.height;return v>=n.clientWidth&&m>=n.clientHeight}),f=c.length>0?c[0].key:u[0].key,d=e.split("-")[1];return f+(d?"-"+d:"")}function EE(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=r?_E(t):_c(t,yE(n));return xm(n,i,r)}function OE(e){var t=e.ownerDocument.defaultView,n=t.getComputedStyle(e),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),i=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),o={width:e.offsetWidth+i,height:e.offsetHeight+r};return o}function Sc(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(n){return t[n]})}function TE(e,t,n){n=n.split("-")[0];var r=OE(e),i={width:r.width,height:r.height},o=["right","left"].indexOf(n)!==-1,a=o?"top":"left",s=o?"left":"top",u=o?"height":"width",c=o?"width":"height";return i[a]=t[a]+t[u]/2-r[u]/2,n===s?i[s]=t[s]-r[c]:i[s]=t[Sc(s)],i}function al(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function GM(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(i){return i[t]===n});var r=al(e,function(i){return i[t]===n});return e.indexOf(r)}function CE(e,t,n){var r=n===void 0?e:e.slice(0,GM(e,"name",n));return r.forEach(function(i){i.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var o=i.function||i.fn;i.enabled&&vE(o)&&(t.offsets.popper=gi(t.offsets.popper),t.offsets.reference=gi(t.offsets.reference),t=o(t,i))}),t}function qM(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=EE(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=SE(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=TE(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=CE(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function IE(e,t){return e.some(function(n){var r=n.name,i=n.enabled;return i&&r===t})}function Rm(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;ra[v]&&(e.offsets.popper[d]+=s[d]+m-a[v]),e.offsets.popper=gi(e.offsets.popper);var w=s[d]+s[c]/2-m/2,I=no(e.instance.popper),O=parseFloat(I["margin"+f]),y=parseFloat(I["border"+f+"Width"]),S=w-e.offsets.popper[d]-O-y;return S=Math.max(Math.min(a[c]-m,S),0),e.arrowElement=r,e.offsets.arrow=(n={},as(n,d,Math.round(S)),as(n,p,""),n),e}function sL(e){return e==="end"?"start":e==="start"?"end":e}var AE=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],vd=AE.slice(3);function S0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=vd.indexOf(e),r=vd.slice(n+1).concat(vd.slice(0,n));return t?r.reverse():r}var yd={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function aL(e,t){if(IE(e.instance.modifiers,"inner")||e.flipped&&e.placement===e.originalPlacement)return e;var n=Am(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=Sc(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case yd.FLIP:a=[r,i];break;case yd.CLOCKWISE:a=S0(r);break;case yd.COUNTERCLOCKWISE:a=S0(r,!0);break;default:a=t.behavior}return a.forEach(function(s,u){if(r!==s||a.length===u+1)return e;r=e.placement.split("-")[0],i=Sc(r);var c=e.offsets.popper,f=e.offsets.reference,d=Math.floor,p=r==="left"&&d(c.right)>d(f.left)||r==="right"&&d(c.left)d(f.top)||r==="bottom"&&d(c.top)d(n.right),w=d(c.top)d(n.bottom),O=r==="left"&&v||r==="right"&&m||r==="top"&&w||r==="bottom"&&I,y=["top","bottom"].indexOf(r)!==-1,S=!!t.flipVariations&&(y&&o==="start"&&v||y&&o==="end"&&m||!y&&o==="start"&&w||!y&&o==="end"&&I),x=!!t.flipVariationsByContent&&(y&&o==="start"&&m||y&&o==="end"&&v||!y&&o==="start"&&I||!y&&o==="end"&&w),M=S||x;(p||O||M)&&(e.flipped=!0,(p||O)&&(r=a[u+1]),M&&(o=sL(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=En({},e.offsets.popper,TE(e.instance.popper,e.offsets.reference,e.placement)),e=CE(e.instance.modifiers,e,"flip"))}),e}function lL(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=["top","bottom"].indexOf(i)!==-1,s=a?"right":"bottom",u=a?"left":"top",c=a?"width":"height";return n[s]o(r[s])&&(e.offsets.popper[u]=o(r[s])),e}function uL(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(a.indexOf("%")===0){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}var u=gi(s);return u[t]/100*o}else if(a==="vh"||a==="vw"){var c=void 0;return a==="vh"?c=Math.max(document.documentElement.clientHeight,window.innerHeight||0):c=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c/100*o}else return o}function cL(e,t,n,r){var i=[0,0],o=["right","left"].indexOf(r)!==-1,a=e.split(/(\+|\-)/).map(function(f){return f.trim()}),s=a.indexOf(al(a,function(f){return f.search(/,|\s/)!==-1}));a[s]&&a[s].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var u=/\s*,\s*|\s+/,c=s!==-1?[a.slice(0,s).concat([a[s].split(u)[0]]),[a[s].split(u)[1]].concat(a.slice(s+1))]:[a];return c=c.map(function(f,d){var p=(d===1?!o:o)?"height":"width",v=!1;return f.reduce(function(m,w){return m[m.length-1]===""&&["+","-"].indexOf(w)!==-1?(m[m.length-1]=w,v=!0,m):v?(m[m.length-1]+=w,v=!1,m):m.concat(w)},[]).map(function(m){return uL(m,p,t,n)})}),c.forEach(function(f,d){f.forEach(function(p,v){Nm(p)&&(i[d]+=p*(f[v-1]==="-"?-1:1))})}),i}function fL(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],u=void 0;return Nm(+n)?u=[+n,0]:u=cL(n,o,a,s),s==="left"?(o.top+=u[0],o.left-=u[1]):s==="right"?(o.top+=u[0],o.left+=u[1]):s==="top"?(o.left+=u[0],o.top-=u[1]):s==="bottom"&&(o.left+=u[0],o.top+=u[1]),e.popper=o,e}function dL(e,t){var n=t.boundariesElement||os(e.instance.popper);e.instance.reference===n&&(n=os(n));var r=Rm("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var u=Am(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=u;var c=t.priority,f=e.offsets.popper,d={primary:function(v){var m=f[v];return f[v]u[v]&&!t.escapeWithReference&&(w=Math.min(f[m],u[v]-(v==="right"?f.width:f.height))),as({},m,w)}};return c.forEach(function(p){var v=["left","top"].indexOf(p)!==-1?"primary":"secondary";f=En({},f,d[v](p))}),e.offsets.popper=f,e}function hL(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=["bottom","top"].indexOf(n)!==-1,u=s?"left":"top",c=s?"width":"height",f={start:as({},u,o[u]),end:as({},u,o[u]+o[c]-a[c])};e.offsets.popper=En({},a,f[r])}return e}function pL(e){if(!xE(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=al(e.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&arguments[2]!==void 0?arguments[2]:{};BM(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=UM(this.update.bind(this)),this.options=En({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(En({},e.Defaults.modifiers,i.modifiers)).forEach(function(a){r.options.modifiers[a]=En({},e.Defaults.modifiers[a]||{},i.modifiers?i.modifiers[a]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return En({name:a},r.options.modifiers[a])}).sort(function(a,s){return a.order-s.order}),this.modifiers.forEach(function(a){a.enabled&&vE(a.onLoad)&&a.onLoad(r.reference,r.popper,r.options,a,r.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return zM(e,[{key:"update",value:function(){return qM.call(this)}},{key:"destroy",value:function(){return KM.call(this)}},{key:"enableEventListeners",value:function(){return QM.call(this)}},{key:"disableEventListeners",value:function(){return XM.call(this)}}]),e}();ja.Utils=(typeof window<"u"?window:global).PopperUtils;ja.placements=AE;ja.Defaults=vL;var yL=["innerHTML","ownerDocument","style","attributes","nodeValue"],wL=["Array","ArrayBuffer","AsyncFunction","AsyncGenerator","AsyncGeneratorFunction","Date","Error","Function","Generator","GeneratorFunction","HTMLElement","Map","Object","Promise","RegExp","Set","WeakMap","WeakSet"],bL=["bigint","boolean","null","number","string","symbol","undefined"];function lf(e){var t=Object.prototype.toString.call(e).slice(8,-1);if(/HTML\w+Element/.test(t))return"HTMLElement";if(_L(t))return t}function Kn(e){return function(t){return lf(t)===e}}function _L(e){return wL.includes(e)}function ws(e){return function(t){return typeof t===e}}function SL(e){return bL.includes(e)}function Y(e){if(e===null)return"null";switch(typeof e){case"bigint":return"bigint";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";case"undefined":return"undefined"}if(Y.array(e))return"Array";if(Y.plainFunction(e))return"Function";var t=lf(e);return t||"Object"}Y.array=Array.isArray;Y.arrayOf=function(e,t){return!Y.array(e)&&!Y.function(t)?!1:e.every(function(n){return t(n)})};Y.asyncGeneratorFunction=function(e){return lf(e)==="AsyncGeneratorFunction"};Y.asyncFunction=Kn("AsyncFunction");Y.bigint=ws("bigint");Y.boolean=function(e){return e===!0||e===!1};Y.date=Kn("Date");Y.defined=function(e){return!Y.undefined(e)};Y.domElement=function(e){return Y.object(e)&&!Y.plainObject(e)&&e.nodeType===1&&Y.string(e.nodeName)&&yL.every(function(t){return t in e})};Y.empty=function(e){return Y.string(e)&&e.length===0||Y.array(e)&&e.length===0||Y.object(e)&&!Y.map(e)&&!Y.set(e)&&Object.keys(e).length===0||Y.set(e)&&e.size===0||Y.map(e)&&e.size===0};Y.error=Kn("Error");Y.function=ws("function");Y.generator=function(e){return Y.iterable(e)&&Y.function(e.next)&&Y.function(e.throw)};Y.generatorFunction=Kn("GeneratorFunction");Y.instanceOf=function(e,t){return!e||!t?!1:Object.getPrototypeOf(e)===t.prototype};Y.iterable=function(e){return!Y.nullOrUndefined(e)&&Y.function(e[Symbol.iterator])};Y.map=Kn("Map");Y.nan=function(e){return Number.isNaN(e)};Y.null=function(e){return e===null};Y.nullOrUndefined=function(e){return Y.null(e)||Y.undefined(e)};Y.number=function(e){return ws("number")(e)&&!Y.nan(e)};Y.numericString=function(e){return Y.string(e)&&e.length>0&&!Number.isNaN(Number(e))};Y.object=function(e){return!Y.nullOrUndefined(e)&&(Y.function(e)||typeof e=="object")};Y.oneOf=function(e,t){return Y.array(e)?e.indexOf(t)>-1:!1};Y.plainFunction=Kn("Function");Y.plainObject=function(e){if(lf(e)!=="Object")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};Y.primitive=function(e){return Y.null(e)||SL(typeof e)};Y.promise=Kn("Promise");Y.propertyOf=function(e,t,n){if(!Y.object(e)||!t)return!1;var r=e[t];return Y.function(n)?n(r):Y.defined(r)};Y.regexp=Kn("RegExp");Y.set=Kn("Set");Y.string=ws("string");Y.symbol=ws("symbol");Y.undefined=ws("undefined");Y.weakMap=Kn("WeakMap");Y.weakSet=Kn("WeakSet");function RE(e){return function(t){return typeof t===e}}var EL=RE("function"),OL=function(e){return e===null},E0=function(e){return Object.prototype.toString.call(e).slice(8,-1)==="RegExp"},O0=function(e){return!TL(e)&&!OL(e)&&(EL(e)||typeof e=="object")},TL=RE("undefined"),zh=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function CL(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=n;r--!==0;)if(!tn(e[r],t[r]))return!1;return!0}function IL(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=new DataView(e.buffer),r=new DataView(t.buffer),i=e.byteLength;i--;)if(n.getUint8(i)!==r.getUint8(i))return!1;return!0}function kL(e,t){var n,r,i,o;if(e.size!==t.size)return!1;try{for(var a=zh(e.entries()),s=a.next();!s.done;s=a.next()){var u=s.value;if(!t.has(u[0]))return!1}}catch(d){n={error:d}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}try{for(var c=zh(e.entries()),f=c.next();!f.done;f=c.next()){var u=f.value;if(!tn(u[1],t.get(u[0])))return!1}}catch(d){i={error:d}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}return!0}function PL(e,t){var n,r;if(e.size!==t.size)return!1;try{for(var i=zh(e.entries()),o=i.next();!o.done;o=i.next()){var a=o.value;if(!t.has(a[0]))return!1}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0}function tn(e,t){if(e===t)return!0;if(e&&O0(e)&&t&&O0(t)){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t))return CL(e,t);if(e instanceof Map&&t instanceof Map)return kL(e,t);if(e instanceof Set&&t instanceof Set)return PL(e,t);if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return IL(e,t);if(E0(e)&&E0(t))return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=n.length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,n[i]))return!1;for(var i=n.length;i--!==0;){var o=n[i];if(!(o==="_owner"&&e.$$typeof)&&!tn(e[o],t[o]))return!1}return!0}return Number.isNaN(e)&&Number.isNaN(t)?!0:e===t}function xL(){for(var e=[],t=0;tu);return Y.undefined(r)||(c=c&&u===r),Y.undefined(o)||(c=c&&s===o),c}function C0(e,t,n){var r=n.key,i=n.type,o=n.value,a=ir(e,r),s=ir(t,r),u=i==="added"?a:s,c=i==="added"?s:a;if(!Y.nullOrUndefined(o)){if(Y.defined(u)){if(Y.array(u)||Y.plainObject(u))return AL(u,c,o)}else return tn(c,o);return!1}return[a,s].every(Y.array)?!c.every(Dm(u)):[a,s].every(Y.plainObject)?RL(Object.keys(u),Object.keys(c)):![a,s].every(function(f){return Y.primitive(f)&&Y.defined(f)})&&(i==="added"?!Y.defined(a)&&Y.defined(s):Y.defined(a)&&!Y.defined(s))}function I0(e,t,n){var r=n===void 0?{}:n,i=r.key,o=ir(e,i),a=ir(t,i);if(!NE(o,a))throw new TypeError("Inputs have different types");if(!xL(o,a))throw new TypeError("Inputs don't have length");return[o,a].every(Y.plainObject)&&(o=Object.keys(o),a=Object.keys(a)),[o,a]}function k0(e){return function(t){var n=t[0],r=t[1];return Y.array(e)?tn(e,r)||e.some(function(i){return tn(i,r)||Y.array(r)&&Dm(r)(i)}):Y.plainObject(e)&&e[n]?!!e[n]&&tn(e[n],r):tn(e,r)}}function RL(e,t){return t.some(function(n){return!e.includes(n)})}function P0(e){return function(t){return Y.array(e)?e.some(function(n){return tn(n,t)||Y.array(t)&&Dm(t)(n)}):tn(e,t)}}function zs(e,t){return Y.array(e)?e.some(function(n){return tn(n,t)}):tn(e,t)}function Dm(e){return function(t){return e.some(function(n){return tn(n,t)})}}function NE(){for(var e=[],t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function LL(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function DE(e,t){if(e==null)return{};var n=LL(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function mr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jL(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mr(e)}function fl(e){var t=ML();return function(){var r=Ec(e),i;if(t){var o=Ec(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return jL(this,i)}}function FL(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ME(e){var t=FL(e,"string");return typeof t=="symbol"?t:String(t)}var UL={flip:{padding:20},preventOverflow:{padding:10}},$L="The typeValidator argument must be a function with the signature function(props, propName, componentName).",VL="The error message is optional, but must be a string if provided.";function BL(e,t,n,r){return typeof e=="boolean"?e:typeof e=="function"?e(t,n,r):e?!!e:!1}function zL(e,t){return Object.hasOwnProperty.call(e,t)}function WL(e,t,n,r){return new Error("Required ".concat(e[t]," `").concat(t,"` was not specified in `").concat(n,"`."))}function HL(e,t){if(typeof e!="function")throw new TypeError($L);if(t&&typeof t!="string")throw new TypeError(VL)}function A0(e,t,n){return HL(e,n),function(r,i,o){for(var a=arguments.length,s=new Array(a>3?a-3:0),u=3;u3&&arguments[3]!==void 0?arguments[3]:!1;e.addEventListener(t,n,r)}function qL(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;e.removeEventListener(t,n,r)}function KL(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i;i=function(a){n(a),qL(e,t,i)},GL(e,t,i,r)}function R0(){}var LE=function(e){cl(n,e);var t=fl(n);function n(){return ll(this,n),t.apply(this,arguments)}return ul(n,[{key:"componentDidMount",value:function(){Xn()&&(this.node||this.appendNode(),Ws||this.renderPortal())}},{key:"componentDidUpdate",value:function(){Xn()&&(Ws||this.renderPortal())}},{key:"componentWillUnmount",value:function(){!Xn()||!this.node||(Ws||du.unmountComponentAtNode(this.node),this.node&&this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=void 0))}},{key:"appendNode",value:function(){var i=this.props,o=i.id,a=i.zIndex;this.node||(this.node=document.createElement("div"),o&&(this.node.id=o),a&&(this.node.style.zIndex=a),document.body.appendChild(this.node))}},{key:"renderPortal",value:function(){if(!Xn())return null;var i=this.props,o=i.children,a=i.setRef;if(this.node||this.appendNode(),Ws)return du.createPortal(o,this.node);var s=du.unstable_renderSubtreeIntoContainer(this,o.length>1?J.createElement("div",null,o):o[0],this.node);return a(s),null}},{key:"renderReact16",value:function(){var i=this.props,o=i.hasChildren,a=i.placement,s=i.target;return o?this.renderPortal():s||a==="center"?this.renderPortal():null}},{key:"render",value:function(){return Ws?this.renderReact16():null}}]),n}(J.Component);Nt(LE,"propTypes",{children:re.oneOfType([re.element,re.array]),hasChildren:re.bool,id:re.oneOfType([re.string,re.number]),placement:re.string,setRef:re.func.isRequired,target:re.oneOfType([re.object,re.string]),zIndex:re.number});var jE=function(e){cl(n,e);var t=fl(n);function n(){return ll(this,n),t.apply(this,arguments)}return ul(n,[{key:"parentStyle",get:function(){var i=this.props,o=i.placement,a=i.styles,s=a.arrow.length,u={pointerEvents:"none",position:"absolute",width:"100%"};return o.startsWith("top")?(u.bottom=0,u.left=0,u.right=0,u.height=s):o.startsWith("bottom")?(u.left=0,u.right=0,u.top=0,u.height=s):o.startsWith("left")?(u.right=0,u.top=0,u.bottom=0):o.startsWith("right")&&(u.left=0,u.top=0),u}},{key:"render",value:function(){var i=this.props,o=i.placement,a=i.setArrowRef,s=i.styles,u=s.arrow,c=u.color,f=u.display,d=u.length,p=u.margin,v=u.position,m=u.spread,w={display:f,position:v},I,O=m,y=d;return o.startsWith("top")?(I="0,0 ".concat(O/2,",").concat(y," ").concat(O,",0"),w.bottom=0,w.marginLeft=p,w.marginRight=p):o.startsWith("bottom")?(I="".concat(O,",").concat(y," ").concat(O/2,",0 0,").concat(y),w.top=0,w.marginLeft=p,w.marginRight=p):o.startsWith("left")?(y=m,O=d,I="0,0 ".concat(O,",").concat(y/2," 0,").concat(y),w.right=0,w.marginTop=p,w.marginBottom=p):o.startsWith("right")&&(y=m,O=d,I="".concat(O,",").concat(y," ").concat(O,",0 0,").concat(y/2),w.left=0,w.marginTop=p,w.marginBottom=p),J.createElement("div",{className:"__floater__arrow",style:this.parentStyle},J.createElement("span",{ref:a,style:w},J.createElement("svg",{width:O,height:y,version:"1.1",xmlns:"http://www.w3.org/2000/svg"},J.createElement("polygon",{points:I,fill:c}))))}}]),n}(J.Component);Nt(jE,"propTypes",{placement:re.string.isRequired,setArrowRef:re.func.isRequired,styles:re.object.isRequired});var YL=["color","height","width"];function FE(e){var t=e.handleClick,n=e.styles,r=n.color,i=n.height,o=n.width,a=DE(n,YL);return J.createElement("button",{"aria-label":"close",onClick:t,style:a,type:"button"},J.createElement("svg",{width:"".concat(o,"px"),height:"".concat(i,"px"),viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},J.createElement("g",null,J.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:r}))))}FE.propTypes={handleClick:re.func.isRequired,styles:re.object.isRequired};function UE(e){var t=e.content,n=e.footer,r=e.handleClick,i=e.open,o=e.positionWrapper,a=e.showCloseButton,s=e.title,u=e.styles,c={content:J.isValidElement(t)?t:J.createElement("div",{className:"__floater__content",style:u.content},t)};return s&&(c.title=J.isValidElement(s)?s:J.createElement("div",{className:"__floater__title",style:u.title},s)),n&&(c.footer=J.isValidElement(n)?n:J.createElement("div",{className:"__floater__footer",style:u.footer},n)),(a||o)&&!Y.boolean(i)&&(c.close=J.createElement(FE,{styles:u.close,handleClick:r})),J.createElement("div",{className:"__floater__container",style:u.container},c.close,c.title,c.content,c.footer)}UE.propTypes={content:re.node.isRequired,footer:re.node,handleClick:re.func.isRequired,open:re.bool,positionWrapper:re.bool.isRequired,showCloseButton:re.bool.isRequired,styles:re.object.isRequired,title:re.node};var $E=function(e){cl(n,e);var t=fl(n);function n(){return ll(this,n),t.apply(this,arguments)}return ul(n,[{key:"style",get:function(){var i=this.props,o=i.disableAnimation,a=i.component,s=i.placement,u=i.hideArrow,c=i.status,f=i.styles,d=f.arrow.length,p=f.floater,v=f.floaterCentered,m=f.floaterClosing,w=f.floaterOpening,I=f.floaterWithAnimation,O=f.floaterWithComponent,y={};return u||(s.startsWith("top")?y.padding="0 0 ".concat(d,"px"):s.startsWith("bottom")?y.padding="".concat(d,"px 0 0"):s.startsWith("left")?y.padding="0 ".concat(d,"px 0 0"):s.startsWith("right")&&(y.padding="0 0 0 ".concat(d,"px"))),[Le.OPENING,Le.OPEN].indexOf(c)!==-1&&(y=tt(tt({},y),w)),c===Le.CLOSING&&(y=tt(tt({},y),m)),c===Le.OPEN&&!o&&(y=tt(tt({},y),I)),s==="center"&&(y=tt(tt({},y),v)),a&&(y=tt(tt({},y),O)),tt(tt({},p),y)}},{key:"render",value:function(){var i=this.props,o=i.component,a=i.handleClick,s=i.hideArrow,u=i.setFloaterRef,c=i.status,f={},d=["__floater"];return o?J.isValidElement(o)?f.content=J.cloneElement(o,{closeFn:a}):f.content=o({closeFn:a}):f.content=J.createElement(UE,this.props),c===Le.OPEN&&d.push("__floater__open"),s||(f.arrow=J.createElement(jE,this.props)),J.createElement("div",{ref:u,className:d.join(" "),style:this.style},J.createElement("div",{className:"__floater__body"},f.content,f.arrow))}}]),n}(J.Component);Nt($E,"propTypes",{component:re.oneOfType([re.func,re.element]),content:re.node,disableAnimation:re.bool.isRequired,footer:re.node,handleClick:re.func.isRequired,hideArrow:re.bool.isRequired,open:re.bool,placement:re.string.isRequired,positionWrapper:re.bool.isRequired,setArrowRef:re.func.isRequired,setFloaterRef:re.func.isRequired,showCloseButton:re.bool,status:re.string.isRequired,styles:re.object.isRequired,title:re.node});var VE=function(e){cl(n,e);var t=fl(n);function n(){return ll(this,n),t.apply(this,arguments)}return ul(n,[{key:"render",value:function(){var i=this.props,o=i.children,a=i.handleClick,s=i.handleMouseEnter,u=i.handleMouseLeave,c=i.setChildRef,f=i.setWrapperRef,d=i.style,p=i.styles,v;if(o)if(J.Children.count(o)===1)if(!J.isValidElement(o))v=J.createElement("span",null,o);else{var m=Y.function(o.type)?"innerRef":"ref";v=J.cloneElement(J.Children.only(o),Nt({},m,c))}else v=o;return v?J.createElement("span",{ref:f,style:tt(tt({},p),d),onClick:a,onMouseEnter:s,onMouseLeave:u},v):null}}]),n}(J.Component);Nt(VE,"propTypes",{children:re.node,handleClick:re.func.isRequired,handleMouseEnter:re.func.isRequired,handleMouseLeave:re.func.isRequired,setChildRef:re.func.isRequired,setWrapperRef:re.func.isRequired,style:re.object,styles:re.object.isRequired});var QL={zIndex:100};function JL(e){var t=Fn(QL,e.options||{});return{wrapper:{cursor:"help",display:"inline-flex",flexDirection:"column",zIndex:t.zIndex},wrapperPosition:{left:-1e3,position:"absolute",top:-1e3,visibility:"hidden"},floater:{display:"inline-block",filter:"drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))",maxWidth:300,opacity:0,position:"relative",transition:"opacity 0.3s",visibility:"hidden",zIndex:t.zIndex},floaterOpening:{opacity:1,visibility:"visible"},floaterWithAnimation:{opacity:1,transition:"opacity 0.3s, transform 0.2s",visibility:"visible"},floaterWithComponent:{maxWidth:"100%"},floaterClosing:{opacity:0,visibility:"visible"},floaterCentered:{left:"50%",position:"fixed",top:"50%",transform:"translate(-50%, -50%)"},container:{backgroundColor:"#fff",color:"#666",minHeight:60,minWidth:200,padding:20,position:"relative",zIndex:10},title:{borderBottom:"1px solid #555",color:"#555",fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",fontSize:0,height:15,outline:"none",padding:10,position:"absolute",right:0,top:0,width:15,WebkitAppearance:"none"},footer:{borderTop:"1px solid #ccc",fontSize:13,marginTop:10,paddingTop:5},arrow:{color:"#fff",display:"inline-flex",length:16,margin:8,position:"absolute",spread:32},options:t}}var XL=["arrow","flip","offset"],ZL=["position","top","right","bottom","left"],Mm=function(e){cl(n,e);var t=fl(n);function n(r){var i;return ll(this,n),i=t.call(this,r),Nt(mr(i),"setArrowRef",function(o){i.arrowRef=o}),Nt(mr(i),"setChildRef",function(o){i.childRef=o}),Nt(mr(i),"setFloaterRef",function(o){i.floaterRef=o}),Nt(mr(i),"setWrapperRef",function(o){i.wrapperRef=o}),Nt(mr(i),"handleTransitionEnd",function(){var o=i.state.status,a=i.props.callback;i.wrapperPopper&&i.wrapperPopper.instance.update(),i.setState({status:o===Le.OPENING?Le.OPEN:Le.IDLE},function(){var s=i.state.status;a(s===Le.OPEN?"open":"close",i.props)})}),Nt(mr(i),"handleClick",function(){var o=i.props,a=o.event,s=o.open;if(!Y.boolean(s)){var u=i.state,c=u.positionWrapper,f=u.status;(i.event==="click"||i.event==="hover"&&c)&&(Xl({title:"click",data:[{event:a,status:f===Le.OPEN?"closing":"opening"}],debug:i.debug}),i.toggle())}}),Nt(mr(i),"handleMouseEnter",function(){var o=i.props,a=o.event,s=o.open;if(!(Y.boolean(s)||wd())){var u=i.state.status;i.event==="hover"&&u===Le.IDLE&&(Xl({title:"mouseEnter",data:[{key:"originalEvent",value:a}],debug:i.debug}),clearTimeout(i.eventDelayTimeout),i.toggle())}}),Nt(mr(i),"handleMouseLeave",function(){var o=i.props,a=o.event,s=o.eventDelay,u=o.open;if(!(Y.boolean(u)||wd())){var c=i.state,f=c.status,d=c.positionWrapper;i.event==="hover"&&(Xl({title:"mouseLeave",data:[{key:"originalEvent",value:a}],debug:i.debug}),s?[Le.OPENING,Le.OPEN].indexOf(f)!==-1&&!d&&!i.eventDelayTimeout&&(i.eventDelayTimeout=setTimeout(function(){delete i.eventDelayTimeout,i.toggle()},s*1e3)):i.toggle(Le.IDLE))}}),i.state={currentPlacement:r.placement,needsUpdate:!1,positionWrapper:r.wrapperOptions.position&&!!r.target,status:Le.INIT,statusWrapper:Le.INIT},i._isMounted=!1,i.hasMounted=!1,Xn()&&window.addEventListener("load",function(){i.popper&&i.popper.instance.update(),i.wrapperPopper&&i.wrapperPopper.instance.update()}),i}return ul(n,[{key:"componentDidMount",value:function(){if(Xn()){var i=this.state.positionWrapper,o=this.props,a=o.children,s=o.open,u=o.target;this._isMounted=!0,Xl({title:"init",data:{hasChildren:!!a,hasTarget:!!u,isControlled:Y.boolean(s),positionWrapper:i,target:this.target,floater:this.floaterRef},debug:this.debug}),this.hasMounted||(this.initPopper(),this.hasMounted=!0),!a&&u&&Y.boolean(s)}}},{key:"componentDidUpdate",value:function(i,o){if(Xn()){var a=this.props,s=a.autoOpen,u=a.open,c=a.target,f=a.wrapperOptions,d=NL(o,this.state),p=d.changedFrom,v=d.changed;if(i.open!==u){var m;Y.boolean(u)&&(m=u?Le.OPENING:Le.CLOSING),this.toggle(m)}(i.wrapperOptions.position!==f.position||i.target!==c)&&this.changeWrapperPosition(this.props),v("status",Le.IDLE)&&u?this.toggle(Le.OPEN):p("status",Le.INIT,Le.IDLE)&&s&&this.toggle(Le.OPEN),this.popper&&v("status",Le.OPENING)&&this.popper.instance.update(),this.floaterRef&&(v("status",Le.OPENING)||v("status",Le.CLOSING))&&KL(this.floaterRef,"transitionend",this.handleTransitionEnd),v("needsUpdate",!0)&&this.rebuildPopper()}}},{key:"componentWillUnmount",value:function(){Xn()&&(this._isMounted=!1,this.popper&&this.popper.instance.destroy(),this.wrapperPopper&&this.wrapperPopper.instance.destroy())}},{key:"initPopper",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.target,a=this.state.positionWrapper,s=this.props,u=s.disableFlip,c=s.getPopper,f=s.hideArrow,d=s.offset,p=s.placement,v=s.wrapperOptions,m=p==="top"||p==="bottom"?"flip":["right","bottom-end","top-end","left","top-start","bottom-start"];if(p==="center")this.setState({status:Le.IDLE});else if(o&&this.floaterRef){var w=this.options,I=w.arrow,O=w.flip,y=w.offset,S=DE(w,XL);new ja(o,this.floaterRef,{placement:p,modifiers:tt({arrow:tt({enabled:!f,element:this.arrowRef},I),flip:tt({enabled:!u,behavior:m},O),offset:tt({offset:"0, ".concat(d,"px")},y)},S),onCreate:function(U){var E;if(i.popper=U,!((E=i.floaterRef)!==null&&E!==void 0&&E.isConnected)){i.setState({needsUpdate:!0});return}c(U,"floater"),i._isMounted&&i.setState({currentPlacement:U.placement,status:Le.IDLE}),p!==U.placement&&setTimeout(function(){U.instance.update()},1)},onUpdate:function(U){i.popper=U;var E=i.state.currentPlacement;i._isMounted&&U.placement!==E&&i.setState({currentPlacement:U.placement})}})}if(a){var x=Y.undefined(v.offset)?0:v.offset;new ja(this.target,this.wrapperRef,{placement:v.placement||p,modifiers:{arrow:{enabled:!1},offset:{offset:"0, ".concat(x,"px")},flip:{enabled:!1}},onCreate:function(U){i.wrapperPopper=U,i._isMounted&&i.setState({statusWrapper:Le.IDLE}),c(U,"wrapper"),p!==U.placement&&setTimeout(function(){U.instance.update()},1)}})}}},{key:"rebuildPopper",value:function(){var i=this;this.floaterRefInterval=setInterval(function(){var o;(o=i.floaterRef)!==null&&o!==void 0&&o.isConnected&&(clearInterval(i.floaterRefInterval),i.setState({needsUpdate:!1}),i.initPopper())},50)}},{key:"changeWrapperPosition",value:function(i){var o=i.target,a=i.wrapperOptions;this.setState({positionWrapper:a.position&&!!o})}},{key:"toggle",value:function(i){var o=this.state.status,a=o===Le.OPEN?Le.CLOSING:Le.OPENING;Y.undefined(i)||(a=i),this.setState({status:a})}},{key:"debug",get:function(){var i=this.props.debug;return i||Xn()&&"ReactFloaterDebug"in window&&!!window.ReactFloaterDebug}},{key:"event",get:function(){var i=this.props,o=i.disableHoverToClick,a=i.event;return a==="hover"&&wd()&&!o?"click":a}},{key:"options",get:function(){var i=this.props.options;return Fn(UL,i||{})}},{key:"styles",get:function(){var i=this,o=this.state,a=o.status,s=o.positionWrapper,u=o.statusWrapper,c=this.props.styles,f=Fn(JL(c),c);if(s){var d;[Le.IDLE].indexOf(a)===-1||[Le.IDLE].indexOf(u)===-1?d=f.wrapperPosition:d=this.wrapperPopper.styles,f.wrapper=tt(tt({},f.wrapper),d)}if(this.target){var p=window.getComputedStyle(this.target);this.wrapperStyles?f.wrapper=tt(tt({},f.wrapper),this.wrapperStyles):["relative","static"].indexOf(p.position)===-1&&(this.wrapperStyles={},s||(ZL.forEach(function(v){i.wrapperStyles[v]=p[v]}),f.wrapper=tt(tt({},f.wrapper),this.wrapperStyles),this.target.style.position="relative",this.target.style.top="auto",this.target.style.right="auto",this.target.style.bottom="auto",this.target.style.left="auto"))}return f}},{key:"target",get:function(){if(!Xn())return null;var i=this.props.target;return i?Y.domElement(i)?i:document.querySelector(i):this.childRef||this.wrapperRef}},{key:"render",value:function(){var i=this.state,o=i.currentPlacement,a=i.positionWrapper,s=i.status,u=this.props,c=u.children,f=u.component,d=u.content,p=u.disableAnimation,v=u.footer,m=u.hideArrow,w=u.id,I=u.open,O=u.showCloseButton,y=u.style,S=u.target,x=u.title,M=J.createElement(VE,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:y,styles:this.styles.wrapper},c),U={};return a?U.wrapperInPortal=M:U.wrapperAsChildren=M,J.createElement("span",null,J.createElement(LE,{hasChildren:!!c,id:w,placement:o,setRef:this.setFloaterRef,target:S,zIndex:this.styles.options.zIndex},J.createElement($E,{component:f,content:d,disableAnimation:p,footer:v,handleClick:this.handleClick,hideArrow:m||o==="center",open:I,placement:o,positionWrapper:a,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:O,status:s,styles:this.styles,title:x}),U.wrapperInPortal),U.wrapperAsChildren)}}]),n}(J.Component);Nt(Mm,"propTypes",{autoOpen:re.bool,callback:re.func,children:re.node,component:A0(re.oneOfType([re.func,re.element]),function(e){return!e.content}),content:A0(re.node,function(e){return!e.component}),debug:re.bool,disableAnimation:re.bool,disableFlip:re.bool,disableHoverToClick:re.bool,event:re.oneOf(["hover","click"]),eventDelay:re.number,footer:re.node,getPopper:re.func,hideArrow:re.bool,id:re.oneOfType([re.string,re.number]),offset:re.number,open:re.bool,options:re.object,placement:re.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto","center"]),showCloseButton:re.bool,style:re.object,styles:re.object,target:re.oneOfType([re.object,re.string]),title:re.node,wrapperOptions:re.shape({offset:re.number,placement:re.oneOf(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end","auto"]),position:re.bool})});Nt(Mm,"defaultProps",{autoOpen:!1,callback:R0,debug:!1,disableAnimation:!1,disableFlip:!1,disableHoverToClick:!1,event:"click",eventDelay:.4,getPopper:R0,hideArrow:!1,offset:15,placement:"bottom",showCloseButton:!1,styles:{},target:null,wrapperOptions:{position:!1}});var e4=function(e){return Object.prototype.hasOwnProperty.call(e,"props")},t4=function(e,t){return e+Fa(t)},Fa=function(e){return e===null||typeof e=="boolean"||typeof e>"u"?"":typeof e=="number"?e.toString():typeof e=="string"?e:Array.isArray(e)?e.reduce(t4,""):e4(e)&&Object.prototype.hasOwnProperty.call(e.props,"children")?Fa(e.props.children):""};Fa.default=Fa;var n4=Fa;const r4=ur(n4);var i4=Object.defineProperty,o4=(e,t,n)=>t in e?i4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ye=(e,t,n)=>(o4(e,typeof t!="symbol"?t+"":t,n),n),ze={INIT:"init",START:"start",STOP:"stop",RESET:"reset",PREV:"prev",NEXT:"next",GO:"go",CLOSE:"close",SKIP:"skip",UPDATE:"update"},Ln={TOUR_START:"tour:start",STEP_BEFORE:"step:before",BEACON:"beacon",TOOLTIP:"tooltip",STEP_AFTER:"step:after",TOUR_END:"tour:end",TOUR_STATUS:"tour:status",TARGET_NOT_FOUND:"error:target_not_found",ERROR:"error"},xe={INIT:"init",READY:"ready",BEACON:"beacon",TOOLTIP:"tooltip",COMPLETE:"complete",ERROR:"error"},Ne={IDLE:"idle",READY:"ready",WAITING:"waiting",RUNNING:"running",PAUSED:"paused",SKIPPED:"skipped",FINISHED:"finished",ERROR:"error"};function Yr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function BE(e){return e?e.getBoundingClientRect():null}function s4(e=!0){const{body:t,documentElement:n}=document;if(!t||!n)return 0;if(e){const r=[t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight].sort((o,a)=>o-a),i=Math.floor(r.length/2);return r.length%2===0?(r[i-1]+r[i])/2:r[i]}return Math.max(t.scrollHeight,t.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight)}function hi(e){return typeof e=="string"?document.querySelector(e):e}function a4(e){return!e||e.nodeType!==1?null:getComputedStyle(e)}function uf(e,t,n){if(!e)return Li();const r=mE(e);if(r){if(r.isSameNode(Li()))return n?document:Li();if(!(r.scrollHeight>r.offsetHeight)&&!t)return r.style.overflow="initial",Li()}return r}function cf(e,t){if(!e)return!1;const n=uf(e,t);return n?!n.isSameNode(Li()):!1}function l4(e){return e.offsetParent!==document.body}function Ua(e,t="fixed"){if(!e||!(e instanceof HTMLElement))return!1;const{nodeName:n}=e,r=a4(e);return n==="BODY"||n==="HTML"?!1:r&&r.position===t?!0:e.parentNode?Ua(e.parentNode,t):!1}function u4(e){var t;if(!e)return!1;let n=e;for(;n&&n!==document.body;){if(n instanceof HTMLElement){const{display:r,visibility:i}=getComputedStyle(n);if(r==="none"||i==="hidden")return!1}n=(t=n.parentElement)!=null?t:null}return!0}function c4(e,t,n){var r;const i=BE(e),o=uf(e,n),a=cf(e,n);let s=0,u=(r=i==null?void 0:i.top)!=null?r:0;return o instanceof HTMLElement&&(s=o.scrollTop,!a&&!Ua(e)&&(u+=s),o.isSameNode(Li())||(u+=Li().scrollTop)),Math.floor(u-t)}function f4(e,t,n){var r;if(!e)return 0;const{offsetTop:i=0,scrollTop:o=0}=(r=mE(e))!=null?r:{};let a=e.getBoundingClientRect().top+o;i&&(cf(e,n)||l4(e))&&(a-=i);const s=Math.floor(a-t);return s<0?0:s}function Li(){var e;return(e=document.scrollingElement)!=null?e:document.documentElement}function d4(e,t){const{duration:n,element:r}=t;return new Promise((i,o)=>{const{scrollTop:a}=r,s=e>a?e-a:a-e;wM.top(r,e,{duration:s<100?50:n},u=>u&&u.message!=="Element already at target scroll position"?o(u):i())})}var Hs=Ui.createPortal!==void 0;function zE(e=navigator.userAgent){let t=e;return typeof window>"u"?t="node":document.documentMode?t="ie":/Edge/.test(e)?t="edge":window.opera||e.includes(" OPR/")?t="opera":typeof window.InstallTrigger<"u"?t="firefox":window.chrome?t="chrome":/(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(e)&&(t="safari"),t}function Qr(e){const t=[],n=r=>{if(typeof r=="string"||typeof r=="number")t.push(r);else if(Array.isArray(r))r.forEach(i=>n(i));else if(K.isValidElement(r)){const{children:i}=r.props;Array.isArray(i)?i.forEach(o=>n(o)):n(i)}};return n(e),t.join(" ").trim()}function h4(e,t){return!ve.plainObject(e)||!ve.array(t)?!1:Object.keys(e).every(n=>t.includes(n))}function p4(e){const t=/^#?([\da-f])([\da-f])([\da-f])$/i,n=e.replace(t,(i,o,a,s)=>o+o+a+a+s+s),r=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(n);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:[]}function N0(e){return e.disableBeacon||e.placement==="center"}function D0(){return!["chrome","safari","firefox","opera"].includes(zE())}function Zi({data:e,debug:t=!1,title:n,warn:r=!1}){const i=r?console.warn||console.error:console.log;t&&(n&&e?(console.groupCollapsed(`%creact-joyride: ${n}`,"color: #ff0044; font-weight: bold; font-size: 12px;"),Array.isArray(e)?e.forEach(o=>{ve.plainObject(o)&&o.key?i.apply(console,[o.key,o.value]):i.apply(console,[o])}):i.apply(console,[e]),console.groupEnd()):console.error("Missing title or data props"))}function m4(e){return Object.keys(e)}function WE(e,...t){if(!ve.plainObject(e))throw new TypeError("Expected an object");const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&(t.includes(r)||(n[r]=e[r]));return n}function g4(e,...t){if(!ve.plainObject(e))throw new TypeError("Expected an object");if(!t.length)return e;const n={};for(const r in e)({}).hasOwnProperty.call(e,r)&&t.includes(r)&&(n[r]=e[r]);return n}function v4(e){const{isFirstStep:t,lifecycle:n,previousLifecycle:r,scrollToFirstStep:i,step:o,target:a}=e;return!o.disableScrolling&&(!t||i||n===xe.TOOLTIP)&&o.placement!=="center"&&(!o.isFixed||!Ua(a))&&r!==n&&[xe.BEACON,xe.TOOLTIP].includes(n)}var y4={options:{preventOverflow:{boundariesElement:"scrollParent"}},wrapperOptions:{offset:-18,position:!0}},HE={back:"Back",close:"Close",last:"Last",next:"Next",open:"Open the dialog",skip:"Skip"},w4={event:"click",placement:"bottom",offset:10,disableBeacon:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrollParentFix:!1,disableScrolling:!1,hideBackButton:!1,hideCloseButton:!1,hideFooter:!1,isFixed:!1,locale:HE,showProgress:!1,showSkipButton:!1,spotlightClicks:!1,spotlightPadding:10},b4={continuous:!1,debug:!1,disableCloseOnEsc:!1,disableOverlay:!1,disableOverlayClose:!1,disableScrolling:!1,disableScrollParentFix:!1,getHelpers:void 0,hideBackButton:!1,run:!0,scrollOffset:20,scrollDuration:300,scrollToFirstStep:!1,showSkipButton:!1,showProgress:!1,spotlightClicks:!1,spotlightPadding:10,steps:[]},_4={arrowColor:"#fff",backgroundColor:"#fff",beaconSize:36,overlayColor:"rgba(0, 0, 0, 0.5)",primaryColor:"#f04",spotlightShadow:"0 0 15px rgba(0, 0, 0, 0.5)",textColor:"#333",width:380,zIndex:100},Gs={backgroundColor:"transparent",border:0,borderRadius:0,color:"#555",cursor:"pointer",fontSize:16,lineHeight:1,padding:8,WebkitAppearance:"none"},M0={borderRadius:4,position:"absolute"};function S4(e,t){var n,r,i,o,a;const{floaterProps:s,styles:u}=e,c=Fn((n=t.floaterProps)!=null?n:{},s??{}),f=Fn(u??{},(r=t.styles)!=null?r:{}),d=Fn(_4,f.options||{}),p=t.placement==="center"||t.disableBeacon;let{width:v}=d;window.innerWidth>480&&(v=380),"width"in d&&(v=typeof d.width=="number"&&window.innerWidthGE(n,t)):(Zi({title:"validateSteps",data:"steps must be an array",warn:!0,debug:t}),!1)}var qE={action:"init",controlled:!1,index:0,lifecycle:xe.INIT,origin:null,size:0,status:Ne.IDLE},j0=m4(WE(qE,"controlled","size")),O4=class{constructor(e){ye(this,"beaconPopper"),ye(this,"tooltipPopper"),ye(this,"data",new Map),ye(this,"listener"),ye(this,"store",new Map),ye(this,"addListener",i=>{this.listener=i}),ye(this,"setSteps",i=>{const{size:o,status:a}=this.getState(),s={size:i.length,status:a};this.data.set("steps",i),a===Ne.WAITING&&!o&&i.length&&(s.status=Ne.RUNNING),this.setState(s)}),ye(this,"getPopper",i=>i==="beacon"?this.beaconPopper:this.tooltipPopper),ye(this,"setPopper",(i,o)=>{i==="beacon"?this.beaconPopper=o:this.tooltipPopper=o}),ye(this,"cleanupPoppers",()=>{this.beaconPopper=null,this.tooltipPopper=null}),ye(this,"close",(i=null)=>{const{index:o,status:a}=this.getState();a===Ne.RUNNING&&this.setState({...this.getNextState({action:ze.CLOSE,index:o+1,origin:i})})}),ye(this,"go",i=>{const{controlled:o,status:a}=this.getState();if(o||a!==Ne.RUNNING)return;const s=this.getSteps()[i];this.setState({...this.getNextState({action:ze.GO,index:i}),status:s?a:Ne.FINISHED})}),ye(this,"info",()=>this.getState()),ye(this,"next",()=>{const{index:i,status:o}=this.getState();o===Ne.RUNNING&&this.setState(this.getNextState({action:ze.NEXT,index:i+1}))}),ye(this,"open",()=>{const{status:i}=this.getState();i===Ne.RUNNING&&this.setState({...this.getNextState({action:ze.UPDATE,lifecycle:xe.TOOLTIP})})}),ye(this,"prev",()=>{const{index:i,status:o}=this.getState();o===Ne.RUNNING&&this.setState({...this.getNextState({action:ze.PREV,index:i-1})})}),ye(this,"reset",(i=!1)=>{const{controlled:o}=this.getState();o||this.setState({...this.getNextState({action:ze.RESET,index:0}),status:i?Ne.RUNNING:Ne.READY})}),ye(this,"skip",()=>{const{status:i}=this.getState();i===Ne.RUNNING&&this.setState({action:ze.SKIP,lifecycle:xe.INIT,status:Ne.SKIPPED})}),ye(this,"start",i=>{const{index:o,size:a}=this.getState();this.setState({...this.getNextState({action:ze.START,index:ve.number(i)?i:o},!0),status:a?Ne.RUNNING:Ne.WAITING})}),ye(this,"stop",(i=!1)=>{const{index:o,status:a}=this.getState();[Ne.FINISHED,Ne.SKIPPED].includes(a)||this.setState({...this.getNextState({action:ze.STOP,index:o+(i?1:0)}),status:Ne.PAUSED})}),ye(this,"update",i=>{var o,a;if(!h4(i,j0))throw new Error(`State is not valid. Valid keys: ${j0.join(", ")}`);this.setState({...this.getNextState({...this.getState(),...i,action:(o=i.action)!=null?o:ze.UPDATE,origin:(a=i.origin)!=null?a:null},!0)})});const{continuous:t=!1,stepIndex:n,steps:r=[]}=e??{};this.setState({action:ze.INIT,controlled:ve.number(n),continuous:t,index:ve.number(n)?n:0,lifecycle:xe.INIT,origin:null,status:r.length?Ne.READY:Ne.IDLE},!0),this.beaconPopper=null,this.tooltipPopper=null,this.listener=null,this.setSteps(r)}getState(){return this.store.size?{action:this.store.get("action")||"",controlled:this.store.get("controlled")||!1,index:parseInt(this.store.get("index"),10),lifecycle:this.store.get("lifecycle")||"",origin:this.store.get("origin")||null,size:this.store.get("size")||0,status:this.store.get("status")||""}:{...qE}}getNextState(e,t=!1){var n,r,i,o,a;const{action:s,controlled:u,index:c,size:f,status:d}=this.getState(),p=ve.number(e.index)?e.index:c,v=u&&!t?c:Math.min(Math.max(p,0),f);return{action:(n=e.action)!=null?n:s,controlled:u,index:v,lifecycle:(r=e.lifecycle)!=null?r:xe.INIT,origin:(i=e.origin)!=null?i:null,size:(o=e.size)!=null?o:f,status:v===f?Ne.FINISHED:(a=e.status)!=null?a:d}}getSteps(){const e=this.data.get("steps");return Array.isArray(e)?e:[]}hasUpdatedState(e){const t=JSON.stringify(e),n=JSON.stringify(this.getState());return t!==n}setState(e,t=!1){const n=this.getState(),{action:r,index:i,lifecycle:o,origin:a=null,size:s,status:u}={...n,...e};this.store.set("action",r),this.store.set("index",i),this.store.set("lifecycle",o),this.store.set("origin",a),this.store.set("size",s),this.store.set("status",u),t&&(this.store.set("controlled",e.controlled),this.store.set("continuous",e.continuous)),this.listener&&this.hasUpdatedState(n)&&this.listener(this.getState())}getHelpers(){return{close:this.close,go:this.go,info:this.info,next:this.next,open:this.open,prev:this.prev,reset:this.reset,skip:this.skip}}};function T4(e){return new O4(e)}function C4({styles:e}){return K.createElement("div",{key:"JoyrideSpotlight",className:"react-joyride__spotlight","data-test-id":"spotlight",style:e})}var I4=C4,k4=class extends K.Component{constructor(){super(...arguments),ye(this,"isActive",!1),ye(this,"resizeTimeout"),ye(this,"scrollTimeout"),ye(this,"scrollParent"),ye(this,"state",{isScrolling:!1,mouseOverSpotlight:!1,showSpotlight:!0}),ye(this,"hideSpotlight",()=>{const{continuous:e,disableOverlay:t,lifecycle:n}=this.props,r=[xe.BEACON,xe.COMPLETE,xe.ERROR];return t||(e?r.includes(n):n!==xe.TOOLTIP)}),ye(this,"handleMouseMove",e=>{const{mouseOverSpotlight:t}=this.state,{height:n,left:r,position:i,top:o,width:a}=this.spotlightStyles,s=i==="fixed"?e.clientY:e.pageY,u=i==="fixed"?e.clientX:e.pageX,c=s>=o&&s<=o+n,d=u>=r&&u<=r+a&&c;d!==t&&this.updateState({mouseOverSpotlight:d})}),ye(this,"handleScroll",()=>{const{target:e}=this.props,t=hi(e);if(this.scrollParent!==document){const{isScrolling:n}=this.state;n||this.updateState({isScrolling:!0,showSpotlight:!1}),clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.updateState({isScrolling:!1,showSpotlight:!0})},50)}else Ua(t,"sticky")&&this.updateState({})}),ye(this,"handleResize",()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.isActive&&this.forceUpdate()},100)})}componentDidMount(){const{debug:e,disableScrolling:t,disableScrollParentFix:n=!1,target:r}=this.props,i=hi(r);this.scrollParent=uf(i??document.body,n,!0),this.isActive=!0,window.addEventListener("resize",this.handleResize)}componentDidUpdate(e){var t;const{lifecycle:n,spotlightClicks:r}=this.props,{changed:i}=bc(e,this.props);i("lifecycle",xe.TOOLTIP)&&((t=this.scrollParent)==null||t.addEventListener("scroll",this.handleScroll,{passive:!0}),setTimeout(()=>{const{isScrolling:o}=this.state;o||this.updateState({showSpotlight:!0})},100)),(i("spotlightClicks")||i("disableOverlay")||i("lifecycle"))&&(r&&n===xe.TOOLTIP?window.addEventListener("mousemove",this.handleMouseMove,!1):n!==xe.TOOLTIP&&window.removeEventListener("mousemove",this.handleMouseMove))}componentWillUnmount(){var e;this.isActive=!1,window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),clearTimeout(this.resizeTimeout),clearTimeout(this.scrollTimeout),(e=this.scrollParent)==null||e.removeEventListener("scroll",this.handleScroll)}get overlayStyles(){const{mouseOverSpotlight:e}=this.state,{disableOverlayClose:t,placement:n,styles:r}=this.props;let i=r.overlay;return D0()&&(i=n==="center"?r.overlayLegacyCenter:r.overlayLegacy),{cursor:t?"default":"pointer",height:s4(),pointerEvents:e?"none":"auto",...i}}get spotlightStyles(){var e,t,n;const{showSpotlight:r}=this.state,{disableScrollParentFix:i=!1,spotlightClicks:o,spotlightPadding:a=0,styles:s,target:u}=this.props,c=hi(u),f=BE(c),d=Ua(c),p=c4(c,a,i);return{...D0()?s.spotlightLegacy:s.spotlight,height:Math.round(((e=f==null?void 0:f.height)!=null?e:0)+a*2),left:Math.round(((t=f==null?void 0:f.left)!=null?t:0)-a),opacity:r?1:0,pointerEvents:o?"none":"auto",position:d?"fixed":"absolute",top:p,transition:"opacity 0.2s",width:Math.round(((n=f==null?void 0:f.width)!=null?n:0)+a*2)}}updateState(e){this.isActive&&this.setState(t=>({...t,...e}))}render(){const{showSpotlight:e}=this.state,{onClickOverlay:t,placement:n}=this.props,{hideSpotlight:r,overlayStyles:i,spotlightStyles:o}=this;if(r())return null;let a=n!=="center"&&e&&K.createElement(I4,{styles:o});if(zE()==="safari"){const{mixBlendMode:s,zIndex:u,...c}=i;a=K.createElement("div",{style:{...c}},a),delete i.backgroundColor}return K.createElement("div",{className:"react-joyride__overlay","data-test-id":"overlay",onClick:t,role:"presentation",style:i},a)}},P4=class extends K.Component{constructor(){super(...arguments),ye(this,"node",null)}componentDidMount(){const{id:e}=this.props;Yr()&&(this.node=document.createElement("div"),this.node.id=e,document.body.appendChild(this.node),Hs||this.renderReact15())}componentDidUpdate(){Yr()&&(Hs||this.renderReact15())}componentWillUnmount(){!Yr()||!this.node||(Hs||Ui.unmountComponentAtNode(this.node),this.node.parentNode===document.body&&(document.body.removeChild(this.node),this.node=null))}renderReact15(){if(!Yr())return;const{children:e}=this.props;this.node&&Ui.unstable_renderSubtreeIntoContainer(this,e,this.node)}renderReact16(){if(!Yr()||!Hs)return null;const{children:e}=this.props;return this.node?Ui.createPortal(e,this.node):null}render(){return Hs?this.renderReact16():null}},x4=class{constructor(e,t){if(ye(this,"element"),ye(this,"options"),ye(this,"canBeTabbed",n=>{const{tabIndex:r}=n;return r===null||r<0?!1:this.canHaveFocus(n)}),ye(this,"canHaveFocus",n=>{const r=/input|select|textarea|button|object/,i=n.nodeName.toLowerCase();return(r.test(i)&&!n.getAttribute("disabled")||i==="a"&&!!n.getAttribute("href"))&&this.isVisible(n)}),ye(this,"findValidTabElements",()=>[].slice.call(this.element.querySelectorAll("*"),0).filter(this.canBeTabbed)),ye(this,"handleKeyDown",n=>{const{code:r="Tab"}=this.options;n.code===r&&this.interceptTab(n)}),ye(this,"interceptTab",n=>{n.preventDefault();const r=this.findValidTabElements(),{shiftKey:i}=n;if(!r.length)return;let o=document.activeElement?r.indexOf(document.activeElement):0;o===-1||!i&&o+1===r.length?o=0:i&&o===0?o=r.length-1:o+=i?-1:1,r[o].focus()}),ye(this,"isHidden",n=>{const r=n.offsetWidth<=0&&n.offsetHeight<=0,i=window.getComputedStyle(n);return r&&!n.innerHTML?!0:r&&i.getPropertyValue("overflow")!=="visible"||i.getPropertyValue("display")==="none"}),ye(this,"isVisible",n=>{let r=n;for(;r;)if(r instanceof HTMLElement){if(r===document.body)break;if(this.isHidden(r))return!1;r=r.parentNode}return!0}),ye(this,"removeScope",()=>{window.removeEventListener("keydown",this.handleKeyDown)}),ye(this,"checkFocus",n=>{document.activeElement!==n&&(n.focus(),window.requestAnimationFrame(()=>this.checkFocus(n)))}),ye(this,"setFocus",()=>{const{selector:n}=this.options;if(!n)return;const r=this.element.querySelector(n);r&&window.requestAnimationFrame(()=>this.checkFocus(r))}),!(e instanceof HTMLElement))throw new TypeError("Invalid parameter: element must be an HTMLElement");this.element=e,this.options=t,window.addEventListener("keydown",this.handleKeyDown,!1),this.setFocus()}},A4=class extends K.Component{constructor(e){if(super(e),ye(this,"beacon",null),ye(this,"setBeaconRef",i=>{this.beacon=i}),e.beaconComponent)return;const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id="joyride-beacon-animation",e.nonce&&n.setAttribute("nonce",e.nonce),n.appendChild(document.createTextNode(` - @keyframes joyride-beacon-inner { - 20% { - opacity: 0.9; - } - - 90% { - opacity: 0.7; - } - } - - @keyframes joyride-beacon-outer { - 0% { - transform: scale(1); - } - - 45% { - opacity: 0.7; - transform: scale(0.75); - } - - 100% { - opacity: 0.9; - transform: scale(1); - } - } - `)),t.appendChild(n)}componentDidMount(){const{shouldFocus:e}=this.props;setTimeout(()=>{ve.domElement(this.beacon)&&e&&this.beacon.focus()},0)}componentWillUnmount(){const e=document.getElementById("joyride-beacon-animation");e!=null&&e.parentNode&&e.parentNode.removeChild(e)}render(){const{beaconComponent:e,continuous:t,index:n,isLastStep:r,locale:i,onClickOrHover:o,size:a,step:s,styles:u}=this.props,c=ve.string(i.open)?i.open:r4(i.open),f={"aria-label":c,onClick:o,onMouseEnter:o,ref:this.setBeaconRef,title:c};let d;if(e){const p=e;d=K.createElement(p,{continuous:t,index:n,isLastStep:r,size:a,step:s,...f})}else d=K.createElement("button",{key:"JoyrideBeacon",className:"react-joyride__beacon","data-test-id":"button-beacon",style:u.beacon,type:"button",...f},K.createElement("span",{style:u.beaconInner}),K.createElement("span",{style:u.beaconOuter}));return d}};function R4({styles:e,...t}){const{color:n,height:r,width:i,...o}=e;return J.createElement("button",{style:o,type:"button",...t},J.createElement("svg",{height:typeof r=="number"?`${r}px`:r,preserveAspectRatio:"xMidYMid",version:"1.1",viewBox:"0 0 18 18",width:typeof i=="number"?`${i}px`:i,xmlns:"http://www.w3.org/2000/svg"},J.createElement("g",null,J.createElement("path",{d:"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",fill:n}))))}var N4=R4;function D4(e){const{backProps:t,closeProps:n,continuous:r,index:i,isLastStep:o,primaryProps:a,size:s,skipProps:u,step:c,tooltipProps:f}=e,{content:d,hideBackButton:p,hideCloseButton:v,hideFooter:m,locale:w,showProgress:I,showSkipButton:O,styles:y,title:S}=c,{back:x,close:M,last:U,next:E,skip:b}=w,T={primary:M};return r&&(T.primary=o?U:E,I&&(T.primary=K.createElement("span",null,T.primary," (",i+1,"/",s,")"))),T.primary&&(T.primary=K.createElement("button",{"data-test-id":"button-primary",style:y.buttonNext,type:"button",...a},T.primary)),O&&!o&&(T.skip=K.createElement("button",{"aria-live":"off","data-test-id":"button-skip",style:y.buttonSkip,type:"button",...u},b)),!p&&i>0&&(T.back=K.createElement("button",{"data-test-id":"button-back",style:y.buttonBack,type:"button",...t},x)),T.close=!v&&K.createElement(N4,{"data-test-id":"button-close",styles:y.buttonClose,...n}),K.createElement("div",{key:"JoyrideTooltip","aria-label":Qr(S)||Qr(d),className:"react-joyride__tooltip",style:y.tooltip,...f},K.createElement("div",{style:y.tooltipContainer},S&&K.createElement("h1",{"aria-label":Qr(S),style:y.tooltipTitle},S),K.createElement("div",{style:y.tooltipContent},d)),!m&&K.createElement("div",{style:y.tooltipFooter},K.createElement("div",{style:y.tooltipFooterSpacer},T.skip),T.back,T.primary),T.close)}var M4=D4,L4=class extends K.Component{constructor(){super(...arguments),ye(this,"handleClickBack",e=>{e.preventDefault();const{helpers:t}=this.props;t.prev()}),ye(this,"handleClickClose",e=>{e.preventDefault();const{helpers:t}=this.props;t.close("button_close")}),ye(this,"handleClickPrimary",e=>{e.preventDefault();const{continuous:t,helpers:n}=this.props;if(!t){n.close("button_primary");return}n.next()}),ye(this,"handleClickSkip",e=>{e.preventDefault();const{helpers:t}=this.props;t.skip()}),ye(this,"getElementsProps",()=>{const{continuous:e,isLastStep:t,setTooltipRef:n,step:r}=this.props,i=Qr(r.locale.back),o=Qr(r.locale.close),a=Qr(r.locale.last),s=Qr(r.locale.next),u=Qr(r.locale.skip);let c=e?s:o;return t&&(c=a),{backProps:{"aria-label":i,"data-action":"back",onClick:this.handleClickBack,role:"button",title:i},closeProps:{"aria-label":o,"data-action":"close",onClick:this.handleClickClose,role:"button",title:o},primaryProps:{"aria-label":c,"data-action":"primary",onClick:this.handleClickPrimary,role:"button",title:c},skipProps:{"aria-label":u,"data-action":"skip",onClick:this.handleClickSkip,role:"button",title:u},tooltipProps:{"aria-modal":!0,ref:n,role:"alertdialog"}}})}render(){const{continuous:e,index:t,isLastStep:n,setTooltipRef:r,size:i,step:o}=this.props,{beaconComponent:a,tooltipComponent:s,...u}=o;let c;if(s){const f={...this.getElementsProps(),continuous:e,index:t,isLastStep:n,size:i,step:u,setTooltipRef:r},d=s;c=K.createElement(d,{...f})}else c=K.createElement(M4,{...this.getElementsProps(),continuous:e,index:t,isLastStep:n,size:i,step:o});return c}},j4=class extends K.Component{constructor(){super(...arguments),ye(this,"scope",null),ye(this,"tooltip",null),ye(this,"handleClickHoverBeacon",e=>{const{step:t,store:n}=this.props;e.type==="mouseenter"&&t.event!=="hover"||n.update({lifecycle:xe.TOOLTIP})}),ye(this,"setTooltipRef",e=>{this.tooltip=e}),ye(this,"setPopper",(e,t)=>{var n;const{action:r,lifecycle:i,step:o,store:a}=this.props;t==="wrapper"?a.setPopper("beacon",e):a.setPopper("tooltip",e),a.getPopper("beacon")&&a.getPopper("tooltip")&&i===xe.INIT&&a.update({action:r,lifecycle:xe.READY}),(n=o.floaterProps)!=null&&n.getPopper&&o.floaterProps.getPopper(e,t)}),ye(this,"renderTooltip",e=>{const{continuous:t,helpers:n,index:r,size:i,step:o}=this.props;return K.createElement(L4,{continuous:t,helpers:n,index:r,isLastStep:r+1===i,setTooltipRef:this.setTooltipRef,size:i,step:o,...e})})}componentDidMount(){const{debug:e,index:t}=this.props;Zi({title:`step:${t}`,data:[{key:"props",value:this.props}],debug:e})}componentDidUpdate(e){var t;const{action:n,callback:r,continuous:i,controlled:o,debug:a,helpers:s,index:u,lifecycle:c,status:f,step:d,store:p}=this.props,{changed:v,changedFrom:m}=bc(e,this.props),w=s.info(),I=i&&n!==ze.CLOSE&&(u>0||n===ze.PREV),O=v("action")||v("index")||v("lifecycle")||v("status"),y=m("lifecycle",[xe.TOOLTIP,xe.INIT],xe.INIT),S=v("action",[ze.NEXT,ze.PREV,ze.SKIP,ze.CLOSE]),x=o&&u===e.index;if(S&&(y||x)&&r({...w,index:e.index,lifecycle:xe.COMPLETE,step:e.step,type:Ln.STEP_AFTER}),d.placement==="center"&&f===Ne.RUNNING&&v("index")&&n!==ze.START&&c===xe.INIT&&p.update({lifecycle:xe.READY}),O){const M=hi(d.target),U=!!M;U&&u4(M)?(m("status",Ne.READY,Ne.RUNNING)||m("lifecycle",xe.INIT,xe.READY))&&r({...w,step:d,type:Ln.STEP_BEFORE}):(console.warn(U?"Target not visible":"Target not mounted",d),r({...w,type:Ln.TARGET_NOT_FOUND,step:d}),o||p.update({index:u+(n===ze.PREV?-1:1)}))}m("lifecycle",xe.INIT,xe.READY)&&p.update({lifecycle:N0(d)||I?xe.TOOLTIP:xe.BEACON}),v("index")&&Zi({title:`step:${c}`,data:[{key:"props",value:this.props}],debug:a}),v("lifecycle",xe.BEACON)&&r({...w,step:d,type:Ln.BEACON}),v("lifecycle",xe.TOOLTIP)&&(r({...w,step:d,type:Ln.TOOLTIP}),this.tooltip&&(this.scope=new x4(this.tooltip,{selector:"[data-action=primary]"}),this.scope.setFocus())),m("lifecycle",[xe.TOOLTIP,xe.INIT],xe.INIT)&&((t=this.scope)==null||t.removeScope(),p.cleanupPoppers())}componentWillUnmount(){var e;(e=this.scope)==null||e.removeScope()}get open(){const{lifecycle:e,step:t}=this.props;return N0(t)||e===xe.TOOLTIP}render(){const{continuous:e,debug:t,index:n,nonce:r,shouldScroll:i,size:o,step:a}=this.props,s=hi(a.target);return!GE(a)||!ve.domElement(s)?null:K.createElement("div",{key:`JoyrideStep-${n}`,className:"react-joyride__step"},K.createElement(Mm,{...a.floaterProps,component:this.renderTooltip,debug:t,getPopper:this.setPopper,id:`react-joyride-step-${n}`,open:this.open,placement:a.placement,target:a.target},K.createElement(A4,{beaconComponent:a.beaconComponent,continuous:e,index:n,isLastStep:n+1===o,locale:a.locale,nonce:r,onClickOrHover:this.handleClickHoverBeacon,shouldFocus:i,size:o,step:a,styles:a.styles})))}},KE=class extends K.Component{constructor(e){super(e),ye(this,"helpers"),ye(this,"store"),ye(this,"callback",a=>{const{callback:s}=this.props;ve.function(s)&&s(a)}),ye(this,"handleKeyboard",a=>{const{index:s,lifecycle:u}=this.state,{steps:c}=this.props,f=c[s];u===xe.TOOLTIP&&a.code==="Escape"&&f&&!f.disableCloseOnEsc&&this.store.close("keyboard")}),ye(this,"handleClickOverlay",()=>{const{index:a}=this.state,{steps:s}=this.props;fo(this.props,s[a]).disableOverlayClose||this.helpers.close("overlay")}),ye(this,"syncState",a=>{this.setState(a)});const{debug:t,getHelpers:n,run:r,stepIndex:i}=e;this.store=T4({...e,controlled:r&&ve.number(i)}),this.helpers=this.store.getHelpers();const{addListener:o}=this.store;Zi({title:"init",data:[{key:"props",value:this.props},{key:"state",value:this.state}],debug:t}),o(this.syncState),n&&n(this.helpers),this.state=this.store.getState()}componentDidMount(){if(!Yr())return;const{debug:e,disableCloseOnEsc:t,run:n,steps:r}=this.props,{start:i}=this.store;L0(r,e)&&n&&i(),t||document.body.addEventListener("keydown",this.handleKeyboard,{passive:!0})}componentDidUpdate(e,t){if(!Yr())return;const{action:n,controlled:r,index:i,lifecycle:o,status:a}=this.state,{debug:s,run:u,stepIndex:c,steps:f}=this.props,{stepIndex:d,steps:p}=e,{reset:v,setSteps:m,start:w,stop:I,update:O}=this.store,{changed:y}=bc(e,this.props),{changed:S,changedFrom:x}=bc(t,this.state),M=fo(this.props,f[i]),U=!Gt(p,f),E=ve.number(c)&&y("stepIndex"),b=hi(M.target);if(U&&(L0(f,s)?m(f):console.warn("Steps are not valid",f)),y("run")&&(u?w(c):I()),E){let L=ve.number(d)&&d=0?w:0,r===Ne.RUNNING&&d4(w,{element:m,duration:a}).then(()=>{setTimeout(()=>{var y;(y=this.store.getPopper("tooltip"))==null||y.instance.update()},10)})}}render(){if(!Yr())return null;const{index:e,lifecycle:t,status:n}=this.state,{continuous:r=!1,debug:i=!1,nonce:o,scrollToFirstStep:a=!1,steps:s}=this.props,u=n===Ne.RUNNING,c={};if(u&&s[e]){const f=fo(this.props,s[e]);c.step=K.createElement(j4,{...this.state,callback:this.callback,continuous:r,debug:i,helpers:this.helpers,nonce:o,shouldScroll:!f.disableScrolling&&(e!==0||a),step:f,store:this.store}),c.overlay=K.createElement(P4,{id:"react-joyride-portal"},K.createElement(k4,{...f,continuous:r,debug:i,lifecycle:t,onClickOverlay:this.handleClickOverlay}))}return K.createElement("div",{className:"react-joyride"},c.step,c.overlay)}};ye(KE,"defaultProps",b4);var F4=KE;const U4=[{target:".landing-header",content:"Welcome to SimpliTrac! This is a simple to use financial tracker that allows you to record expenses on the go.",disableBeacon:!0},{target:".buttons-container button:nth-child(2)",content:"With our intuitive AI-driven camera setup, you can snap pictures of your receipts on the fly and record your daily expenses."},{target:".landing-content",content:"You can manually enter your expenses on the main page with our easy to use Expense Table."},{target:".buttons-container button:nth-child(3)",content:"See where your money is going in real time with our handy Chart feature."},{target:".buttons-container button:nth-child(4)",content:"Use the Edit Transaction function to correct any errors in your expense processing."},{target:"body",content:"Be sure to check your achievements tab to see how you rank among other users and earn badges while maintaining financial peace of mind!",placement:"center"}],$4=({run:e,setRun:t})=>{const n=r=>{const{status:i}=r;[Ne.FINISHED,Ne.SKIPPED].includes(i)&&t(!1)};return j.jsx(F4,{steps:U4,run:e,continuous:!0,showSkipButton:!0,showProgress:!0,styles:{options:{zIndex:1e4}},callback:n})},Lm="/assets/simplitrac_logo-CakUhnBD.png",V4=()=>{const{setScreen:e,ocrData:t,serverResponse:n,setServerResponse:r,user:i,setIsUpdating:o}=K.useContext(Pn),[a,s]=K.useState(!1),[u,c]=K.useState(!1);K.useEffect(()=>{i.isNewUser&&i.isNewUser()&&c(!0)},[i]);const f=v=>{v!==void 0&&e(v)};K.useEffect(()=>{n&&r(null)},[i]);const d=()=>{s(!a)},p=async v=>{if(window.confirm("Are you sure you want to delete this category?")){o(!0);const w=await new Ht(i).deleteCategory(v);w instanceof Ht?(setUser(w),r("Category Successfully Deleted")):r("Failed to delete category")}o(!1)};return j.jsx(QD,{config:JD,initialState:i.serialize(),badgesButtonPosition:"top-right",children:j.jsxs(Xc,{fluid:!0,className:"landing-container",children:[j.jsx($4,{run:u,setRun:c}),i.first_name&&j.jsxs(j.Fragment,{children:[j.jsxs("p",{children:["Welcome ",i.first_name," ",i.last_name]}),i.isNewUser()&&j.jsx(aA,{}),t&&j.jsx(vD,{}),n&&j.jsx(xD,{})]}),j.jsx("div",{className:"landing-header",children:j.jsx("h1",{children:j.jsx(Jc,{xs:1,md:1,children:j.jsx(Zc,{src:Lm,role:"logo",style:{width:"300px",height:"300px"},roundedCircle:!0})})})}),j.jsx("div",{className:"landing-content",children:j.jsx(BP,{})}),j.jsxs("div",{className:"buttons-container",children:[j.jsx("button",{className:"custom-button",onClick:()=>c(!0),children:"Start Tour"}),j.jsx("button",{className:"custom-button",onClick:()=>f("camera"),children:"Camera"}),j.jsx("button",{className:"custom-button",onClick:()=>f("chart"),children:"Chart"}),j.jsx("button",{className:"custom-button",onClick:()=>f("edit"),children:"Edit Transactions"}),j.jsx("button",{className:"custom-button",onClick:d,children:a?"Hide Categories":"Show Categories"})]}),a&&j.jsxs("div",{className:"categories-list",children:[j.jsx("h3",{children:"Your Categories"}),j.jsx("ul",{className:"category-list",children:i.categories.map(v=>j.jsxs("li",{className:"category-item",children:[j.jsx("span",{children:v.category_name}),j.jsx("button",{className:"delete-button custom-button",onClick:()=>p(v.category_id),children:"Delete"})]},v.category_id))})]}),j.jsx("div",{className:"landing-content",children:j.jsx(gD,{})})]})})},B4=()=>{const e=["Our application is a simple to use financial tracker that allows you to record expenses on the go","Intuitive AI-Driven Camera Support","Manual Expense Entry","Cost Tracker via Up-to-date data display and Pie Chart","Edit/Delete Transaction Fuctionality","Achievement System to display activity and rewards"];return j.jsxs("div",{style:Zl.container,children:[j.jsx("h2",{style:Zl.title,children:"Website Features"}),j.jsx("ul",{style:Zl.list,children:e.map((t,n)=>j.jsx("li",{style:Zl.listItem,children:t},n))})]})},Zl={container:{padding:"20px",maxWidth:"600px",margin:"0 auto",backgroundColor:"#f5f5f5",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0,0,0,0.1)"},title:{fontSize:"24px",marginBottom:"15px",color:"#333"},list:{listStyleType:"disc",paddingLeft:"20px"},listItem:{fontSize:"18px",marginBottom:"10px",color:"#555"}},z4=()=>{const{setScreen:e,setUser:t,isUpdating:n,setIsUpdating:r}=K.useContext(Pn);let i=new Ht(JSON.parse(localStorage.getItem("user")));if(localStorage.length!==0){t(i),e("landing");return}const o=async()=>{try{r(!0);const u=await Yy(wc,r0),c=u.user.uid;let f=await Ht.getUserFromFirestore(c);if(!f.isNewUser()){alert("Sorry, you already have an account."),e(),r(!1);return}f=new Ht(u.user),await s(new Ht(f)),t(f),localStorage.setItem("user",f),e("landing"),r(!1)}catch(u){console.log(u)}},a=async()=>{try{r(!0);const c=(await Yy(wc,r0)).user.uid;let f=await Ht.getUserFromFirestore(c);if(f.isNewUser()){alert("Sorry. You do not have an account."),e(""),r(!1);return}t(f),localStorage.setItem("user",f),e("landing"),r(!1)}catch(u){console.error(u)}};async function s(u){const c={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(u)},d=await fetch("https://us-central1-simplitracapp.cloudfunctions.net/create_new_user",c);console.log(d)}return j.jsxs(j.Fragment,{children:[j.jsx(Xc,{children:j.jsx(im,{children:j.jsx(Jc,{xs:1,md:1,children:j.jsx(Zc,{src:Lm,role:"logo",style:{width:"300px",height:"300px"},roundedCircle:!0})})})}),j.jsxs("div",{children:[n&&j.jsx(em,{})," ",j.jsx("button",{onClick:o,children:" New User Sign Up"}),j.jsx("div",{}),j.jsx("button",{onClick:a,children:" Existing User Sign In"}),j.jsx("div",{children:j.jsx(B4,{})})]})]})},W4=()=>{const[e,t]=K.useState("");return K.useEffect(()=>{const n=nN(wc,r=>{r?(t(r.email),console.log(`User Email set: ${r.email}`)):(t(""),console.log("No user is signed in"))});return()=>n()},[]),j.jsxs("div",{className:"App",children:[j.jsx("h1",{children:"SimpliTrac"}),e?j.jsx(H4,{user_email:e}):j.jsx("p",{children:"Please Enter in an Expense."}),j.jsx(tm,{})]})},H4=({user_email:e})=>{const t=`https://lookerstudio.google.com/embed/reporting/ae330055-31b8-4e65-a1a9-f0bbd1cda92f/page/87O5D?params=${encodeURIComponent(`{"user_email": "${e}","filter": {"user_email": "${e}"} }`)}`;return K.useEffect(()=>{console.log(`Report URL: ${t}`)},[t]),j.jsx("div",{className:"report-container",children:j.jsx("iframe",{id:"report-frame",width:"900",height:"600",src:t,style:{border:0},allowFullScreen:!0})})},G4=()=>{const{user:e,setUser:t,setScreen:n,setServerResponse:r}=K.useContext(Pn),[i,o]=K.useState([]),[a,s]=K.useState([]),[u,c]=K.useState([]);K.useEffect(()=>{e&&e.transactions&&o(e.transactions),e&&e.categories&&s(["Select Category",...e.categories.map(I=>I.category_name)])},[e]);const{control:f,handleSubmit:d,watch:p}=fb(),v=async I=>{const O=i.map((x,M)=>{const U=new Zt(x);return U.vendor=I[`vendor-${M}`],U.amount=parseFloat(I[`amount-${M}`]),U.category={name:I[`category-${M}`]},U.createdAt=I[`date-${M}`],U}),y=new Ht(e);y.transactions=O;const S=await y.deleteTransactions();S instanceof Ht&&(t(S),r("Transactions Successfully Updated"),localStorage.clear(),localStorage.setItem("user",S),n("landing"))},m=()=>{n("landing")},w=async I=>{if(window.confirm("Are you sure you want to delete this transaction?")){const O=i.filter(x=>x.transactionId!==I);o(O),c();const y=new Ht(e);y.transactions=O;const S=await y.updateFirebase();S instanceof Ht&&(t(S),r("Transaction Successfully Deleted"))}};return j.jsxs("form",{onSubmit:d(v),children:[j.jsx("h2",{children:"Edit Transactions"}),i.map((I,O)=>j.jsxs("div",{className:"transaction-edit-row",children:[j.jsx("label",{children:"Date"}),j.jsx(Zr,{name:`date-${O}`,control:f,defaultValue:I.createdAt,render:({field:y})=>j.jsx("input",{type:"date",...y})}),j.jsx("label",{children:"Vendor"}),j.jsx(Zr,{name:`vendor-${O}`,control:f,defaultValue:I.vendor,render:({field:y})=>j.jsx("input",{type:"text",...y})}),j.jsx("label",{children:"Amount"}),j.jsx(Zr,{name:`amount-${O}`,control:f,defaultValue:I.amount,render:({field:y})=>j.jsx("input",{type:"number",step:"0.01",...y})}),j.jsx("label",{children:"Category"}),j.jsx(Zr,{name:`category-${O}`,control:f,defaultValue:I.category_name||"Select Category",render:({field:y})=>j.jsx("select",{...y,children:a.map(S=>j.jsx("option",{value:S,children:S},S))})}),j.jsx("button",{type:"button",className:"custom-button delete-button",onClick:()=>w(I.transactionId),children:"Delete"})]},I.transactionId)),j.jsxs("div",{className:"edit-buttons",children:[j.jsx("button",{type:"submit",className:"custom-button",children:"Save Changes"}),j.jsx("button",{type:"button",className:"custom-button",onClick:m,children:"Cancel"}),j.jsx("button",{type:"button",className:"custom-button",onClick:m,children:"Back"})]})]})},q4=()=>j.jsxs(j.Fragment,{children:[j.jsx(Xc,{children:j.jsx(im,{children:j.jsx(Jc,{xs:1,md:1,children:j.jsx(Zc,{src:Lm,role:"logo",style:{width:"300px",height:"300px"},roundedCircle:!0})})})}),j.jsxs("div",{children:[j.jsx("p",{children:"Welcome to the SimpliTrac User Guide!"}),j.jsx("p",{children:"Our application is a simple to use financial tracker that allows you to record expenses on the go."}),j.jsx("p",{children:" -------------------------------------------- "}),j.jsx("p",{children:"With our intuitive AI-driven camera setup, you can snap pictures of your receipts on the fly and record your daily expenses."}),j.jsx("p",{children:" -------------------------------------------- "}),j.jsx("p",{children:"Or you can manually enter your expenses on the main page with our easy to use Expense Table."}),j.jsx("p",{children:" -------------------------------------------- "}),j.jsx("p",{children:"See where your money is going in real time with our handy Chart feature."}),j.jsx("p",{children:" -------------------------------------------- "}),j.jsx("p",{children:"And use the Edit Transaction function to correct any errors in your expense processing."}),j.jsx("p",{children:" -------------------------------------------- "}),j.jsx("p",{children:"Be sure to check your achievements tab to see how you rank among other users and earn badges while maintaining financial peace of mind!"}),j.jsx(tm,{})]})]});function K4(){const{screen:e,setScreen:t,user:n}=K.useContext(Pn);return(()=>{switch(e){case"landing":return j.jsx(V4,{});case"chart":return j.jsx(W4,{});case"camera":return j.jsx(tx,{});case"edit":return j.jsx(G4,{});case"userguide":return j.jsx(q4,{});default:return j.jsx(z4,{})}})()}bd.createRoot(document.getElementById("root")).render(j.jsx(J.StrictMode,{children:j.jsx(Lk,{children:j.jsx(K4,{})})})); diff --git a/index.html b/index.html index efa6205..1312f02 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ SimpliTrac - +