1(function() { 2const Yt=()=>{};var ve={};/** 3 * @license 4 * Copyright 2017 Google LLC 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */const et=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},Xt=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const o=e[n++];t[r++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){const o=e[n++],a=e[n++],c=e[n++],d=((i&7)<<18|(o&63)<<12|(a&63)<<6|c&63)-65536;t[r++]=String.fromCharCode(55296+(d>>10)),t[r++]=String.fromCharCode(56320+(d&1023))}else{const o=e[n++],a=e[n++];t[r++]=String.fromCharCode((i&15)<<12|(o&63)<<6|a&63)}}return t.join("")},tt={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<e.length;i+=3){const o=e[i],a=i+1<e.length,c=a?e[i+1]:0,d=i+2<e.length,s=d?e[i+2]:0,B=o>>2,R=(o&3)<<4|c>>4;let F=(c&15)<<2|s>>6,$=s&63;d||($=64,a||(F=64)),r.push(n[B],n[R],n[F],n[$])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(et(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):Xt(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<e.length;){const o=n[e.charAt(i++)],c=i<e.length?n[e.charAt(i)]:0;++i;const s=i<e.length?n[e.charAt(i)]:64;++i;const R=i<e.length?n[e.charAt(i)]:64;if(++i,o==null||c==null||s==null||R==null)throw new Zt;const F=o<<2|c>>4;if(r.push(F),s!==64){const $=c<<4&240|s>>2;if(r.push($),R!==64){const Jt=s<<6&192|R;r.push(Jt)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class Zt extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Qt=function(e){const t=et(e);return tt.encodeByteArray(t,!0)},nt=function(e){return Qt(e).replace(/\./g,"")},en=function(e){try{return tt.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/** 18 * @license 19 * Copyright 2022 Google LLC 20 * 21 * Licensed under the Apache License, Version 2.0 (the "License"); 22 * you may not use this file except in compliance with the License. 23 * You may obtain a copy of the License at 24 * 25 * http://www.apache.org/licenses/LICENSE-2.0 26 * 27 * Unless required by applicable law or agreed to in writing, softw
27are 28 * distributed under the License is distributed on an "AS IS" BASIS, 29 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 30 * See the License for the specific language governing permissions and 31 * limitations under the License. 32 */function tn(){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.")}/** 33 * @license 34 * Copyright 2022 Google LLC 35 * 36 * Licensed under the Apache License, Version 2.0 (the "License"); 37 * you may not use this file except in compliance with the License. 38 * You may obtain a copy of the License at 39 * 40 * http://www.apache.org/licenses/LICENSE-2.0 41 * 42 * Unless required by applicable law or agreed to in writing, software 43 * distributed under the License is distributed on an "AS IS" BASIS, 44 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 45 * See the License for the specific language governing permissions and 46 * limitations under the License. 47 */const nn=()=>tn().__FIREBASE_DEFAULTS__,rn=()=>{if(typeof process>"u"||typeof ve>"u")return;const e=ve.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},on=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&en(e[1]);return t&&JSON.parse(t)},an=()=>{try{return Yt()||nn()||rn()||on()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},rt=()=>an()?.config;/** 48 * @license 49 * Copyright 2017 Google LLC 50 * 51 * Licensed under the Apache License, Version 2.0 (the "License"); 52 * you may not use this file except in compliance with the License. 53 * You may obtain a copy of the License at 54 * 55 * http://www.apache.org/licenses/LICENSE-2.0 56 * 57 * Unless required by applicable law or agreed to in writing, software 58 * distributed under the License is distributed on an "AS IS" BASIS, 59 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 60 * See the License for the specific language governing permissions and 61 * limitations under the License. 62 */class sn{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,r))}}}function it(){try{return typeof indexedDB=="object"}catch{return!1}}function ot(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{t(i.error?.message||"")}}catch(n){t(n)}})}function cn(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/** 63 * @license 64 * Copyright 2017 Google LLC 65 * 66 * Licensed under the Apache License, Version 2.0 (the "License"); 67 * you may not use this file except in compliance with the License. 68 * You may obtain a copy of the License at 69 * 70 * http://www.apache.org/licenses/LICENSE-2.0 71 * 72 * Unless required by applicable law or agreed to in writing, software 73 * distributed under the License is distributed on an "AS IS" BASIS, 74 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 75 * See the License for the specific language governing permissions and 76 * limitations under the License. 77 */const dn="FirebaseError";class k extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=dn,Object.setPrototypeOf(this,k.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,V.prototype.create)}}class V{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},i=`${this.service}/${t}`,o=this.errors[t],a=o?ln(o,r):"Error",c=`${this.serviceName}: ${a} (${i}).`;return new k(i,c,r)}}function ln(e,t){return e.replace(un,(n,r)=>{const i=t[r];return i!=null?String(i):`<${r}?>`})}const un=/\{\$([^}]+)}/g;function ae(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const o=e[i],a=t[i];if(Ce(o)&&Ce(a)){if(!ae(o,a))return!1}else if(o!==a)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function Ce(e){return e!==null&&typeof e=="object"}/** 78 * @license 79 * Copyright 2021 Google LLC 80 * 81 * Licensed under the Apache License, Version 2.0 (the "License");
82 * you may not use this file except in compliance with the License. 83 * You may obtain a copy of the License at 84 * 85 * http://www.apache.org/licenses/LICENSE-2.0 86 * 87 * Unless required by applicable law or agreed to in writing, software 88 * distributed under the License is distributed on an "AS IS" BASIS, 89 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 90 * See the License for the specific language governing permissions and 91 * limitations under the License. 92 */function ge(e){return e&&e._delegate?e._delegate:e}class y{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/** 93 * @license 94 * Copyright 2019 Google LLC 95 * 96 * Licensed under the Apache License, Version 2.0 (the "License"); 97 * you may not use this file except in compliance with the License. 98 * You may obtain a copy of the License at 99 * 100 * http://www.apache.org/licenses/LICENSE-2.0 101 * 102 * Unless required by applicable law or agreed to in writing, software 103 * distributed under the License is distributed on an "AS IS" BASIS, 104 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 105 * See the License for the specific language governing permissions and 106 * limitations under the License. 107 */const _="[DEFAULT]";/** 108 * @license 109 * Copyright 2019 Google LLC 110 * 111 * Licensed under the Apache License, Version 2.0 (the "License"); 112 * you may not use this file except in compliance with the License. 113 * You may obtain a copy of the License at 114 * 115 * http://www.apache.org/licenses/LICENSE-2.0 116 * 117 * Unless required by applicable law or agreed to in writing, software 118 * distributed under the License is distributed on an "AS IS" BASIS, 119 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 120 * See the License for the specific language governing permissions and 121 * limitations under the License. 122 */class fn{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const r=new sn;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(t){const n=this.normalizeInstanceIdentifier(t?.identifier),r=t?.optional??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(hn(t))try{this.getOrInitializeService({instanceIdentifier:_})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const o=this.getOrInitializeService({instanceIdentifier:i});r.resolve(o)}catch{}}}}clearInstance(t=_){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=_){return this.instances.has(t)}getOptions(t=_){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,r=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[o,a]of this.instancesDeferred.entries()){const c=this.normalizeInstanceIdentifier(o);r===c&&a.resolve(i)}return i}onInit(t,n){const r=this.normalizeInstanceIdentifier(n),i=this.onInitCallbacks.get(r)??new Set;i.add(t),this.onInitCallbacks.set(r,i);const o=this.instances.get(r);return o&&t(o,r),()=>{i.delete(t)}}invokeOnInitCallbacks(t,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:pn(t),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch{}return r||null}normalizeInstanceIdentifier(t=_){return this.component?this.component.multipleInstances?t:_:t}
122shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function pn(e){return e===_?void 0:e}function hn(e){return e.instantiationMode==="EAGER"}/** 123 * @license 124 * Copyright 2019 Google LLC 125 * 126 * Licensed under the Apache License, Version 2.0 (the "License"); 127 * you may not use this file except in compliance with the License. 128 * You may obtain a copy of the License at 129 * 130 * http://www.apache.org/licenses/LICENSE-2.0 131 * 132 * Unless required by applicable law or agreed to in writing, software 133 * distributed under the License is distributed on an "AS IS" BASIS, 134 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 135 * See the License for the specific language governing permissions and 136 * limitations under the License. 137 */class gn{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new fn(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/** 138 * @license 139 * Copyright 2017 Google LLC 140 * 141 * Licensed under the Apache License, Version 2.0 (the "License"); 142 * you may not use this file except in compliance with the License. 143 * You may obtain a copy of the License at 144 * 145 * http://www.apache.org/licenses/LICENSE-2.0 146 * 147 * Unless required by applicable law or agreed to in writing, software 148 * distributed under the License is distributed on an "AS IS" BASIS, 149 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 150 * See the License for the specific language governing permissions and 151 * limitations under the License. 152 */var u;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(u||(u={}));const mn={debug:u.DEBUG,verbose:u.VERBOSE,info:u.INFO,warn:u.WARN,error:u.ERROR,silent:u.SILENT},bn=u.INFO,wn={[u.DEBUG]:"log",[u.VERBOSE]:"log",[u.INFO]:"info",[u.WARN]:"warn",[u.ERROR]:"error"},yn=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),i=wn[t];if(i)console[i](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class _n{constructor(t){this.name=t,this._logLevel=bn,this._logHandler=yn,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in u))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?mn[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,u.DEBUG,...t),this._logHandler(this,u.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,u.VERBOSE,...t),this._logHandler(this,u.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,u.INFO,...t),this._logHandler(this,u.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,u.WARN,...t),this._logHandler(this,u.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,u.ERROR,...t),this._logHandler(this,u.ERROR,...t)}}const In=(e,t)=>t.some(n=>e instanceof n);let De,ke;function Sn(){return De||(De=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function En(){return ke||(ke=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const at=new WeakMap,se=new WeakMap,st=new WeakMap,Z=new WeakMap,me=new WeakMap;function Tn(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",o),e.removeEventListener("error",a)},o=()=>{n(h(e.result)),i()},a=()=>{r(e.error),i()};e.addEventListener("success",o),e.addEventListener("error",a)});return t.then(n=>
152{n instanceof IDBCursor&&at.set(n,e)}).catch(()=>{}),me.set(t,e),t}function An(e){if(se.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",a),e.removeEventListener("abort",a)},o=()=>{n(),i()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",o),e.addEventListener("error",a),e.addEventListener("abort",a)});se.set(e,t)}let ce={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return se.get(e);if(t==="objectStoreNames")return e.objectStoreNames||st.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return h(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function vn(e){ce=e(ce)}function Cn(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Q(this),t,...n);return st.set(r,t.sort?t.sort():[t]),h(r)}:En().includes(e)?function(...t){return e.apply(Q(this),t),h(at.get(this))}:function(...t){return h(e.apply(Q(this),t))}}function Dn(e){return typeof e=="function"?Cn(e):(e instanceof IDBTransaction&&An(e),In(e,Sn())?new Proxy(e,ce):e)}function h(e){if(e instanceof IDBRequest)return Tn(e);if(Z.has(e))return Z.get(e);const t=Dn(e);return t!==e&&(Z.set(e,t),me.set(t,e)),t}const Q=e=>me.get(e);function W(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const a=indexedDB.open(e,t),c=h(a);return r&&a.addEventListener("upgradeneeded",d=>{r(h(a.result),d.oldVersion,d.newVersion,h(a.transaction),d)}),n&&a.addEventListener("blocked",d=>n(d.oldVersion,d.newVersion,d)),c.then(d=>{o&&d.addEventListener("close",()=>o()),i&&d.addEventListener("versionchange",s=>i(s.oldVersion,s.newVersion,s))}).catch(()=>{}),c}function L(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",r=>t(r.oldVersion,r)),h(n).then(()=>{})}const kn=["get","getKey","getAll","getAllKeys","count"],On=["put","add","delete","clear"],ee=new Map;function Oe(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(ee.get(t))return ee.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=On.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||kn.includes(n)))return;const o=async function(a,...c){const d=this.transaction(a,i?"readwrite":"readonly");let s=d.store;return r&&(s=s.index(c.shift())),(await Promise.all([s[n](...c),i&&d.done]))[0]};return ee.set(t,o),o}vn(e=>({...e,get:(t,n,r)=>Oe(t,n)||e.get(t,n,r),has:(t,n)=>!!Oe(t,n)||e.has(t,n)}));/** 153 * @license 154 * Copyright 2019 Google LLC 155 * 156 * Licensed under the Apache License, Version 2.0 (the "License"); 157 * you may not use this file except in compliance with the License. 158 * You may obtain a copy of the License at 159 * 160 * http://www.apache.org/licenses/LICENSE-2.0 161 * 162 * Unless required by applicable law or agreed to in writing, software 163 * distributed under the License is distributed on an "AS IS" BASIS, 164 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 165 * See the License for the specific language governing permissions and 166 * limitations under the License. 167 */class Rn{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(Nn(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function Nn(e){return e.getComponent()?.type==="VERSION"}const de="@firebase/app",Re="0.15.1";/** 168 * @license 169 * Copyright 2019 Google LLC 170 * 171 * Licensed under the Apache License, Version 2.0 (the "License"); 172 * you may not use this file except in compliance with the License. 173 * You may obtain a copy of the License at 174 * 175 * http://www.apache.org/licenses/LICENSE-2.0 176 * 177 * Unless required by applicable law or agreed to in writing, software 178 * distributed under the License is distributed on an "AS IS" BASIS, 179 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 180 * See the License for the specific language governing permissions and 181 * limitations under the License. 182 */const m=new _n("@firebase/app"),Pn="@firebase/app-compat",Mn="@firebase/analytics-compat",Bn="@firebase/analytics",Fn="@firebase/app-check-compat",$n="@firebase/app-check",xn="@firebase/auth",Ln="@firebase/auth-compat",Hn="@firebase/database",jn="@firebase/data-connect",Kn="@firebase/database-compat",Un="@firebase/functions",Vn="@firebase/functions-compat",Wn="@firebase/installations",qn="@firebase/installations-compat",zn="@firebase/messaging",Gn="@firebase/messaging-compat",Jn="@f
182irebase/performance",Yn="@firebase/performance-compat",Xn="@firebase/remote-config",Zn="@firebase/remote-config-compat",Qn="@firebase/storage",er="@firebase/storage-compat",tr="@firebase/firestore",nr="@firebase/ai",rr="@firebase/firestore-compat",ir="firebase";/** 183 * @license 184 * Copyright 2019 Google LLC 185 * 186 * Licensed under the Apache License, Version 2.0 (the "License"); 187 * you may not use this file except in compliance with the License. 188 * You may obtain a copy of the License at 189 * 190 * http://www.apache.org/licenses/LICENSE-2.0 191 * 192 * Unless required by applicable law or agreed to in writing, software 193 * distributed under the License is distributed on an "AS IS" BASIS, 194 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 195 * See the License for the specific language governing permissions and 196 * limitations under the License. 197 */const le="[DEFAULT]",or={[de]:"fire-core",[Pn]:"fire-core-compat",[Bn]:"fire-analytics",[Mn]:"fire-analytics-compat",[$n]:"fire-app-check",[Fn]:"fire-app-check-compat",[xn]:"fire-auth",[Ln]:"fire-auth-compat",[Hn]:"fire-rtdb",[jn]:"fire-data-connect",[Kn]:"fire-rtdb-compat",[Un]:"fire-fn",[Vn]:"fire-fn-compat",[Wn]:"fire-iid",[qn]:"fire-iid-compat",[zn]:"fire-fcm",[Gn]:"fire-fcm-compat",[Jn]:"fire-perf",[Yn]:"fire-perf-compat",[Xn]:"fire-rc",[Zn]:"fire-rc-compat",[Qn]:"fire-gcs",[er]:"fire-gcs-compat",[tr]:"fire-fst",[rr]:"fire-fst-compat",[nr]:"fire-vertex","fire-js":"fire-js",[ir]:"fire-js-all"};/** 198 * @license 199 * Copyright 2019 Google LLC 200 * 201 * Licensed under the Apache License, Version 2.0 (the "License"); 202 * you may not use this file except in compliance with the License. 203 * You may obtain a copy of the License at 204 * 205 * http://www.apache.org/licenses/LICENSE-2.0 206 * 207 * Unless required by applicable law or agreed to in writing, software 208 * distributed under the License is distributed on an "AS IS" BASIS, 209 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 210 * See the License for the specific language governing permissions and 211 * limitations under the License. 212 */const j=new Map,ar=new Map,ue=new Map;function Ne(e,t){try{e.container.addComponent(t)}catch(n){m.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function S(e){const t=e.name;if(ue.has(t))return m.debug(`There were multiple attempts to register component ${t}.`),!1;ue.set(t,e);for(const n of j.values())Ne(n,e);for(const n of ar.values())Ne(n,e);return!0}function be(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}/** 213 * @license 214 * Copyright 2019 Google LLC 215 * 216 * Licensed under the Apache License, Version 2.0 (the "License"); 217 * you may not use this file except in compliance with the License. 218 * You may obtain a copy of the License at 219 * 220 * http://www.apache.org/licenses/LICENSE-2.0 221 * 222 * Unless required by applicable law or agreed to in writing, software 223 * distributed under the License is distributed on an "AS IS" BASIS, 224 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 225 * See the License for the specific language governing permissions and 226 * limitations under the License. 227 */const sr={"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.","invali
227d-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."},b=new V("app","Firebase",sr);/** 228 * @license 229 * Copyright 2019 Google LLC 230 * 231 * Licensed under the Apache License, Version 2.0 (the "License"); 232 * you may not use this file except in compliance with the License. 233 * You may obtain a copy of the License at 234 * 235 * http://www.apache.org/licenses/LICENSE-2.0 236 * 237 * Unless required by applicable law or agreed to in writing, software 238 * distributed under the License is distributed on an "AS IS" BASIS, 239 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 240 * See the License for the specific language governing permissions and 241 * limitations under the License. 242 */class cr{constructor(t,n,r){this._isDeleted=!1,this._options={...t},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new y("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw b.create("app-deleted",{appName:this._name})}}function ct(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:le,automaticDataCollectionEnabled:!0,...t},i=r.name;if(typeof i!="string"||!i)throw b.create("bad-app-name",{appName:String(i)});if(n||(n=rt()),!n)throw b.create("no-options");const o=j.get(i);if(o){if(ae(n,o.options)&&ae(r,o.config))return o;throw b.create("duplicate-app",{appName:i})}const a=new gn(i);for(const d of ue.values())a.addComponent(d);const c=new cr(n,r,a);return j.set(i,c),c}function dr(e=le){const t=j.get(e);if(!t&&e===le&&rt())return ct();if(!t)throw b.create("no-app",{appName:e});return t}function w(e,t,n){let r=or[e]??e;n&&(r+=`-${n}`);const i=r.match(/\s|\//),o=t.match(/\s|\//);if(i||o){const a=[`Unable to register library "${r}" with version "${t}":`];i&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&o&&a.push("and"),o&&a.push(`version name "${t}" contains illegal characters (whitespace or "/")`),m.warn(a.join(" "));return}S(new y(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/** 243 * @license 244 * Copyright 2021 Google LLC 245 * 246 * Licensed under the Apache License, Version 2.0 (the "License"); 247 * you may not use this file except in compliance with the License. 248 * You may obtain a copy of the License at 249 * 250 * http://www.apache.org/licenses/LICENSE-2.0 251 * 252 * Unless required by applicable law or agreed to in writing, software 253 * distributed under the License is distributed on an "AS IS" BASIS, 254 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 255 * See the License for the specific language governing permissions and 256 * limitations under the License. 257 */const lr="firebase-heartbeat-database",ur=1,P="firebase-heartbeat-store";let te=null;function dt(){return te||(te=W(lr,ur,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(P)}catch(n){console.warn(n)}}}}).catch(e=>{throw b.create("idb-open",{originalErrorMessage:e.message})})),te}async function fr(e){try{const n=(await dt()).transaction(P),r=await n.objectStore(P).get(lt(e));return await n.done,r}catch(t){if(t instanceof k)m.warn(t.message);else{const n=b.create("idb-get",{originalErrorMessage:t?.message});m.warn(n.message)}}}async function Pe(e,t){try{const r=(await dt()).transaction(P,"readwrite");await r.objectStore(P).put(t,lt(e)),await r.done}catch(n){if(n instanceof k)m.warn(n.message);else{const r=b.create("idb-set",{originalErrorMessage:n?.message});m.warn(r.message)}}}function lt(e){return`${e.name}!${e.options.appId}`}/** 258 * @license 259 * Copyright 2021 Google LLC 260 * 261 * Licensed under the Apache License, Version 2.0 (the "License");
262 * you may not use this file except in compliance with the License. 263 * You may obtain a copy of the License at 264 * 265 * http://www.apache.org/licenses/LICENSE-2.0 266 * 267 * Unless required by applicable law or agreed to in writing, software 268 * distributed under the License is distributed on an "AS IS" BASIS, 269 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 270 * See the License for the specific language governing permissions and 271 * limitations under the License. 272 */const pr=1024,hr=30;class gr{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new br(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=Me();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats.length>hr){const i=wr(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(t){m.warn(t)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=Me(),{heartbeatsToSend:n,unsentEntries:r}=mr(this._heartbeatsCache.heartbeats),i=nt(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(t){return m.warn(t),""}}}function Me(){return new Date().toISOString().substring(0,10)}function mr(e,t=pr){const n=[];let r=e.slice();for(const i of e){const o=n.find(a=>a.agent===i.agent);if(o){if(o.dates.push(i.date),Be(n)>t){o.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Be(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class br{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return it()?ot().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await fr(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return Pe(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return Pe(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function Be(e){return nt(JSON.stringify({version:2,heartbeats:e})).length}function wr(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}/** 273 * @license 274 * Copyright 2019 Google LLC 275 * 276 * Licensed under the Apache License, Version 2.0 (the "License"); 277 * you may not use this file except in compliance with the License. 278 * You may obtain a copy of the License at 279 * 280 * http://www.apache.org/licenses/LICENSE-2.0 281 * 282 * Unless required by applicable law or agreed to in writing, software 283 * distributed under the License is distributed on an "AS IS" BASIS, 284 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 285 * See the License for the specific language governing permissions and 286 * limitations under the License. 287 */function yr(e){S(new y("platform-logger",t=>new Rn(t),"PRIVATE")),S(new y("heartbeat",t=>new gr(t),"PRIVATE")),w(de,Re,e),w(de,Re,"esm2020"),w("fire-js","")}yr("");var _r="firebase",Ir="12.16.0";/** 288 * @license 289 * Copyright 2020 Google LLC 290 * 291 * Licensed under the Apache License, Version 2.0 (the "License");
292 * you may not use this file except in compliance with the License. 293 * You may obtain a copy of the License at 294 * 295 * http://www.apache.org/licenses/LICENSE-2.0 296 * 297 * Unless required by applicable law or agreed to in writing, software 298 * distributed under the License is distributed on an "AS IS" BASIS, 299 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 300 * See the License for the specific language governing permissions and 301 * limitations under the License. 302 */w(_r,Ir,"app");const ut="@firebase/installations",we="0.6.22";/** 303 * @license 304 * Copyright 2019 Google LLC 305 * 306 * Licensed under the Apache License, Version 2.0 (the "License"); 307 * you may not use this file except in compliance with the License. 308 * You may obtain a copy of the License at 309 * 310 * http://www.apache.org/licenses/LICENSE-2.0 311 * 312 * Unless required by applicable law or agreed to in writing, software 313 * distributed under the License is distributed on an "AS IS" BASIS, 314 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 315 * See the License for the specific language governing permissions and 316 * limitations under the License. 317 */const ft=1e4,pt=`w:${we}`,ht="FIS_v2",Sr="https://firebaseinstallations.googleapis.com/v1",Er=3600*1e3,Tr="installations",Ar="Installations";/** 318 * @license 319 * Copyright 2019 Google LLC 320 * 321 * Licensed under the Apache License, Version 2.0 (the "License"); 322 * you may not use this file except in compliance with the License. 323 * You may obtain a copy of the License at 324 * 325 * http://www.apache.org/licenses/LICENSE-2.0 326 * 327 * Unless required by applicable law or agreed to in writing, software 328 * distributed under the License is distributed on an "AS IS" BASIS, 329 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 330 * See the License for the specific language governing permissions and 331 * limitations under the License. 332 */const vr={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},E=new V(Tr,Ar,vr);function gt(e){return e instanceof k&&e.code.includes("request-failed")}/** 333 * @license 334 * Copyright 2019 Google LLC 335 * 336 * Licensed under the Apache License, Version 2.0 (the "License"); 337 * you may not use this file except in compliance with the License. 338 * You may obtain a copy of the License at 339 * 340 * http://www.apache.org/licenses/LICENSE-2.0 341 * 342 * Unless required by applicable law or agreed to in writing, software 343 * distributed under the License is distributed on an "AS IS" BASIS, 344 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 345 * See the License for the specific language governing permissions and 346 * limitations under the License. 347 */function mt({projectId:e}){return`${Sr}/projects/${e}/installations`}function bt(e){return{token:e.token,requestStatus:2,expiresIn:Dr(e.expiresIn),creationTime:Date.now()}}async function wt(e,t){const r=(await t.json()).error;return E.create("request-failed",{requestName:e,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})}function yt({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function Cr(e,{refreshToken:t}){const n=yt(e);return n.append("Authorization",kr(t)),n}async function _t(e){const t=await e();return t.status>=500&&t.status<600?e():t}function Dr(e){return Number(e.replace("s","000"))}function kr(e){return`${ht} ${e}`}/** 348 * @license 349 * Copyright 2019 Google LLC 350 * 351 * Licensed under the Apache License, Version 2.0 (the "License"); 352 * you may not use this file except in compliance with the License. 353 * You may obtain a copy of the License at 354 * 355 * http://www.apache.org/licenses/LICENSE-2.0 356 * 357 * Unless required by applicable law or agreed to in writing, softw
357are 358 * distributed under the License is distributed on an "AS IS" BASIS, 359 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 360 * See the License for the specific language governing permissions and 361 * limitations under the License. 362 */async function Or({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const r=mt(e),i=yt(e),o=t.getImmediate({optional:!0});if(o){const s=await o.getHeartbeatsHeader();s&&i.append("x-firebase-client",s)}const a={fid:n,authVersion:ht,appId:e.appId,sdkVersion:pt},c={method:"POST",headers:i,body:JSON.stringify(a)},d=await _t(()=>fetch(r,c));if(d.ok){const s=await d.json();return{fid:s.fid||n,registrationStatus:2,refreshToken:s.refreshToken,authToken:bt(s.authToken)}}else throw await wt("Create Installation",d)}/** 363 * @license 364 * Copyright 2019 Google LLC 365 * 366 * Licensed under the Apache License, Version 2.0 (the "License"); 367 * you may not use this file except in compliance with the License. 368 * You may obtain a copy of the License at 369 * 370 * http://www.apache.org/licenses/LICENSE-2.0 371 * 372 * Unless required by applicable law or agreed to in writing, software 373 * distributed under the License is distributed on an "AS IS" BASIS, 374 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 375 * See the License for the specific language governing permissions and 376 * limitations under the License. 377 */function It(e){return new Promise(t=>{setTimeout(t,e)})}/** 378 * @license 379 * Copyright 2019 Google LLC 380 * 381 * Licensed under the Apache License, Version 2.0 (the "License"); 382 * you may not use this file except in compliance with the License. 383 * You may obtain a copy of the License at 384 * 385 * http://www.apache.org/licenses/LICENSE-2.0 386 * 387 * Unless required by applicable law or agreed to in writing, software 388 * distributed under the License is distributed on an "AS IS" BASIS, 389 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 390 * See the License for the specific language governing permissions and 391 * limitations under the License. 392 */function Rr(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_")}/** 393 * @license 394 * Copyright 2019 Google LLC 395 * 396 * Licensed under the Apache License, Version 2.0 (the "License"); 397 * you may not use this file except in compliance with the License. 398 * You may obtain a copy of the License at 399 * 400 * http://www.apache.org/licenses/LICENSE-2.0 401 * 402 * Unless required by applicable law or agreed to in writing, software 403 * distributed under the License is distributed on an "AS IS" BASIS, 404 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 405 * See the License for the specific language governing permissions and 406 * limitations under the License. 407 */const Nr=/^[cdef][\w-]{21}$/,fe="";function Pr(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const n=Mr(e);return Nr.test(n)?n:fe}catch{return fe}}function Mr(e){return Rr(e).substr(0,22)}/** 408 * @license 409 * Copyright 2019 Google LLC 410 * 411 * Licensed under the Apache License, Version 2.0 (the "License"); 412 * you may not use this file except in compliance with the License. 413 * You may obtain a copy of the License at 414 * 415 * http://www.apache.org/licenses/LICENSE-2.0 416 * 417 * Unless required by applicable law or agreed to in writing, software 418 * distributed under the License is distributed on an "AS IS" BASIS, 419 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 420 * See the License for the specific language governing permissions and 421 * limitations under the License. 422 */function O(e){return`${e.appName}!${e.appId}`}/** 423 * @license 424 * Copyright 2019 Google LLC 425 * 426 * Licensed under the Apache License, Version 2.0 (the "License"); 427 * you may not use this file except in compliance with the License. 428 * You may obtain a copy of the License at 429 * 430 * http://www.apache.org/licenses/LICENSE-2.0 431 * 432 * Unless required by applicable law or agreed to in writing, software 433 * distributed under the License is distributed on an "AS IS" BASIS, 434 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 435 * See the License for the specific language governing permissions and 436 * limitations under the License. 437 */const C=new Map;function St(e,t){const n=O(e);Et(n,t),$r(n,t)}function Br(e,t){Tt();const n=O(e);let r=C.get(n);r||(r=new Set,C.set(n,r)),r.add(t)}function Fr(e,t){const n=O(e),r=C.get(n);r&&(r.delete(t),r.size===0&&C.delete(n),At())}function Et(e,t){const n=C.get(e);if(n)for(const r of n)r(t)}function $r(e,t){const n=Tt();n&&n.postMessage({key:e,fid:t}),At()}let I=null;function Tt(){return!I&&"BroadcastChannel"in self&&(I=new BroadcastChannel("[Firebase] FID Change"),I.onmessage=e=>{Et(e.data.key,e.data.fid)}),I}function At(){C.size===0&&I&&(I.close(),I=null)}/** 438 * @license 439 * Copyright 2019 Google LLC 440 * 441 * Licensed under the Apache License, Version 2.0 (the "License");
442 * you may not use this file except in compliance with the License. 443 * You may obtain a copy of the License at 444 * 445 * http://www.apache.org/licenses/LICENSE-2.0 446 * 447 * Unless required by applicable law or agreed to in writing, software 448 * distributed under the License is distributed on an "AS IS" BASIS, 449 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 450 * See the License for the specific language governing permissions and 451 * limitations under the License. 452 */const xr="firebase-installations-database",Lr=1,T="firebase-installations-store";let ne=null;function ye(){return ne||(ne=W(xr,Lr,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(T)}}})),ne}async function K(e,t){const n=O(e),i=(await ye()).transaction(T,"readwrite"),o=i.objectStore(T),a=await o.get(n);return await o.put(t,n),await i.done,(!a||a.fid!==t.fid)&&St(e,t.fid),t}async function vt(e){const t=O(e),r=(await ye()).transaction(T,"readwrite");await r.objectStore(T).delete(t),await r.done}async function q(e,t){const n=O(e),i=(await ye()).transaction(T,"readwrite"),o=i.objectStore(T),a=await o.get(n),c=t(a);return c===void 0?await o.delete(n):await o.put(c,n),await i.done,c&&(!a||a.fid!==c.fid)&&St(e,c.fid),c}/** 453 * @license 454 * Copyright 2019 Google LLC 455 * 456 * Licensed under the Apache License, Version 2.0 (the "License"); 457 * you may not use this file except in compliance with the License. 458 * You may obtain a copy of the License at 459 * 460 * http://www.apache.org/licenses/LICENSE-2.0 461 * 462 * Unless required by applicable law or agreed to in writing, software 463 * distributed under the License is distributed on an "AS IS" BASIS, 464 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 465 * See the License for the specific language governing permissions and 466 * limitations under the License. 467 */async function _e(e){let t;const n=await q(e.appConfig,r=>{const i=Hr(r),o=jr(e,i);return t=o.registrationPromise,o.installationEntry});return n.fid===fe?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}function Hr(e){const t=e||{fid:Pr(),registrationStatus:0};return Ct(t)}function jr(e,t){if(t.registrationStatus===0){if(!navigator.onLine){const i=Promise.reject(E.create("app-offline"));return{installationEntry:t,registrationPromise:i}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},r=Kr(e,n);return{installationEntry:n,registrationPromise:r}}else return t.registrationStatus===1?{installationEntry:t,registrationPromise:Ur(e)}:{installationEntry:t}}async function Kr(e,t){try{const n=await Or(e,t);return K(e.appConfig,n)}catch(n){throw gt(n)&&n.customData.serverCode===409?await vt(e.appConfig):await K(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}async function Ur(e){let t=await Fe(e.appConfig);for(;t.registrationStatus===1;)await It(100),t=await Fe(e.appConfig);if(t.registrationStatus===0){const{installationEntry:n,registrationPromise:r}=await _e(e);return r||n}return t}function Fe(e){return q(e,t=>{if(!t)throw E.create("installation-not-found");return Ct(t)})}function Ct(e){return Vr(e)?{fid:e.fid,registrationStatus:0}:e}function Vr(e){return e.registrationStatus===1&&e.registrationTime+ft<Date.now()}/** 468 * @license 469 * Copyright 2019 Google LLC 470 * 471 * Licensed under the Apache License, Version 2.0 (the "License"); 472 * you may not use this file except in compliance with the License. 473 * You may obtain a copy of the License at 474 * 475 * http://www.apache.org/licenses/LICENSE-2.0 476 * 477 * Unless required by applicable law or agreed to in writing, software 478 * distributed under the License is distributed on an "AS IS" BASIS, 479 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 480 * See the License for the specific language governing permissions and 481 * limitations under the License. 482 */async function Wr({appConfig:e,heartbeatServiceProvider:t},n){const r=qr(e,n),i=Cr(e,n),o=t.getImmediate({optional:!0});if(o){const s=await o.getHeartbeatsHeader();s&&i.append("x-firebase-client",s)}const a={installation:{sdkVersion:pt,appId:e.appId}},c={method:"POST",headers:i,body:JSON.stringify(a)},d=await _t(()=>fetch(r,c));if(d.ok){const s=await d.json();return bt(s)}else throw await wt("Generate Auth Token",d)}function qr(e,{fid:t}){return`${mt(e)}/${t}/authTokens:generate`}/** 483 * @license 484 * Copyright 2019 Google LLC 485 * 486 * Licensed under the Apache License, Version 2.0 (the "License");
487 * you may not use this file except in compliance with the License. 488 * You may obtain a copy of the License at 489 * 490 * http://www.apache.org/licenses/LICENSE-2.0 491 * 492 * Unless required by applicable law or agreed to in writing, software 493 * distributed under the License is distributed on an "AS IS" BASIS, 494 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 495 * See the License for the specific language governing permissions and 496 * limitations under the License. 497 */async function Ie(e,t=!1){let n;const r=await q(e.appConfig,o=>{if(!Dt(o))throw E.create("not-registered");const a=o.authToken;if(!t&&Jr(a))return o;if(a.requestStatus===1)return n=zr(e,t),o;{if(!navigator.onLine)throw E.create("app-offline");const c=Xr(o);return n=Gr(e,c),c}});return n?await n:r.authToken}async function zr(e,t){let n=await $e(e.appConfig);for(;n.authToken.requestStatus===1;)await It(100),n=await $e(e.appConfig);const r=n.authToken;return r.requestStatus===0?Ie(e,t):r}function $e(e){return q(e,t=>{if(!Dt(t))throw E.create("not-registered");const n=t.authToken;return Zr(n)?{...t,authToken:{requestStatus:0}}:t})}async function Gr(e,t){try{const n=await Wr(e,t),r={...t,authToken:n};return await K(e.appConfig,r),n}catch(n){if(gt(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await vt(e.appConfig);else{const r={...t,authToken:{requestStatus:0}};await K(e.appConfig,r)}throw n}}function Dt(e){return e!==void 0&&e.registrationStatus===2}function Jr(e){return e.requestStatus===2&&!Yr(e)}function Yr(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+Er}function Xr(e){const t={requestStatus:1,requestTime:Date.now()};return{...e,authToken:t}}function Zr(e){return e.requestStatus===1&&e.requestTime+ft<Date.now()}/** 498 * @license 499 * Copyright 2019 Google LLC 500 * 501 * Licensed under the Apache License, Version 2.0 (the "License"); 502 * you may not use this file except in compliance with the License. 503 * You may obtain a copy of the License at 504 * 505 * http://www.apache.org/licenses/LICENSE-2.0 506 * 507 * Unless required by applicable law or agreed to in writing, software 508 * distributed under the License is distributed on an "AS IS" BASIS, 509 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 510 * See the License for the specific language governing permissions and 511 * limitations under the License. 512 */async function Qr(e){const t=e,{installationEntry:n,registrationPromise:r}=await _e(t);return r?r.catch(console.error):Ie(t).catch(console.error),n.fid}/** 513 * @license 514 * Copyright 2019 Google LLC 515 * 516 * Licensed under the Apache License, Version 2.0 (the "License"); 517 * you may not use this file except in compliance with the License. 518 * You may obtain a copy of the License at 519 * 520 * http://www.apache.org/licenses/LICENSE-2.0 521 * 522 * Unless required by applicable law or agreed to in writing, software 523 * distributed under the License is distributed on an "AS IS" BASIS, 524 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 525 * See the License for the specific language governing permissions and 526 * limitations under the License. 527 */async function ei(e,t=!1){const n=e;return await ti(n),(await Ie(n,t)).token}async function ti(e){const{registrationPromise:t}=await _e(e);t&&await t}/** 528 * @license 529 * Copyright 2019 Google LLC 530 * 531 * Licensed under the Apache License, Version 2.0 (the "License"); 532 * you may not use this file except in compliance with the License. 533 * You may obtain a copy of the License at 534 * 535 * http://www.apache.org/licenses/LICENSE-2.0 536 * 537 * Unless required by applicable law or agreed to in writing, software 538 * distributed under the License is distributed on an "AS IS" BASIS, 539 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 540 * See the License for the specific language governing permissions and 541 * limitations under the License. 542 */function ni(e,t){const{appConfig:n}=e;return Br(n,t),()=>{Fr(n,t)}}/** 543 * @license 544 * Copyright 2019 Google LLC 545 * 546 * Licensed under the Apache License, Version 2.0 (the "License"); 547 * you may not use this file except in compliance with the License. 548 * You may obtain a copy of the License at 549 * 550 * http://www.apache.org/licenses/LICENSE-2.0 551 * 552 * Unless required by applicable law or agreed to in writing, softw
552are 553 * distributed under the License is distributed on an "AS IS" BASIS, 554 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 555 * See the License for the specific language governing permissions and 556 * limitations under the License. 557 */function ri(e){if(!e||!e.options)throw re("App Configuration");if(!e.name)throw re("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw re(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}function re(e){return E.create("missing-app-config-values",{valueName:e})}/** 558 * @license 559 * Copyright 2020 Google LLC 560 * 561 * Licensed under the Apache License, Version 2.0 (the "License"); 562 * you may not use this file except in compliance with the License. 563 * You may obtain a copy of the License at 564 * 565 * http://www.apache.org/licenses/LICENSE-2.0 566 * 567 * Unless required by applicable law or agreed to in writing, software 568 * distributed under the License is distributed on an "AS IS" BASIS, 569 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 570 * See the License for the specific language governing permissions and 571 * limitations under the License. 572 */const kt="installations",ii="installations-internal",oi=e=>{const t=e.getProvider("app").getImmediate(),n=ri(t),r=be(t,"heartbeat");return{app:t,appConfig:n,heartbeatServiceProvider:r,_delete:()=>Promise.resolve()}},ai=e=>{const t=e.getProvider("app").getImmediate(),n=be(t,kt).getImmediate();return{getId:()=>Qr(n),getToken:i=>ei(n,i)}};function si(){S(new y(kt,oi,"PUBLIC")),S(new y(ii,ai,"PRIVATE"))}si();w(ut,we);w(ut,we,"esm2020");/** 573 * @license 574 * Copyright 2019 Google LLC 575 * 576 * Licensed under the Apache License, Version 2.0 (the "License"); 577 * you may not use this file except in compliance with the License. 578 * You may obtain a copy of the License at 579 * 580 * http://www.apache.org/licenses/LICENSE-2.0 581 * 582 * Unless required by applicable law or agreed to in writing, software 583 * distributed under the License is distributed on an "AS IS" BASIS, 584 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 585 * See the License for the specific language governing permissions and 586 * limitations under the License. 587 */const ci="/firebase-messaging-sw.js",di="/firebase-cloud-messaging-push-scope",Ot="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",li="https://fcmregistrations.googleapis.com/v1",Rt="google.c.a.c_id",ui="google.c.a.c_l",fi="google.c.a.ts",pi="google.c.a.e",xe=1e4;var Le;(function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"})(Le||(Le={}));/** 588 * @license 589 * Copyright 2018 Google LLC 590 * 591 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 592 * in compliance with the License. You may obtain a copy of the License at 593 * 594 * http://www.apache.org/licenses/LICENSE-2.0 595 * 596 * Unless required by applicable law or agreed to in writing, software distributed under the License 597 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 598 * or implied. See the License for the specific language governing permissions and limitations under 599 * the License. 600 */var D;(function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked",e.FID_REGISTERED="fid-registered"})(D||(D={}));/** 601 * @license 602 * Copyright 2017 Google LLC 603 * 604 * Licensed under the Apache License, Version 2.0 (the "License"); 605 * you may not use this file except in compliance with the License. 606 * You may obtain a copy of the License at 607 * 608 * http://www.apache.org/licenses/LICENSE-2.0 609 * 610 * Unless required by applicable law or agreed to in writing, software 611 * distributed under the License is distributed on an "AS IS" BASIS, 612 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 613 * See the License for the specific language governing permissions and 614 * limitations under the License. 615 */function p(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Nt(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/\-/g,"+").replace(/_/g,"/"),r=atob(n),i=new Uint8Array(r.length);for(let o=0;o<r.length;++o)i[o]=r.charCodeAt(o);return i}/** 616 * @license 617 * Copyright 2019 Google LLC 618 * 619 * Licensed under the Apache License, Version 2.0 (the "License");
620 * you may not use this file except in compliance with the License. 621 * You may obtain a copy of the License at 622 * 623 * http://www.apache.org/licenses/LICENSE-2.0 624 * 625 * Unless required by applicable law or agreed to in writing, software 626 * distributed under the License is distributed on an "AS IS" BASIS, 627 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 628 * See the License for the specific language governing permissions and 629 * limitations under the License. 630 */const ie="fcm_token_details_db",hi=5,He="fcm_token_object_Store";async function gi(e){if("databases"in indexedDB&&!(await indexedDB.databases()).map(o=>o.name).includes(ie))return null;let t=null;return(await W(ie,hi,{upgrade:async(r,i,o,a)=>{if(i<2||!r.objectStoreNames.contains(He))return;const c=a.objectStore(He),d=await c.index("fcmSenderId").get(e);if(await c.clear(),!!d){if(i===2){const s=d;if(!s.auth||!s.p256dh||!s.endpoint)return;t={token:s.fcmToken,createTime:s.createTime??Date.now(),subscriptionOptions:{auth:s.auth,p256dh:s.p256dh,endpoint:s.endpoint,swScope:s.swScope,vapidKey:typeof s.vapidKey=="string"?s.vapidKey:p(s.vapidKey)}}}else if(i===3){const s=d;t={token:s.fcmToken,createTime:s.createTime,subscriptionOptions:{auth:p(s.auth),p256dh:p(s.p256dh),endpoint:s.endpoint,swScope:s.swScope,vapidKey:p(s.vapidKey)}}}else if(i===4){const s=d;t={token:s.fcmToken,createTime:s.createTime,subscriptionOptions:{auth:p(s.auth),p256dh:p(s.p256dh),endpoint:s.endpoint,swScope:s.swScope,vapidKey:p(s.vapidKey)}}}}}})).close(),await L(ie),await L("fcm_vapid_details_db"),await L("undefined"),mi(t)?t:null}function mi(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return typeof e.createTime=="number"&&e.createTime>0&&typeof e.token=="string"&&e.token.length>0&&typeof t.auth=="string"&&t.auth.length>0&&typeof t.p256dh=="string"&&t.p256dh.length>0&&typeof t.endpoint=="string"&&t.endpoint.length>0&&typeof t.swScope=="string"&&t.swScope.length>0&&typeof t.vapidKey=="string"&&t.vapidKey.length>0}/** 631 * @license 632 * Copyright 2017 Google LLC 633 * 634 * Licensed under the Apache License, Version 2.0 (the "License"); 635 * you may not use this file except in compliance with the License. 636 * You may obtain a copy of the License at 637 * 638 * http://www.apache.org/licenses/LICENSE-2.0 639 * 640 * Unless required by applicable law or agreed to in writing, software 641 * distributed under the License is distributed on an "AS IS" BASIS, 642 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 643 * See the License for the specific language governing permissions and 644 * limitations under the License. 645 */const bi={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","fid-registration-failed":"A problem occurred while creating an FCM registration via FID: {$errorInfo}","fid-unregister-failed":"A problem occurred while unregistering the FCM registration via FID: {$errorInfo}","fid-registration-idb-schema-unavailable":"Unable to read or persist FID registration metadata because the messaging IndexedDB schema is unavailable (for example, the database could not be upgraded to the latest version).","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invali
645d-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.","invalid-on-registered-handler":"No onRegistered callback handler was provided or registered. Implement onRegistered() before register()."},l=new V("messaging","Messaging",bi);/** 646 * @license 647 * Copyright 2019 Google LLC 648 * 649 * Licensed under the Apache License, Version 2.0 (the "License"); 650 * you may not use this file except in compliance with the License. 651 * You may obtain a copy of the License at 652 * 653 * http://www.apache.org/licenses/LICENSE-2.0 654 * 655 * Unless required by applicable law or agreed to in writing, software 656 * distributed under the License is distributed on an "AS IS" BASIS, 657 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 658 * See the License for the specific language governing permissions and 659 * limitations under the License. 660 */const je="firebase-messaging-database",Ke=2,A="firebase-messaging-store",g="firebase-messaging-fid-registration-store",wi={openDB:W,deleteDB:L};let Ue=wi,N=null;function yi(e,t,n){switch(t){case 0:if(e.createObjectStore(A),n===1)break;case 1:n===2&&e.createObjectStore(g)}}function Ve(e){return{upgrade:(t,n)=>{yi(t,n,e)},blocked:()=>{},blocking:(t,n,r)=>{N=null,r.target?.close()},terminated:()=>{N=null}}}function z(){return N||(N=Ue.openDB(je,Ke,Ve(2)).catch(()=>Ue.openDB(je,Ke-1,Ve(1)))),N}function Pt(e,t){return e.objectStoreNames.contains(t)}function Mt(e){if(!Pt(e,g))throw l.create("fid-registration-idb-schema-unavailable")}async function _i(e){const t=G(e),r=await(await z()).transaction(A).objectStore(A).get(t);if(r)return r;{const i=await gi(e.appConfig.senderId);if(i)return await Se(e,i),i}}async function Se(e,t){const n=G(e),r=await z(),i=[A],o=Pt(r,g);o&&i.push(g);const a=r.transaction(i,"readwrite");return await a.objectStore(A).put(t,n),o&&await a.objectStore(g).delete(n),await a.done,t}async function Bt(e){const t=G(e),n=await z();return Mt(n),await n.transaction(g).objectStore(g).get(t)}async function Ii(e,t){const n=G(e),r=await z();Mt(r);const i=r.transaction([A,g],"readwrite");return await i.objectStore(g).put(t,n),await i.objectStore(A).delete(n),await i.done,t}function G({appConfig:e}){return e.appId}const We="@firebase/messaging",pe="0.13.0";/** 661 * @license 662 * Copyright 2019 Google LLC 663 * 664 * Licensed under the Apache License, Version 2.0 (the "License"); 665 * you may not use this file except in compliance with the License. 666 * You may obtain a copy of the License at 667 * 668 * http://www.apache.org/licenses/LICENSE-2.0 669 * 670 * Unless required by applicable law or agreed to in writing, software 671 * distributed under the License is distributed on an "AS IS" BASIS, 672 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 673 * See the License for the specific language governing permissions and 674 * limitations under the License. 675 */const Si=3,Ei=1e3;async function Ti(e,t){const n=await Y(e),r=Ee(t,e.appConfig.appName,!1),i={method:"POST",headers:n,body:JSON.stringify(r)};let o;try{o=await(await fetch(J(e.appConfig),i)).json()}catch(a){throw l.create("token-subscribe-failed",{errorInfo:a?.toString()})}if(o.error){const a=o.error.message;throw l.create("token-subscribe-failed",{errorInfo:a})}if(!o.token)throw l.create("token-subscribe-no-token");return o.token}async function Ai(e,t){const n=await Y(e),r=Ee(t,e.appConfig.appName,!0),i={method:"POST",headers:n,body:JSON.stringify(r)};let o;try{o=await Oi(()=>fetch(J(e.appConfig),i),Si,Ei)}catch(d){throw l.create("fid-registration-failed",{errorInfo:d?.toString()})}if(o.ok)return{responseFid:await vi(o)};let a;try{a=await o.json()}catch{throw l.create("fid-registration-failed",{errorInfo:o.statusText})}const c=a.error?.message??o.statusText;throw l.create("fid-registration-failed",{errorInfo:c})}async function vi(e){const t=await e.text();if(!t.trim())throw l.create("fid-registration-failed",{errorInfo:"CreateRegistration succeeded but response body is empty"});let n;try{n=JSON.parse(t)}catch{throw l.create("fid-registration-failed",{errorInfo:"CreateRegistration succeeded but response body is not val
675id JSON"})}const r=n.name;if(typeof r!="string"||r.length===0)throw l.create("fid-registration-failed",{errorInfo:"CreateRegistration succeeded but response did not include a non-empty name"});return Ci(r)}const qe="/registrations/";function Ci(e){const t=e.indexOf(qe);if(t!==-1){const n=e.slice(t+qe.length);if(n.length>0)return n}throw l.create("fid-registration-failed",{errorInfo:"CreateRegistration succeeded but response name is not a valid registration resource name"})}async function Di(e,t){const n=await Y(e),r=Ee(t.subscriptionOptions,e.appConfig.appName,!1),i={method:"PATCH",headers:n,body:JSON.stringify(r)};let o;try{o=await(await fetch(`${J(e.appConfig)}/${t.token}`,i)).json()}catch(a){throw l.create("token-update-failed",{errorInfo:a?.toString()})}if(o.error){const a=o.error.message;throw l.create("token-update-failed",{errorInfo:a})}if(!o.token)throw l.create("token-update-no-token");return o.token}async function ki(e,t){const r={method:"DELETE",headers:await Y(e)};try{const o=await(await fetch(`${J(e.appConfig)}/${t}`,r)).json();if(o.error){const a=o.error.message;throw l.create("token-unsubscribe-failed",{errorInfo:a})}}catch(i){throw l.create("token-unsubscribe-failed",{errorInfo:i?.toString()})}}async function Oi(e,t,n){let r;for(let i=0;i<t;i++)try{return await e()}catch(o){if(r=o,i<t-1){const a=n*Math.pow(2,i);await new Promise(c=>setTimeout(c,a))}}throw r}function J({projectId:e}){return`${li}/projects/${e}/registrations`}async function Y({appConfig:e,installations:t}){const n=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${n}`})}function Ri(e,t){try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e))return new URL(e).host}catch{}try{if(typeof self<"u"&&self.location?.href)return new URL(e,self.location.origin).host}catch{}return typeof self<"u"&&self.location?.host?self.location.host:t}function Ee({p256dh:e,auth:t,endpoint:n,vapidKey:r,swScope:i},o,a){const c={web:{origin:Ri(i,o),endpoint:n,auth:t,p256dh:e}};return a&&(c.fcm_sdk_version=pe),r!==Ot&&(c.web.applicationPubKey=r),c}/** 676 * @license 677 * Copyright 2019 Google LLC 678 * 679 * Licensed under the Apache License, Version 2.0 (the "License"); 680 * you may not use this file except in compliance with the License. 681 * You may obtain a copy of the License at 682 * 683 * http://www.apache.org/licenses/LICENSE-2.0 684 * 685 * Unless required by applicable law or agreed to in writing, software 686 * distributed under the License is distributed on an "AS IS" BASIS, 687 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 688 * See the License for the specific language governing permissions and 689 * limitations under the License. 690 */const Ni=10080*60*1e3;async function Pi(e){const t=await Bi(e.swRegistration,e.vapidKey),n={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:p(t.getKey("auth")),p256dh:p(t.getKey("p256dh"))},r=await _i(e.firebaseDependencies);if(r){if(Fi(r.subscriptionOptions,n))return Date.now()>=r.createTime+Ni?Mi(e,{token:r.token,createTime:Date.now(),subscriptionOptions:n}):r.token;try{await ki(e.firebaseDependencies,r.token)}catch(i){console.warn(i)}return ze(e.firebaseDependencies,n)}else return ze(e.firebaseDependencies,n)}async function Mi(e,t){try{const n=await Di(e.firebaseDependencies,t),r={...t,token:n,createTime:Date.now()};return await Se(e.firebaseDependencies,r),n}catch(n){throw n}}async function ze(e,t){const r={token:await Ti(e,t),createTime:Date.now(),subscriptionOptions:t};return await Se(e,r),r.token}async function Bi(e,t){const n=await e.pushManager.getSubscription();return n||e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Nt(t)})}function Fi(e,t){const n=t.vapidKey===e.vapidKey,r=t.endpoint===e.endpoint,i=t.auth===e.auth,o=t.p256dh===e.p256dh;return n&&r&&i&&o}function $i(e,t){const n=e.onRegisteredHandler;n&&(typeof n=="function"?n(t):n.next(t))}/** 691 * @license 692 * Copyright 2020 Google LLC 693 * 694 * Licensed under the Apache License, Version 2.0 (the "License"); 695 * you may not use this file except in compliance with the License. 696 * You may obtain a copy of the License at 697 * 698 * http://www.apache.org/licenses/LICENSE-2.0 699 * 700 * Unless required by applicable law or agreed to in writing, softw
700are 701 * distributed under the License is distributed on an "AS IS" BASIS, 702 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 703 * See the License for the specific language governing permissions and 704 * limitations under the License. 705 */async function xi(e){try{e.swRegistration=await navigator.serviceWorker.register(ci,{scope:di}),e.swRegistration.update().catch(()=>{}),await Li(e.swRegistration)}catch(t){throw l.create("failed-service-worker-registration",{browserErrorMessage:t?.message})}}async function Li(e){return new Promise((t,n)=>{const r=setTimeout(()=>n(new Error(`Service worker not registered after ${xe} ms`)),xe),i=e.installing||e.waiting;e.active?(clearTimeout(r),t()):i?i.onstatechange=o=>{o.target?.state==="activated"&&(i.onstatechange=null,clearTimeout(r),t())}:(clearTimeout(r),n(new Error("No incoming service worker found.")))})}/** 706 * @license 707 * Copyright 2020 Google LLC 708 * 709 * Licensed under the Apache License, Version 2.0 (the "License"); 710 * you may not use this file except in compliance with the License. 711 * You may obtain a copy of the License at 712 * 713 * http://www.apache.org/licenses/LICENSE-2.0 714 * 715 * Unless required by applicable law or agreed to in writing, software 716 * distributed under the License is distributed on an "AS IS" BASIS, 717 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 718 * See the License for the specific language governing permissions and 719 * limitations under the License. 720 */async function Ft(e,t){if(!t&&!e.swRegistration&&await xi(e),!(!t&&e.swRegistration)){if(!(t instanceof ServiceWorkerRegistration))throw l.create("invalid-sw-registration");e.swRegistration=t}}/** 721 * @license 722 * Copyright 2020 Google LLC 723 * 724 * Licensed under the Apache License, Version 2.0 (the "License"); 725 * you may not use this file except in compliance with the License. 726 * You may obtain a copy of the License at 727 * 728 * http://www.apache.org/licenses/LICENSE-2.0 729 * 730 * Unless required by applicable law or agreed to in writing, software 731 * distributed under the License is distributed on an "AS IS" BASIS, 732 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 733 * See the License for the specific language governing permissions and 734 * limitations under the License. 735 */async function $t(e,t){t?e.vapidKey=t:e.vapidKey||(e.vapidKey=Ot)}/** 736 * @license 737 * Copyright 2020 Google LLC 738 * 739 * Licensed under the Apache License, Version 2.0 (the "License"); 740 * you may not use this file except in compliance with the License. 741 * You may obtain a copy of the License at 742 * 743 * http://www.apache.org/licenses/LICENSE-2.0 744 * 745 * Unless required by applicable law or agreed to in writing, software 746 * distributed under the License is distributed on an "AS IS" BASIS, 747 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 748 * See the License for the specific language governing permissions and 749 * limitations under the License. 750 */const Ge=3;async function Hi(e,t){const n=await ji(e.swRegistration,e.vapidKey),r={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:n.endpoint,auth:p(n.getKey("auth")),p256dh:p(n.getKey("p256dh"))},i=e.firebaseDependencies.installations;for(let o=0;o<Ge;o++){const{responseFid:a}=await Ai(e.firebaseDependencies,r);if(a===t)return;o<Ge-1&&await i.getToken(!0)}throw l.create("fid-registration-failed",{errorInfo:"CreateRegistration response FID does not match Firebase Installation ID"})}async function ji(e,t){const n=await e.pushManager.getSubscription();return n||e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Nt(t)})}/** 751 * @license 752 * Copyright 2020 Google LLC 753 * 754 * Licensed under the Apache License, Version 2.0 (the "License"); 755 * you may not use this file except in compliance with the License. 756 * You may obtain a copy of the License at 757 * 758 * http://www.apache.org/licenses/LICENSE-2.0 759 * 760 * Unless required by applicable law or agreed to in writing, software 761 * distributed under the License is distributed on an "AS IS" BASIS, 762 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 763 * See the License for the specific language governing permissions and 764 * limitations under the License. 765 */const Ki=10080*60*1e3;async function xt(e,t){if(!navigator)throw l.create("only-available-in-window");if(Notification.permission==="default"&&await Notification.requestPermission(),Notification.permission!=="granted")throw l.create("permission-blocked");if(!e.onRegisteredHandler)throw l.create("invalid-on-registered-handler");await $t(e,t?.vapidKey),await Ft(e,t?.serviceWorkerRegistration);const n=e._registerNotifyChain.catch(()=>{});return e._registerNotifyChain=n.then(async()=>{const r=await e.firebaseDependencies.installations.getId(),i=await Bt(e.firebaseDependencies),o=Date.now();if((!i||i.fid!==r||o>=i.lastRegisterTime+Ki)&&(await Hi(e,r),await Ii(e.firebaseDependencies,{fid:r,lastRegisterTime:o,vapidKey:e.vapidKey}
765)),!e.onRegisteredHandler)throw l.create("invalid-on-registered-handler");$i(e,r)}),e._registerNotifyChain}/** 766 * @license 767 * Copyright 2026 Google LLC 768 * 769 * Licensed under the Apache License, Version 2.0 (the "License"); 770 * you may not use this file except in compliance with the License. 771 * You may obtain a copy of the License at 772 * 773 * http://www.apache.org/licenses/LICENSE-2.0 774 * 775 * Unless required by applicable law or agreed to in writing, software 776 * distributed under the License is distributed on an "AS IS" BASIS, 777 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 778 * See the License for the specific language governing permissions and 779 * limitations under the License. 780 */function Ui(e,t){return ni(t,()=>{(async()=>!e.onRegisteredHandler||!await Bt(e.firebaseDependencies)||await xt(e).catch(()=>{}))()})}/** 781 * @license 782 * Copyright 2020 Google LLC 783 * 784 * Licensed under the Apache License, Version 2.0 (the "License"); 785 * you may not use this file except in compliance with the License. 786 * You may obtain a copy of the License at 787 * 788 * http://www.apache.org/licenses/LICENSE-2.0 789 * 790 * Unless required by applicable law or agreed to in writing, software 791 * distributed under the License is distributed on an "AS IS" BASIS, 792 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 793 * See the License for the specific language governing permissions and 794 * limitations under the License. 795 */function Je(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return Vi(t,e),Wi(t,e),qi(t,e),t}function Vi(e,t){if(!t.notification)return;e.notification={};const n=t.notification.title;n&&(e.notification.title=n);const r=t.notification.body;r&&(e.notification.body=r);const i=t.notification.image;i&&(e.notification.image=i);const o=t.notification.icon;o&&(e.notification.icon=o)}function Wi(e,t){t.data&&(e.data=t.data)}function qi(e,t){if(!t.fcmOptions&&!t.notification?.click_action)return;e.fcmOptions={};const n=t.fcmOptions?.link??t.notification?.click_action;n&&(e.fcmOptions.link=n);const r=t.fcmOptions?.analytics_label;r&&(e.fcmOptions.analyticsLabel=r)}/** 796 * @license 797 * Copyright 2019 Google LLC 798 * 799 * Licensed under the Apache License, Version 2.0 (the "License"); 800 * you may not use this file except in compliance with the License. 801 * You may obtain a copy of the License at 802 * 803 * http://www.apache.org/licenses/LICENSE-2.0 804 * 805 * Unless required by applicable law or agreed to in writing, software 806 * distributed under the License is distributed on an "AS IS" BASIS, 807 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 808 * See the License for the specific language governing permissions and 809 * limitations under the License. 810 */function zi(e){return typeof e=="object"&&!!e&&Rt in e}/** 811 * @license 812 * Copyright 2019 Google LLC 813 * 814 * Licensed under the Apache License, Version 2.0 (the "License"); 815 * you may not use this file except in compliance with the License. 816 * You may obtain a copy of the License at 817 * 818 * http://www.apache.org/licenses/LICENSE-2.0 819 * 820 * Unless required by applicable law or agreed to in writing, software 821 * distributed under the License is distributed on an "AS IS" BASIS, 822 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 823 * See the License for the specific language governing permissions and 824 * limitations under the License. 825 */function Gi(e){if(!e||!e.options)throw oe("App Configuration Object");if(!e.name)throw oe("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:n}=e;for(const r of t)if(!n[r])throw oe(r);return{appName:e.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}function oe(e){return l.create("missing-app-config-values",{valueName:e})}/** 826 * @license 827 * Copyright 2020 Google LLC 828 * 829 * Licensed under the Apache License, Version 2.0 (the "License"); 830 * you may not use this file except in compliance with the License. 831 * You may obtain a copy of the License at 832 * 833 * http://www.apache.org/licenses/LICENSE-2.0 834 * 835 * Unless required by applicable law or agreed to in writing, softw
835are 836 * distributed under the License is distributed on an "AS IS" BASIS, 837 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 838 * See the License for the specific language governing permissions and 839 * limitations under the License. 840 */class Ji{constructor(t,n,r){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.onRegisteredHandler=null,this.onUnregisteredHandler=null,this._registerNotifyChain=Promise.resolve(),this._fidChangeUnsubscribe=null,this.logEvents=[],this.logQueue={state:"stopped"};const i=Gi(t);this.firebaseDependencies={app:t,appConfig:i,installations:n,analyticsProvider:r}}_delete(){return this._fidChangeUnsubscribe&&(this._fidChangeUnsubscribe(),this._fidChangeUnsubscribe=null),this.logQueue.state==="scheduled"&&clearTimeout(this.logQueue.timerId),this.logQueue={state:"stopped"},Promise.resolve()}}/** 841 * @license 842 * Copyright 2020 Google LLC 843 * 844 * Licensed under the Apache License, Version 2.0 (the "License"); 845 * you may not use this file except in compliance with the License. 846 * You may obtain a copy of the License at 847 * 848 * http://www.apache.org/licenses/LICENSE-2.0 849 * 850 * Unless required by applicable law or agreed to in writing, software 851 * distributed under the License is distributed on an "AS IS" BASIS, 852 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 853 * See the License for the specific language governing permissions and 854 * limitations under the License. 855 */async function Lt(e,t){if(!navigator)throw l.create("only-available-in-window");if(Notification.permission==="default"&&await Notification.requestPermission(),Notification.permission!=="granted")throw l.create("permission-blocked");return await $t(e,t?.vapidKey),await Ft(e,t?.serviceWorkerRegistration),Pi(e)}/** 856 * @license 857 * Copyright 2019 Google LLC 858 * 859 * Licensed under the Apache License, Version 2.0 (the "License"); 860 * you may not use this file except in compliance with the License. 861 * You may obtain a copy of the License at 862 * 863 * http://www.apache.org/licenses/LICENSE-2.0 864 * 865 * Unless required by applicable law or agreed to in writing, software 866 * distributed under the License is distributed on an "AS IS" BASIS, 867 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 868 * See the License for the specific language governing permissions and 869 * limitations under the License. 870 */async function Yi(e,t,n){const r=Xi(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(r,{message_id:n[Rt],message_name:n[ui],message_time:n[fi],message_device_time:Math.floor(Date.now()/1e3)})}function Xi(e){switch(e){case D.NOTIFICATION_CLICKED:return"notification_open";case D.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}/** 871 * @license 872 * Copyright 2017 Google LLC 873 * 874 * Licensed under the Apache License, Version 2.0 (the "License"); 875 * you may not use this file except in compliance with the License. 876 * You may obtain a copy of the License at 877 * 878 * http://www.apache.org/licenses/LICENSE-2.0 879 * 880 * Unless required by applicable law or agreed to in writing, software 881 * distributed under the License is distributed on an "AS IS" BASIS, 882 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 883 * See the License for the specific language governing permissions and 884 * limitations under the License. 885 */async function Zi(e,t){const n=t.data;if(!n.isFirebaseMessaging)return;if(e.onMessageHandler&&n.messageType===D.PUSH_RECEIVED&&(typeof e.onMessageHandler=="function"?e.onMessageHandler(Je(n)):e.onMessageHandler.next(Je(n))),e.onRegisteredHandler&&n.messageType===D.FID_REGISTERED){const i=n.fid;typeof e.onRegisteredHandler=="function"?e.onRegisteredHandler(i):e.onRegisteredHandler.next(i)}const r=n.data;zi(r)&&r[pi]==="1"&&await Yi(e,n.messageType,r)}/** 886 * @license 887 * Copyright 2020 Google LLC 888 * 889 * Licensed under the Apache License, Version 2.0 (the "License"); 890 * you may not use this file except in compliance with the License. 891 * You may obtain a copy of the License at 892 * 893 * http://www.apache.org/licenses/LICENSE-2.0 894 * 895 * Unless required by applicable law or agreed to in writing, softw
895are 896 * distributed under the License is distributed on an "AS IS" BASIS, 897 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 898 * See the License for the specific language governing permissions and 899 * limitations under the License. 900 */const Qi=e=>{const t=new Ji(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",n=>Zi(t,n)),t._fidChangeUnsubscribe=Ui(t,e.getProvider("installations").getImmediate()),t},eo=e=>{const t=e.getProvider("messaging").getImmediate();return{getToken:r=>Lt(t,r),register:r=>xt(t,r)}};function to(){S(new y("messaging",Qi,"PUBLIC")),S(new y("messaging-internal",eo,"PRIVATE")),w(We,pe),w(We,pe,"esm2020")}/** 901 * @license 902 * Copyright 2020 Google LLC 903 * 904 * Licensed under the Apache License, Version 2.0 (the "License"); 905 * you may not use this file except in compliance with the License. 906 * You may obtain a copy of the License at 907 * 908 * http://www.apache.org/licenses/LICENSE-2.0 909 * 910 * Unless required by applicable law or agreed to in writing, software 911 * distributed under the License is distributed on an "AS IS" BASIS, 912 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 913 * See the License for the specific language governing permissions and 914 * limitations under the License. 915 */async function Ht(){try{await ot()}catch{return!1}return typeof window<"u"&&it()&&cn()&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}/** 916 * @license 917 * Copyright 2020 Google LLC 918 * 919 * Licensed under the Apache License, Version 2.0 (the "License"); 920 * you may not use this file except in compliance with the License. 921 * You may obtain a copy of the License at 922 * 923 * http://www.apache.org/licenses/LICENSE-2.0 924 * 925 * Unless required by applicable law or agreed to in writing, software 926 * distributed under the License is distributed on an "AS IS" BASIS, 927 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 928 * See the License for the specific language governing permissions and 929 * limitations under the License. 930 */function no(e,t){if(!navigator)throw l.create("only-available-in-window");return e.onMessageHandler=t,()=>{e.onMessageHandler=null}}/** 931 * @license 932 * Copyright 2017 Google LLC 933 * 934 * Licensed under the Apache License, Version 2.0 (the "License"); 935 * you may not use this file except in compliance with the License. 936 * You may obtain a copy of the License at 937 * 938 * http://www.apache.org/licenses/LICENSE-2.0 939 * 940 * Unless required by applicable law or agreed to in writing, software 941 * distributed under the License is distributed on an "AS IS" BASIS, 942 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 943 * See the License for the specific language governing permissions and 944 * limitations under the License. 945 */function ro(e=dr()){return Ht().then(t=>{if(!t)throw l.create("unsupported-browser")},t=>{throw l.create("indexed-db-unsupported")}),be(ge(e),"messaging").getImmediate()}async function io(e,t){return e=ge(e),Lt(e,t)}function oo(e,t){return e=ge(e),no(e,t)}to();const f=window.__iterableConfig;if(!f||!f.apiKey||!f.vapidKey)throw new Error("IterableWebPush: window.__iterableConfig missing or incomplete â aborting.");const Ye="clwp_iterable_user_id",jt="clwp_iterable_browser_token",he="clwp_iterable_sub_created",Kt="clwp_iterable_sub_updated",U="clwp_iterable_last_prompt",Te="clwp_iterable_prompt_count",Xe="clwp_iterable_profile_sig",Ut="clwp_iterable_signup_url",Vt="clwp_iterable_utm";function v(e){return new Date(e).toISOString().replace("T"," ").slice(0,19)}function ao(){let e=localStorage.getItem(Ye);return e||(e=crypto.randomUUID(),localStorage.setItem(Ye,e)),e}function X(){return ao()+"@placeholder.email"}let x=null;function so(){if(x)return x;const e=navigator.userAgent||"",t=navigator.userAgentData||null;let n="",r="";const i=[["Edge",/Edg(?:e|A|iOS)?\/([\d.]+)/],["Opera",/OPR\/([\d.]+)/],["Samsung",/SamsungBrowser\/([\d.]+)/],["Firefox",/(?:Firefox|FxiOS)\/([\d.]+)/],["Chrome",/(?:Chrome|CriOS)\/([\d.]+)/],["Safari",/Version\/([\d.]+).*Safari/]];for(const[c,d]of i){const s=e.match(d);if(s){n=c,r=s[1];break}}let o="";/Windows NT/.test(e)?o="Windows":/Android/.test(e)?o="Android":/iPhone|iPad|iPod/.test(e)?o="iOS":/Mac OS X/.test(e)?o="macOS":/CrOS/.test(e)?o="ChromeOS":/Linux/.test(e)&&(o="Linux");let a;return t&&typeof t.mobile=="boolean"?a=t.mobile?"mobile":"desktop":/iPad|Tablet/.test(e)?a="tablet":/Mobi|Android/.test(e)?a="mobile":a="desktop",x={browser:n,browserVersion:r,operatingSystem:o,deviceType:a},x}function co(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}}const lo=ct(f.firebase);let M=null;Ht().then(e=>{e&&(M=ro(lo),oo(M,wo))}).catch(()=>{});function Ae(){return typeof Notification<"u"}function Wt(){return localStorage.getItem(jt)||""}function qt(){return Ae()&&Notification.permission==="granted"&&!!Wt()}function uo(){return!Ae()||!M?"unsupported":Notification.permission==="denied"?"denied":qt()?"subscribed":localStorage.getItem(U)?"dismissed":"unprompted"}function fo(){const e=so(),t=localStorage.getItem(he),n=localStorage.getItem(Kt),r={cl_brand:f.brand||"",cl_websiteDomain:window.location.hostname,cl_browser:e.browser,cl_browserVersion:e.browserVersion,cl_operatingSystem:e.operatingSystem,cl_deviceType:e.deviceType,cl_language:navigator.language||"",cl_timeZone:co(),cl_webPushPermissionStatus:Ae()?Notification.permission:"unsupported",cl_canReceiveNotifications:qt(),cl_subscriptionStatus:uo()},i=localStorage.getItem(Ut);i&&(r.cl_signupUrl=i);const o=localStorage.getItem(Vt);if(o)try{Object.assign(r,JSON.parse(o))}catch{}return t&&(r.cl_subscriptionCreatedAt=v(parseInt(t,10))),n&&(r.cl_subscriptionUpdatedAt=v(parseInt(n,10))),r}const po={utm_source:"cl_utmSource",utm_medium:"cl_utmMedium",utm_campaign:"cl_utmCampaign",utm_term:"cl_utmTerm",utm_content:"cl_utmContent"};function ho(){const e={};try{const t=new URLSearchParams(window.location.search);for(const[n,r]of Object.entries(po)){const i=t.get(n);i&&(e[r]=i)}}catch{}return e}function go(){return{cl_pageUrl:window.location.href,cl_pageTitle:document.title}}async function zt(){const e=fo(),t=JSON.stringify(e);if(localStorage.getItem(Xe)!==t)try{(await fetch("https://api.iterable.com/api/users/update",{method:"POST",headers:{"Content-Type":"application/json","Api-Key":f.apiKey},body:JSON.stringify({email:X(),dataFields:e,mergeNestedObjects:!0})})).ok&&localStorage.setItem(Xe,t)}catch{}}async function mo(e){if(Wt()===e)return;const n=X();try{if((await fetch("https://api.iterable.com/api/users/registerBrowserToken",{method:"POST",headers:{"Content-Type":"application/json","Api-Key":f.apiKey},body:JSON.stringify({browserToken:e,email:n})})).ok){const i=String(Date.now());return localStorage.setItem(jt,e),localStorage.getItem(he)||(localStorage.setItem(he,i),localStorage.setItem(Ut,window.location.href),localStorage.setItem(Vt,JSON.stringify(ho()))),localStorage.setItem(Kt,i),!0}}catch{}return!1}async function bo(e,t){try{await fetch("https://api.iterable.com/api/events/trackWebPushClick",{method:"POST",headers:{"Content-Type":"application/json","Api-Key":f.apiKey},body:JSON.stringify({messageId:e.messageId||void 0,campaignId:e.campaignId?parseInt(e.campaignId,10):void 0,templateId:e.templateId?parseInt(e.templateId,10):void 0,email:e.email||X(),userId:e.userId||void 0})})}catch{}t&&window.open(t,"_blank")}async function H(e,t={},n=!1){const r="clwp_iterable_tracked_"+e;if(!(n&&localStorage.getItem(r)))try{const i=await fetch("https://api.iterable.com/api/events/track",{method:"POST",headers:{"Content-Type":"application/json","Api-Key":f.apiKey},body:JSON.stringify({email:X(),eventName:e,dataFields:t})});n&&i.ok&&localStorage.setItem(r,"1")}catch{}}function wo(e){const t=e.notification||{},n=e.data||{},r=e.fcmOptions&&e.fcmOptions.link||null,i=document.createElement("div");Object.assign(i.style,{position:"fixed",bottom:"24px",right:"24px",maxWidth:"360px",padding:"16px 20px",background:"#fff",color:"#111",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",zIndex:"999999",fontFamily:"sans-serif",fontSize:"14px",lineHeight:"1.4",cursor:r?"pointer":"default",transition:"opacity 0.3s ease"});const o=document.createElement("strong");o.textContent=t.title||"";const a=document.createElement("p");Object.assign(a.style,{margin:"4px 0 0",opacity:"0.75"}),a.textContent=t.body||"",i.appendChild(o),t.body&&i.appendChild(a);const c=()=>{i.style.opacity="0",setTimeout(()=>{i.parentNode&&i.parentNode.removeChild(i)},300)};r&&i.addEventListener("click",()=>{c(),bo(n,r)}),document.body.appendChild(i),setTimeout(c,8e3)}const yo=7,Gt=yo*864e5;function _o(){if(localStorage.getItem("clwp_iterable_prompted"))return localStorage.removeItem("clwp_iterable_prompted"),localStorage.setItem(U,String(Date.now())),localStorage.setItem(Te,"1"),!1;const e=parseInt(localStorage.getItem(U)||"0",10);return e?Date.now()-e>=Gt:!0}function Ze(){return parseInt(localStorage.getItem(Te)||"0",10)}async function Io(){let e;try{e=await navigator.serviceWorker.register(f.swPath,{scope:f.swScope}),await Promise.race([navigator.serviceWorker.ready,new Promise(r=>setTimeout(r,5e3))])}catch{e=void 0}let t;try{t=await io(M,{vapidKey:f.vapidKey,serviceWorkerRegistration:e})}catch{return}if(!t)return;const n=await mo(t);await zt(),n&&await H("webPushSubscribed",{cl_registeredAt:v(Date.now()),cl_webPushToken:t,cl_pageUrl:window.location.href})}
945async function So(){if(M&&Notification.permission!=="denied"){if(Notification.permission==="default"){if(!_o())return;const e=Date.now();localStorage.setItem(U,String(e)),localStorage.setItem(Te,String(Ze()+1));const t=Ze(),n=go();await H("webPushPromptShown",{cl_promptShownAt:v(e),cl_secondsToPrompt:Math.round(performance.now()/1e3),cl_retryAttempt:t,...n});const r=await Notification.requestPermission(),i=v(Date.now());if(r==="denied"?await H("webPushPermissionDenied",{cl_respondedAt:i,cl_retryAttempt:t,...n},!0):r==="default"&&await H("webPushPromptDismissed",{cl_respondedAt:i,cl_retryAttempt:t,cl_retryEligibleAt:v(e+Gt),...n}),r!=="granted"){await zt();return}}await Io()}}function Qe(){setTimeout(So,1e4)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Qe):Qe(); 946 947})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.