!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],e):e((t=t||self).firebase)}(this,function(De){"use strict";try{(function(){De=De&&De.hasOwnProperty("default")?De.default:De;var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;na[0]&&e[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function r(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||0"})}(o,r):"Error",s=this.serviceName+": "+a+" ("+i+").",c=new h(i,s),u=0,f=Object.keys(r);uDate.now()}(e))return;var n=t.getItem(xt);if(!n)return;try{return JSON.parse(n)}catch(t){return}}();return e?(oe(e),Promise.resolve()):function(r){return function(){var t=Jt.getInstance().installationsService.getToken();return t.then(function(t){}),t}().then(function(t){var e="https://firebaseremoteconfig.googleapis.com/v1/projects/"+Jt.getInstance().getProjectId()+"/namespaces/fireperf:fetch?key="+Jt.getInstance().getApiKey(),n=new Request(e,{method:"POST",headers:{Authorization:ne+" "+t},body:JSON.stringify({app_instance_id:r,app_instance_id_token:t,app_id:Jt.getInstance().getAppId(),app_version:Bt,sdk_version:te})});return fetch(n).then(function(t){if(t.ok)return t.json();throw Ft.create("RC response not ok")})}).catch(function(){Xt.info(ie)})}(t).then(function(t){return oe(t)}).then(function(t){return function(t){var e=Vt.getInstance().localStorage;if(!t||!e)return;e.setItem(xt,JSON.stringify(t)),e.setItem(qt,String(Date.now()+60*Jt.getInstance().configTimeToLive*60*1e3))}(t)},function(){})}var ie="Could not fetch config, will use default configs";function oe(t){if(!t)return t;var e=Jt.getInstance(),n=t.entries||{};return void 0!==n.fpr_enabled?e.loggingEnabled="true"===String(n.fpr_enabled):e.loggingEnabled=ee.loggingEnabled,n.fpr_log_source&&(e.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(e.logEndPointUrl=n.fpr_log_endpoint_url),void 0!==n.fpr_vc_network_request_sampling_rate&&(e.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(e.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),e.logTraceAfterSampling=ae(e.tracesSamplingRate),e.logNetworkAfterSampling=ae(e.networkRequestsSamplingRate),t}function ae(t){return Math.random()<=t}var se,ce=1;function ue(){return ce=2,se=se||function(){var n=Vt.getInstance().document;return new Promise(function(t){if(n&&"complete"!==n.readyState){var e=function(){"complete"===n.readyState&&(n.removeEventListener("readystatechange",e),t())};n.addEventListener("readystatechange",e)}else t()})}().then(function(){return function(){var t=Jt.getInstance().installationsService.getId();return t.then(function(t){Ht=t}),t}()}).then(function(t){return re(t)}).then(function(){return fe()},function(){return fe()})}function fe(){ce=3}var le,pe=1e4,he=5500,de=3,ge=de,ve=[],me=!1;function ye(){me||(!function r(t){setTimeout(function(){if(0!==ge){if(!ve.length)return r(pe);var t=i(ve);ve=[];var e=t.map(function(t){return{source_extension_json_proto3:t.message,event_time_ms:String(t.eventTime)}}),n={request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:Jt.getInstance().logSource,log_event:e};fetch(Jt.getInstance().logEndPointUrl,{method:"POST",body:JSON.stringify(n)}).then(function(t){return t.ok||Xt.info("Call to Firebase backend failed."),t.json()}).then(function(t){var e=Number(t.next_request_wait_millis),n=isNaN(e)?pe:Math.max(pe,e);ge=de,r(n)}).catch(function(){ve=i(t,ve),ge--,Xt.info("Tries left: "+ge+"."),r(pe)})}},t)}(he),me=!0)}function be(n){return function(){for(var t=[],e=0;e