diff --git a/assets/index-jfpUGUyj.js b/assets/index-CDC7DSUb.js similarity index 71% rename from assets/index-jfpUGUyj.js rename to assets/index-CDC7DSUb.js index b95393b..308c871 100644 --- a/assets/index-jfpUGUyj.js +++ b/assets/index-CDC7DSUb.js @@ -1,4 +1,4 @@ -var Hh=t=>{throw TypeError(t)};var $_=(t,e,n)=>e.has(t)||Hh("Cannot "+n);var qh=(t,e,n)=>e.has(t)?Hh("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);var Gh=(t,e,n)=>($_(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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 cg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ss(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function fg(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var dg={exports:{}},Ml={},hg={exports:{}},Ie={};/** +var qh=t=>{throw TypeError(t)};var W_=(t,e,n)=>e.has(t)||qh("Cannot "+n);var Gh=(t,e,n)=>e.has(t)?qh("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);var Kh=(t,e,n)=>(W_(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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 fg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ss(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function dg(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var hg={exports:{}},Ll={},pg={exports:{}},Ie={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var Hh=t=>{throw TypeError(t)};var $_=(t,e,n)=>e.has(t)||Hh("Cannot "+n);var qh= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Es=Symbol.for("react.element"),W_=Symbol.for("react.portal"),H_=Symbol.for("react.fragment"),q_=Symbol.for("react.strict_mode"),G_=Symbol.for("react.profiler"),K_=Symbol.for("react.provider"),Y_=Symbol.for("react.context"),Q_=Symbol.for("react.forward_ref"),X_=Symbol.for("react.suspense"),J_=Symbol.for("react.memo"),Z_=Symbol.for("react.lazy"),Kh=Symbol.iterator;function e1(t){return t===null||typeof t!="object"?null:(t=Kh&&t[Kh]||t["@@iterator"],typeof t=="function"?t:null)}var pg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mg=Object.assign,gg={};function ro(t,e,n){this.props=t,this.context=e,this.refs=gg,this.updater=n||pg}ro.prototype.isReactComponent={};ro.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};ro.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function vg(){}vg.prototype=ro.prototype;function bf(t,e,n){this.props=t,this.context=e,this.refs=gg,this.updater=n||pg}var Tf=bf.prototype=new vg;Tf.constructor=bf;mg(Tf,ro.prototype);Tf.isPureReactComponent=!0;var Yh=Array.isArray,yg=Object.prototype.hasOwnProperty,Cf={current:null},wg={key:!0,ref:!0,__self:!0,__source:!0};function _g(t,e,n){var r,i={},o=null,l=null;if(e!=null)for(r in e.ref!==void 0&&(l=e.ref),e.key!==void 0&&(o=""+e.key),e)yg.call(e,r)&&!wg.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1{throw TypeError(t)};var $_=(t,e,n)=>e.has(t)||Hh("Cannot "+n);var qh= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var o1=ee,s1=Symbol.for("react.element"),a1=Symbol.for("react.fragment"),l1=Object.prototype.hasOwnProperty,u1=o1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c1={key:!0,ref:!0,__self:!0,__source:!0};function Eg(t,e,n){var r,i={},o=null,l=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(l=e.ref);for(r in e)l1.call(e,r)&&!c1.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:s1,type:t,key:o,ref:l,props:i,_owner:u1.current}}Ml.Fragment=a1;Ml.jsx=Eg;Ml.jsxs=Eg;dg.exports=Ml;var U=dg.exports,uc={},bg={exports:{}},Kt={},Tg={exports:{}},Cg={};/** + */var s1=ee,a1=Symbol.for("react.element"),l1=Symbol.for("react.fragment"),u1=Object.prototype.hasOwnProperty,c1=s1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f1={key:!0,ref:!0,__self:!0,__source:!0};function bg(t,e,n){var r,i={},o=null,l=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(l=e.ref);for(r in e)u1.call(e,r)&&!f1.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:a1,type:t,key:o,ref:l,props:i,_owner:c1.current}}Ll.Fragment=l1;Ll.jsx=bg;Ll.jsxs=bg;hg.exports=Ll;var j=hg.exports,cc={},Tg={exports:{}},Kt={},Cg={exports:{}},Ig={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var Hh=t=>{throw TypeError(t)};var $_=(t,e,n)=>e.has(t)||Hh("Cannot "+n);var qh= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(W,oe){var le=W.length;W.push(oe);e:for(;0>>1,we=W[ve];if(0>>1;ve<_e;){var Be=2*(ve+1)-1,Me=W[Be],Re=Be+1,ze=W[Re];if(0>i(Me,le))Rei(ze,Me)?(W[ve]=ze,W[Re]=le,ve=Re):(W[ve]=Me,W[Be]=le,ve=Be);else if(Rei(ze,le))W[ve]=ze,W[Re]=le,ve=Re;else break e}}return oe}function i(W,oe){var le=W.sortIndex-oe.sortIndex;return le!==0?le:W.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var l=Date,a=l.now();t.unstable_now=function(){return l.now()-a}}var u=[],f=[],h=1,p=null,m=3,_=!1,g=!1,P=!1,D=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(W){for(var oe=n(f);oe!==null;){if(oe.callback===null)r(f);else if(oe.startTime<=W)r(f),oe.sortIndex=oe.expirationTime,e(u,oe);else break;oe=n(f)}}function M(W){if(P=!1,E(W),!g)if(n(u)!==null)g=!0,me(F);else{var oe=n(f);oe!==null&&B(M,oe.startTime-W)}}function F(W,oe){g=!1,P&&(P=!1,I(w),w=-1),_=!0;var le=m;try{for(E(oe),p=n(u);p!==null&&(!(p.expirationTime>oe)||W&&!N());){var ve=p.callback;if(typeof ve=="function"){p.callback=null,m=p.priorityLevel;var we=ve(p.expirationTime<=oe);oe=t.unstable_now(),typeof we=="function"?p.callback=we:p===n(u)&&r(u),E(oe)}else r(u);p=n(u)}if(p!==null)var _e=!0;else{var Be=n(f);Be!==null&&B(M,Be.startTime-oe),_e=!1}return _e}finally{p=null,m=le,_=!1}}var q=!1,T=null,w=-1,b=5,C=-1;function N(){return!(t.unstable_now()-CW||125ve?(W.sortIndex=le,e(f,W),n(u)===null&&W===n(f)&&(P?(I(w),w=-1):P=!0,B(M,le-ve))):(W.sortIndex=we,e(u,W),g||_||(g=!0,me(F))),W},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(W){var oe=m;return function(){var le=m;m=oe;try{return W.apply(this,arguments)}finally{m=le}}}})(Cg);Tg.exports=Cg;var f1=Tg.exports;/** + */(function(t){function e(W,oe){var le=W.length;W.push(oe);e:for(;0>>1,we=W[ve];if(0>>1;ve<_e;){var Be=2*(ve+1)-1,Me=W[Be],Re=Be+1,ze=W[Re];if(0>i(Me,le))Rei(ze,Me)?(W[ve]=ze,W[Re]=le,ve=Re):(W[ve]=Me,W[Be]=le,ve=Be);else if(Rei(ze,le))W[ve]=ze,W[Re]=le,ve=Re;else break e}}return oe}function i(W,oe){var le=W.sortIndex-oe.sortIndex;return le!==0?le:W.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var l=Date,a=l.now();t.unstable_now=function(){return l.now()-a}}var u=[],f=[],h=1,p=null,m=3,_=!1,g=!1,P=!1,D=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(W){for(var oe=n(f);oe!==null;){if(oe.callback===null)r(f);else if(oe.startTime<=W)r(f),oe.sortIndex=oe.expirationTime,e(u,oe);else break;oe=n(f)}}function M(W){if(P=!1,E(W),!g)if(n(u)!==null)g=!0,me(F);else{var oe=n(f);oe!==null&&B(M,oe.startTime-W)}}function F(W,oe){g=!1,P&&(P=!1,I(w),w=-1),_=!0;var le=m;try{for(E(oe),p=n(u);p!==null&&(!(p.expirationTime>oe)||W&&!N());){var ve=p.callback;if(typeof ve=="function"){p.callback=null,m=p.priorityLevel;var we=ve(p.expirationTime<=oe);oe=t.unstable_now(),typeof we=="function"?p.callback=we:p===n(u)&&r(u),E(oe)}else r(u);p=n(u)}if(p!==null)var _e=!0;else{var Be=n(f);Be!==null&&B(M,Be.startTime-oe),_e=!1}return _e}finally{p=null,m=le,_=!1}}var q=!1,T=null,w=-1,b=5,C=-1;function N(){return!(t.unstable_now()-CW||125ve?(W.sortIndex=le,e(f,W),n(u)===null&&W===n(f)&&(P?(I(w),w=-1):P=!0,B(M,le-ve))):(W.sortIndex=we,e(u,W),g||_||(g=!0,me(F))),W},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(W){var oe=m;return function(){var le=m;m=oe;try{return W.apply(this,arguments)}finally{m=le}}}})(Ig);Cg.exports=Ig;var d1=Cg.exports;/** * @license React * react-dom.production.min.js * @@ -30,19 +30,19 @@ var Hh=t=>{throw TypeError(t)};var $_=(t,e,n)=>e.has(t)||Hh("Cannot "+n);var qh= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var d1=ee,Gt=f1;function X(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cc=Object.prototype.hasOwnProperty,h1=/^[: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]*$/,Xh={},Jh={};function p1(t){return cc.call(Jh,t)?!0:cc.call(Xh,t)?!1:h1.test(t)?Jh[t]=!0:(Xh[t]=!0,!1)}function m1(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function g1(t,e,n,r){if(e===null||typeof e>"u"||m1(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function At(t,e,n,r,i,o,l){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=l}var ct={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ct[t]=new At(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ct[e]=new At(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ct[t]=new At(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ct[t]=new At(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ct[t]=new At(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ct[t]=new At(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ct[t]=new At(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ct[t]=new At(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ct[t]=new At(t,5,!1,t.toLowerCase(),null,!1,!1)});var Of=/[\-:]([a-z])/g;function kf(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Of,kf);ct[e]=new At(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Of,kf);ct[e]=new At(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Of,kf);ct[e]=new At(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ct[t]=new At(t,1,!1,t.toLowerCase(),null,!1,!1)});ct.xlinkHref=new At("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ct[t]=new At(t,1,!1,t.toLowerCase(),null,!0,!0)});function Pf(t,e,n,r){var i=ct.hasOwnProperty(e)?ct[e]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fc=Object.prototype.hasOwnProperty,p1=/^[: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]*$/,Jh={},Zh={};function m1(t){return fc.call(Zh,t)?!0:fc.call(Jh,t)?!1:p1.test(t)?Zh[t]=!0:(Jh[t]=!0,!1)}function g1(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function v1(t,e,n,r){if(e===null||typeof e>"u"||g1(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function At(t,e,n,r,i,o,l){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=l}var ct={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ct[t]=new At(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ct[e]=new At(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ct[t]=new At(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ct[t]=new At(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ct[t]=new At(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ct[t]=new At(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ct[t]=new At(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ct[t]=new At(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ct[t]=new At(t,5,!1,t.toLowerCase(),null,!1,!1)});var kf=/[\-:]([a-z])/g;function Pf(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(kf,Pf);ct[e]=new At(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(kf,Pf);ct[e]=new At(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(kf,Pf);ct[e]=new At(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ct[t]=new At(t,1,!1,t.toLowerCase(),null,!1,!1)});ct.xlinkHref=new At("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ct[t]=new At(t,1,!1,t.toLowerCase(),null,!0,!0)});function xf(t,e,n,r){var i=ct.hasOwnProperty(e)?ct[e]:null;(i!==null?i.type!==0:r||!(2a||i[l]!==o[a]){var u=` -`+i[l].replace(" at new "," at ");return t.displayName&&u.includes("")&&(u=u.replace("",t.displayName)),u}while(1<=l&&0<=a);break}}}finally{Iu=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Mo(t):""}function v1(t){switch(t.tag){case 5:return Mo(t.type);case 16:return Mo("Lazy");case 13:return Mo("Suspense");case 19:return Mo("SuspenseList");case 0:case 2:case 15:return t=Ou(t.type,!1),t;case 11:return t=Ou(t.type.render,!1),t;case 1:return t=Ou(t.type,!0),t;default:return""}}function pc(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case wi:return"Fragment";case yi:return"Portal";case fc:return"Profiler";case xf:return"StrictMode";case dc:return"Suspense";case hc:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case kg:return(t.displayName||"Context")+".Consumer";case Og:return(t._context.displayName||"Context")+".Provider";case Af:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Rf:return e=t.displayName||null,e!==null?e:pc(t.type)||"Memo";case sr:e=t._payload,t=t._init;try{return pc(t(e))}catch{}}return null}function y1(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pc(e);case 8:return e===xf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Pr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function xg(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function w1(t){var e=xg(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ea(t){t._valueTracker||(t._valueTracker=w1(t))}function Ag(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=xg(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function za(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function mc(t,e){var n=e.checked;return Ge({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function ep(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Pr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Rg(t,e){e=e.checked,e!=null&&Pf(t,"checked",e,!1)}function gc(t,e){Rg(t,e);var n=Pr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?vc(t,e.type,n):e.hasOwnProperty("defaultValue")&&vc(t,e.type,Pr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function tp(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function vc(t,e,n){(e!=="number"||za(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Lo=Array.isArray;function Ri(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=ta.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function ts(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Fo={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},_1=["Webkit","ms","Moz","O"];Object.keys(Fo).forEach(function(t){_1.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Fo[e]=Fo[t]})});function Lg(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Fo.hasOwnProperty(t)&&Fo[t]?(""+e).trim():e+"px"}function jg(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Lg(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var S1=Ge({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 _c(t,e){if(e){if(S1[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(X(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(X(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(X(61))}if(e.style!=null&&typeof e.style!="object")throw Error(X(62))}}function Sc(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ec=null;function Nf(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var bc=null,Ni=null,Di=null;function ip(t){if(t=Cs(t)){if(typeof bc!="function")throw Error(X(280));var e=t.stateNode;e&&(e=Vl(e),bc(t.stateNode,t.type,e))}}function Ug(t){Ni?Di?Di.push(t):Di=[t]:Ni=t}function Fg(){if(Ni){var t=Ni,e=Di;if(Di=Ni=null,ip(t),e)for(t=0;t>>=0,t===0?32:31-(R1(t)/N1|0)|0}var na=64,ra=4194304;function jo(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function qa(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,l=n&268435455;if(l!==0){var a=l&~i;a!==0?r=jo(a):(o&=l,o!==0&&(r=jo(o)))}else l=n&~i,l!==0?r=jo(l):o!==0&&(r=jo(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function bs(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-mn(e),t[e]=n}function j1(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Bo),hp=" ",pp=!1;function ov(t,e){switch(t){case"keyup":return fS.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _i=!1;function hS(t,e){switch(t){case"compositionend":return sv(e);case"keypress":return e.which!==32?null:(pp=!0,hp);case"textInput":return t=e.data,t===hp&&pp?null:t;default:return null}}function pS(t,e){if(_i)return t==="compositionend"||!Bf&&ov(t,e)?(t=rv(),Oa=Uf=hr=null,_i=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yp(n)}}function cv(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?cv(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function fv(){for(var t=window,e=za();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=za(t.document)}return e}function zf(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function bS(t){var e=fv(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&cv(n.ownerDocument.documentElement,n)){if(r!==null&&zf(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=wp(n,o);var l=wp(n,r);i&&l&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==l.node||t.focusOffset!==l.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(l.node,l.offset)):(e.setEnd(l.node,l.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Si=null,Pc=null,$o=null,xc=!1;function _p(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xc||Si==null||Si!==za(r)||(r=Si,"selectionStart"in r&&zf(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}),$o&&as($o,r)||($o=r,r=Ya(Pc,"onSelect"),0Ti||(t.current=Lc[Ti],Lc[Ti]=null,Ti--)}function Le(t,e){Ti++,Lc[Ti]=t.current,t.current=e}var xr={},bt=Rr(xr),Lt=Rr(!1),ei=xr;function Wi(t,e){var n=t.type.contextTypes;if(!n)return xr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function jt(t){return t=t.childContextTypes,t!=null}function Xa(){Ve(Lt),Ve(bt)}function Op(t,e,n){if(bt.current!==xr)throw Error(X(168));Le(bt,e),Le(Lt,n)}function _v(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(X(108,y1(t)||"Unknown",i));return Ge({},n,r)}function Ja(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||xr,ei=bt.current,Le(bt,t),Le(Lt,Lt.current),!0}function kp(t,e,n){var r=t.stateNode;if(!r)throw Error(X(169));n?(t=_v(t,e,ei),r.__reactInternalMemoizedMergedChildContext=t,Ve(Lt),Ve(bt),Le(bt,t)):Ve(Lt),Le(Lt,n)}var Un=null,Bl=!1,Bu=!1;function Sv(t){Un===null?Un=[t]:Un.push(t)}function MS(t){Bl=!0,Sv(t)}function Nr(){if(!Bu&&Un!==null){Bu=!0;var t=0,e=Ae;try{var n=Un;for(Ae=1;t>=l,i-=l,Vn=1<<32-mn(e)+i|n<w?(b=T,T=null):b=T.sibling;var C=m(I,T,E[w],M);if(C===null){T===null&&(T=b);break}t&&T&&C.alternate===null&&e(I,T),S=o(C,S,w),q===null?F=C:q.sibling=C,q=C,T=b}if(w===E.length)return n(I,T),$e&&Vr(I,w),F;if(T===null){for(;ww?(b=T,T=null):b=T.sibling;var N=m(I,T,C.value,M);if(N===null){T===null&&(T=b);break}t&&T&&N.alternate===null&&e(I,T),S=o(N,S,w),q===null?F=N:q.sibling=N,q=N,T=b}if(C.done)return n(I,T),$e&&Vr(I,w),F;if(T===null){for(;!C.done;w++,C=E.next())C=p(I,C.value,M),C!==null&&(S=o(C,S,w),q===null?F=C:q.sibling=C,q=C);return $e&&Vr(I,w),F}for(T=r(I,T);!C.done;w++,C=E.next())C=_(T,I,w,C.value,M),C!==null&&(t&&C.alternate!==null&&T.delete(C.key===null?w:C.key),S=o(C,S,w),q===null?F=C:q.sibling=C,q=C);return t&&T.forEach(function(A){return e(I,A)}),$e&&Vr(I,w),F}function D(I,S,E,M){if(typeof E=="object"&&E!==null&&E.type===wi&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Zs:e:{for(var F=E.key,q=S;q!==null;){if(q.key===F){if(F=E.type,F===wi){if(q.tag===7){n(I,q.sibling),S=i(q,E.props.children),S.return=I,I=S;break e}}else if(q.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===sr&&Ap(F)===q.type){n(I,q.sibling),S=i(q,E.props),S.ref=Po(I,q,E),S.return=I,I=S;break e}n(I,q);break}else e(I,q);q=q.sibling}E.type===wi?(S=Xr(E.props.children,I.mode,M,E.key),S.return=I,I=S):(M=Ma(E.type,E.key,E.props,null,I.mode,M),M.ref=Po(I,S,E),M.return=I,I=M)}return l(I);case yi:e:{for(q=E.key;S!==null;){if(S.key===q)if(S.tag===4&&S.stateNode.containerInfo===E.containerInfo&&S.stateNode.implementation===E.implementation){n(I,S.sibling),S=i(S,E.children||[]),S.return=I,I=S;break e}else{n(I,S);break}else e(I,S);S=S.sibling}S=Yu(E,I.mode,M),S.return=I,I=S}return l(I);case sr:return q=E._init,D(I,S,q(E._payload),M)}if(Lo(E))return g(I,S,E,M);if(To(E))return P(I,S,E,M);ca(I,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,S!==null&&S.tag===6?(n(I,S.sibling),S=i(S,E),S.return=I,I=S):(n(I,S),S=Ku(E,I.mode,M),S.return=I,I=S),l(I)):n(I,S)}return D}var qi=Cv(!0),Iv=Cv(!1),tl=Rr(null),nl=null,Oi=null,qf=null;function Gf(){qf=Oi=nl=null}function Kf(t){var e=tl.current;Ve(tl),t._currentValue=e}function Fc(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Li(t,e){nl=t,qf=Oi=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Dt=!0),t.firstContext=null)}function rn(t){var e=t._currentValue;if(qf!==t)if(t={context:t,memoizedValue:e,next:null},Oi===null){if(nl===null)throw Error(X(308));Oi=t,nl.dependencies={lanes:0,firstContext:t}}else Oi=Oi.next=t;return e}var qr=null;function Yf(t){qr===null?qr=[t]:qr.push(t)}function Ov(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Yf(e)):(n.next=i.next,i.next=n),e.interleaved=n,Yn(t,r)}function Yn(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var ar=!1;function Qf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function kv(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function qn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Er(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,ke&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Yn(t,n)}return i=r.interleaved,i===null?(e.next=e,Yf(r)):(e.next=i.next,i.next=e),r.interleaved=e,Yn(t,n)}function Pa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Mf(t,n)}}function Rp(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function rl(t,e,n,r){var i=t.updateQueue;ar=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,f=u.next;u.next=null,l===null?o=f:l.next=f,l=u;var h=t.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==l&&(a===null?h.firstBaseUpdate=f:a.next=f,h.lastBaseUpdate=u))}if(o!==null){var p=i.baseState;l=0,h=f=u=null,a=o;do{var m=a.lane,_=a.eventTime;if((r&m)===m){h!==null&&(h=h.next={eventTime:_,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=t,P=a;switch(m=e,_=n,P.tag){case 1:if(g=P.payload,typeof g=="function"){p=g.call(_,p,m);break e}p=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=P.payload,m=typeof g=="function"?g.call(_,p,m):g,m==null)break e;p=Ge({},p,m);break e;case 2:ar=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,m=i.effects,m===null?i.effects=[a]:m.push(a))}else _={eventTime:_,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(f=h=_,u=p):h=h.next=_,l|=m;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;m=a,a=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);if(h===null&&(u=p),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=h,e=i.shared.interleaved,e!==null){i=e;do l|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);ri|=l,t.lanes=l,t.memoizedState=p}}function Np(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=$u.transition;$u.transition={};try{t(!1),e()}finally{Ae=n,$u.transition=r}}function Hv(){return on().memoizedState}function FS(t,e,n){var r=Tr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},qv(t))Gv(e,n);else if(n=Ov(t,e,n,r),n!==null){var i=Pt();gn(n,t,r,i),Kv(n,e,r)}}function VS(t,e,n){var r=Tr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(qv(t))Gv(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var l=e.lastRenderedState,a=o(l,n);if(i.hasEagerState=!0,i.eagerState=a,wn(a,l)){var u=e.interleaved;u===null?(i.next=i,Yf(e)):(i.next=u.next,u.next=i),e.interleaved=i;return}}catch{}finally{}n=Ov(t,e,i,r),n!==null&&(i=Pt(),gn(n,t,r,i),Kv(n,e,r))}}function qv(t){var e=t.alternate;return t===qe||e!==null&&e===qe}function Gv(t,e){Wo=ol=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Kv(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Mf(t,n)}}var sl={readContext:rn,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},BS={readContext:rn,useCallback:function(t,e){return bn().memoizedState=[t,e===void 0?null:e],t},useContext:rn,useEffect:Mp,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Aa(4194308,4,Vv.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Aa(4194308,4,t,e)},useInsertionEffect:function(t,e){return Aa(4,2,t,e)},useMemo:function(t,e){var n=bn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=bn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=FS.bind(null,qe,t),[r.memoizedState,t]},useRef:function(t){var e=bn();return t={current:t},e.memoizedState=t},useState:Dp,useDebugValue:id,useDeferredValue:function(t){return bn().memoizedState=t},useTransition:function(){var t=Dp(!1),e=t[0];return t=US.bind(null,t[1]),bn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=qe,i=bn();if($e){if(n===void 0)throw Error(X(407));n=n()}else{if(n=e(),ot===null)throw Error(X(349));ni&30||Rv(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Mp(Dv.bind(null,r,o,t),[t]),r.flags|=2048,ms(9,Nv.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=bn(),e=ot.identifierPrefix;if($e){var n=Bn,r=Vn;n=(r&~(1<<32-mn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=hs++,0")&&(u=u.replace("",t.displayName)),u}while(1<=l&&0<=a);break}}}finally{Ou=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Mo(t):""}function y1(t){switch(t.tag){case 5:return Mo(t.type);case 16:return Mo("Lazy");case 13:return Mo("Suspense");case 19:return Mo("SuspenseList");case 0:case 2:case 15:return t=ku(t.type,!1),t;case 11:return t=ku(t.type.render,!1),t;case 1:return t=ku(t.type,!0),t;default:return""}}function mc(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case wi:return"Fragment";case yi:return"Portal";case dc:return"Profiler";case Af:return"StrictMode";case hc:return"Suspense";case pc:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Pg:return(t.displayName||"Context")+".Consumer";case kg:return(t._context.displayName||"Context")+".Provider";case Rf:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Nf:return e=t.displayName||null,e!==null?e:mc(t.type)||"Memo";case sr:e=t._payload,t=t._init;try{return mc(t(e))}catch{}}return null}function w1(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mc(e);case 8:return e===Af?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Pr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ag(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function _1(t){var e=Ag(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ea(t){t._valueTracker||(t._valueTracker=_1(t))}function Rg(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Ag(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function $a(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function gc(t,e){var n=e.checked;return Ge({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function tp(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Pr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Ng(t,e){e=e.checked,e!=null&&xf(t,"checked",e,!1)}function vc(t,e){Ng(t,e);var n=Pr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?yc(t,e.type,n):e.hasOwnProperty("defaultValue")&&yc(t,e.type,Pr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function np(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function yc(t,e,n){(e!=="number"||$a(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Lo=Array.isArray;function Ri(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=ta.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function ts(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Fo={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},S1=["Webkit","ms","Moz","O"];Object.keys(Fo).forEach(function(t){S1.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Fo[e]=Fo[t]})});function jg(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Fo.hasOwnProperty(t)&&Fo[t]?(""+e).trim():e+"px"}function Ug(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=jg(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var E1=Ge({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 Sc(t,e){if(e){if(E1[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(X(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(X(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(X(61))}if(e.style!=null&&typeof e.style!="object")throw Error(X(62))}}function Ec(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bc=null;function Df(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Tc=null,Ni=null,Di=null;function op(t){if(t=Cs(t)){if(typeof Tc!="function")throw Error(X(280));var e=t.stateNode;e&&(e=Bl(e),Tc(t.stateNode,t.type,e))}}function Fg(t){Ni?Di?Di.push(t):Di=[t]:Ni=t}function Vg(){if(Ni){var t=Ni,e=Di;if(Di=Ni=null,op(t),e)for(t=0;t>>=0,t===0?32:31-(N1(t)/D1|0)|0}var na=64,ra=4194304;function jo(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Ga(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,l=n&268435455;if(l!==0){var a=l&~i;a!==0?r=jo(a):(o&=l,o!==0&&(r=jo(o)))}else l=n&~i,l!==0?r=jo(l):o!==0&&(r=jo(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function bs(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-mn(e),t[e]=n}function U1(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Bo),pp=" ",mp=!1;function sv(t,e){switch(t){case"keyup":return dS.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function av(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _i=!1;function pS(t,e){switch(t){case"compositionend":return av(e);case"keypress":return e.which!==32?null:(mp=!0,pp);case"textInput":return t=e.data,t===pp&&mp?null:t;default:return null}}function mS(t,e){if(_i)return t==="compositionend"||!zf&&sv(t,e)?(t=iv(),ka=Ff=hr=null,_i=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wp(n)}}function fv(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?fv(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function dv(){for(var t=window,e=$a();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=$a(t.document)}return e}function $f(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function TS(t){var e=dv(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&fv(n.ownerDocument.documentElement,n)){if(r!==null&&$f(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=_p(n,o);var l=_p(n,r);i&&l&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==l.node||t.focusOffset!==l.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(l.node,l.offset)):(e.setEnd(l.node,l.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Si=null,xc=null,$o=null,Ac=!1;function Sp(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ac||Si==null||Si!==$a(r)||(r=Si,"selectionStart"in r&&$f(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}),$o&&as($o,r)||($o=r,r=Qa(xc,"onSelect"),0Ti||(t.current=jc[Ti],jc[Ti]=null,Ti--)}function Le(t,e){Ti++,jc[Ti]=t.current,t.current=e}var xr={},bt=Rr(xr),Lt=Rr(!1),ei=xr;function Wi(t,e){var n=t.type.contextTypes;if(!n)return xr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function jt(t){return t=t.childContextTypes,t!=null}function Ja(){Ve(Lt),Ve(bt)}function kp(t,e,n){if(bt.current!==xr)throw Error(X(168));Le(bt,e),Le(Lt,n)}function Sv(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(X(108,w1(t)||"Unknown",i));return Ge({},n,r)}function Za(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||xr,ei=bt.current,Le(bt,t),Le(Lt,Lt.current),!0}function Pp(t,e,n){var r=t.stateNode;if(!r)throw Error(X(169));n?(t=Sv(t,e,ei),r.__reactInternalMemoizedMergedChildContext=t,Ve(Lt),Ve(bt),Le(bt,t)):Ve(Lt),Le(Lt,n)}var Un=null,zl=!1,zu=!1;function Ev(t){Un===null?Un=[t]:Un.push(t)}function LS(t){zl=!0,Ev(t)}function Nr(){if(!zu&&Un!==null){zu=!0;var t=0,e=Ae;try{var n=Un;for(Ae=1;t>=l,i-=l,Vn=1<<32-mn(e)+i|n<w?(b=T,T=null):b=T.sibling;var C=m(I,T,E[w],M);if(C===null){T===null&&(T=b);break}t&&T&&C.alternate===null&&e(I,T),S=o(C,S,w),q===null?F=C:q.sibling=C,q=C,T=b}if(w===E.length)return n(I,T),$e&&Vr(I,w),F;if(T===null){for(;ww?(b=T,T=null):b=T.sibling;var N=m(I,T,C.value,M);if(N===null){T===null&&(T=b);break}t&&T&&N.alternate===null&&e(I,T),S=o(N,S,w),q===null?F=N:q.sibling=N,q=N,T=b}if(C.done)return n(I,T),$e&&Vr(I,w),F;if(T===null){for(;!C.done;w++,C=E.next())C=p(I,C.value,M),C!==null&&(S=o(C,S,w),q===null?F=C:q.sibling=C,q=C);return $e&&Vr(I,w),F}for(T=r(I,T);!C.done;w++,C=E.next())C=_(T,I,w,C.value,M),C!==null&&(t&&C.alternate!==null&&T.delete(C.key===null?w:C.key),S=o(C,S,w),q===null?F=C:q.sibling=C,q=C);return t&&T.forEach(function(A){return e(I,A)}),$e&&Vr(I,w),F}function D(I,S,E,M){if(typeof E=="object"&&E!==null&&E.type===wi&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Zs:e:{for(var F=E.key,q=S;q!==null;){if(q.key===F){if(F=E.type,F===wi){if(q.tag===7){n(I,q.sibling),S=i(q,E.props.children),S.return=I,I=S;break e}}else if(q.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===sr&&Rp(F)===q.type){n(I,q.sibling),S=i(q,E.props),S.ref=Po(I,q,E),S.return=I,I=S;break e}n(I,q);break}else e(I,q);q=q.sibling}E.type===wi?(S=Xr(E.props.children,I.mode,M,E.key),S.return=I,I=S):(M=La(E.type,E.key,E.props,null,I.mode,M),M.ref=Po(I,S,E),M.return=I,I=M)}return l(I);case yi:e:{for(q=E.key;S!==null;){if(S.key===q)if(S.tag===4&&S.stateNode.containerInfo===E.containerInfo&&S.stateNode.implementation===E.implementation){n(I,S.sibling),S=i(S,E.children||[]),S.return=I,I=S;break e}else{n(I,S);break}else e(I,S);S=S.sibling}S=Qu(E,I.mode,M),S.return=I,I=S}return l(I);case sr:return q=E._init,D(I,S,q(E._payload),M)}if(Lo(E))return g(I,S,E,M);if(To(E))return P(I,S,E,M);ca(I,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,S!==null&&S.tag===6?(n(I,S.sibling),S=i(S,E),S.return=I,I=S):(n(I,S),S=Yu(E,I.mode,M),S.return=I,I=S),l(I)):n(I,S)}return D}var qi=Iv(!0),Ov=Iv(!1),nl=Rr(null),rl=null,Oi=null,Gf=null;function Kf(){Gf=Oi=rl=null}function Yf(t){var e=nl.current;Ve(nl),t._currentValue=e}function Vc(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Li(t,e){rl=t,Gf=Oi=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Dt=!0),t.firstContext=null)}function rn(t){var e=t._currentValue;if(Gf!==t)if(t={context:t,memoizedValue:e,next:null},Oi===null){if(rl===null)throw Error(X(308));Oi=t,rl.dependencies={lanes:0,firstContext:t}}else Oi=Oi.next=t;return e}var qr=null;function Qf(t){qr===null?qr=[t]:qr.push(t)}function kv(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Qf(e)):(n.next=i.next,i.next=n),e.interleaved=n,Yn(t,r)}function Yn(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var ar=!1;function Xf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pv(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function qn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Er(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,ke&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Yn(t,n)}return i=r.interleaved,i===null?(e.next=e,Qf(r)):(e.next=i.next,i.next=e),r.interleaved=e,Yn(t,n)}function xa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Lf(t,n)}}function Np(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function il(t,e,n,r){var i=t.updateQueue;ar=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var u=a,f=u.next;u.next=null,l===null?o=f:l.next=f,l=u;var h=t.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==l&&(a===null?h.firstBaseUpdate=f:a.next=f,h.lastBaseUpdate=u))}if(o!==null){var p=i.baseState;l=0,h=f=u=null,a=o;do{var m=a.lane,_=a.eventTime;if((r&m)===m){h!==null&&(h=h.next={eventTime:_,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=t,P=a;switch(m=e,_=n,P.tag){case 1:if(g=P.payload,typeof g=="function"){p=g.call(_,p,m);break e}p=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=P.payload,m=typeof g=="function"?g.call(_,p,m):g,m==null)break e;p=Ge({},p,m);break e;case 2:ar=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,m=i.effects,m===null?i.effects=[a]:m.push(a))}else _={eventTime:_,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(f=h=_,u=p):h=h.next=_,l|=m;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;m=a,a=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);if(h===null&&(u=p),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=h,e=i.shared.interleaved,e!==null){i=e;do l|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);ri|=l,t.lanes=l,t.memoizedState=p}}function Dp(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=Wu.transition;Wu.transition={};try{t(!1),e()}finally{Ae=n,Wu.transition=r}}function qv(){return on().memoizedState}function VS(t,e,n){var r=Tr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Gv(t))Kv(e,n);else if(n=kv(t,e,n,r),n!==null){var i=Pt();gn(n,t,r,i),Yv(n,e,r)}}function BS(t,e,n){var r=Tr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gv(t))Kv(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var l=e.lastRenderedState,a=o(l,n);if(i.hasEagerState=!0,i.eagerState=a,wn(a,l)){var u=e.interleaved;u===null?(i.next=i,Qf(e)):(i.next=u.next,u.next=i),e.interleaved=i;return}}catch{}finally{}n=kv(t,e,i,r),n!==null&&(i=Pt(),gn(n,t,r,i),Yv(n,e,r))}}function Gv(t){var e=t.alternate;return t===qe||e!==null&&e===qe}function Kv(t,e){Wo=sl=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Yv(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Lf(t,n)}}var al={readContext:rn,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},zS={readContext:rn,useCallback:function(t,e){return bn().memoizedState=[t,e===void 0?null:e],t},useContext:rn,useEffect:Lp,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Ra(4194308,4,Bv.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Ra(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ra(4,2,t,e)},useMemo:function(t,e){var n=bn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=bn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=VS.bind(null,qe,t),[r.memoizedState,t]},useRef:function(t){var e=bn();return t={current:t},e.memoizedState=t},useState:Mp,useDebugValue:od,useDeferredValue:function(t){return bn().memoizedState=t},useTransition:function(){var t=Mp(!1),e=t[0];return t=FS.bind(null,t[1]),bn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=qe,i=bn();if($e){if(n===void 0)throw Error(X(407));n=n()}else{if(n=e(),ot===null)throw Error(X(349));ni&30||Nv(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Lp(Mv.bind(null,r,o,t),[t]),r.flags|=2048,ms(9,Dv.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=bn(),e=ot.identifierPrefix;if($e){var n=Bn,r=Vn;n=(r&~(1<<32-mn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=hs++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=l.createElement(n,{is:r.is}):(t=l.createElement(n),n==="select"&&(l=t,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):t=l.createElementNS(t,n),t[Tn]=e,t[cs]=r,iy(t,e,!1,!1),e.stateNode=t;e:{switch(l=Sc(n,r),n){case"dialog":Fe("cancel",t),Fe("close",t),i=r;break;case"iframe":case"object":case"embed":Fe("load",t),i=r;break;case"video":case"audio":for(i=0;iYi&&(e.flags|=128,r=!0,xo(o,!1),e.lanes=4194304)}else{if(!r)if(t=il(l),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),xo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!$e)return mt(e),null}else 2*Xe()-o.renderingStartTime>Yi&&n!==1073741824&&(e.flags|=128,r=!0,xo(o,!1),e.lanes=4194304);o.isBackwards?(l.sibling=e.child,e.child=l):(n=o.last,n!==null?n.sibling=l:e.child=l,o.last=l)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Xe(),e.sibling=null,n=He.current,Le(He,r?n&1|2:n&1),e):(mt(e),null);case 22:case 23:return cd(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?zt&1073741824&&(mt(e),e.subtreeFlags&6&&(e.flags|=8192)):mt(e),null;case 24:return null;case 25:return null}throw Error(X(156,e.tag))}function YS(t,e){switch(Wf(e),e.tag){case 1:return jt(e.type)&&Xa(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Gi(),Ve(Lt),Ve(bt),Zf(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Jf(e),null;case 13:if(Ve(He),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(X(340));Hi()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ve(He),null;case 4:return Gi(),null;case 10:return Kf(e.type._context),null;case 22:case 23:return cd(),null;case 24:return null;default:return null}}var da=!1,wt=!1,QS=typeof WeakSet=="function"?WeakSet:Set,ce=null;function ki(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ke(t,e,r)}else n.current=null}function Kc(t,e,n){try{n()}catch(r){Ke(t,e,r)}}var qp=!1;function XS(t,e){if(Ac=Ga,t=fv(),zf(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,a=-1,u=-1,f=0,h=0,p=t,m=null;t:for(;;){for(var _;p!==n||i!==0&&p.nodeType!==3||(a=l+i),p!==o||r!==0&&p.nodeType!==3||(u=l+r),p.nodeType===3&&(l+=p.nodeValue.length),(_=p.firstChild)!==null;)m=p,p=_;for(;;){if(p===t)break t;if(m===n&&++f===i&&(a=l),m===o&&++h===r&&(u=l),(_=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=_}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rc={focusedElem:t,selectionRange:n},Ga=!1,ce=e;ce!==null;)if(e=ce,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ce=t;else for(;ce!==null;){e=ce;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var P=g.memoizedProps,D=g.memoizedState,I=e.stateNode,S=I.getSnapshotBeforeUpdate(e.elementType===e.type?P:cn(e.type,P),D);I.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var E=e.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(M){Ke(e,e.return,M)}if(t=e.sibling,t!==null){t.return=e.return,ce=t;break}ce=e.return}return g=qp,qp=!1,g}function Ho(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&Kc(e,n,o)}i=i.next}while(i!==r)}}function Wl(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Yc(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function ay(t){var e=t.alternate;e!==null&&(t.alternate=null,ay(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Tn],delete e[cs],delete e[Mc],delete e[NS],delete e[DS])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function ly(t){return t.tag===5||t.tag===3||t.tag===4}function Gp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ly(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Qc(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Qa));else if(r!==4&&(t=t.child,t!==null))for(Qc(t,e,n),t=t.sibling;t!==null;)Qc(t,e,n),t=t.sibling}function Xc(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Xc(t,e,n),t=t.sibling;t!==null;)Xc(t,e,n),t=t.sibling}var lt=null,dn=!1;function ir(t,e,n){for(n=n.child;n!==null;)uy(t,e,n),n=n.sibling}function uy(t,e,n){if(kn&&typeof kn.onCommitFiberUnmount=="function")try{kn.onCommitFiberUnmount(Ll,n)}catch{}switch(n.tag){case 5:wt||ki(n,e);case 6:var r=lt,i=dn;lt=null,ir(t,e,n),lt=r,dn=i,lt!==null&&(dn?(t=lt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):lt.removeChild(n.stateNode));break;case 18:lt!==null&&(dn?(t=lt,n=n.stateNode,t.nodeType===8?Vu(t.parentNode,n):t.nodeType===1&&Vu(t,n),os(t)):Vu(lt,n.stateNode));break;case 4:r=lt,i=dn,lt=n.stateNode.containerInfo,dn=!0,ir(t,e,n),lt=r,dn=i;break;case 0:case 11:case 14:case 15:if(!wt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&Kc(n,e,l),i=i.next}while(i!==r)}ir(t,e,n);break;case 1:if(!wt&&(ki(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ke(n,e,a)}ir(t,e,n);break;case 21:ir(t,e,n);break;case 22:n.mode&1?(wt=(r=wt)||n.memoizedState!==null,ir(t,e,n),wt=r):ir(t,e,n);break;default:ir(t,e,n)}}function Kp(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new QS),e.forEach(function(r){var i=sE.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function un(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ZS(r/1960))-r,10t?16:t,pr===null)var r=!1;else{if(t=pr,pr=null,ul=0,ke&6)throw Error(X(331));var i=ke;for(ke|=4,ce=t.current;ce!==null;){var o=ce,l=o.child;if(ce.flags&16){var a=o.deletions;if(a!==null){for(var u=0;uXe()-ld?Qr(t,0):ad|=n),Ut(t,e)}function vy(t,e){e===0&&(t.mode&1?(e=ra,ra<<=1,!(ra&130023424)&&(ra=4194304)):e=1);var n=Pt();t=Yn(t,e),t!==null&&(bs(t,e,n),Ut(t,n))}function oE(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),vy(t,n)}function sE(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(e),vy(t,n)}var yy;yy=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Lt.current)Dt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Dt=!1,GS(t,e,n);Dt=!!(t.flags&131072)}else Dt=!1,$e&&e.flags&1048576&&Ev(e,el,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Ra(t,e),t=e.pendingProps;var i=Wi(e,bt.current);Li(e,n),i=td(null,e,r,t,i,n);var o=nd();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,jt(r)?(o=!0,Ja(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Qf(e),i.updater=$l,e.stateNode=i,i._reactInternals=e,Bc(e,r,t,n),e=Wc(null,e,r,!0,o,n)):(e.tag=0,$e&&o&&$f(e),Ot(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Ra(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=lE(r),t=cn(r,t),i){case 0:e=$c(null,e,r,t,n);break e;case 1:e=$p(null,e,r,t,n);break e;case 11:e=Bp(null,e,r,t,n);break e;case 14:e=zp(null,e,r,cn(r.type,t),n);break e}throw Error(X(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:cn(r,i),$c(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:cn(r,i),$p(t,e,r,i,n);case 3:e:{if(ty(e),t===null)throw Error(X(387));r=e.pendingProps,o=e.memoizedState,i=o.element,kv(t,e),rl(e,r,null,n);var l=e.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Ki(Error(X(423)),e),e=Wp(t,e,r,n,i);break e}else if(r!==i){i=Ki(Error(X(424)),e),e=Wp(t,e,r,n,i);break e}else for(Wt=Sr(e.stateNode.containerInfo.firstChild),qt=e,$e=!0,hn=null,n=Iv(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hi(),r===i){e=Qn(t,e,n);break e}Ot(t,e,r,n)}e=e.child}return e;case 5:return Pv(e),t===null&&Uc(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,l=i.children,Nc(r,i)?l=null:o!==null&&Nc(r,o)&&(e.flags|=32),ey(t,e),Ot(t,e,l,n),e.child;case 6:return t===null&&Uc(e),null;case 13:return ny(t,e,n);case 4:return Xf(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=qi(e,null,r,n):Ot(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:cn(r,i),Bp(t,e,r,i,n);case 7:return Ot(t,e,e.pendingProps,n),e.child;case 8:return Ot(t,e,e.pendingProps.children,n),e.child;case 12:return Ot(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,l=i.value,Le(tl,r._currentValue),r._currentValue=l,o!==null)if(wn(o.value,l)){if(o.children===i.children&&!Lt.current){e=Qn(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){l=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=qn(-1,n&-n),u.tag=2;var f=o.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?u.next=u:(u.next=h.next,h.next=u),f.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Fc(o.return,n,e),a.lanes|=n;break}u=u.next}}else if(o.tag===10)l=o.type===e.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(X(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),Fc(l,n,e),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===e){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Ot(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Li(e,n),i=rn(i),r=r(i),e.flags|=1,Ot(t,e,r,n),e.child;case 14:return r=e.type,i=cn(r,e.pendingProps),i=cn(r.type,i),zp(t,e,r,i,n);case 15:return Jv(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:cn(r,i),Ra(t,e),e.tag=1,jt(r)?(t=!0,Ja(e)):t=!1,Li(e,n),Yv(e,r,i),Bc(e,r,i,n),Wc(null,e,r,!0,t,n);case 19:return ry(t,e,n);case 22:return Zv(t,e,n)}throw Error(X(156,e.tag))};function wy(t,e){return qg(t,e)}function aE(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(t,e,n,r){return new aE(t,e,n,r)}function dd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function lE(t){if(typeof t=="function")return dd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Af)return 11;if(t===Rf)return 14}return 2}function Cr(t,e){var n=t.alternate;return n===null?(n=tn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ma(t,e,n,r,i,o){var l=2;if(r=t,typeof t=="function")dd(t)&&(l=1);else if(typeof t=="string")l=5;else e:switch(t){case wi:return Xr(n.children,i,o,e);case xf:l=8,i|=8;break;case fc:return t=tn(12,n,e,i|2),t.elementType=fc,t.lanes=o,t;case dc:return t=tn(13,n,e,i),t.elementType=dc,t.lanes=o,t;case hc:return t=tn(19,n,e,i),t.elementType=hc,t.lanes=o,t;case Pg:return ql(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Og:l=10;break e;case kg:l=9;break e;case Af:l=11;break e;case Rf:l=14;break e;case sr:l=16,r=null;break e}throw Error(X(130,t==null?t:typeof t,""))}return e=tn(l,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Xr(t,e,n,r){return t=tn(7,t,r,e),t.lanes=n,t}function ql(t,e,n,r){return t=tn(22,t,r,e),t.elementType=Pg,t.lanes=n,t.stateNode={isHidden:!1},t}function Ku(t,e,n){return t=tn(6,t,null,e),t.lanes=n,t}function Yu(t,e,n){return e=tn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function uE(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pu(0),this.expirationTimes=Pu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pu(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hd(t,e,n,r,i,o,l,a,u){return t=new uE(t,e,n,a,u),e===1?(e=1,o===!0&&(e|=8)):e=0,o=tn(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qf(o),t}function cE(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(by)}catch(t){console.error(t)}}by(),bg.exports=Kt;var Ty=bg.exports,nm=Ty;uc.createRoot=nm.createRoot,uc.hydrateRoot=nm.hydrateRoot;var Os=t=>t.type==="checkbox",xi=t=>t instanceof Date,kt=t=>t==null;const Cy=t=>typeof t=="object";var rt=t=>!kt(t)&&!Array.isArray(t)&&Cy(t)&&!xi(t),Iy=t=>rt(t)&&t.target?Os(t.target)?t.target.checked:t.target.value:t,mE=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,Oy=(t,e)=>t.has(mE(e)),gE=t=>{const e=t.constructor&&t.constructor.prototype;return rt(e)&&e.hasOwnProperty("isPrototypeOf")},vd=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Rt(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(vd&&(t instanceof Blob||t instanceof FileList))&&(n||rt(t)))if(e=n?[]:{},!n&&!gE(t))e=t;else for(const r in t)t.hasOwnProperty(r)&&(e[r]=Rt(t[r]));else return t;return e}var Xl=t=>Array.isArray(t)?t.filter(Boolean):[],Ye=t=>t===void 0,ie=(t,e,n)=>{if(!e||!rt(t))return n;const r=Xl(e.split(/[,[\].]+?/)).reduce((i,o)=>kt(i)?i:i[o],t);return Ye(r)||r===t?Ye(t[e])?n:t[e]:r},Cn=t=>typeof t=="boolean",yd=t=>/^\w*$/.test(t),ky=t=>Xl(t.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(t,e,n)=>{let r=-1;const i=yd(e)?[e]:ky(e),o=i.length,l=o-1;for(;++rge.useContext(vE);var Py=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const o in t)Object.defineProperty(i,o,{get:()=>{const l=o;return e._proxyFormState[l]!==pn.all&&(e._proxyFormState[l]=!r||pn.all),n&&(n[l]=!0),t[l]}});return i},Bt=t=>rt(t)&&!Object.keys(t).length,xy=(t,e,n,r)=>{n(t);const{name:i,...o}=t;return Bt(o)||Object.keys(o).length>=Object.keys(e).length||Object.keys(o).find(l=>e[l]===(!r||pn.all))},Ko=t=>Array.isArray(t)?t:[t],Ay=(t,e,n)=>!t||!e||t===e||Ko(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function _d(t){const e=ge.useRef(t);e.current=t,ge.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function yE(t){const e=wd(),{control:n=e.control,disabled:r,name:i,exact:o}=t||{},[l,a]=ge.useState(n._formState),u=ge.useRef(!0),f=ge.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),h=ge.useRef(i);return h.current=i,_d({disabled:r,next:p=>u.current&&Ay(h.current,p.name,o)&&xy(p,f.current,n._updateFormState)&&a({...n._formState,...p}),subject:n._subjects.state}),ge.useEffect(()=>(u.current=!0,f.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),Py(l,n,f.current,!1)}var On=t=>typeof t=="string",Ry=(t,e,n,r,i)=>On(t)?(r&&e.watch.add(t),ie(n,t,i)):Array.isArray(t)?t.map(o=>(r&&e.watch.add(o),ie(n,o))):(r&&(e.watchAll=!0),n);function wE(t){const e=wd(),{control:n=e.control,name:r,defaultValue:i,disabled:o,exact:l}=t||{},a=ge.useRef(r);a.current=r,_d({disabled:o,subject:n._subjects.values,next:h=>{Ay(a.current,h.name,l)&&f(Rt(Ry(a.current,n._names,h.values||n._formValues,!1,i)))}});const[u,f]=ge.useState(n._getWatch(r,i));return ge.useEffect(()=>n._removeUnmounted()),u}function _E(t){const e=wd(),{name:n,disabled:r,control:i=e.control,shouldUnregister:o}=t,l=Oy(i._names.array,n),a=wE({control:i,name:n,defaultValue:ie(i._formValues,n,ie(i._defaultValues,n,t.defaultValue)),exact:!0}),u=yE({control:i,name:n}),f=ge.useRef(i.register(n,{...t.rules,value:a,...Cn(t.disabled)?{disabled:t.disabled}:{}}));return ge.useEffect(()=>{const h=i._options.shouldUnregister||o,p=(m,_)=>{const g=ie(i._fields,m);g&&g._f&&(g._f.mount=_)};if(p(n,!0),h){const m=Rt(ie(i._options.defaultValues,n));De(i._defaultValues,n,m),Ye(ie(i._formValues,n))&&De(i._formValues,n,m)}return()=>{(l?h&&!i._state.action:h)?i.unregister(n):p(n,!1)}},[n,i,l,o]),ge.useEffect(()=>{ie(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:ie(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:a,...Cn(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:ge.useCallback(h=>f.current.onChange({target:{value:Iy(h),name:n},type:dl.CHANGE}),[n]),onBlur:ge.useCallback(()=>f.current.onBlur({target:{value:ie(i._formValues,n),name:n},type:dl.BLUR}),[n,i]),ref:h=>{const p=ie(i._fields,n);p&&h&&(p._f.ref={focus:()=>h.focus(),select:()=>h.select(),setCustomValidity:m=>h.setCustomValidity(m),reportValidity:()=>h.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ie(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!ie(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ie(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!ie(u.validatingFields,n)},error:{enumerable:!0,get:()=>ie(u.errors,n)}})}}const mr=t=>t.render(_E(t));var SE=(t,e,n,r,i)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},rm=t=>({isOnSubmit:!t||t===pn.onSubmit,isOnBlur:t===pn.onBlur,isOnChange:t===pn.onChange,isOnAll:t===pn.all,isOnTouch:t===pn.onTouched}),im=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Yo=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const o=ie(t,i);if(o){const{_f:l,...a}=o;if(l){if(l.refs&&l.refs[0]&&e(l.refs[0],i)&&!r)break;if(l.ref&&e(l.ref,l.name)&&!r)break;Yo(a,e)}else rt(a)&&Yo(a,e)}}};var EE=(t,e,n)=>{const r=Ko(ie(t,n));return De(r,"root",e[n]),De(t,n,r),t},Sd=t=>t.type==="file",gr=t=>typeof t=="function",hl=t=>{if(!vd)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},La=t=>On(t),Ed=t=>t.type==="radio",pl=t=>t instanceof RegExp;const om={value:!1,isValid:!1},sm={value:!0,isValid:!0};var Ny=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Ye(t[0].attributes.value)?Ye(t[0].value)||t[0].value===""?sm:{value:t[0].value,isValid:!0}:sm:om}return om};const am={isValid:!1,value:null};var Dy=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,am):am;function lm(t,e,n="validate"){if(La(t)||Array.isArray(t)&&t.every(La)||Cn(t)&&!t)return{type:n,message:La(t)?t:"",ref:e}}var vi=t=>rt(t)&&!pl(t)?t:{value:t,message:""},um=async(t,e,n,r,i)=>{const{ref:o,refs:l,required:a,maxLength:u,minLength:f,min:h,max:p,pattern:m,validate:_,name:g,valueAsNumber:P,mount:D,disabled:I}=t._f,S=ie(e,g);if(!D||I)return{};const E=l?l[0]:o,M=A=>{r&&E.reportValidity&&(E.setCustomValidity(Cn(A)?"":A||""),E.reportValidity())},F={},q=Ed(o),T=Os(o),w=q||T,b=(P||Sd(o))&&Ye(o.value)&&Ye(S)||hl(o)&&o.value===""||S===""||Array.isArray(S)&&!S.length,C=SE.bind(null,g,n,F),N=(A,v,G,Y=Mn.maxLength,me=Mn.minLength)=>{const B=A?v:G;F[g]={type:A?Y:me,message:B,ref:o,...C(A?Y:me,B)}};if(i?!Array.isArray(S)||!S.length:a&&(!w&&(b||kt(S))||Cn(S)&&!S||T&&!Ny(l).isValid||q&&!Dy(l).isValid)){const{value:A,message:v}=La(a)?{value:!!a,message:a}:vi(a);if(A&&(F[g]={type:Mn.required,message:v,ref:E,...C(Mn.required,v)},!n))return M(v),F}if(!b&&(!kt(h)||!kt(p))){let A,v;const G=vi(p),Y=vi(h);if(!kt(S)&&!isNaN(S)){const me=o.valueAsNumber||S&&+S;kt(G.value)||(A=me>G.value),kt(Y.value)||(v=menew Date(new Date().toDateString()+" "+le),W=o.type=="time",oe=o.type=="week";On(G.value)&&S&&(A=W?B(S)>B(G.value):oe?S>G.value:me>new Date(G.value)),On(Y.value)&&S&&(v=W?B(S)+A.value,Y=!kt(v.value)&&S.length<+v.value;if((G||Y)&&(N(G,A.message,v.message),!n))return M(F[g].message),F}if(m&&!b&&On(S)){const{value:A,message:v}=vi(m);if(pl(A)&&!S.match(A)&&(F[g]={type:Mn.pattern,message:v,ref:o,...C(Mn.pattern,v)},!n))return M(v),F}if(_){if(gr(_)){const A=await _(S,e),v=lm(A,E);if(v&&(F[g]={...v,...C(Mn.validate,v.message)},!n))return M(v.message),F}else if(rt(_)){let A={};for(const v in _){if(!Bt(A)&&!n)break;const G=lm(await _[v](S,e),E,v);G&&(A={...G,...C(v,G.message)},M(G.message),n&&(F[g]=A))}if(!Bt(A)&&(F[g]={ref:E,...A},!n))return F}}return M(!0),F};function bE(t,e){const n=e.slice(0,-1).length;let r=0;for(;r{let t=[];return{get observers(){return t},next:i=>{for(const o of t)o.next&&o.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(o=>o!==i)}}),unsubscribe:()=>{t=[]}}},ml=t=>kt(t)||!Cy(t);function Kr(t,e){if(ml(t)||ml(e))return t===e;if(xi(t)&&xi(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const o=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const l=e[i];if(xi(o)&&xi(l)||rt(o)&&rt(l)||Array.isArray(o)&&Array.isArray(l)?!Kr(o,l):o!==l)return!1}}return!0}var My=t=>t.type==="select-multiple",CE=t=>Ed(t)||Os(t),Xu=t=>hl(t)&&t.isConnected,Ly=t=>{for(const e in t)if(gr(t[e]))return!0;return!1};function gl(t,e={}){const n=Array.isArray(t);if(rt(t)||n)for(const r in t)Array.isArray(t[r])||rt(t[r])&&!Ly(t[r])?(e[r]=Array.isArray(t[r])?[]:{},gl(t[r],e[r])):kt(t[r])||(e[r]=!0);return e}function jy(t,e,n){const r=Array.isArray(t);if(rt(t)||r)for(const i in t)Array.isArray(t[i])||rt(t[i])&&!Ly(t[i])?Ye(e)||ml(n[i])?n[i]=Array.isArray(t[i])?gl(t[i],[]):{...gl(t[i])}:jy(t[i],kt(e)?{}:e[i],n[i]):n[i]=!Kr(t[i],e[i]);return n}var ma=(t,e)=>jy(t,e,gl(e)),Uy=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Ye(t)?t:e?t===""?NaN:t&&+t:n&&On(t)?new Date(t):r?r(t):t;function Ju(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return Sd(e)?e.files:Ed(e)?Dy(t.refs).value:My(e)?[...e.selectedOptions].map(({value:n})=>n):Os(e)?Ny(t.refs).value:Uy(Ye(e.value)?t.ref.value:e.value,t)}var IE=(t,e,n,r)=>{const i={};for(const o of t){const l=ie(e,o);l&&De(i,o,l._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},Ro=t=>Ye(t)?t:pl(t)?t.source:rt(t)?pl(t.value)?t.value.source:t.value:t,OE=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function cm(t,e,n){const r=ie(t,n);if(r||yd(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),l=ie(e,o),a=ie(t,o);if(l&&!Array.isArray(l)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};i.pop()}return{name:n}}var kE=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,PE=(t,e)=>!Xl(ie(t,e)).length&&et(t,e);const xE={mode:pn.onSubmit,reValidateMode:pn.onChange,shouldFocusError:!0};function AE(t={}){let e={...xE,...t},n={submitCount:0,isDirty:!1,isLoading:gr(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},i=rt(e.defaultValues)||rt(e.values)?Rt(e.defaultValues||e.values)||{}:{},o=e.shouldUnregister?{}:Rt(i),l={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,f=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:Qu(),array:Qu(),state:Qu()},m=rm(e.mode),_=rm(e.reValidateMode),g=e.criteriaMode===pn.all,P=k=>j=>{clearTimeout(f),f=setTimeout(k,j)},D=async k=>{if(h.isValid||k){const j=e.resolver?Bt((await w()).errors):await C(r,!0);j!==n.isValid&&p.state.next({isValid:j})}},I=(k,j)=>{(h.isValidating||h.validatingFields)&&((k||Array.from(a.mount)).forEach(z=>{z&&(j?De(n.validatingFields,z,j):et(n.validatingFields,z))}),p.state.next({validatingFields:n.validatingFields,isValidating:!Bt(n.validatingFields)}))},S=(k,j=[],z,Z,Q=!0,K=!0)=>{if(Z&&z){if(l.action=!0,K&&Array.isArray(ie(r,k))){const ae=z(ie(r,k),Z.argA,Z.argB);Q&&De(r,k,ae)}if(K&&Array.isArray(ie(n.errors,k))){const ae=z(ie(n.errors,k),Z.argA,Z.argB);Q&&De(n.errors,k,ae),PE(n.errors,k)}if(h.touchedFields&&K&&Array.isArray(ie(n.touchedFields,k))){const ae=z(ie(n.touchedFields,k),Z.argA,Z.argB);Q&&De(n.touchedFields,k,ae)}h.dirtyFields&&(n.dirtyFields=ma(i,o)),p.state.next({name:k,isDirty:A(k,j),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else De(o,k,j)},E=(k,j)=>{De(n.errors,k,j),p.state.next({errors:n.errors})},M=k=>{n.errors=k,p.state.next({errors:n.errors,isValid:!1})},F=(k,j,z,Z)=>{const Q=ie(r,k);if(Q){const K=ie(o,k,Ye(z)?ie(i,k):z);Ye(K)||Z&&Z.defaultChecked||j?De(o,k,j?K:Ju(Q._f)):Y(k,K),l.mount&&D()}},q=(k,j,z,Z,Q)=>{let K=!1,ae=!1;const te={name:k},se=!!(ie(r,k)&&ie(r,k)._f&&ie(r,k)._f.disabled);if(!z||Z){h.isDirty&&(ae=n.isDirty,n.isDirty=te.isDirty=A(),K=ae!==te.isDirty);const re=se||Kr(ie(i,k),j);ae=!!(!se&&ie(n.dirtyFields,k)),re||se?et(n.dirtyFields,k):De(n.dirtyFields,k,!0),te.dirtyFields=n.dirtyFields,K=K||h.dirtyFields&&ae!==!re}if(z){const re=ie(n.touchedFields,k);re||(De(n.touchedFields,k,z),te.touchedFields=n.touchedFields,K=K||h.touchedFields&&re!==z)}return K&&Q&&p.state.next(te),K?te:{}},T=(k,j,z,Z)=>{const Q=ie(n.errors,k),K=h.isValid&&Cn(j)&&n.isValid!==j;if(t.delayError&&z?(u=P(()=>E(k,z)),u(t.delayError)):(clearTimeout(f),u=null,z?De(n.errors,k,z):et(n.errors,k)),(z?!Kr(Q,z):Q)||!Bt(Z)||K){const ae={...Z,...K&&Cn(j)?{isValid:j}:{},errors:n.errors,name:k};n={...n,...ae},p.state.next(ae)}},w=async k=>{I(k,!0);const j=await e.resolver(o,e.context,IE(k||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return I(k),j},b=async k=>{const{errors:j}=await w(k);if(k)for(const z of k){const Z=ie(j,z);Z?De(n.errors,z,Z):et(n.errors,z)}else n.errors=j;return j},C=async(k,j,z={valid:!0})=>{for(const Z in k){const Q=k[Z];if(Q){const{_f:K,...ae}=Q;if(K){const te=a.array.has(K.name);I([Z],!0);const se=await um(Q,o,g,e.shouldUseNativeValidation&&!j,te);if(I([Z]),se[K.name]&&(z.valid=!1,j))break;!j&&(ie(se,K.name)?te?EE(n.errors,se,K.name):De(n.errors,K.name,se[K.name]):et(n.errors,K.name))}ae&&await C(ae,j,z)}}return z.valid},N=()=>{for(const k of a.unMount){const j=ie(r,k);j&&(j._f.refs?j._f.refs.every(z=>!Xu(z)):!Xu(j._f.ref))&&Re(k)}a.unMount=new Set},A=(k,j)=>(k&&j&&De(o,k,j),!Kr(ve(),i)),v=(k,j,z)=>Ry(k,a,{...l.mount?o:Ye(j)?i:On(k)?{[k]:j}:j},z,j),G=k=>Xl(ie(l.mount?o:i,k,t.shouldUnregister?ie(i,k,[]):[])),Y=(k,j,z={})=>{const Z=ie(r,k);let Q=j;if(Z){const K=Z._f;K&&(!K.disabled&&De(o,k,Uy(j,K)),Q=hl(K.ref)&&kt(j)?"":j,My(K.ref)?[...K.ref.options].forEach(ae=>ae.selected=Q.includes(ae.value)):K.refs?Os(K.ref)?K.refs.length>1?K.refs.forEach(ae=>(!ae.defaultChecked||!ae.disabled)&&(ae.checked=Array.isArray(Q)?!!Q.find(te=>te===ae.value):Q===ae.value)):K.refs[0]&&(K.refs[0].checked=!!Q):K.refs.forEach(ae=>ae.checked=ae.value===Q):Sd(K.ref)?K.ref.value="":(K.ref.value=Q,K.ref.type||p.values.next({name:k,values:{...o}})))}(z.shouldDirty||z.shouldTouch)&&q(k,Q,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&le(k)},me=(k,j,z)=>{for(const Z in j){const Q=j[Z],K=`${k}.${Z}`,ae=ie(r,K);(a.array.has(k)||!ml(Q)||ae&&!ae._f)&&!xi(Q)?me(K,Q,z):Y(K,Q,z)}},B=(k,j,z={})=>{const Z=ie(r,k),Q=a.array.has(k),K=Rt(j);De(o,k,K),Q?(p.array.next({name:k,values:{...o}}),(h.isDirty||h.dirtyFields)&&z.shouldDirty&&p.state.next({name:k,dirtyFields:ma(i,o),isDirty:A(k,K)})):Z&&!Z._f&&!kt(K)?me(k,K,z):Y(k,K,z),im(k,a)&&p.state.next({...n}),p.values.next({name:l.mount?k:void 0,values:{...o}})},W=async k=>{l.mount=!0;const j=k.target;let z=j.name,Z=!0;const Q=ie(r,z),K=()=>j.type?Ju(Q._f):Iy(k),ae=te=>{Z=Number.isNaN(te)||te===ie(o,z,te)};if(Q){let te,se;const re=K(),Ce=k.type===dl.BLUR||k.type===dl.FOCUS_OUT,Je=!OE(Q._f)&&!e.resolver&&!ie(n.errors,z)&&!Q._f.deps||kE(Ce,ie(n.touchedFields,z),n.isSubmitted,_,m),We=im(z,a,Ce);De(o,z,re),Ce?(Q._f.onBlur&&Q._f.onBlur(k),u&&u(0)):Q._f.onChange&&Q._f.onChange(k);const Se=q(z,re,Ce,!1),he=!Bt(Se)||We;if(!Ce&&p.values.next({name:z,type:k.type,values:{...o}}),Je)return h.isValid&&D(),he&&p.state.next({name:z,...We?{}:Se});if(!Ce&&We&&p.state.next({...n}),e.resolver){const{errors:ft}=await w([z]);if(ae(re),Z){const er=cm(n.errors,r,z),Rn=cm(ft,r,er.name||z);te=Rn.error,z=Rn.name,se=Bt(ft)}}else I([z],!0),te=(await um(Q,o,g,e.shouldUseNativeValidation))[z],I([z]),ae(re),Z&&(te?se=!1:h.isValid&&(se=await C(r,!0)));Z&&(Q._f.deps&&le(Q._f.deps),T(z,se,te,Se))}},oe=(k,j)=>{if(ie(n.errors,j)&&k.focus)return k.focus(),1},le=async(k,j={})=>{let z,Z;const Q=Ko(k);if(e.resolver){const K=await b(Ye(k)?k:Q);z=Bt(K),Z=k?!Q.some(ae=>ie(K,ae)):z}else k?(Z=(await Promise.all(Q.map(async K=>{const ae=ie(r,K);return await C(ae&&ae._f?{[K]:ae}:ae)}))).every(Boolean),!(!Z&&!n.isValid)&&D()):Z=z=await C(r);return p.state.next({...!On(k)||h.isValid&&z!==n.isValid?{}:{name:k},...e.resolver||!k?{isValid:z}:{},errors:n.errors}),j.shouldFocus&&!Z&&Yo(r,oe,k?Q:a.mount),Z},ve=k=>{const j={...l.mount?o:i};return Ye(k)?j:On(k)?ie(j,k):k.map(z=>ie(j,z))},we=(k,j)=>({invalid:!!ie((j||n).errors,k),isDirty:!!ie((j||n).dirtyFields,k),error:ie((j||n).errors,k),isValidating:!!ie(n.validatingFields,k),isTouched:!!ie((j||n).touchedFields,k)}),_e=k=>{k&&Ko(k).forEach(j=>et(n.errors,j)),p.state.next({errors:k?n.errors:{}})},Be=(k,j,z)=>{const Z=(ie(r,k,{_f:{}})._f||{}).ref,Q=ie(n.errors,k)||{},{ref:K,message:ae,type:te,...se}=Q;De(n.errors,k,{...se,...j,ref:Z}),p.state.next({name:k,errors:n.errors,isValid:!1}),z&&z.shouldFocus&&Z&&Z.focus&&Z.focus()},Me=(k,j)=>gr(k)?p.values.subscribe({next:z=>k(v(void 0,j),z)}):v(k,j,!0),Re=(k,j={})=>{for(const z of k?Ko(k):a.mount)a.mount.delete(z),a.array.delete(z),j.keepValue||(et(r,z),et(o,z)),!j.keepError&&et(n.errors,z),!j.keepDirty&&et(n.dirtyFields,z),!j.keepTouched&&et(n.touchedFields,z),!j.keepIsValidating&&et(n.validatingFields,z),!e.shouldUnregister&&!j.keepDefaultValue&&et(i,z);p.values.next({values:{...o}}),p.state.next({...n,...j.keepDirty?{isDirty:A()}:{}}),!j.keepIsValid&&D()},ze=({disabled:k,name:j,field:z,fields:Z,value:Q})=>{if(Cn(k)&&l.mount||k){const K=k?void 0:Ye(Q)?Ju(z?z._f:ie(Z,j)._f):Q;De(o,j,K),q(j,K,!1,!1,!0)}},O=(k,j={})=>{let z=ie(r,k);const Z=Cn(j.disabled);return De(r,k,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:k}},name:k,mount:!0,...j}}),a.mount.add(k),z?ze({field:z,disabled:j.disabled,name:k,value:j.value}):F(k,!0,j.value),{...Z?{disabled:j.disabled}:{},...e.progressive?{required:!!j.required,min:Ro(j.min),max:Ro(j.max),minLength:Ro(j.minLength),maxLength:Ro(j.maxLength),pattern:Ro(j.pattern)}:{},name:k,onChange:W,onBlur:W,ref:Q=>{if(Q){O(k,j),z=ie(r,k);const K=Ye(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,ae=CE(K),te=z._f.refs||[];if(ae?te.find(se=>se===K):K===z._f.ref)return;De(r,k,{_f:{...z._f,...ae?{refs:[...te.filter(Xu),K,...Array.isArray(ie(i,k))?[{}]:[]],ref:{type:K.type,name:k}}:{ref:K}}}),F(k,!1,void 0,K)}else z=ie(r,k,{}),z._f&&(z._f.mount=!1),(e.shouldUnregister||j.shouldUnregister)&&!(Oy(a.array,k)&&l.action)&&a.unMount.add(k)}}},R=()=>e.shouldFocusError&&Yo(r,oe,a.mount),L=k=>{Cn(k)&&(p.state.next({disabled:k}),Yo(r,(j,z)=>{const Z=ie(r,z);Z&&(j.disabled=Z._f.disabled||k,Array.isArray(Z._f.refs)&&Z._f.refs.forEach(Q=>{Q.disabled=Z._f.disabled||k}))},0,!1))},x=(k,j)=>async z=>{let Z;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let Q=Rt(o);if(p.state.next({isSubmitting:!0}),e.resolver){const{errors:K,values:ae}=await w();n.errors=K,Q=ae}else await C(r);if(et(n.errors,"root"),Bt(n.errors)){p.state.next({errors:{}});try{await k(Q,z)}catch(K){Z=K}}else j&&await j({...n.errors},z),R(),setTimeout(R);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Bt(n.errors)&&!Z,submitCount:n.submitCount+1,errors:n.errors}),Z)throw Z},ue=(k,j={})=>{ie(r,k)&&(Ye(j.defaultValue)?B(k,Rt(ie(i,k))):(B(k,j.defaultValue),De(i,k,Rt(j.defaultValue))),j.keepTouched||et(n.touchedFields,k),j.keepDirty||(et(n.dirtyFields,k),n.isDirty=j.defaultValue?A(k,Rt(ie(i,k))):A()),j.keepError||(et(n.errors,k),h.isValid&&D()),p.state.next({...n}))},$=(k,j={})=>{const z=k?Rt(k):i,Z=Rt(z),Q=Bt(k),K=Q?i:Z;if(j.keepDefaultValues||(i=z),!j.keepValues){if(j.keepDirtyValues)for(const ae of a.mount)ie(n.dirtyFields,ae)?De(K,ae,ie(o,ae)):B(ae,ie(K,ae));else{if(vd&&Ye(k))for(const ae of a.mount){const te=ie(r,ae);if(te&&te._f){const se=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(hl(se)){const re=se.closest("form");if(re){re.reset();break}}}}r={}}o=t.shouldUnregister?j.keepDefaultValues?Rt(i):{}:Rt(K),p.array.next({values:{...K}}),p.values.next({values:{...K}})}a={mount:j.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!h.isValid||!!j.keepIsValid||!!j.keepDirtyValues,l.watch=!!t.shouldUnregister,p.state.next({submitCount:j.keepSubmitCount?n.submitCount:0,isDirty:Q?!1:j.keepDirty?n.isDirty:!!(j.keepDefaultValues&&!Kr(k,i)),isSubmitted:j.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Q?{}:j.keepDirtyValues?j.keepDefaultValues&&o?ma(i,o):n.dirtyFields:j.keepDefaultValues&&k?ma(i,k):j.keepDirty?n.dirtyFields:{},touchedFields:j.keepTouched?n.touchedFields:{},errors:j.keepErrors?n.errors:{},isSubmitSuccessful:j.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},J=(k,j)=>$(gr(k)?k(o):k,j);return{control:{register:O,unregister:Re,getFieldState:we,handleSubmit:x,setError:Be,_executeSchema:w,_getWatch:v,_getDirty:A,_updateValid:D,_removeUnmounted:N,_updateFieldArray:S,_updateDisabledField:ze,_getFieldArray:G,_reset:$,_resetDefaultValues:()=>gr(e.defaultValues)&&e.defaultValues().then(k=>{J(k,e.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:k=>{n={...n,...k}},_disableForm:L,_subjects:p,_proxyFormState:h,_setErrors:M,get _fields(){return r},get _formValues(){return o},get _state(){return l},set _state(k){l=k},get _defaultValues(){return i},get _names(){return a},set _names(k){a=k},get _formState(){return n},set _formState(k){n=k},get _options(){return e},set _options(k){e={...e,...k}}},trigger:le,register:O,handleSubmit:x,watch:Me,setValue:B,getValues:ve,reset:J,resetField:ue,clearErrors:_e,unregister:Re,setError:Be,setFocus:(k,j={})=>{const z=ie(r,k),Z=z&&z._f;if(Z){const Q=Z.refs?Z.refs[0]:Z.ref;Q.focus&&(Q.focus(),j.shouldSelect&&Q.select())}},getFieldState:we}}function Fy(t={}){const e=ge.useRef(),n=ge.useRef(),[r,i]=ge.useState({isDirty:!1,isValidating:!1,isLoading:gr(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:gr(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...AE(t),formState:r});const o=e.current.control;return o._options=t,_d({subject:o._subjects.state,next:l=>{xy(l,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),ge.useEffect(()=>o._disableForm(t.disabled),[o,t.disabled]),ge.useEffect(()=>{if(o._proxyFormState.isDirty){const l=o._getDirty();l!==r.isDirty&&o._subjects.state.next({isDirty:l})}},[o,r.isDirty]),ge.useEffect(()=>{t.values&&!Kr(t.values,n.current)?(o._reset(t.values,o._options.resetOptions),n.current=t.values,i(l=>({...l}))):o._resetDefaultValues()},[t.values,o]),ge.useEffect(()=>{t.errors&&o._setErrors(t.errors)},[t.errors,o]),ge.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()}),ge.useEffect(()=>{t.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[t.shouldUnregister,o]),e.current.formState=Py(r,o),e.current}var fe={},nf={exports:{}};(function(t,e){(function(n,r){var i="1.0.38",o="",l="?",a="function",u="undefined",f="object",h="string",p="major",m="model",_="name",g="type",P="vendor",D="version",I="architecture",S="console",E="mobile",M="tablet",F="smarttv",q="wearable",T="embedded",w=500,b="Amazon",C="Apple",N="ASUS",A="BlackBerry",v="Browser",G="Chrome",Y="Edge",me="Firefox",B="Google",W="Huawei",oe="LG",le="Microsoft",ve="Motorola",we="Opera",_e="Samsung",Be="Sharp",Me="Sony",Re="Xiaomi",ze="Zebra",O="Facebook",R="Chromium OS",L="Mac OS",x=function(te,se){var re={};for(var Ce in te)se[Ce]&&se[Ce].length%2===0?re[Ce]=se[Ce].concat(te[Ce]):re[Ce]=te[Ce];return re},ue=function(te){for(var se={},re=0;re0?Se.length===2?typeof Se[1]==a?this[Se[0]]=Se[1].call(this,ft):this[Se[0]]=Se[1]:Se.length===3?typeof Se[1]===a&&!(Se[1].exec&&Se[1].test)?this[Se[0]]=ft?Se[1].call(this,ft,Se[2]):r:this[Se[0]]=ft?ft.replace(Se[1],Se[2]):r:Se.length===4&&(this[Se[0]]=ft?Se[3].call(this,ft.replace(Se[1],Se[2])):r):this[Se]=ft||r;re+=2}},k=function(te,se){for(var re in se)if(typeof se[re]===f&&se[re].length>0){for(var Ce=0;Ce2&&(he[m]="iPad",he[g]=M),he},this.getEngine=function(){var he={};return he[_]=r,he[D]=r,de.call(he,Ce,We.engine),he},this.getOS=function(){var he={};return he[_]=r,he[D]=r,de.call(he,Ce,We.os),Se&&!he[_]&&Je&&Je.platform&&Je.platform!="Unknown"&&(he[_]=Je.platform.replace(/chrome os/i,R).replace(/macos/i,L)),he},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ce},this.setUA=function(he){return Ce=typeof he===h&&he.length>w?ye(he,w):he,this},this.setUA(Ce),this};Q.VERSION=i,Q.BROWSER=ue([_,D,p]),Q.CPU=ue([I]),Q.DEVICE=ue([m,P,g,S,E,F,M,q,T]),Q.ENGINE=Q.OS=ue([_,D]),t.exports&&(e=t.exports=Q),e.UAParser=Q;var K=typeof n!==u&&(n.jQuery||n.Zepto);if(K&&!K.ua){var ae=new Q;K.ua=ae.getResult(),K.ua.get=function(){return ae.getUA()},K.ua.set=function(te){ae.setUA(te);var se=ae.getResult();for(var re in se)K.ua[re]=se[re]}}})(typeof window=="object"?window:cg)})(nf,nf.exports);var RE=nf.exports;Object.defineProperty(fe,"__esModule",{value:!0});function NE(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Et=ee,je=NE(Et),Vy=RE,Dr=new Vy,Ct=Dr.getBrowser(),DE=Dr.getCPU(),Qt=Dr.getDevice(),bd=Dr.getEngine(),Mr=Dr.getOS(),ks=Dr.getUA(),By=function(e){return Dr.setUA(e)},Ps=function(e){if(!e){console.error("No userAgent string was provided");return}var n=new Vy(e);return{UA:n,browser:n.getBrowser(),cpu:n.getCPU(),device:n.getDevice(),engine:n.getEngine(),os:n.getOS(),ua:n.getUA(),setUserAgent:function(i){return n.setUA(i)}}},zy=Object.freeze({ClientUAInstance:Dr,browser:Ct,cpu:DE,device:Qt,engine:bd,os:Mr,ua:ks,setUa:By,parseUserAgent:Ps});function fm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ME(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function sn(t,e){if(t==null)return{};var n=BE(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ja(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zE(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ja(t)}function $E(t,e){return WE(t)||HE(t,e)||qE(t,e)||GE()}function WE(t){if(Array.isArray(t))return t}function HE(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,l,a;try{for(n=n.call(t);!(i=(l=n.next()).done)&&(r.push(l.value),!(e&&r.length===e));i=!0);}catch(u){o=!0,a=u}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function qE(t,e){if(t){if(typeof t=="string")return dm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dm(t,e)}}function dm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:"none";return e||n},Td=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},Cd=function(e){var n=Td();return n&&n.platform&&(n.platform.indexOf(e)!==-1||n.platform==="MacIntel"&&n.maxTouchPoints>1&&!window.MSStream)},XE=function(e,n,r,i,o){return{isBrowser:e,browserMajorVersion:Ee(n.major),browserFullVersion:Ee(n.version),browserName:Ee(n.name),engineName:Ee(r.name),engineVersion:Ee(r.version),osName:Ee(i.name),osVersion:Ee(i.version),userAgent:Ee(o)}},hm=function(e,n,r,i){return ME({},e,{vendor:Ee(n.vendor),model:Ee(n.model),os:Ee(r.name),osVersion:Ee(r.version),ua:Ee(i)})},JE=function(e,n,r,i){return{isSmartTV:e,engineName:Ee(n.name),engineVersion:Ee(n.version),osName:Ee(r.name),osVersion:Ee(r.version),userAgent:Ee(i)}},ZE=function(e,n,r,i){return{isConsole:e,engineName:Ee(n.name),engineVersion:Ee(n.version),osName:Ee(r.name),osVersion:Ee(r.version),userAgent:Ee(i)}},eb=function(e,n,r,i){return{isWearable:e,engineName:Ee(n.name),engineVersion:Ee(n.version),osName:Ee(r.name),osVersion:Ee(r.version),userAgent:Ee(i)}},tb=function(e,n,r,i,o){return{isEmbedded:e,vendor:Ee(n.vendor),model:Ee(n.model),engineName:Ee(r.name),engineVersion:Ee(r.version),osName:Ee(i.name),osVersion:Ee(i.version),userAgent:Ee(o)}};function nb(t){var e=t?Ps(t):zy,n=e.device,r=e.browser,i=e.engine,o=e.os,l=e.ua,a=YE(n.type),u=a.isBrowser,f=a.isMobile,h=a.isTablet,p=a.isSmartTV,m=a.isConsole,_=a.isWearable,g=a.isEmbedded;if(u)return XE(u,r,i,o,l);if(p)return JE(p,i,o,l);if(m)return ZE(m,i,o,l);if(f||h)return hm(a,n,o,l);if(_)return eb(_,i,o,l);if(g)return tb(g,n,i,o,l)}var $y=function(e){var n=e.type;return n===yt.Mobile},Wy=function(e){var n=e.type;return n===yt.Tablet},Hy=function(e){var n=e.type;return n===yt.Mobile||n===yt.Tablet},qy=function(e){var n=e.type;return n===yt.SmartTv},vl=function(e){var n=e.type;return n===yt.Browser},Gy=function(e){var n=e.type;return n===yt.Wearable},Ky=function(e){var n=e.type;return n===yt.Console},Yy=function(e){var n=e.type;return n===yt.Embedded},Qy=function(e){var n=e.vendor;return Ee(n)},Xy=function(e){var n=e.model;return Ee(n)},Jy=function(e){var n=e.type;return Ee(n,"browser")},Zy=function(e){var n=e.name;return n===so.Android},e0=function(e){var n=e.name;return n===so.Windows},t0=function(e){var n=e.name;return n===so.MAC_OS},n0=function(e){var n=e.name;return n===so.WindowsPhone},r0=function(e){var n=e.name;return n===so.IOS},i0=function(e){var n=e.version;return Ee(n)},o0=function(e){var n=e.name;return Ee(n)},s0=function(e){var n=e.name;return n===Ft.Chrome},a0=function(e){var n=e.name;return n===Ft.Firefox},l0=function(e){var n=e.name;return n===Ft.Chromium},yl=function(e){var n=e.name;return n===Ft.Edge},u0=function(e){var n=e.name;return n===Ft.Yandex},c0=function(e){var n=e.name;return n===Ft.Safari||n===Ft.MobileSafari},f0=function(e){var n=e.name;return n===Ft.MobileSafari},d0=function(e){var n=e.name;return n===Ft.Opera},h0=function(e){var n=e.name;return n===Ft.InternetExplorer||n===Ft.Ie},p0=function(e){var n=e.name;return n===Ft.MIUI},m0=function(e){var n=e.name;return n===Ft.SamsungBrowser},g0=function(e){var n=e.version;return Ee(n)},v0=function(e){var n=e.major;return Ee(n)},y0=function(e){var n=e.name;return Ee(n)},w0=function(e){var n=e.name;return Ee(n)},_0=function(e){var n=e.version;return Ee(n)},S0=function(){var e=Td(),n=e&&e.userAgent&&e.userAgent.toLowerCase();return typeof n=="string"?/electron/.test(n):!1},Ui=function(e){return typeof e=="string"&&e.indexOf("Edg/")!==-1},E0=function(){var e=Td();return e&&(/iPad|iPhone|iPod/.test(e.platform)||e.platform==="MacIntel"&&e.maxTouchPoints>1)&&!window.MSStream},In=function(){return Cd("iPad")},b0=function(){return Cd("iPhone")},T0=function(){return Cd("iPod")},C0=function(e){return Ee(e)};function I0(t){var e=t||zy,n=e.device,r=e.browser,i=e.os,o=e.engine,l=e.ua;return{isSmartTV:qy(n),isConsole:Ky(n),isWearable:Gy(n),isEmbedded:Yy(n),isMobileSafari:f0(r)||In(),isChromium:l0(r),isMobile:Hy(n)||In(),isMobileOnly:$y(n),isTablet:Wy(n)||In(),isBrowser:vl(n),isDesktop:vl(n),isAndroid:Zy(i),isWinPhone:n0(i),isIOS:r0(i)||In(),isChrome:s0(r),isFirefox:a0(r),isSafari:c0(r),isOpera:d0(r),isIE:h0(r),osVersion:i0(i),osName:o0(i),fullBrowserVersion:g0(r),browserVersion:v0(r),browserName:y0(r),mobileVendor:Qy(n),mobileModel:Xy(n),engineName:w0(o),engineVersion:_0(o),getUA:C0(l),isEdge:yl(r)||Ui(l),isYandex:u0(r),deviceType:Jy(n),isIOS13:E0(),isIPad13:In(),isIPhone13:b0(),isIPod13:T0(),isElectron:S0(),isEdgeChromium:Ui(l),isLegacyEdge:yl(r)&&!Ui(l),isWindows:e0(i),isMacOs:t0(i),isMIUI:p0(r),isSamsungBrowser:m0(r)}}var O0=qy(Qt),k0=Ky(Qt),P0=Gy(Qt),rb=Yy(Qt),ib=f0(Ct)||In(),ob=l0(Ct),Jl=Hy(Qt)||In(),x0=$y(Qt),A0=Wy(Qt)||In(),R0=vl(Qt),sb=vl(Qt),N0=Zy(Mr),D0=n0(Mr),M0=r0(Mr)||In(),ab=s0(Ct),lb=a0(Ct),ub=c0(Ct),cb=d0(Ct),L0=h0(Ct),fb=i0(Mr),db=o0(Mr),hb=g0(Ct),pb=v0(Ct),mb=y0(Ct),gb=Qy(Qt),vb=Xy(Qt),yb=w0(bd),wb=_0(bd),_b=C0(ks),Sb=yl(Ct)||Ui(ks),Eb=u0(Ct),bb=Jy(Qt),Tb=E0(),Cb=In(),Ib=b0(),Ob=T0(),kb=S0(),Pb=Ui(ks),xb=yl(Ct)&&!Ui(ks),Ab=e0(Mr),Rb=t0(Mr),Nb=p0(Ct),Db=m0(Ct),Mb=function(e){if(!e||typeof e!="string"){console.error("No valid user agent string was provided");return}var n=Ps(e),r=n.device,i=n.browser,o=n.os,l=n.engine,a=n.ua;return I0({device:r,browser:i,os:o,engine:l,ua:a})},Lb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return N0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},jb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return R0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Ub=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return L0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Fb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return M0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Vb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return Jl?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Bb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return A0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},zb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return D0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},$b=function(e){var n=e.renderWithFragment,r=e.children;e.viewClassName,e.style;var i=sn(e,["renderWithFragment","children","viewClassName","style"]);return x0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Wb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return O0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Hb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return k0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},qb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return P0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Gb=function(e){var n=e.renderWithFragment,r=e.children;e.viewClassName,e.style;var i=e.condition,o=sn(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?n?je.createElement(Et.Fragment,null,r):je.createElement("div",o,r):null};function Kb(t){return function(e){VE(n,e);function n(r){var i;return LE(this,n),i=zE(this,of(n).call(this,r)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(ja(i)),i.onOrientationChange=i.onOrientationChange.bind(ja(i)),i.onPageLoad=i.onPageLoad.bind(ja(i)),i.state={isLandscape:!1,isPortrait:!1},i}return UE(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":Qo(window))!==void 0&&Jl&&(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 je.createElement(t,rf({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),n}(je.Component)}function Yb(){var t=Et.useState(function(){var o=window.innerWidth>window.innerHeight?90:0;return{isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"}}),e=$E(t,2),n=e[0],r=e[1],i=Et.useCallback(function(){var o=window.innerWidth>window.innerHeight?90:0,l={isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"};n.orientation!==l.orientation&&r(l)},[n.orientation]);return Et.useEffect(function(){return(typeof window>"u"?"undefined":Qo(window))!==void 0&&Jl&&(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 j0(t){var e=t||window.navigator.userAgent;return Ps(e)}function Qb(t){var e=t||window.navigator.userAgent,n=j0(e),r=I0(n);return[r,n]}fe.AndroidView=Lb;fe.BrowserTypes=Ft;fe.BrowserView=jb;fe.ConsoleView=Hb;fe.CustomView=Gb;fe.IEView=Ub;fe.IOSView=Fb;fe.MobileOnlyView=$b;fe.MobileView=Vb;fe.OsTypes=so;fe.SmartTVView=Wb;fe.TabletView=Bb;fe.WearableView=qb;fe.WinPhoneView=zb;fe.browserName=mb;fe.browserVersion=pb;fe.deviceDetect=nb;fe.deviceType=bb;fe.engineName=yb;fe.engineVersion=wb;fe.fullBrowserVersion=hb;fe.getSelectorsByUserAgent=Mb;fe.getUA=_b;fe.isAndroid=N0;fe.isBrowser=R0;fe.isChrome=ab;fe.isChromium=ob;fe.isConsole=k0;var Xb=fe.isDesktop=sb;fe.isEdge=Sb;fe.isEdgeChromium=Pb;fe.isElectron=kb;fe.isEmbedded=rb;fe.isFirefox=lb;fe.isIE=L0;fe.isIOS=M0;fe.isIOS13=Tb;fe.isIPad13=Cb;fe.isIPhone13=Ib;fe.isIPod13=Ob;fe.isLegacyEdge=xb;fe.isMIUI=Nb;fe.isMacOs=Rb;fe.isMobile=Jl;fe.isMobileOnly=x0;fe.isMobileSafari=ib;fe.isOpera=cb;fe.isSafari=ub;fe.isSamsungBrowser=Db;fe.isSmartTV=O0;fe.isTablet=A0;fe.isWearable=P0;fe.isWinPhone=D0;fe.isWindows=Ab;fe.isYandex=Eb;fe.mobileModel=vb;fe.mobileVendor=gb;fe.osName=db;fe.osVersion=fb;fe.parseUserAgent=Ps;fe.setUserAgent=QE;fe.useDeviceData=j0;fe.useDeviceSelectors=Qb;fe.useMobileOrientation=Yb;fe.withOrientationChange=Kb;var at=[];for(var Zu=0;Zu<256;++Zu)at.push((Zu+256).toString(16).slice(1));function Jb(t,e=0){return(at[t[e+0]]+at[t[e+1]]+at[t[e+2]]+at[t[e+3]]+"-"+at[t[e+4]]+at[t[e+5]]+"-"+at[t[e+6]]+at[t[e+7]]+"-"+at[t[e+8]]+at[t[e+9]]+"-"+at[t[e+10]]+at[t[e+11]]+at[t[e+12]]+at[t[e+13]]+at[t[e+14]]+at[t[e+15]]).toLowerCase()}var ga,Zb=new Uint8Array(16);function eT(){if(!ga&&(ga=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ga))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ga(Zb)}var tT=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const pm={randomUUID:tT};function nT(t,e,n){if(pm.randomUUID&&!e&&!t)return pm.randomUUID();t=t||{};var r=t.random||(t.rng||eT)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Jb(r)}var Dl,U0;const th=class th{constructor(e={}){qh(this,Dl);if(typeof e=="string")try{e=JSON.parse(e)}catch(n){console.error("Invalid JSON string provided:",n),e={}}else e instanceof th?Object.assign(this,e):(this.transactionId=e.transaction_id||Gh(this,Dl,U0).call(this),this.createdAt=e.created_at||null,this.amount=e.amount||null,this.vendor=e.vendor||null,this.category_id=e.category_id||null,this.category_name=e.category_name||null,this.pictureId=e.pictureId||null,this.isSuccessful=e.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())}};Dl=new WeakSet,U0=function(){return nT()};let Mt=th,af=class{constructor(e){e instanceof Mt?(this.vendor=e.vendor,this.amount=e.amount,this.category_name=e.category_name,this.created_at=e.created_at):(this.vendor="",this.created_at="",this.amount="",this.category_name="")}returnNonEmptyValues(){return Object.entries(this).filter((e,n)=>e[n]!==null&&e[n]!==void 0)}};class Qi{constructor(e){e instanceof Object?(this.category_id=e.category_id,this.category_name=e.category_name):e instanceof Qi?Object.assign(this,e):(this.category_name=e,this.category_id="")}serialize(){return{category_id:this.category_id,category_name:this.category_name}}toString(){return JSON.stringify(this.serialize())}}var rT={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:"/simplitrac_frontend/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let $t=class zr{constructor(e={}){var n,r,i,o;e instanceof zr?Object.assign(this,e):(this.user_id=(e==null?void 0:e.uid)??(e==null?void 0:e.user_id),this.access_token=e==null?void 0:e.accessToken,this.email=e==null?void 0:e.email,e!=null&&e.displayName?(this.first_name=e==null?void 0:e.displayName.split(" ")[0],this.last_name=e==null?void 0:e.displayName.split(" ").slice(1).join(" ")):(this.first_name=e==null?void 0:e.first_name,this.last_name=e==null?void 0:e.last_name),this.created_at=((n=e==null?void 0:e.metadata)==null?void 0:n.createdAt)||new Date().getTime(),this.last_login=((r=e==null?void 0:e.metadata)==null?void 0:r.lastLoginAt)||new Date().getTime(),this.admin=null,this.transactions=((i=e==null?void 0:e.transactions)==null?void 0:i.map(l=>new Mt(l)))||[],this.categories=((o=e==null?void 0:e.categories)==null?void 0:o.map(l=>new Qi(l)))||[])}getCreatedAtString(){return new Date(this.created_at).toString()}getLastLoginString(){return new Date(this.last_login).toString()}isNewUser(){var e,n;return((e=this.categories)==null?void 0:e.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(e=>e.serialize()),categories:this.categories.map(e=>e.serialize())}}addCategory(e){this.categories.push(new Qi(e))}toString(){return JSON.stringify(this.serialize())}addTransaction(e){e instanceof Mt?this.transactions.push(e):console.error("Invalid transaction provided:",e)}returnCategoryList(){return[...new Set(["Select category",...this.categories.map(e=>mm(e.category_name))])]}returnVendorList(){return[...new Set(["Select vendor",...this.transactions.map(e=>mm(e.vendor))])]}async updateFirebase(){const e={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,e);let i;return i=await r.text(),new zr(JSON.parse(i))}async deleteTransactions(){const e={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(this.serialize())},n=`${rT.VITE_PROD_DELETE_TRANSACTIONS_ENDPOINT}/?user_id=${this.user_id}`,r=await fetch(n,e);let i;return i=await r.text(),new zr(JSON.parse(i))}static async getUserFromFirestore(e){const n={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}},r=`https://us-central1-simplitracapp.cloudfunctions.net/get_existing_user?user_id=${e}`;try{const o=await(await fetch(r,n)).json();return o instanceof Object?new zr(o):new zr}catch(i){return console.log(i),new zr}}};function mm(t){if(!t)return;const e=t.toLowerCase();return e.charAt(0).toUpperCase()+e.slice(1)}const an=ee.createContext({}),iT=({children:t})=>{const e=()=>Xb?"desktop":"mobile",[n,r]=ee.useState(),[i,o]=ee.useState(new $t(JSON.parse(localStorage.getItem("user")))),[l,a]=ee.useState(!0),[u,f]=ee.useState(!1),[h,p]=ee.useState(null),[m,_]=ee.useState(new Mt),[g,P]=ee.useState(e()),[D,I]=ee.useState(),[S,E]=ee.useState(!1),[M,F]=ee.useState(new af),q=async()=>{const b="http://127.0.0.1:5001/simplitracapp/us-central1/get_existing_user";try{const C=await fetch(b);if(!C.ok)throw new Error("Network response issue exists");const N=await C.json();o(N)}catch(C){console.error("Error fetching user data:",C)}},T=()=>{r("login"),o({first_name:"",last_name:"",categories:[]}),a(!0),f(!1),p(null),_(new Mt),P(e()),I(),E(!1),F(new af)};ee.useEffect(()=>{q()},[]);const w={screen:n,setScreen:r,user:i,setUser:o,modalIsOpen:l,setModalIsOpen:a,show:u,setShow:f,capturedPhoto:h,setCapturedPhoto:p,ocrData:m,setOcrData:_,device:g,setDevice:P,serverResponse:D,setServerResponse:I,ocrModalOpen:S,setOcrModalOpen:E,fetchUserData:q,formData:M,setFormData:F,resetAppState:T};return U.jsx(an.Provider,{value:w,children:t})},oT=()=>{const{user:t,formData:e,setFormData:n,setUser:r,ocrData:i,setOcrData:o,setServerResponse:l}=ee.useContext(an),[a,u]=ee.useState([]),[f,h]=ee.useState([]),[p,m]=ee.useState(""),[_,g]=ee.useState(""),P=ee.useRef(""),D=ee.useRef(""),{control:I,handleSubmit:S,setValue:E,watch:M,reset:F,formState:{errors:q}}=Fy({defaultValues:{vendor:"Select Vendor",category:"Select Category",date:new Date().toISOString().split("T")[0],amount:""}}),T=v=>{if(!v)return;const G=v.toLowerCase();return G.charAt(0).toUpperCase()+G.slice(1)},w=()=>{if(t.transactions.length!==0){const v=new Set(["Select vendor",...t.returnVendorList()]);u([...v])}else u(["Select Vendor"])},b=()=>{if(t.categories.length!==0){const v=new Set(["Select Category",...t.categories.map(G=>T(G.category_name))]);h([...v])}else h(["Select Category"])},C=v=>{const G=v.target.value,Y=new Mt(i);Y.vendor=G,o(Y),u(me=>[...new Set([...me,G])]),m(""),E("vendor",G)},N=v=>{if(v.target.value!==""){const G=v.target.value,Y=new Mt(i);Y.category_name=G,o(Y),h(me=>[...new Set([...me,G])]),g(""),E("category",G)}};ee.useEffect(()=>{if(i.isEmpty()&&(w(),b()),!e)return;const v=e.returnNonEmptyValues();let G,Y=!0;if(v.length){for(const me of v){const B=me[0],W=me[1];switch(B){case"vendor":u([...t.returnVendorList(),W]),P.current=T(W),E(B,W),G=!1;break;case"category":t.addCategory(W),h([...t.returnCategoryList()]),D.current=T(W),E(B,W),Y=!1;break;default:E(B,W);break}}n(),G&&w(),Y&&b()}},[P.current,D.current,t,e]);const A=async v=>{if(Object.keys(q).length>0){alert("Please fill in all the inputs properly");return}const G=new $t(t),Y=new Mt(i);Y.createdAt=v.date,Y.vendor=v.vendor,Y.amount=v.amount,Y.category_name=v.category,G.transactions.push(Y),G.addCategory(v.category);const me=await t.updateFirebase();me instanceof $t&&(l("User Successfully Updated"),r(me),F({vendor:"Select Vendor",category:"Select Category",date:new Date().toISOString().split("T")[0],amount:""}),o(new Mt))};return U.jsxs("form",{onSubmit:S(A),children:[U.jsxs("div",{children:[U.jsx("label",{children:"Date"}),U.jsx(mr,{name:"date",control:I,render:({field:v})=>U.jsx("input",{type:"date",...v})})]}),U.jsxs("div",{children:[U.jsx("label",{children:"Vendor"}),U.jsx(mr,{name:"vendor",control:I,rules:{required:"Please select a vendor",validate:v=>v==="Select vendor"||v===""?"Please select a vendor":!0},render:({field:v})=>U.jsxs("div",{children:[U.jsxs("select",{...v,onChange:G=>{const Y=G.target.value;Y==="other"?v.onChange(""):v.onChange(Y)},children:[a.map(G=>U.jsx("option",{value:G,children:G},G)),U.jsx("option",{value:"other",children:"Other (specify below)"})]}),(v.value===""||v.value==="Select vendor"||v.value==="Other (specify below)")&&U.jsxs(U.Fragment,{children:[U.jsx("input",{id:"vendor",type:"text",value:p,onChange:G=>{m(G.target.value)},onBlur:G=>{C(G),v.onBlur()}}),q.vendor&&U.jsx("span",{role:"alert",style:{color:"red"},children:q.vendor.message})]})]})})]}),U.jsxs("div",{children:[U.jsx("label",{htmlFor:"amount",children:"Amount"}),U.jsx(mr,{name:"amount",control:I,rules:{required:"Please enter a valid number",validate:v=>!0},render:({field:v})=>U.jsx("input",{id:"amount",type:"number",inputMode:"numeric",step:"0.01",...v})}),q.amount&&U.jsx("span",{role:"alert",style:{color:"red"},children:q.amount.message})]}),U.jsxs("div",{children:[U.jsx("label",{children:"Category"}),U.jsx(mr,{name:"category",control:I,rules:{required:"Please select a category",validate:v=>v==="Select category"||v===""||v==="Other (specify below)"||v==="Select Category"?"Please select a category":!0},render:({field:v})=>U.jsxs("div",{children:[U.jsxs("select",{...v,onChange:G=>{const Y=G.target.value;Y==="other"?v.onChange(""):v.onChange(Y)},children:[f.map(G=>U.jsx("option",{value:G,children:G},G)),U.jsx("option",{value:"other",children:"Other (specify below)"})]}),(v.value===""||v.value==="Select category"||v.value==="Select Category"||v.value==="Other (specify below)")&&U.jsxs(U.Fragment,{children:[U.jsx("input",{id:"category",type:"text",value:_,onChange:G=>{g(G.target.value)},onBlur:N}),q.category&&U.jsx("span",{role:"alert",style:{color:"red"},children:q.category.message})]})]})})]}),U.jsx("button",{type:"submit",children:"Submit"})]})},Id=()=>{const{setScreen:t}=ee.useContext(an),e=()=>{t("landing")};return U.jsx("button",{onClick:e,children:"Back"})};var F0={exports:{}};/*! +`+o.stack}return{value:t,source:e,stack:i,digest:null}}function Gu(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function $c(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var HS=typeof WeakMap=="function"?WeakMap:Map;function Xv(t,e,n){n=qn(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){ul||(ul=!0,Zc=r),$c(t,e)},n}function Jv(t,e,n){n=qn(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){$c(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){$c(t,e),typeof r!="function"&&(br===null?br=new Set([this]):br.add(this));var l=e.stack;this.componentDidCatch(e.value,{componentStack:l!==null?l:""})}),n}function Fp(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new HS;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=oE.bind(null,t,e,n),e.then(t,t))}function Vp(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Bp(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=qn(-1,1),e.tag=2,Er(n,e,1))),n.lanes|=1),t)}var qS=Jn.ReactCurrentOwner,Dt=!1;function Ot(t,e,n,r){e.child=t===null?Ov(e,null,n,r):qi(e,t.child,n,r)}function zp(t,e,n,r,i){n=n.render;var o=e.ref;return Li(e,i),r=nd(t,e,n,r,o,i),n=rd(),t!==null&&!Dt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Qn(t,e,i)):($e&&n&&Wf(e),e.flags|=1,Ot(t,e,r,i),e.child)}function $p(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!hd(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,Zv(t,e,o,r,i)):(t=La(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!(t.lanes&i)){var l=o.memoizedProps;if(n=n.compare,n=n!==null?n:as,n(l,r)&&t.ref===e.ref)return Qn(t,e,i)}return e.flags|=1,t=Cr(o,r),t.ref=e.ref,t.return=e,e.child=t}function Zv(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(as(o,r)&&t.ref===e.ref)if(Dt=!1,e.pendingProps=r=o,(t.lanes&i)!==0)t.flags&131072&&(Dt=!0);else return e.lanes=t.lanes,Qn(t,e,i)}return Wc(t,e,n,r,i)}function ey(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Le(Pi,zt),zt|=n;else{if(!(n&1073741824))return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Le(Pi,zt),zt|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Le(Pi,zt),zt|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,Le(Pi,zt),zt|=r;return Ot(t,e,i,n),e.child}function ty(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Wc(t,e,n,r,i){var o=jt(n)?ei:bt.current;return o=Wi(e,o),Li(e,i),n=nd(t,e,n,r,o,i),r=rd(),t!==null&&!Dt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Qn(t,e,i)):($e&&r&&Wf(e),e.flags|=1,Ot(t,e,n,i),e.child)}function Wp(t,e,n,r,i){if(jt(n)){var o=!0;Za(e)}else o=!1;if(Li(e,i),e.stateNode===null)Na(t,e),Qv(e,n,r),zc(e,n,r,i),r=!0;else if(t===null){var l=e.stateNode,a=e.memoizedProps;l.props=a;var u=l.context,f=n.contextType;typeof f=="object"&&f!==null?f=rn(f):(f=jt(n)?ei:bt.current,f=Wi(e,f));var h=n.getDerivedStateFromProps,p=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function";p||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==r||u!==f)&&Up(e,l,r,f),ar=!1;var m=e.memoizedState;l.state=m,il(e,r,l,i),u=e.memoizedState,a!==r||m!==u||Lt.current||ar?(typeof h=="function"&&(Bc(e,n,h,r),u=e.memoizedState),(a=ar||jp(e,n,a,r,m,u,f))?(p||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(e.flags|=4194308)):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=u),l.props=r,l.state=u,l.context=f,r=a):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{l=e.stateNode,Pv(t,e),a=e.memoizedProps,f=e.type===e.elementType?a:cn(e.type,a),l.props=f,p=e.pendingProps,m=l.context,u=n.contextType,typeof u=="object"&&u!==null?u=rn(u):(u=jt(n)?ei:bt.current,u=Wi(e,u));var _=n.getDerivedStateFromProps;(h=typeof _=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==p||m!==u)&&Up(e,l,r,u),ar=!1,m=e.memoizedState,l.state=m,il(e,r,l,i);var g=e.memoizedState;a!==p||m!==g||Lt.current||ar?(typeof _=="function"&&(Bc(e,n,_,r),g=e.memoizedState),(f=ar||jp(e,n,f,r,m,g,u)||!1)?(h||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,g,u),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,g,u)),typeof l.componentDidUpdate=="function"&&(e.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),l.props=r,l.state=g,l.context=u,r=f):(typeof l.componentDidUpdate!="function"||a===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),r=!1)}return Hc(t,e,n,r,o,i)}function Hc(t,e,n,r,i,o){ty(t,e);var l=(e.flags&128)!==0;if(!r&&!l)return i&&Pp(e,n,!1),Qn(t,e,o);r=e.stateNode,qS.current=e;var a=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&l?(e.child=qi(e,t.child,null,o),e.child=qi(e,null,a,o)):Ot(t,e,a,o),e.memoizedState=r.state,i&&Pp(e,n,!0),e.child}function ny(t){var e=t.stateNode;e.pendingContext?kp(t,e.pendingContext,e.pendingContext!==e.context):e.context&&kp(t,e.context,!1),Jf(t,e.containerInfo)}function Hp(t,e,n,r,i){return Hi(),qf(i),e.flags|=256,Ot(t,e,n,r),e.child}var qc={dehydrated:null,treeContext:null,retryLane:0};function Gc(t){return{baseLanes:t,cachePool:null,transitions:null}}function ry(t,e,n){var r=e.pendingProps,i=He.current,o=!1,l=(e.flags&128)!==0,a;if((a=l)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Le(He,i&1),t===null)return Fc(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(l=r.children,t=r.fallback,o?(r=e.mode,o=e.child,l={mode:"hidden",children:l},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=l):o=Gl(l,r,0,null),t=Xr(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=Gc(n),e.memoizedState=qc,t):sd(e,l));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return GS(t,e,l,r,a,i,n);if(o){o=r.fallback,l=e.mode,i=t.child,a=i.sibling;var u={mode:"hidden",children:r.children};return!(l&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=u,e.deletions=null):(r=Cr(i,u),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=Cr(a,o):(o=Xr(o,l,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,l=t.child.memoizedState,l=l===null?Gc(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=t.childLanes&~n,e.memoizedState=qc,r}return o=t.child,t=o.sibling,r=Cr(o,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function sd(t,e){return e=Gl({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function fa(t,e,n,r){return r!==null&&qf(r),qi(e,t.child,null,n),t=sd(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function GS(t,e,n,r,i,o,l){if(n)return e.flags&256?(e.flags&=-257,r=Gu(Error(X(422))),fa(t,e,l,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=Gl({mode:"visible",children:r.children},i,0,null),o=Xr(o,i,l,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,e.mode&1&&qi(e,t.child,null,l),e.child.memoizedState=Gc(l),e.memoizedState=qc,o);if(!(e.mode&1))return fa(t,e,l,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(X(419)),r=Gu(o,r,void 0),fa(t,e,l,r)}if(a=(l&t.childLanes)!==0,Dt||a){if(r=ot,r!==null){switch(l&-l){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|l)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Yn(t,i),gn(r,t,i,-1))}return dd(),r=Gu(Error(X(421))),fa(t,e,l,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=sE.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Wt=Sr(i.nextSibling),qt=e,$e=!0,hn=null,t!==null&&(Zt[en++]=Vn,Zt[en++]=Bn,Zt[en++]=ti,Vn=t.id,Bn=t.overflow,ti=e),e=sd(e,r.children),e.flags|=4096,e)}function qp(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Vc(t.return,e,n)}function Ku(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function iy(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(Ot(t,e,r.children,n),r=He.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&qp(t,n,e);else if(t.tag===19)qp(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(Le(He,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&ol(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Ku(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&ol(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Ku(e,!0,n,null,o);break;case"together":Ku(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Na(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Qn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ri|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(X(153));if(e.child!==null){for(t=e.child,n=Cr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Cr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function KS(t,e,n){switch(e.tag){case 3:ny(e),Hi();break;case 5:xv(e);break;case 1:jt(e.type)&&Za(e);break;case 4:Jf(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Le(nl,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Le(He,He.current&1),e.flags|=128,null):n&e.child.childLanes?ry(t,e,n):(Le(He,He.current&1),t=Qn(t,e,n),t!==null?t.sibling:null);Le(He,He.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return iy(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Le(He,He.current),r)break;return null;case 22:case 23:return e.lanes=0,ey(t,e,n)}return Qn(t,e,n)}var oy,Kc,sy,ay;oy=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Kc=function(){};sy=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Gr(Pn.current);var o=null;switch(n){case"input":i=gc(t,i),r=gc(t,r),o=[];break;case"select":i=Ge({},i,{value:void 0}),r=Ge({},r,{value:void 0}),o=[];break;case"textarea":i=wc(t,i),r=wc(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Xa)}Sc(n,r);var l;n=null;for(f in i)if(!r.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var a=i[f];for(l in a)a.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(es.hasOwnProperty(f)?o||(o=[]):(o=o||[]).push(f,null));for(f in r){var u=r[f];if(a=i!=null?i[f]:void 0,r.hasOwnProperty(f)&&u!==a&&(u!=null||a!=null))if(f==="style")if(a){for(l in a)!a.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in u)u.hasOwnProperty(l)&&a[l]!==u[l]&&(n||(n={}),n[l]=u[l])}else n||(o||(o=[]),o.push(f,n)),n=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(o=o||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(es.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&Fe("scroll",t),o||a===u||(o=[])):(o=o||[]).push(f,u))}n&&(o=o||[]).push("style",n);var f=o;(e.updateQueue=f)&&(e.flags|=4)}};ay=function(t,e,n,r){n!==r&&(e.flags|=4)};function xo(t,e){if(!$e)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function mt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function YS(t,e,n){var r=e.pendingProps;switch(Hf(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(e),null;case 1:return jt(e.type)&&Ja(),mt(e),null;case 3:return r=e.stateNode,Gi(),Ve(Lt),Ve(bt),ed(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(ua(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,hn!==null&&(nf(hn),hn=null))),Kc(t,e),mt(e),null;case 5:Zf(e);var i=Gr(ds.current);if(n=e.type,t!==null&&e.stateNode!=null)sy(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(X(166));return mt(e),null}if(t=Gr(Pn.current),ua(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[Tn]=e,r[cs]=o,t=(e.mode&1)!==0,n){case"dialog":Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":case"embed":Fe("load",r);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=l.createElement(n,{is:r.is}):(t=l.createElement(n),n==="select"&&(l=t,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):t=l.createElementNS(t,n),t[Tn]=e,t[cs]=r,oy(t,e,!1,!1),e.stateNode=t;e:{switch(l=Ec(n,r),n){case"dialog":Fe("cancel",t),Fe("close",t),i=r;break;case"iframe":case"object":case"embed":Fe("load",t),i=r;break;case"video":case"audio":for(i=0;iYi&&(e.flags|=128,r=!0,xo(o,!1),e.lanes=4194304)}else{if(!r)if(t=ol(l),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),xo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!$e)return mt(e),null}else 2*Xe()-o.renderingStartTime>Yi&&n!==1073741824&&(e.flags|=128,r=!0,xo(o,!1),e.lanes=4194304);o.isBackwards?(l.sibling=e.child,e.child=l):(n=o.last,n!==null?n.sibling=l:e.child=l,o.last=l)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Xe(),e.sibling=null,n=He.current,Le(He,r?n&1|2:n&1),e):(mt(e),null);case 22:case 23:return fd(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?zt&1073741824&&(mt(e),e.subtreeFlags&6&&(e.flags|=8192)):mt(e),null;case 24:return null;case 25:return null}throw Error(X(156,e.tag))}function QS(t,e){switch(Hf(e),e.tag){case 1:return jt(e.type)&&Ja(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Gi(),Ve(Lt),Ve(bt),ed(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Zf(e),null;case 13:if(Ve(He),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(X(340));Hi()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ve(He),null;case 4:return Gi(),null;case 10:return Yf(e.type._context),null;case 22:case 23:return fd(),null;case 24:return null;default:return null}}var da=!1,wt=!1,XS=typeof WeakSet=="function"?WeakSet:Set,ce=null;function ki(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ke(t,e,r)}else n.current=null}function Yc(t,e,n){try{n()}catch(r){Ke(t,e,r)}}var Gp=!1;function JS(t,e){if(Rc=Ka,t=dv(),$f(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,a=-1,u=-1,f=0,h=0,p=t,m=null;t:for(;;){for(var _;p!==n||i!==0&&p.nodeType!==3||(a=l+i),p!==o||r!==0&&p.nodeType!==3||(u=l+r),p.nodeType===3&&(l+=p.nodeValue.length),(_=p.firstChild)!==null;)m=p,p=_;for(;;){if(p===t)break t;if(m===n&&++f===i&&(a=l),m===o&&++h===r&&(u=l),(_=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=_}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Nc={focusedElem:t,selectionRange:n},Ka=!1,ce=e;ce!==null;)if(e=ce,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ce=t;else for(;ce!==null;){e=ce;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var P=g.memoizedProps,D=g.memoizedState,I=e.stateNode,S=I.getSnapshotBeforeUpdate(e.elementType===e.type?P:cn(e.type,P),D);I.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var E=e.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(M){Ke(e,e.return,M)}if(t=e.sibling,t!==null){t.return=e.return,ce=t;break}ce=e.return}return g=Gp,Gp=!1,g}function Ho(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&Yc(e,n,o)}i=i.next}while(i!==r)}}function Hl(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Qc(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function ly(t){var e=t.alternate;e!==null&&(t.alternate=null,ly(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Tn],delete e[cs],delete e[Lc],delete e[DS],delete e[MS])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function uy(t){return t.tag===5||t.tag===3||t.tag===4}function Kp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||uy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Xc(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Xa));else if(r!==4&&(t=t.child,t!==null))for(Xc(t,e,n),t=t.sibling;t!==null;)Xc(t,e,n),t=t.sibling}function Jc(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Jc(t,e,n),t=t.sibling;t!==null;)Jc(t,e,n),t=t.sibling}var lt=null,dn=!1;function ir(t,e,n){for(n=n.child;n!==null;)cy(t,e,n),n=n.sibling}function cy(t,e,n){if(kn&&typeof kn.onCommitFiberUnmount=="function")try{kn.onCommitFiberUnmount(jl,n)}catch{}switch(n.tag){case 5:wt||ki(n,e);case 6:var r=lt,i=dn;lt=null,ir(t,e,n),lt=r,dn=i,lt!==null&&(dn?(t=lt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):lt.removeChild(n.stateNode));break;case 18:lt!==null&&(dn?(t=lt,n=n.stateNode,t.nodeType===8?Bu(t.parentNode,n):t.nodeType===1&&Bu(t,n),os(t)):Bu(lt,n.stateNode));break;case 4:r=lt,i=dn,lt=n.stateNode.containerInfo,dn=!0,ir(t,e,n),lt=r,dn=i;break;case 0:case 11:case 14:case 15:if(!wt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&Yc(n,e,l),i=i.next}while(i!==r)}ir(t,e,n);break;case 1:if(!wt&&(ki(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ke(n,e,a)}ir(t,e,n);break;case 21:ir(t,e,n);break;case 22:n.mode&1?(wt=(r=wt)||n.memoizedState!==null,ir(t,e,n),wt=r):ir(t,e,n);break;default:ir(t,e,n)}}function Yp(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new XS),e.forEach(function(r){var i=aE.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function un(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*eE(r/1960))-r,10t?16:t,pr===null)var r=!1;else{if(t=pr,pr=null,cl=0,ke&6)throw Error(X(331));var i=ke;for(ke|=4,ce=t.current;ce!==null;){var o=ce,l=o.child;if(ce.flags&16){var a=o.deletions;if(a!==null){for(var u=0;uXe()-ud?Qr(t,0):ld|=n),Ut(t,e)}function yy(t,e){e===0&&(t.mode&1?(e=ra,ra<<=1,!(ra&130023424)&&(ra=4194304)):e=1);var n=Pt();t=Yn(t,e),t!==null&&(bs(t,e,n),Ut(t,n))}function sE(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),yy(t,n)}function aE(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(e),yy(t,n)}var wy;wy=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Lt.current)Dt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Dt=!1,KS(t,e,n);Dt=!!(t.flags&131072)}else Dt=!1,$e&&e.flags&1048576&&bv(e,tl,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Na(t,e),t=e.pendingProps;var i=Wi(e,bt.current);Li(e,n),i=nd(null,e,r,t,i,n);var o=rd();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,jt(r)?(o=!0,Za(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Xf(e),i.updater=Wl,e.stateNode=i,i._reactInternals=e,zc(e,r,t,n),e=Hc(null,e,r,!0,o,n)):(e.tag=0,$e&&o&&Wf(e),Ot(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Na(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=uE(r),t=cn(r,t),i){case 0:e=Wc(null,e,r,t,n);break e;case 1:e=Wp(null,e,r,t,n);break e;case 11:e=zp(null,e,r,t,n);break e;case 14:e=$p(null,e,r,cn(r.type,t),n);break e}throw Error(X(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:cn(r,i),Wc(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:cn(r,i),Wp(t,e,r,i,n);case 3:e:{if(ny(e),t===null)throw Error(X(387));r=e.pendingProps,o=e.memoizedState,i=o.element,Pv(t,e),il(e,r,null,n);var l=e.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Ki(Error(X(423)),e),e=Hp(t,e,r,n,i);break e}else if(r!==i){i=Ki(Error(X(424)),e),e=Hp(t,e,r,n,i);break e}else for(Wt=Sr(e.stateNode.containerInfo.firstChild),qt=e,$e=!0,hn=null,n=Ov(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hi(),r===i){e=Qn(t,e,n);break e}Ot(t,e,r,n)}e=e.child}return e;case 5:return xv(e),t===null&&Fc(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,l=i.children,Dc(r,i)?l=null:o!==null&&Dc(r,o)&&(e.flags|=32),ty(t,e),Ot(t,e,l,n),e.child;case 6:return t===null&&Fc(e),null;case 13:return ry(t,e,n);case 4:return Jf(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=qi(e,null,r,n):Ot(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:cn(r,i),zp(t,e,r,i,n);case 7:return Ot(t,e,e.pendingProps,n),e.child;case 8:return Ot(t,e,e.pendingProps.children,n),e.child;case 12:return Ot(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,l=i.value,Le(nl,r._currentValue),r._currentValue=l,o!==null)if(wn(o.value,l)){if(o.children===i.children&&!Lt.current){e=Qn(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){l=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=qn(-1,n&-n),u.tag=2;var f=o.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?u.next=u:(u.next=h.next,h.next=u),f.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Vc(o.return,n,e),a.lanes|=n;break}u=u.next}}else if(o.tag===10)l=o.type===e.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(X(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),Vc(l,n,e),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===e){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Ot(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Li(e,n),i=rn(i),r=r(i),e.flags|=1,Ot(t,e,r,n),e.child;case 14:return r=e.type,i=cn(r,e.pendingProps),i=cn(r.type,i),$p(t,e,r,i,n);case 15:return Zv(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:cn(r,i),Na(t,e),e.tag=1,jt(r)?(t=!0,Za(e)):t=!1,Li(e,n),Qv(e,r,i),zc(e,r,i,n),Hc(null,e,r,!0,t,n);case 19:return iy(t,e,n);case 22:return ey(t,e,n)}throw Error(X(156,e.tag))};function _y(t,e){return Gg(t,e)}function lE(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(t,e,n,r){return new lE(t,e,n,r)}function hd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function uE(t){if(typeof t=="function")return hd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Rf)return 11;if(t===Nf)return 14}return 2}function Cr(t,e){var n=t.alternate;return n===null?(n=tn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function La(t,e,n,r,i,o){var l=2;if(r=t,typeof t=="function")hd(t)&&(l=1);else if(typeof t=="string")l=5;else e:switch(t){case wi:return Xr(n.children,i,o,e);case Af:l=8,i|=8;break;case dc:return t=tn(12,n,e,i|2),t.elementType=dc,t.lanes=o,t;case hc:return t=tn(13,n,e,i),t.elementType=hc,t.lanes=o,t;case pc:return t=tn(19,n,e,i),t.elementType=pc,t.lanes=o,t;case xg:return Gl(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case kg:l=10;break e;case Pg:l=9;break e;case Rf:l=11;break e;case Nf:l=14;break e;case sr:l=16,r=null;break e}throw Error(X(130,t==null?t:typeof t,""))}return e=tn(l,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Xr(t,e,n,r){return t=tn(7,t,r,e),t.lanes=n,t}function Gl(t,e,n,r){return t=tn(22,t,r,e),t.elementType=xg,t.lanes=n,t.stateNode={isHidden:!1},t}function Yu(t,e,n){return t=tn(6,t,null,e),t.lanes=n,t}function Qu(t,e,n){return e=tn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function cE(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xu(0),this.expirationTimes=xu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xu(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function pd(t,e,n,r,i,o,l,a,u){return t=new cE(t,e,n,a,u),e===1?(e=1,o===!0&&(e|=8)):e=0,o=tn(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xf(o),t}function fE(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ty)}catch(t){console.error(t)}}Ty(),Tg.exports=Kt;var Cy=Tg.exports,rm=Cy;cc.createRoot=rm.createRoot,cc.hydrateRoot=rm.hydrateRoot;var Os=t=>t.type==="checkbox",xi=t=>t instanceof Date,kt=t=>t==null;const Iy=t=>typeof t=="object";var rt=t=>!kt(t)&&!Array.isArray(t)&&Iy(t)&&!xi(t),Oy=t=>rt(t)&&t.target?Os(t.target)?t.target.checked:t.target.value:t,gE=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,ky=(t,e)=>t.has(gE(e)),vE=t=>{const e=t.constructor&&t.constructor.prototype;return rt(e)&&e.hasOwnProperty("isPrototypeOf")},yd=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Rt(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(yd&&(t instanceof Blob||t instanceof FileList))&&(n||rt(t)))if(e=n?[]:{},!n&&!vE(t))e=t;else for(const r in t)t.hasOwnProperty(r)&&(e[r]=Rt(t[r]));else return t;return e}var Jl=t=>Array.isArray(t)?t.filter(Boolean):[],Ye=t=>t===void 0,ie=(t,e,n)=>{if(!e||!rt(t))return n;const r=Jl(e.split(/[,[\].]+?/)).reduce((i,o)=>kt(i)?i:i[o],t);return Ye(r)||r===t?Ye(t[e])?n:t[e]:r},Cn=t=>typeof t=="boolean",wd=t=>/^\w*$/.test(t),Py=t=>Jl(t.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(t,e,n)=>{let r=-1;const i=wd(e)?[e]:Py(e),o=i.length,l=o-1;for(;++rge.useContext(yE);var xy=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const o in t)Object.defineProperty(i,o,{get:()=>{const l=o;return e._proxyFormState[l]!==pn.all&&(e._proxyFormState[l]=!r||pn.all),n&&(n[l]=!0),t[l]}});return i},Bt=t=>rt(t)&&!Object.keys(t).length,Ay=(t,e,n,r)=>{n(t);const{name:i,...o}=t;return Bt(o)||Object.keys(o).length>=Object.keys(e).length||Object.keys(o).find(l=>e[l]===(!r||pn.all))},Ko=t=>Array.isArray(t)?t:[t],Ry=(t,e,n)=>!t||!e||t===e||Ko(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function Sd(t){const e=ge.useRef(t);e.current=t,ge.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function wE(t){const e=_d(),{control:n=e.control,disabled:r,name:i,exact:o}=t||{},[l,a]=ge.useState(n._formState),u=ge.useRef(!0),f=ge.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),h=ge.useRef(i);return h.current=i,Sd({disabled:r,next:p=>u.current&&Ry(h.current,p.name,o)&&Ay(p,f.current,n._updateFormState)&&a({...n._formState,...p}),subject:n._subjects.state}),ge.useEffect(()=>(u.current=!0,f.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),xy(l,n,f.current,!1)}var On=t=>typeof t=="string",Ny=(t,e,n,r,i)=>On(t)?(r&&e.watch.add(t),ie(n,t,i)):Array.isArray(t)?t.map(o=>(r&&e.watch.add(o),ie(n,o))):(r&&(e.watchAll=!0),n);function _E(t){const e=_d(),{control:n=e.control,name:r,defaultValue:i,disabled:o,exact:l}=t||{},a=ge.useRef(r);a.current=r,Sd({disabled:o,subject:n._subjects.values,next:h=>{Ry(a.current,h.name,l)&&f(Rt(Ny(a.current,n._names,h.values||n._formValues,!1,i)))}});const[u,f]=ge.useState(n._getWatch(r,i));return ge.useEffect(()=>n._removeUnmounted()),u}function SE(t){const e=_d(),{name:n,disabled:r,control:i=e.control,shouldUnregister:o}=t,l=ky(i._names.array,n),a=_E({control:i,name:n,defaultValue:ie(i._formValues,n,ie(i._defaultValues,n,t.defaultValue)),exact:!0}),u=wE({control:i,name:n}),f=ge.useRef(i.register(n,{...t.rules,value:a,...Cn(t.disabled)?{disabled:t.disabled}:{}}));return ge.useEffect(()=>{const h=i._options.shouldUnregister||o,p=(m,_)=>{const g=ie(i._fields,m);g&&g._f&&(g._f.mount=_)};if(p(n,!0),h){const m=Rt(ie(i._options.defaultValues,n));De(i._defaultValues,n,m),Ye(ie(i._formValues,n))&&De(i._formValues,n,m)}return()=>{(l?h&&!i._state.action:h)?i.unregister(n):p(n,!1)}},[n,i,l,o]),ge.useEffect(()=>{ie(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:ie(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:a,...Cn(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:ge.useCallback(h=>f.current.onChange({target:{value:Oy(h),name:n},type:hl.CHANGE}),[n]),onBlur:ge.useCallback(()=>f.current.onBlur({target:{value:ie(i._formValues,n),name:n},type:hl.BLUR}),[n,i]),ref:h=>{const p=ie(i._fields,n);p&&h&&(p._f.ref={focus:()=>h.focus(),select:()=>h.select(),setCustomValidity:m=>h.setCustomValidity(m),reportValidity:()=>h.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ie(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!ie(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ie(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!ie(u.validatingFields,n)},error:{enumerable:!0,get:()=>ie(u.errors,n)}})}}const mr=t=>t.render(SE(t));var EE=(t,e,n,r,i)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},im=t=>({isOnSubmit:!t||t===pn.onSubmit,isOnBlur:t===pn.onBlur,isOnChange:t===pn.onChange,isOnAll:t===pn.all,isOnTouch:t===pn.onTouched}),om=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Yo=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const o=ie(t,i);if(o){const{_f:l,...a}=o;if(l){if(l.refs&&l.refs[0]&&e(l.refs[0],i)&&!r)break;if(l.ref&&e(l.ref,l.name)&&!r)break;Yo(a,e)}else rt(a)&&Yo(a,e)}}};var bE=(t,e,n)=>{const r=Ko(ie(t,n));return De(r,"root",e[n]),De(t,n,r),t},Ed=t=>t.type==="file",gr=t=>typeof t=="function",pl=t=>{if(!yd)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},ja=t=>On(t),bd=t=>t.type==="radio",ml=t=>t instanceof RegExp;const sm={value:!1,isValid:!1},am={value:!0,isValid:!0};var Dy=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Ye(t[0].attributes.value)?Ye(t[0].value)||t[0].value===""?am:{value:t[0].value,isValid:!0}:am:sm}return sm};const lm={isValid:!1,value:null};var My=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,lm):lm;function um(t,e,n="validate"){if(ja(t)||Array.isArray(t)&&t.every(ja)||Cn(t)&&!t)return{type:n,message:ja(t)?t:"",ref:e}}var vi=t=>rt(t)&&!ml(t)?t:{value:t,message:""},cm=async(t,e,n,r,i)=>{const{ref:o,refs:l,required:a,maxLength:u,minLength:f,min:h,max:p,pattern:m,validate:_,name:g,valueAsNumber:P,mount:D,disabled:I}=t._f,S=ie(e,g);if(!D||I)return{};const E=l?l[0]:o,M=A=>{r&&E.reportValidity&&(E.setCustomValidity(Cn(A)?"":A||""),E.reportValidity())},F={},q=bd(o),T=Os(o),w=q||T,b=(P||Ed(o))&&Ye(o.value)&&Ye(S)||pl(o)&&o.value===""||S===""||Array.isArray(S)&&!S.length,C=EE.bind(null,g,n,F),N=(A,v,G,Y=Mn.maxLength,me=Mn.minLength)=>{const B=A?v:G;F[g]={type:A?Y:me,message:B,ref:o,...C(A?Y:me,B)}};if(i?!Array.isArray(S)||!S.length:a&&(!w&&(b||kt(S))||Cn(S)&&!S||T&&!Dy(l).isValid||q&&!My(l).isValid)){const{value:A,message:v}=ja(a)?{value:!!a,message:a}:vi(a);if(A&&(F[g]={type:Mn.required,message:v,ref:E,...C(Mn.required,v)},!n))return M(v),F}if(!b&&(!kt(h)||!kt(p))){let A,v;const G=vi(p),Y=vi(h);if(!kt(S)&&!isNaN(S)){const me=o.valueAsNumber||S&&+S;kt(G.value)||(A=me>G.value),kt(Y.value)||(v=menew Date(new Date().toDateString()+" "+le),W=o.type=="time",oe=o.type=="week";On(G.value)&&S&&(A=W?B(S)>B(G.value):oe?S>G.value:me>new Date(G.value)),On(Y.value)&&S&&(v=W?B(S)+A.value,Y=!kt(v.value)&&S.length<+v.value;if((G||Y)&&(N(G,A.message,v.message),!n))return M(F[g].message),F}if(m&&!b&&On(S)){const{value:A,message:v}=vi(m);if(ml(A)&&!S.match(A)&&(F[g]={type:Mn.pattern,message:v,ref:o,...C(Mn.pattern,v)},!n))return M(v),F}if(_){if(gr(_)){const A=await _(S,e),v=um(A,E);if(v&&(F[g]={...v,...C(Mn.validate,v.message)},!n))return M(v.message),F}else if(rt(_)){let A={};for(const v in _){if(!Bt(A)&&!n)break;const G=um(await _[v](S,e),E,v);G&&(A={...G,...C(v,G.message)},M(G.message),n&&(F[g]=A))}if(!Bt(A)&&(F[g]={ref:E,...A},!n))return F}}return M(!0),F};function TE(t,e){const n=e.slice(0,-1).length;let r=0;for(;r{let t=[];return{get observers(){return t},next:i=>{for(const o of t)o.next&&o.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(o=>o!==i)}}),unsubscribe:()=>{t=[]}}},gl=t=>kt(t)||!Iy(t);function Kr(t,e){if(gl(t)||gl(e))return t===e;if(xi(t)&&xi(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const o=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const l=e[i];if(xi(o)&&xi(l)||rt(o)&&rt(l)||Array.isArray(o)&&Array.isArray(l)?!Kr(o,l):o!==l)return!1}}return!0}var Ly=t=>t.type==="select-multiple",IE=t=>bd(t)||Os(t),Ju=t=>pl(t)&&t.isConnected,jy=t=>{for(const e in t)if(gr(t[e]))return!0;return!1};function vl(t,e={}){const n=Array.isArray(t);if(rt(t)||n)for(const r in t)Array.isArray(t[r])||rt(t[r])&&!jy(t[r])?(e[r]=Array.isArray(t[r])?[]:{},vl(t[r],e[r])):kt(t[r])||(e[r]=!0);return e}function Uy(t,e,n){const r=Array.isArray(t);if(rt(t)||r)for(const i in t)Array.isArray(t[i])||rt(t[i])&&!jy(t[i])?Ye(e)||gl(n[i])?n[i]=Array.isArray(t[i])?vl(t[i],[]):{...vl(t[i])}:Uy(t[i],kt(e)?{}:e[i],n[i]):n[i]=!Kr(t[i],e[i]);return n}var ma=(t,e)=>Uy(t,e,vl(e)),Fy=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Ye(t)?t:e?t===""?NaN:t&&+t:n&&On(t)?new Date(t):r?r(t):t;function Zu(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return Ed(e)?e.files:bd(e)?My(t.refs).value:Ly(e)?[...e.selectedOptions].map(({value:n})=>n):Os(e)?Dy(t.refs).value:Fy(Ye(e.value)?t.ref.value:e.value,t)}var OE=(t,e,n,r)=>{const i={};for(const o of t){const l=ie(e,o);l&&De(i,o,l._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},Ro=t=>Ye(t)?t:ml(t)?t.source:rt(t)?ml(t.value)?t.value.source:t.value:t,kE=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function fm(t,e,n){const r=ie(t,n);if(r||wd(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),l=ie(e,o),a=ie(t,o);if(l&&!Array.isArray(l)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};i.pop()}return{name:n}}var PE=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,xE=(t,e)=>!Jl(ie(t,e)).length&&et(t,e);const AE={mode:pn.onSubmit,reValidateMode:pn.onChange,shouldFocusError:!0};function RE(t={}){let e={...AE,...t},n={submitCount:0,isDirty:!1,isLoading:gr(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},i=rt(e.defaultValues)||rt(e.values)?Rt(e.defaultValues||e.values)||{}:{},o=e.shouldUnregister?{}:Rt(i),l={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,f=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:Xu(),array:Xu(),state:Xu()},m=im(e.mode),_=im(e.reValidateMode),g=e.criteriaMode===pn.all,P=k=>U=>{clearTimeout(f),f=setTimeout(k,U)},D=async k=>{if(h.isValid||k){const U=e.resolver?Bt((await w()).errors):await C(r,!0);U!==n.isValid&&p.state.next({isValid:U})}},I=(k,U)=>{(h.isValidating||h.validatingFields)&&((k||Array.from(a.mount)).forEach(z=>{z&&(U?De(n.validatingFields,z,U):et(n.validatingFields,z))}),p.state.next({validatingFields:n.validatingFields,isValidating:!Bt(n.validatingFields)}))},S=(k,U=[],z,Z,Q=!0,K=!0)=>{if(Z&&z){if(l.action=!0,K&&Array.isArray(ie(r,k))){const ae=z(ie(r,k),Z.argA,Z.argB);Q&&De(r,k,ae)}if(K&&Array.isArray(ie(n.errors,k))){const ae=z(ie(n.errors,k),Z.argA,Z.argB);Q&&De(n.errors,k,ae),xE(n.errors,k)}if(h.touchedFields&&K&&Array.isArray(ie(n.touchedFields,k))){const ae=z(ie(n.touchedFields,k),Z.argA,Z.argB);Q&&De(n.touchedFields,k,ae)}h.dirtyFields&&(n.dirtyFields=ma(i,o)),p.state.next({name:k,isDirty:A(k,U),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else De(o,k,U)},E=(k,U)=>{De(n.errors,k,U),p.state.next({errors:n.errors})},M=k=>{n.errors=k,p.state.next({errors:n.errors,isValid:!1})},F=(k,U,z,Z)=>{const Q=ie(r,k);if(Q){const K=ie(o,k,Ye(z)?ie(i,k):z);Ye(K)||Z&&Z.defaultChecked||U?De(o,k,U?K:Zu(Q._f)):Y(k,K),l.mount&&D()}},q=(k,U,z,Z,Q)=>{let K=!1,ae=!1;const te={name:k},se=!!(ie(r,k)&&ie(r,k)._f&&ie(r,k)._f.disabled);if(!z||Z){h.isDirty&&(ae=n.isDirty,n.isDirty=te.isDirty=A(),K=ae!==te.isDirty);const re=se||Kr(ie(i,k),U);ae=!!(!se&&ie(n.dirtyFields,k)),re||se?et(n.dirtyFields,k):De(n.dirtyFields,k,!0),te.dirtyFields=n.dirtyFields,K=K||h.dirtyFields&&ae!==!re}if(z){const re=ie(n.touchedFields,k);re||(De(n.touchedFields,k,z),te.touchedFields=n.touchedFields,K=K||h.touchedFields&&re!==z)}return K&&Q&&p.state.next(te),K?te:{}},T=(k,U,z,Z)=>{const Q=ie(n.errors,k),K=h.isValid&&Cn(U)&&n.isValid!==U;if(t.delayError&&z?(u=P(()=>E(k,z)),u(t.delayError)):(clearTimeout(f),u=null,z?De(n.errors,k,z):et(n.errors,k)),(z?!Kr(Q,z):Q)||!Bt(Z)||K){const ae={...Z,...K&&Cn(U)?{isValid:U}:{},errors:n.errors,name:k};n={...n,...ae},p.state.next(ae)}},w=async k=>{I(k,!0);const U=await e.resolver(o,e.context,OE(k||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return I(k),U},b=async k=>{const{errors:U}=await w(k);if(k)for(const z of k){const Z=ie(U,z);Z?De(n.errors,z,Z):et(n.errors,z)}else n.errors=U;return U},C=async(k,U,z={valid:!0})=>{for(const Z in k){const Q=k[Z];if(Q){const{_f:K,...ae}=Q;if(K){const te=a.array.has(K.name);I([Z],!0);const se=await cm(Q,o,g,e.shouldUseNativeValidation&&!U,te);if(I([Z]),se[K.name]&&(z.valid=!1,U))break;!U&&(ie(se,K.name)?te?bE(n.errors,se,K.name):De(n.errors,K.name,se[K.name]):et(n.errors,K.name))}ae&&await C(ae,U,z)}}return z.valid},N=()=>{for(const k of a.unMount){const U=ie(r,k);U&&(U._f.refs?U._f.refs.every(z=>!Ju(z)):!Ju(U._f.ref))&&Re(k)}a.unMount=new Set},A=(k,U)=>(k&&U&&De(o,k,U),!Kr(ve(),i)),v=(k,U,z)=>Ny(k,a,{...l.mount?o:Ye(U)?i:On(k)?{[k]:U}:U},z,U),G=k=>Jl(ie(l.mount?o:i,k,t.shouldUnregister?ie(i,k,[]):[])),Y=(k,U,z={})=>{const Z=ie(r,k);let Q=U;if(Z){const K=Z._f;K&&(!K.disabled&&De(o,k,Fy(U,K)),Q=pl(K.ref)&&kt(U)?"":U,Ly(K.ref)?[...K.ref.options].forEach(ae=>ae.selected=Q.includes(ae.value)):K.refs?Os(K.ref)?K.refs.length>1?K.refs.forEach(ae=>(!ae.defaultChecked||!ae.disabled)&&(ae.checked=Array.isArray(Q)?!!Q.find(te=>te===ae.value):Q===ae.value)):K.refs[0]&&(K.refs[0].checked=!!Q):K.refs.forEach(ae=>ae.checked=ae.value===Q):Ed(K.ref)?K.ref.value="":(K.ref.value=Q,K.ref.type||p.values.next({name:k,values:{...o}})))}(z.shouldDirty||z.shouldTouch)&&q(k,Q,z.shouldTouch,z.shouldDirty,!0),z.shouldValidate&&le(k)},me=(k,U,z)=>{for(const Z in U){const Q=U[Z],K=`${k}.${Z}`,ae=ie(r,K);(a.array.has(k)||!gl(Q)||ae&&!ae._f)&&!xi(Q)?me(K,Q,z):Y(K,Q,z)}},B=(k,U,z={})=>{const Z=ie(r,k),Q=a.array.has(k),K=Rt(U);De(o,k,K),Q?(p.array.next({name:k,values:{...o}}),(h.isDirty||h.dirtyFields)&&z.shouldDirty&&p.state.next({name:k,dirtyFields:ma(i,o),isDirty:A(k,K)})):Z&&!Z._f&&!kt(K)?me(k,K,z):Y(k,K,z),om(k,a)&&p.state.next({...n}),p.values.next({name:l.mount?k:void 0,values:{...o}})},W=async k=>{l.mount=!0;const U=k.target;let z=U.name,Z=!0;const Q=ie(r,z),K=()=>U.type?Zu(Q._f):Oy(k),ae=te=>{Z=Number.isNaN(te)||te===ie(o,z,te)};if(Q){let te,se;const re=K(),Ce=k.type===hl.BLUR||k.type===hl.FOCUS_OUT,Je=!kE(Q._f)&&!e.resolver&&!ie(n.errors,z)&&!Q._f.deps||PE(Ce,ie(n.touchedFields,z),n.isSubmitted,_,m),We=om(z,a,Ce);De(o,z,re),Ce?(Q._f.onBlur&&Q._f.onBlur(k),u&&u(0)):Q._f.onChange&&Q._f.onChange(k);const Se=q(z,re,Ce,!1),he=!Bt(Se)||We;if(!Ce&&p.values.next({name:z,type:k.type,values:{...o}}),Je)return h.isValid&&D(),he&&p.state.next({name:z,...We?{}:Se});if(!Ce&&We&&p.state.next({...n}),e.resolver){const{errors:ft}=await w([z]);if(ae(re),Z){const er=fm(n.errors,r,z),Rn=fm(ft,r,er.name||z);te=Rn.error,z=Rn.name,se=Bt(ft)}}else I([z],!0),te=(await cm(Q,o,g,e.shouldUseNativeValidation))[z],I([z]),ae(re),Z&&(te?se=!1:h.isValid&&(se=await C(r,!0)));Z&&(Q._f.deps&&le(Q._f.deps),T(z,se,te,Se))}},oe=(k,U)=>{if(ie(n.errors,U)&&k.focus)return k.focus(),1},le=async(k,U={})=>{let z,Z;const Q=Ko(k);if(e.resolver){const K=await b(Ye(k)?k:Q);z=Bt(K),Z=k?!Q.some(ae=>ie(K,ae)):z}else k?(Z=(await Promise.all(Q.map(async K=>{const ae=ie(r,K);return await C(ae&&ae._f?{[K]:ae}:ae)}))).every(Boolean),!(!Z&&!n.isValid)&&D()):Z=z=await C(r);return p.state.next({...!On(k)||h.isValid&&z!==n.isValid?{}:{name:k},...e.resolver||!k?{isValid:z}:{},errors:n.errors}),U.shouldFocus&&!Z&&Yo(r,oe,k?Q:a.mount),Z},ve=k=>{const U={...l.mount?o:i};return Ye(k)?U:On(k)?ie(U,k):k.map(z=>ie(U,z))},we=(k,U)=>({invalid:!!ie((U||n).errors,k),isDirty:!!ie((U||n).dirtyFields,k),error:ie((U||n).errors,k),isValidating:!!ie(n.validatingFields,k),isTouched:!!ie((U||n).touchedFields,k)}),_e=k=>{k&&Ko(k).forEach(U=>et(n.errors,U)),p.state.next({errors:k?n.errors:{}})},Be=(k,U,z)=>{const Z=(ie(r,k,{_f:{}})._f||{}).ref,Q=ie(n.errors,k)||{},{ref:K,message:ae,type:te,...se}=Q;De(n.errors,k,{...se,...U,ref:Z}),p.state.next({name:k,errors:n.errors,isValid:!1}),z&&z.shouldFocus&&Z&&Z.focus&&Z.focus()},Me=(k,U)=>gr(k)?p.values.subscribe({next:z=>k(v(void 0,U),z)}):v(k,U,!0),Re=(k,U={})=>{for(const z of k?Ko(k):a.mount)a.mount.delete(z),a.array.delete(z),U.keepValue||(et(r,z),et(o,z)),!U.keepError&&et(n.errors,z),!U.keepDirty&&et(n.dirtyFields,z),!U.keepTouched&&et(n.touchedFields,z),!U.keepIsValidating&&et(n.validatingFields,z),!e.shouldUnregister&&!U.keepDefaultValue&&et(i,z);p.values.next({values:{...o}}),p.state.next({...n,...U.keepDirty?{isDirty:A()}:{}}),!U.keepIsValid&&D()},ze=({disabled:k,name:U,field:z,fields:Z,value:Q})=>{if(Cn(k)&&l.mount||k){const K=k?void 0:Ye(Q)?Zu(z?z._f:ie(Z,U)._f):Q;De(o,U,K),q(U,K,!1,!1,!0)}},O=(k,U={})=>{let z=ie(r,k);const Z=Cn(U.disabled);return De(r,k,{...z||{},_f:{...z&&z._f?z._f:{ref:{name:k}},name:k,mount:!0,...U}}),a.mount.add(k),z?ze({field:z,disabled:U.disabled,name:k,value:U.value}):F(k,!0,U.value),{...Z?{disabled:U.disabled}:{},...e.progressive?{required:!!U.required,min:Ro(U.min),max:Ro(U.max),minLength:Ro(U.minLength),maxLength:Ro(U.maxLength),pattern:Ro(U.pattern)}:{},name:k,onChange:W,onBlur:W,ref:Q=>{if(Q){O(k,U),z=ie(r,k);const K=Ye(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,ae=IE(K),te=z._f.refs||[];if(ae?te.find(se=>se===K):K===z._f.ref)return;De(r,k,{_f:{...z._f,...ae?{refs:[...te.filter(Ju),K,...Array.isArray(ie(i,k))?[{}]:[]],ref:{type:K.type,name:k}}:{ref:K}}}),F(k,!1,void 0,K)}else z=ie(r,k,{}),z._f&&(z._f.mount=!1),(e.shouldUnregister||U.shouldUnregister)&&!(ky(a.array,k)&&l.action)&&a.unMount.add(k)}}},R=()=>e.shouldFocusError&&Yo(r,oe,a.mount),L=k=>{Cn(k)&&(p.state.next({disabled:k}),Yo(r,(U,z)=>{const Z=ie(r,z);Z&&(U.disabled=Z._f.disabled||k,Array.isArray(Z._f.refs)&&Z._f.refs.forEach(Q=>{Q.disabled=Z._f.disabled||k}))},0,!1))},x=(k,U)=>async z=>{let Z;z&&(z.preventDefault&&z.preventDefault(),z.persist&&z.persist());let Q=Rt(o);if(p.state.next({isSubmitting:!0}),e.resolver){const{errors:K,values:ae}=await w();n.errors=K,Q=ae}else await C(r);if(et(n.errors,"root"),Bt(n.errors)){p.state.next({errors:{}});try{await k(Q,z)}catch(K){Z=K}}else U&&await U({...n.errors},z),R(),setTimeout(R);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Bt(n.errors)&&!Z,submitCount:n.submitCount+1,errors:n.errors}),Z)throw Z},ue=(k,U={})=>{ie(r,k)&&(Ye(U.defaultValue)?B(k,Rt(ie(i,k))):(B(k,U.defaultValue),De(i,k,Rt(U.defaultValue))),U.keepTouched||et(n.touchedFields,k),U.keepDirty||(et(n.dirtyFields,k),n.isDirty=U.defaultValue?A(k,Rt(ie(i,k))):A()),U.keepError||(et(n.errors,k),h.isValid&&D()),p.state.next({...n}))},$=(k,U={})=>{const z=k?Rt(k):i,Z=Rt(z),Q=Bt(k),K=Q?i:Z;if(U.keepDefaultValues||(i=z),!U.keepValues){if(U.keepDirtyValues)for(const ae of a.mount)ie(n.dirtyFields,ae)?De(K,ae,ie(o,ae)):B(ae,ie(K,ae));else{if(yd&&Ye(k))for(const ae of a.mount){const te=ie(r,ae);if(te&&te._f){const se=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(pl(se)){const re=se.closest("form");if(re){re.reset();break}}}}r={}}o=t.shouldUnregister?U.keepDefaultValues?Rt(i):{}:Rt(K),p.array.next({values:{...K}}),p.values.next({values:{...K}})}a={mount:U.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!h.isValid||!!U.keepIsValid||!!U.keepDirtyValues,l.watch=!!t.shouldUnregister,p.state.next({submitCount:U.keepSubmitCount?n.submitCount:0,isDirty:Q?!1:U.keepDirty?n.isDirty:!!(U.keepDefaultValues&&!Kr(k,i)),isSubmitted:U.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Q?{}:U.keepDirtyValues?U.keepDefaultValues&&o?ma(i,o):n.dirtyFields:U.keepDefaultValues&&k?ma(i,k):U.keepDirty?n.dirtyFields:{},touchedFields:U.keepTouched?n.touchedFields:{},errors:U.keepErrors?n.errors:{},isSubmitSuccessful:U.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},J=(k,U)=>$(gr(k)?k(o):k,U);return{control:{register:O,unregister:Re,getFieldState:we,handleSubmit:x,setError:Be,_executeSchema:w,_getWatch:v,_getDirty:A,_updateValid:D,_removeUnmounted:N,_updateFieldArray:S,_updateDisabledField:ze,_getFieldArray:G,_reset:$,_resetDefaultValues:()=>gr(e.defaultValues)&&e.defaultValues().then(k=>{J(k,e.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:k=>{n={...n,...k}},_disableForm:L,_subjects:p,_proxyFormState:h,_setErrors:M,get _fields(){return r},get _formValues(){return o},get _state(){return l},set _state(k){l=k},get _defaultValues(){return i},get _names(){return a},set _names(k){a=k},get _formState(){return n},set _formState(k){n=k},get _options(){return e},set _options(k){e={...e,...k}}},trigger:le,register:O,handleSubmit:x,watch:Me,setValue:B,getValues:ve,reset:J,resetField:ue,clearErrors:_e,unregister:Re,setError:Be,setFocus:(k,U={})=>{const z=ie(r,k),Z=z&&z._f;if(Z){const Q=Z.refs?Z.refs[0]:Z.ref;Q.focus&&(Q.focus(),U.shouldSelect&&Q.select())}},getFieldState:we}}function Vy(t={}){const e=ge.useRef(),n=ge.useRef(),[r,i]=ge.useState({isDirty:!1,isValidating:!1,isLoading:gr(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:gr(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...RE(t),formState:r});const o=e.current.control;return o._options=t,Sd({subject:o._subjects.state,next:l=>{Ay(l,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),ge.useEffect(()=>o._disableForm(t.disabled),[o,t.disabled]),ge.useEffect(()=>{if(o._proxyFormState.isDirty){const l=o._getDirty();l!==r.isDirty&&o._subjects.state.next({isDirty:l})}},[o,r.isDirty]),ge.useEffect(()=>{t.values&&!Kr(t.values,n.current)?(o._reset(t.values,o._options.resetOptions),n.current=t.values,i(l=>({...l}))):o._resetDefaultValues()},[t.values,o]),ge.useEffect(()=>{t.errors&&o._setErrors(t.errors)},[t.errors,o]),ge.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()}),ge.useEffect(()=>{t.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[t.shouldUnregister,o]),e.current.formState=xy(r,o),e.current}var fe={},rf={exports:{}};(function(t,e){(function(n,r){var i="1.0.38",o="",l="?",a="function",u="undefined",f="object",h="string",p="major",m="model",_="name",g="type",P="vendor",D="version",I="architecture",S="console",E="mobile",M="tablet",F="smarttv",q="wearable",T="embedded",w=500,b="Amazon",C="Apple",N="ASUS",A="BlackBerry",v="Browser",G="Chrome",Y="Edge",me="Firefox",B="Google",W="Huawei",oe="LG",le="Microsoft",ve="Motorola",we="Opera",_e="Samsung",Be="Sharp",Me="Sony",Re="Xiaomi",ze="Zebra",O="Facebook",R="Chromium OS",L="Mac OS",x=function(te,se){var re={};for(var Ce in te)se[Ce]&&se[Ce].length%2===0?re[Ce]=se[Ce].concat(te[Ce]):re[Ce]=te[Ce];return re},ue=function(te){for(var se={},re=0;re0?Se.length===2?typeof Se[1]==a?this[Se[0]]=Se[1].call(this,ft):this[Se[0]]=Se[1]:Se.length===3?typeof Se[1]===a&&!(Se[1].exec&&Se[1].test)?this[Se[0]]=ft?Se[1].call(this,ft,Se[2]):r:this[Se[0]]=ft?ft.replace(Se[1],Se[2]):r:Se.length===4&&(this[Se[0]]=ft?Se[3].call(this,ft.replace(Se[1],Se[2])):r):this[Se]=ft||r;re+=2}},k=function(te,se){for(var re in se)if(typeof se[re]===f&&se[re].length>0){for(var Ce=0;Ce2&&(he[m]="iPad",he[g]=M),he},this.getEngine=function(){var he={};return he[_]=r,he[D]=r,de.call(he,Ce,We.engine),he},this.getOS=function(){var he={};return he[_]=r,he[D]=r,de.call(he,Ce,We.os),Se&&!he[_]&&Je&&Je.platform&&Je.platform!="Unknown"&&(he[_]=Je.platform.replace(/chrome os/i,R).replace(/macos/i,L)),he},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ce},this.setUA=function(he){return Ce=typeof he===h&&he.length>w?ye(he,w):he,this},this.setUA(Ce),this};Q.VERSION=i,Q.BROWSER=ue([_,D,p]),Q.CPU=ue([I]),Q.DEVICE=ue([m,P,g,S,E,F,M,q,T]),Q.ENGINE=Q.OS=ue([_,D]),t.exports&&(e=t.exports=Q),e.UAParser=Q;var K=typeof n!==u&&(n.jQuery||n.Zepto);if(K&&!K.ua){var ae=new Q;K.ua=ae.getResult(),K.ua.get=function(){return ae.getUA()},K.ua.set=function(te){ae.setUA(te);var se=ae.getResult();for(var re in se)K.ua[re]=se[re]}}})(typeof window=="object"?window:fg)})(rf,rf.exports);var NE=rf.exports;Object.defineProperty(fe,"__esModule",{value:!0});function DE(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Et=ee,je=DE(Et),By=NE,Dr=new By,Ct=Dr.getBrowser(),ME=Dr.getCPU(),Qt=Dr.getDevice(),Td=Dr.getEngine(),Mr=Dr.getOS(),ks=Dr.getUA(),zy=function(e){return Dr.setUA(e)},Ps=function(e){if(!e){console.error("No userAgent string was provided");return}var n=new By(e);return{UA:n,browser:n.getBrowser(),cpu:n.getCPU(),device:n.getDevice(),engine:n.getEngine(),os:n.getOS(),ua:n.getUA(),setUserAgent:function(i){return n.setUA(i)}}},$y=Object.freeze({ClientUAInstance:Dr,browser:Ct,cpu:ME,device:Qt,engine:Td,os:Mr,ua:ks,setUa:zy,parseUserAgent:Ps});function dm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function LE(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function sn(t,e){if(t==null)return{};var n=zE(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ua(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $E(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ua(t)}function WE(t,e){return HE(t)||qE(t,e)||GE(t,e)||KE()}function HE(t){if(Array.isArray(t))return t}function qE(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,l,a;try{for(n=n.call(t);!(i=(l=n.next()).done)&&(r.push(l.value),!(e&&r.length===e));i=!0);}catch(u){o=!0,a=u}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function GE(t,e){if(t){if(typeof t=="string")return hm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hm(t,e)}}function hm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:"none";return e||n},Cd=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},Id=function(e){var n=Cd();return n&&n.platform&&(n.platform.indexOf(e)!==-1||n.platform==="MacIntel"&&n.maxTouchPoints>1&&!window.MSStream)},JE=function(e,n,r,i,o){return{isBrowser:e,browserMajorVersion:Ee(n.major),browserFullVersion:Ee(n.version),browserName:Ee(n.name),engineName:Ee(r.name),engineVersion:Ee(r.version),osName:Ee(i.name),osVersion:Ee(i.version),userAgent:Ee(o)}},pm=function(e,n,r,i){return LE({},e,{vendor:Ee(n.vendor),model:Ee(n.model),os:Ee(r.name),osVersion:Ee(r.version),ua:Ee(i)})},ZE=function(e,n,r,i){return{isSmartTV:e,engineName:Ee(n.name),engineVersion:Ee(n.version),osName:Ee(r.name),osVersion:Ee(r.version),userAgent:Ee(i)}},eb=function(e,n,r,i){return{isConsole:e,engineName:Ee(n.name),engineVersion:Ee(n.version),osName:Ee(r.name),osVersion:Ee(r.version),userAgent:Ee(i)}},tb=function(e,n,r,i){return{isWearable:e,engineName:Ee(n.name),engineVersion:Ee(n.version),osName:Ee(r.name),osVersion:Ee(r.version),userAgent:Ee(i)}},nb=function(e,n,r,i,o){return{isEmbedded:e,vendor:Ee(n.vendor),model:Ee(n.model),engineName:Ee(r.name),engineVersion:Ee(r.version),osName:Ee(i.name),osVersion:Ee(i.version),userAgent:Ee(o)}};function rb(t){var e=t?Ps(t):$y,n=e.device,r=e.browser,i=e.engine,o=e.os,l=e.ua,a=QE(n.type),u=a.isBrowser,f=a.isMobile,h=a.isTablet,p=a.isSmartTV,m=a.isConsole,_=a.isWearable,g=a.isEmbedded;if(u)return JE(u,r,i,o,l);if(p)return ZE(p,i,o,l);if(m)return eb(m,i,o,l);if(f||h)return pm(a,n,o,l);if(_)return tb(_,i,o,l);if(g)return nb(g,n,i,o,l)}var Wy=function(e){var n=e.type;return n===yt.Mobile},Hy=function(e){var n=e.type;return n===yt.Tablet},qy=function(e){var n=e.type;return n===yt.Mobile||n===yt.Tablet},Gy=function(e){var n=e.type;return n===yt.SmartTv},yl=function(e){var n=e.type;return n===yt.Browser},Ky=function(e){var n=e.type;return n===yt.Wearable},Yy=function(e){var n=e.type;return n===yt.Console},Qy=function(e){var n=e.type;return n===yt.Embedded},Xy=function(e){var n=e.vendor;return Ee(n)},Jy=function(e){var n=e.model;return Ee(n)},Zy=function(e){var n=e.type;return Ee(n,"browser")},e0=function(e){var n=e.name;return n===so.Android},t0=function(e){var n=e.name;return n===so.Windows},n0=function(e){var n=e.name;return n===so.MAC_OS},r0=function(e){var n=e.name;return n===so.WindowsPhone},i0=function(e){var n=e.name;return n===so.IOS},o0=function(e){var n=e.version;return Ee(n)},s0=function(e){var n=e.name;return Ee(n)},a0=function(e){var n=e.name;return n===Ft.Chrome},l0=function(e){var n=e.name;return n===Ft.Firefox},u0=function(e){var n=e.name;return n===Ft.Chromium},wl=function(e){var n=e.name;return n===Ft.Edge},c0=function(e){var n=e.name;return n===Ft.Yandex},f0=function(e){var n=e.name;return n===Ft.Safari||n===Ft.MobileSafari},d0=function(e){var n=e.name;return n===Ft.MobileSafari},h0=function(e){var n=e.name;return n===Ft.Opera},p0=function(e){var n=e.name;return n===Ft.InternetExplorer||n===Ft.Ie},m0=function(e){var n=e.name;return n===Ft.MIUI},g0=function(e){var n=e.name;return n===Ft.SamsungBrowser},v0=function(e){var n=e.version;return Ee(n)},y0=function(e){var n=e.major;return Ee(n)},w0=function(e){var n=e.name;return Ee(n)},_0=function(e){var n=e.name;return Ee(n)},S0=function(e){var n=e.version;return Ee(n)},E0=function(){var e=Cd(),n=e&&e.userAgent&&e.userAgent.toLowerCase();return typeof n=="string"?/electron/.test(n):!1},Ui=function(e){return typeof e=="string"&&e.indexOf("Edg/")!==-1},b0=function(){var e=Cd();return e&&(/iPad|iPhone|iPod/.test(e.platform)||e.platform==="MacIntel"&&e.maxTouchPoints>1)&&!window.MSStream},In=function(){return Id("iPad")},T0=function(){return Id("iPhone")},C0=function(){return Id("iPod")},I0=function(e){return Ee(e)};function O0(t){var e=t||$y,n=e.device,r=e.browser,i=e.os,o=e.engine,l=e.ua;return{isSmartTV:Gy(n),isConsole:Yy(n),isWearable:Ky(n),isEmbedded:Qy(n),isMobileSafari:d0(r)||In(),isChromium:u0(r),isMobile:qy(n)||In(),isMobileOnly:Wy(n),isTablet:Hy(n)||In(),isBrowser:yl(n),isDesktop:yl(n),isAndroid:e0(i),isWinPhone:r0(i),isIOS:i0(i)||In(),isChrome:a0(r),isFirefox:l0(r),isSafari:f0(r),isOpera:h0(r),isIE:p0(r),osVersion:o0(i),osName:s0(i),fullBrowserVersion:v0(r),browserVersion:y0(r),browserName:w0(r),mobileVendor:Xy(n),mobileModel:Jy(n),engineName:_0(o),engineVersion:S0(o),getUA:I0(l),isEdge:wl(r)||Ui(l),isYandex:c0(r),deviceType:Zy(n),isIOS13:b0(),isIPad13:In(),isIPhone13:T0(),isIPod13:C0(),isElectron:E0(),isEdgeChromium:Ui(l),isLegacyEdge:wl(r)&&!Ui(l),isWindows:t0(i),isMacOs:n0(i),isMIUI:m0(r),isSamsungBrowser:g0(r)}}var k0=Gy(Qt),P0=Yy(Qt),x0=Ky(Qt),ib=Qy(Qt),ob=d0(Ct)||In(),sb=u0(Ct),Zl=qy(Qt)||In(),A0=Wy(Qt),R0=Hy(Qt)||In(),N0=yl(Qt),ab=yl(Qt),D0=e0(Mr),M0=r0(Mr),L0=i0(Mr)||In(),lb=a0(Ct),ub=l0(Ct),cb=f0(Ct),fb=h0(Ct),j0=p0(Ct),db=o0(Mr),hb=s0(Mr),pb=v0(Ct),mb=y0(Ct),gb=w0(Ct),vb=Xy(Qt),yb=Jy(Qt),wb=_0(Td),_b=S0(Td),Sb=I0(ks),Eb=wl(Ct)||Ui(ks),bb=c0(Ct),Tb=Zy(Qt),Cb=b0(),Ib=In(),Ob=T0(),kb=C0(),Pb=E0(),xb=Ui(ks),Ab=wl(Ct)&&!Ui(ks),Rb=t0(Mr),Nb=n0(Mr),Db=m0(Ct),Mb=g0(Ct),Lb=function(e){if(!e||typeof e!="string"){console.error("No valid user agent string was provided");return}var n=Ps(e),r=n.device,i=n.browser,o=n.os,l=n.engine,a=n.ua;return O0({device:r,browser:i,os:o,engine:l,ua:a})},jb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return D0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Ub=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return N0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Fb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return j0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Vb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return L0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Bb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return Zl?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},zb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return R0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},$b=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return M0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Wb=function(e){var n=e.renderWithFragment,r=e.children;e.viewClassName,e.style;var i=sn(e,["renderWithFragment","children","viewClassName","style"]);return A0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Hb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return k0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},qb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return P0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Gb=function(e){var n=e.renderWithFragment,r=e.children,i=sn(e,["renderWithFragment","children"]);return x0?n?je.createElement(Et.Fragment,null,r):je.createElement("div",i,r):null},Kb=function(e){var n=e.renderWithFragment,r=e.children;e.viewClassName,e.style;var i=e.condition,o=sn(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?n?je.createElement(Et.Fragment,null,r):je.createElement("div",o,r):null};function Yb(t){return function(e){BE(n,e);function n(r){var i;return jE(this,n),i=$E(this,sf(n).call(this,r)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(Ua(i)),i.onOrientationChange=i.onOrientationChange.bind(Ua(i)),i.onPageLoad=i.onPageLoad.bind(Ua(i)),i.state={isLandscape:!1,isPortrait:!1},i}return FE(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":Qo(window))!==void 0&&Zl&&(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 je.createElement(t,of({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),n}(je.Component)}function Qb(){var t=Et.useState(function(){var o=window.innerWidth>window.innerHeight?90:0;return{isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"}}),e=WE(t,2),n=e[0],r=e[1],i=Et.useCallback(function(){var o=window.innerWidth>window.innerHeight?90:0,l={isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"};n.orientation!==l.orientation&&r(l)},[n.orientation]);return Et.useEffect(function(){return(typeof window>"u"?"undefined":Qo(window))!==void 0&&Zl&&(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 U0(t){var e=t||window.navigator.userAgent;return Ps(e)}function Xb(t){var e=t||window.navigator.userAgent,n=U0(e),r=O0(n);return[r,n]}fe.AndroidView=jb;fe.BrowserTypes=Ft;fe.BrowserView=Ub;fe.ConsoleView=qb;fe.CustomView=Kb;fe.IEView=Fb;fe.IOSView=Vb;fe.MobileOnlyView=Wb;fe.MobileView=Bb;fe.OsTypes=so;fe.SmartTVView=Hb;fe.TabletView=zb;fe.WearableView=Gb;fe.WinPhoneView=$b;fe.browserName=gb;fe.browserVersion=mb;fe.deviceDetect=rb;fe.deviceType=Tb;fe.engineName=wb;fe.engineVersion=_b;fe.fullBrowserVersion=pb;fe.getSelectorsByUserAgent=Lb;fe.getUA=Sb;fe.isAndroid=D0;fe.isBrowser=N0;fe.isChrome=lb;fe.isChromium=sb;fe.isConsole=P0;var Jb=fe.isDesktop=ab;fe.isEdge=Eb;fe.isEdgeChromium=xb;fe.isElectron=Pb;fe.isEmbedded=ib;fe.isFirefox=ub;fe.isIE=j0;fe.isIOS=L0;fe.isIOS13=Cb;fe.isIPad13=Ib;fe.isIPhone13=Ob;fe.isIPod13=kb;fe.isLegacyEdge=Ab;fe.isMIUI=Db;fe.isMacOs=Nb;fe.isMobile=Zl;fe.isMobileOnly=A0;fe.isMobileSafari=ob;fe.isOpera=fb;fe.isSafari=cb;fe.isSamsungBrowser=Mb;fe.isSmartTV=k0;fe.isTablet=R0;fe.isWearable=x0;fe.isWinPhone=M0;fe.isWindows=Rb;fe.isYandex=bb;fe.mobileModel=yb;fe.mobileVendor=vb;fe.osName=hb;fe.osVersion=db;fe.parseUserAgent=Ps;fe.setUserAgent=XE;fe.useDeviceData=U0;fe.useDeviceSelectors=Xb;fe.useMobileOrientation=Qb;fe.withOrientationChange=Yb;var at=[];for(var ec=0;ec<256;++ec)at.push((ec+256).toString(16).slice(1));function Zb(t,e=0){return(at[t[e+0]]+at[t[e+1]]+at[t[e+2]]+at[t[e+3]]+"-"+at[t[e+4]]+at[t[e+5]]+"-"+at[t[e+6]]+at[t[e+7]]+"-"+at[t[e+8]]+at[t[e+9]]+"-"+at[t[e+10]]+at[t[e+11]]+at[t[e+12]]+at[t[e+13]]+at[t[e+14]]+at[t[e+15]]).toLowerCase()}var ga,eT=new Uint8Array(16);function tT(){if(!ga&&(ga=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ga))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ga(eT)}var nT=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const mm={randomUUID:nT};function rT(t,e,n){if(mm.randomUUID&&!e&&!t)return mm.randomUUID();t=t||{};var r=t.random||(t.rng||tT)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Zb(r)}var Ml,F0;const nh=class nh{constructor(e={}){Gh(this,Ml);if(typeof e=="string")try{e=JSON.parse(e)}catch(n){console.error("Invalid JSON string provided:",n),e={}}else e instanceof nh?Object.assign(this,e):(this.transactionId=e.transaction_id||Kh(this,Ml,F0).call(this),this.createdAt=e.created_at||null,this.amount=e.amount||null,this.vendor=e.vendor||null,this.category_id=e.category_id||null,this.category_name=e.category_name||null,this.pictureId=e.pictureId||null,this.isSuccessful=e.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())}};Ml=new WeakSet,F0=function(){return rT()};let Mt=nh,lf=class{constructor(e){e instanceof Mt?(this.vendor=e.vendor,this.amount=e.amount,this.category_name=e.category_name,this.created_at=e.created_at):(this.vendor="",this.created_at="",this.amount="",this.category_name="")}returnNonEmptyValues(){return Object.entries(this).filter((e,n)=>e[n]!==null&&e[n]!==void 0)}};class Qi{constructor(e){e instanceof Object?(this.category_id=e.category_id,this.category_name=e.category_name):e instanceof Qi?Object.assign(this,e):(this.category_name=e,this.category_id="")}serialize(){return{category_id:this.category_id,category_name:this.category_name}}toString(){return JSON.stringify(this.serialize())}}var iT={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:"/simplitrac_frontend/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let $t=class zr{constructor(e={}){var n,r,i,o;e instanceof zr?Object.assign(this,e):(this.user_id=(e==null?void 0:e.uid)??(e==null?void 0:e.user_id),this.access_token=e==null?void 0:e.accessToken,this.email=e==null?void 0:e.email,e!=null&&e.displayName?(this.first_name=e==null?void 0:e.displayName.split(" ")[0],this.last_name=e==null?void 0:e.displayName.split(" ").slice(1).join(" ")):(this.first_name=e==null?void 0:e.first_name,this.last_name=e==null?void 0:e.last_name),this.created_at=((n=e==null?void 0:e.metadata)==null?void 0:n.createdAt)||new Date().getTime(),this.last_login=((r=e==null?void 0:e.metadata)==null?void 0:r.lastLoginAt)||new Date().getTime(),this.admin=null,this.transactions=((i=e==null?void 0:e.transactions)==null?void 0:i.map(l=>new Mt(l)))||[],this.categories=((o=e==null?void 0:e.categories)==null?void 0:o.map(l=>new Qi(l)))||[])}getCreatedAtString(){return new Date(this.created_at).toString()}getLastLoginString(){return new Date(this.last_login).toString()}isNewUser(){var e,n;return((e=this.categories)==null?void 0:e.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(e=>e.serialize()),categories:this.categories.map(e=>e.serialize())}}addCategory(e){this.categories.push(new Qi(e))}toString(){return JSON.stringify(this.serialize())}addTransaction(e){e instanceof Mt?this.transactions.push(e):console.error("Invalid transaction provided:",e)}returnCategoryList(){return[...new Set(["Select category",...this.categories.map(e=>gm(e.category_name))])]}returnVendorList(){return[...new Set(["Select vendor",...this.transactions.map(e=>gm(e.vendor))])]}async updateFirebase(){const e={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,e);let i;return i=await r.text(),new zr(JSON.parse(i))}async deleteTransactions(){const e={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(this.serialize())},n=`${iT.VITE_PROD_DELETE_TRANSACTIONS_ENDPOINT}/?user_id=${this.user_id}`,r=await fetch(n,e);let i;return i=await r.text(),new zr(JSON.parse(i))}static async getUserFromFirestore(e){const n={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}},r=`https://us-central1-simplitracapp.cloudfunctions.net/get_existing_user?user_id=${e}`;try{const o=await(await fetch(r,n)).json();return o instanceof Object?new zr(o):new zr}catch(i){return console.log(i),new zr}}};function gm(t){if(!t)return;const e=t.toLowerCase();return e.charAt(0).toUpperCase()+e.slice(1)}const an=ee.createContext({}),oT=({children:t})=>{const e=()=>Jb?"desktop":"mobile",[n,r]=ee.useState(),[i,o]=ee.useState(new $t(JSON.parse(localStorage.getItem("user")))),[l,a]=ee.useState(!0),[u,f]=ee.useState(!1),[h,p]=ee.useState(null),[m,_]=ee.useState(new Mt),[g,P]=ee.useState(e()),[D,I]=ee.useState(),[S,E]=ee.useState(!1),[M,F]=ee.useState(new lf),q=async()=>{const b="http://127.0.0.1:5001/simplitracapp/us-central1/get_existing_user";try{const C=await fetch(b);if(!C.ok)throw new Error("Network response issue exists");const N=await C.json();o(N)}catch(C){console.error("Error fetching user data:",C)}},T=()=>{r("login"),o({first_name:"",last_name:"",categories:[]}),a(!0),f(!1),p(null),_(new Mt),P(e()),I(),E(!1),F(new lf)};ee.useEffect(()=>{q()},[]);const w={screen:n,setScreen:r,user:i,setUser:o,modalIsOpen:l,setModalIsOpen:a,show:u,setShow:f,capturedPhoto:h,setCapturedPhoto:p,ocrData:m,setOcrData:_,device:g,setDevice:P,serverResponse:D,setServerResponse:I,ocrModalOpen:S,setOcrModalOpen:E,fetchUserData:q,formData:M,setFormData:F,resetAppState:T};return j.jsx(an.Provider,{value:w,children:t})},sT=()=>{const{user:t,formData:e,setFormData:n,setUser:r,ocrData:i,setOcrData:o,setServerResponse:l}=ee.useContext(an),[a,u]=ee.useState([]),[f,h]=ee.useState([]),[p,m]=ee.useState(""),[_,g]=ee.useState(""),P=ee.useRef(""),D=ee.useRef(""),{control:I,handleSubmit:S,setValue:E,watch:M,reset:F,formState:{errors:q}}=Vy({defaultValues:{vendor:"Select Vendor",category:"Select Category",date:new Date().toISOString().split("T")[0],amount:""}}),T=v=>{if(!v)return;const G=v.toLowerCase();return G.charAt(0).toUpperCase()+G.slice(1)},w=()=>{if(t.transactions.length!==0){const v=new Set(["Select vendor",...t.returnVendorList()]);u([...v])}else u(["Select Vendor"])},b=()=>{if(t.categories.length!==0){const v=new Set(["Select Category",...t.categories.map(G=>T(G.category_name))]);h([...v])}else h(["Select Category"])},C=v=>{const G=v.target.value,Y=new Mt(i);Y.vendor=G,o(Y),u(me=>[...new Set([...me,G])]),m(""),E("vendor",G)},N=v=>{if(v.target.value!==""){const G=v.target.value,Y=new Mt(i);Y.category_name=G,o(Y),h(me=>[...new Set([...me,G])]),g(""),E("category",G)}};ee.useEffect(()=>{if(i.isEmpty()&&(w(),b()),!e)return;const v=e.returnNonEmptyValues();let G,Y=!0;if(v.length){for(const me of v){const B=me[0],W=me[1];switch(B){case"vendor":u([...t.returnVendorList(),W]),P.current=T(W),E(B,W),G=!1;break;case"category":t.addCategory(W),h([...t.returnCategoryList()]),D.current=T(W),E(B,W),Y=!1;break;default:E(B,W);break}}n(),G&&w(),Y&&b()}},[P.current,D.current,t,e]);const A=async v=>{if(Object.keys(q).length>0){alert("Please fill in all the inputs properly");return}const G=new $t(t),Y=new Mt(i);Y.createdAt=v.date,Y.vendor=v.vendor,Y.amount=v.amount,Y.category_name=v.category,G.transactions.push(Y),G.addCategory(v.category);const me=await t.updateFirebase();me instanceof $t&&(l("User Successfully Updated"),r(me),F({vendor:"Select Vendor",category:"Select Category",date:new Date().toISOString().split("T")[0],amount:""}),o(new Mt))};return j.jsxs("form",{onSubmit:S(A),children:[j.jsxs("div",{children:[j.jsx("label",{children:"Date"}),j.jsx(mr,{name:"date",control:I,render:({field:v})=>j.jsx("input",{type:"date",...v})})]}),j.jsxs("div",{children:[j.jsx("label",{children:"Vendor"}),j.jsx(mr,{name:"vendor",control:I,rules:{required:"Please select a vendor",validate:v=>v==="Select vendor"||v===""?"Please select a vendor":!0},render:({field:v})=>j.jsxs("div",{children:[j.jsxs("select",{...v,onChange:G=>{const Y=G.target.value;Y==="other"?v.onChange(""):v.onChange(Y)},children:[a.map(G=>j.jsx("option",{value:G,children:G},G)),j.jsx("option",{value:"other",children:"Other (specify below)"})]}),(v.value===""||v.value==="Select vendor"||v.value==="Other (specify below)")&&j.jsxs(j.Fragment,{children:[j.jsx("input",{id:"vendor",type:"text",value:p,onChange:G=>{m(G.target.value)},onBlur:G=>{C(G),v.onBlur()}}),q.vendor&&j.jsx("span",{role:"alert",style:{color:"red"},children:q.vendor.message})]})]})})]}),j.jsxs("div",{children:[j.jsx("label",{htmlFor:"amount",children:"Amount"}),j.jsx(mr,{name:"amount",control:I,rules:{required:"Please enter a valid number",validate:v=>!0},render:({field:v})=>j.jsx("input",{id:"amount",type:"number",inputMode:"numeric",step:"0.01",...v})}),q.amount&&j.jsx("span",{role:"alert",style:{color:"red"},children:q.amount.message})]}),j.jsxs("div",{children:[j.jsx("label",{children:"Category"}),j.jsx(mr,{name:"category",control:I,rules:{required:"Please select a category",validate:v=>v==="Select category"||v===""||v==="Other (specify below)"||v==="Select Category"?"Please select a category":!0},render:({field:v})=>j.jsxs("div",{children:[j.jsxs("select",{...v,onChange:G=>{const Y=G.target.value;Y==="other"?v.onChange(""):v.onChange(Y)},children:[f.map(G=>j.jsx("option",{value:G,children:G},G)),j.jsx("option",{value:"other",children:"Other (specify below)"})]}),(v.value===""||v.value==="Select category"||v.value==="Select Category"||v.value==="Other (specify below)")&&j.jsxs(j.Fragment,{children:[j.jsx("input",{id:"category",type:"text",value:_,onChange:G=>{g(G.target.value)},onBlur:N}),q.category&&j.jsx("span",{role:"alert",style:{color:"red"},children:q.category.message})]})]})})]}),j.jsx("button",{type:"submit",children:"Submit"})]})},Od=()=>{const{setScreen:t}=ee.useContext(an),e=()=>{t("landing")};return j.jsx("button",{onClick:e,children:"Back"})};var V0={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",l=0;l{const f=r[u];delete r[u];let h,p,m;typeof f=="object"&&f!=null?{span:h,offset:p,order:m}=f:h=f;const _=u!==o?`-${u}`:"";h&&l.push(h===!0?`${e}${_}`:`${e}${_}-${h}`),m!=null&&a.push(`order${_}-${m}`),p!=null&&a.push(`offset${_}-${p}`)}),[{...r,className:xs(n,...l,...a)},{as:t,bsPrefix:e,spans:l}]}const Pd=ee.forwardRef((t,e)=>{const[{className:n,...r},{as:i="div",bsPrefix:o,spans:l}]=mT(t);return U.jsx(i,{...r,ref:e,className:xs(n,!l.length&&o)})});Pd.displayName="Col";const eu=ee.forwardRef(({bsPrefix:t,fluid:e=!1,as:n="div",className:r,...i},o)=>{const l=Zl(t,"container"),a=typeof e=="string"?`-${e}`:"-fluid";return U.jsx(n,{ref:o,...i,className:xs(r,e?`${l}${a}`:l)})});eu.displayName="Container";var gT=function(){},vT=gT;No.string,No.bool,No.bool,No.bool,No.bool;const xd=ee.forwardRef(({bsPrefix:t,className:e,fluid:n=!1,rounded:r=!1,roundedCircle:i=!1,thumbnail:o=!1,...l},a)=>(t=Zl(t,"img"),U.jsx("img",{ref:a,...l,className:xs(e,n&&`${t}-fluid`,r&&"rounded",i&&"rounded-circle",o&&`${t}-thumbnail`)})));xd.displayName="Image";const Ad=ee.forwardRef(({bsPrefix:t,className:e,as:n="div",...r},i)=>{const o=Zl(t,"row"),l=$0(),a=W0(),u=`${o}-cols`,f=[];return l.forEach(h=>{const p=r[h];delete r[h];let m;p!=null&&typeof p=="object"?{cols:m}=p:m=p;const _=h!==a?`-${h}`:"";m!=null&&f.push(`${u}${_}-${m}`)}),U.jsx(n,{ref:i,...r,className:xs(e,o,...f)})});Ad.displayName="Row";const yT=()=>{const{capturedPhoto:t,setCapturedPhoto:e,screen:n,setScreen:r,ocrData:i,setOcrData:o,device:l,setOcrModalOpen:a}=ee.useContext(an),[u,f]=ee.useState(null),[h,p]=ee.useState(null),m=ee.useRef(null),_=ee.useRef(null),g=ee.useRef(null);ee.useEffect(()=>{!t&&l==="mobile"&&g.current.click(),l==="desktop"&&!t&&(async()=>{var E;(E=m.current)!=null&&E.srcObject||await D()})()},[t,m,u]);const P=()=>{if(m.current&&_.current){_.current.getContext("2d").drawImage(m.current,0,0,_.current.width,_.current.height);const M=_.current.toDataURL("image/png");e(M),h.getTracks().forEach(F=>{F.stop()}),p(null),console.log("Camera light turned off")}},D=async()=>{e(null);try{let E;l==="desktop"&&(E=await navigator.mediaDevices.getUserMedia({video:!0})),p(E),m.current&&(m.current.srcObject=E,m.current.play(),f(!0))}catch(E){console.error("Error accessing camera:",E),f(!1)}},I=E=>{const M=E.target.files[0];if(M){const F=new FileReader;F.onload=q=>{e(q.target.result),l==="mobile"&&S()},F.readAsDataURL(M)}},S=async()=>{try{const E="https://us-central1-simplitracapp.cloudfunctions.net/process_receipt",F={method:"POST",body:_T(t)},q=await fetch(E,F);if(!q.ok)throw new Error("Network response was not ok");const T=await q.json();if(T.error)console.error("Error from OCR service:",T.message),alert(T.message);else{const w=new Mt(T);o(w),r("landing"),e(!1),a(!0)}}catch(E){console.error("Error submitting photo:",E),alert("Text is unreadable, please take the photo again.")}};return U.jsxs("div",{style:Ln.container,children:[l==="mobile"&&!t&&U.jsx("div",{children:U.jsx("input",{type:"file",accept:"image/*",capture:"environment",ref:g,onChange:I,style:Ln.fileInput})}),l==="desktop"&&!t&&U.jsxs("div",{children:[U.jsx("video",{ref:m,style:Ln.video}),U.jsx("button",{className:"custom-button",onClick:P,style:Ln.button,children:"Capture Photo"})]}),t&&U.jsxs("div",{children:[U.jsxs("div",{style:Ln.imageContainer,children:[U.jsx("p",{children:"Captured Photo:"}),U.jsx("img",{src:t,alt:"Captured",style:Ln.image})]}),U.jsx("button",{className:"custom-button",onClick:S,style:Ln.button,children:"Submit"}),U.jsx("button",{className:"custom-button",onClick:D,style:Ln.button,children:"Retake"})]}),U.jsx(Id,{}),U.jsx("canvas",{ref:_,style:Ln.hiddenCanvas})]})},Ln={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 wT(t){const e=atob(t.split(",")[1]),n=t.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(e.length),i=new Uint8Array(r);for(let o=0;o{const f=r[u];delete r[u];let h,p,m;typeof f=="object"&&f!=null?{span:h,offset:p,order:m}=f:h=f;const _=u!==o?`-${u}`:"";h&&l.push(h===!0?`${e}${_}`:`${e}${_}-${h}`),m!=null&&a.push(`order${_}-${m}`),p!=null&&a.push(`offset${_}-${p}`)}),[{...r,className:xs(n,...l,...a)},{as:t,bsPrefix:e,spans:l}]}const xd=ee.forwardRef((t,e)=>{const[{className:n,...r},{as:i="div",bsPrefix:o,spans:l}]=gT(t);return j.jsx(i,{...r,ref:e,className:xs(n,!l.length&&o)})});xd.displayName="Col";const tu=ee.forwardRef(({bsPrefix:t,fluid:e=!1,as:n="div",className:r,...i},o)=>{const l=eu(t,"container"),a=typeof e=="string"?`-${e}`:"-fluid";return j.jsx(n,{ref:o,...i,className:xs(r,e?`${l}${a}`:l)})});tu.displayName="Container";var vT=function(){},yT=vT;No.string,No.bool,No.bool,No.bool,No.bool;const Ad=ee.forwardRef(({bsPrefix:t,className:e,fluid:n=!1,rounded:r=!1,roundedCircle:i=!1,thumbnail:o=!1,...l},a)=>(t=eu(t,"img"),j.jsx("img",{ref:a,...l,className:xs(e,n&&`${t}-fluid`,r&&"rounded",i&&"rounded-circle",o&&`${t}-thumbnail`)})));Ad.displayName="Image";const Rd=ee.forwardRef(({bsPrefix:t,className:e,as:n="div",...r},i)=>{const o=eu(t,"row"),l=W0(),a=H0(),u=`${o}-cols`,f=[];return l.forEach(h=>{const p=r[h];delete r[h];let m;p!=null&&typeof p=="object"?{cols:m}=p:m=p;const _=h!==a?`-${h}`:"";m!=null&&f.push(`${u}${_}-${m}`)}),j.jsx(n,{ref:i,...r,className:xs(e,o,...f)})});Rd.displayName="Row";const wT=()=>{const{capturedPhoto:t,setCapturedPhoto:e,screen:n,setScreen:r,ocrData:i,setOcrData:o,device:l,setOcrModalOpen:a}=ee.useContext(an),[u,f]=ee.useState(null),[h,p]=ee.useState(null),m=ee.useRef(null),_=ee.useRef(null),g=ee.useRef(null);ee.useEffect(()=>{!t&&l==="mobile"&&g.current.click(),l==="desktop"&&!t&&(async()=>{var E;(E=m.current)!=null&&E.srcObject||await D()})()},[t,m,u]);const P=()=>{if(m.current&&_.current){_.current.getContext("2d").drawImage(m.current,0,0,_.current.width,_.current.height);const M=_.current.toDataURL("image/png");e(M),h.getTracks().forEach(F=>{F.stop()}),p(null),console.log("Camera light turned off")}},D=async()=>{e(null);try{let E;l==="desktop"&&(E=await navigator.mediaDevices.getUserMedia({video:!0})),p(E),m.current&&(m.current.srcObject=E,m.current.play(),f(!0))}catch(E){console.error("Error accessing camera:",E),f(!1)}},I=E=>{const M=E.target.files[0];if(M){const F=new FileReader;F.onload=q=>{e(q.target.result),l==="mobile"&&S()},F.readAsDataURL(M)}},S=async()=>{try{const E="https://us-central1-simplitracapp.cloudfunctions.net/process_receipt",F={method:"POST",body:ST(t)},q=await fetch(E,F);if(!q.ok)throw new Error("Network response was not ok");const T=await q.json();if(T.error)console.error("Error from OCR service:",T.message),alert(T.message);else{const w=new Mt(T);o(w),r("landing"),e(!1),a(!0)}}catch(E){console.error("Error submitting photo:",E),alert("Text is unreadable, please take the photo again.")}};return j.jsxs("div",{style:Ln.container,children:[l==="mobile"&&!t&&j.jsx("div",{children:j.jsx("input",{type:"file",accept:"image/*",capture:"environment",ref:g,onChange:I,style:Ln.fileInput})}),l==="desktop"&&!t&&j.jsxs("div",{children:[j.jsx("video",{ref:m,style:Ln.video}),j.jsx("button",{className:"custom-button",onClick:P,style:Ln.button,children:"Capture Photo"})]}),t&&j.jsxs("div",{children:[j.jsxs("div",{style:Ln.imageContainer,children:[j.jsx("p",{children:"Captured Photo:"}),j.jsx("img",{src:t,alt:"Captured",style:Ln.image})]}),j.jsx("button",{className:"custom-button",onClick:S,style:Ln.button,children:"Submit"}),j.jsx("button",{className:"custom-button",onClick:D,style:Ln.button,children:"Retake"})]}),j.jsx(Od,{}),j.jsx("canvas",{ref:_,style:Ln.hiddenCanvas})]})},Ln={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 _T(t){const e=atob(t.split(",")[1]),n=t.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(e.length),i=new Uint8Array(r);for(let o=0;o=0)&&u(p,!_)}function h(p){var m=[].slice.call(p.querySelectorAll("*"),0).reduce(function(_,g){return _.concat(g.shadowRoot?h(g.shadowRoot):[g])},[]);return m.filter(f)}t.exports=e.default})(cf,cf.exports);var K0=cf.exports;Object.defineProperty(_n,"__esModule",{value:!0});_n.resetState=TT;_n.log=CT;_n.handleBlur=vs;_n.handleFocus=ys;_n.markForFocusLater=IT;_n.returnFocus=OT;_n.popWithoutFocus=kT;_n.setupScopedFocus=PT;_n.teardownScopedFocus=xT;var ST=K0,ET=bT(ST);function bT(t){return t&&t.__esModule?t:{default:t}}var Xi=[],Ai=null,ff=!1;function TT(){Xi=[]}function CT(){}function vs(){ff=!0}function ys(){if(ff){if(ff=!1,!Ai)return;setTimeout(function(){if(!Ai.contains(document.activeElement)){var t=(0,ET.default)(Ai)[0]||Ai;t.focus()}},0)}}function IT(){Xi.push(document.activeElement)}function OT(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=null;try{Xi.length!==0&&(e=Xi.pop(),e.focus({preventScroll:t}));return}catch{console.warn(["You tried to return focus to",e,"but it is not in the DOM anymore"].join(" "))}}function kT(){Xi.length>0&&Xi.pop()}function PT(t){Ai=t,window.addEventListener?(window.addEventListener("blur",vs,!1),document.addEventListener("focus",ys,!0)):(window.attachEvent("onBlur",vs),document.attachEvent("onFocus",ys))}function xT(){Ai=null,window.addEventListener?(window.removeEventListener("blur",vs),document.removeEventListener("focus",ys)):(window.detachEvent("onBlur",vs),document.detachEvent("onFocus",ys))}var df={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var n=K0,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 l(a,u){var f=(0,r.default)(a);if(!f.length){u.preventDefault();return}var h=void 0,p=u.shiftKey,m=f[0],_=f[f.length-1],g=o();if(a===g){if(!p)return;h=_}if(_===g&&!p&&(h=m),m===g&&p&&(h=_),h){u.preventDefault(),h.focus();return}var P=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),D=P!=null&&P[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(D){var I=f.indexOf(g);if(I>-1&&(I+=p?-1:1),h=f[I],typeof h>"u"){u.preventDefault(),h=p?_:m,h.focus();return}u.preventDefault(),h.focus()}}t.exports=e.default})(df,df.exports);var AT=df.exports,Sn={},vn={},Y0={exports:{}};/*! + */var n="none",r="contents",i=/input|select|textarea|button|object|iframe/;function o(p,m){return m.getPropertyValue("overflow")!=="visible"||p.scrollWidth<=0&&p.scrollHeight<=0}function l(p){var m=p.offsetWidth<=0&&p.offsetHeight<=0;if(m&&!p.innerHTML)return!0;try{var _=window.getComputedStyle(p),g=_.getPropertyValue("display");return m?g!==r&&o(p,_):g===n}catch{return console.warn("Failed to inspect element style"),!1}}function a(p){for(var m=p,_=p.getRootNode&&p.getRootNode();m&&m!==document.body;){if(_&&m===_&&(m=_.host.parentNode),l(m))return!1;m=m.parentNode}return!0}function u(p,m){var _=p.nodeName.toLowerCase(),g=i.test(_)&&!p.disabled||_==="a"&&p.href||m;return g&&a(p)}function f(p){var m=p.getAttribute("tabindex");m===null&&(m=void 0);var _=isNaN(m);return(_||m>=0)&&u(p,!_)}function h(p){var m=[].slice.call(p.querySelectorAll("*"),0).reduce(function(_,g){return _.concat(g.shadowRoot?h(g.shadowRoot):[g])},[]);return m.filter(f)}t.exports=e.default})(ff,ff.exports);var Y0=ff.exports;Object.defineProperty(_n,"__esModule",{value:!0});_n.resetState=CT;_n.log=IT;_n.handleBlur=vs;_n.handleFocus=ys;_n.markForFocusLater=OT;_n.returnFocus=kT;_n.popWithoutFocus=PT;_n.setupScopedFocus=xT;_n.teardownScopedFocus=AT;var ET=Y0,bT=TT(ET);function TT(t){return t&&t.__esModule?t:{default:t}}var Xi=[],Ai=null,df=!1;function CT(){Xi=[]}function IT(){}function vs(){df=!0}function ys(){if(df){if(df=!1,!Ai)return;setTimeout(function(){if(!Ai.contains(document.activeElement)){var t=(0,bT.default)(Ai)[0]||Ai;t.focus()}},0)}}function OT(){Xi.push(document.activeElement)}function kT(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=null;try{Xi.length!==0&&(e=Xi.pop(),e.focus({preventScroll:t}));return}catch{console.warn(["You tried to return focus to",e,"but it is not in the DOM anymore"].join(" "))}}function PT(){Xi.length>0&&Xi.pop()}function xT(t){Ai=t,window.addEventListener?(window.addEventListener("blur",vs,!1),document.addEventListener("focus",ys,!0)):(window.attachEvent("onBlur",vs),document.attachEvent("onFocus",ys))}function AT(){Ai=null,window.addEventListener?(window.removeEventListener("blur",vs),document.removeEventListener("focus",ys)):(window.detachEvent("onBlur",vs),document.detachEvent("onFocus",ys))}var hf={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var n=Y0,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 l(a,u){var f=(0,r.default)(a);if(!f.length){u.preventDefault();return}var h=void 0,p=u.shiftKey,m=f[0],_=f[f.length-1],g=o();if(a===g){if(!p)return;h=_}if(_===g&&!p&&(h=m),m===g&&p&&(h=_),h){u.preventDefault(),h.focus();return}var P=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),D=P!=null&&P[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(D){var I=f.indexOf(g);if(I>-1&&(I+=p?-1:1),h=f[I],typeof h>"u"){u.preventDefault(),h=p?_:m,h.focus();return}u.preventDefault(),h.focus()}}t.exports=e.default})(hf,hf.exports);var RT=hf.exports,Sn={},vn={},Q0={exports:{}};/*! Copyright (c) 2015 Jed Watson. Based on code that is Copyright 2013-2015, Facebook, Inc. All rights reserved. -*/(function(t){(function(){var e=!!(typeof window<"u"&&window.document&&window.document.createElement),n={canUseDOM:e,canUseWorkers:typeof Worker<"u",canUseEventListeners:e&&!!(window.addEventListener||window.attachEvent),canUseViewport:e&&!!window.screen};t.exports?t.exports=n:window.ExecutionEnvironment=n})()})(Y0);var RT=Y0.exports;Object.defineProperty(vn,"__esModule",{value:!0});vn.canUseDOM=vn.SafeNodeList=vn.SafeHTMLCollection=void 0;var NT=RT,DT=MT(NT);function MT(t){return t&&t.__esModule?t:{default:t}}var tu=DT.default,LT=tu.canUseDOM?window.HTMLElement:{};vn.SafeHTMLCollection=tu.canUseDOM?window.HTMLCollection:{};vn.SafeNodeList=tu.canUseDOM?window.NodeList:{};vn.canUseDOM=tu.canUseDOM;vn.default=LT;Object.defineProperty(Sn,"__esModule",{value:!0});Sn.resetState=BT;Sn.log=zT;Sn.assertNodeList=Q0;Sn.setElement=$T;Sn.validateElement=Rd;Sn.hide=WT;Sn.show=HT;Sn.documentNotReadyOrSSRTesting=qT;var jT=vT,UT=VT(jT),FT=vn;function VT(t){return t&&t.__esModule?t:{default:t}}var Jt=null;function BT(){Jt&&(Jt.removeAttribute?Jt.removeAttribute("aria-hidden"):Jt.length!=null?Jt.forEach(function(t){return t.removeAttribute("aria-hidden")}):document.querySelectorAll(Jt).forEach(function(t){return t.removeAttribute("aria-hidden")})),Jt=null}function zT(){}function Q0(t,e){if(!t||!t.length)throw new Error("react-modal: No elements were found for selector "+e+".")}function $T(t){var e=t;if(typeof e=="string"&&FT.canUseDOM){var n=document.querySelectorAll(e);Q0(n,e),e=n}return Jt=e||Jt,Jt}function Rd(t){var e=t||Jt;return e?Array.isArray(e)||e instanceof HTMLCollection||e instanceof NodeList?e:[e]:((0,UT.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 WT(t){var e=!0,n=!1,r=void 0;try{for(var i=Rd(t)[Symbol.iterator](),o;!(e=(o=i.next()).done);e=!0){var l=o.value;l.setAttribute("aria-hidden","true")}}catch(a){n=!0,r=a}finally{try{!e&&i.return&&i.return()}finally{if(n)throw r}}}function HT(t){var e=!0,n=!1,r=void 0;try{for(var i=Rd(t)[Symbol.iterator](),o;!(e=(o=i.next()).done);e=!0){var l=o.value;l.removeAttribute("aria-hidden")}}catch(a){n=!0,r=a}finally{try{!e&&i.return&&i.return()}finally{if(n)throw r}}}function qT(){Jt=null}var ao={};Object.defineProperty(ao,"__esModule",{value:!0});ao.resetState=GT;ao.log=KT;var Xo={},Jo={};function gm(t,e){t.classList.remove(e)}function GT(){var t=document.getElementsByTagName("html")[0];for(var e in Xo)gm(t,Xo[e]);var n=document.body;for(var r in Jo)gm(n,Jo[r]);Xo={},Jo={}}function KT(){}var YT=function(e,n){return e[n]||(e[n]=0),e[n]+=1,n},QT=function(e,n){return e[n]&&(e[n]-=1),n},XT=function(e,n,r){r.forEach(function(i){YT(n,i),e.add(i)})},JT=function(e,n,r){r.forEach(function(i){QT(n,i),n[i]===0&&e.remove(i)})};ao.add=function(e,n){return XT(e.classList,e.nodeName.toLowerCase()=="html"?Xo:Jo,n.split(" "))};ao.remove=function(e,n){return JT(e.classList,e.nodeName.toLowerCase()=="html"?Xo:Jo,n.split(" "))};var lo={};Object.defineProperty(lo,"__esModule",{value:!0});lo.log=eC;lo.resetState=tC;function ZT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var X0=function t(){var e=this;ZT(this,t),this.register=function(n){e.openInstances.indexOf(n)===-1&&(e.openInstances.push(n),e.emit("register"))},this.deregister=function(n){var r=e.openInstances.indexOf(n);r!==-1&&(e.openInstances.splice(r,1),e.emit("deregister"))},this.subscribe=function(n){e.subscribers.push(n)},this.emit=function(n){e.subscribers.forEach(function(r){return r(n,e.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},wl=new X0;function eC(){console.log("portalOpenInstances ----------"),console.log(wl.openInstances.length),wl.openInstances.forEach(function(t){return console.log(t)}),console.log("end portalOpenInstances ----------")}function tC(){wl=new X0}lo.default=wl;var Nd={};Object.defineProperty(Nd,"__esModule",{value:!0});Nd.resetState=oC;Nd.log=sC;var nC=lo,rC=iC(nC);function iC(t){return t&&t.__esModule?t:{default:t}}var gt=void 0,fn=void 0,Jr=[];function oC(){for(var t=[gt,fn],e=0;e0?(document.body.firstChild!==gt&&document.body.insertBefore(gt,document.body.firstChild),document.body.lastChild!==fn&&document.body.appendChild(fn)):(gt.parentElement&>.parentElement.removeChild(gt),fn.parentElement&&fn.parentElement.removeChild(fn))}rC.default.subscribe(aC);(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(G){for(var Y=1;Y0&&(A-=1,A===0&&_.show(oe)),B.props.shouldFocusAfterRender&&(B.props.shouldReturnFocusAfterClose?(f.returnFocus(B.props.preventScroll),f.teardownScopedFocus()):f.popWithoutFocus()),B.props.onAfterClose&&B.props.onAfterClose(),E.default.deregister(B)},B.open=function(){B.beforeOpen(),B.state.afterOpen&&B.state.beforeClose?(clearTimeout(B.closeTimer),B.setState({beforeClose:!1})):(B.props.shouldFocusAfterRender&&(f.setupScopedFocus(B.node),f.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){C(W)&&(0,p.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,oe){var le=(typeof oe>"u"?"undefined":r(oe))==="object"?oe:{base:b[W],afterOpen:b[W]+"--after-open",beforeClose:b[W]+"--before-close"},ve=le.base;return B.state.afterOpen&&(ve=ve+" "+le.afterOpen),B.state.beforeClose&&(ve=ve+" "+le.beforeClose),typeof oe=="string"&&oe?ve+" "+oe:ve},B.attributesFromObject=function(W,oe){return Object.keys(oe).reduce(function(le,ve){return le[W+"-"+ve]=oe[ve],le},{})},B.state={afterOpen:!1,beforeClose:!1},B.shouldClose=null,B.moveFromContentToOverlay=null,B}return i(Y,[{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,oe=B.ariaHideApp,le=B.htmlOpenClassName,ve=B.bodyOpenClassName,we=B.parentSelector,_e=we&&we().ownerDocument||document;ve&&P.add(_e.body,ve),le&&P.add(_e.getElementsByTagName("html")[0],le),oe&&(A+=1,_.hide(W)),E.default.register(this)}},{key:"render",value:function(){var B=this.props,W=B.id,oe=B.className,le=B.overlayClassName,ve=B.defaultStyles,we=B.children,_e=oe?{}:ve.content,Be=le?{}:ve.overlay;if(this.shouldBeClosed())return null;var Me={ref:this.setOverlayRef,className:this.buildClassName("overlay",le),style:n({},Be,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},Re=n({id:W,ref:this.setContentRef,style:n({},_e,this.props.style.content),className:this.buildClassName("content",oe),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}),ze=this.props.contentElement(Re,we);return this.props.overlayElement(Me,ze)}}]),Y}(o.Component);v.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},v.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(I.default),a.default.instanceOf(D.SafeHTMLCollection),a.default.instanceOf(D.SafeNodeList),a.default.arrayOf(a.default.instanceOf(I.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},e.default=v,t.exports=e.default})(uf,uf.exports);var lC=uf.exports;const uC=fg(lT);Object.defineProperty(oi,"__esModule",{value:!0});oi.bodyOpenClassName=oi.portalClassName=void 0;var ym=Object.assign||function(t){for(var e=1;e{Ji.setAppElement("#root");const t=ee.useRef(),{user:e,setUser:n}=ee.useContext(an),[r,i]=ee.useState(!0),[o,l]=ee.useState([]),a=h=>{i(!h),u()},u=h=>{const p=[...o];h!=null&&h.target&&(p.push(new Qi({category_name:h.target.name,category_id:h.target.id})),l(p))},f=()=>{e.categories=o.map(p=>new Qi(p));const h=new $t(e);n(h),a(r)};return U.jsx("div",{className:"source-type",children:U.jsxs(Ji,{isOpen:r,className:"modal-content",overlayClassName:"modal-overlay","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var h;return(h=t.current)==null?void 0:h.focus()},0)},children:[U.jsx("h2",{id:"source-type-dialog-label",children:"Select Your Categories"})," ",U.jsx("header",{}),U.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:bC.map((h,p)=>U.jsx("li",{className:"source-type-modal__list-item",children:U.jsxs("label",{children:[U.jsx("input",{type:"checkbox",onChange:u,name:h.category_name,ref:p===0?t:null,id:h.category_id}),h.category_name]})},h.category_id))}),U.jsx("div",{className:"source-type-modal__controls",children:U.jsx("button",{value:"apply",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:f,children:"Apply"})})]})})};var Tm={};/** +*/(function(t){(function(){var e=!!(typeof window<"u"&&window.document&&window.document.createElement),n={canUseDOM:e,canUseWorkers:typeof Worker<"u",canUseEventListeners:e&&!!(window.addEventListener||window.attachEvent),canUseViewport:e&&!!window.screen};t.exports?t.exports=n:window.ExecutionEnvironment=n})()})(Q0);var NT=Q0.exports;Object.defineProperty(vn,"__esModule",{value:!0});vn.canUseDOM=vn.SafeNodeList=vn.SafeHTMLCollection=void 0;var DT=NT,MT=LT(DT);function LT(t){return t&&t.__esModule?t:{default:t}}var nu=MT.default,jT=nu.canUseDOM?window.HTMLElement:{};vn.SafeHTMLCollection=nu.canUseDOM?window.HTMLCollection:{};vn.SafeNodeList=nu.canUseDOM?window.NodeList:{};vn.canUseDOM=nu.canUseDOM;vn.default=jT;Object.defineProperty(Sn,"__esModule",{value:!0});Sn.resetState=zT;Sn.log=$T;Sn.assertNodeList=X0;Sn.setElement=WT;Sn.validateElement=Nd;Sn.hide=HT;Sn.show=qT;Sn.documentNotReadyOrSSRTesting=GT;var UT=yT,FT=BT(UT),VT=vn;function BT(t){return t&&t.__esModule?t:{default:t}}var Jt=null;function zT(){Jt&&(Jt.removeAttribute?Jt.removeAttribute("aria-hidden"):Jt.length!=null?Jt.forEach(function(t){return t.removeAttribute("aria-hidden")}):document.querySelectorAll(Jt).forEach(function(t){return t.removeAttribute("aria-hidden")})),Jt=null}function $T(){}function X0(t,e){if(!t||!t.length)throw new Error("react-modal: No elements were found for selector "+e+".")}function WT(t){var e=t;if(typeof e=="string"&&VT.canUseDOM){var n=document.querySelectorAll(e);X0(n,e),e=n}return Jt=e||Jt,Jt}function Nd(t){var e=t||Jt;return e?Array.isArray(e)||e instanceof HTMLCollection||e instanceof NodeList?e:[e]:((0,FT.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 HT(t){var e=!0,n=!1,r=void 0;try{for(var i=Nd(t)[Symbol.iterator](),o;!(e=(o=i.next()).done);e=!0){var l=o.value;l.setAttribute("aria-hidden","true")}}catch(a){n=!0,r=a}finally{try{!e&&i.return&&i.return()}finally{if(n)throw r}}}function qT(t){var e=!0,n=!1,r=void 0;try{for(var i=Nd(t)[Symbol.iterator](),o;!(e=(o=i.next()).done);e=!0){var l=o.value;l.removeAttribute("aria-hidden")}}catch(a){n=!0,r=a}finally{try{!e&&i.return&&i.return()}finally{if(n)throw r}}}function GT(){Jt=null}var ao={};Object.defineProperty(ao,"__esModule",{value:!0});ao.resetState=KT;ao.log=YT;var Xo={},Jo={};function vm(t,e){t.classList.remove(e)}function KT(){var t=document.getElementsByTagName("html")[0];for(var e in Xo)vm(t,Xo[e]);var n=document.body;for(var r in Jo)vm(n,Jo[r]);Xo={},Jo={}}function YT(){}var QT=function(e,n){return e[n]||(e[n]=0),e[n]+=1,n},XT=function(e,n){return e[n]&&(e[n]-=1),n},JT=function(e,n,r){r.forEach(function(i){QT(n,i),e.add(i)})},ZT=function(e,n,r){r.forEach(function(i){XT(n,i),n[i]===0&&e.remove(i)})};ao.add=function(e,n){return JT(e.classList,e.nodeName.toLowerCase()=="html"?Xo:Jo,n.split(" "))};ao.remove=function(e,n){return ZT(e.classList,e.nodeName.toLowerCase()=="html"?Xo:Jo,n.split(" "))};var lo={};Object.defineProperty(lo,"__esModule",{value:!0});lo.log=tC;lo.resetState=nC;function eC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var J0=function t(){var e=this;eC(this,t),this.register=function(n){e.openInstances.indexOf(n)===-1&&(e.openInstances.push(n),e.emit("register"))},this.deregister=function(n){var r=e.openInstances.indexOf(n);r!==-1&&(e.openInstances.splice(r,1),e.emit("deregister"))},this.subscribe=function(n){e.subscribers.push(n)},this.emit=function(n){e.subscribers.forEach(function(r){return r(n,e.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},_l=new J0;function tC(){console.log("portalOpenInstances ----------"),console.log(_l.openInstances.length),_l.openInstances.forEach(function(t){return console.log(t)}),console.log("end portalOpenInstances ----------")}function nC(){_l=new J0}lo.default=_l;var Dd={};Object.defineProperty(Dd,"__esModule",{value:!0});Dd.resetState=sC;Dd.log=aC;var rC=lo,iC=oC(rC);function oC(t){return t&&t.__esModule?t:{default:t}}var gt=void 0,fn=void 0,Jr=[];function sC(){for(var t=[gt,fn],e=0;e0?(document.body.firstChild!==gt&&document.body.insertBefore(gt,document.body.firstChild),document.body.lastChild!==fn&&document.body.appendChild(fn)):(gt.parentElement&>.parentElement.removeChild(gt),fn.parentElement&&fn.parentElement.removeChild(fn))}iC.default.subscribe(lC);(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(G){for(var Y=1;Y0&&(A-=1,A===0&&_.show(oe)),B.props.shouldFocusAfterRender&&(B.props.shouldReturnFocusAfterClose?(f.returnFocus(B.props.preventScroll),f.teardownScopedFocus()):f.popWithoutFocus()),B.props.onAfterClose&&B.props.onAfterClose(),E.default.deregister(B)},B.open=function(){B.beforeOpen(),B.state.afterOpen&&B.state.beforeClose?(clearTimeout(B.closeTimer),B.setState({beforeClose:!1})):(B.props.shouldFocusAfterRender&&(f.setupScopedFocus(B.node),f.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){C(W)&&(0,p.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,oe){var le=(typeof oe>"u"?"undefined":r(oe))==="object"?oe:{base:b[W],afterOpen:b[W]+"--after-open",beforeClose:b[W]+"--before-close"},ve=le.base;return B.state.afterOpen&&(ve=ve+" "+le.afterOpen),B.state.beforeClose&&(ve=ve+" "+le.beforeClose),typeof oe=="string"&&oe?ve+" "+oe:ve},B.attributesFromObject=function(W,oe){return Object.keys(oe).reduce(function(le,ve){return le[W+"-"+ve]=oe[ve],le},{})},B.state={afterOpen:!1,beforeClose:!1},B.shouldClose=null,B.moveFromContentToOverlay=null,B}return i(Y,[{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,oe=B.ariaHideApp,le=B.htmlOpenClassName,ve=B.bodyOpenClassName,we=B.parentSelector,_e=we&&we().ownerDocument||document;ve&&P.add(_e.body,ve),le&&P.add(_e.getElementsByTagName("html")[0],le),oe&&(A+=1,_.hide(W)),E.default.register(this)}},{key:"render",value:function(){var B=this.props,W=B.id,oe=B.className,le=B.overlayClassName,ve=B.defaultStyles,we=B.children,_e=oe?{}:ve.content,Be=le?{}:ve.overlay;if(this.shouldBeClosed())return null;var Me={ref:this.setOverlayRef,className:this.buildClassName("overlay",le),style:n({},Be,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},Re=n({id:W,ref:this.setContentRef,style:n({},_e,this.props.style.content),className:this.buildClassName("content",oe),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}),ze=this.props.contentElement(Re,we);return this.props.overlayElement(Me,ze)}}]),Y}(o.Component);v.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},v.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(I.default),a.default.instanceOf(D.SafeHTMLCollection),a.default.instanceOf(D.SafeNodeList),a.default.arrayOf(a.default.instanceOf(I.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},e.default=v,t.exports=e.default})(cf,cf.exports);var uC=cf.exports;const cC=dg(uT);Object.defineProperty(oi,"__esModule",{value:!0});oi.bodyOpenClassName=oi.portalClassName=void 0;var wm=Object.assign||function(t){for(var e=1;e{Ji.setAppElement("#root");const t=ee.useRef(),{user:e,setUser:n}=ee.useContext(an),[r,i]=ee.useState(!0),[o,l]=ee.useState([]),a=h=>{i(!h),u()},u=h=>{const p=[...o];h!=null&&h.target&&(p.push(new Qi({category_name:h.target.name,category_id:h.target.id})),l(p))},f=()=>{e.categories=o.map(p=>new Qi(p));const h=new $t(e);n(h),a(r)};return j.jsx("div",{className:"source-type",children:j.jsxs(Ji,{isOpen:r,className:"modal-content",overlayClassName:"modal-overlay","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var h;return(h=t.current)==null?void 0:h.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:TC.map((h,p)=>j.jsx("li",{className:"source-type-modal__list-item",children:j.jsxs("label",{children:[j.jsx("input",{type:"checkbox",onChange:u,name:h.category_name,ref:p===0?t:null,id:h.category_id}),h.category_name]})},h.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:f,children:"Apply"})})]})})};var Cm={};/** * @license * Copyright 2017 Google LLC * @@ -79,7 +79,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 Z0=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},CC=function(t){const e=[];let n=0,r=0;for(;n191&&i<224){const o=t[n++];e[r++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){const o=t[n++],l=t[n++],a=t[n++],u=((i&7)<<18|(o&63)<<12|(l&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(u&1023))}else{const o=t[n++],l=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(o&63)<<6|l&63)}}return e.join("")},ew={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,p=(o&3)<<4|a>>4;let m=(a&15)<<2|f>>6,_=f&63;u||(_=64,l||(m=64)),r.push(n[h],n[p],n[m],n[_])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Z0(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):CC(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(m),f!==64){const _=a<<4&240|f>>2;if(r.push(_),p!==64){const g=f<<6&192|p;r.push(g)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class IC extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const OC=function(t){const e=Z0(t);return ew.encodeByteArray(e,!0)},El=function(t){return OC(t).replace(/\./g,"")},tw=function(t){try{return ew.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** + */const ew=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},IC=function(t){const e=[];let n=0,r=0;for(;n191&&i<224){const o=t[n++];e[r++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){const o=t[n++],l=t[n++],a=t[n++],u=((i&7)<<18|(o&63)<<12|(l&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(u&1023))}else{const o=t[n++],l=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(o&63)<<6|l&63)}}return e.join("")},tw={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,p=(o&3)<<4|a>>4;let m=(a&15)<<2|f>>6,_=f&63;u||(_=64,l||(m=64)),r.push(n[h],n[p],n[m],n[_])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(ew(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):IC(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(m),f!==64){const _=a<<4&240|f>>2;if(r.push(_),p!==64){const g=f<<6&192|p;r.push(g)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class OC extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const kC=function(t){const e=ew(t);return tw.encodeByteArray(e,!0)},bl=function(t){return kC(t).replace(/\./g,"")},nw=function(t){try{return tw.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** * @license * Copyright 2022 Google LLC * @@ -94,7 +94,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 kC(){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.")}/** + */function PC(){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 * @@ -109,7 +109,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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=()=>kC().__FIREBASE_DEFAULTS__,xC=()=>{if(typeof process>"u"||typeof Tm>"u")return;const t=Tm.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},AC=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&tw(t[1]);return e&&JSON.parse(e)},Dd=()=>{try{return PC()||xC()||AC()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},nw=t=>{var e,n;return(n=(e=Dd())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},RC=t=>{const e=nw(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},rw=()=>{var t;return(t=Dd())===null||t===void 0?void 0:t.config},iw=t=>{var e;return(e=Dd())===null||e===void 0?void 0:e[`_${t}`]};/** + */const xC=()=>PC().__FIREBASE_DEFAULTS__,AC=()=>{if(typeof process>"u"||typeof Cm>"u")return;const t=Cm.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},RC=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&nw(t[1]);return e&&JSON.parse(e)},Md=()=>{try{return xC()||AC()||RC()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},rw=t=>{var e,n;return(n=(e=Md())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},NC=t=>{const e=rw(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},iw=()=>{var t;return(t=Md())===null||t===void 0?void 0:t.config},ow=t=>{var e;return(e=Md())===null||e===void 0?void 0:e[`_${t}`]};/** * @license * Copyright 2017 Google LLC * @@ -124,7 +124,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 NC{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/** + */class DC{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/** * @license * Copyright 2021 Google LLC * @@ -139,7 +139,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 DC(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,o=t.sub||t.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const l=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:{}}},t);return[El(JSON.stringify(n)),El(JSON.stringify(l)),""].join(".")}/** + */function MC(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,o=t.sub||t.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const l=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:{}}},t);return[bl(JSON.stringify(n)),bl(JSON.stringify(l)),""].join(".")}/** * @license * Copyright 2017 Google LLC * @@ -154,7 +154,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 Tt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function MC(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Tt())}function LC(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function jC(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function UC(){const t=Tt();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function FC(){try{return typeof indexedDB=="object"}catch{return!1}}function VC(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var o;e(((o=i.error)===null||o===void 0?void 0:o.message)||"")}}catch(n){e(n)}})}/** + */function Tt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function LC(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Tt())}function jC(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function UC(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function FC(){const t=Tt();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function VC(){try{return typeof indexedDB=="object"}catch{return!1}}function BC(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var o;e(((o=i.error)===null||o===void 0?void 0:o.message)||"")}}catch(n){e(n)}})}/** * @license * Copyright 2017 Google LLC * @@ -169,7 +169,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 BC="FirebaseError";class Zn extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=BC,Object.setPrototypeOf(this,Zn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Ns.prototype.create)}}class Ns{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},i=`${this.service}/${e}`,o=this.errors[e],l=o?zC(o,r):"Error",a=`${this.serviceName}: ${l} (${i}).`;return new Zn(i,a,r)}}function zC(t,e){return t.replace($C,(n,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const $C=/\{\$([^}]+)}/g;function WC(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function bl(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const o=t[i],l=e[i];if(Cm(o)&&Cm(l)){if(!bl(o,l))return!1}else if(o!==l)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function Cm(t){return t!==null&&typeof t=="object"}/** + */const zC="FirebaseError";class Zn extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=zC,Object.setPrototypeOf(this,Zn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Ns.prototype.create)}}class Ns{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},i=`${this.service}/${e}`,o=this.errors[e],l=o?$C(o,r):"Error",a=`${this.serviceName}: ${l} (${i}).`;return new Zn(i,a,r)}}function $C(t,e){return t.replace(WC,(n,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const WC=/\{\$([^}]+)}/g;function HC(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Tl(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const o=t[i],l=e[i];if(Im(o)&&Im(l)){if(!Tl(o,l))return!1}else if(o!==l)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function Im(t){return t!==null&&typeof t=="object"}/** * @license * Copyright 2017 Google LLC * @@ -184,7 +184,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 Ds(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function HC(t,e){const n=new qC(t,e);return n.subscribe.bind(n)}class qC{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");GC(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=ec),i.error===void 0&&(i.error=ec),i.complete===void 0&&(i.complete=ec);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(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function GC(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function ec(){}/** + */function Ds(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function qC(t,e){const n=new GC(t,e);return n.subscribe.bind(n)}class GC{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");KC(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=tc),i.error===void 0&&(i.error=tc),i.complete===void 0&&(i.complete=tc);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(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function KC(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function tc(){}/** * @license * Copyright 2021 Google LLC * @@ -229,7 +229,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 KC{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new NC;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(n=e==null?void 0:e.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(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(QC(e))try{this.getOrInitializeService({instanceIdentifier:Wr})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const o=this.getOrInitializeService({instanceIdentifier:i});r.resolve(o)}catch{}}}}clearInstance(e=Wr){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Wr){return this.instances.has(e)}getOptions(e=Wr){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[o,l]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(o);r===a&&l.resolve(i)}return i}onInit(e,n){var r;const i=this.normalizeInstanceIdentifier(n),o=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;o.add(e),this.onInitCallbacks.set(i,o);const l=this.instances.get(i);return l&&e(l,i),()=>{o.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:YC(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=Wr){return this.component?this.component.multipleInstances?e:Wr:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function YC(t){return t===Wr?void 0:t}function QC(t){return t.instantiationMode==="EAGER"}/** + */class YC{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new DC;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(n=e==null?void 0:e.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(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(XC(e))try{this.getOrInitializeService({instanceIdentifier:Wr})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const o=this.getOrInitializeService({instanceIdentifier:i});r.resolve(o)}catch{}}}}clearInstance(e=Wr){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Wr){return this.instances.has(e)}getOptions(e=Wr){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[o,l]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(o);r===a&&l.resolve(i)}return i}onInit(e,n){var r;const i=this.normalizeInstanceIdentifier(n),o=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;o.add(e),this.onInitCallbacks.set(i,o);const l=this.instances.get(i);return l&&e(l,i),()=>{o.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:QC(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=Wr){return this.component?this.component.multipleInstances?e:Wr:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function QC(t){return t===Wr?void 0:t}function XC(t){return t.instantiationMode==="EAGER"}/** * @license * Copyright 2019 Google LLC * @@ -244,7 +244,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 XC{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new KC(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/** + */class JC{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new YC(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/** * @license * Copyright 2017 Google LLC * @@ -259,7 +259,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 xe;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(xe||(xe={}));const JC={debug:xe.DEBUG,verbose:xe.VERBOSE,info:xe.INFO,warn:xe.WARN,error:xe.ERROR,silent:xe.SILENT},ZC=xe.INFO,eI={[xe.DEBUG]:"log",[xe.VERBOSE]:"log",[xe.INFO]:"info",[xe.WARN]:"warn",[xe.ERROR]:"error"},tI=(t,e,...n)=>{if(ee.some(n=>t instanceof n);let Im,Om;function rI(){return Im||(Im=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function iI(){return Om||(Om=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const ow=new WeakMap,hf=new WeakMap,sw=new WeakMap,tc=new WeakMap,Ld=new WeakMap;function oI(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",o),t.removeEventListener("error",l)},o=()=>{n(Ir(t.result)),i()},l=()=>{r(t.error),i()};t.addEventListener("success",o),t.addEventListener("error",l)});return e.then(n=>{n instanceof IDBCursor&&ow.set(n,t)}).catch(()=>{}),Ld.set(e,t),e}function sI(t){if(hf.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",o),t.removeEventListener("error",l),t.removeEventListener("abort",l)},o=()=>{n(),i()},l=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",o),t.addEventListener("error",l),t.addEventListener("abort",l)});hf.set(t,e)}let pf={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return hf.get(t);if(e==="objectStoreNames")return t.objectStoreNames||sw.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Ir(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function aI(t){pf=t(pf)}function lI(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(nc(this),e,...n);return sw.set(r,e.sort?e.sort():[e]),Ir(r)}:iI().includes(t)?function(...e){return t.apply(nc(this),e),Ir(ow.get(this))}:function(...e){return Ir(t.apply(nc(this),e))}}function uI(t){return typeof t=="function"?lI(t):(t instanceof IDBTransaction&&sI(t),nI(t,rI())?new Proxy(t,pf):t)}function Ir(t){if(t instanceof IDBRequest)return oI(t);if(tc.has(t))return tc.get(t);const e=uI(t);return e!==t&&(tc.set(t,e),Ld.set(e,t)),e}const nc=t=>Ld.get(t);function cI(t,e,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const l=indexedDB.open(t,e),a=Ir(l);return r&&l.addEventListener("upgradeneeded",u=>{r(Ir(l.result),u.oldVersion,u.newVersion,Ir(l.transaction),u)}),n&&l.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),a.then(u=>{o&&u.addEventListener("close",()=>o()),i&&u.addEventListener("versionchange",f=>i(f.oldVersion,f.newVersion,f))}).catch(()=>{}),a}const fI=["get","getKey","getAll","getAllKeys","count"],dI=["put","add","delete","clear"],rc=new Map;function km(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(rc.get(e))return rc.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=dI.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||fI.includes(n)))return;const o=async function(l,...a){const u=this.transaction(l,i?"readwrite":"readonly");let f=u.store;return r&&(f=f.index(a.shift())),(await Promise.all([f[n](...a),i&&u.done]))[0]};return rc.set(e,o),o}aI(t=>({...t,get:(e,n,r)=>km(e,n)||t.get(e,n,r),has:(e,n)=>!!km(e,n)||t.has(e,n)}));/** + */var xe;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(xe||(xe={}));const ZC={debug:xe.DEBUG,verbose:xe.VERBOSE,info:xe.INFO,warn:xe.WARN,error:xe.ERROR,silent:xe.SILENT},eI=xe.INFO,tI={[xe.DEBUG]:"log",[xe.VERBOSE]:"log",[xe.INFO]:"info",[xe.WARN]:"warn",[xe.ERROR]:"error"},nI=(t,e,...n)=>{if(ee.some(n=>t instanceof n);let Om,km;function iI(){return Om||(Om=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function oI(){return km||(km=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const sw=new WeakMap,pf=new WeakMap,aw=new WeakMap,nc=new WeakMap,jd=new WeakMap;function sI(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",o),t.removeEventListener("error",l)},o=()=>{n(Ir(t.result)),i()},l=()=>{r(t.error),i()};t.addEventListener("success",o),t.addEventListener("error",l)});return e.then(n=>{n instanceof IDBCursor&&sw.set(n,t)}).catch(()=>{}),jd.set(e,t),e}function aI(t){if(pf.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",o),t.removeEventListener("error",l),t.removeEventListener("abort",l)},o=()=>{n(),i()},l=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",o),t.addEventListener("error",l),t.addEventListener("abort",l)});pf.set(t,e)}let mf={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return pf.get(t);if(e==="objectStoreNames")return t.objectStoreNames||aw.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Ir(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function lI(t){mf=t(mf)}function uI(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(rc(this),e,...n);return aw.set(r,e.sort?e.sort():[e]),Ir(r)}:oI().includes(t)?function(...e){return t.apply(rc(this),e),Ir(sw.get(this))}:function(...e){return Ir(t.apply(rc(this),e))}}function cI(t){return typeof t=="function"?uI(t):(t instanceof IDBTransaction&&aI(t),rI(t,iI())?new Proxy(t,mf):t)}function Ir(t){if(t instanceof IDBRequest)return sI(t);if(nc.has(t))return nc.get(t);const e=cI(t);return e!==t&&(nc.set(t,e),jd.set(e,t)),e}const rc=t=>jd.get(t);function fI(t,e,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const l=indexedDB.open(t,e),a=Ir(l);return r&&l.addEventListener("upgradeneeded",u=>{r(Ir(l.result),u.oldVersion,u.newVersion,Ir(l.transaction),u)}),n&&l.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),a.then(u=>{o&&u.addEventListener("close",()=>o()),i&&u.addEventListener("versionchange",f=>i(f.oldVersion,f.newVersion,f))}).catch(()=>{}),a}const dI=["get","getKey","getAll","getAllKeys","count"],hI=["put","add","delete","clear"],ic=new Map;function Pm(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(ic.get(e))return ic.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=hI.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||dI.includes(n)))return;const o=async function(l,...a){const u=this.transaction(l,i?"readwrite":"readonly");let f=u.store;return r&&(f=f.index(a.shift())),(await Promise.all([f[n](...a),i&&u.done]))[0]};return ic.set(e,o),o}lI(t=>({...t,get:(e,n,r)=>Pm(e,n)||t.get(e,n,r),has:(e,n)=>!!Pm(e,n)||t.has(e,n)}));/** * @license * Copyright 2019 Google LLC * @@ -274,7 +274,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 hI{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(pI(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function pI(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const mf="@firebase/app",Pm="0.10.5";/** + */class pI{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(mI(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function mI(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const gf="@firebase/app",xm="0.10.5";/** * @license * Copyright 2019 Google LLC * @@ -289,7 +289,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 ai=new Md("@firebase/app"),mI="@firebase/app-compat",gI="@firebase/analytics-compat",vI="@firebase/analytics",yI="@firebase/app-check-compat",wI="@firebase/app-check",_I="@firebase/auth",SI="@firebase/auth-compat",EI="@firebase/database",bI="@firebase/database-compat",TI="@firebase/functions",CI="@firebase/functions-compat",II="@firebase/installations",OI="@firebase/installations-compat",kI="@firebase/messaging",PI="@firebase/messaging-compat",xI="@firebase/performance",AI="@firebase/performance-compat",RI="@firebase/remote-config",NI="@firebase/remote-config-compat",DI="@firebase/storage",MI="@firebase/storage-compat",LI="@firebase/firestore",jI="@firebase/vertexai-preview",UI="@firebase/firestore-compat",FI="firebase",VI="10.12.2";/** + */const ai=new Ld("@firebase/app"),gI="@firebase/app-compat",vI="@firebase/analytics-compat",yI="@firebase/analytics",wI="@firebase/app-check-compat",_I="@firebase/app-check",SI="@firebase/auth",EI="@firebase/auth-compat",bI="@firebase/database",TI="@firebase/database-compat",CI="@firebase/functions",II="@firebase/functions-compat",OI="@firebase/installations",kI="@firebase/installations-compat",PI="@firebase/messaging",xI="@firebase/messaging-compat",AI="@firebase/performance",RI="@firebase/performance-compat",NI="@firebase/remote-config",DI="@firebase/remote-config-compat",MI="@firebase/storage",LI="@firebase/storage-compat",jI="@firebase/firestore",UI="@firebase/vertexai-preview",FI="@firebase/firestore-compat",VI="firebase",BI="10.12.2";/** * @license * Copyright 2019 Google LLC * @@ -304,7 +304,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 gf="[DEFAULT]",BI={[mf]:"fire-core",[mI]:"fire-core-compat",[vI]:"fire-analytics",[gI]:"fire-analytics-compat",[wI]:"fire-app-check",[yI]:"fire-app-check-compat",[_I]:"fire-auth",[SI]:"fire-auth-compat",[EI]:"fire-rtdb",[bI]:"fire-rtdb-compat",[TI]:"fire-fn",[CI]:"fire-fn-compat",[II]:"fire-iid",[OI]:"fire-iid-compat",[kI]:"fire-fcm",[PI]:"fire-fcm-compat",[xI]:"fire-perf",[AI]:"fire-perf-compat",[RI]:"fire-rc",[NI]:"fire-rc-compat",[DI]:"fire-gcs",[MI]:"fire-gcs-compat",[LI]:"fire-fst",[UI]:"fire-fst-compat",[jI]:"fire-vertex","fire-js":"fire-js",[FI]:"fire-js-all"};/** + */const vf="[DEFAULT]",zI={[gf]:"fire-core",[gI]:"fire-core-compat",[yI]:"fire-analytics",[vI]:"fire-analytics-compat",[_I]:"fire-app-check",[wI]:"fire-app-check-compat",[SI]:"fire-auth",[EI]:"fire-auth-compat",[bI]:"fire-rtdb",[TI]:"fire-rtdb-compat",[CI]:"fire-fn",[II]:"fire-fn-compat",[OI]:"fire-iid",[kI]:"fire-iid-compat",[PI]:"fire-fcm",[xI]:"fire-fcm-compat",[AI]:"fire-perf",[RI]:"fire-perf-compat",[NI]:"fire-rc",[DI]:"fire-rc-compat",[MI]:"fire-gcs",[LI]:"fire-gcs-compat",[jI]:"fire-fst",[FI]:"fire-fst-compat",[UI]:"fire-vertex","fire-js":"fire-js",[VI]:"fire-js-all"};/** * @license * Copyright 2019 Google LLC * @@ -319,7 +319,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 Tl=new Map,zI=new Map,vf=new Map;function xm(t,e){try{t.container.addComponent(e)}catch(n){ai.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Zi(t){const e=t.name;if(vf.has(e))return ai.debug(`There were multiple attempts to register component ${e}.`),!1;vf.set(e,t);for(const n of Tl.values())xm(n,t);for(const n of zI.values())xm(n,t);return!0}function jd(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function zn(t){return t.settings!==void 0}/** + */const Cl=new Map,$I=new Map,yf=new Map;function Am(t,e){try{t.container.addComponent(e)}catch(n){ai.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Zi(t){const e=t.name;if(yf.has(e))return ai.debug(`There were multiple attempts to register component ${e}.`),!1;yf.set(e,t);for(const n of Cl.values())Am(n,t);for(const n of $I.values())Am(n,t);return!0}function Ud(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function zn(t){return t.settings!==void 0}/** * @license * Copyright 2019 Google LLC * @@ -334,7 +334,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const $I={"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."},Or=new Ns("app","Firebase",$I);/** + */const WI={"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."},Or=new Ns("app","Firebase",WI);/** * @license * Copyright 2019 Google LLC * @@ -349,7 +349,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 WI{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new si("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Or.create("app-deleted",{appName:this._name})}}/** + */class HI{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new si("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Or.create("app-deleted",{appName:this._name})}}/** * @license * Copyright 2019 Google LLC * @@ -364,7 +364,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 uo=VI;function aw(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:gf,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw Or.create("bad-app-name",{appName:String(i)});if(n||(n=rw()),!n)throw Or.create("no-options");const o=Tl.get(i);if(o){if(bl(n,o.options)&&bl(r,o.config))return o;throw Or.create("duplicate-app",{appName:i})}const l=new XC(i);for(const u of vf.values())l.addComponent(u);const a=new WI(n,r,l);return Tl.set(i,a),a}function lw(t=gf){const e=Tl.get(t);if(!e&&t===gf&&rw())return aw();if(!e)throw Or.create("no-app",{appName:t});return e}function kr(t,e,n){var r;let i=(r=BI[t])!==null&&r!==void 0?r:t;n&&(i+=`-${n}`);const o=i.match(/\s|\//),l=e.match(/\s|\//);if(o||l){const a=[`Unable to register library "${i}" with version "${e}":`];o&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&l&&a.push("and"),l&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ai.warn(a.join(" "));return}Zi(new si(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/** + */const uo=BI;function lw(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:vf,automaticDataCollectionEnabled:!1},e),i=r.name;if(typeof i!="string"||!i)throw Or.create("bad-app-name",{appName:String(i)});if(n||(n=iw()),!n)throw Or.create("no-options");const o=Cl.get(i);if(o){if(Tl(n,o.options)&&Tl(r,o.config))return o;throw Or.create("duplicate-app",{appName:i})}const l=new JC(i);for(const u of yf.values())l.addComponent(u);const a=new HI(n,r,l);return Cl.set(i,a),a}function uw(t=vf){const e=Cl.get(t);if(!e&&t===vf&&iw())return lw();if(!e)throw Or.create("no-app",{appName:t});return e}function kr(t,e,n){var r;let i=(r=zI[t])!==null&&r!==void 0?r:t;n&&(i+=`-${n}`);const o=i.match(/\s|\//),l=e.match(/\s|\//);if(o||l){const a=[`Unable to register library "${i}" with version "${e}":`];o&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&l&&a.push("and"),l&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ai.warn(a.join(" "));return}Zi(new si(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/** * @license * Copyright 2021 Google LLC * @@ -379,7 +379,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 HI="firebase-heartbeat-database",qI=1,ws="firebase-heartbeat-store";let ic=null;function uw(){return ic||(ic=cI(HI,qI,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(ws)}catch(n){console.warn(n)}}}}).catch(t=>{throw Or.create("idb-open",{originalErrorMessage:t.message})})),ic}async function GI(t){try{const n=(await uw()).transaction(ws),r=await n.objectStore(ws).get(cw(t));return await n.done,r}catch(e){if(e instanceof Zn)ai.warn(e.message);else{const n=Or.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});ai.warn(n.message)}}}async function Am(t,e){try{const r=(await uw()).transaction(ws,"readwrite");await r.objectStore(ws).put(e,cw(t)),await r.done}catch(n){if(n instanceof Zn)ai.warn(n.message);else{const r=Or.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});ai.warn(r.message)}}}function cw(t){return`${t.name}!${t.options.appId}`}/** + */const qI="firebase-heartbeat-database",GI=1,ws="firebase-heartbeat-store";let oc=null;function cw(){return oc||(oc=fI(qI,GI,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(ws)}catch(n){console.warn(n)}}}}).catch(t=>{throw Or.create("idb-open",{originalErrorMessage:t.message})})),oc}async function KI(t){try{const n=(await cw()).transaction(ws),r=await n.objectStore(ws).get(fw(t));return await n.done,r}catch(e){if(e instanceof Zn)ai.warn(e.message);else{const n=Or.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});ai.warn(n.message)}}}async function Rm(t,e){try{const r=(await cw()).transaction(ws,"readwrite");await r.objectStore(ws).put(e,fw(t)),await r.done}catch(n){if(n instanceof Zn)ai.warn(n.message);else{const r=Or.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});ai.warn(r.message)}}}function fw(t){return`${t.name}!${t.options.appId}`}/** * @license * Copyright 2021 Google LLC * @@ -394,7 +394,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 KI=1024,YI=30*24*60*60*1e3;class QI{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new JI(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=Rm();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.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(l=>l.date===o)))return this._heartbeatsCache.heartbeats.push({date:o,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(l=>{const a=new Date(l.date).valueOf();return Date.now()-a<=YI}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Rm(),{heartbeatsToSend:r,unsentEntries:i}=XI(this._heartbeatsCache.heartbeats),o=El(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 Rm(){return new Date().toISOString().substring(0,10)}function XI(t,e=KI){const n=[];let r=t.slice();for(const i of t){const o=n.find(l=>l.agent===i.agent);if(o){if(o.dates.push(i.date),Nm(n)>e){o.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Nm(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class JI{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return FC()?VC().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await GI(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return Am(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return Am(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function Nm(t){return El(JSON.stringify({version:2,heartbeats:t})).length}/** + */const YI=1024,QI=30*24*60*60*1e3;class XI{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new ZI(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=Nm();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.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(l=>l.date===o)))return this._heartbeatsCache.heartbeats.push({date:o,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(l=>{const a=new Date(l.date).valueOf();return Date.now()-a<=QI}),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Nm(),{heartbeatsToSend:r,unsentEntries:i}=JI(this._heartbeatsCache.heartbeats),o=bl(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 Nm(){return new Date().toISOString().substring(0,10)}function JI(t,e=YI){const n=[];let r=t.slice();for(const i of t){const o=n.find(l=>l.agent===i.agent);if(o){if(o.dates.push(i.date),Dm(n)>e){o.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Dm(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class ZI{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return VC()?BC().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await KI(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return Rm(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return Rm(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function Dm(t){return bl(JSON.stringify({version:2,heartbeats:t})).length}/** * @license * Copyright 2019 Google LLC * @@ -409,7 +409,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT 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 ZI(t){Zi(new si("platform-logger",e=>new hI(e),"PRIVATE")),Zi(new si("heartbeat",e=>new QI(e),"PRIVATE")),kr(mf,Pm,t),kr(mf,Pm,"esm2017"),kr("fire-js","")}ZI("");var eO="firebase",tO="10.12.2";/** + */function eO(t){Zi(new si("platform-logger",e=>new pI(e),"PRIVATE")),Zi(new si("heartbeat",e=>new XI(e),"PRIVATE")),kr(gf,xm,t),kr(gf,xm,"esm2017"),kr("fire-js","")}eO("");var tO="firebase",nO="10.12.2";/** * @license * Copyright 2020 Google LLC * @@ -424,26 +424,26 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStat * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */kr(eO,tO,"app");var Dm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license + */kr(tO,nO,"app");var Mm=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 fw;(function(){var t;/** @license +*/var dw;(function(){var t;/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 -*/function e(T,w){function b(){}b.prototype=w.prototype,T.D=w.prototype,T.prototype=new b,T.prototype.constructor=T,T.C=function(C,N,A){for(var v=Array(arguments.length-2),G=2;GN;++N)C[N]=w.charCodeAt(b++)|w.charCodeAt(b++)<<8|w.charCodeAt(b++)<<16|w.charCodeAt(b++)<<24;else for(N=0;16>N;++N)C[N]=w[b++]|w[b++]<<8|w[b++]<<16|w[b++]<<24;w=T.g[0],b=T.g[1],N=T.g[2];var A=T.g[3],v=w+(A^b&(N^A))+C[0]+3614090360&4294967295;w=b+(v<<7&4294967295|v>>>25),v=A+(N^w&(b^N))+C[1]+3905402710&4294967295,A=w+(v<<12&4294967295|v>>>20),v=N+(b^A&(w^b))+C[2]+606105819&4294967295,N=A+(v<<17&4294967295|v>>>15),v=b+(w^N&(A^w))+C[3]+3250441966&4294967295,b=N+(v<<22&4294967295|v>>>10),v=w+(A^b&(N^A))+C[4]+4118548399&4294967295,w=b+(v<<7&4294967295|v>>>25),v=A+(N^w&(b^N))+C[5]+1200080426&4294967295,A=w+(v<<12&4294967295|v>>>20),v=N+(b^A&(w^b))+C[6]+2821735955&4294967295,N=A+(v<<17&4294967295|v>>>15),v=b+(w^N&(A^w))+C[7]+4249261313&4294967295,b=N+(v<<22&4294967295|v>>>10),v=w+(A^b&(N^A))+C[8]+1770035416&4294967295,w=b+(v<<7&4294967295|v>>>25),v=A+(N^w&(b^N))+C[9]+2336552879&4294967295,A=w+(v<<12&4294967295|v>>>20),v=N+(b^A&(w^b))+C[10]+4294925233&4294967295,N=A+(v<<17&4294967295|v>>>15),v=b+(w^N&(A^w))+C[11]+2304563134&4294967295,b=N+(v<<22&4294967295|v>>>10),v=w+(A^b&(N^A))+C[12]+1804603682&4294967295,w=b+(v<<7&4294967295|v>>>25),v=A+(N^w&(b^N))+C[13]+4254626195&4294967295,A=w+(v<<12&4294967295|v>>>20),v=N+(b^A&(w^b))+C[14]+2792965006&4294967295,N=A+(v<<17&4294967295|v>>>15),v=b+(w^N&(A^w))+C[15]+1236535329&4294967295,b=N+(v<<22&4294967295|v>>>10),v=w+(N^A&(b^N))+C[1]+4129170786&4294967295,w=b+(v<<5&4294967295|v>>>27),v=A+(b^N&(w^b))+C[6]+3225465664&4294967295,A=w+(v<<9&4294967295|v>>>23),v=N+(w^b&(A^w))+C[11]+643717713&4294967295,N=A+(v<<14&4294967295|v>>>18),v=b+(A^w&(N^A))+C[0]+3921069994&4294967295,b=N+(v<<20&4294967295|v>>>12),v=w+(N^A&(b^N))+C[5]+3593408605&4294967295,w=b+(v<<5&4294967295|v>>>27),v=A+(b^N&(w^b))+C[10]+38016083&4294967295,A=w+(v<<9&4294967295|v>>>23),v=N+(w^b&(A^w))+C[15]+3634488961&4294967295,N=A+(v<<14&4294967295|v>>>18),v=b+(A^w&(N^A))+C[4]+3889429448&4294967295,b=N+(v<<20&4294967295|v>>>12),v=w+(N^A&(b^N))+C[9]+568446438&4294967295,w=b+(v<<5&4294967295|v>>>27),v=A+(b^N&(w^b))+C[14]+3275163606&4294967295,A=w+(v<<9&4294967295|v>>>23),v=N+(w^b&(A^w))+C[3]+4107603335&4294967295,N=A+(v<<14&4294967295|v>>>18),v=b+(A^w&(N^A))+C[8]+1163531501&4294967295,b=N+(v<<20&4294967295|v>>>12),v=w+(N^A&(b^N))+C[13]+2850285829&4294967295,w=b+(v<<5&4294967295|v>>>27),v=A+(b^N&(w^b))+C[2]+4243563512&4294967295,A=w+(v<<9&4294967295|v>>>23),v=N+(w^b&(A^w))+C[7]+1735328473&4294967295,N=A+(v<<14&4294967295|v>>>18),v=b+(A^w&(N^A))+C[12]+2368359562&4294967295,b=N+(v<<20&4294967295|v>>>12),v=w+(b^N^A)+C[5]+4294588738&4294967295,w=b+(v<<4&4294967295|v>>>28),v=A+(w^b^N)+C[8]+2272392833&4294967295,A=w+(v<<11&4294967295|v>>>21),v=N+(A^w^b)+C[11]+1839030562&4294967295,N=A+(v<<16&4294967295|v>>>16),v=b+(N^A^w)+C[14]+4259657740&4294967295,b=N+(v<<23&4294967295|v>>>9),v=w+(b^N^A)+C[1]+2763975236&4294967295,w=b+(v<<4&4294967295|v>>>28),v=A+(w^b^N)+C[4]+1272893353&4294967295,A=w+(v<<11&4294967295|v>>>21),v=N+(A^w^b)+C[7]+4139469664&4294967295,N=A+(v<<16&4294967295|v>>>16),v=b+(N^A^w)+C[10]+3200236656&4294967295,b=N+(v<<23&4294967295|v>>>9),v=w+(b^N^A)+C[13]+681279174&4294967295,w=b+(v<<4&4294967295|v>>>28),v=A+(w^b^N)+C[0]+3936430074&4294967295,A=w+(v<<11&4294967295|v>>>21),v=N+(A^w^b)+C[3]+3572445317&4294967295,N=A+(v<<16&4294967295|v>>>16),v=b+(N^A^w)+C[6]+76029189&4294967295,b=N+(v<<23&4294967295|v>>>9),v=w+(b^N^A)+C[9]+3654602809&4294967295,w=b+(v<<4&4294967295|v>>>28),v=A+(w^b^N)+C[12]+3873151461&4294967295,A=w+(v<<11&4294967295|v>>>21),v=N+(A^w^b)+C[15]+530742520&4294967295,N=A+(v<<16&4294967295|v>>>16),v=b+(N^A^w)+C[2]+3299628645&4294967295,b=N+(v<<23&4294967295|v>>>9),v=w+(N^(b|~A))+C[0]+4096336452&4294967295,w=b+(v<<6&4294967295|v>>>26),v=A+(b^(w|~N))+C[7]+1126891415&4294967295,A=w+(v<<10&4294967295|v>>>22),v=N+(w^(A|~b))+C[14]+2878612391&4294967295,N=A+(v<<15&4294967295|v>>>17),v=b+(A^(N|~w))+C[5]+4237533241&4294967295,b=N+(v<<21&4294967295|v>>>11),v=w+(N^(b|~A))+C[12]+1700485571&4294967295,w=b+(v<<6&4294967295|v>>>26),v=A+(b^(w|~N))+C[3]+2399980690&4294967295,A=w+(v<<10&4294967295|v>>>22),v=N+(w^(A|~b))+C[10]+4293915773&4294967295,N=A+(v<<15&4294967295|v>>>17),v=b+(A^(N|~w))+C[1]+2240044497&4294967295,b=N+(v<<21&4294967295|v>>>11),v=w+(N^(b|~A))+C[8]+1873313359&4294967295,w=b+(v<<6&4294967295|v>>>26),v=A+(b^(w|~N))+C[15]+4264355552&4294967295,A=w+(v<<10&4294967295|v>>>22),v=N+(w^(A|~b))+C[6]+2734768916&4294967295,N=A+(v<<15&4294967295|v>>>17),v=b+(A^(N|~w))+C[13]+1309151649&4294967295,b=N+(v<<21&4294967295|v>>>11),v=w+(N^(b|~A))+C[4]+4149444226&4294967295,w=b+(v<<6&4294967295|v>>>26),v=A+(b^(w|~N))+C[11]+3174756917&4294967295,A=w+(v<<10&4294967295|v>>>22),v=N+(w^(A|~b))+C[2]+718787259&4294967295,N=A+(v<<15&4294967295|v>>>17),v=b+(A^(N|~w))+C[9]+3951481745&4294967295,T.g[0]=T.g[0]+w&4294967295,T.g[1]=T.g[1]+(N+(v<<21&4294967295|v>>>11))&4294967295,T.g[2]=T.g[2]+N&4294967295,T.g[3]=T.g[3]+A&4294967295}r.prototype.u=function(T,w){w===void 0&&(w=T.length);for(var b=w-this.blockSize,C=this.B,N=this.h,A=0;Athis.h?this.blockSize:2*this.blockSize)-this.h);T[0]=128;for(var w=1;ww;++w)for(var C=0;32>C;C+=8)T[b++]=this.g[w]>>>C&255;return T};function o(T,w){var b=a;return Object.prototype.hasOwnProperty.call(b,T)?b[T]:b[T]=w(T)}function l(T,w){this.h=w;for(var b=[],C=!0,N=T.length-1;0<=N;N--){var A=T[N]|0;C&&A==w||(b[N]=A,C=!1)}this.g=b}var a={};function u(T){return-128<=T&&128>T?o(T,function(w){return new l([w|0],0>w?-1:0)}):new l([T|0],0>T?-1:0)}function f(T){if(isNaN(T)||!isFinite(T))return p;if(0>T)return D(f(-T));for(var w=[],b=1,C=0;T>=b;C++)w[C]=T/b|0,b*=4294967296;return new l(w,0)}function h(T,w){if(T.length==0)throw Error("number format error: empty string");if(w=w||10,2>w||36A?(A=f(Math.pow(w,A)),C=C.j(A).add(f(v))):(C=C.j(b),C=C.add(f(v)))}return C}var p=u(0),m=u(1),_=u(16777216);t=l.prototype,t.m=function(){if(P(this))return-D(this).m();for(var T=0,w=1,b=0;bT||36>>0).toString(T);if(b=N,g(b))return A+C;for(;6>A.length;)A="0"+A;C=A+C}},t.i=function(T){return 0>T?0:T>>16)+(this.i(N)>>>16)+(T.i(N)>>>16);C=v>>>16,A&=65535,v&=65535,b[N]=v<<16|A}return new l(b,b[b.length-1]&-2147483648?-1:0)};function I(T,w){return T.add(D(w))}t.j=function(T){if(g(this)||g(T))return p;if(P(this))return P(T)?D(this).j(D(T)):D(D(this).j(T));if(P(T))return D(this.j(D(T)));if(0>this.l(_)&&0>T.l(_))return f(this.m()*T.m());for(var w=this.g.length+T.g.length,b=[],C=0;C<2*w;C++)b[C]=0;for(C=0;C>>16,v=this.i(C)&65535,G=T.i(N)>>>16,Y=T.i(N)&65535;b[2*C+2*N]+=v*Y,S(b,2*C+2*N),b[2*C+2*N+1]+=A*Y,S(b,2*C+2*N+1),b[2*C+2*N+1]+=v*G,S(b,2*C+2*N+1),b[2*C+2*N+2]+=A*G,S(b,2*C+2*N+2)}for(C=0;C>>16,T[w]&=65535,w++}function E(T,w){this.g=T,this.h=w}function M(T,w){if(g(w))throw Error("division by zero");if(g(T))return new E(p,p);if(P(T))return w=M(D(T),w),new E(D(w.g),D(w.h));if(P(w))return w=M(T,D(w)),new E(D(w.g),w.h);if(30=C.l(T);)b=F(b),C=F(C);var N=q(b,1),A=q(C,1);for(C=q(C,2),b=q(b,2);!g(C);){var v=A.add(C);0>=v.l(T)&&(N=N.add(b),A=v),C=q(C,1),b=q(b,1)}return w=I(T,N.j(w)),new E(N,w)}for(N=p;0<=T.l(w);){for(b=Math.max(1,Math.floor(T.m()/w.m())),C=Math.ceil(Math.log(b)/Math.LN2),C=48>=C?1:Math.pow(2,C-48),A=f(b),v=A.j(w);P(v)||0>>31;return new l(b,T.h)}function q(T,w){var b=w>>5;w%=32;for(var C=T.g.length-b,N=[],A=0;A>>w|T.i(A+b+1)<<32-w:T.i(A+b);return new l(N,T.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,l.prototype.add=l.prototype.add,l.prototype.multiply=l.prototype.j,l.prototype.modulo=l.prototype.A,l.prototype.compare=l.prototype.l,l.prototype.toNumber=l.prototype.m,l.prototype.toString=l.prototype.toString,l.prototype.getBits=l.prototype.i,l.fromNumber=f,l.fromString=h,fw=l}).apply(typeof Dm<"u"?Dm:typeof self<"u"?self:typeof window<"u"?window:{});var ya=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(s,c,d){return s==Array.prototype||s==Object.prototype||(s[c]=d.value),s};function n(s){s=[typeof globalThis=="object"&&globalThis,s,typeof window=="object"&&window,typeof self=="object"&&self,typeof ya=="object"&&ya];for(var c=0;cN;++N)C[N]=w.charCodeAt(b++)|w.charCodeAt(b++)<<8|w.charCodeAt(b++)<<16|w.charCodeAt(b++)<<24;else for(N=0;16>N;++N)C[N]=w[b++]|w[b++]<<8|w[b++]<<16|w[b++]<<24;w=T.g[0],b=T.g[1],N=T.g[2];var A=T.g[3],v=w+(A^b&(N^A))+C[0]+3614090360&4294967295;w=b+(v<<7&4294967295|v>>>25),v=A+(N^w&(b^N))+C[1]+3905402710&4294967295,A=w+(v<<12&4294967295|v>>>20),v=N+(b^A&(w^b))+C[2]+606105819&4294967295,N=A+(v<<17&4294967295|v>>>15),v=b+(w^N&(A^w))+C[3]+3250441966&4294967295,b=N+(v<<22&4294967295|v>>>10),v=w+(A^b&(N^A))+C[4]+4118548399&4294967295,w=b+(v<<7&4294967295|v>>>25),v=A+(N^w&(b^N))+C[5]+1200080426&4294967295,A=w+(v<<12&4294967295|v>>>20),v=N+(b^A&(w^b))+C[6]+2821735955&4294967295,N=A+(v<<17&4294967295|v>>>15),v=b+(w^N&(A^w))+C[7]+4249261313&4294967295,b=N+(v<<22&4294967295|v>>>10),v=w+(A^b&(N^A))+C[8]+1770035416&4294967295,w=b+(v<<7&4294967295|v>>>25),v=A+(N^w&(b^N))+C[9]+2336552879&4294967295,A=w+(v<<12&4294967295|v>>>20),v=N+(b^A&(w^b))+C[10]+4294925233&4294967295,N=A+(v<<17&4294967295|v>>>15),v=b+(w^N&(A^w))+C[11]+2304563134&4294967295,b=N+(v<<22&4294967295|v>>>10),v=w+(A^b&(N^A))+C[12]+1804603682&4294967295,w=b+(v<<7&4294967295|v>>>25),v=A+(N^w&(b^N))+C[13]+4254626195&4294967295,A=w+(v<<12&4294967295|v>>>20),v=N+(b^A&(w^b))+C[14]+2792965006&4294967295,N=A+(v<<17&4294967295|v>>>15),v=b+(w^N&(A^w))+C[15]+1236535329&4294967295,b=N+(v<<22&4294967295|v>>>10),v=w+(N^A&(b^N))+C[1]+4129170786&4294967295,w=b+(v<<5&4294967295|v>>>27),v=A+(b^N&(w^b))+C[6]+3225465664&4294967295,A=w+(v<<9&4294967295|v>>>23),v=N+(w^b&(A^w))+C[11]+643717713&4294967295,N=A+(v<<14&4294967295|v>>>18),v=b+(A^w&(N^A))+C[0]+3921069994&4294967295,b=N+(v<<20&4294967295|v>>>12),v=w+(N^A&(b^N))+C[5]+3593408605&4294967295,w=b+(v<<5&4294967295|v>>>27),v=A+(b^N&(w^b))+C[10]+38016083&4294967295,A=w+(v<<9&4294967295|v>>>23),v=N+(w^b&(A^w))+C[15]+3634488961&4294967295,N=A+(v<<14&4294967295|v>>>18),v=b+(A^w&(N^A))+C[4]+3889429448&4294967295,b=N+(v<<20&4294967295|v>>>12),v=w+(N^A&(b^N))+C[9]+568446438&4294967295,w=b+(v<<5&4294967295|v>>>27),v=A+(b^N&(w^b))+C[14]+3275163606&4294967295,A=w+(v<<9&4294967295|v>>>23),v=N+(w^b&(A^w))+C[3]+4107603335&4294967295,N=A+(v<<14&4294967295|v>>>18),v=b+(A^w&(N^A))+C[8]+1163531501&4294967295,b=N+(v<<20&4294967295|v>>>12),v=w+(N^A&(b^N))+C[13]+2850285829&4294967295,w=b+(v<<5&4294967295|v>>>27),v=A+(b^N&(w^b))+C[2]+4243563512&4294967295,A=w+(v<<9&4294967295|v>>>23),v=N+(w^b&(A^w))+C[7]+1735328473&4294967295,N=A+(v<<14&4294967295|v>>>18),v=b+(A^w&(N^A))+C[12]+2368359562&4294967295,b=N+(v<<20&4294967295|v>>>12),v=w+(b^N^A)+C[5]+4294588738&4294967295,w=b+(v<<4&4294967295|v>>>28),v=A+(w^b^N)+C[8]+2272392833&4294967295,A=w+(v<<11&4294967295|v>>>21),v=N+(A^w^b)+C[11]+1839030562&4294967295,N=A+(v<<16&4294967295|v>>>16),v=b+(N^A^w)+C[14]+4259657740&4294967295,b=N+(v<<23&4294967295|v>>>9),v=w+(b^N^A)+C[1]+2763975236&4294967295,w=b+(v<<4&4294967295|v>>>28),v=A+(w^b^N)+C[4]+1272893353&4294967295,A=w+(v<<11&4294967295|v>>>21),v=N+(A^w^b)+C[7]+4139469664&4294967295,N=A+(v<<16&4294967295|v>>>16),v=b+(N^A^w)+C[10]+3200236656&4294967295,b=N+(v<<23&4294967295|v>>>9),v=w+(b^N^A)+C[13]+681279174&4294967295,w=b+(v<<4&4294967295|v>>>28),v=A+(w^b^N)+C[0]+3936430074&4294967295,A=w+(v<<11&4294967295|v>>>21),v=N+(A^w^b)+C[3]+3572445317&4294967295,N=A+(v<<16&4294967295|v>>>16),v=b+(N^A^w)+C[6]+76029189&4294967295,b=N+(v<<23&4294967295|v>>>9),v=w+(b^N^A)+C[9]+3654602809&4294967295,w=b+(v<<4&4294967295|v>>>28),v=A+(w^b^N)+C[12]+3873151461&4294967295,A=w+(v<<11&4294967295|v>>>21),v=N+(A^w^b)+C[15]+530742520&4294967295,N=A+(v<<16&4294967295|v>>>16),v=b+(N^A^w)+C[2]+3299628645&4294967295,b=N+(v<<23&4294967295|v>>>9),v=w+(N^(b|~A))+C[0]+4096336452&4294967295,w=b+(v<<6&4294967295|v>>>26),v=A+(b^(w|~N))+C[7]+1126891415&4294967295,A=w+(v<<10&4294967295|v>>>22),v=N+(w^(A|~b))+C[14]+2878612391&4294967295,N=A+(v<<15&4294967295|v>>>17),v=b+(A^(N|~w))+C[5]+4237533241&4294967295,b=N+(v<<21&4294967295|v>>>11),v=w+(N^(b|~A))+C[12]+1700485571&4294967295,w=b+(v<<6&4294967295|v>>>26),v=A+(b^(w|~N))+C[3]+2399980690&4294967295,A=w+(v<<10&4294967295|v>>>22),v=N+(w^(A|~b))+C[10]+4293915773&4294967295,N=A+(v<<15&4294967295|v>>>17),v=b+(A^(N|~w))+C[1]+2240044497&4294967295,b=N+(v<<21&4294967295|v>>>11),v=w+(N^(b|~A))+C[8]+1873313359&4294967295,w=b+(v<<6&4294967295|v>>>26),v=A+(b^(w|~N))+C[15]+4264355552&4294967295,A=w+(v<<10&4294967295|v>>>22),v=N+(w^(A|~b))+C[6]+2734768916&4294967295,N=A+(v<<15&4294967295|v>>>17),v=b+(A^(N|~w))+C[13]+1309151649&4294967295,b=N+(v<<21&4294967295|v>>>11),v=w+(N^(b|~A))+C[4]+4149444226&4294967295,w=b+(v<<6&4294967295|v>>>26),v=A+(b^(w|~N))+C[11]+3174756917&4294967295,A=w+(v<<10&4294967295|v>>>22),v=N+(w^(A|~b))+C[2]+718787259&4294967295,N=A+(v<<15&4294967295|v>>>17),v=b+(A^(N|~w))+C[9]+3951481745&4294967295,T.g[0]=T.g[0]+w&4294967295,T.g[1]=T.g[1]+(N+(v<<21&4294967295|v>>>11))&4294967295,T.g[2]=T.g[2]+N&4294967295,T.g[3]=T.g[3]+A&4294967295}r.prototype.u=function(T,w){w===void 0&&(w=T.length);for(var b=w-this.blockSize,C=this.B,N=this.h,A=0;Athis.h?this.blockSize:2*this.blockSize)-this.h);T[0]=128;for(var w=1;ww;++w)for(var C=0;32>C;C+=8)T[b++]=this.g[w]>>>C&255;return T};function o(T,w){var b=a;return Object.prototype.hasOwnProperty.call(b,T)?b[T]:b[T]=w(T)}function l(T,w){this.h=w;for(var b=[],C=!0,N=T.length-1;0<=N;N--){var A=T[N]|0;C&&A==w||(b[N]=A,C=!1)}this.g=b}var a={};function u(T){return-128<=T&&128>T?o(T,function(w){return new l([w|0],0>w?-1:0)}):new l([T|0],0>T?-1:0)}function f(T){if(isNaN(T)||!isFinite(T))return p;if(0>T)return D(f(-T));for(var w=[],b=1,C=0;T>=b;C++)w[C]=T/b|0,b*=4294967296;return new l(w,0)}function h(T,w){if(T.length==0)throw Error("number format error: empty string");if(w=w||10,2>w||36A?(A=f(Math.pow(w,A)),C=C.j(A).add(f(v))):(C=C.j(b),C=C.add(f(v)))}return C}var p=u(0),m=u(1),_=u(16777216);t=l.prototype,t.m=function(){if(P(this))return-D(this).m();for(var T=0,w=1,b=0;bT||36>>0).toString(T);if(b=N,g(b))return A+C;for(;6>A.length;)A="0"+A;C=A+C}},t.i=function(T){return 0>T?0:T>>16)+(this.i(N)>>>16)+(T.i(N)>>>16);C=v>>>16,A&=65535,v&=65535,b[N]=v<<16|A}return new l(b,b[b.length-1]&-2147483648?-1:0)};function I(T,w){return T.add(D(w))}t.j=function(T){if(g(this)||g(T))return p;if(P(this))return P(T)?D(this).j(D(T)):D(D(this).j(T));if(P(T))return D(this.j(D(T)));if(0>this.l(_)&&0>T.l(_))return f(this.m()*T.m());for(var w=this.g.length+T.g.length,b=[],C=0;C<2*w;C++)b[C]=0;for(C=0;C>>16,v=this.i(C)&65535,G=T.i(N)>>>16,Y=T.i(N)&65535;b[2*C+2*N]+=v*Y,S(b,2*C+2*N),b[2*C+2*N+1]+=A*Y,S(b,2*C+2*N+1),b[2*C+2*N+1]+=v*G,S(b,2*C+2*N+1),b[2*C+2*N+2]+=A*G,S(b,2*C+2*N+2)}for(C=0;C>>16,T[w]&=65535,w++}function E(T,w){this.g=T,this.h=w}function M(T,w){if(g(w))throw Error("division by zero");if(g(T))return new E(p,p);if(P(T))return w=M(D(T),w),new E(D(w.g),D(w.h));if(P(w))return w=M(T,D(w)),new E(D(w.g),w.h);if(30=C.l(T);)b=F(b),C=F(C);var N=q(b,1),A=q(C,1);for(C=q(C,2),b=q(b,2);!g(C);){var v=A.add(C);0>=v.l(T)&&(N=N.add(b),A=v),C=q(C,1),b=q(b,1)}return w=I(T,N.j(w)),new E(N,w)}for(N=p;0<=T.l(w);){for(b=Math.max(1,Math.floor(T.m()/w.m())),C=Math.ceil(Math.log(b)/Math.LN2),C=48>=C?1:Math.pow(2,C-48),A=f(b),v=A.j(w);P(v)||0>>31;return new l(b,T.h)}function q(T,w){var b=w>>5;w%=32;for(var C=T.g.length-b,N=[],A=0;A>>w|T.i(A+b+1)<<32-w:T.i(A+b);return new l(N,T.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,l.prototype.add=l.prototype.add,l.prototype.multiply=l.prototype.j,l.prototype.modulo=l.prototype.A,l.prototype.compare=l.prototype.l,l.prototype.toNumber=l.prototype.m,l.prototype.toString=l.prototype.toString,l.prototype.getBits=l.prototype.i,l.fromNumber=f,l.fromString=h,dw=l}).apply(typeof Mm<"u"?Mm:typeof self<"u"?self:typeof window<"u"?window:{});var ya=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(s,c,d){return s==Array.prototype||s==Object.prototype||(s[c]=d.value),s};function n(s){s=[typeof globalThis=="object"&&globalThis,s,typeof window=="object"&&window,typeof self=="object"&&self,typeof ya=="object"&&ya];for(var c=0;c{throw s},0)}function v(){var s=oe;let c=null;return s.g&&(c=s.g,s.g=s.g.next,s.g||(s.h=null),c.next=null),c}class G{constructor(){this.h=this.g=null}add(c,d){const y=Y.get();y.set(c,d),this.h?this.h.next=y:this.g=y,this.h=y}}var Y=new I(()=>new me,s=>s.reset());class me{constructor(){this.next=this.g=this.h=null}set(c,d){this.h=c,this.g=d,this.next=null}reset(){this.next=this.g=this.h=null}}let B,W=!1,oe=new G,le=()=>{const s=a.Promise.resolve(void 0);B=()=>{s.then(ve)}};var ve=()=>{for(var s;s=v();){try{s.h.call(s.g)}catch(d){A(d)}var c=Y;c.j(s),100>c.h&&(c.h++,s.next=c.g,c.g=s)}W=!1};function we(){this.s=this.s,this.C=this.C}we.prototype.s=!1,we.prototype.ma=function(){this.s||(this.s=!0,this.N())},we.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function _e(s,c){this.type=s,this.g=this.target=c,this.defaultPrevented=!1}_e.prototype.h=function(){this.defaultPrevented=!0};var Be=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var s=!1,c=Object.defineProperty({},"passive",{get:function(){s=!0}});try{const d=()=>{};a.addEventListener("test",d,c),a.removeEventListener("test",d,c)}catch{}return s}();function Me(s,c){if(_e.call(this,s?s.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,s){var d=this.type=s.type,y=s.changedTouches&&s.changedTouches.length?s.changedTouches[0]:null;if(this.target=s.target||s.srcElement,this.g=c,c=s.relatedTarget){if(F){e:{try{M(c.nodeName);var V=!0;break e}catch{}V=!1}V||(c=null)}}else d=="mouseover"?c=s.fromElement:d=="mouseout"&&(c=s.toElement);this.relatedTarget=c,y?(this.clientX=y.clientX!==void 0?y.clientX:y.pageX,this.clientY=y.clientY!==void 0?y.clientY:y.pageY,this.screenX=y.screenX||0,this.screenY=y.screenY||0):(this.clientX=s.clientX!==void 0?s.clientX:s.pageX,this.clientY=s.clientY!==void 0?s.clientY:s.pageY,this.screenX=s.screenX||0,this.screenY=s.screenY||0),this.button=s.button,this.key=s.key||"",this.ctrlKey=s.ctrlKey,this.altKey=s.altKey,this.shiftKey=s.shiftKey,this.metaKey=s.metaKey,this.pointerId=s.pointerId||0,this.pointerType=typeof s.pointerType=="string"?s.pointerType:Re[s.pointerType]||"",this.state=s.state,this.i=s,s.defaultPrevented&&Me.aa.h.call(this)}}g(Me,_e);var Re={2:"touch",3:"pen",4:"mouse"};Me.prototype.h=function(){Me.aa.h.call(this);var s=this.i;s.preventDefault?s.preventDefault():s.returnValue=!1};var ze="closure_listenable_"+(1e6*Math.random()|0),O=0;function R(s,c,d,y,V){this.listener=s,this.proxy=null,this.src=c,this.type=d,this.capture=!!y,this.ha=V,this.key=++O,this.da=this.fa=!1}function L(s){s.da=!0,s.listener=null,s.proxy=null,s.src=null,s.ha=null}function x(s){this.src=s,this.g={},this.h=0}x.prototype.add=function(s,c,d,y,V){var H=s.toString();s=this.g[H],s||(s=this.g[H]=[],this.h++);var ne=$(s,c,y,V);return-1>>0);function te(s){return typeof s=="function"?s:(s[ae]||(s[ae]=function(c){return s.handleEvent(c)}),s[ae])}function se(){we.call(this),this.i=new x(this),this.M=this,this.F=null}g(se,we),se.prototype[ze]=!0,se.prototype.removeEventListener=function(s,c,d,y){j(this,s,c,d,y)};function re(s,c){var d,y=s.F;if(y)for(d=[];y;y=y.F)d.push(y);if(s=s.M,y=c.type||c,typeof c=="string")c=new _e(c,s);else if(c instanceof _e)c.target=c.target||s;else{var V=c;c=new _e(y,s),C(c,V)}if(V=!0,d)for(var H=d.length-1;0<=H;H--){var ne=c.g=d[H];V=Ce(ne,y,!0,c)&&V}if(ne=c.g=s,V=Ce(ne,y,!0,c)&&V,V=Ce(ne,y,!1,c)&&V,d)for(H=0;H{s.g=null,s.i&&(s.i=!1,We(s))},s.l);const c=s.h;s.h=null,s.m.apply(null,c)}class Se extends we{constructor(c,d){super(),this.m=c,this.l=d,this.h=null,this.i=!1,this.g=null}j(c){this.h=arguments,this.g?this.i=!0:We(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function he(s){we.call(this),this.h=s,this.g={}}g(he,we);var ft=[];function er(s){q(s.g,function(c,d){this.g.hasOwnProperty(d)&&z(c)},s),s.g={}}he.prototype.N=function(){he.aa.N.call(this),er(this)},he.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Rn=a.JSON.stringify,g_=a.JSON.parse,v_=class{stringify(s){return a.JSON.stringify(s,void 0)}parse(s){return a.JSON.parse(s,void 0)}};function au(){}au.prototype.h=null;function nh(s){return s.h||(s.h=s.i())}function y_(){}var fo={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function lu(){_e.call(this,"d")}g(lu,_e);function uu(){_e.call(this,"c")}g(uu,_e);var fi={},rh=null;function cu(){return rh=rh||new se}fi.La="serverreachability";function ih(s){_e.call(this,fi.La,s)}g(ih,_e);function ho(s){const c=cu();re(c,new ih(c))}fi.STAT_EVENT="statevent";function oh(s,c){_e.call(this,fi.STAT_EVENT,s),this.stat=c}g(oh,_e);function It(s){const c=cu();re(c,new oh(c,s))}fi.Ma="timingevent";function sh(s,c){_e.call(this,fi.Ma,s),this.size=c}g(sh,_e);function po(s,c){if(typeof s!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){s()},c)}function mo(){this.g=!0}mo.prototype.xa=function(){this.g=!1};function w_(s,c,d,y,V,H){s.info(function(){if(s.g)if(H)for(var ne="",Ne=H.split("&"),st=0;st{throw s},0)}function v(){var s=oe;let c=null;return s.g&&(c=s.g,s.g=s.g.next,s.g||(s.h=null),c.next=null),c}class G{constructor(){this.h=this.g=null}add(c,d){const y=Y.get();y.set(c,d),this.h?this.h.next=y:this.g=y,this.h=y}}var Y=new I(()=>new me,s=>s.reset());class me{constructor(){this.next=this.g=this.h=null}set(c,d){this.h=c,this.g=d,this.next=null}reset(){this.next=this.g=this.h=null}}let B,W=!1,oe=new G,le=()=>{const s=a.Promise.resolve(void 0);B=()=>{s.then(ve)}};var ve=()=>{for(var s;s=v();){try{s.h.call(s.g)}catch(d){A(d)}var c=Y;c.j(s),100>c.h&&(c.h++,s.next=c.g,c.g=s)}W=!1};function we(){this.s=this.s,this.C=this.C}we.prototype.s=!1,we.prototype.ma=function(){this.s||(this.s=!0,this.N())},we.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function _e(s,c){this.type=s,this.g=this.target=c,this.defaultPrevented=!1}_e.prototype.h=function(){this.defaultPrevented=!0};var Be=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var s=!1,c=Object.defineProperty({},"passive",{get:function(){s=!0}});try{const d=()=>{};a.addEventListener("test",d,c),a.removeEventListener("test",d,c)}catch{}return s}();function Me(s,c){if(_e.call(this,s?s.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,s){var d=this.type=s.type,y=s.changedTouches&&s.changedTouches.length?s.changedTouches[0]:null;if(this.target=s.target||s.srcElement,this.g=c,c=s.relatedTarget){if(F){e:{try{M(c.nodeName);var V=!0;break e}catch{}V=!1}V||(c=null)}}else d=="mouseover"?c=s.fromElement:d=="mouseout"&&(c=s.toElement);this.relatedTarget=c,y?(this.clientX=y.clientX!==void 0?y.clientX:y.pageX,this.clientY=y.clientY!==void 0?y.clientY:y.pageY,this.screenX=y.screenX||0,this.screenY=y.screenY||0):(this.clientX=s.clientX!==void 0?s.clientX:s.pageX,this.clientY=s.clientY!==void 0?s.clientY:s.pageY,this.screenX=s.screenX||0,this.screenY=s.screenY||0),this.button=s.button,this.key=s.key||"",this.ctrlKey=s.ctrlKey,this.altKey=s.altKey,this.shiftKey=s.shiftKey,this.metaKey=s.metaKey,this.pointerId=s.pointerId||0,this.pointerType=typeof s.pointerType=="string"?s.pointerType:Re[s.pointerType]||"",this.state=s.state,this.i=s,s.defaultPrevented&&Me.aa.h.call(this)}}g(Me,_e);var Re={2:"touch",3:"pen",4:"mouse"};Me.prototype.h=function(){Me.aa.h.call(this);var s=this.i;s.preventDefault?s.preventDefault():s.returnValue=!1};var ze="closure_listenable_"+(1e6*Math.random()|0),O=0;function R(s,c,d,y,V){this.listener=s,this.proxy=null,this.src=c,this.type=d,this.capture=!!y,this.ha=V,this.key=++O,this.da=this.fa=!1}function L(s){s.da=!0,s.listener=null,s.proxy=null,s.src=null,s.ha=null}function x(s){this.src=s,this.g={},this.h=0}x.prototype.add=function(s,c,d,y,V){var H=s.toString();s=this.g[H],s||(s=this.g[H]=[],this.h++);var ne=$(s,c,y,V);return-1>>0);function te(s){return typeof s=="function"?s:(s[ae]||(s[ae]=function(c){return s.handleEvent(c)}),s[ae])}function se(){we.call(this),this.i=new x(this),this.M=this,this.F=null}g(se,we),se.prototype[ze]=!0,se.prototype.removeEventListener=function(s,c,d,y){U(this,s,c,d,y)};function re(s,c){var d,y=s.F;if(y)for(d=[];y;y=y.F)d.push(y);if(s=s.M,y=c.type||c,typeof c=="string")c=new _e(c,s);else if(c instanceof _e)c.target=c.target||s;else{var V=c;c=new _e(y,s),C(c,V)}if(V=!0,d)for(var H=d.length-1;0<=H;H--){var ne=c.g=d[H];V=Ce(ne,y,!0,c)&&V}if(ne=c.g=s,V=Ce(ne,y,!0,c)&&V,V=Ce(ne,y,!1,c)&&V,d)for(H=0;H{s.g=null,s.i&&(s.i=!1,We(s))},s.l);const c=s.h;s.h=null,s.m.apply(null,c)}class Se extends we{constructor(c,d){super(),this.m=c,this.l=d,this.h=null,this.i=!1,this.g=null}j(c){this.h=arguments,this.g?this.i=!0:We(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function he(s){we.call(this),this.h=s,this.g={}}g(he,we);var ft=[];function er(s){q(s.g,function(c,d){this.g.hasOwnProperty(d)&&z(c)},s),s.g={}}he.prototype.N=function(){he.aa.N.call(this),er(this)},he.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Rn=a.JSON.stringify,v_=a.JSON.parse,y_=class{stringify(s){return a.JSON.stringify(s,void 0)}parse(s){return a.JSON.parse(s,void 0)}};function lu(){}lu.prototype.h=null;function rh(s){return s.h||(s.h=s.i())}function w_(){}var fo={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function uu(){_e.call(this,"d")}g(uu,_e);function cu(){_e.call(this,"c")}g(cu,_e);var fi={},ih=null;function fu(){return ih=ih||new se}fi.La="serverreachability";function oh(s){_e.call(this,fi.La,s)}g(oh,_e);function ho(s){const c=fu();re(c,new oh(c))}fi.STAT_EVENT="statevent";function sh(s,c){_e.call(this,fi.STAT_EVENT,s),this.stat=c}g(sh,_e);function It(s){const c=fu();re(c,new sh(c,s))}fi.Ma="timingevent";function ah(s,c){_e.call(this,fi.Ma,s),this.size=c}g(ah,_e);function po(s,c){if(typeof s!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){s()},c)}function mo(){this.g=!0}mo.prototype.xa=function(){this.g=!1};function __(s,c,d,y,V,H){s.info(function(){if(s.g)if(H)for(var ne="",Ne=H.split("&"),st=0;sty.length)){var V=y[1];if(Array.isArray(V)&&!(1>V.length)){var H=V[0];if(H!="noop"&&H!="stop"&&H!="close")for(var ne=1;neht)&&(ht!=3||this.g&&(this.h.h||this.g.oa()||xh(this.g)))){this.J||ht!=4||c==7||(c==8||0>=mi?ho(3):ho(2)),mu(this);var d=this.g.Z();this.X=d;t:if(ch(this)){var y=xh(this.g);s="";var V=y.length,H=Dn(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){jr(this),go(this);var ne="";break t}this.h.i=new a.TextDecoder}for(c=0;cc.length?hu:(c=c.slice(y,y+d),s.C=y+d,c)))}tr.prototype.cancel=function(){this.J=!0,jr(this)};function Bs(s){s.S=Date.now()+s.I,fh(s,s.I)}function fh(s,c){if(s.B!=null)throw Error("WatchDog timer not null");s.B=po(m(s.ba,s),c)}function mu(s){s.B&&(a.clearTimeout(s.B),s.B=null)}tr.prototype.ba=function(){this.B=null;const s=Date.now();0<=s-this.S?(S_(this.i,this.A),this.L!=2&&(ho(),It(17)),jr(this),this.s=2,go(this)):fh(this,this.S-s)};function go(s){s.j.G==0||s.J||jh(s.j,s)}function jr(s){mu(s);var c=s.M;c&&typeof c.ma=="function"&&c.ma(),s.M=null,er(s.U),s.g&&(c=s.g,s.g=null,c.abort(),c.ma())}function gu(s,c){try{var d=s.j;if(d.G!=0&&(d.g==s||vu(d.h,s))){if(!s.K&&vu(d.h,s)&&d.G==3){try{var y=d.Da.g.parse(c)}catch{y=null}if(Array.isArray(y)&&y.length==3){var V=y;if(V[0]==0){e:if(!d.u){if(d.g)if(d.g.F+3e3V[2]&&d.F&&d.v==0&&!d.C&&(d.C=po(m(d.Za,d),6e3));if(1>=ph(d.h)&&d.ca){try{d.ca()}catch{}d.ca=void 0}}else Fr(d,11)}else if((s.K||d.g==s)&&Qs(d),!S(c))for(V=d.Da.g.parse(c),c=0;c=s.j:!1}function ph(s){return s.h?1:s.g?s.g.size:0}function vu(s,c){return s.h?s.h==c:s.g?s.g.has(c):!1}function yu(s,c){s.g?s.g.add(c):s.h=c}function mh(s,c){s.h&&s.h==c?s.h=null:s.g&&s.g.has(c)&&s.g.delete(c)}dh.prototype.cancel=function(){if(this.i=gh(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const s of this.g.values())s.cancel();this.g.clear()}};function gh(s){if(s.h!=null)return s.i.concat(s.h.D);if(s.g!=null&&s.g.size!==0){let c=s.i;for(const d of s.g.values())c=c.concat(d.D);return c}return P(s.i)}function I_(s){if(s.V&&typeof s.V=="function")return s.V();if(typeof Map<"u"&&s instanceof Map||typeof Set<"u"&&s instanceof Set)return Array.from(s.values());if(typeof s=="string")return s.split("");if(u(s)){for(var c=[],d=s.length,y=0;yc)throw Error("Bad port number "+c);s.s=c}else s.s=null}function wh(s,c,d){c instanceof wo?(s.i=c,D_(s.i,s.h)):(d||(c=yo(c,R_)),s.i=new wo(c,s.h))}function Ue(s,c,d){s.i.set(c,d)}function Ws(s){return Ue(s,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),s}function vo(s,c){return s?c?decodeURI(s.replace(/%25/g,"%2525")):decodeURIComponent(s):""}function yo(s,c,d){return typeof s=="string"?(s=encodeURI(s).replace(c,P_),d&&(s=s.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),s):null}function P_(s){return s=s.charCodeAt(0),"%"+(s>>4&15).toString(16)+(s&15).toString(16)}var _h=/[#\/\?@]/g,x_=/[#\?:]/g,A_=/[#\?]/g,R_=/[#\?@]/g,N_=/#/g;function wo(s,c){this.h=this.g=null,this.i=s||null,this.j=!!c}function nr(s){s.g||(s.g=new Map,s.h=0,s.i&&k_(s.i,function(c,d){s.add(decodeURIComponent(c.replace(/\+/g," ")),d)}))}t=wo.prototype,t.add=function(s,c){nr(this),this.i=null,s=hi(this,s);var d=this.g.get(s);return d||this.g.set(s,d=[]),d.push(c),this.h+=1,this};function Sh(s,c){nr(s),c=hi(s,c),s.g.has(c)&&(s.i=null,s.h-=s.g.get(c).length,s.g.delete(c))}function Eh(s,c){return nr(s),c=hi(s,c),s.g.has(c)}t.forEach=function(s,c){nr(this),this.g.forEach(function(d,y){d.forEach(function(V){s.call(c,V,y,this)},this)},this)},t.na=function(){nr(this);const s=Array.from(this.g.values()),c=Array.from(this.g.keys()),d=[];for(let y=0;y{y.abort(),rr(d,"TestPingServer: timeout",!1,c)},1e4);fetch(s,{signal:y.signal}).then(H=>{clearTimeout(V),H.ok?rr(d,"TestPingServer: ok",!0,c):rr(d,"TestPingServer: server error",!1,c)}).catch(()=>{clearTimeout(V),rr(d,"TestPingServer: error",!1,c)})}function rr(s,c,d,y,V){try{V&&(V.onload=null,V.onerror=null,V.onabort=null,V.ontimeout=null),y(d)}catch{}}function j_(){this.g=new v_}function U_(s,c,d){const y=d||"";try{vh(s,function(V,H){let ne=V;f(V)&&(ne=Rn(V)),c.push(y+H+"="+encodeURIComponent(ne))})}catch(V){throw c.push(y+"type="+encodeURIComponent("_badmap")),V}}function Hs(s){this.l=s.Ub||null,this.j=s.eb||!1}g(Hs,au),Hs.prototype.g=function(){return new qs(this.l,this.j)},Hs.prototype.i=function(s){return function(){return s}}({});function qs(s,c){se.call(this),this.D=s,this.o=c,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}g(qs,se),t=qs.prototype,t.open=function(s,c){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=s,this.A=c,this.readyState=1,So(this)},t.send=function(s){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const c={headers:this.u,method:this.B,credentials:this.m,cache:void 0};s&&(c.body=s),(this.D||a).fetch(new Request(this.A,c)).then(this.Sa.bind(this),this.ga.bind(this))},t.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,_o(this)),this.readyState=0},t.Sa=function(s){if(this.g&&(this.l=s,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=s.headers,this.readyState=2,So(this)),this.g&&(this.readyState=3,So(this),this.g)))if(this.responseType==="arraybuffer")s.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in s){if(this.j=s.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;Th(this)}else s.text().then(this.Ra.bind(this),this.ga.bind(this))};function Th(s){s.j.read().then(s.Pa.bind(s)).catch(s.ga.bind(s))}t.Pa=function(s){if(this.g){if(this.o&&s.value)this.response.push(s.value);else if(!this.o){var c=s.value?s.value:new Uint8Array(0);(c=this.v.decode(c,{stream:!s.done}))&&(this.response=this.responseText+=c)}s.done?_o(this):So(this),this.readyState==3&&Th(this)}},t.Ra=function(s){this.g&&(this.response=this.responseText=s,_o(this))},t.Qa=function(s){this.g&&(this.response=s,_o(this))},t.ga=function(){this.g&&_o(this)};function _o(s){s.readyState=4,s.l=null,s.j=null,s.v=null,So(s)}t.setRequestHeader=function(s,c){this.u.append(s,c)},t.getResponseHeader=function(s){return this.h&&this.h.get(s.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const s=[],c=this.h.entries();for(var d=c.next();!d.done;)d=d.value,s.push(d[0]+": "+d[1]),d=c.next();return s.join(`\r -`)};function So(s){s.onreadystatechange&&s.onreadystatechange.call(s)}Object.defineProperty(qs.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(s){this.m=s?"include":"same-origin"}});function Ch(s){let c="";return q(s,function(d,y){c+=y,c+=":",c+=d,c+=`\r -`}),c}function wu(s,c,d){e:{for(y in d){var y=!1;break e}y=!0}y||(d=Ch(d),typeof s=="string"?d!=null&&encodeURIComponent(String(d)):Ue(s,c,d))}function Qe(s){se.call(this),this.headers=new Map,this.o=s||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}g(Qe,se);var F_=/^https?$/i,V_=["POST","PUT"];t=Qe.prototype,t.Ha=function(s){this.J=s},t.ea=function(s,c,d,y){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+s);c=c?c.toUpperCase():"GET",this.D=s,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():du.g(),this.v=this.o?nh(this.o):nh(du),this.g.onreadystatechange=m(this.Ea,this);try{this.B=!0,this.g.open(c,String(s),!0),this.B=!1}catch(H){Ih(this,H);return}if(s=d||"",d=new Map(this.headers),y)if(Object.getPrototypeOf(y)===Object.prototype)for(var V in y)d.set(V,y[V]);else if(typeof y.keys=="function"&&typeof y.get=="function")for(const H of y.keys())d.set(H,y.get(H));else throw Error("Unknown input type for opt_headers: "+String(y));y=Array.from(d.keys()).find(H=>H.toLowerCase()=="content-type"),V=a.FormData&&s instanceof a.FormData,!(0<=Array.prototype.indexOf.call(V_,c,void 0))||y||V||d.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[H,ne]of d)this.g.setRequestHeader(H,ne);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Ph(this),this.u=!0,this.g.send(s),this.u=!1}catch(H){Ih(this,H)}};function Ih(s,c){s.h=!1,s.g&&(s.j=!0,s.g.abort(),s.j=!1),s.l=c,s.m=5,Oh(s),Gs(s)}function Oh(s){s.A||(s.A=!0,re(s,"complete"),re(s,"error"))}t.abort=function(s){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=s||7,re(this,"complete"),re(this,"abort"),Gs(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Gs(this,!0)),Qe.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?kh(this):this.bb())},t.bb=function(){kh(this)};function kh(s){if(s.h&&typeof l<"u"&&(!s.v[1]||Dn(s)!=4||s.Z()!=2)){if(s.u&&Dn(s)==4)Je(s.Ea,0,s);else if(re(s,"readystatechange"),Dn(s)==4){s.h=!1;try{const ne=s.Z();e:switch(ne){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break e;default:c=!1}var d;if(!(d=c)){var y;if(y=ne===0){var V=String(s.D).match(yh)[1]||null;!V&&a.self&&a.self.location&&(V=a.self.location.protocol.slice(0,-1)),y=!F_.test(V?V.toLowerCase():"")}d=y}if(d)re(s,"complete"),re(s,"success");else{s.m=6;try{var H=2{}:null;s.g=null,s.v=null,c||re(s,"ready");try{d.onreadystatechange=y}catch{}}}function Ph(s){s.I&&(a.clearTimeout(s.I),s.I=null)}t.isActive=function(){return!!this.g};function Dn(s){return s.g?s.g.readyState:0}t.Z=function(){try{return 2=s.h.j-(s.s?1:0)?!1:s.s?(s.i=c.D.concat(s.i),!0):s.G==1||s.G==2||s.B>=(s.Va?0:s.Wa)?!1:(s.s=po(m(s.Ga,s,c),Uh(s,s.B)),s.B++,!0)}t.Ga=function(s){if(this.s)if(this.s=null,this.G==1){if(!s){this.U=Math.floor(1e5*Math.random()),s=this.U++;const V=new tr(this,this.j,s);let H=this.o;if(this.S&&(H?(H=w(H),C(H,this.S)):H=this.S),this.m!==null||this.O||(V.H=H,H=null),this.P)e:{for(var c=0,d=0;dPe)H=Math.max(0,V[st].g-100),Ne=!1;else try{U_(dt,ne,"req"+Pe+"_")}catch{y&&y(dt)}}if(Ne){y=ne.join("&");break e}}}return s=s.i.splice(0,d),c.D=s,y}function Mh(s){if(!s.g&&!s.u){s.Y=1;var c=s.Fa;B||le(),W||(B(),W=!0),oe.add(c,s),s.v=0}}function Su(s){return s.g||s.u||3<=s.v?!1:(s.Y++,s.u=po(m(s.Fa,s),Uh(s,s.v)),s.v++,!0)}t.Fa=function(){if(this.u=null,Lh(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var s=2*this.R;this.j.info("BP detection timer enabled: "+s),this.A=po(m(this.ab,this),s)}},t.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,It(10),Ks(this),Lh(this))};function Eu(s){s.A!=null&&(a.clearTimeout(s.A),s.A=null)}function Lh(s){s.g=new tr(s,s.j,"rpc",s.Y),s.m===null&&(s.g.H=s.o),s.g.O=0;var c=Nn(s.qa);Ue(c,"RID","rpc"),Ue(c,"SID",s.K),Ue(c,"AID",s.T),Ue(c,"CI",s.F?"0":"1"),!s.F&&s.ja&&Ue(c,"TO",s.ja),Ue(c,"TYPE","xmlhttp"),bo(s,c),s.m&&s.o&&wu(c,s.m,s.o),s.L&&(s.g.I=s.L);var d=s.g;s=s.ia,d.L=1,d.v=Ws(Nn(c)),d.m=null,d.P=!0,uh(d,s)}t.Za=function(){this.C!=null&&(this.C=null,Ks(this),Su(this),It(19))};function Qs(s){s.C!=null&&(a.clearTimeout(s.C),s.C=null)}function jh(s,c){var d=null;if(s.g==c){Qs(s),Eu(s),s.g=null;var y=2}else if(vu(s.h,c))d=c.D,mh(s.h,c),y=1;else return;if(s.G!=0){if(c.o)if(y==1){d=c.m?c.m.length:0,c=Date.now()-c.F;var V=s.B;y=cu(),re(y,new sh(y,d)),Ys(s)}else Mh(s);else if(V=c.s,V==3||V==0&&0y.length)){var V=y[1];if(Array.isArray(V)&&!(1>V.length)){var H=V[0];if(H!="noop"&&H!="stop"&&H!="close")for(var ne=1;neht)&&(ht!=3||this.g&&(this.h.h||this.g.oa()||Ah(this.g)))){this.J||ht!=4||c==7||(c==8||0>=mi?ho(3):ho(2)),gu(this);var d=this.g.Z();this.X=d;t:if(fh(this)){var y=Ah(this.g);s="";var V=y.length,H=Dn(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){jr(this),go(this);var ne="";break t}this.h.i=new a.TextDecoder}for(c=0;cc.length?pu:(c=c.slice(y,y+d),s.C=y+d,c)))}tr.prototype.cancel=function(){this.J=!0,jr(this)};function Bs(s){s.S=Date.now()+s.I,dh(s,s.I)}function dh(s,c){if(s.B!=null)throw Error("WatchDog timer not null");s.B=po(m(s.ba,s),c)}function gu(s){s.B&&(a.clearTimeout(s.B),s.B=null)}tr.prototype.ba=function(){this.B=null;const s=Date.now();0<=s-this.S?(E_(this.i,this.A),this.L!=2&&(ho(),It(17)),jr(this),this.s=2,go(this)):dh(this,this.S-s)};function go(s){s.j.G==0||s.J||Uh(s.j,s)}function jr(s){gu(s);var c=s.M;c&&typeof c.ma=="function"&&c.ma(),s.M=null,er(s.U),s.g&&(c=s.g,s.g=null,c.abort(),c.ma())}function vu(s,c){try{var d=s.j;if(d.G!=0&&(d.g==s||yu(d.h,s))){if(!s.K&&yu(d.h,s)&&d.G==3){try{var y=d.Da.g.parse(c)}catch{y=null}if(Array.isArray(y)&&y.length==3){var V=y;if(V[0]==0){e:if(!d.u){if(d.g)if(d.g.F+3e3V[2]&&d.F&&d.v==0&&!d.C&&(d.C=po(m(d.Za,d),6e3));if(1>=mh(d.h)&&d.ca){try{d.ca()}catch{}d.ca=void 0}}else Fr(d,11)}else if((s.K||d.g==s)&&Qs(d),!S(c))for(V=d.Da.g.parse(c),c=0;c=s.j:!1}function mh(s){return s.h?1:s.g?s.g.size:0}function yu(s,c){return s.h?s.h==c:s.g?s.g.has(c):!1}function wu(s,c){s.g?s.g.add(c):s.h=c}function gh(s,c){s.h&&s.h==c?s.h=null:s.g&&s.g.has(c)&&s.g.delete(c)}hh.prototype.cancel=function(){if(this.i=vh(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const s of this.g.values())s.cancel();this.g.clear()}};function vh(s){if(s.h!=null)return s.i.concat(s.h.D);if(s.g!=null&&s.g.size!==0){let c=s.i;for(const d of s.g.values())c=c.concat(d.D);return c}return P(s.i)}function O_(s){if(s.V&&typeof s.V=="function")return s.V();if(typeof Map<"u"&&s instanceof Map||typeof Set<"u"&&s instanceof Set)return Array.from(s.values());if(typeof s=="string")return s.split("");if(u(s)){for(var c=[],d=s.length,y=0;yc)throw Error("Bad port number "+c);s.s=c}else s.s=null}function _h(s,c,d){c instanceof wo?(s.i=c,M_(s.i,s.h)):(d||(c=yo(c,N_)),s.i=new wo(c,s.h))}function Ue(s,c,d){s.i.set(c,d)}function Ws(s){return Ue(s,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),s}function vo(s,c){return s?c?decodeURI(s.replace(/%25/g,"%2525")):decodeURIComponent(s):""}function yo(s,c,d){return typeof s=="string"?(s=encodeURI(s).replace(c,x_),d&&(s=s.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),s):null}function x_(s){return s=s.charCodeAt(0),"%"+(s>>4&15).toString(16)+(s&15).toString(16)}var Sh=/[#\/\?@]/g,A_=/[#\?:]/g,R_=/[#\?]/g,N_=/[#\?@]/g,D_=/#/g;function wo(s,c){this.h=this.g=null,this.i=s||null,this.j=!!c}function nr(s){s.g||(s.g=new Map,s.h=0,s.i&&P_(s.i,function(c,d){s.add(decodeURIComponent(c.replace(/\+/g," ")),d)}))}t=wo.prototype,t.add=function(s,c){nr(this),this.i=null,s=hi(this,s);var d=this.g.get(s);return d||this.g.set(s,d=[]),d.push(c),this.h+=1,this};function Eh(s,c){nr(s),c=hi(s,c),s.g.has(c)&&(s.i=null,s.h-=s.g.get(c).length,s.g.delete(c))}function bh(s,c){return nr(s),c=hi(s,c),s.g.has(c)}t.forEach=function(s,c){nr(this),this.g.forEach(function(d,y){d.forEach(function(V){s.call(c,V,y,this)},this)},this)},t.na=function(){nr(this);const s=Array.from(this.g.values()),c=Array.from(this.g.keys()),d=[];for(let y=0;y{y.abort(),rr(d,"TestPingServer: timeout",!1,c)},1e4);fetch(s,{signal:y.signal}).then(H=>{clearTimeout(V),H.ok?rr(d,"TestPingServer: ok",!0,c):rr(d,"TestPingServer: server error",!1,c)}).catch(()=>{clearTimeout(V),rr(d,"TestPingServer: error",!1,c)})}function rr(s,c,d,y,V){try{V&&(V.onload=null,V.onerror=null,V.onabort=null,V.ontimeout=null),y(d)}catch{}}function U_(){this.g=new y_}function F_(s,c,d){const y=d||"";try{yh(s,function(V,H){let ne=V;f(V)&&(ne=Rn(V)),c.push(y+H+"="+encodeURIComponent(ne))})}catch(V){throw c.push(y+"type="+encodeURIComponent("_badmap")),V}}function Hs(s){this.l=s.Ub||null,this.j=s.eb||!1}g(Hs,lu),Hs.prototype.g=function(){return new qs(this.l,this.j)},Hs.prototype.i=function(s){return function(){return s}}({});function qs(s,c){se.call(this),this.D=s,this.o=c,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}g(qs,se),t=qs.prototype,t.open=function(s,c){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=s,this.A=c,this.readyState=1,So(this)},t.send=function(s){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const c={headers:this.u,method:this.B,credentials:this.m,cache:void 0};s&&(c.body=s),(this.D||a).fetch(new Request(this.A,c)).then(this.Sa.bind(this),this.ga.bind(this))},t.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,_o(this)),this.readyState=0},t.Sa=function(s){if(this.g&&(this.l=s,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=s.headers,this.readyState=2,So(this)),this.g&&(this.readyState=3,So(this),this.g)))if(this.responseType==="arraybuffer")s.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in s){if(this.j=s.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;Ch(this)}else s.text().then(this.Ra.bind(this),this.ga.bind(this))};function Ch(s){s.j.read().then(s.Pa.bind(s)).catch(s.ga.bind(s))}t.Pa=function(s){if(this.g){if(this.o&&s.value)this.response.push(s.value);else if(!this.o){var c=s.value?s.value:new Uint8Array(0);(c=this.v.decode(c,{stream:!s.done}))&&(this.response=this.responseText+=c)}s.done?_o(this):So(this),this.readyState==3&&Ch(this)}},t.Ra=function(s){this.g&&(this.response=this.responseText=s,_o(this))},t.Qa=function(s){this.g&&(this.response=s,_o(this))},t.ga=function(){this.g&&_o(this)};function _o(s){s.readyState=4,s.l=null,s.j=null,s.v=null,So(s)}t.setRequestHeader=function(s,c){this.u.append(s,c)},t.getResponseHeader=function(s){return this.h&&this.h.get(s.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const s=[],c=this.h.entries();for(var d=c.next();!d.done;)d=d.value,s.push(d[0]+": "+d[1]),d=c.next();return s.join(`\r +`)};function So(s){s.onreadystatechange&&s.onreadystatechange.call(s)}Object.defineProperty(qs.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(s){this.m=s?"include":"same-origin"}});function Ih(s){let c="";return q(s,function(d,y){c+=y,c+=":",c+=d,c+=`\r +`}),c}function _u(s,c,d){e:{for(y in d){var y=!1;break e}y=!0}y||(d=Ih(d),typeof s=="string"?d!=null&&encodeURIComponent(String(d)):Ue(s,c,d))}function Qe(s){se.call(this),this.headers=new Map,this.o=s||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}g(Qe,se);var V_=/^https?$/i,B_=["POST","PUT"];t=Qe.prototype,t.Ha=function(s){this.J=s},t.ea=function(s,c,d,y){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+s);c=c?c.toUpperCase():"GET",this.D=s,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():hu.g(),this.v=this.o?rh(this.o):rh(hu),this.g.onreadystatechange=m(this.Ea,this);try{this.B=!0,this.g.open(c,String(s),!0),this.B=!1}catch(H){Oh(this,H);return}if(s=d||"",d=new Map(this.headers),y)if(Object.getPrototypeOf(y)===Object.prototype)for(var V in y)d.set(V,y[V]);else if(typeof y.keys=="function"&&typeof y.get=="function")for(const H of y.keys())d.set(H,y.get(H));else throw Error("Unknown input type for opt_headers: "+String(y));y=Array.from(d.keys()).find(H=>H.toLowerCase()=="content-type"),V=a.FormData&&s instanceof a.FormData,!(0<=Array.prototype.indexOf.call(B_,c,void 0))||y||V||d.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[H,ne]of d)this.g.setRequestHeader(H,ne);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{xh(this),this.u=!0,this.g.send(s),this.u=!1}catch(H){Oh(this,H)}};function Oh(s,c){s.h=!1,s.g&&(s.j=!0,s.g.abort(),s.j=!1),s.l=c,s.m=5,kh(s),Gs(s)}function kh(s){s.A||(s.A=!0,re(s,"complete"),re(s,"error"))}t.abort=function(s){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=s||7,re(this,"complete"),re(this,"abort"),Gs(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Gs(this,!0)),Qe.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?Ph(this):this.bb())},t.bb=function(){Ph(this)};function Ph(s){if(s.h&&typeof l<"u"&&(!s.v[1]||Dn(s)!=4||s.Z()!=2)){if(s.u&&Dn(s)==4)Je(s.Ea,0,s);else if(re(s,"readystatechange"),Dn(s)==4){s.h=!1;try{const ne=s.Z();e:switch(ne){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break e;default:c=!1}var d;if(!(d=c)){var y;if(y=ne===0){var V=String(s.D).match(wh)[1]||null;!V&&a.self&&a.self.location&&(V=a.self.location.protocol.slice(0,-1)),y=!V_.test(V?V.toLowerCase():"")}d=y}if(d)re(s,"complete"),re(s,"success");else{s.m=6;try{var H=2{}:null;s.g=null,s.v=null,c||re(s,"ready");try{d.onreadystatechange=y}catch{}}}function xh(s){s.I&&(a.clearTimeout(s.I),s.I=null)}t.isActive=function(){return!!this.g};function Dn(s){return s.g?s.g.readyState:0}t.Z=function(){try{return 2=s.h.j-(s.s?1:0)?!1:s.s?(s.i=c.D.concat(s.i),!0):s.G==1||s.G==2||s.B>=(s.Va?0:s.Wa)?!1:(s.s=po(m(s.Ga,s,c),Fh(s,s.B)),s.B++,!0)}t.Ga=function(s){if(this.s)if(this.s=null,this.G==1){if(!s){this.U=Math.floor(1e5*Math.random()),s=this.U++;const V=new tr(this,this.j,s);let H=this.o;if(this.S&&(H?(H=w(H),C(H,this.S)):H=this.S),this.m!==null||this.O||(V.H=H,H=null),this.P)e:{for(var c=0,d=0;dPe)H=Math.max(0,V[st].g-100),Ne=!1;else try{F_(dt,ne,"req"+Pe+"_")}catch{y&&y(dt)}}if(Ne){y=ne.join("&");break e}}}return s=s.i.splice(0,d),c.D=s,y}function Lh(s){if(!s.g&&!s.u){s.Y=1;var c=s.Fa;B||le(),W||(B(),W=!0),oe.add(c,s),s.v=0}}function Eu(s){return s.g||s.u||3<=s.v?!1:(s.Y++,s.u=po(m(s.Fa,s),Fh(s,s.v)),s.v++,!0)}t.Fa=function(){if(this.u=null,jh(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var s=2*this.R;this.j.info("BP detection timer enabled: "+s),this.A=po(m(this.ab,this),s)}},t.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,It(10),Ks(this),jh(this))};function bu(s){s.A!=null&&(a.clearTimeout(s.A),s.A=null)}function jh(s){s.g=new tr(s,s.j,"rpc",s.Y),s.m===null&&(s.g.H=s.o),s.g.O=0;var c=Nn(s.qa);Ue(c,"RID","rpc"),Ue(c,"SID",s.K),Ue(c,"AID",s.T),Ue(c,"CI",s.F?"0":"1"),!s.F&&s.ja&&Ue(c,"TO",s.ja),Ue(c,"TYPE","xmlhttp"),bo(s,c),s.m&&s.o&&_u(c,s.m,s.o),s.L&&(s.g.I=s.L);var d=s.g;s=s.ia,d.L=1,d.v=Ws(Nn(c)),d.m=null,d.P=!0,ch(d,s)}t.Za=function(){this.C!=null&&(this.C=null,Ks(this),Eu(this),It(19))};function Qs(s){s.C!=null&&(a.clearTimeout(s.C),s.C=null)}function Uh(s,c){var d=null;if(s.g==c){Qs(s),bu(s),s.g=null;var y=2}else if(yu(s.h,c))d=c.D,gh(s.h,c),y=1;else return;if(s.G!=0){if(c.o)if(y==1){d=c.m?c.m.length:0,c=Date.now()-c.F;var V=s.B;y=fu(),re(y,new ah(y,d)),Ys(s)}else Lh(s);else if(V=c.s,V==3||V==0&&0n(vt.UNAUTHENTICATED))}shutdown(){}}class iO{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class oO{constructor(e){this.t=e,this.currentUser=vt.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){let r=this.i;const i=u=>this.i!==r?(r=this.i,n(u)):Promise.resolve();let o=new Fi;this.o=()=>{this.i++,this.currentUser=this.u(),o.resolve(),o=new Fi,e.enqueueRetryable(()=>i(this.currentUser))};const l=()=>{const u=o;e.enqueueRetryable(async()=>{await u.promise,await i(this.currentUser)})},a=u=>{Ht("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.auth.addAuthTokenListener(this.o),l()};this.t.onInit(u=>a(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?a(u):(Ht("FirebaseAuthCredentialsProvider","Auth not yet detected"),o.resolve(),o=new Fi)}},0),l()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(Ht("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(yf(typeof r.accessToken=="string"),new dw(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return yf(e===null||typeof e=="string"),new vt(e)}}class sO{constructor(e,n,r){this.l=e,this.h=n,this.P=r,this.type="FirstParty",this.user=vt.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class aO{constructor(e,n,r){this.l=e,this.h=n,this.P=r}getToken(){return Promise.resolve(new sO(this.l,this.h,this.P))}start(e,n){e.enqueueRetryable(()=>n(vt.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class lO{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class uO{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,n){const r=o=>{o.error!=null&&Ht("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);const l=o.token!==this.R;return this.R=o.token,Ht("FirebaseAppCheckTokenProvider",`Received ${l?"new":"existing"} token.`),l?n(o.token):Promise.resolve()};this.o=o=>{e.enqueueRetryable(()=>r(o))};const i=o=>{Ht("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):Ht("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(yf(typeof n.token=="string"),this.R=n.token,new lO(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}/** + */class hw{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class iO{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(vt.UNAUTHENTICATED))}shutdown(){}}class oO{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class sO{constructor(e){this.t=e,this.currentUser=vt.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){let r=this.i;const i=u=>this.i!==r?(r=this.i,n(u)):Promise.resolve();let o=new Fi;this.o=()=>{this.i++,this.currentUser=this.u(),o.resolve(),o=new Fi,e.enqueueRetryable(()=>i(this.currentUser))};const l=()=>{const u=o;e.enqueueRetryable(async()=>{await u.promise,await i(this.currentUser)})},a=u=>{Ht("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.auth.addAuthTokenListener(this.o),l()};this.t.onInit(u=>a(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?a(u):(Ht("FirebaseAuthCredentialsProvider","Auth not yet detected"),o.resolve(),o=new Fi)}},0),l()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(Ht("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(wf(typeof r.accessToken=="string"),new hw(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return wf(e===null||typeof e=="string"),new vt(e)}}class aO{constructor(e,n,r){this.l=e,this.h=n,this.P=r,this.type="FirstParty",this.user=vt.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class lO{constructor(e,n,r){this.l=e,this.h=n,this.P=r}getToken(){return Promise.resolve(new aO(this.l,this.h,this.P))}start(e,n){e.enqueueRetryable(()=>n(vt.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class uO{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class cO{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,n){const r=o=>{o.error!=null&&Ht("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);const l=o.token!==this.R;return this.R=o.token,Ht("FirebaseAppCheckTokenProvider",`Received ${l?"new":"existing"} token.`),l?n(o.token):Promise.resolve()};this.o=o=>{e.enqueueRetryable(()=>r(o))};const i=o=>{Ht("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):Ht("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(wf(typeof n.token=="string"),this.R=n.token,new uO(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}/** * @license * Copyright 2020 Google LLC * @@ -578,7 +578,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;r0&&Ht("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(),e())),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}}/** + */class pO{constructor(e,n,r=1e3,i=1.5,o=6e4){this.oi=e,this.timerId=n,this.No=r,this.Lo=i,this.Bo=o,this.ko=0,this.qo=null,this.Qo=Date.now(),this.reset()}reset(){this.ko=0}Ko(){this.ko=this.Bo}$o(e){this.cancel();const n=Math.floor(this.ko+this.Uo()),r=Math.max(0,Date.now()-this.Qo),i=Math.max(0,n-r);i>0&&Ht("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(),e())),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 * @@ -668,7 +668,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Bd{constructor(e,n,r,i,o){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=o,this.deferred=new Fi,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(l=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,o){const l=Date.now()+r,a=new Bd(e,n,l,i,o);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new St(_t.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function pO(t,e){if(Ud("AsyncQueue",`${e}: ${t}`),hw(t))return new St(_t.UNAVAILABLE,`${e}: ${t}`);throw t}var jm,Um;(Um=jm||(jm={})).J_="default",Um.Cache="cache";/** + */class zd{constructor(e,n,r,i,o){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=o,this.deferred=new Fi,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(l=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,o){const l=Date.now()+r,a=new zd(e,n,l,i,o);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new St(_t.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function mO(t,e){if(Fd("AsyncQueue",`${e}: ${t}`),pw(t))return new St(_t.UNAVAILABLE,`${e}: ${t}`);throw t}var Um,Fm;(Fm=Um||(Um={})).J_="default",Fm.Cache="cache";/** * @license * Copyright 2017 Google LLC * @@ -683,7 +683,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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(e,n,r,i){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=vt.UNAUTHENTICATED,this.clientId=fO.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(r,async o=>{Ht("FirestoreClient","Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(Ht("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(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new St(_t.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Fi;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=pO(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}/** + */class gO{constructor(e,n,r,i){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=vt.UNAUTHENTICATED,this.clientId=dO.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(r,async o=>{Ht("FirestoreClient","Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(Ht("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(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new St(_t.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Fi;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=mO(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}/** * @license * Copyright 2023 Google LLC * @@ -698,7 +698,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 pw(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/** + */function mw(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/** * @license * Copyright 2020 Google LLC * @@ -713,7 +713,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Fm=new Map;function gO(t,e,n,r){if(e===!0&&r===!0)throw new St(_t.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function vO(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":Vd()}function yO(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new St(_t.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=vO(t);throw new St(_t.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/** + */const Vm=new Map;function vO(t,e,n,r){if(e===!0&&r===!0)throw new St(_t.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function yO(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":Bd()}function wO(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new St(_t.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=yO(t);throw new St(_t.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/** * @license * Copyright 2020 Google LLC * @@ -728,7 +728,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Vm{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new St(_t.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(n=e.ssl)===null||n===void 0||n;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new St(_t.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}gO("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=pw((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(o){if(o.timeoutSeconds!==void 0){if(isNaN(o.timeoutSeconds))throw new St(_t.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (must not be NaN)`);if(o.timeoutSeconds<5)throw new St(_t.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (minimum allowed value is 5)`);if(o.timeoutSeconds>30)throw new St(_t.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class mw{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Vm({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new St(_t.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(e){if(this._settingsFrozen)throw new St(_t.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 Vm(e),e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new rO;switch(r.type){case"firstParty":return new aO(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new St(_t.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.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=Fm.get(n);r&&(Ht("ComponentProvider","Removing Datastore"),Fm.delete(n),r.terminate())}(this),Promise.resolve()}}function wO(t,e,n,r={}){var i;const o=(t=yO(t,mw))._getSettings(),l=`${e}:${n}`;if(o.host!=="firestore.googleapis.com"&&o.host!==l&&nO("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),t._setSettings(Object.assign(Object.assign({},o),{host:l,ssl:!1})),r.mockUserToken){let a,u;if(typeof r.mockUserToken=="string")a=r.mockUserToken,u=vt.MOCK_USER;else{a=DC(r.mockUserToken,(i=t._app)===null||i===void 0?void 0:i.options.projectId);const f=r.mockUserToken.sub||r.mockUserToken.user_id;if(!f)throw new St(_t.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");u=new vt(f)}t._authCredentials=new iO(new dw(a,u))}}/** + */class Bm{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new St(_t.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(n=e.ssl)===null||n===void 0||n;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new St(_t.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}vO("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=mw((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(o){if(o.timeoutSeconds!==void 0){if(isNaN(o.timeoutSeconds))throw new St(_t.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (must not be NaN)`);if(o.timeoutSeconds<5)throw new St(_t.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (minimum allowed value is 5)`);if(o.timeoutSeconds>30)throw new St(_t.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class gw{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Bm({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new St(_t.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(e){if(this._settingsFrozen)throw new St(_t.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 Bm(e),e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new iO;switch(r.type){case"firstParty":return new lO(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new St(_t.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.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=Vm.get(n);r&&(Ht("ComponentProvider","Removing Datastore"),Vm.delete(n),r.terminate())}(this),Promise.resolve()}}function _O(t,e,n,r={}){var i;const o=(t=wO(t,gw))._getSettings(),l=`${e}:${n}`;if(o.host!=="firestore.googleapis.com"&&o.host!==l&&rO("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),t._setSettings(Object.assign(Object.assign({},o),{host:l,ssl:!1})),r.mockUserToken){let a,u;if(typeof r.mockUserToken=="string")a=r.mockUserToken,u=vt.MOCK_USER;else{a=MC(r.mockUserToken,(i=t._app)===null||i===void 0?void 0:i.options.projectId);const f=r.mockUserToken.sub||r.mockUserToken.user_id;if(!f)throw new St(_t.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");u=new vt(f)}t._authCredentials=new oO(new hw(a,u))}}/** * @license * Copyright 2020 Google LLC * @@ -743,8 +743,8 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class _O{constructor(){this.iu=Promise.resolve(),this.su=[],this.ou=!1,this._u=[],this.au=null,this.uu=!1,this.cu=!1,this.lu=[],this.Yo=new hO(this,"async_queue_retry"),this.hu=()=>{const n=oc();n&&Ht("AsyncQueue","Visibility state changed to "+n.visibilityState),this.Yo.Wo()};const e=oc();e&&typeof e.addEventListener=="function"&&e.addEventListener("visibilitychange",this.hu)}get isShuttingDown(){return this.ou}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Pu(),this.Iu(e)}enterRestrictedMode(e){if(!this.ou){this.ou=!0,this.cu=e||!1;const n=oc();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.hu)}}enqueue(e){if(this.Pu(),this.ou)return new Promise(()=>{});const n=new Fi;return this.Iu(()=>this.ou&&this.cu?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.su.push(e),this.Tu()))}async Tu(){if(this.su.length!==0){try{await this.su[0](),this.su.shift(),this.Yo.reset()}catch(e){if(!hw(e))throw e;Ht("AsyncQueue","Operation failed with retryable error: "+e)}this.su.length>0&&this.Yo.$o(()=>this.Tu())}}Iu(e){const n=this.iu.then(()=>(this.uu=!0,e().catch(r=>{this.au=r,this.uu=!1;const i=function(l){let a=l.message||"";return l.stack&&(a=l.stack.includes(l.message)?l.stack:l.message+` -`+l.stack),a}(r);throw Ud("INTERNAL UNHANDLED ERROR: ",i),r}).then(r=>(this.uu=!1,r))));return this.iu=n,n}enqueueAfterDelay(e,n,r){this.Pu(),this.lu.indexOf(e)>-1&&(n=0);const i=Bd.createAndSchedule(this,e,n,r,o=>this.Eu(o));return this._u.push(i),i}Pu(){this.au&&Vd()}verifyOperationInProgress(){}async du(){let e;do e=this.iu,await e;while(e!==this.iu)}Au(e){for(const n of this._u)if(n.timerId===e)return!0;return!1}Ru(e){return this.du().then(()=>{this._u.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this._u)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.du()})}Vu(e){this.lu.push(e)}Eu(e){const n=this._u.indexOf(e);this._u.splice(n,1)}}class SO extends mw{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=function(){return new _O}(),this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||bO(this),this._firestoreClient.terminate()}}function EO(t,e){const n=typeof t=="object"?t:lw(),r=typeof t=="string"?t:"(default)",i=jd(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const o=RC("firestore");o&&wO(i,...o)}return i}function bO(t){var e,n,r;const i=t._freezeSettings(),o=function(a,u,f,h){return new dO(a,u,f,h.host,h.ssl,h.experimentalForceLongPolling,h.experimentalAutoDetectLongPolling,pw(h.experimentalLongPollingOptions),h.useFetchStreams)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,i);t._firestoreClient=new mO(t._authCredentials,t._appCheckCredentials,t._queue,o),!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.localCache.kind,_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider})}(function(e,n=!0){(function(i){Ms=i})(uo),Zi(new si("firestore",(r,{instanceIdentifier:i,options:o})=>{const l=r.getProvider("app").getImmediate(),a=new SO(new oO(r.getProvider("auth-internal")),new uO(r.getProvider("app-check-internal")),function(f,h){if(!Object.prototype.hasOwnProperty.apply(f.options,["projectId"]))throw new St(_t.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Cl(f.options.projectId,h)}(l,i),l);return o=Object.assign({useFetchStreams:n},o),a._setSettings(o),a},"PUBLIC").setMultipleInstances(!0)),kr(Mm,"4.6.3",e),kr(Mm,"4.6.3","esm2017")})();var wf=function(t,e){return wf=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])},wf(t,e)};function gw(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");wf(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Il=function(){return Il=Object.assign||function(e){for(var n,r=1,i=arguments.length;r=0;a--)(l=t[a])&&(o=(i<3?l(o):i>3?l(e,n,o):l(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o}function yw(t,e){return function(n,r){e(n,r,t)}}function TO(t,e,n,r,i,o){function l(I){if(I!==void 0&&typeof I!="function")throw new TypeError("Function expected");return I}for(var a=r.kind,u=a==="getter"?"get":a==="setter"?"set":"value",f=!e&&t?r.static?t:t.prototype:null,h=e||(f?Object.getOwnPropertyDescriptor(f,r.name):{}),p,m=!1,_=n.length-1;_>=0;_--){var g={};for(var P in r)g[P]=P==="access"?{}:r[P];for(var P in r.access)g.access[P]=r.access[P];g.addInitializer=function(I){if(m)throw new TypeError("Cannot add initializers after decoration has completed");o.push(l(I||null))};var D=(0,n[_])(a==="accessor"?{get:h.get,set:h.set}:h[u],g);if(a==="accessor"){if(D===void 0)continue;if(D===null||typeof D!="object")throw new TypeError("Object expected");(p=l(D.get))&&(h.get=p),(p=l(D.set))&&(h.set=p),(p=l(D.init))&&i.unshift(p)}else(p=l(D))&&(a==="field"?i.unshift(p):h[u]=p)}f&&Object.defineProperty(f,r.name,h),m=!0}function CO(t,e,n){for(var r=arguments.length>2,i=0;i0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function zd(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],l;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){l={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}function bw(){for(var t=[],e=0;e1||u(_,P)})},g&&(i[_]=g(i[_])))}function u(_,g){try{f(r[_](g))}catch(P){m(o[0][3],P)}}function f(_){_.value instanceof to?Promise.resolve(_.value.v).then(h,p):m(o[0][2],_)}function h(_){u("next",_)}function p(_){u("throw",_)}function m(_,g){_(g),o.shift(),o.length&&u(o[0][0],o[0][1])}}function Ow(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,o){e[i]=t[i]?function(l){return(n=!n)?{value:to(t[i](l)),done:!1}:o?o(l):l}:o}}function kw(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Ol=="function"?Ol(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(l){return new Promise(function(a,u){l=t[o](l),i(a,u,l.done,l.value)})}}function i(o,l,a,u){Promise.resolve(u).then(function(f){o({value:f,done:a})},l)}}function Pw(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var kO=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function xw(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&nu(e,t,n);return kO(e,t),e}function Aw(t){return t&&t.__esModule?t:{default:t}}function Rw(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}function Nw(t,e,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 e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n}function Dw(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Mw(t,e,n){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[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)}}),t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}var PO=typeof SuppressedError=="function"?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function Lw(t){function e(r){t.error=t.hasError?new PO(r,t.error,"An error was suppressed during disposal."):r,t.hasError=!0}function n(){for(;t.stack.length;){var r=t.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,function(o){return e(o),n()})}catch(o){e(o)}}if(t.hasError)throw t.error}return n()}const xO={__extends:gw,__assign:Il,__rest:Ls,__decorate:vw,__param:yw,__metadata:ww,__awaiter:_w,__generator:Sw,__createBinding:nu,__exportStar:Ew,__values:Ol,__read:zd,__spread:bw,__spreadArrays:Tw,__spreadArray:Cw,__await:to,__asyncGenerator:Iw,__asyncDelegator:Ow,__asyncValues:kw,__makeTemplateObject:Pw,__importStar:xw,__importDefault:Aw,__classPrivateFieldGet:Rw,__classPrivateFieldSet:Nw,__classPrivateFieldIn:Dw,__addDisposableResource:Mw,__disposeResources:Lw},AO=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Mw,get __assign(){return Il},__asyncDelegator:Ow,__asyncGenerator:Iw,__asyncValues:kw,__await:to,__awaiter:_w,__classPrivateFieldGet:Rw,__classPrivateFieldIn:Dw,__classPrivateFieldSet:Nw,__createBinding:nu,__decorate:vw,__disposeResources:Lw,__esDecorate:TO,__exportStar:Ew,__extends:gw,__generator:Sw,__importDefault:Aw,__importStar:xw,__makeTemplateObject:Pw,__metadata:ww,__param:yw,__propKey:IO,__read:zd,__rest:Ls,__runInitializers:CO,__setFunctionName:OO,__spread:bw,__spreadArray:Cw,__spreadArrays:Tw,__values:Ol,default:xO},Symbol.toStringTag,{value:"Module"}));function jw(){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 RO=jw,Uw=new Ns("auth","Firebase",jw());/** + */class SO{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 pO(this,"async_queue_retry"),this.hu=()=>{const n=sc();n&&Ht("AsyncQueue","Visibility state changed to "+n.visibilityState),this.Yo.Wo()};const e=sc();e&&typeof e.addEventListener=="function"&&e.addEventListener("visibilitychange",this.hu)}get isShuttingDown(){return this.ou}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Pu(),this.Iu(e)}enterRestrictedMode(e){if(!this.ou){this.ou=!0,this.cu=e||!1;const n=sc();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.hu)}}enqueue(e){if(this.Pu(),this.ou)return new Promise(()=>{});const n=new Fi;return this.Iu(()=>this.ou&&this.cu?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.su.push(e),this.Tu()))}async Tu(){if(this.su.length!==0){try{await this.su[0](),this.su.shift(),this.Yo.reset()}catch(e){if(!pw(e))throw e;Ht("AsyncQueue","Operation failed with retryable error: "+e)}this.su.length>0&&this.Yo.$o(()=>this.Tu())}}Iu(e){const n=this.iu.then(()=>(this.uu=!0,e().catch(r=>{this.au=r,this.uu=!1;const i=function(l){let a=l.message||"";return l.stack&&(a=l.stack.includes(l.message)?l.stack:l.message+` +`+l.stack),a}(r);throw Fd("INTERNAL UNHANDLED ERROR: ",i),r}).then(r=>(this.uu=!1,r))));return this.iu=n,n}enqueueAfterDelay(e,n,r){this.Pu(),this.lu.indexOf(e)>-1&&(n=0);const i=zd.createAndSchedule(this,e,n,r,o=>this.Eu(o));return this._u.push(i),i}Pu(){this.au&&Bd()}verifyOperationInProgress(){}async du(){let e;do e=this.iu,await e;while(e!==this.iu)}Au(e){for(const n of this._u)if(n.timerId===e)return!0;return!1}Ru(e){return this.du().then(()=>{this._u.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this._u)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.du()})}Vu(e){this.lu.push(e)}Eu(e){const n=this._u.indexOf(e);this._u.splice(n,1)}}class EO extends gw{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=function(){return new SO}(),this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||TO(this),this._firestoreClient.terminate()}}function bO(t,e){const n=typeof t=="object"?t:uw(),r=typeof t=="string"?t:"(default)",i=Ud(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const o=NC("firestore");o&&_O(i,...o)}return i}function TO(t){var e,n,r;const i=t._freezeSettings(),o=function(a,u,f,h){return new hO(a,u,f,h.host,h.ssl,h.experimentalForceLongPolling,h.experimentalAutoDetectLongPolling,mw(h.experimentalLongPollingOptions),h.useFetchStreams)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,i);t._firestoreClient=new gO(t._authCredentials,t._appCheckCredentials,t._queue,o),!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.localCache.kind,_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider})}(function(e,n=!0){(function(i){Ms=i})(uo),Zi(new si("firestore",(r,{instanceIdentifier:i,options:o})=>{const l=r.getProvider("app").getImmediate(),a=new EO(new sO(r.getProvider("auth-internal")),new cO(r.getProvider("app-check-internal")),function(f,h){if(!Object.prototype.hasOwnProperty.apply(f.options,["projectId"]))throw new St(_t.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Il(f.options.projectId,h)}(l,i),l);return o=Object.assign({useFetchStreams:n},o),a._setSettings(o),a},"PUBLIC").setMultipleInstances(!0)),kr(Lm,"4.6.3",e),kr(Lm,"4.6.3","esm2017")})();var _f=function(t,e){return _f=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])},_f(t,e)};function vw(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");_f(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Ol=function(){return Ol=Object.assign||function(e){for(var n,r=1,i=arguments.length;r=0;a--)(l=t[a])&&(o=(i<3?l(o):i>3?l(e,n,o):l(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o}function ww(t,e){return function(n,r){e(n,r,t)}}function CO(t,e,n,r,i,o){function l(I){if(I!==void 0&&typeof I!="function")throw new TypeError("Function expected");return I}for(var a=r.kind,u=a==="getter"?"get":a==="setter"?"set":"value",f=!e&&t?r.static?t:t.prototype:null,h=e||(f?Object.getOwnPropertyDescriptor(f,r.name):{}),p,m=!1,_=n.length-1;_>=0;_--){var g={};for(var P in r)g[P]=P==="access"?{}:r[P];for(var P in r.access)g.access[P]=r.access[P];g.addInitializer=function(I){if(m)throw new TypeError("Cannot add initializers after decoration has completed");o.push(l(I||null))};var D=(0,n[_])(a==="accessor"?{get:h.get,set:h.set}:h[u],g);if(a==="accessor"){if(D===void 0)continue;if(D===null||typeof D!="object")throw new TypeError("Object expected");(p=l(D.get))&&(h.get=p),(p=l(D.set))&&(h.set=p),(p=l(D.init))&&i.unshift(p)}else(p=l(D))&&(a==="field"?i.unshift(p):h[u]=p)}f&&Object.defineProperty(f,r.name,h),m=!0}function IO(t,e,n){for(var r=arguments.length>2,i=0;i0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function $d(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],l;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){l={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return o}function Tw(){for(var t=[],e=0;e1||u(_,P)})},g&&(i[_]=g(i[_])))}function u(_,g){try{f(r[_](g))}catch(P){m(o[0][3],P)}}function f(_){_.value instanceof to?Promise.resolve(_.value.v).then(h,p):m(o[0][2],_)}function h(_){u("next",_)}function p(_){u("throw",_)}function m(_,g){_(g),o.shift(),o.length&&u(o[0][0],o[0][1])}}function kw(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,o){e[i]=t[i]?function(l){return(n=!n)?{value:to(t[i](l)),done:!1}:o?o(l):l}:o}}function Pw(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof kl=="function"?kl(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(l){return new Promise(function(a,u){l=t[o](l),i(a,u,l.done,l.value)})}}function i(o,l,a,u){Promise.resolve(u).then(function(f){o({value:f,done:a})},l)}}function xw(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var PO=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function Aw(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&ru(e,t,n);return PO(e,t),e}function Rw(t){return t&&t.__esModule?t:{default:t}}function Nw(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}function Dw(t,e,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 e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n}function Mw(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Lw(t,e,n){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[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)}}),t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}var xO=typeof SuppressedError=="function"?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function jw(t){function e(r){t.error=t.hasError?new xO(r,t.error,"An error was suppressed during disposal."):r,t.hasError=!0}function n(){for(;t.stack.length;){var r=t.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,function(o){return e(o),n()})}catch(o){e(o)}}if(t.hasError)throw t.error}return n()}const AO={__extends:vw,__assign:Ol,__rest:Ls,__decorate:yw,__param:ww,__metadata:_w,__awaiter:Sw,__generator:Ew,__createBinding:ru,__exportStar:bw,__values:kl,__read:$d,__spread:Tw,__spreadArrays:Cw,__spreadArray:Iw,__await:to,__asyncGenerator:Ow,__asyncDelegator:kw,__asyncValues:Pw,__makeTemplateObject:xw,__importStar:Aw,__importDefault:Rw,__classPrivateFieldGet:Nw,__classPrivateFieldSet:Dw,__classPrivateFieldIn:Mw,__addDisposableResource:Lw,__disposeResources:jw},RO=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Lw,get __assign(){return Ol},__asyncDelegator:kw,__asyncGenerator:Ow,__asyncValues:Pw,__await:to,__awaiter:Sw,__classPrivateFieldGet:Nw,__classPrivateFieldIn:Mw,__classPrivateFieldSet:Dw,__createBinding:ru,__decorate:yw,__disposeResources:jw,__esDecorate:CO,__exportStar:bw,__extends:vw,__generator:Ew,__importDefault:Rw,__importStar:Aw,__makeTemplateObject:xw,__metadata:_w,__param:ww,__propKey:OO,__read:$d,__rest:Ls,__runInitializers:IO,__setFunctionName:kO,__spread:Tw,__spreadArray:Iw,__spreadArrays:Cw,__values:kl,default:AO},Symbol.toStringTag,{value:"Module"}));function Uw(){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 NO=Uw,Fw=new Ns("auth","Firebase",Uw());/** * @license * Copyright 2020 Google LLC * @@ -759,7 +759,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 kl=new Md("@firebase/auth");function NO(t,...e){kl.logLevel<=xe.WARN&&kl.warn(`Auth (${uo}): ${t}`,...e)}function Ua(t,...e){kl.logLevel<=xe.ERROR&&kl.error(`Auth (${uo}): ${t}`,...e)}/** + */const Pl=new Ld("@firebase/auth");function DO(t,...e){Pl.logLevel<=xe.WARN&&Pl.warn(`Auth (${uo}): ${t}`,...e)}function Fa(t,...e){Pl.logLevel<=xe.ERROR&&Pl.error(`Auth (${uo}): ${t}`,...e)}/** * @license * Copyright 2020 Google LLC * @@ -774,7 +774,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 An(t,...e){throw Wd(t,...e)}function yn(t,...e){return Wd(t,...e)}function $d(t,e,n){const r=Object.assign(Object.assign({},RO()),{[e]:n});return new Ns("auth","Firebase",r).create(e,{appName:t.name})}function Zr(t){return $d(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function DO(t,e,n){const r=n;if(!(e instanceof r))throw r.name!==e.constructor.name&&An(t,"argument-error"),$d(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Wd(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return Uw.create(t,...e)}function be(t,e,...n){if(!t)throw Wd(e,...n)}function $n(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Ua(e),new Error(e)}function Xn(t,e){t||$n(e)}/** + */function An(t,...e){throw Hd(t,...e)}function yn(t,...e){return Hd(t,...e)}function Wd(t,e,n){const r=Object.assign(Object.assign({},NO()),{[e]:n});return new Ns("auth","Firebase",r).create(e,{appName:t.name})}function Zr(t){return Wd(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function MO(t,e,n){const r=n;if(!(e instanceof r))throw r.name!==e.constructor.name&&An(t,"argument-error"),Wd(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Hd(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return Fw.create(t,...e)}function be(t,e,...n){if(!t)throw Hd(e,...n)}function $n(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Fa(e),new Error(e)}function Xn(t,e){t||$n(e)}/** * @license * Copyright 2020 Google LLC * @@ -789,7 +789,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 _f(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function MO(){return Bm()==="http:"||Bm()==="https:"}function Bm(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}/** + */function Sf(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function LO(){return zm()==="http:"||zm()==="https:"}function zm(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}/** * @license * Copyright 2020 Google LLC * @@ -804,7 +804,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 LO(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(MO()||LC()||"connection"in navigator)?navigator.onLine:!0}function jO(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/** + */function jO(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(LO()||jC()||"connection"in navigator)?navigator.onLine:!0}function UO(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/** * @license * Copyright 2020 Google LLC * @@ -819,7 +819,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 js{constructor(e,n){this.shortDelay=e,this.longDelay=n,Xn(n>e,"Short delay should be less than long delay!"),this.isMobile=MC()||jC()}get(){return LO()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** + */class js{constructor(e,n){this.shortDelay=e,this.longDelay=n,Xn(n>e,"Short delay should be less than long delay!"),this.isMobile=LC()||UC()}get(){return jO()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** * @license * Copyright 2020 Google LLC * @@ -834,7 +834,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Hd(t,e){Xn(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/** + */function qd(t,e){Xn(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/** * @license * Copyright 2020 Google LLC * @@ -849,7 +849,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Fw{static initialize(e,n,r){this.fetchImpl=e,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;$n("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;$n("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;$n("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** + */class Vw{static initialize(e,n,r){this.fetchImpl=e,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;$n("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;$n("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;$n("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** * @license * Copyright 2020 Google LLC * @@ -864,7 +864,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 UO={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"};/** + */const FO={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 * @@ -879,7 +879,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 FO=new js(3e4,6e4);function qd(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function co(t,e,n,r,i={}){return Vw(t,i,async()=>{let o={},l={};r&&(e==="GET"?l=r:o={body:JSON.stringify(r)});const a=Ds(Object.assign({key:t.config.apiKey},l)).slice(1),u=await t._getAdditionalHeaders();return u["Content-Type"]="application/json",t.languageCode&&(u["X-Firebase-Locale"]=t.languageCode),Fw.fetch()(Bw(t,t.config.apiHost,n,a),Object.assign({method:e,headers:u,referrerPolicy:"no-referrer"},o))})}async function Vw(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},UO),e);try{const i=new BO(t),o=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const l=await o.json();if("needConfirmation"in l)throw wa(t,"account-exists-with-different-credential",l);if(o.ok&&!("errorMessage"in l))return l;{const a=o.ok?l.errorMessage:l.error.message,[u,f]=a.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw wa(t,"credential-already-in-use",l);if(u==="EMAIL_EXISTS")throw wa(t,"email-already-in-use",l);if(u==="USER_DISABLED")throw wa(t,"user-disabled",l);const h=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(f)throw $d(t,h,f);An(t,h)}}catch(i){if(i instanceof Zn)throw i;An(t,"network-request-failed",{message:String(i)})}}async function VO(t,e,n,r,i={}){const o=await co(t,e,n,r,i);return"mfaPendingCredential"in o&&An(t,"multi-factor-auth-required",{_serverResponse:o}),o}function Bw(t,e,n,r){const i=`${e}${n}?${r}`;return t.config.emulator?Hd(t.config,i):`${t.config.apiScheme}://${i}`}class BO{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(yn(this.auth,"network-request-failed")),FO.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function wa(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=yn(t,e,r);return i.customData._tokenResponse=n,i}/** + */const VO=new js(3e4,6e4);function Gd(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function co(t,e,n,r,i={}){return Bw(t,i,async()=>{let o={},l={};r&&(e==="GET"?l=r:o={body:JSON.stringify(r)});const a=Ds(Object.assign({key:t.config.apiKey},l)).slice(1),u=await t._getAdditionalHeaders();return u["Content-Type"]="application/json",t.languageCode&&(u["X-Firebase-Locale"]=t.languageCode),Vw.fetch()(zw(t,t.config.apiHost,n,a),Object.assign({method:e,headers:u,referrerPolicy:"no-referrer"},o))})}async function Bw(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},FO),e);try{const i=new zO(t),o=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const l=await o.json();if("needConfirmation"in l)throw wa(t,"account-exists-with-different-credential",l);if(o.ok&&!("errorMessage"in l))return l;{const a=o.ok?l.errorMessage:l.error.message,[u,f]=a.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw wa(t,"credential-already-in-use",l);if(u==="EMAIL_EXISTS")throw wa(t,"email-already-in-use",l);if(u==="USER_DISABLED")throw wa(t,"user-disabled",l);const h=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(f)throw Wd(t,h,f);An(t,h)}}catch(i){if(i instanceof Zn)throw i;An(t,"network-request-failed",{message:String(i)})}}async function BO(t,e,n,r,i={}){const o=await co(t,e,n,r,i);return"mfaPendingCredential"in o&&An(t,"multi-factor-auth-required",{_serverResponse:o}),o}function zw(t,e,n,r){const i=`${e}${n}?${r}`;return t.config.emulator?qd(t.config,i):`${t.config.apiScheme}://${i}`}class zO{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(yn(this.auth,"network-request-failed")),VO.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function wa(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=yn(t,e,r);return i.customData._tokenResponse=n,i}/** * @license * Copyright 2020 Google LLC * @@ -894,7 +894,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 zO(t,e){return co(t,"POST","/v1/accounts:delete",e)}async function zw(t,e){return co(t,"POST","/v1/accounts:lookup",e)}/** + */async function $O(t,e){return co(t,"POST","/v1/accounts:delete",e)}async function $w(t,e){return co(t,"POST","/v1/accounts:lookup",e)}/** * @license * Copyright 2020 Google LLC * @@ -909,7 +909,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Zo(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function $O(t,e=!1){const n=Lr(t),r=await n.getIdToken(e),i=Gd(r);be(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const o=typeof i.firebase=="object"?i.firebase:void 0,l=o==null?void 0:o.sign_in_provider;return{claims:i,token:r,authTime:Zo(sc(i.auth_time)),issuedAtTime:Zo(sc(i.iat)),expirationTime:Zo(sc(i.exp)),signInProvider:l||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function sc(t){return Number(t)*1e3}function Gd(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Ua("JWT malformed, contained fewer than 3 sections"),null;try{const i=tw(n);return i?JSON.parse(i):(Ua("Failed to decode base64 JWT payload"),null)}catch(i){return Ua("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function zm(t){const e=Gd(t);return be(e,"internal-error"),be(typeof e.exp<"u","internal-error"),be(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** + */function Zo(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function WO(t,e=!1){const n=Lr(t),r=await n.getIdToken(e),i=Kd(r);be(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const o=typeof i.firebase=="object"?i.firebase:void 0,l=o==null?void 0:o.sign_in_provider;return{claims:i,token:r,authTime:Zo(ac(i.auth_time)),issuedAtTime:Zo(ac(i.iat)),expirationTime:Zo(ac(i.exp)),signInProvider:l||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function ac(t){return Number(t)*1e3}function Kd(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Fa("JWT malformed, contained fewer than 3 sections"),null;try{const i=nw(n);return i?JSON.parse(i):(Fa("Failed to decode base64 JWT payload"),null)}catch(i){return Fa("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function $m(t){const e=Kd(t);return be(e,"internal-error"),be(typeof e.exp<"u","internal-error"),be(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** * @license * Copyright 2020 Google LLC * @@ -924,7 +924,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 _s(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof Zn&&WO(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function WO({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/** + */async function _s(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof Zn&&HO(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function HO({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/** * @license * Copyright 2020 Google LLC * @@ -939,7 +939,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class HO{constructor(e){this.user=e,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(e){var n;if(e){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(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** + */class qO{constructor(e){this.user=e,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(e){var n;if(e){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(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** * @license * Copyright 2020 Google LLC * @@ -954,7 +954,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Sf{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Zo(this.lastLoginAt),this.creationTime=Zo(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** + */class Ef{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Zo(this.lastLoginAt),this.creationTime=Zo(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** * @license * Copyright 2019 Google LLC * @@ -969,7 +969,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Pl(t){var e;const n=t.auth,r=await t.getIdToken(),i=await _s(t,zw(n,{idToken:r}));be(i==null?void 0:i.users.length,n,"internal-error");const o=i.users[0];t._notifyReloadListener(o);const l=!((e=o.providerUserInfo)===null||e===void 0)&&e.length?$w(o.providerUserInfo):[],a=GO(t.providerData,l),u=t.isAnonymous,f=!(t.email&&o.passwordHash)&&!(a!=null&&a.length),h=u?f:!1,p={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 Sf(o.createdAt,o.lastLoginAt),isAnonymous:h};Object.assign(t,p)}async function qO(t){const e=Lr(t);await Pl(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function GO(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function $w(t){return t.map(e=>{var{providerId:n}=e,r=Ls(e,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/** + */async function xl(t){var e;const n=t.auth,r=await t.getIdToken(),i=await _s(t,$w(n,{idToken:r}));be(i==null?void 0:i.users.length,n,"internal-error");const o=i.users[0];t._notifyReloadListener(o);const l=!((e=o.providerUserInfo)===null||e===void 0)&&e.length?Ww(o.providerUserInfo):[],a=KO(t.providerData,l),u=t.isAnonymous,f=!(t.email&&o.passwordHash)&&!(a!=null&&a.length),h=u?f:!1,p={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 Ef(o.createdAt,o.lastLoginAt),isAnonymous:h};Object.assign(t,p)}async function GO(t){const e=Lr(t);await xl(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function KO(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function Ww(t){return t.map(e=>{var{providerId:n}=e,r=Ls(e,["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 * @@ -984,7 +984,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 KO(t,e){const n=await Vw(t,{},async()=>{const r=Ds({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:o}=t.config,l=Bw(t,i,"/v1/token",`key=${o}`),a=await t._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Fw.fetch()(l,{method:"POST",headers:a,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function YO(t,e){return co(t,"POST","/v2/accounts:revokeToken",qd(t,e))}/** + */async function YO(t,e){const n=await Bw(t,{},async()=>{const r=Ds({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:o}=t.config,l=zw(t,i,"/v1/token",`key=${o}`),a=await t._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Vw.fetch()(l,{method:"POST",headers:a,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function QO(t,e){return co(t,"POST","/v2/accounts:revokeToken",Gd(t,e))}/** * @license * Copyright 2020 Google LLC * @@ -999,7 +999,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){be(e.idToken,"internal-error"),be(typeof e.idToken<"u","internal-error"),be(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):zm(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){be(e.length!==0,"internal-error");const n=zm(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(be(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:i,expiresIn:o}=await KO(e,n);this.updateTokensAndExpiration(r,i,Number(o))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:i,expirationTime:o}=n,l=new Vi;return r&&(be(typeof r=="string","internal-error",{appName:e}),l.refreshToken=r),i&&(be(typeof i=="string","internal-error",{appName:e}),l.accessToken=i),o&&(be(typeof o=="number","internal-error",{appName:e}),l.expirationTime=o),l}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Vi,this.toJSON())}_performRefresh(){return $n("not implemented")}}/** + */class Vi{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){be(e.idToken,"internal-error"),be(typeof e.idToken<"u","internal-error"),be(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):$m(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){be(e.length!==0,"internal-error");const n=$m(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(be(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:i,expiresIn:o}=await YO(e,n);this.updateTokensAndExpiration(r,i,Number(o))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:i,expirationTime:o}=n,l=new Vi;return r&&(be(typeof r=="string","internal-error",{appName:e}),l.refreshToken=r),i&&(be(typeof i=="string","internal-error",{appName:e}),l.accessToken=i),o&&(be(typeof o=="number","internal-error",{appName:e}),l.expirationTime=o),l}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Vi,this.toJSON())}_performRefresh(){return $n("not implemented")}}/** * @license * Copyright 2020 Google LLC * @@ -1014,7 +1014,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 or(t,e){be(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class Wn{constructor(e){var{uid:n,auth:r,stsTokenManager:i}=e,o=Ls(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new HO(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 Sf(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(e){const n=await _s(this,this.stsTokenManager.getToken(this.auth,e));return be(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return $O(this,e)}reload(){return qO(this)}_assign(e){this!==e&&(be(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new Wn(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){be(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await Pl(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(zn(this.auth.app))return Promise.reject(Zr(this.auth));const e=await this.getIdToken();return await _s(this,zO(this.auth,{idToken:e})),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(e=>Object.assign({},e)),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(e,n){var r,i,o,l,a,u,f,h;const p=(r=n.displayName)!==null&&r!==void 0?r:void 0,m=(i=n.email)!==null&&i!==void 0?i:void 0,_=(o=n.phoneNumber)!==null&&o!==void 0?o:void 0,g=(l=n.photoURL)!==null&&l!==void 0?l:void 0,P=(a=n.tenantId)!==null&&a!==void 0?a:void 0,D=(u=n._redirectEventId)!==null&&u!==void 0?u:void 0,I=(f=n.createdAt)!==null&&f!==void 0?f:void 0,S=(h=n.lastLoginAt)!==null&&h!==void 0?h:void 0,{uid:E,emailVerified:M,isAnonymous:F,providerData:q,stsTokenManager:T}=n;be(E&&T,e,"internal-error");const w=Vi.fromJSON(this.name,T);be(typeof E=="string",e,"internal-error"),or(p,e.name),or(m,e.name),be(typeof M=="boolean",e,"internal-error"),be(typeof F=="boolean",e,"internal-error"),or(_,e.name),or(g,e.name),or(P,e.name),or(D,e.name),or(I,e.name),or(S,e.name);const b=new Wn({uid:E,auth:e,email:m,emailVerified:M,displayName:p,isAnonymous:F,photoURL:g,phoneNumber:_,tenantId:P,stsTokenManager:w,createdAt:I,lastLoginAt:S});return q&&Array.isArray(q)&&(b.providerData=q.map(C=>Object.assign({},C))),D&&(b._redirectEventId=D),b}static async _fromIdTokenResponse(e,n,r=!1){const i=new Vi;i.updateFromServerResponse(n);const o=new Wn({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Pl(o),o}static async _fromGetAccountInfoResponse(e,n,r){const i=n.users[0];be(i.localId!==void 0,"internal-error");const o=i.providerUserInfo!==void 0?$w(i.providerUserInfo):[],l=!(i.email&&i.passwordHash)&&!(o!=null&&o.length),a=new Vi;a.updateFromIdToken(r);const u=new Wn({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:l}),f={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 Sf(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(o!=null&&o.length)};return Object.assign(u,f),u}}/** + */function or(t,e){be(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class Wn{constructor(e){var{uid:n,auth:r,stsTokenManager:i}=e,o=Ls(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new qO(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 Ef(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(e){const n=await _s(this,this.stsTokenManager.getToken(this.auth,e));return be(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return WO(this,e)}reload(){return GO(this)}_assign(e){this!==e&&(be(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new Wn(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){be(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await xl(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(zn(this.auth.app))return Promise.reject(Zr(this.auth));const e=await this.getIdToken();return await _s(this,$O(this.auth,{idToken:e})),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(e=>Object.assign({},e)),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(e,n){var r,i,o,l,a,u,f,h;const p=(r=n.displayName)!==null&&r!==void 0?r:void 0,m=(i=n.email)!==null&&i!==void 0?i:void 0,_=(o=n.phoneNumber)!==null&&o!==void 0?o:void 0,g=(l=n.photoURL)!==null&&l!==void 0?l:void 0,P=(a=n.tenantId)!==null&&a!==void 0?a:void 0,D=(u=n._redirectEventId)!==null&&u!==void 0?u:void 0,I=(f=n.createdAt)!==null&&f!==void 0?f:void 0,S=(h=n.lastLoginAt)!==null&&h!==void 0?h:void 0,{uid:E,emailVerified:M,isAnonymous:F,providerData:q,stsTokenManager:T}=n;be(E&&T,e,"internal-error");const w=Vi.fromJSON(this.name,T);be(typeof E=="string",e,"internal-error"),or(p,e.name),or(m,e.name),be(typeof M=="boolean",e,"internal-error"),be(typeof F=="boolean",e,"internal-error"),or(_,e.name),or(g,e.name),or(P,e.name),or(D,e.name),or(I,e.name),or(S,e.name);const b=new Wn({uid:E,auth:e,email:m,emailVerified:M,displayName:p,isAnonymous:F,photoURL:g,phoneNumber:_,tenantId:P,stsTokenManager:w,createdAt:I,lastLoginAt:S});return q&&Array.isArray(q)&&(b.providerData=q.map(C=>Object.assign({},C))),D&&(b._redirectEventId=D),b}static async _fromIdTokenResponse(e,n,r=!1){const i=new Vi;i.updateFromServerResponse(n);const o=new Wn({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await xl(o),o}static async _fromGetAccountInfoResponse(e,n,r){const i=n.users[0];be(i.localId!==void 0,"internal-error");const o=i.providerUserInfo!==void 0?Ww(i.providerUserInfo):[],l=!(i.email&&i.passwordHash)&&!(o!=null&&o.length),a=new Vi;a.updateFromIdToken(r);const u=new Wn({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:l}),f={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 Ef(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(o!=null&&o.length)};return Object.assign(u,f),u}}/** * @license * Copyright 2020 Google LLC * @@ -1029,7 +1029,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 $m=new Map;function Hn(t){Xn(t instanceof Function,"Expected a class definition");let e=$m.get(t);return e?(Xn(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,$m.set(t,e),e)}/** + */const Wm=new Map;function Hn(t){Xn(t instanceof Function,"Expected a class definition");let e=Wm.get(t);return e?(Xn(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,Wm.set(t,e),e)}/** * @license * Copyright 2019 Google LLC * @@ -1044,7 +1044,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Ww{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}Ww.type="NONE";const Wm=Ww;/** + */class Hw{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}Hw.type="NONE";const Hm=Hw;/** * @license * Copyright 2019 Google LLC * @@ -1059,7 +1059,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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(t,e,n){return`firebase:${t}:${e}:${n}`}class Bi{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:i,name:o}=this.auth;this.fullUserKey=Fa(this.userKey,i.apiKey,o),this.fullPersistenceKey=Fa("persistence",i.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?Wn._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new Bi(Hn(Wm),e,r);const i=(await Promise.all(n.map(async f=>{if(await f._isAvailable())return f}))).filter(f=>f);let o=i[0]||Hn(Wm);const l=Fa(r,e.config.apiKey,e.name);let a=null;for(const f of n)try{const h=await f._get(l);if(h){const p=Wn._fromJSON(e,h);f!==o&&(a=p),o=f;break}}catch{}const u=i.filter(f=>f._shouldAllowMigration);return!o._shouldAllowMigration||!u.length?new Bi(o,e,r):(o=u[0],a&&await o._set(l,a.toJSON()),await Promise.all(n.map(async f=>{if(f!==o)try{await f._remove(l)}catch{}})),new Bi(o,e,r))}}/** + */function Va(t,e,n){return`firebase:${t}:${e}:${n}`}class Bi{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:i,name:o}=this.auth;this.fullUserKey=Va(this.userKey,i.apiKey,o),this.fullPersistenceKey=Va("persistence",i.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?Wn._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new Bi(Hn(Hm),e,r);const i=(await Promise.all(n.map(async f=>{if(await f._isAvailable())return f}))).filter(f=>f);let o=i[0]||Hn(Hm);const l=Va(r,e.config.apiKey,e.name);let a=null;for(const f of n)try{const h=await f._get(l);if(h){const p=Wn._fromJSON(e,h);f!==o&&(a=p),o=f;break}}catch{}const u=i.filter(f=>f._shouldAllowMigration);return!o._shouldAllowMigration||!u.length?new Bi(o,e,r):(o=u[0],a&&await o._set(l,a.toJSON()),await Promise.all(n.map(async f=>{if(f!==o)try{await f._remove(l)}catch{}})),new Bi(o,e,r))}}/** * @license * Copyright 2020 Google LLC * @@ -1074,7 +1074,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Hm(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Gw(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Hw(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Yw(e))return"Blackberry";if(Qw(e))return"Webos";if(Kd(e))return"Safari";if((e.includes("chrome/")||qw(e))&&!e.includes("edge/"))return"Chrome";if(Kw(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function Hw(t=Tt()){return/firefox\//i.test(t)}function Kd(t=Tt()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function qw(t=Tt()){return/crios\//i.test(t)}function Gw(t=Tt()){return/iemobile/i.test(t)}function Kw(t=Tt()){return/android/i.test(t)}function Yw(t=Tt()){return/blackberry/i.test(t)}function Qw(t=Tt()){return/webos/i.test(t)}function ru(t=Tt()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function QO(t=Tt()){var e;return ru(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function XO(){return UC()&&document.documentMode===10}function Xw(t=Tt()){return ru(t)||Kw(t)||Qw(t)||Yw(t)||/windows phone/i.test(t)||Gw(t)}function JO(){try{return!!(window&&window!==window.top)}catch{return!1}}/** + */function qm(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Kw(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(qw(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Qw(e))return"Blackberry";if(Xw(e))return"Webos";if(Yd(e))return"Safari";if((e.includes("chrome/")||Gw(e))&&!e.includes("edge/"))return"Chrome";if(Yw(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function qw(t=Tt()){return/firefox\//i.test(t)}function Yd(t=Tt()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Gw(t=Tt()){return/crios\//i.test(t)}function Kw(t=Tt()){return/iemobile/i.test(t)}function Yw(t=Tt()){return/android/i.test(t)}function Qw(t=Tt()){return/blackberry/i.test(t)}function Xw(t=Tt()){return/webos/i.test(t)}function iu(t=Tt()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function XO(t=Tt()){var e;return iu(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function JO(){return FC()&&document.documentMode===10}function Jw(t=Tt()){return iu(t)||Yw(t)||Xw(t)||Qw(t)||/windows phone/i.test(t)||Kw(t)}function ZO(){try{return!!(window&&window!==window.top)}catch{return!1}}/** * @license * Copyright 2020 Google LLC * @@ -1089,7 +1089,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Jw(t,e=[]){let n;switch(t){case"Browser":n=Hm(Tt());break;case"Worker":n=`${Hm(Tt())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${uo}/${r}`}/** + */function Zw(t,e=[]){let n;switch(t){case"Browser":n=qm(Tt());break;case"Worker":n=`${qm(Tt())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${uo}/${r}`}/** * @license * Copyright 2022 Google LLC * @@ -1104,7 +1104,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class ZO{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=o=>new Promise((l,a)=>{try{const u=e(o);l(u)}catch(u){a(u)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),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})}}}/** + */class ek{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=o=>new Promise((l,a)=>{try{const u=e(o);l(u)}catch(u){a(u)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),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 * @@ -1119,7 +1119,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 ek(t,e={}){return co(t,"GET","/v2/passwordPolicy",qd(t,e))}/** + */async function tk(t,e={}){return co(t,"GET","/v2/passwordPolicy",Gd(t,e))}/** * @license * Copyright 2023 Google LLC * @@ -1134,7 +1134,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 tk=6;class nk{constructor(e){var n,r,i,o;const l=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=l.minPasswordLength)!==null&&n!==void 0?n:tk,l.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=l.maxPasswordLength),l.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=l.containsLowercaseCharacter),l.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=l.containsUppercaseCharacter),l.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=l.containsNumericCharacter),l.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=l.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(o=e.forceUpgradeOnSignin)!==null&&o!==void 0?o:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,r,i,o,l,a;const u={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,u),this.validatePasswordCharacterOptions(e,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=(l=u.containsNumericCharacter)!==null&&l!==void 0?l:!0),u.isValid&&(u.isValid=(a=u.containsNonAlphanumericCharacter)!==null&&a!==void 0?a:!0),u}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,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(e,n,r,i,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=o))}}/** + */const nk=6;class rk{constructor(e){var n,r,i,o;const l=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=l.minPasswordLength)!==null&&n!==void 0?n:nk,l.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=l.maxPasswordLength),l.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=l.containsLowercaseCharacter),l.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=l.containsUppercaseCharacter),l.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=l.containsNumericCharacter),l.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=l.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(o=e.forceUpgradeOnSignin)!==null&&o!==void 0?o:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,r,i,o,l,a;const u={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,u),this.validatePasswordCharacterOptions(e,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=(l=u.containsNumericCharacter)!==null&&l!==void 0?l:!0),u.isValid&&(u.isValid=(a=u.containsNonAlphanumericCharacter)!==null&&a!==void 0?a:!0),u}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,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(e,n,r,i,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=o))}}/** * @license * Copyright 2020 Google LLC * @@ -1149,7 +1149,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 rk{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new qm(this),this.idTokenSubscription=new qm(this),this.beforeStateQueue=new ZO(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=Uw,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=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Hn(n)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await Bi.create(this,e),!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 e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await zw(this,{idToken:e}),r=await Wn._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if(zn(this.app)){const l=this.app.settings.authIdToken;return l?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(l).then(a,a))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let i=r,o=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const l=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=i==null?void 0:i._redirectEventId,u=await this.tryRedirectSignIn(e);(!l||l===a)&&(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(l){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(l))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return be(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await Pl(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=jO()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(zn(this.app))return Promise.reject(Zr(this));const n=e?Lr(e):null;return n&&be(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&be(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return zn(this.app)?Promise.reject(Zr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return zn(this.app)?Promise.reject(Zr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Hn(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){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(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await ek(this),n=new nk(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Ns("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await YO(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Hn(e)||this._popupRedirectResolver;be(n,this,"argument-error"),this.redirectPersistenceManager=await Bi.create(this,[Hn(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===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 e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let l=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(be(a,this,"internal-error"),a.then(()=>{l||o(this.currentUser)}),typeof n=="function"){const u=e.addObserver(n,r,i);return()=>{l=!0,u()}}else{const u=e.addObserver(n);return()=>{l=!0,u()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return be(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Jw(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var e;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&NO(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function iu(t){return Lr(t)}class qm{constructor(e){this.auth=e,this.observer=null,this.addObserver=HC(n=>this.observer=n)}get next(){return be(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** + */class ik{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Gm(this),this.idTokenSubscription=new Gm(this),this.beforeStateQueue=new ek(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=Fw,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=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Hn(n)),this._initializationPromise=this.queue(async()=>{var r,i;if(!this._deleted&&(this.persistenceManager=await Bi.create(this,e),!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 e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await $w(this,{idToken:e}),r=await Wn._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if(zn(this.app)){const l=this.app.settings.authIdToken;return l?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(l).then(a,a))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let i=r,o=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const l=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=i==null?void 0:i._redirectEventId,u=await this.tryRedirectSignIn(e);(!l||l===a)&&(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(l){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(l))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return be(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await xl(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=UO()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(zn(this.app))return Promise.reject(Zr(this));const n=e?Lr(e):null;return n&&be(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&be(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return zn(this.app)?Promise.reject(Zr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return zn(this.app)?Promise.reject(Zr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Hn(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){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(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await tk(this),n=new rk(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Ns("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await QO(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Hn(e)||this._popupRedirectResolver;be(n,this,"argument-error"),this.redirectPersistenceManager=await Bi.create(this,[Hn(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===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 e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let l=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(be(a,this,"internal-error"),a.then(()=>{l||o(this.currentUser)}),typeof n=="function"){const u=e.addObserver(n,r,i);return()=>{l=!0,u()}}else{const u=e.addObserver(n);return()=>{l=!0,u()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return be(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Zw(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var e;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&DO(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function ou(t){return Lr(t)}class Gm{constructor(e){this.auth=e,this.observer=null,this.addObserver=qC(n=>this.observer=n)}get next(){return be(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** * @license * Copyright 2020 Google LLC * @@ -1164,7 +1164,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Yd={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function ik(t){Yd=t}function ok(t){return Yd.loadJS(t)}function sk(){return Yd.gapiScript}function ak(t){return`__${t}${Math.floor(Math.random()*1e6)}`}/** + */let Qd={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function ok(t){Qd=t}function sk(t){return Qd.loadJS(t)}function ak(){return Qd.gapiScript}function lk(t){return`__${t}${Math.floor(Math.random()*1e6)}`}/** * @license * Copyright 2020 Google LLC * @@ -1179,7 +1179,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 lk(t,e){const n=jd(t,"auth");if(n.isInitialized()){const i=n.getImmediate(),o=n.getOptions();if(bl(o,e??{}))return i;An(i,"already-initialized")}return n.initialize({options:e})}function uk(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Hn);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function ck(t,e,n){const r=iu(t);be(r._canInitEmulator,r,"emulator-config-failed"),be(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,o=Zw(e),{host:l,port:a}=fk(e),u=a===null?"":`:${a}`;r.config.emulator={url:`${o}//${l}${u}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:l,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),dk()}function Zw(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function fk(t){const e=Zw(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.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:Gm(r.substr(o.length+1))}}else{const[o,l]=r.split(":");return{host:o,port:Gm(l)}}}function Gm(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function dk(){function t(){const e=document.createElement("p"),n=e.style;e.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",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}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",t):t())}/** + */function uk(t,e){const n=Ud(t,"auth");if(n.isInitialized()){const i=n.getImmediate(),o=n.getOptions();if(Tl(o,e??{}))return i;An(i,"already-initialized")}return n.initialize({options:e})}function ck(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Hn);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function fk(t,e,n){const r=ou(t);be(r._canInitEmulator,r,"emulator-config-failed"),be(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,o=e_(e),{host:l,port:a}=dk(e),u=a===null?"":`:${a}`;r.config.emulator={url:`${o}//${l}${u}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:l,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),hk()}function e_(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function dk(t){const e=e_(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.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:Km(r.substr(o.length+1))}}else{const[o,l]=r.split(":");return{host:o,port:Km(l)}}}function Km(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function hk(){function t(){const e=document.createElement("p"),n=e.style;e.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",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}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",t):t())}/** * @license * Copyright 2020 Google LLC * @@ -1194,7 +1194,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 e_{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return $n("not implemented")}_getIdTokenResponse(e){return $n("not implemented")}_linkToIdToken(e,n){return $n("not implemented")}_getReauthenticationResolver(e){return $n("not implemented")}}/** + */class t_{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return $n("not implemented")}_getIdTokenResponse(e){return $n("not implemented")}_linkToIdToken(e,n){return $n("not implemented")}_getReauthenticationResolver(e){return $n("not implemented")}}/** * @license * Copyright 2020 Google LLC * @@ -1209,7 +1209,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 zi(t,e){return VO(t,"POST","/v1/accounts:signInWithIdp",qd(t,e))}/** + */async function zi(t,e){return BO(t,"POST","/v1/accounts:signInWithIdp",Gd(t,e))}/** * @license * Copyright 2020 Google LLC * @@ -1224,7 +1224,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 hk="http://localhost";class li extends e_{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new li(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):An("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(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=n,o=Ls(n,["providerId","signInMethod"]);if(!r||!i)return null;const l=new li(r,i);return l.idToken=o.idToken||void 0,l.accessToken=o.accessToken||void 0,l.secret=o.secret,l.nonce=o.nonce,l.pendingToken=o.pendingToken||null,l}_getIdTokenResponse(e){const n=this.buildRequest();return zi(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,zi(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,zi(e,n)}buildRequest(){const e={requestUri:hk,returnSecureToken:!0};if(this.pendingToken)e.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),e.postBody=Ds(n)}return e}}/** + */const pk="http://localhost";class li extends t_{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new li(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):An("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(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=n,o=Ls(n,["providerId","signInMethod"]);if(!r||!i)return null;const l=new li(r,i);return l.idToken=o.idToken||void 0,l.accessToken=o.accessToken||void 0,l.secret=o.secret,l.nonce=o.nonce,l.pendingToken=o.pendingToken||null,l}_getIdTokenResponse(e){const n=this.buildRequest();return zi(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,zi(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,zi(e,n)}buildRequest(){const e={requestUri:pk,returnSecureToken:!0};if(this.pendingToken)e.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),e.postBody=Ds(n)}return e}}/** * @license * Copyright 2020 Google LLC * @@ -1239,7 +1239,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Qd{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** + */class Xd{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** * @license * Copyright 2019 Google LLC * @@ -1254,7 +1254,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Us extends Qd{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** + */class Us extends Xd{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** * @license * Copyright 2020 Google LLC * @@ -1329,7 +1329,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */class no{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){const o=await Wn._fromIdTokenResponse(e,r,i),l=Km(r);return new no({user:o,providerId:l,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const i=Km(r);return new no({user:e,providerId:i,_tokenResponse:r,operationType:n})}}function Km(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/** + */class no{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){const o=await Wn._fromIdTokenResponse(e,r,i),l=Ym(r);return new no({user:o,providerId:l,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const i=Ym(r);return new no({user:e,providerId:i,_tokenResponse:r,operationType:n})}}function Ym(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/** * @license * Copyright 2020 Google LLC * @@ -1344,7 +1344,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 xl extends Zn{constructor(e,n,r,i){var o;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,xl.prototype),this.customData={appName:e.name,tenantId:(o=e.tenantId)!==null&&o!==void 0?o:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new xl(e,n,r,i)}}function t_(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?xl._fromErrorAndOperation(t,o,e,r):o})}async function pk(t,e,n=!1){const r=await _s(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return no._forOperation(t,"link",r)}/** + */class Al extends Zn{constructor(e,n,r,i){var o;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,Al.prototype),this.customData={appName:e.name,tenantId:(o=e.tenantId)!==null&&o!==void 0?o:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new Al(e,n,r,i)}}function n_(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Al._fromErrorAndOperation(t,o,e,r):o})}async function mk(t,e,n=!1){const r=await _s(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return no._forOperation(t,"link",r)}/** * @license * Copyright 2019 Google LLC * @@ -1359,7 +1359,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 mk(t,e,n=!1){const{auth:r}=t;if(zn(r.app))return Promise.reject(Zr(r));const i="reauthenticate";try{const o=await _s(t,t_(r,i,e,t),n);be(o.idToken,r,"internal-error");const l=Gd(o.idToken);be(l,r,"internal-error");const{sub:a}=l;return be(t.uid===a,r,"user-mismatch"),no._forOperation(t,i,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&An(r,"user-mismatch"),o}}/** + */async function gk(t,e,n=!1){const{auth:r}=t;if(zn(r.app))return Promise.reject(Zr(r));const i="reauthenticate";try{const o=await _s(t,n_(r,i,e,t),n);be(o.idToken,r,"internal-error");const l=Kd(o.idToken);be(l,r,"internal-error");const{sub:a}=l;return be(t.uid===a,r,"user-mismatch"),no._forOperation(t,i,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&An(r,"user-mismatch"),o}}/** * @license * Copyright 2020 Google LLC * @@ -1374,7 +1374,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 gk(t,e,n=!1){if(zn(t.app))return Promise.reject(Zr(t));const r="signIn",i=await t_(t,r,e),o=await no._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(o.user),o}function vk(t,e,n,r){return Lr(t).onIdTokenChanged(e,n,r)}function yk(t,e,n){return Lr(t).beforeAuthStateChanged(e,n)}function wk(t,e,n,r){return Lr(t).onAuthStateChanged(e,n,r)}function _k(t){return Lr(t).signOut()}const Al="__sak";/** + */async function vk(t,e,n=!1){if(zn(t.app))return Promise.reject(Zr(t));const r="signIn",i=await n_(t,r,e),o=await no._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(o.user),o}function yk(t,e,n,r){return Lr(t).onIdTokenChanged(e,n,r)}function wk(t,e,n){return Lr(t).beforeAuthStateChanged(e,n)}function _k(t,e,n,r){return Lr(t).onAuthStateChanged(e,n,r)}function Sk(t){return Lr(t).signOut()}const Rl="__sak";/** * @license * Copyright 2019 Google LLC * @@ -1389,7 +1389,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 n_{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Al,"1"),this.storage.removeItem(Al),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** + */class r_{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Rl,"1"),this.storage.removeItem(Rl),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** * @license * Copyright 2020 Google LLC * @@ -1404,7 +1404,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Sk(){const t=Tt();return Kd(t)||ru(t)}const Ek=1e3,bk=10;class r_ extends n_{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Sk()&&JO(),this.fallbackToPolling=Xw(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((l,a,u)=>{this.notifyListeners(l,u)});return}const r=e.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const l=this.storage.getItem(r);if(e.newValue!==l)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!n)return}const i=()=>{const l=this.storage.getItem(r);!n&&this.localCache[r]===l||this.notifyListeners(r,l)},o=this.storage.getItem(r);XO()&&o!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,bk):i()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},Ek)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}r_.type="LOCAL";const Tk=r_;/** + */function Ek(){const t=Tt();return Yd(t)||iu(t)}const bk=1e3,Tk=10;class i_ extends r_{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=Ek()&&ZO(),this.fallbackToPolling=Jw(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((l,a,u)=>{this.notifyListeners(l,u)});return}const r=e.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const l=this.storage.getItem(r);if(e.newValue!==l)e.newValue!==null?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!n)return}const i=()=>{const l=this.storage.getItem(r);!n&&this.localCache[r]===l||this.notifyListeners(r,l)},o=this.storage.getItem(r);JO()&&o!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Tk):i()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},bk)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}i_.type="LOCAL";const Ck=i_;/** * @license * Copyright 2020 Google LLC * @@ -1419,7 +1419,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 i_ extends n_{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}i_.type="SESSION";const o_=i_;/** + */class o_ extends r_{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}o_.type="SESSION";const s_=o_;/** * @license * Copyright 2019 Google LLC * @@ -1434,7 +1434,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Ck(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/** + */function Ik(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/** * @license * Copyright 2019 Google LLC * @@ -1449,7 +1449,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 ou{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;const r=new ou(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:i,data:o}=n.data,l=this.handlersMap[i];if(!(l!=null&&l.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(l).map(async f=>f(n.origin,o)),u=await Ck(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:u})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}ou.receivers=[];/** + */class su{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;const r=new su(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:i,data:o}=n.data,l=this.handlersMap[i];if(!(l!=null&&l.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const a=Array.from(l).map(async f=>f(n.origin,o)),u=await Ik(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:u})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}su.receivers=[];/** * @license * Copyright 2020 Google LLC * @@ -1464,7 +1464,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Xd(t="",e=10){let n="";for(let r=0;r{const f=Xd("",20);i.port1.start();const h=setTimeout(()=>{u(new Error("unsupported_event"))},r);l={messageChannel:i,onMessage(p){const m=p;if(m.data.eventId===f)switch(m.data.status){case"ack":clearTimeout(h),o=setTimeout(()=>{u(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(m.data.response);break;default:clearTimeout(h),clearTimeout(o),u(new Error("invalid_response"));break}}},this.handlers.add(l),i.port1.addEventListener("message",l.onMessage),this.target.postMessage({eventType:e,eventId:f,data:n},[i.port2])}).finally(()=>{l&&this.removeMessageHandler(l)})}}/** + */class Ok{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let o,l;return new Promise((a,u)=>{const f=Jd("",20);i.port1.start();const h=setTimeout(()=>{u(new Error("unsupported_event"))},r);l={messageChannel:i,onMessage(p){const m=p;if(m.data.eventId===f)switch(m.data.status){case"ack":clearTimeout(h),o=setTimeout(()=>{u(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(m.data.response);break;default:clearTimeout(h),clearTimeout(o),u(new Error("invalid_response"));break}}},this.handlers.add(l),i.port1.addEventListener("message",l.onMessage),this.target.postMessage({eventType:e,eventId:f,data:n},[i.port2])}).finally(()=>{l&&this.removeMessageHandler(l)})}}/** * @license * Copyright 2020 Google LLC * @@ -1494,7 +1494,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 xn(){return window}function Ok(t){xn().location.href=t}/** + */function xn(){return window}function kk(t){xn().location.href=t}/** * @license * Copyright 2020 Google LLC. * @@ -1509,7 +1509,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 s_(){return typeof xn().WorkerGlobalScope<"u"&&typeof xn().importScripts=="function"}async function kk(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Pk(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function xk(){return s_()?self:null}/** + */function a_(){return typeof xn().WorkerGlobalScope<"u"&&typeof xn().importScripts=="function"}async function Pk(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function xk(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function Ak(){return a_()?self:null}/** * @license * Copyright 2019 Google LLC * @@ -1524,7 +1524,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 a_="firebaseLocalStorageDb",Ak=1,Rl="firebaseLocalStorage",l_="fbase_key";class Fs{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function su(t,e){return t.transaction([Rl],e?"readwrite":"readonly").objectStore(Rl)}function Rk(){const t=indexedDB.deleteDatabase(a_);return new Fs(t).toPromise()}function Ef(){const t=indexedDB.open(a_,Ak);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Rl,{keyPath:l_})}catch(i){n(i)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Rl)?e(r):(r.close(),await Rk(),e(await Ef()))})})}async function Ym(t,e,n){const r=su(t,!0).put({[l_]:e,value:n});return new Fs(r).toPromise()}async function Nk(t,e){const n=su(t,!1).get(e),r=await new Fs(n).toPromise();return r===void 0?null:r.value}function Qm(t,e){const n=su(t,!0).delete(e);return new Fs(n).toPromise()}const Dk=800,Mk=3;class u_{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 Ef(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>Mk)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return s_()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ou._getInstance(xk()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await kk(),!this.activeServiceWorker)return;this.sender=new Ik(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Pk()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Ef();return await Ym(e,Al,"1"),await Qm(e,Al),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>Ym(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>Nk(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>Qm(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const o=su(i,!1).getAll();return new Fs(o).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:o}of e)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(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Dk)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}u_.type="LOCAL";const Lk=u_;new js(3e4,6e4);/** + */const l_="firebaseLocalStorageDb",Rk=1,Nl="firebaseLocalStorage",u_="fbase_key";class Fs{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function au(t,e){return t.transaction([Nl],e?"readwrite":"readonly").objectStore(Nl)}function Nk(){const t=indexedDB.deleteDatabase(l_);return new Fs(t).toPromise()}function bf(){const t=indexedDB.open(l_,Rk);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Nl,{keyPath:u_})}catch(i){n(i)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Nl)?e(r):(r.close(),await Nk(),e(await bf()))})})}async function Qm(t,e,n){const r=au(t,!0).put({[u_]:e,value:n});return new Fs(r).toPromise()}async function Dk(t,e){const n=au(t,!1).get(e),r=await new Fs(n).toPromise();return r===void 0?null:r.value}function Xm(t,e){const n=au(t,!0).delete(e);return new Fs(n).toPromise()}const Mk=800,Lk=3;class c_{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 bf(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>Lk)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return a_()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=su._getInstance(Ak()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await Pk(),!this.activeServiceWorker)return;this.sender=new Ok(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||xk()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await bf();return await Qm(e,Rl,"1"),await Xm(e,Rl),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>Qm(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>Dk(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>Xm(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const o=au(i,!1).getAll();return new Fs(o).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:o}of e)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(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Mk)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}c_.type="LOCAL";const jk=c_;new js(3e4,6e4);/** * @license * Copyright 2021 Google LLC * @@ -1539,7 +1539,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 c_(t,e){return e?Hn(e):(be(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/** + */function f_(t,e){return e?Hn(e):(be(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/** * @license * Copyright 2019 Google LLC * @@ -1554,7 +1554,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Jd extends e_{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return zi(e,this._buildIdpRequest())}_linkToIdToken(e,n){return zi(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return zi(e,this._buildIdpRequest())}_buildIdpRequest(e){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 e&&(n.idToken=e),n}}function jk(t){return gk(t.auth,new Jd(t),t.bypassAuthState)}function Uk(t){const{auth:e,user:n}=t;return be(n,e,"internal-error"),mk(n,new Jd(t),t.bypassAuthState)}async function Fk(t){const{auth:e,user:n}=t;return be(n,e,"internal-error"),pk(n,new Jd(t),t.bypassAuthState)}/** + */class Zd extends t_{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return zi(e,this._buildIdpRequest())}_linkToIdToken(e,n){return zi(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return zi(e,this._buildIdpRequest())}_buildIdpRequest(e){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 e&&(n.idToken=e),n}}function Uk(t){return vk(t.auth,new Zd(t),t.bypassAuthState)}function Fk(t){const{auth:e,user:n}=t;return be(n,e,"internal-error"),gk(n,new Zd(t),t.bypassAuthState)}async function Vk(t){const{auth:e,user:n}=t;return be(n,e,"internal-error"),mk(n,new Zd(t),t.bypassAuthState)}/** * @license * Copyright 2020 Google LLC * @@ -1569,7 +1569,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 f_{constructor(e,n,r,i,o=!1){this.auth=e,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(e,n)=>{this.pendingPromise={resolve:e,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(e){const{urlResponse:n,sessionId:r,postBody:i,tenantId:o,error:l,type:a}=e;if(l){this.reject(l);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(a)(u))}catch(f){this.reject(f)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return jk;case"linkViaPopup":case"linkViaRedirect":return Fk;case"reauthViaPopup":case"reauthViaRedirect":return Uk;default:An(this.auth,"internal-error")}}resolve(e){Xn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Xn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** + */class d_{constructor(e,n,r,i,o=!1){this.auth=e,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(e,n)=>{this.pendingPromise={resolve:e,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(e){const{urlResponse:n,sessionId:r,postBody:i,tenantId:o,error:l,type:a}=e;if(l){this.reject(l);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(a)(u))}catch(f){this.reject(f)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Uk;case"linkViaPopup":case"linkViaRedirect":return Vk;case"reauthViaPopup":case"reauthViaRedirect":return Fk;default:An(this.auth,"internal-error")}}resolve(e){Xn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Xn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** * @license * Copyright 2020 Google LLC * @@ -1584,7 +1584,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Vk=new js(2e3,1e4);async function Xm(t,e,n){if(zn(t.app))return Promise.reject(yn(t,"operation-not-supported-in-this-environment"));const r=iu(t);DO(t,e,Qd);const i=c_(r,n);return new Yr(r,"signInViaPopup",e,i).executeNotNull()}class Yr extends f_{constructor(e,n,r,i,o){super(e,n,i,o),this.provider=r,this.authWindow=null,this.pollId=null,Yr.currentPopupAction&&Yr.currentPopupAction.cancel(),Yr.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return be(e,this.auth,"internal-error"),e}async onExecution(){Xn(this.filter.length===1,"Popup operations only handle one event");const e=Xd();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(yn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(yn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Yr.currentPopupAction=null}pollUserCancellation(){const e=()=>{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(yn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Vk.get())};e()}}Yr.currentPopupAction=null;/** + */const Bk=new js(2e3,1e4);async function Jm(t,e,n){if(zn(t.app))return Promise.reject(yn(t,"operation-not-supported-in-this-environment"));const r=ou(t);MO(t,e,Xd);const i=f_(r,n);return new Yr(r,"signInViaPopup",e,i).executeNotNull()}class Yr extends d_{constructor(e,n,r,i,o){super(e,n,i,o),this.provider=r,this.authWindow=null,this.pollId=null,Yr.currentPopupAction&&Yr.currentPopupAction.cancel(),Yr.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return be(e,this.auth,"internal-error"),e}async onExecution(){Xn(this.filter.length===1,"Popup operations only handle one event");const e=Jd();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(yn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(yn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Yr.currentPopupAction=null}pollUserCancellation(){const e=()=>{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(yn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Bk.get())};e()}}Yr.currentPopupAction=null;/** * @license * Copyright 2020 Google LLC * @@ -1599,7 +1599,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Bk="pendingRedirect",Va=new Map;class zk extends f_{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Va.get(this.auth._key());if(!e){try{const r=await $k(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Va.set(this.auth._key(),e)}return this.bypassAuthState||Va.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function $k(t,e){const n=qk(e),r=Hk(t);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function Wk(t,e){Va.set(t._key(),e)}function Hk(t){return Hn(t._redirectPersistence)}function qk(t){return Fa(Bk,t.config.apiKey,t.name)}async function Gk(t,e,n=!1){if(zn(t.app))return Promise.reject(Zr(t));const r=iu(t),i=c_(r,e),l=await new zk(r,i,n).execute();return l&&!n&&(delete l.user._redirectEventId,await r._persistUserIfCurrent(l.user),await r._setRedirectUser(null,e)),l}/** + */const zk="pendingRedirect",Ba=new Map;class $k extends d_{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Ba.get(this.auth._key());if(!e){try{const r=await Wk(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Ba.set(this.auth._key(),e)}return this.bypassAuthState||Ba.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function Wk(t,e){const n=Gk(e),r=qk(t);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function Hk(t,e){Ba.set(t._key(),e)}function qk(t){return Hn(t._redirectPersistence)}function Gk(t){return Va(zk,t.config.apiKey,t.name)}async function Kk(t,e,n=!1){if(zn(t.app))return Promise.reject(Zr(t));const r=ou(t),i=f_(r,e),l=await new $k(r,i,n).execute();return l&&!n&&(delete l.user._redirectEventId,await r._persistUserIfCurrent(l.user),await r._setRedirectUser(null,e)),l}/** * @license * Copyright 2020 Google LLC * @@ -1614,7 +1614,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Kk=10*60*1e3;class Yk{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Qk(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!d_(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(yn(this.auth,i))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Kk&&this.cachedEventUids.clear(),this.cachedEventUids.has(Jm(e))}saveEventToCache(e){this.cachedEventUids.add(Jm(e)),this.lastProcessedEventTime=Date.now()}}function Jm(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function d_({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function Qk(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return d_(t);default:return!1}}/** + */const Yk=10*60*1e3;class Qk{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Xk(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!h_(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(yn(this.auth,i))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Yk&&this.cachedEventUids.clear(),this.cachedEventUids.has(Zm(e))}saveEventToCache(e){this.cachedEventUids.add(Zm(e)),this.lastProcessedEventTime=Date.now()}}function Zm(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function h_({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function Xk(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return h_(t);default:return!1}}/** * @license * Copyright 2020 Google LLC * @@ -1629,7 +1629,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Xk(t,e={}){return co(t,"GET","/v1/projects",e)}/** + */async function Jk(t,e={}){return co(t,"GET","/v1/projects",e)}/** * @license * Copyright 2020 Google LLC * @@ -1644,7 +1644,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 Jk=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Zk=/^https?/;async function e2(t){if(t.config.emulator)return;const{authorizedDomains:e}=await Xk(t);for(const n of e)try{if(t2(n))return}catch{}An(t,"unauthorized-domain")}function t2(t){const e=_f(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const l=new URL(t);return l.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&l.hostname===r}if(!Zk.test(n))return!1;if(Jk.test(t))return r===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/** + */const Zk=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,e2=/^https?/;async function t2(t){if(t.config.emulator)return;const{authorizedDomains:e}=await Jk(t);for(const n of e)try{if(n2(n))return}catch{}An(t,"unauthorized-domain")}function n2(t){const e=Sf(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const l=new URL(t);return l.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&l.hostname===r}if(!e2.test(n))return!1;if(Zk.test(t))return r===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/** * @license * Copyright 2020 Google LLC. * @@ -1659,7 +1659,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */const n2=new js(3e4,6e4);function Zm(){const t=xn().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n{var r,i,o;function l(){Zm(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Zm(),n(yn(t,"network-request-failed"))},timeout:n2.get()})}if(!((i=(r=xn().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((o=xn().gapi)===null||o===void 0)&&o.load)l();else{const a=ak("iframefcb");return xn()[a]=()=>{gapi.load?l():n(yn(t,"network-request-failed"))},ok(`${sk()}?onload=${a}`).catch(u=>n(u))}}).catch(e=>{throw Ba=null,e})}let Ba=null;function i2(t){return Ba=Ba||r2(t),Ba}/** + */const r2=new js(3e4,6e4);function eg(){const t=xn().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n{var r,i,o;function l(){eg(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{eg(),n(yn(t,"network-request-failed"))},timeout:r2.get()})}if(!((i=(r=xn().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((o=xn().gapi)===null||o===void 0)&&o.load)l();else{const a=lk("iframefcb");return xn()[a]=()=>{gapi.load?l():n(yn(t,"network-request-failed"))},sk(`${ak()}?onload=${a}`).catch(u=>n(u))}}).catch(e=>{throw za=null,e})}let za=null;function o2(t){return za=za||i2(t),za}/** * @license * Copyright 2020 Google LLC. * @@ -1674,7 +1674,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 o2=new js(5e3,15e3),s2="__/auth/iframe",a2="emulator/auth/iframe",l2={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},u2=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function c2(t){const e=t.config;be(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Hd(e,a2):`https://${t.config.authDomain}/${s2}`,r={apiKey:e.apiKey,appName:t.name,v:uo},i=u2.get(t.config.apiHost);i&&(r.eid=i);const o=t._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${Ds(r).slice(1)}`}async function f2(t){const e=await i2(t),n=xn().gapi;return be(n,t,"internal-error"),e.open({where:document.body,url:c2(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:l2,dontclear:!0},r=>new Promise(async(i,o)=>{await r.restyle({setHideOnLeave:!1});const l=yn(t,"network-request-failed"),a=xn().setTimeout(()=>{o(l)},o2.get());function u(){xn().clearTimeout(a),i(r)}r.ping(u).then(u,()=>{o(l)})}))}/** + */const s2=new js(5e3,15e3),a2="__/auth/iframe",l2="emulator/auth/iframe",u2={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},c2=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function f2(t){const e=t.config;be(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?qd(e,l2):`https://${t.config.authDomain}/${a2}`,r={apiKey:e.apiKey,appName:t.name,v:uo},i=c2.get(t.config.apiHost);i&&(r.eid=i);const o=t._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${Ds(r).slice(1)}`}async function d2(t){const e=await o2(t),n=xn().gapi;return be(n,t,"internal-error"),e.open({where:document.body,url:f2(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:u2,dontclear:!0},r=>new Promise(async(i,o)=>{await r.restyle({setHideOnLeave:!1});const l=yn(t,"network-request-failed"),a=xn().setTimeout(()=>{o(l)},s2.get());function u(){xn().clearTimeout(a),i(r)}r.ping(u).then(u,()=>{o(l)})}))}/** * @license * Copyright 2020 Google LLC. * @@ -1689,7 +1689,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 d2={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},h2=500,p2=600,m2="_blank",g2="http://localhost";class eg{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function v2(t,e,n,r=h2,i=p2){const o=Math.max((window.screen.availHeight-i)/2,0).toString(),l=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const u=Object.assign(Object.assign({},d2),{width:r.toString(),height:i.toString(),top:o,left:l}),f=Tt().toLowerCase();n&&(a=qw(f)?m2:n),Hw(f)&&(e=e||g2,u.scrollbars="yes");const h=Object.entries(u).reduce((m,[_,g])=>`${m}${_}=${g},`,"");if(QO(f)&&a!=="_self")return y2(e||"",a),new eg(null);const p=window.open(e||"",a,h);be(p,t,"popup-blocked");try{p.focus()}catch{}return new eg(p)}function y2(t,e){const n=document.createElement("a");n.href=t,n.target=e;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)}/** + */const h2={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},p2=500,m2=600,g2="_blank",v2="http://localhost";class tg{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function y2(t,e,n,r=p2,i=m2){const o=Math.max((window.screen.availHeight-i)/2,0).toString(),l=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const u=Object.assign(Object.assign({},h2),{width:r.toString(),height:i.toString(),top:o,left:l}),f=Tt().toLowerCase();n&&(a=Gw(f)?g2:n),qw(f)&&(e=e||v2,u.scrollbars="yes");const h=Object.entries(u).reduce((m,[_,g])=>`${m}${_}=${g},`,"");if(XO(f)&&a!=="_self")return w2(e||"",a),new tg(null);const p=window.open(e||"",a,h);be(p,t,"popup-blocked");try{p.focus()}catch{}return new tg(p)}function w2(t,e){const n=document.createElement("a");n.href=t,n.target=e;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 * @@ -1704,7 +1704,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 w2="__/auth/handler",_2="emulator/auth/handler",S2=encodeURIComponent("fac");async function tg(t,e,n,r,i,o){be(t.config.authDomain,t,"auth-domain-config-required"),be(t.config.apiKey,t,"invalid-api-key");const l={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:uo,eventId:i};if(e instanceof Qd){e.setDefaultLanguage(t.languageCode),l.providerId=e.providerId||"",WC(e.getCustomParameters())||(l.customParameters=JSON.stringify(e.getCustomParameters()));for(const[h,p]of Object.entries({}))l[h]=p}if(e instanceof Us){const h=e.getScopes().filter(p=>p!=="");h.length>0&&(l.scopes=h.join(","))}t.tenantId&&(l.tid=t.tenantId);const a=l;for(const h of Object.keys(a))a[h]===void 0&&delete a[h];const u=await t._getAppCheckToken(),f=u?`#${S2}=${encodeURIComponent(u)}`:"";return`${E2(t)}?${Ds(a).slice(1)}${f}`}function E2({config:t}){return t.emulator?Hd(t,_2):`https://${t.authDomain}/${w2}`}/** + */const _2="__/auth/handler",S2="emulator/auth/handler",E2=encodeURIComponent("fac");async function ng(t,e,n,r,i,o){be(t.config.authDomain,t,"auth-domain-config-required"),be(t.config.apiKey,t,"invalid-api-key");const l={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:uo,eventId:i};if(e instanceof Xd){e.setDefaultLanguage(t.languageCode),l.providerId=e.providerId||"",HC(e.getCustomParameters())||(l.customParameters=JSON.stringify(e.getCustomParameters()));for(const[h,p]of Object.entries({}))l[h]=p}if(e instanceof Us){const h=e.getScopes().filter(p=>p!=="");h.length>0&&(l.scopes=h.join(","))}t.tenantId&&(l.tid=t.tenantId);const a=l;for(const h of Object.keys(a))a[h]===void 0&&delete a[h];const u=await t._getAppCheckToken(),f=u?`#${E2}=${encodeURIComponent(u)}`:"";return`${b2(t)}?${Ds(a).slice(1)}${f}`}function b2({config:t}){return t.emulator?qd(t,S2):`https://${t.authDomain}/${_2}`}/** * @license * Copyright 2020 Google LLC * @@ -1719,7 +1719,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 ac="webStorageSupport";class b2{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=o_,this._completeRedirectFn=Gk,this._overrideRedirectResult=Wk}async _openPopup(e,n,r,i){var o;Xn((o=this.eventManagers[e._key()])===null||o===void 0?void 0:o.manager,"_initialize() not called before _openPopup()");const l=await tg(e,n,r,_f(),i);return v2(e,l,Xd())}async _openRedirect(e,n,r,i){await this._originValidation(e);const o=await tg(e,n,r,_f(),i);return Ok(o),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:i,promise:o}=this.eventManagers[n];return i?Promise.resolve(i):(Xn(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await f2(e),r=new Yk(e);return n.register("authEvent",i=>(be(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(ac,{type:ac},i=>{var o;const l=(o=i==null?void 0:i[0])===null||o===void 0?void 0:o[ac];l!==void 0&&n(!!l),An(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=e2(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return Xw()||Kd()||ru()}}const T2=b2;var ng="@firebase/auth",rg="1.7.4";/** + */const lc="webStorageSupport";class T2{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=s_,this._completeRedirectFn=Kk,this._overrideRedirectResult=Hk}async _openPopup(e,n,r,i){var o;Xn((o=this.eventManagers[e._key()])===null||o===void 0?void 0:o.manager,"_initialize() not called before _openPopup()");const l=await ng(e,n,r,Sf(),i);return y2(e,l,Jd())}async _openRedirect(e,n,r,i){await this._originValidation(e);const o=await ng(e,n,r,Sf(),i);return kk(o),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:i,promise:o}=this.eventManagers[n];return i?Promise.resolve(i):(Xn(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await d2(e),r=new Qk(e);return n.register("authEvent",i=>(be(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(lc,{type:lc},i=>{var o;const l=(o=i==null?void 0:i[0])===null||o===void 0?void 0:o[lc];l!==void 0&&n(!!l),An(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=t2(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return Jw()||Yd()||iu()}}const C2=T2;var rg="@firebase/auth",ig="1.7.4";/** * @license * Copyright 2020 Google LLC * @@ -1734,7 +1734,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 C2{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){be(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** + */class I2{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){be(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** * @license * Copyright 2020 Google LLC * @@ -1749,7 +1749,7 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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 I2(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function O2(t){Zi(new si("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:l,authDomain:a}=r.options;be(l&&!l.includes(":"),"invalid-api-key",{appName:r.name});const u={apiKey:l,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Jw(t)},f=new rk(r,i,o,u);return uk(f,n),f},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),Zi(new si("auth-internal",e=>{const n=iu(e.getProvider("auth").getImmediate());return(r=>new C2(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),kr(ng,rg,I2(t)),kr(ng,rg,"esm2017")}/** + */function O2(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function k2(t){Zi(new si("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:l,authDomain:a}=r.options;be(l&&!l.includes(":"),"invalid-api-key",{appName:r.name});const u={apiKey:l,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Zw(t)},f=new ik(r,i,o,u);return ck(f,n),f},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),Zi(new si("auth-internal",e=>{const n=ou(e.getProvider("auth").getImmediate());return(r=>new I2(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),kr(rg,ig,O2(t)),kr(rg,ig,"esm2017")}/** * @license * Copyright 2021 Google LLC * @@ -1764,8 +1764,8 @@ SPDX-License-Identifier: Apache-2.0 * WITHOUT 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=5*60,P2=iw("authIdTokenMaxAge")||k2;let ig=null;const x2=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>P2)return;const i=n==null?void 0:n.token;ig!==i&&(ig=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function A2(t=lw()){const e=jd(t,"auth");if(e.isInitialized())return e.getImmediate();const n=lk(t,{popupRedirectResolver:T2,persistence:[Lk,Tk,o_]}),r=iw("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const l=x2(o.toString());yk(n,l,()=>l(n.currentUser)),vk(n,a=>l(a))}}const i=nw("auth");return i&&ck(n,`http://${i}`),n}function R2(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}ik({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{const o=yn("internal-error");o.customData=i,n(o)},r.type="text/javascript",r.charset="UTF-8",R2().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="});O2("Browser");let Zd;(()=>{const e=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"}');Zd=aw(e)})();EO(Zd);const Nl=A2(Zd),og=new Fn,N2=()=>{const{setScreen:t,setUser:e,resetAppState:n}=ee.useContext(an),r=async()=>{try{await _k(Nl),localStorage.clear(),n()}catch(i){console.error("Error signing out: ",i)}};return U.jsx("button",{onClick:r,children:"Logout"})},D2=()=>{Ji.setAppElement("#root");const t=ee.useRef(),{ocrData:e,user:n,setFormData:r,ocrModalOpen:i,setOcrModalOpen:o}=ee.useContext(an),l=p=>{o(!p)},a=p=>(n.addTransaction(p),n.updateFirebase()),u=()=>new af(e),f=p=>{switch(p.target.value){case"edit":r(u());break;case"submit":if(e.isNotComplete()){alert("Data not complete. Switching to edit mode"),r(u());break}e.error?alert(e.message):a(e);break;case"tryAgain":setScreen("camera");break}l(i)},h=p=>p.error?U.jsxs("li",{className:"source-type-modal__list-item",children:[U.jsx("label",{children:"Error"}),U.jsx("div",{children:p.message})]}):Object.entries(p).filter(m=>m[1]!==null&&m[1]!==void 0).map((m,_)=>{if(m[0]!=="transactionId")return U.jsxs("li",{className:"source-type-modal__list-item",children:[U.jsx("label",{children:m[0]}),U.jsx("div",{children:m[1]})]},_)});return U.jsx("div",{className:"source-type",children:U.jsxs(Ji,{style:M2,isOpen:i,className:"source-type-modal","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var p;return(p=t.current)==null?void 0:p.focus()},0)},children:[U.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:h(e)}),U.jsx("div",{className:"source-type-modal__controls",children:e.error?U.jsx("button",{value:"tryAgain",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:f,children:"Try Again"}):U.jsxs(U.Fragment,{children:[U.jsx("button",{value:"edit",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:f,children:"Edit Info"}),U.jsx("button",{value:"submit",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:f,children:"Submit"})]})})]})})},M2={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 h_={exports:{}};(function(t,e){(function(n,r){t.exports=r(ee)})(typeof self<"u"?self:cg,function(n){return function(r){var i={};function o(l){if(i[l])return i[l].exports;var a=i[l]={i:l,l:!1,exports:{}};return r[l].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=r,o.c=i,o.d=function(l,a,u){o.o(l,a)||Object.defineProperty(l,a,{enumerable:!0,get:u})},o.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},o.t=function(l,a){if(1&a&&(l=o(l)),8&a||4&a&&typeof l=="object"&&l&&l.__esModule)return l;var u=Object.create(null);if(o.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:l}),2&a&&typeof l!="string")for(var f in l)o.d(u,f,(function(h){return l[h]}).bind(null,f));return u},o.n=function(l){var a=l&&l.__esModule?function(){return l.default}:function(){return l};return o.d(a,"a",a),a},o.o=function(l,a){return Object.prototype.hasOwnProperty.call(l,a)},o.p="",o(o.s=2)}([function(r,i){r.exports=n},function(r,i,o){var l={linear:function(a,u,f,h){return(f-u)*a/h+u},easeInQuad:function(a,u,f,h){return(f-u)*(a/=h)*a+u},easeOutQuad:function(a,u,f,h){return-(f-u)*(a/=h)*(a-2)+u},easeInOutQuad:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a+u:-p/2*(--a*(a-2)-1)+u},easeInCubic:function(a,u,f,h){return(f-u)*(a/=h)*a*a+u},easeOutCubic:function(a,u,f,h){return(f-u)*((a=a/h-1)*a*a+1)+u},easeInOutCubic:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a+u:p/2*((a-=2)*a*a+2)+u},easeInQuart:function(a,u,f,h){return(f-u)*(a/=h)*a*a*a+u},easeOutQuart:function(a,u,f,h){return-(f-u)*((a=a/h-1)*a*a*a-1)+u},easeInOutQuart:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a*a+u:-p/2*((a-=2)*a*a*a-2)+u},easeInQuint:function(a,u,f,h){return(f-u)*(a/=h)*a*a*a*a+u},easeOutQuint:function(a,u,f,h){return(f-u)*((a=a/h-1)*a*a*a*a+1)+u},easeInOutQuint:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a*a*a+u:p/2*((a-=2)*a*a*a*a+2)+u},easeInSine:function(a,u,f,h){var p=f-u;return-p*Math.cos(a/h*(Math.PI/2))+p+u},easeOutSine:function(a,u,f,h){return(f-u)*Math.sin(a/h*(Math.PI/2))+u},easeInOutSine:function(a,u,f,h){return-(f-u)/2*(Math.cos(Math.PI*a/h)-1)+u},easeInExpo:function(a,u,f,h){return a==0?u:(f-u)*Math.pow(2,10*(a/h-1))+u},easeOutExpo:function(a,u,f,h){var p=f-u;return a==h?u+p:p*(1-Math.pow(2,-10*a/h))+u},easeInOutExpo:function(a,u,f,h){var p=f-u;return a===0?u:a===h?u+p:(a/=h/2)<1?p/2*Math.pow(2,10*(a-1))+u:p/2*(2-Math.pow(2,-10*--a))+u},easeInCirc:function(a,u,f,h){return-(f-u)*(Math.sqrt(1-(a/=h)*a)-1)+u},easeOutCirc:function(a,u,f,h){return(f-u)*Math.sqrt(1-(a=a/h-1)*a)+u},easeInOutCirc:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?-p/2*(Math.sqrt(1-a*a)-1)+u:p/2*(Math.sqrt(1-(a-=2)*a)+1)+u},easeInElastic:function(a,u,f,h){var p,m,_,g=f-u;return _=1.70158,a===0?u:(a/=h)==1?u+g:((m=0)||(m=.3*h),(p=g)=1&&this.rotationDirection===a.Positive?this.rotationDirection=a.Negative:this.rotateY<=-1&&this.rotationDirection===a.Negative&&(this.rotationDirection=a.Positive);var de=.1*this.rotationDirection;if(this.rotateY+=de,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=pe,this.context.lineCap="round",this.context.lineWidth=2,ye&&typeof ye=="function")ye.call(this,this.context);else switch(this.shape){case l.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case l.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case l.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}])&&_(R.prototype,L),O}();function D(O,R,L){return R in O?Object.defineProperty(O,R,{value:L,enumerable:!0,configurable:!0,writable:!0}):O[R]=L,O}var I=function O(R,L){var x=this;(function($,J){if(!($ instanceof J))throw new TypeError("Cannot call a class as a function")})(this,O),D(this,"canvas",void 0),D(this,"context",void 0),D(this,"getOptions",void 0),D(this,"x",0),D(this,"y",0),D(this,"w",0),D(this,"h",0),D(this,"lastNumberOfPieces",0),D(this,"tweenInitTime",Date.now()),D(this,"particles",[]),D(this,"particlesGenerated",0),D(this,"removeParticleAt",function($){x.particles.splice($,1)}),D(this,"getParticle",function(){var $=m(x.x,x.w+x.x),J=m(x.y,x.h+x.y);return new P(x.context,x.getOptions,$,J)}),D(this,"animate",function(){var $=x.canvas,J=x.context,pe=x.particlesGenerated,ye=x.lastNumberOfPieces,de=x.getOptions(),k=de.run,j=de.recycle,z=de.numberOfPieces,Z=de.debug,Q=de.tweenFunction,K=de.tweenDuration;if(!k)return!1;var ae=x.particles.length,te=j?ae:pe,se=Date.now();if(teK?K:Math.max(0,se-re),te,z,K),Je=Math.round(Ce-te),We=0;We$.height||Se.y<-100||Se.x>$.width+100||Se.x<-100)&&(j&&te<=z?x.particles[he]=x.getParticle():x.removeParticleAt(he))}),ae>0||te0&&de.call($,$),$._options.run=!1)}),F(this,"reset",function(){$.generator&&$.generator.particlesGenerated>0&&($.generator.particlesGenerated=0,$.generator.particles=[],$.generator.lastNumberOfPieces=0)}),F(this,"stop",function(){$.options={run:!1},$.rafId&&(cancelAnimationFrame($.rafId),$.rafId=void 0)}),this.canvas=x;var J=this.canvas.getContext("2d");if(!J)throw new Error("Could not get canvas context");this.context=J,this.generator=new I(this.canvas,function(){return $.options}),this.options=ue,this.update()}var R,L;return R=O,(L=[{key:"options",get:function(){return this._options},set:function(x){var ue=this._options&&this._options.run,$=this._options&&this._options.recycle;this.setOptionsWithDefaults(x),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof x.recycle=="boolean"&&x.recycle&&$===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof x.run=="boolean"&&x.run&&ue===!1&&this.update()}}])&&M(R.prototype,L),O}();function w(O){return function(R){if(Array.isArray(R))return Y(R)}(O)||function(R){if(typeof Symbol<"u"&&Symbol.iterator in Object(R))return Array.from(R)}(O)||G(O)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. + */const P2=5*60,x2=ow("authIdTokenMaxAge")||P2;let og=null;const A2=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>x2)return;const i=n==null?void 0:n.token;og!==i&&(og=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function R2(t=uw()){const e=Ud(t,"auth");if(e.isInitialized())return e.getImmediate();const n=uk(t,{popupRedirectResolver:C2,persistence:[jk,Ck,s_]}),r=ow("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const l=A2(o.toString());wk(n,l,()=>l(n.currentUser)),yk(n,a=>l(a))}}const i=rw("auth");return i&&fk(n,`http://${i}`),n}function N2(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}ok({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{const o=yn("internal-error");o.customData=i,n(o)},r.type="text/javascript",r.charset="UTF-8",N2().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="});k2("Browser");let eh;(()=>{const e=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"}');eh=lw(e)})();bO(eh);const Dl=R2(eh),sg=new Fn,D2=()=>{const{setScreen:t,setUser:e,resetAppState:n}=ee.useContext(an),r=async()=>{try{await Sk(Dl),localStorage.clear(),n()}catch(i){console.error("Error signing out: ",i)}};return j.jsx("button",{onClick:r,children:"Logout"})},M2=()=>{Ji.setAppElement("#root");const t=ee.useRef(),{ocrData:e,user:n,setFormData:r,ocrModalOpen:i,setOcrModalOpen:o}=ee.useContext(an),l=p=>{o(!p)},a=p=>(n.addTransaction(p),n.updateFirebase()),u=()=>new lf(e),f=p=>{switch(p.target.value){case"edit":r(u());break;case"submit":if(e.isNotComplete()){alert("Data not complete. Switching to edit mode"),r(u());break}e.error?alert(e.message):a(e);break;case"tryAgain":setScreen("camera");break}l(i)},h=p=>p.error?j.jsxs("li",{className:"source-type-modal__list-item",children:[j.jsx("label",{children:"Error"}),j.jsx("div",{children:p.message})]}):Object.entries(p).filter(m=>m[1]!==null&&m[1]!==void 0).map((m,_)=>{if(m[0]!=="transactionId")return j.jsxs("li",{className:"source-type-modal__list-item",children:[j.jsx("label",{children:m[0]}),j.jsx("div",{children:m[1]})]},_)});return j.jsx("div",{className:"source-type",children:j.jsxs(Ji,{style:L2,isOpen:i,className:"source-type-modal","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var p;return(p=t.current)==null?void 0:p.focus()},0)},children:[j.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:h(e)}),j.jsx("div",{className:"source-type-modal__controls",children:e.error?j.jsx("button",{value:"tryAgain",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:f,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:f,children:"Edit Info"}),j.jsx("button",{value:"submit",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:f,children:"Submit"})]})})]})})},L2={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 p_={exports:{}};(function(t,e){(function(n,r){t.exports=r(ee)})(typeof self<"u"?self:fg,function(n){return function(r){var i={};function o(l){if(i[l])return i[l].exports;var a=i[l]={i:l,l:!1,exports:{}};return r[l].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=r,o.c=i,o.d=function(l,a,u){o.o(l,a)||Object.defineProperty(l,a,{enumerable:!0,get:u})},o.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},o.t=function(l,a){if(1&a&&(l=o(l)),8&a||4&a&&typeof l=="object"&&l&&l.__esModule)return l;var u=Object.create(null);if(o.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:l}),2&a&&typeof l!="string")for(var f in l)o.d(u,f,(function(h){return l[h]}).bind(null,f));return u},o.n=function(l){var a=l&&l.__esModule?function(){return l.default}:function(){return l};return o.d(a,"a",a),a},o.o=function(l,a){return Object.prototype.hasOwnProperty.call(l,a)},o.p="",o(o.s=2)}([function(r,i){r.exports=n},function(r,i,o){var l={linear:function(a,u,f,h){return(f-u)*a/h+u},easeInQuad:function(a,u,f,h){return(f-u)*(a/=h)*a+u},easeOutQuad:function(a,u,f,h){return-(f-u)*(a/=h)*(a-2)+u},easeInOutQuad:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a+u:-p/2*(--a*(a-2)-1)+u},easeInCubic:function(a,u,f,h){return(f-u)*(a/=h)*a*a+u},easeOutCubic:function(a,u,f,h){return(f-u)*((a=a/h-1)*a*a+1)+u},easeInOutCubic:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a+u:p/2*((a-=2)*a*a+2)+u},easeInQuart:function(a,u,f,h){return(f-u)*(a/=h)*a*a*a+u},easeOutQuart:function(a,u,f,h){return-(f-u)*((a=a/h-1)*a*a*a-1)+u},easeInOutQuart:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a*a+u:-p/2*((a-=2)*a*a*a-2)+u},easeInQuint:function(a,u,f,h){return(f-u)*(a/=h)*a*a*a*a+u},easeOutQuint:function(a,u,f,h){return(f-u)*((a=a/h-1)*a*a*a*a+1)+u},easeInOutQuint:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a*a*a+u:p/2*((a-=2)*a*a*a*a+2)+u},easeInSine:function(a,u,f,h){var p=f-u;return-p*Math.cos(a/h*(Math.PI/2))+p+u},easeOutSine:function(a,u,f,h){return(f-u)*Math.sin(a/h*(Math.PI/2))+u},easeInOutSine:function(a,u,f,h){return-(f-u)/2*(Math.cos(Math.PI*a/h)-1)+u},easeInExpo:function(a,u,f,h){return a==0?u:(f-u)*Math.pow(2,10*(a/h-1))+u},easeOutExpo:function(a,u,f,h){var p=f-u;return a==h?u+p:p*(1-Math.pow(2,-10*a/h))+u},easeInOutExpo:function(a,u,f,h){var p=f-u;return a===0?u:a===h?u+p:(a/=h/2)<1?p/2*Math.pow(2,10*(a-1))+u:p/2*(2-Math.pow(2,-10*--a))+u},easeInCirc:function(a,u,f,h){return-(f-u)*(Math.sqrt(1-(a/=h)*a)-1)+u},easeOutCirc:function(a,u,f,h){return(f-u)*Math.sqrt(1-(a=a/h-1)*a)+u},easeInOutCirc:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?-p/2*(Math.sqrt(1-a*a)-1)+u:p/2*(Math.sqrt(1-(a-=2)*a)+1)+u},easeInElastic:function(a,u,f,h){var p,m,_,g=f-u;return _=1.70158,a===0?u:(a/=h)==1?u+g:((m=0)||(m=.3*h),(p=g)=1&&this.rotationDirection===a.Positive?this.rotationDirection=a.Negative:this.rotateY<=-1&&this.rotationDirection===a.Negative&&(this.rotationDirection=a.Positive);var de=.1*this.rotationDirection;if(this.rotateY+=de,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=pe,this.context.lineCap="round",this.context.lineWidth=2,ye&&typeof ye=="function")ye.call(this,this.context);else switch(this.shape){case l.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case l.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case l.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}])&&_(R.prototype,L),O}();function D(O,R,L){return R in O?Object.defineProperty(O,R,{value:L,enumerable:!0,configurable:!0,writable:!0}):O[R]=L,O}var I=function O(R,L){var x=this;(function($,J){if(!($ instanceof J))throw new TypeError("Cannot call a class as a function")})(this,O),D(this,"canvas",void 0),D(this,"context",void 0),D(this,"getOptions",void 0),D(this,"x",0),D(this,"y",0),D(this,"w",0),D(this,"h",0),D(this,"lastNumberOfPieces",0),D(this,"tweenInitTime",Date.now()),D(this,"particles",[]),D(this,"particlesGenerated",0),D(this,"removeParticleAt",function($){x.particles.splice($,1)}),D(this,"getParticle",function(){var $=m(x.x,x.w+x.x),J=m(x.y,x.h+x.y);return new P(x.context,x.getOptions,$,J)}),D(this,"animate",function(){var $=x.canvas,J=x.context,pe=x.particlesGenerated,ye=x.lastNumberOfPieces,de=x.getOptions(),k=de.run,U=de.recycle,z=de.numberOfPieces,Z=de.debug,Q=de.tweenFunction,K=de.tweenDuration;if(!k)return!1;var ae=x.particles.length,te=U?ae:pe,se=Date.now();if(teK?K:Math.max(0,se-re),te,z,K),Je=Math.round(Ce-te),We=0;We$.height||Se.y<-100||Se.x>$.width+100||Se.x<-100)&&(U&&te<=z?x.particles[he]=x.getParticle():x.removeParticleAt(he))}),ae>0||te0&&de.call($,$),$._options.run=!1)}),F(this,"reset",function(){$.generator&&$.generator.particlesGenerated>0&&($.generator.particlesGenerated=0,$.generator.particles=[],$.generator.lastNumberOfPieces=0)}),F(this,"stop",function(){$.options={run:!1},$.rafId&&(cancelAnimationFrame($.rafId),$.rafId=void 0)}),this.canvas=x;var J=this.canvas.getContext("2d");if(!J)throw new Error("Could not get canvas context");this.context=J,this.generator=new I(this.canvas,function(){return $.options}),this.options=ue,this.update()}var R,L;return R=O,(L=[{key:"options",get:function(){return this._options},set:function(x){var ue=this._options&&this._options.run,$=this._options&&this._options.recycle;this.setOptionsWithDefaults(x),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof x.recycle=="boolean"&&x.recycle&&$===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof x.run=="boolean"&&x.run&&ue===!1&&this.update()}}])&&M(R.prototype,L),O}();function w(O){return function(R){if(Array.isArray(R))return Y(R)}(O)||function(R){if(typeof Symbol<"u"&&Symbol.iterator in Object(R))return Array.from(R)}(O)||G(O)||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 b(O){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(O)}function C(){return(C=Object.assign||function(O){for(var R=1;R"u"||!(Symbol.iterator in Object(L)))){var ue=[],$=!0,J=!1,pe=void 0;try{for(var ye,de=L[Symbol.iterator]();!($=(ye=de.next()).done)&&(ue.push(ye.value),!x||ue.length!==x);$=!0);}catch(k){J=!0,pe=k}finally{try{$||de.return==null||de.return()}finally{if(J)throw pe}}return ue}}(O,R)||G(O,R)||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 G(O,R){if(O){if(typeof O=="string")return Y(O,R);var L=Object.prototype.toString.call(O).slice(8,-1);return L==="Object"&&O.constructor&&(L=O.constructor.name),L==="Map"||L==="Set"?Array.from(O):L==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L)?Y(O,R):void 0}}function Y(O,R){(R==null||R>O.length)&&(R=O.length);for(var L=0,x=new Array(R);L"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 L,x=we(O);if(R){var ue=we(this).constructor;L=Reflect.construct(x,arguments,ue)}else L=x.apply(this,arguments);return le(this,L)}}function le(O,R){return!R||b(R)!=="object"&&typeof R!="function"?ve(O):R}function ve(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function we(O){return(we=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(O)}function _e(O,R,L){return R in O?Object.defineProperty(O,R,{value:L,enumerable:!0,configurable:!0,writable:!0}):O[R]=L,O}var Be=f.a.createRef(),Me=function(O){(function($,J){if(typeof J!="function"&&J!==null)throw new TypeError("Super expression must either be null or a function");$.prototype=Object.create(J&&J.prototype,{constructor:{value:$,writable:!0,configurable:!0}}),J&&W($,J)})(ue,O);var R,L,x=oe(ue);function ue($){var J;me(this,ue);for(var pe=arguments.length,ye=new Array(pe>1?pe-1:0),de=1;de{Ji.setAppElement("#root");const t=ee.useRef(),{serverResponse:e,setServerResponse:n,setOcrData:r}=ee.useContext(an),[i,o]=ee.useState(!!e),{width:l,height:a}=q2(),u=p=>{o(!p)},f=p=>{u(i),n(""),r(new Mt)},h=()=>[e].map((m,_)=>U.jsx("li",{className:"source-type-modal__list-item",children:U.jsx("label",{children:m})},_));return U.jsxs("div",{className:"source-type",children:[U.jsxs(Ji,{style:K2,isOpen:i,className:"source-type-modal","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var p;return(p=t.current)==null?void 0:p.focus()},0)},children:[U.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:h()}),U.jsx("div",{className:"source-type-modal__controls",children:U.jsx("button",{value:"Okay",className:"source-type-modal__control-btn source-type-modal__control-btn--apply",onClick:f,children:"Okay"})})]}),i&&U.jsx(j2,{width:l,height:a})]})},K2={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)"}},Y2=({show:t,achievement:e,onClose:n})=>{if(!t||!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},i={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",zIndex:999};return ge.createElement(ge.Fragment,null,ge.createElement("div",{style:i,onClick:n}),ge.createElement("div",{style:r,role:"dialog","aria-modal":"true","aria-labelledby":"achievement-title"},ge.createElement("h2",{id:"achievement-title"},"Achievement Unlocked!"),ge.createElement("img",{src:e.icon,alt:e.title,style:{width:"50px",height:"50px"}}),ge.createElement("h3",null,e.title),ge.createElement("p",null,e.description),ge.createElement("button",{onClick:n},"Okay")))};var Q2=ge.memo(Y2);const X2=({show:t,achievements:e,onClose:n})=>{if(!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,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 ge.createElement(ge.Fragment,null,ge.createElement("div",{style:i,onClick:n}),ge.createElement("div",{style:r,role:"dialog","aria-modal":"true","aria-labelledby":"badges-title"},ge.createElement("h2",{id:"badges-title"},"Your Achievements"),ge.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"center"}},e.map(o=>ge.createElement("div",{key:o.id,style:{margin:"10px",textAlign:"center"}},ge.createElement("img",{src:o.icon,alt:o.title,style:{width:"50px",height:"50px"}}),ge.createElement("h4",null,o.title)))),ge.createElement("button",{onClick:n,style:{marginTop:"20px"}},"Close")))};var J2=ge.memo(X2);const Z2=({onClick:t,position:e})=>{const n={position:"fixed",[e.split("-")[0]]:"20px",[e.split("-")[1]]:"20px",padding:"10px 20px",backgroundColor:"#007bff",color:"#fff",border:"none",borderRadius:"5px",cursor:"pointer",zIndex:998};return ge.createElement("button",{style:n,onClick:t},"View Achievements")};var eP=ge.memo(Z2),tP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nP(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var m_={exports:{}};(function(t,e){(function(n,r){t.exports=r(ge)})(typeof self<"u"?self:tP,function(n){return function(r){var i={};function o(l){if(i[l])return i[l].exports;var a=i[l]={i:l,l:!1,exports:{}};return r[l].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=r,o.c=i,o.d=function(l,a,u){o.o(l,a)||Object.defineProperty(l,a,{enumerable:!0,get:u})},o.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},o.t=function(l,a){if(1&a&&(l=o(l)),8&a||4&a&&typeof l=="object"&&l&&l.__esModule)return l;var u=Object.create(null);if(o.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:l}),2&a&&typeof l!="string")for(var f in l)o.d(u,f,(function(h){return l[h]}).bind(null,f));return u},o.n=function(l){var a=l&&l.__esModule?function(){return l.default}:function(){return l};return o.d(a,"a",a),a},o.o=function(l,a){return Object.prototype.hasOwnProperty.call(l,a)},o.p="",o(o.s=2)}([function(r,i){r.exports=n},function(r,i,o){var l={linear:function(a,u,f,h){return(f-u)*a/h+u},easeInQuad:function(a,u,f,h){return(f-u)*(a/=h)*a+u},easeOutQuad:function(a,u,f,h){return-(f-u)*(a/=h)*(a-2)+u},easeInOutQuad:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a+u:-p/2*(--a*(a-2)-1)+u},easeInCubic:function(a,u,f,h){return(f-u)*(a/=h)*a*a+u},easeOutCubic:function(a,u,f,h){return(f-u)*((a=a/h-1)*a*a+1)+u},easeInOutCubic:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a+u:p/2*((a-=2)*a*a+2)+u},easeInQuart:function(a,u,f,h){return(f-u)*(a/=h)*a*a*a+u},easeOutQuart:function(a,u,f,h){return-(f-u)*((a=a/h-1)*a*a*a-1)+u},easeInOutQuart:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a*a+u:-p/2*((a-=2)*a*a*a-2)+u},easeInQuint:function(a,u,f,h){return(f-u)*(a/=h)*a*a*a*a+u},easeOutQuint:function(a,u,f,h){return(f-u)*((a=a/h-1)*a*a*a*a+1)+u},easeInOutQuint:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a*a*a+u:p/2*((a-=2)*a*a*a*a+2)+u},easeInSine:function(a,u,f,h){var p=f-u;return-p*Math.cos(a/h*(Math.PI/2))+p+u},easeOutSine:function(a,u,f,h){return(f-u)*Math.sin(a/h*(Math.PI/2))+u},easeInOutSine:function(a,u,f,h){return-(f-u)/2*(Math.cos(Math.PI*a/h)-1)+u},easeInExpo:function(a,u,f,h){return a==0?u:(f-u)*Math.pow(2,10*(a/h-1))+u},easeOutExpo:function(a,u,f,h){var p=f-u;return a==h?u+p:p*(1-Math.pow(2,-10*a/h))+u},easeInOutExpo:function(a,u,f,h){var p=f-u;return a===0?u:a===h?u+p:(a/=h/2)<1?p/2*Math.pow(2,10*(a-1))+u:p/2*(2-Math.pow(2,-10*--a))+u},easeInCirc:function(a,u,f,h){return-(f-u)*(Math.sqrt(1-(a/=h)*a)-1)+u},easeOutCirc:function(a,u,f,h){return(f-u)*Math.sqrt(1-(a=a/h-1)*a)+u},easeInOutCirc:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?-p/2*(Math.sqrt(1-a*a)-1)+u:p/2*(Math.sqrt(1-(a-=2)*a)+1)+u},easeInElastic:function(a,u,f,h){var p,m,_,g=f-u;return _=1.70158,a===0?u:(a/=h)==1?u+g:((m=0)||(m=.3*h),(p=g)=1&&this.rotationDirection===a.Positive?this.rotationDirection=a.Negative:this.rotateY<=-1&&this.rotationDirection===a.Negative&&(this.rotationDirection=a.Positive);var de=.1*this.rotationDirection;if(this.rotateY+=de,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=pe,this.context.lineCap="round",this.context.lineWidth=2,ye&&typeof ye=="function")ye.call(this,this.context);else switch(this.shape){case l.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case l.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case l.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}])&&_(R.prototype,L),O}();function D(O,R,L){return R in O?Object.defineProperty(O,R,{value:L,enumerable:!0,configurable:!0,writable:!0}):O[R]=L,O}var I=function O(R,L){var x=this;(function($,J){if(!($ instanceof J))throw new TypeError("Cannot call a class as a function")})(this,O),D(this,"canvas",void 0),D(this,"context",void 0),D(this,"getOptions",void 0),D(this,"x",0),D(this,"y",0),D(this,"w",0),D(this,"h",0),D(this,"lastNumberOfPieces",0),D(this,"tweenInitTime",Date.now()),D(this,"particles",[]),D(this,"particlesGenerated",0),D(this,"removeParticleAt",function($){x.particles.splice($,1)}),D(this,"getParticle",function(){var $=m(x.x,x.w+x.x),J=m(x.y,x.h+x.y);return new P(x.context,x.getOptions,$,J)}),D(this,"animate",function(){var $=x.canvas,J=x.context,pe=x.particlesGenerated,ye=x.lastNumberOfPieces,de=x.getOptions(),k=de.run,j=de.recycle,z=de.numberOfPieces,Z=de.debug,Q=de.tweenFunction,K=de.tweenDuration;if(!k)return!1;var ae=x.particles.length,te=j?ae:pe,se=Date.now();if(teK?K:Math.max(0,se-re),te,z,K),Je=Math.round(Ce-te),We=0;We$.height||Se.y<-100||Se.x>$.width+100||Se.x<-100)&&(j&&te<=z?x.particles[he]=x.getParticle():x.removeParticleAt(he))}),ae>0||te0&&de.call($,$),$._options.run=!1)}),F(this,"reset",function(){$.generator&&$.generator.particlesGenerated>0&&($.generator.particlesGenerated=0,$.generator.particles=[],$.generator.lastNumberOfPieces=0)}),F(this,"stop",function(){$.options={run:!1},$.rafId&&(cancelAnimationFrame($.rafId),$.rafId=void 0)}),this.canvas=x;var J=this.canvas.getContext("2d");if(!J)throw new Error("Could not get canvas context");this.context=J,this.generator=new I(this.canvas,function(){return $.options}),this.options=ue,this.update()}var R,L;return R=O,(L=[{key:"options",get:function(){return this._options},set:function(x){var ue=this._options&&this._options.run,$=this._options&&this._options.recycle;this.setOptionsWithDefaults(x),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof x.recycle=="boolean"&&x.recycle&&$===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof x.run=="boolean"&&x.run&&ue===!1&&this.update()}}])&&M(R.prototype,L),O}();function w(O){return function(R){if(Array.isArray(R))return Y(R)}(O)||function(R){if(typeof Symbol<"u"&&Symbol.iterator in Object(R))return Array.from(R)}(O)||G(O)||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 G(O,R){if(O){if(typeof O=="string")return Y(O,R);var L=Object.prototype.toString.call(O).slice(8,-1);return L==="Object"&&O.constructor&&(L=O.constructor.name),L==="Map"||L==="Set"?Array.from(O):L==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L)?Y(O,R):void 0}}function Y(O,R){(R==null||R>O.length)&&(R=O.length);for(var L=0,x=new Array(R);L"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 L,x=we(O);if(R){var ue=we(this).constructor;L=Reflect.construct(x,arguments,ue)}else L=x.apply(this,arguments);return le(this,L)}}function le(O,R){return!R||b(R)!=="object"&&typeof R!="function"?ve(O):R}function ve(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function we(O){return(we=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(O)}function _e(O,R,L){return R in O?Object.defineProperty(O,R,{value:L,enumerable:!0,configurable:!0,writable:!0}):O[R]=L,O}var Be=f.a.createRef(),Me=function(O){(function($,J){if(typeof J!="function"&&J!==null)throw new TypeError("Super expression must either be null or a function");$.prototype=Object.create(J&&J.prototype,{constructor:{value:$,writable:!0,configurable:!0}}),J&&W($,J)})(ue,O);var R,L,x=oe(ue);function ue($){var J;me(this,ue);for(var pe=arguments.length,ye=new Array(pe>1?pe-1:0),de=1;de{Ji.setAppElement("#root");const t=ee.useRef(),{serverResponse:e,setServerResponse:n,setOcrData:r}=ee.useContext(an),[i,o]=ee.useState(!!e),{width:l,height:a}=G2(),u=p=>{o(!p)},f=p=>{u(i),n(""),r(new Mt)},h=()=>[e].map((m,_)=>j.jsx("li",{className:"source-type-modal__list-item",children:j.jsx("label",{children:m})},_));return j.jsxs("div",{className:"source-type",children:[j.jsxs(Ji,{style:Y2,isOpen:i,className:"source-type-modal","aria-labelledby":"source-type-dialog-label",onAfterOpen:()=>{setTimeout(()=>{var p;return(p=t.current)==null?void 0:p.focus()},0)},children:[j.jsx("ul",{className:"source-type-modal__list",role:"group","aria-labelledby":"source-type-dialog-label",children:h()}),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:f,children:"Okay"})})]}),i&&j.jsx(U2,{width:l,height:a})]})},Y2={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)"}},Q2=({show:t,achievement:e,onClose:n})=>{if(!t||!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},i={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",zIndex:999};return ge.createElement(ge.Fragment,null,ge.createElement("div",{style:i,onClick:n}),ge.createElement("div",{style:r,role:"dialog","aria-modal":"true","aria-labelledby":"achievement-title"},ge.createElement("h2",{id:"achievement-title"},"Achievement Unlocked!"),ge.createElement("img",{src:e.icon,alt:e.title,style:{width:"50px",height:"50px"}}),ge.createElement("h3",null,e.title),ge.createElement("p",null,e.description),ge.createElement("button",{onClick:n},"Okay")))};var X2=ge.memo(Q2);const J2=({show:t,achievements:e,onClose:n})=>{if(!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,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 ge.createElement(ge.Fragment,null,ge.createElement("div",{style:i,onClick:n}),ge.createElement("div",{style:r,role:"dialog","aria-modal":"true","aria-labelledby":"badges-title"},ge.createElement("h2",{id:"badges-title"},"Your Achievements"),ge.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"center"}},e.map(o=>ge.createElement("div",{key:o.id,style:{margin:"10px",textAlign:"center"}},ge.createElement("img",{src:o.icon,alt:o.title,style:{width:"50px",height:"50px"}}),ge.createElement("h4",null,o.title)))),ge.createElement("button",{onClick:n,style:{marginTop:"20px"}},"Close")))};var Z2=ge.memo(J2);const eP=({onClick:t,position:e})=>{const n={position:"fixed",[e.split("-")[0]]:"20px",[e.split("-")[1]]:"20px",padding:"10px 20px",backgroundColor:"#007bff",color:"#fff",border:"none",borderRadius:"5px",cursor:"pointer",zIndex:998};return ge.createElement("button",{style:n,onClick:t},"View Achievements")};var tP=ge.memo(eP),nP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rP(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var g_={exports:{}};(function(t,e){(function(n,r){t.exports=r(ge)})(typeof self<"u"?self:nP,function(n){return function(r){var i={};function o(l){if(i[l])return i[l].exports;var a=i[l]={i:l,l:!1,exports:{}};return r[l].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=r,o.c=i,o.d=function(l,a,u){o.o(l,a)||Object.defineProperty(l,a,{enumerable:!0,get:u})},o.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},o.t=function(l,a){if(1&a&&(l=o(l)),8&a||4&a&&typeof l=="object"&&l&&l.__esModule)return l;var u=Object.create(null);if(o.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:l}),2&a&&typeof l!="string")for(var f in l)o.d(u,f,(function(h){return l[h]}).bind(null,f));return u},o.n=function(l){var a=l&&l.__esModule?function(){return l.default}:function(){return l};return o.d(a,"a",a),a},o.o=function(l,a){return Object.prototype.hasOwnProperty.call(l,a)},o.p="",o(o.s=2)}([function(r,i){r.exports=n},function(r,i,o){var l={linear:function(a,u,f,h){return(f-u)*a/h+u},easeInQuad:function(a,u,f,h){return(f-u)*(a/=h)*a+u},easeOutQuad:function(a,u,f,h){return-(f-u)*(a/=h)*(a-2)+u},easeInOutQuad:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a+u:-p/2*(--a*(a-2)-1)+u},easeInCubic:function(a,u,f,h){return(f-u)*(a/=h)*a*a+u},easeOutCubic:function(a,u,f,h){return(f-u)*((a=a/h-1)*a*a+1)+u},easeInOutCubic:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a+u:p/2*((a-=2)*a*a+2)+u},easeInQuart:function(a,u,f,h){return(f-u)*(a/=h)*a*a*a+u},easeOutQuart:function(a,u,f,h){return-(f-u)*((a=a/h-1)*a*a*a-1)+u},easeInOutQuart:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a*a+u:-p/2*((a-=2)*a*a*a-2)+u},easeInQuint:function(a,u,f,h){return(f-u)*(a/=h)*a*a*a*a+u},easeOutQuint:function(a,u,f,h){return(f-u)*((a=a/h-1)*a*a*a*a+1)+u},easeInOutQuint:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?p/2*a*a*a*a*a+u:p/2*((a-=2)*a*a*a*a+2)+u},easeInSine:function(a,u,f,h){var p=f-u;return-p*Math.cos(a/h*(Math.PI/2))+p+u},easeOutSine:function(a,u,f,h){return(f-u)*Math.sin(a/h*(Math.PI/2))+u},easeInOutSine:function(a,u,f,h){return-(f-u)/2*(Math.cos(Math.PI*a/h)-1)+u},easeInExpo:function(a,u,f,h){return a==0?u:(f-u)*Math.pow(2,10*(a/h-1))+u},easeOutExpo:function(a,u,f,h){var p=f-u;return a==h?u+p:p*(1-Math.pow(2,-10*a/h))+u},easeInOutExpo:function(a,u,f,h){var p=f-u;return a===0?u:a===h?u+p:(a/=h/2)<1?p/2*Math.pow(2,10*(a-1))+u:p/2*(2-Math.pow(2,-10*--a))+u},easeInCirc:function(a,u,f,h){return-(f-u)*(Math.sqrt(1-(a/=h)*a)-1)+u},easeOutCirc:function(a,u,f,h){return(f-u)*Math.sqrt(1-(a=a/h-1)*a)+u},easeInOutCirc:function(a,u,f,h){var p=f-u;return(a/=h/2)<1?-p/2*(Math.sqrt(1-a*a)-1)+u:p/2*(Math.sqrt(1-(a-=2)*a)+1)+u},easeInElastic:function(a,u,f,h){var p,m,_,g=f-u;return _=1.70158,a===0?u:(a/=h)==1?u+g:((m=0)||(m=.3*h),(p=g)=1&&this.rotationDirection===a.Positive?this.rotationDirection=a.Negative:this.rotateY<=-1&&this.rotationDirection===a.Negative&&(this.rotationDirection=a.Positive);var de=.1*this.rotationDirection;if(this.rotateY+=de,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=pe,this.context.lineCap="round",this.context.lineWidth=2,ye&&typeof ye=="function")ye.call(this,this.context);else switch(this.shape){case l.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case l.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case l.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}])&&_(R.prototype,L),O}();function D(O,R,L){return R in O?Object.defineProperty(O,R,{value:L,enumerable:!0,configurable:!0,writable:!0}):O[R]=L,O}var I=function O(R,L){var x=this;(function($,J){if(!($ instanceof J))throw new TypeError("Cannot call a class as a function")})(this,O),D(this,"canvas",void 0),D(this,"context",void 0),D(this,"getOptions",void 0),D(this,"x",0),D(this,"y",0),D(this,"w",0),D(this,"h",0),D(this,"lastNumberOfPieces",0),D(this,"tweenInitTime",Date.now()),D(this,"particles",[]),D(this,"particlesGenerated",0),D(this,"removeParticleAt",function($){x.particles.splice($,1)}),D(this,"getParticle",function(){var $=m(x.x,x.w+x.x),J=m(x.y,x.h+x.y);return new P(x.context,x.getOptions,$,J)}),D(this,"animate",function(){var $=x.canvas,J=x.context,pe=x.particlesGenerated,ye=x.lastNumberOfPieces,de=x.getOptions(),k=de.run,U=de.recycle,z=de.numberOfPieces,Z=de.debug,Q=de.tweenFunction,K=de.tweenDuration;if(!k)return!1;var ae=x.particles.length,te=U?ae:pe,se=Date.now();if(teK?K:Math.max(0,se-re),te,z,K),Je=Math.round(Ce-te),We=0;We$.height||Se.y<-100||Se.x>$.width+100||Se.x<-100)&&(U&&te<=z?x.particles[he]=x.getParticle():x.removeParticleAt(he))}),ae>0||te0&&de.call($,$),$._options.run=!1)}),F(this,"reset",function(){$.generator&&$.generator.particlesGenerated>0&&($.generator.particlesGenerated=0,$.generator.particles=[],$.generator.lastNumberOfPieces=0)}),F(this,"stop",function(){$.options={run:!1},$.rafId&&(cancelAnimationFrame($.rafId),$.rafId=void 0)}),this.canvas=x;var J=this.canvas.getContext("2d");if(!J)throw new Error("Could not get canvas context");this.context=J,this.generator=new I(this.canvas,function(){return $.options}),this.options=ue,this.update()}var R,L;return R=O,(L=[{key:"options",get:function(){return this._options},set:function(x){var ue=this._options&&this._options.run,$=this._options&&this._options.recycle;this.setOptionsWithDefaults(x),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof x.recycle=="boolean"&&x.recycle&&$===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof x.run=="boolean"&&x.run&&ue===!1&&this.update()}}])&&M(R.prototype,L),O}();function w(O){return function(R){if(Array.isArray(R))return Y(R)}(O)||function(R){if(typeof Symbol<"u"&&Symbol.iterator in Object(R))return Array.from(R)}(O)||G(O)||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 b(O){return(b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(O)}function C(){return(C=Object.assign||function(O){for(var R=1;R"u"||!(Symbol.iterator in Object(L)))){var ue=[],$=!0,J=!1,pe=void 0;try{for(var ye,de=L[Symbol.iterator]();!($=(ye=de.next()).done)&&(ue.push(ye.value),!x||ue.length!==x);$=!0);}catch(k){J=!0,pe=k}finally{try{$||de.return==null||de.return()}finally{if(J)throw pe}}return ue}}(O,R)||G(O,R)||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 G(O,R){if(O){if(typeof O=="string")return Y(O,R);var L=Object.prototype.toString.call(O).slice(8,-1);return L==="Object"&&O.constructor&&(L=O.constructor.name),L==="Map"||L==="Set"?Array.from(O):L==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L)?Y(O,R):void 0}}function Y(O,R){(R==null||R>O.length)&&(R=O.length);for(var L=0,x=new Array(R);L"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 L,x=we(O);if(R){var ue=we(this).constructor;L=Reflect.construct(x,arguments,ue)}else L=x.apply(this,arguments);return le(this,L)}}function le(O,R){return!R||b(R)!=="object"&&typeof R!="function"?ve(O):R}function ve(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function we(O){return(we=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(O)}function _e(O,R,L){return R in O?Object.defineProperty(O,R,{value:L,enumerable:!0,configurable:!0,writable:!0}):O[R]=L,O}var Be=f.a.createRef(),Me=function(O){(function($,J){if(typeof J!="function"&&J!==null)throw new TypeError("Super expression must either be null or a function");$.prototype=Object.create(J&&J.prototype,{constructor:{value:$,writable:!0,configurable:!0}}),J&&W($,J)})(ue,O);var R,L,x=oe(ue);function ue($){var J;me(this,ue);for(var pe=arguments.length,ye=new Array(pe>1?pe-1:0),de=1;de{const{width:n,height:r}=cP();return t?ge.createElement(iP,Object.assign({width:n,height:r},e)):null},dP=ee.createContext(void 0),hP=({children:t,config:e,initialState:n={},storageKey:r="react-achievements",badgesButtonPosition:i="top-right"})=>{const o=M=>Object.keys(e).reduce((F,q)=>(q in M?F[q]=M[q]:F[q]=[],F),{}),l=()=>{const M=Object.values(e).flatMap(F=>F.filter(q=>f.includes(q.data.id)).map(q=>q.data));return console.log(M),M},[a,u]=ee.useState(()=>{const M=localStorage.getItem(`${r}-metrics`);return M?JSON.parse(M):o(n)}),[f,h]=ee.useState(()=>{const M=localStorage.getItem(`${r}-achievements`);return M?JSON.parse(M):[]}),[p,m]=ee.useState(null),[_,g]=ee.useState(!1),[P,D]=ee.useState(!1);ee.useEffect(()=>{localStorage.setItem(`${r}-metrics`,JSON.stringify(a))},[a,r]);const I=ee.useCallback(()=>{const M=[];if(Object.entries(e).forEach(([F,q])=>{const T=a[F];q.forEach(w=>{w.check(T)&&!f.includes(w.data.id)&&M.push(w.data)})}),M.length>0){const F=[...f,...M.map(q=>q.id)];h(F),localStorage.setItem(`${r}-achievements`,JSON.stringify(F)),m(M[0]),D(!0)}},[e,a,f,r]);ee.useEffect(()=>{I()},[I]);const S=()=>{g(!0)},E={metrics:a,setMetrics:M=>{u(F=>typeof M=="function"?M(F):M)},achievedAchievements:f,checkAchievements:I,showBadgesModal:S};return ge.createElement(dP.Provider,{value:E},t,ge.createElement(Q2,{show:!!p,achievement:p,onClose:()=>{m(null),D(!1)}}),ge.createElement(J2,{show:_,achievements:l(),onClose:()=>g(!1)}),ge.createElement(eP,{onClick:S,position:i}),ge.createElement(fP,{show:P}))},ba="/simplitrac_frontend/assets/badge_1-C-eV18Km.png",pP={transactions:[{check:t=>t.length>=1,data:{id:"first_transaction",title:"First Transaction",description:"Completed your first transaction",icon:ba}},{check:t=>t.length>=10,data:{id:"ten_transactions",title:"Ten Transactions",description:"Completed ten transactions",icon:ba}}],categories:[{check:t=>t.length>=1,data:{id:"first_category",title:"First Category",description:"Created your first category",icon:ba}},{check:t=>t.length>=5,data:{id:"five_categories",title:"Five Categories",description:"Created five categories",icon:ba}}]},mP=()=>{const{setScreen:t,ocrData:e,serverResponse:n,setServerResponse:r,user:i}=ee.useContext(an),o=l=>{l!==void 0&&t(l)};return ee.useEffect(()=>{n&&r(null)},[i]),U.jsx(hP,{config:pP,initialState:i.serialize(),badgesButtonPosition:"top-right",children:U.jsxs(eu,{fluid:!0,className:"landing-container",children:[i.first_name&&U.jsxs(U.Fragment,{children:[U.jsxs("p",{children:["Welcome ",i.first_name," ",i.last_name]}),i.isNewUser()&&U.jsx(TC,{}),e&&U.jsx(D2,{}),n&&U.jsx(G2,{})]}),U.jsx("div",{className:"landing-header",children:U.jsx("h1",{children:"SimpliTrac"})}),U.jsx("div",{className:"landing-content",children:U.jsx(oT,{})}),U.jsxs("div",{className:"buttons-container",children:[U.jsx("button",{className:"custom-button",onClick:()=>o("camera"),children:"Camera"}),U.jsx("button",{className:"custom-button",onClick:()=>o("chart"),children:"Chart"}),U.jsx("button",{className:"custom-button",onClick:()=>o("edit"),children:"Edit Transactions"}),U.jsx("button",{className:"custom-button",onClick:()=>o("userguide"),children:"User Guide"})]}),U.jsx("div",{className:"landing-content",children:U.jsx(N2,{})})]})})},gP="/simplitrac_frontend/assets/simplitrac-Bu0G2zUg.webp",vP=()=>{const{setScreen:t,setUser:e}=ee.useContext(an);let n=new $t(JSON.parse(localStorage.getItem("user")));if(localStorage.length!==0){e(n),t("landing");return}const r=async()=>{try{const l=await Xm(Nl,og),a=l.user.uid;let u=await $t.getUserFromFirestore(a);if(!u.isNewUser()){alert("Sorry, you already have an account."),t();return}u=new $t(l.user),await o(new $t(u)),e(u),localStorage.setItem("user",u),t("landing")}catch(l){console.log(l)}},i=async()=>{try{const a=(await Xm(Nl,og)).user.uid;let u=await $t.getUserFromFirestore(a);if(u.isNewUser()){alert("Sorry. You do not have an account."),t("");return}e(u),localStorage.setItem("user",u),t("landing")}catch(l){console.error(l)}};async function o(l){const a={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(l)},f=await fetch("https://us-central1-simplitracapp.cloudfunctions.net/create_new_user",a);console.log(f)}return U.jsxs(U.Fragment,{children:[U.jsx(eu,{children:U.jsx(Ad,{children:U.jsx(Pd,{xs:1,md:1,children:U.jsx(xd,{src:gP,role:"logo",style:{width:"300px",height:"300px"},roundedCircle:!0})})})}),U.jsxs("div",{children:[U.jsx("button",{onClick:r,children:" New User Sign Up"}),U.jsx("button",{onClick:i,children:" Existing User Sign In"})]})]})},yP=()=>{const[t,e]=ee.useState("");return ee.useEffect(()=>{const n=wk(Nl,r=>{r?(e(r.email),console.log(`User Email set: ${r.email}`)):(e(""),console.log("No user is signed in"))});return()=>n()},[]),U.jsxs("div",{className:"App",children:[U.jsx("h1",{children:"SimpliTrac"}),t?U.jsx(wP,{user_email:t}):U.jsx("p",{children:"Please Enter in an Expense."}),U.jsx(Id,{})]})},wP=({user_email:t})=>{const e=`https://lookerstudio.google.com/embed/reporting/ae330055-31b8-4e65-a1a9-f0bbd1cda92f/page/87O5D?params=${encodeURIComponent(`{"user_email": "${t}","filter": {"user_email": "${t}"} }`)}`;return ee.useEffect(()=>{console.log(`Report URL: ${e}`)},[e]),U.jsx("div",{className:"report-container",children:U.jsx("iframe",{id:"report-frame",width:"900",height:"600",src:e,style:{border:0},allowFullScreen:!0})})},_P=()=>{const{user:t,setUser:e,setScreen:n,setServerResponse:r}=ee.useContext(an),[i,o]=ee.useState([]),[l,a]=ee.useState([]),[u,f]=ee.useState([]);ee.useEffect(()=>{t&&t.transactions&&o(t.transactions),t&&t.categories&&a(["Select Category",...t.categories.map(D=>D.category_name)])},[t]);const{control:h,handleSubmit:p,watch:m}=Fy(),_=async D=>{const I=i.map((M,F)=>{const q=new Mt(M);return q.vendor=D[`vendor-${F}`],q.amount=parseFloat(D[`amount-${F}`]),q.category={name:D[`category-${F}`]},q.createdAt=D[`date-${F}`],q}),S=new $t(t);S.transactions=I;const E=await S.deleteTransactions();E instanceof $t&&(e(E),r("Transactions Successfully Updated"),localStorage.clear(),localStorage.setItem("user",E),n("landing"))},g=()=>{n("landing")},P=async D=>{if(window.confirm("Are you sure you want to delete this transaction?")){const I=i.filter(M=>M.transactionId!==D);o(I),f();const S=new $t(t);S.transactions=I;const E=await S.updateFirebase();E instanceof $t&&(e(E),r("Transaction Successfully Deleted"))}};return U.jsxs("form",{onSubmit:p(_),children:[U.jsx("h2",{children:"Edit Transactions"}),i.map((D,I)=>U.jsxs("div",{className:"transaction-edit-row",children:[U.jsx("label",{children:"Date"}),U.jsx(mr,{name:`date-${I}`,control:h,defaultValue:D.createdAt,render:({field:S})=>U.jsx("input",{type:"date",...S})}),U.jsx("label",{children:"Vendor"}),U.jsx(mr,{name:`vendor-${I}`,control:h,defaultValue:D.vendor,render:({field:S})=>U.jsx("input",{type:"text",...S})}),U.jsx("label",{children:"Amount"}),U.jsx(mr,{name:`amount-${I}`,control:h,defaultValue:D.amount,render:({field:S})=>U.jsx("input",{type:"number",step:"0.01",...S})}),U.jsx("label",{children:"Category"}),U.jsx(mr,{name:`category-${I}`,control:h,defaultValue:D.category_name||"Select Category",render:({field:S})=>U.jsx("select",{...S,children:l.map(E=>U.jsx("option",{value:E,children:E},E))})}),U.jsx("button",{type:"button",className:"custom-button delete-button",onClick:()=>P(D.transactionId),children:"Delete"})]},D.transactionId)),U.jsxs("div",{className:"edit-buttons",children:[U.jsx("button",{type:"submit",className:"custom-button",children:"Save Changes"}),U.jsx("button",{type:"button",className:"custom-button",onClick:g,children:"Cancel"}),U.jsx("button",{type:"button",className:"custom-button",onClick:g,children:"Back"})]})]})},SP="/simplitrac_frontend/assets/simplitrac_logo-CakUhnBD.png",EP=()=>U.jsxs(U.Fragment,{children:[U.jsx(eu,{children:U.jsx(Ad,{children:U.jsx(Pd,{xs:1,md:1,children:U.jsx(xd,{src:SP,role:"logo",style:{width:"300px",height:"300px"},roundedCircle:!0})})})}),U.jsxs("div",{children:[U.jsx("p",{children:"Welcome to the SimpliTrac User Guide!"}),U.jsx("p",{children:"Our application is a simple to use financial tracker that allows you to record expenses on the go."}),U.jsx("p",{children:" -------------------------------------------- "}),U.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."}),U.jsx("p",{children:" -------------------------------------------- "}),U.jsx("p",{children:"Or you can manually enter your expenses on the main page with our easy to use Expense Table."}),U.jsx("p",{children:" -------------------------------------------- "}),U.jsx("p",{children:"See where your money is going in real time with our handy Chart feature."}),U.jsx("p",{children:" -------------------------------------------- "}),U.jsx("p",{children:"And use the Edit Transaction function to correct any errors in your expense processing."}),U.jsx("p",{children:" -------------------------------------------- "}),U.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!"}),U.jsx(Id,{})]})]});function bP(){const{screen:t,setScreen:e,user:n}=ee.useContext(an);return(()=>{switch(t){case"landing":return U.jsx(mP,{});case"chart":return U.jsx(yP,{});case"camera":return U.jsx(yT,{});case"edit":return U.jsx(_P,{});case"userguide":return U.jsx(EP,{});default:return U.jsx(vP,{})}})()}uc.createRoot(document.getElementById("root")).render(U.jsx(ge.StrictMode,{children:U.jsx(iT,{children:U.jsx(bP,{})})})); +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function G(O,R){if(O){if(typeof O=="string")return Y(O,R);var L=Object.prototype.toString.call(O).slice(8,-1);return L==="Object"&&O.constructor&&(L=O.constructor.name),L==="Map"||L==="Set"?Array.from(O):L==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(L)?Y(O,R):void 0}}function Y(O,R){(R==null||R>O.length)&&(R=O.length);for(var L=0,x=new Array(R);L"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 L,x=we(O);if(R){var ue=we(this).constructor;L=Reflect.construct(x,arguments,ue)}else L=x.apply(this,arguments);return le(this,L)}}function le(O,R){return!R||b(R)!=="object"&&typeof R!="function"?ve(O):R}function ve(O){if(O===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O}function we(O){return(we=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)})(O)}function _e(O,R,L){return R in O?Object.defineProperty(O,R,{value:L,enumerable:!0,configurable:!0,writable:!0}):O[R]=L,O}var Be=f.a.createRef(),Me=function(O){(function($,J){if(typeof J!="function"&&J!==null)throw new TypeError("Super expression must either be null or a function");$.prototype=Object.create(J&&J.prototype,{constructor:{value:$,writable:!0,configurable:!0}}),J&&W($,J)})(ue,O);var R,L,x=oe(ue);function ue($){var J;me(this,ue);for(var pe=arguments.length,ye=new Array(pe>1?pe-1:0),de=1;de{const{width:n,height:r}=fP();return t?ge.createElement(oP,Object.assign({width:n,height:r},e)):null},hP=ee.createContext(void 0),pP=({children:t,config:e,initialState:n={},storageKey:r="react-achievements",badgesButtonPosition:i="top-right"})=>{const o=M=>Object.keys(e).reduce((F,q)=>(q in M?F[q]=M[q]:F[q]=[],F),{}),l=()=>{const M=Object.values(e).flatMap(F=>F.filter(q=>f.includes(q.data.id)).map(q=>q.data));return console.log(M),M},[a,u]=ee.useState(()=>{const M=localStorage.getItem(`${r}-metrics`);return M?JSON.parse(M):o(n)}),[f,h]=ee.useState(()=>{const M=localStorage.getItem(`${r}-achievements`);return M?JSON.parse(M):[]}),[p,m]=ee.useState(null),[_,g]=ee.useState(!1),[P,D]=ee.useState(!1);ee.useEffect(()=>{localStorage.setItem(`${r}-metrics`,JSON.stringify(a))},[a,r]);const I=ee.useCallback(()=>{const M=[];if(Object.entries(e).forEach(([F,q])=>{const T=a[F];q.forEach(w=>{w.check(T)&&!f.includes(w.data.id)&&M.push(w.data)})}),M.length>0){const F=[...f,...M.map(q=>q.id)];h(F),localStorage.setItem(`${r}-achievements`,JSON.stringify(F)),m(M[0]),D(!0)}},[e,a,f,r]);ee.useEffect(()=>{I()},[I]);const S=()=>{g(!0)},E={metrics:a,setMetrics:M=>{u(F=>typeof M=="function"?M(F):M)},achievedAchievements:f,checkAchievements:I,showBadgesModal:S};return ge.createElement(hP.Provider,{value:E},t,ge.createElement(X2,{show:!!p,achievement:p,onClose:()=>{m(null),D(!1)}}),ge.createElement(Z2,{show:_,achievements:l(),onClose:()=>g(!1)}),ge.createElement(tP,{onClick:S,position:i}),ge.createElement(dP,{show:P}))},ba="/simplitrac_frontend/assets/badge_1-C-eV18Km.png",mP={transactions:[{check:t=>t.length>=1,data:{id:"first_transaction",title:"First Transaction",description:"Completed your first transaction",icon:ba}},{check:t=>t.length>=10,data:{id:"ten_transactions",title:"Ten Transactions",description:"Completed ten transactions",icon:ba}}],categories:[{check:t=>t.length>=1,data:{id:"first_category",title:"First Category",description:"Created your first category",icon:ba}},{check:t=>t.length>=5,data:{id:"five_categories",title:"Five Categories",description:"Created five categories",icon:ba}}]},gP=()=>{const{setScreen:t,ocrData:e,serverResponse:n,setServerResponse:r,user:i}=ee.useContext(an),o=l=>{l!==void 0&&t(l)};return ee.useEffect(()=>{n&&r(null)},[i]),j.jsx(pP,{config:mP,initialState:i.serialize(),badgesButtonPosition:"top-right",children:j.jsxs(tu,{fluid:!0,className:"landing-container",children:[i.first_name&&j.jsxs(j.Fragment,{children:[j.jsxs("p",{children:["Welcome ",i.first_name," ",i.last_name]}),i.isNewUser()&&j.jsx(CC,{}),e&&j.jsx(M2,{}),n&&j.jsx(K2,{})]}),j.jsx("div",{className:"landing-header",children:j.jsx("h1",{children:"SimpliTrac"})}),j.jsx("div",{className:"landing-content",children:j.jsx(sT,{})}),j.jsxs("div",{className:"buttons-container",children:[j.jsx("button",{className:"custom-button",onClick:()=>o("camera"),children:"Camera"}),j.jsx("button",{className:"custom-button",onClick:()=>o("chart"),children:"Chart"}),j.jsx("button",{className:"custom-button",onClick:()=>o("edit"),children:"Edit Transactions"}),j.jsx("button",{className:"custom-button",onClick:()=>o("userguide"),children:"User Guide"})]}),j.jsx("div",{className:"landing-content",children:j.jsx(D2,{})})]})})},vP="/simplitrac_frontend/assets/simplitrac-Bu0G2zUg.webp",yP="/simplitrac_frontend/assets/simplitrac_logo-CakUhnBD.png",wP=()=>{const t=["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:Ta.container,children:[j.jsx("h2",{style:Ta.title,children:"Website Features"}),j.jsx("ul",{style:Ta.list,children:t.map((e,n)=>j.jsx("li",{style:Ta.listItem,children:e},n))})]})},Ta={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"}},_P=()=>{const{setScreen:t,setUser:e}=ee.useContext(an);let n=new $t(JSON.parse(localStorage.getItem("user")));if(localStorage.length!==0){e(n),t("landing");return}const r=async()=>{try{const l=await Jm(Dl,sg),a=l.user.uid;let u=await $t.getUserFromFirestore(a);if(!u.isNewUser()){alert("Sorry, you already have an account."),t();return}u=new $t(l.user),await o(new $t(u)),e(u),localStorage.setItem("user",u),t("landing")}catch(l){console.log(l)}},i=async()=>{try{const a=(await Jm(Dl,sg)).user.uid;let u=await $t.getUserFromFirestore(a);if(u.isNewUser()){alert("Sorry. You do not have an account."),t("");return}e(u),localStorage.setItem("user",u),t("landing")}catch(l){console.error(l)}};async function o(l){const a={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(l)},f=await fetch("https://us-central1-simplitracapp.cloudfunctions.net/create_new_user",a);console.log(f)}return j.jsxs(j.Fragment,{children:[j.jsx(tu,{children:j.jsx(Rd,{children:j.jsx(xd,{xs:1,md:1,children:j.jsx(Ad,{src:vP,role:"logo",style:{width:"300px",height:"300px"},roundedCircle:!0})})})}),j.jsxs("div",{children:[j.jsx("button",{onClick:r,children:" New User Sign Up"}),j.jsx("div",{}),j.jsx("button",{onClick:i,children:" Existing User Sign In"}),j.jsx("div",{children:j.jsx(wP,{})})]})]})},SP=()=>{const[t,e]=ee.useState("");return ee.useEffect(()=>{const n=_k(Dl,r=>{r?(e(r.email),console.log(`User Email set: ${r.email}`)):(e(""),console.log("No user is signed in"))});return()=>n()},[]),j.jsxs("div",{className:"App",children:[j.jsx("h1",{children:"SimpliTrac"}),t?j.jsx(EP,{user_email:t}):j.jsx("p",{children:"Please Enter in an Expense."}),j.jsx(Od,{})]})},EP=({user_email:t})=>{const e=`https://lookerstudio.google.com/embed/reporting/ae330055-31b8-4e65-a1a9-f0bbd1cda92f/page/87O5D?params=${encodeURIComponent(`{"user_email": "${t}","filter": {"user_email": "${t}"} }`)}`;return ee.useEffect(()=>{console.log(`Report URL: ${e}`)},[e]),j.jsx("div",{className:"report-container",children:j.jsx("iframe",{id:"report-frame",width:"900",height:"600",src:e,style:{border:0},allowFullScreen:!0})})},bP=()=>{const{user:t,setUser:e,setScreen:n,setServerResponse:r}=ee.useContext(an),[i,o]=ee.useState([]),[l,a]=ee.useState([]),[u,f]=ee.useState([]);ee.useEffect(()=>{t&&t.transactions&&o(t.transactions),t&&t.categories&&a(["Select Category",...t.categories.map(D=>D.category_name)])},[t]);const{control:h,handleSubmit:p,watch:m}=Vy(),_=async D=>{const I=i.map((M,F)=>{const q=new Mt(M);return q.vendor=D[`vendor-${F}`],q.amount=parseFloat(D[`amount-${F}`]),q.category={name:D[`category-${F}`]},q.createdAt=D[`date-${F}`],q}),S=new $t(t);S.transactions=I;const E=await S.deleteTransactions();E instanceof $t&&(e(E),r("Transactions Successfully Updated"),localStorage.clear(),localStorage.setItem("user",E),n("landing"))},g=()=>{n("landing")},P=async D=>{if(window.confirm("Are you sure you want to delete this transaction?")){const I=i.filter(M=>M.transactionId!==D);o(I),f();const S=new $t(t);S.transactions=I;const E=await S.updateFirebase();E instanceof $t&&(e(E),r("Transaction Successfully Deleted"))}};return j.jsxs("form",{onSubmit:p(_),children:[j.jsx("h2",{children:"Edit Transactions"}),i.map((D,I)=>j.jsxs("div",{className:"transaction-edit-row",children:[j.jsx("label",{children:"Date"}),j.jsx(mr,{name:`date-${I}`,control:h,defaultValue:D.createdAt,render:({field:S})=>j.jsx("input",{type:"date",...S})}),j.jsx("label",{children:"Vendor"}),j.jsx(mr,{name:`vendor-${I}`,control:h,defaultValue:D.vendor,render:({field:S})=>j.jsx("input",{type:"text",...S})}),j.jsx("label",{children:"Amount"}),j.jsx(mr,{name:`amount-${I}`,control:h,defaultValue:D.amount,render:({field:S})=>j.jsx("input",{type:"number",step:"0.01",...S})}),j.jsx("label",{children:"Category"}),j.jsx(mr,{name:`category-${I}`,control:h,defaultValue:D.category_name||"Select Category",render:({field:S})=>j.jsx("select",{...S,children:l.map(E=>j.jsx("option",{value:E,children:E},E))})}),j.jsx("button",{type:"button",className:"custom-button delete-button",onClick:()=>P(D.transactionId),children:"Delete"})]},D.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:g,children:"Cancel"}),j.jsx("button",{type:"button",className:"custom-button",onClick:g,children:"Back"})]})]})},TP=()=>j.jsxs(j.Fragment,{children:[j.jsx(tu,{children:j.jsx(Rd,{children:j.jsx(xd,{xs:1,md:1,children:j.jsx(Ad,{src:yP,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(Od,{})]})]});function CP(){const{screen:t,setScreen:e,user:n}=ee.useContext(an);return(()=>{switch(t){case"landing":return j.jsx(gP,{});case"chart":return j.jsx(SP,{});case"camera":return j.jsx(wT,{});case"edit":return j.jsx(bP,{});case"userguide":return j.jsx(TP,{});default:return j.jsx(_P,{})}})()}cc.createRoot(document.getElementById("root")).render(j.jsx(ge.StrictMode,{children:j.jsx(oT,{children:j.jsx(CP,{})})})); diff --git a/index.html b/index.html index f1c8cc8..34affb6 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ SimpliTrac - +