marketplacepos 3.11.1 → 3.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/Marketplace/3rdpartylicenses.txt +40 -40
  2. package/Marketplace/chunk-3LQ5TKLD.js +1 -0
  3. package/Marketplace/chunk-3PX6SSDC.js +1 -0
  4. package/Marketplace/chunk-5LCXVQBT.js +1 -0
  5. package/Marketplace/chunk-5SE72MGC.js +2 -0
  6. package/Marketplace/chunk-5ZUWMFL5.js +1 -0
  7. package/Marketplace/chunk-6B64VOO7.js +1 -0
  8. package/Marketplace/chunk-6DRNAUKE.js +8 -0
  9. package/Marketplace/chunk-6F6NSBIF.js +1 -0
  10. package/Marketplace/chunk-6HBK3C7G.js +1 -0
  11. package/Marketplace/chunk-6WGRXHNE.js +47 -0
  12. package/Marketplace/chunk-AL67KXJV.js +2 -0
  13. package/Marketplace/chunk-BD2QQPDK.js +1 -0
  14. package/Marketplace/chunk-BMZAGAK3.js +1 -0
  15. package/Marketplace/chunk-C45X4NQK.js +5 -0
  16. package/Marketplace/chunk-D72PMDHY.js +1 -0
  17. package/Marketplace/chunk-DEH6NGKQ.js +1 -0
  18. package/Marketplace/chunk-DT3B54LD.js +4 -0
  19. package/Marketplace/chunk-G5LCLRIW.js +1 -0
  20. package/Marketplace/chunk-GRMIXZTT.js +1 -0
  21. package/Marketplace/{chunk-56R3B6EL.js → chunk-GSSZWMCP.js} +4 -4
  22. package/Marketplace/chunk-INNTQ5YN.js +1 -0
  23. package/Marketplace/chunk-IPGAIBF6.js +5 -0
  24. package/Marketplace/chunk-JM3LERUP.js +7 -0
  25. package/Marketplace/chunk-JPAJ6YR6.js +1 -0
  26. package/Marketplace/chunk-K3G6FMDF.js +1 -0
  27. package/Marketplace/chunk-KBYAFLE5.js +1 -0
  28. package/Marketplace/chunk-KUVW5SH2.js +1 -0
  29. package/Marketplace/chunk-KYJA5TD4.js +1 -0
  30. package/Marketplace/chunk-L4DP3Q4W.js +1 -0
  31. package/Marketplace/chunk-MK34PW5S.js +1 -0
  32. package/Marketplace/{chunk-TMXG5A2R.js → chunk-MSAVOLLA.js} +2 -2
  33. package/Marketplace/chunk-MSGMWJHN.js +1 -0
  34. package/Marketplace/chunk-MYMGWQRE.js +6 -0
  35. package/Marketplace/chunk-N4S3Q3EC.js +1 -0
  36. package/Marketplace/chunk-NRVXDIHY.js +1 -0
  37. package/Marketplace/chunk-NSM4JDXS.js +1 -0
  38. package/Marketplace/chunk-OHTJCLX7.js +4 -0
  39. package/Marketplace/chunk-PRYDCJG5.js +1 -0
  40. package/Marketplace/chunk-PZJCL4YS.js +1 -0
  41. package/Marketplace/chunk-PZOGC5DT.js +1 -0
  42. package/Marketplace/chunk-QK22WK2Q.js +1 -0
  43. package/Marketplace/chunk-SP6QPE3M.js +1 -0
  44. package/Marketplace/chunk-SQDLJ6C7.js +3 -0
  45. package/Marketplace/chunk-SRYGE2HW.js +1 -0
  46. package/Marketplace/chunk-TCC7PQV3.js +1 -0
  47. package/Marketplace/chunk-TDHJ34QP.js +1 -0
  48. package/Marketplace/chunk-TDK2QBFI.js +1 -0
  49. package/Marketplace/chunk-U5YOE633.js +5 -0
  50. package/Marketplace/chunk-UILE7H6I.js +1 -0
  51. package/Marketplace/chunk-VK32VX4W.js +2 -0
  52. package/Marketplace/chunk-VO5VAOZH.js +1 -0
  53. package/Marketplace/chunk-W3EAYQL3.js +1 -0
  54. package/Marketplace/chunk-WQ7LUTQ2.js +1 -0
  55. package/Marketplace/chunk-XDNW2F3I.js +3 -0
  56. package/Marketplace/chunk-XOYXFFE6.js +1 -0
  57. package/Marketplace/chunk-YZ67XPSX.js +1 -0
  58. package/Marketplace/chunk-ZIW2YTBP.js +1 -0
  59. package/Marketplace/chunk-ZKBLXGXT.js +2 -0
  60. package/Marketplace/index.html +5 -4
  61. package/Marketplace/main-RSHB3ATI.js +1 -0
  62. package/Marketplace/polyfills-Y3W47ZLP.js +2 -0
  63. package/Marketplace/scripts-TB7H6DN4.js +5 -0
  64. package/Marketplace/styles-D4MZYFH2.css +1 -0
  65. package/package.json +1 -1
  66. package/Marketplace/chunk-27WF5XZ4.js +0 -1
  67. package/Marketplace/chunk-2B2NRXVD.js +0 -1
  68. package/Marketplace/chunk-2J5KIMJG.js +0 -1
  69. package/Marketplace/chunk-2XUETMFD.js +0 -7
  70. package/Marketplace/chunk-34W6ODFY.js +0 -1
  71. package/Marketplace/chunk-36YTJB5U.js +0 -3
  72. package/Marketplace/chunk-3FV4VZY5.js +0 -4
  73. package/Marketplace/chunk-3M3TUG3Y.js +0 -1
  74. package/Marketplace/chunk-3WESNZYZ.js +0 -4
  75. package/Marketplace/chunk-4HCIBOMI.js +0 -1
  76. package/Marketplace/chunk-4JMSYMIL.js +0 -1
  77. package/Marketplace/chunk-5DXPVZPM.js +0 -3
  78. package/Marketplace/chunk-5QWCH2MN.js +0 -8
  79. package/Marketplace/chunk-6OCGOSYU.js +0 -5
  80. package/Marketplace/chunk-6RTNGXAA.js +0 -1
  81. package/Marketplace/chunk-7IY5O4IO.js +0 -1
  82. package/Marketplace/chunk-AEGUGM6R.js +0 -1
  83. package/Marketplace/chunk-CWR3EUXB.js +0 -2
  84. package/Marketplace/chunk-DJAIEPHT.js +0 -1
  85. package/Marketplace/chunk-DJWYB3IP.js +0 -1
  86. package/Marketplace/chunk-DMYPGAP6.js +0 -1
  87. package/Marketplace/chunk-EFARFDMO.js +0 -1
  88. package/Marketplace/chunk-EONYNPVG.js +0 -1
  89. package/Marketplace/chunk-FHVEGV4R.js +0 -1
  90. package/Marketplace/chunk-FMMN3KTC.js +0 -1
  91. package/Marketplace/chunk-GNBJF4YQ.js +0 -1
  92. package/Marketplace/chunk-HTPOQKQV.js +0 -1
  93. package/Marketplace/chunk-I6MPDIYA.js +0 -1
  94. package/Marketplace/chunk-IQOBZ4KW.js +0 -1
  95. package/Marketplace/chunk-J2RJWRY7.js +0 -6
  96. package/Marketplace/chunk-JQLRFJ7L.js +0 -2
  97. package/Marketplace/chunk-LAR65HEV.js +0 -39
  98. package/Marketplace/chunk-LSVERPQC.js +0 -1
  99. package/Marketplace/chunk-M7LNCX6S.js +0 -1
  100. package/Marketplace/chunk-MSXYPVTU.js +0 -1
  101. package/Marketplace/chunk-NDXXUZJP.js +0 -1
  102. package/Marketplace/chunk-NQA3MADS.js +0 -1
  103. package/Marketplace/chunk-NTO57GBJ.js +0 -1
  104. package/Marketplace/chunk-OG7GSPJM.js +0 -1
  105. package/Marketplace/chunk-PAOA6DW4.js +0 -1
  106. package/Marketplace/chunk-PJFUFZDK.js +0 -1
  107. package/Marketplace/chunk-PUT3J5LU.js +0 -1
  108. package/Marketplace/chunk-Q4YKWFBH.js +0 -1
  109. package/Marketplace/chunk-RRSW335I.js +0 -1
  110. package/Marketplace/chunk-S5WITFO4.js +0 -1
  111. package/Marketplace/chunk-TVL547JR.js +0 -2
  112. package/Marketplace/chunk-TXGX5F7A.js +0 -1
  113. package/Marketplace/chunk-UBKA24B2.js +0 -1
  114. package/Marketplace/chunk-UCUYPEVP.js +0 -1
  115. package/Marketplace/chunk-UE36JAUR.js +0 -1
  116. package/Marketplace/chunk-VBIHRHCP.js +0 -1
  117. package/Marketplace/chunk-VGATQ2BG.js +0 -2
  118. package/Marketplace/chunk-XBBNBXKA.js +0 -5
  119. package/Marketplace/chunk-XCMMTIOL.js +0 -1
  120. package/Marketplace/chunk-XT6FL25D.js +0 -1
  121. package/Marketplace/chunk-Z3KG4YMT.js +0 -5
  122. package/Marketplace/main-Z4RBEQWQ.js +0 -1
  123. package/Marketplace/polyfills-WYDKZVNK.js +0 -2
  124. package/Marketplace/scripts-M46NWPTC.js +0 -5
  125. package/Marketplace/styles-EMWW7N6T.css +0 -1
  126. /package/Marketplace/{chunk-ZCIDRSQR.js → chunk-662E5VTA.js} +0 -0
  127. /package/Marketplace/{chunk-CF5HBP53.js → chunk-IWVYX6KY.js} +0 -0
@@ -0,0 +1,7 @@
1
+ import{a as gr,b as _r,f as eo,h as oe,i as a,j as lt}from"./chunk-GRMIXZTT.js";var Ir=function(n){let e=[],t=0;for(let i=0;i<n.length;i++){let r=n.charCodeAt(i);r<128?e[t++]=r:r<2048?(e[t++]=r>>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1<n.length&&(n.charCodeAt(i+1)&64512)===56320?(r=65536+((r&1023)<<10)+(n.charCodeAt(++i)&1023),e[t++]=r>>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},to=function(n){let e=[],t=0,i=0;for(;t<n.length;){let r=n[t++];if(r<128)e[i++]=String.fromCharCode(r);else if(r>191&&r<224){let s=n[t++];e[i++]=String.fromCharCode((r&31)<<6|s&63)}else if(r>239&&r<365){let s=n[t++],o=n[t++],c=n[t++],d=((r&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[i++]=String.fromCharCode(55296+(d>>10)),e[i++]=String.fromCharCode(56320+(d&1023))}else{let s=n[t++],o=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Er={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(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();let t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r<n.length;r+=3){let s=n[r],o=r+1<n.length,c=o?n[r+1]:0,d=r+2<n.length,l=d?n[r+2]:0,h=s>>2,f=(s&3)<<4|c>>4,m=(c&15)<<2|l>>6,P=l&63;d||(P=64,o||(m=64)),i.push(t[h],t[f],t[m],t[P])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(Ir(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):to(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r<n.length;){let s=t[n.charAt(r++)],c=r<n.length?t[n.charAt(r)]:0;++r;let l=r<n.length?t[n.charAt(r)]:64;++r;let f=r<n.length?t[n.charAt(r)]:64;if(++r,s==null||c==null||l==null||f==null)throw new tn;let m=s<<2|c>>4;if(i.push(m),l!==64){let P=c<<4&240|l>>2;if(i.push(P),f!==64){let se=l<<6&192|f;i.push(se)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},tn=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},no=function(n){let e=Ir(n);return Er.encodeByteArray(e,!0)},rn=function(n){return no(n).replace(/\./g,"")},sn=function(n){try{return Er.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function xe(n,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:let t=e;return new Date(t.getTime());case Object:n===void 0&&(n={});break;case Array:n=[];break;default:return e}for(let t in e)!e.hasOwnProperty(t)||!io(t)||(n[t]=xe(n[t],e[t]));return n}function io(n){return n!=="__proto__"}function ro(){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.")}var so=()=>ro().__FIREBASE_DEFAULTS__,oo=()=>{if(typeof process>"u"||typeof process.env>"u")return;let n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},ao=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=n&&sn(n[1]);return e&&JSON.parse(e)},on=()=>{try{return so()||oo()||ao()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}};var an=()=>{var n;return(n=on())===null||n===void 0?void 0:n.config},yr=n=>{var e;return(e=on())===null||e===void 0?void 0:e[`_${n}`]};var ut=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,i))}}};function I(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function wr(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(I())}function cn(){var n;let e=(n=on())===null||n===void 0?void 0:n.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function ht(){return typeof self=="object"&&self.self===self}function ft(){let n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Ue(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function pt(){let n=I();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Te(){try{return typeof indexedDB=="object"}catch{return!1}}function Tr(){return new Promise((n,e)=>{try{let t=!0,i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),t||self.indexedDB.deleteDatabase(i),n(!0)},r.onupgradeneeded=()=>{t=!1},r.onerror=()=>{var s;e(((s=r.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}var co="FirebaseError",A=class n extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=co,Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,O.prototype.create)}},O=class{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){let i=t[0]||{},r=`${this.service}/${e}`,s=this.errors[e],o=s?lo(s,i):"Error",c=`${this.serviceName}: ${o} (${r}).`;return new A(r,c,i)}};function lo(n,e){return n.replace(uo,(t,i)=>{let r=e[i];return r!=null?String(r):`<${i}?>`})}var uo=/\{\$([^}]+)}/g;function dn(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function br(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Fe(n,e){if(n===e)return!0;let t=Object.keys(n),i=Object.keys(e);for(let r of t){if(!i.includes(r))return!1;let s=n[r],o=e[r];if(vr(s)&&vr(o)){if(!Fe(s,o))return!1}else if(s!==o)return!1}for(let r of i)if(!t.includes(r))return!1;return!0}function vr(n){return n!==null&&typeof n=="object"}function ae(n){let e=[];for(let[t,i]of Object.entries(n))Array.isArray(i)?i.forEach(r=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function X(n){let e={};return n.replace(/^\?/,"").split("&").forEach(i=>{if(i){let[r,s]=i.split("=");e[decodeURIComponent(r)]=decodeURIComponent(s)}}),e}function be(n){let e=n.indexOf("?");if(!e)return"";let t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function mt(n,e){let t=new nn(n,e);return t.subscribe.bind(t)}var nn=class{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(i=>{this.error(i)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let r;if(e===void 0&&t===void 0&&i===void 0)throw new Error("Missing Observer.");ho(e,["next","error","complete"])?r=e:r={next:e,error:t,complete:i},r.next===void 0&&(r.next=en),r.error===void 0&&(r.error=en),r.complete===void 0&&(r.complete=en);let s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(i){typeof console<"u"&&console.error&&console.error(i)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function ho(n,e){if(typeof n!="object"||n===null)return!1;for(let t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function en(){}var _l=4*60*60*1e3;function p(n){return n&&n._delegate?n._delegate:n}var C=class{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};var ce="[DEFAULT]";var ln=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let i=new ut;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&i.resolve(r)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let i=this.normalizeInstanceIdentifier(e?.identifier),r=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(po(e))try{this.getOrInitializeService({instanceIdentifier:ce})}catch{}for(let[t,i]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(t);try{let s=this.getOrInitializeService({instanceIdentifier:r});i.resolve(s)}catch{}}}}clearInstance(e=ce){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){return a(this,null,function*(){let e=Array.from(this.instances.values());yield Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])})}isComponentSet(){return this.component!=null}isInitialized(e=ce){return this.instances.has(e)}getOptions(e=ce){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let r=this.getOrInitializeService({instanceIdentifier:i,options:t});for(let[s,o]of this.instancesDeferred.entries()){let c=this.normalizeInstanceIdentifier(s);i===c&&o.resolve(r)}return r}onInit(e,t){var i;let r=this.normalizeInstanceIdentifier(t),s=(i=this.onInitCallbacks.get(r))!==null&&i!==void 0?i:new Set;s.add(e),this.onInitCallbacks.set(r,s);let o=this.instances.get(r);return o&&e(o,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){let i=this.onInitCallbacks.get(t);if(i)for(let r of i)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:fo(e),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=ce){return this.component?this.component.multipleInstances?e:ce:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function fo(n){return n===ce?void 0:n}function po(n){return n.instantiationMode==="EAGER"}var Ve=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new ln(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}};var Rn={};eo(Rn,{FirebaseError:()=>A,SDK_VERSION:()=>q,_DEFAULT_ENTRY_NAME:()=>W,_addComponent:()=>Re,_addOrOverwriteComponent:()=>Tn,_apps:()=>Z,_clearComponents:()=>na,_components:()=>Se,_getProvider:()=>bn,_isFirebaseApp:()=>Fr,_isFirebaseServerApp:()=>v,_registerComponent:()=>G,_removeServiceInstance:()=>ta,_serverApps:()=>Ae,deleteApp:()=>Et,getApp:()=>Vr,getApps:()=>sa,initializeApp:()=>It,initializeServerApp:()=>ra,onLog:()=>An,registerVersion:()=>L,setLogLevel:()=>Sn});var un=[],g=function(n){return n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT",n}(g||{}),Ar={debug:g.DEBUG,verbose:g.VERBOSE,info:g.INFO,warn:g.WARN,error:g.ERROR,silent:g.SILENT},mo=g.INFO,go={[g.DEBUG]:"log",[g.VERBOSE]:"log",[g.INFO]:"info",[g.WARN]:"warn",[g.ERROR]:"error"},_o=(n,e,...t)=>{if(e<n.logLevel)return;let i=new Date().toISOString(),r=go[e];if(r)console[r](`[${i}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},Q=class{constructor(e){this.name=e,this._logLevel=mo,this._logHandler=_o,this._userLogHandler=null,un.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in g))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?Ar[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,g.DEBUG,...e),this._logHandler(this,g.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,g.VERBOSE,...e),this._logHandler(this,g.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,g.INFO,...e),this._logHandler(this,g.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,g.WARN,...e),this._logHandler(this,g.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,g.ERROR,...e),this._logHandler(this,g.ERROR,...e)}};function Sr(n){un.forEach(e=>{e.setLogLevel(n)})}function Rr(n,e){for(let t of un){let i=null;e&&e.level&&(i=Ar[e.level]),n===null?t.userLogHandler=null:t.userLogHandler=(r,s,...o)=>{let c=o.map(d=>{if(d==null)return null;if(typeof d=="string")return d;if(typeof d=="number"||typeof d=="boolean")return d.toString();if(d instanceof Error)return d.message;try{return JSON.stringify(d)}catch{return null}}).filter(d=>d).join(" ");s>=(i??r.logLevel)&&n({level:g[s].toLowerCase(),message:c,args:o,type:r.name})}}}var vo=(n,e)=>e.some(t=>n instanceof t),Pr,Cr;function Io(){return Pr||(Pr=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Eo(){return Cr||(Cr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var kr=new WeakMap,fn=new WeakMap,Nr=new WeakMap,hn=new WeakMap,mn=new WeakMap;function yo(n){let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(V(n.result)),r()},o=()=>{i(n.error),r()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&kr.set(t,n)}).catch(()=>{}),mn.set(e,n),e}function wo(n){if(fn.has(n))return;let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),r()},o=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});fn.set(n,e)}var pn={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return fn.get(n);if(e==="objectStoreNames")return n.objectStoreNames||Nr.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return V(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Or(n){pn=n(pn)}function To(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let i=n.call(gt(this),e,...t);return Nr.set(i,e.sort?e.sort():[e]),V(i)}:Eo().includes(n)?function(...e){return n.apply(gt(this),e),V(kr.get(this))}:function(...e){return V(n.apply(gt(this),e))}}function bo(n){return typeof n=="function"?To(n):(n instanceof IDBTransaction&&wo(n),vo(n,Io())?new Proxy(n,pn):n)}function V(n){if(n instanceof IDBRequest)return yo(n);if(hn.has(n))return hn.get(n);let e=bo(n);return e!==n&&(hn.set(n,e),mn.set(e,n)),e}var gt=n=>mn.get(n);function Lr(n,e,{blocked:t,upgrade:i,blocking:r,terminated:s}={}){let o=indexedDB.open(n,e),c=V(o);return i&&o.addEventListener("upgradeneeded",d=>{i(V(o.result),d.oldVersion,d.newVersion,V(o.transaction),d)}),t&&o.addEventListener("blocked",d=>t(d.oldVersion,d.newVersion,d)),c.then(d=>{s&&d.addEventListener("close",()=>s()),r&&d.addEventListener("versionchange",l=>r(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}var Ao=["get","getKey","getAll","getAllKeys","count"],So=["put","add","delete","clear"],gn=new Map;function Dr(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(gn.get(e))return gn.get(e);let t=e.replace(/FromIndex$/,""),i=e!==t,r=So.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||Ao.includes(t)))return;let s=function(o,...c){return a(this,null,function*(){let d=this.transaction(o,r?"readwrite":"readonly"),l=d.store;return i&&(l=l.index(c.shift())),(yield Promise.all([l[t](...c),r&&d.done]))[0]})};return gn.set(e,s),s}Or(n=>_r(gr({},n),{get:(e,t,i)=>Dr(e,t)||n.get(e,t,i),has:(e,t)=>!!Dr(e,t)||n.has(e,t)}));var vn=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(Ro(t)){let i=t.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(t=>t).join(" ")}};function Ro(n){let e=n.getComponent();return e?.type==="VERSION"}var _t="@firebase/app",In="0.10.4";var de=new Q("@firebase/app"),Po="@firebase/app-compat",Co="@firebase/analytics-compat",ko="@firebase/analytics",No="@firebase/app-check-compat",Oo="@firebase/app-check",Do="@firebase/auth",Lo="@firebase/auth-compat",Mo="@firebase/database",xo="@firebase/database-compat",Uo="@firebase/functions",Fo="@firebase/functions-compat",Vo="@firebase/installations",Wo="@firebase/installations-compat",Ho="@firebase/messaging",Bo="@firebase/messaging-compat",jo="@firebase/performance",zo="@firebase/performance-compat",$o="@firebase/remote-config",Go="@firebase/remote-config-compat",qo="@firebase/storage",Ko="@firebase/storage-compat",Jo="@firebase/firestore",Yo="@firebase/vertexai-preview",Xo="@firebase/firestore-compat",Qo="firebase",Zo="10.12.1";var W="[DEFAULT]",ea={[_t]:"fire-core",[Po]:"fire-core-compat",[ko]:"fire-analytics",[Co]:"fire-analytics-compat",[Oo]:"fire-app-check",[No]:"fire-app-check-compat",[Do]:"fire-auth",[Lo]:"fire-auth-compat",[Mo]:"fire-rtdb",[xo]:"fire-rtdb-compat",[Uo]:"fire-fn",[Fo]:"fire-fn-compat",[Vo]:"fire-iid",[Wo]:"fire-iid-compat",[Ho]:"fire-fcm",[Bo]:"fire-fcm-compat",[jo]:"fire-perf",[zo]:"fire-perf-compat",[$o]:"fire-rc",[Go]:"fire-rc-compat",[qo]:"fire-gcs",[Ko]:"fire-gcs-compat",[Jo]:"fire-fst",[Xo]:"fire-fst-compat",[Yo]:"fire-vertex","fire-js":"fire-js",[Qo]:"fire-js-all"};var Z=new Map,Ae=new Map,Se=new Map;function Re(n,e){try{n.container.addComponent(e)}catch(t){de.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Tn(n,e){n.container.addOrOverwriteComponent(e)}function G(n){let e=n.name;if(Se.has(e))return de.debug(`There were multiple attempts to register component ${e}.`),!1;Se.set(e,n);for(let t of Z.values())Re(t,n);for(let t of Ae.values())Re(t,n);return!0}function bn(n,e){let t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function ta(n,e,t=W){bn(n,e).clearInstance(t)}function Fr(n){return n.options!==void 0}function v(n){return n.settings!==void 0}function na(){Se.clear()}var ia={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},D=new O("app","Firebase",ia);var vt=class{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new C("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw D.create("app-deleted",{appName:this._name})}};var En=class extends vt{constructor(e,t,i,r){let s=t.automaticDataCollectionEnabled!==void 0?t.automaticDataCollectionEnabled:!1,o={name:i,automaticDataCollectionEnabled:s};if(e.apiKey!==void 0)super(e,o,r);else{let c=e;super(c.options,o,r)}this._serverConfig=Object.assign({automaticDataCollectionEnabled:s},t),this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()}),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,t.releaseOnDeref=void 0,L(_t,In,"serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,e!==void 0&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){Et(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw D.create("server-app-deleted")}};var q=Zo;function It(n,e={}){let t=n;typeof e!="object"&&(e={name:e});let i=Object.assign({name:W,automaticDataCollectionEnabled:!1},e),r=i.name;if(typeof r!="string"||!r)throw D.create("bad-app-name",{appName:String(r)});if(t||(t=an()),!t)throw D.create("no-options");let s=Z.get(r);if(s){if(Fe(t,s.options)&&Fe(i,s.config))return s;throw D.create("duplicate-app",{appName:r})}let o=new Ve(r);for(let d of Se.values())o.addComponent(d);let c=new vt(t,i,o);return Z.set(r,c),c}function ra(n,e){if(ht())throw D.create("invalid-server-app-environment");e.automaticDataCollectionEnabled===void 0&&(e.automaticDataCollectionEnabled=!1);let t;Fr(n)?t=n.options:t=n;let i=Object.assign(Object.assign({},e),t);i.releaseOnDeref!==void 0&&delete i.releaseOnDeref;let r=l=>[...l].reduce((h,f)=>Math.imul(31,h)+f.charCodeAt(0)|0,0);if(e.releaseOnDeref!==void 0&&typeof FinalizationRegistry>"u")throw D.create("finalization-registry-not-supported",{});let s=""+r(JSON.stringify(i)),o=Ae.get(s);if(o)return o.incRefCount(e.releaseOnDeref),o;let c=new Ve(s);for(let l of Se.values())c.addComponent(l);let d=new En(t,e,s,c);return Ae.set(s,d),d}function Vr(n=W){let e=Z.get(n);if(!e&&n===W&&an())return It();if(!e)throw D.create("no-app",{appName:n});return e}function sa(){return Array.from(Z.values())}function Et(n){return a(this,null,function*(){let e=!1,t=n.name;Z.has(t)?(e=!0,Z.delete(t)):Ae.has(t)&&n.decRefCount()<=0&&(Ae.delete(t),e=!0),e&&(yield Promise.all(n.container.getProviders().map(i=>i.delete())),n.isDeleted=!0)})}function L(n,e,t){var i;let r=(i=ea[n])!==null&&i!==void 0?i:n;t&&(r+=`-${t}`);let s=r.match(/\s|\//),o=e.match(/\s|\//);if(s||o){let c=[`Unable to register library "${r}" with version "${e}":`];s&&c.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&c.push("and"),o&&c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),de.warn(c.join(" "));return}G(new C(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}function An(n,e){if(n!==null&&typeof n!="function")throw D.create("invalid-log-argument");Rr(n,e)}function Sn(n){Sr(n)}var oa="firebase-heartbeat-database",aa=1,We="firebase-heartbeat-store",_n=null;function Wr(){return _n||(_n=Lr(oa,aa,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(We)}catch(t){console.warn(t)}}}}).catch(n=>{throw D.create("idb-open",{originalErrorMessage:n.message})})),_n}function ca(n){return a(this,null,function*(){try{let t=(yield Wr()).transaction(We),i=yield t.objectStore(We).get(Hr(n));return yield t.done,i}catch(e){if(e instanceof A)de.warn(e.message);else{let t=D.create("idb-get",{originalErrorMessage:e?.message});de.warn(t.message)}}})}function Mr(n,e){return a(this,null,function*(){try{let i=(yield Wr()).transaction(We,"readwrite");yield i.objectStore(We).put(e,Hr(n)),yield i.done}catch(t){if(t instanceof A)de.warn(t.message);else{let i=D.create("idb-set",{originalErrorMessage:t?.message});de.warn(i.message)}}})}function Hr(n){return`${n.name}!${n.options.appId}`}var da=1024,la=30*24*60*60*1e3,yn=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new wn(t),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}triggerHeartbeat(){return a(this,null,function*(){var e,t;let r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=xr();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=yield this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)))return this._heartbeatsCache.heartbeats.push({date:s,agent:r}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{let c=new Date(o.date).valueOf();return Date.now()-c<=la}),this._storage.overwrite(this._heartbeatsCache)})}getHeartbeatsHeader(){return a(this,null,function*(){var e;if(this._heartbeatsCache===null&&(yield this._heartbeatsCachePromise),((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";let t=xr(),{heartbeatsToSend:i,unsentEntries:r}=ua(this._heartbeatsCache.heartbeats),s=rn(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,yield this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s})}};function xr(){return new Date().toISOString().substring(0,10)}function ua(n,e=da){let t=[],i=n.slice();for(let r of n){let s=t.find(o=>o.agent===r.agent);if(s){if(s.dates.push(r.date),Ur(t)>e){s.dates.pop();break}}else if(t.push({agent:r.agent,dates:[r.date]}),Ur(t)>e){t.pop();break}i=i.slice(1)}return{heartbeatsToSend:t,unsentEntries:i}}var wn=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return a(this,null,function*(){return Te()?Tr().then(()=>!0).catch(()=>!1):!1})}read(){return a(this,null,function*(){if(yield this._canUseIndexedDBPromise){let t=yield ca(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}})}overwrite(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let r=yield this.read();return Mr(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return})}add(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let r=yield this.read();return Mr(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return})}};function Ur(n){return rn(JSON.stringify({version:2,heartbeats:n})).length}function ha(n){G(new C("platform-logger",e=>new vn(e),"PRIVATE")),G(new C("heartbeat",e=>new yn(e),"PRIVATE")),L(_t,In,n),L(_t,In,"esm2017"),L("fire-js","")}ha("");var Pn=class{constructor(e,t){this._delegate=e,this.firebase=t,Re(e,new C("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),Et(this._delegate)))}_getService(e,t=W){var i;this._delegate.checkDestroyed();let r=this._delegate.container.getProvider(e);return!r.isInitialized()&&((i=r.getComponent())===null||i===void 0?void 0:i.instantiationMode)==="EXPLICIT"&&r.initialize(),r.getImmediate({identifier:t})}_removeServiceInstance(e,t=W){this._delegate.container.getProvider(e).clearInstance(t)}_addComponent(e){Re(this._delegate,e)}_addOrOverwriteComponent(e){Tn(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}};var fa={"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."},Br=new O("app-compat","Firebase",fa);function pa(n){let e={},t={__esModule:!0,initializeApp:s,app:r,registerVersion:L,setLogLevel:Sn,onLog:An,apps:null,SDK_VERSION:q,INTERNAL:{registerComponent:c,removeApp:i,useAsService:d,modularAPIs:Rn}};t.default=t,Object.defineProperty(t,"apps",{get:o});function i(l){delete e[l]}function r(l){if(l=l||W,!dn(e,l))throw Br.create("no-app",{appName:l});return e[l]}r.App=n;function s(l,h={}){let f=It(l,h);if(dn(e,f.name))return e[f.name];let m=new n(f,t);return e[f.name]=m,m}function o(){return Object.keys(e).map(l=>e[l])}function c(l){let h=l.name,f=h.replace("-compat","");if(G(l)&&l.type==="PUBLIC"){let m=(P=r())=>{if(typeof P[f]!="function")throw Br.create("invalid-app-argument",{appName:h});return P[f]()};l.serviceProps!==void 0&&xe(m,l.serviceProps),t[f]=m,n.prototype[f]=function(...P){return this._getService.bind(this,h).apply(this,l.multipleInstances?P:[])}}return l.type==="PUBLIC"?t[f]:null}function d(l,h){return h==="serverAuth"?null:h}return t}function zr(){let n=pa(Pn);n.INTERNAL=Object.assign(Object.assign({},n.INTERNAL),{createFirebaseNamespace:zr,extendNamespace:e,createSubscribe:mt,ErrorFactory:O,deepExtend:xe});function e(t){xe(n,t)}return n}var ma=zr();var jr=new Q("@firebase/app-compat"),ga="@firebase/app-compat",_a="0.2.34";function va(n){L(ga,_a,n)}if(ht()&&self.firebase!==void 0){jr.warn(`
2
+ Warning: Firebase is already defined in the global scope. Please make sure
3
+ Firebase library is only loaded once.
4
+ `);let n=self.firebase.SDK_VERSION;n&&n.indexOf("LITE")>=0&&jr.warn(`
5
+ Warning: You are trying to load Firebase while using Firebase Performance standalone script.
6
+ You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.
7
+ `)}var yt=ma;va();var me={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"};var re={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"};function Ia(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements."}}function os(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}var si=Ia,as=os,cs=new O("auth","Firebase",os());var At=new Q("@firebase/auth");function Ea(n,...e){At.logLevel<=g.WARN&&At.warn(`Auth (${q}): ${n}`,...e)}function Tt(n,...e){At.logLevel<=g.ERROR&&At.error(`Auth (${q}): ${n}`,...e)}function b(n,...e){throw ai(n,...e)}function T(n,...e){return ai(n,...e)}function oi(n,e,t){let i=Object.assign(Object.assign({},as()),{[e]:t});return new O("auth","Firebase",i).create(e,{appName:n.name})}function S(n){return oi(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function ke(n,e,t){let i=t;if(!(e instanceof i))throw i.name!==e.constructor.name&&b(n,"argument-error"),oi(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function ai(n,...e){if(typeof n!="string"){let t=e[0],i=[...e.slice(1)];return i[0]&&(i[0].appName=n.name),n._errorFactory.create(t,...i)}return cs.create(n,...e)}function u(n,e,...t){if(!n)throw ai(e,...t)}function H(n){let e="INTERNAL ASSERTION FAILED: "+n;throw Tt(e),new Error(e)}function M(n,e){n||H(e)}function $e(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function ci(){return $r()==="http:"||$r()==="https:"}function $r(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}function ya(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(ci()||ft()||"connection"in navigator)?navigator.onLine:!0}function wa(){if(typeof navigator>"u")return null;let n=navigator;return n.languages&&n.languages[0]||n.language||null}var le=class{constructor(e,t){this.shortDelay=e,this.longDelay=t,M(t>e,"Short delay should be less than long delay!"),this.isMobile=wr()||Ue()}get(){return ya()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};function di(n,e){M(n.emulator,"Emulator should always be set here");let{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}var Ge=class{static initialize(e,t,i){this.fetchImpl=e,t&&(this.headersImpl=t),i&&(this.responseImpl=i)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;H("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;H("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;H("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};var Ta={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};var ba=new le(3e4,6e4);function E(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}function y(s,o,c,d){return a(this,arguments,function*(n,e,t,i,r={}){return ds(n,r,()=>a(this,null,function*(){let l={},h={};i&&(e==="GET"?h=i:l={body:JSON.stringify(i)});let f=ae(Object.assign({key:n.config.apiKey},h)).slice(1),m=yield n._getAdditionalHeaders();return m["Content-Type"]="application/json",n.languageCode&&(m["X-Firebase-Locale"]=n.languageCode),Ge.fetch()(ls(n,n.config.apiHost,t,f),Object.assign({method:e,headers:m,referrerPolicy:"no-referrer"},l))}))})}function ds(n,e,t){return a(this,null,function*(){n._canInitEmulator=!1;let i=Object.assign(Object.assign({},Ta),e);try{let r=new Dn(n),s=yield Promise.race([t(),r.promise]);r.clearNetworkTimeout();let o=yield s.json();if("needConfirmation"in o)throw He(n,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{let c=s.ok?o.errorMessage:o.error.message,[d,l]=c.split(" : ");if(d==="FEDERATED_USER_ID_ALREADY_LINKED")throw He(n,"credential-already-in-use",o);if(d==="EMAIL_EXISTS")throw He(n,"email-already-in-use",o);if(d==="USER_DISABLED")throw He(n,"user-disabled",o);let h=i[d]||d.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw oi(n,h,l);b(n,h)}}catch(r){if(r instanceof A)throw r;b(n,"network-request-failed",{message:String(r)})}})}function Y(s,o,c,d){return a(this,arguments,function*(n,e,t,i,r={}){let l=yield y(n,e,t,i,r);return"mfaPendingCredential"in l&&b(n,"multi-factor-auth-required",{_serverResponse:l}),l})}function ls(n,e,t,i){let r=`${e}${t}?${i}`;return n.config.emulator?di(n.config,r):`${n.config.apiScheme}://${r}`}function Aa(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}var Dn=class{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,i)=>{this.timer=setTimeout(()=>i(T(this.auth,"network-request-failed")),ba.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}};function He(n,e,t){let i={appName:n.name};t.email&&(i.email=t.email),t.phoneNumber&&(i.phoneNumber=t.phoneNumber);let r=T(n,e,i);return r.customData._tokenResponse=t,r}function Gr(n){return n!==void 0&&n.getResponse!==void 0}function qr(n){return n!==void 0&&n.enterprise!==void 0}var Ln=class{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(let t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Aa(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}};function Sa(n){return a(this,null,function*(){return(yield y(n,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""})}function Ra(n,e){return a(this,null,function*(){return y(n,"GET","/v2/recaptchaConfig",E(n,e))})}function Pa(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:delete",e)})}function Ca(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:update",e)})}function us(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:lookup",e)})}function Be(n){if(n)try{let e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function hs(n,e=!1){return a(this,null,function*(){let t=p(n),i=yield t.getIdToken(e),r=xt(i);u(r&&r.exp&&r.auth_time&&r.iat,t.auth,"internal-error");let s=typeof r.firebase=="object"?r.firebase:void 0,o=s?.sign_in_provider;return{claims:r,token:i,authTime:Be(Cn(r.auth_time)),issuedAtTime:Be(Cn(r.iat)),expirationTime:Be(Cn(r.exp)),signInProvider:o||null,signInSecondFactor:s?.sign_in_second_factor||null}})}function Cn(n){return Number(n)*1e3}function xt(n){let[e,t,i]=n.split(".");if(e===void 0||t===void 0||i===void 0)return Tt("JWT malformed, contained fewer than 3 sections"),null;try{let r=sn(t);return r?JSON.parse(r):(Tt("Failed to decode base64 JWT payload"),null)}catch(r){return Tt("Caught error parsing JWT payload as JSON",r?.toString()),null}}function Kr(n){let e=xt(n);return u(e,"internal-error"),u(typeof e.exp<"u","internal-error"),u(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}function J(n,e,t=!1){return a(this,null,function*(){if(t)return e;try{return yield e}catch(i){throw i instanceof A&&ka(i)&&n.auth.currentUser===n&&(yield n.auth.signOut()),i}})}function ka({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}var Mn=class{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){let i=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),i}else{this.errorBackoff=3e4;let r=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(()=>a(this,null,function*(){yield this.iteration()}),t)}iteration(){return a(this,null,function*(){try{yield this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()})}};var qe=class{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Be(this.lastLoginAt),this.creationTime=Be(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};function Ke(n){return a(this,null,function*(){var e;let t=n.auth,i=yield n.getIdToken(),r=yield J(n,us(t,{idToken:i}));u(r?.users.length,t,"internal-error");let s=r.users[0];n._notifyReloadListener(s);let o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?ps(s.providerUserInfo):[],c=Na(n.providerData,o),d=n.isAnonymous,l=!(n.email&&s.passwordHash)&&!c?.length,h=d?l:!1,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:c,metadata:new qe(s.createdAt,s.lastLoginAt),isAnonymous:h};Object.assign(n,f)})}function fs(n){return a(this,null,function*(){let e=p(n);yield Ke(e),yield e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)})}function Na(n,e){return[...n.filter(i=>!e.some(r=>r.providerId===i.providerId)),...e]}function ps(n){return n.map(e=>{var{providerId:t}=e,i=lt(e,["providerId"]);return{providerId:t,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}})}function Oa(n,e){return a(this,null,function*(){let t=yield ds(n,{},()=>a(this,null,function*(){let i=ae({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:r,apiKey:s}=n.config,o=ls(n,r,"/v1/token",`key=${s}`),c=yield n._getAdditionalHeaders();return c["Content-Type"]="application/x-www-form-urlencoded",Ge.fetch()(o,{method:"POST",headers:c,body:i})}));return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}})}function Da(n,e){return a(this,null,function*(){return y(n,"POST","/v2/accounts:revokeToken",E(n,e))})}var je=class n{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){u(e.idToken,"internal-error"),u(typeof e.idToken<"u","internal-error"),u(typeof e.refreshToken<"u","internal-error");let t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):Kr(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){u(e.length!==0,"internal-error");let t=Kr(e);this.updateTokensAndExpiration(e,null,t)}getToken(e,t=!1){return a(this,null,function*(){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(u(this.refreshToken,e,"user-token-expired"),this.refreshToken?(yield this.refresh(e,this.refreshToken),this.accessToken):null)})}clearRefreshToken(){this.refreshToken=null}refresh(e,t){return a(this,null,function*(){let{accessToken:i,refreshToken:r,expiresIn:s}=yield Oa(e,t);this.updateTokensAndExpiration(i,r,Number(s))})}updateTokensAndExpiration(e,t,i){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+i*1e3}static fromJSON(e,t){let{refreshToken:i,accessToken:r,expirationTime:s}=t,o=new n;return i&&(u(typeof i=="string","internal-error",{appName:e}),o.refreshToken=i),r&&(u(typeof r=="string","internal-error",{appName:e}),o.accessToken=r),s&&(u(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new n,this.toJSON())}_performRefresh(){return H("not implemented")}};function ee(n,e){u(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}var ue=class n{constructor(e){var{uid:t,auth:i,stsTokenManager:r}=e,s=lt(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Mn(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=i,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new qe(s.createdAt||void 0,s.lastLoginAt||void 0)}getIdToken(e){return a(this,null,function*(){let t=yield J(this,this.stsTokenManager.getToken(this.auth,e));return u(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,yield this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t})}getIdTokenResult(e){return hs(this,e)}reload(){return fs(this)}_assign(e){this!==e&&(u(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new n(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){u(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}_updateTokensIfNecessary(e,t=!1){return a(this,null,function*(){let i=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),i=!0),t&&(yield Ke(this)),yield this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)})}delete(){return a(this,null,function*(){if(v(this.auth.app))return Promise.reject(S(this.auth));let e=yield this.getIdToken();return yield J(this,Pa(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()})}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var i,r,s,o,c,d,l,h;let f=(i=t.displayName)!==null&&i!==void 0?i:void 0,m=(r=t.email)!==null&&r!==void 0?r:void 0,P=(s=t.phoneNumber)!==null&&s!==void 0?s:void 0,se=(o=t.photoURL)!==null&&o!==void 0?o:void 0,lr=(c=t.tenantId)!==null&&c!==void 0?c:void 0,Yt=(d=t._redirectEventId)!==null&&d!==void 0?d:void 0,ur=(l=t.createdAt)!==null&&l!==void 0?l:void 0,hr=(h=t.lastLoginAt)!==null&&h!==void 0?h:void 0,{uid:Xt,emailVerified:fr,isAnonymous:pr,providerData:Qt,stsTokenManager:mr}=t;u(Xt&&mr,e,"internal-error");let Qs=je.fromJSON(this.name,mr);u(typeof Xt=="string",e,"internal-error"),ee(f,e.name),ee(m,e.name),u(typeof fr=="boolean",e,"internal-error"),u(typeof pr=="boolean",e,"internal-error"),ee(P,e.name),ee(se,e.name),ee(lr,e.name),ee(Yt,e.name),ee(ur,e.name),ee(hr,e.name);let Zt=new n({uid:Xt,auth:e,email:m,emailVerified:fr,displayName:f,isAnonymous:pr,photoURL:se,phoneNumber:P,tenantId:lr,stsTokenManager:Qs,createdAt:ur,lastLoginAt:hr});return Qt&&Array.isArray(Qt)&&(Zt.providerData=Qt.map(Zs=>Object.assign({},Zs))),Yt&&(Zt._redirectEventId=Yt),Zt}static _fromIdTokenResponse(e,t,i=!1){return a(this,null,function*(){let r=new je;r.updateFromServerResponse(t);let s=new n({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:i});return yield Ke(s),s})}static _fromGetAccountInfoResponse(e,t,i){return a(this,null,function*(){let r=t.users[0];u(r.localId!==void 0,"internal-error");let s=r.providerUserInfo!==void 0?ps(r.providerUserInfo):[],o=!(r.email&&r.passwordHash)&&!s?.length,c=new je;c.updateFromIdToken(i);let d=new n({uid:r.localId,auth:e,stsTokenManager:c,isAnonymous:o}),l={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:s,metadata:new qe(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash)&&!s?.length};return Object.assign(d,l),d})}};var Jr=new Map;function R(n){M(n instanceof Function,"Expected a class definition");let e=Jr.get(n);return e?(M(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,Jr.set(n,e),e)}var La=(()=>{class n{constructor(){this.type="NONE",this.storage={}}_isAvailable(){return a(this,null,function*(){return!0})}_set(t,i){return a(this,null,function*(){this.storage[t]=i})}_get(t){return a(this,null,function*(){let i=this.storage[t];return i===void 0?null:i})}_remove(t){return a(this,null,function*(){delete this.storage[t]})}_addListener(t,i){}_removeListener(t,i){}}return n.type="NONE",n})(),ne=La;function B(n,e,t){return`firebase:${n}:${e}:${t}`}var St=class n{constructor(e,t,i){this.persistence=e,this.auth=t,this.userKey=i;let{config:r,name:s}=this.auth;this.fullUserKey=B(this.userKey,r.apiKey,s),this.fullPersistenceKey=B("persistence",r.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}getCurrentUser(){return a(this,null,function*(){let e=yield this.persistence._get(this.fullUserKey);return e?ue._fromJSON(this.auth,e):null})}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}setPersistence(e){return a(this,null,function*(){if(this.persistence===e)return;let t=yield this.getCurrentUser();if(yield this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)})}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static create(e,t,i="authUser"){return a(this,null,function*(){if(!t.length)return new n(R(ne),e,i);let r=(yield Promise.all(t.map(l=>a(this,null,function*(){if(yield l._isAvailable())return l})))).filter(l=>l),s=r[0]||R(ne),o=B(i,e.config.apiKey,e.name),c=null;for(let l of t)try{let h=yield l._get(o);if(h){let f=ue._fromJSON(e,h);l!==s&&(c=f),s=l;break}}catch{}let d=r.filter(l=>l._shouldAllowMigration);return!s._shouldAllowMigration||!d.length?new n(s,e,i):(s=d[0],c&&(yield s._set(o,c.toJSON())),yield Promise.all(t.map(l=>a(this,null,function*(){if(l!==s)try{yield l._remove(o)}catch{}}))),new n(s,e,i))})}};function Yr(n){let e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(_s(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(ms(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(vs(e))return"Blackberry";if(Is(e))return"Webos";if(li(e))return"Safari";if((e.includes("chrome/")||gs(e))&&!e.includes("edge/"))return"Chrome";if(Ne(e))return"Android";{let t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,i=n.match(t);if(i?.length===2)return i[1]}return"Other"}function ms(n=I()){return/firefox\//i.test(n)}function li(n=I()){let e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function gs(n=I()){return/crios\//i.test(n)}function _s(n=I()){return/iemobile/i.test(n)}function Ne(n=I()){return/android/i.test(n)}function vs(n=I()){return/blackberry/i.test(n)}function Is(n=I()){return/webos/i.test(n)}function ge(n=I()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function Es(n=I()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(n)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(n)}function Ma(n=I()){var e;return ge(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function xa(){return pt()&&document.documentMode===10}function ys(n=I()){return ge(n)||Ne(n)||Is(n)||vs(n)||/windows phone/i.test(n)||_s(n)}function Ua(){try{return!!(window&&window!==window.top)}catch{return!1}}function ui(n,e=[]){let t;switch(n){case"Browser":t=Yr(I());break;case"Worker":t=`${Yr(I())}-${n}`;break;default:t=n}let i=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${q}/${i}`}var xn=class{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let i=s=>new Promise((o,c)=>{try{let d=e(s);o(d)}catch(d){c(d)}});i.onAbort=t,this.queue.push(i);let r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}runMiddleware(e){return a(this,null,function*(){if(this.auth.currentUser===e)return;let t=[];try{for(let i of this.queue)yield i(e),i.onAbort&&t.push(i.onAbort)}catch(i){t.reverse();for(let r of t)try{r()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:i?.message})}})}};function Fa(t){return a(this,arguments,function*(n,e={}){return y(n,"GET","/v2/passwordPolicy",E(n,e))})}var Va=6,Un=class{constructor(e){var t,i,r,s;let o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(t=o.minPasswordLength)!==null&&t!==void 0?t:Va,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(r=(i=e.allowedNonAlphanumericCharacters)===null||i===void 0?void 0:i.join(""))!==null&&r!==void 0?r:"",this.forceUpgradeOnSignin=(s=e.forceUpgradeOnSignin)!==null&&s!==void 0?s:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,i,r,s,o,c;let d={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,d),this.validatePasswordCharacterOptions(e,d),d.isValid&&(d.isValid=(t=d.meetsMinPasswordLength)!==null&&t!==void 0?t:!0),d.isValid&&(d.isValid=(i=d.meetsMaxPasswordLength)!==null&&i!==void 0?i:!0),d.isValid&&(d.isValid=(r=d.containsLowercaseLetter)!==null&&r!==void 0?r:!0),d.isValid&&(d.isValid=(s=d.containsUppercaseLetter)!==null&&s!==void 0?s:!0),d.isValid&&(d.isValid=(o=d.containsNumericCharacter)!==null&&o!==void 0?o:!0),d.isValid&&(d.isValid=(c=d.containsNonAlphanumericCharacter)!==null&&c!==void 0?c:!0),d}validatePasswordLengthOptions(e,t){let i=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;i&&(t.meetsMinPasswordLength=e.length>=i),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let i;for(let r=0;r<e.length;r++)i=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,i>="a"&&i<="z",i>="A"&&i<="Z",i>="0"&&i<="9",this.allowedNonAlphanumericCharacters.includes(i))}updatePasswordCharacterOptionsStatuses(e,t,i,r,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=i)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}};var Rt=class{constructor(e,t,i,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Pt(this),this.idTokenSubscription=new Pt(this),this.beforeStateQueue=new xn(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=cs,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=R(t)),this._initializationPromise=this.queue(()=>a(this,null,function*(){var i,r;if(!this._deleted&&(this.persistenceManager=yield St.create(this,e),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{yield this._popupRedirectResolver._initialize(this)}catch{}yield this.initializeCurrentUser(t),this.lastNotifiedUid=((r=this.currentUser)===null||r===void 0?void 0:r.uid)||null,!this._deleted&&(this._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){return a(this,null,function*(){if(this._deleted)return;let e=yield this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),yield this.currentUser.getIdToken();return}yield this._updateCurrentUser(e,!0)}})}initializeCurrentUserFromIdToken(e){return a(this,null,function*(){try{let t=yield us(this,{idToken:e}),i=yield ue._fromGetAccountInfoResponse(this,t,e);yield this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),yield this.directlySetCurrentUser(null)}})}initializeCurrentUser(e){return a(this,null,function*(){var t;if(v(this.app)){let o=this.app.settings.authIdToken;return o?new Promise(c=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(c,c))}):this.directlySetCurrentUser(null)}let i=yield this.assertedPersistence.getCurrentUser(),r=i,s=!1;if(e&&this.config.authDomain){yield this.getOrInitRedirectPersistenceManager();let o=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,c=r?._redirectEventId,d=yield this.tryRedirectSignIn(e);(!o||o===c)&&d?.user&&(r=d.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{yield this.beforeStateQueue.runMiddleware(r)}catch(o){r=i,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return u(this._popupRedirectResolver,this,"argument-error"),yield this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)})}tryRedirectSignIn(e){return a(this,null,function*(){let t=null;try{t=yield this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{yield this._setRedirectUser(null)}return t})}reloadAndSetCurrentUserOrClear(e){return a(this,null,function*(){try{yield Ke(e)}catch(t){if(t?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)})}useDeviceLanguage(){this.languageCode=wa()}_delete(){return a(this,null,function*(){this._deleted=!0})}updateCurrentUser(e){return a(this,null,function*(){if(v(this.app))return Promise.reject(S(this));let t=e?p(e):null;return t&&u(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))})}_updateCurrentUser(e,t=!1){return a(this,null,function*(){if(!this._deleted)return e&&u(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||(yield this.beforeStateQueue.runMiddleware(e)),this.queue(()=>a(this,null,function*(){yield this.directlySetCurrentUser(e),this.notifyAuthListeners()}))})}signOut(){return a(this,null,function*(){return v(this.app)?Promise.reject(S(this)):(yield this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&(yield this._setRedirectUser(null)),this._updateCurrentUser(null,!0))})}setPersistence(e){return v(this.app)?Promise.reject(S(this)):this.queue(()=>a(this,null,function*(){yield this.assertedPersistence.setPersistence(R(e))}))}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}validatePassword(e){return a(this,null,function*(){this._getPasswordPolicyInternal()||(yield this._updatePasswordPolicy());let t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)})}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}_updatePasswordPolicy(){return a(this,null,function*(){let e=yield Fa(this),t=new Un(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t})}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new O("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{let i=this.onAuthStateChanged(()=>{i(),e()},t)}})}revokeAccessToken(e){return a(this,null,function*(){if(this.currentUser){let t=yield this.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(i.tenantId=this.tenantId),yield Da(this,i)}})}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}_setRedirectUser(e,t){return a(this,null,function*(){let i=yield this.getOrInitRedirectPersistenceManager(t);return e===null?i.removeCurrentUser():i.setCurrentUser(e)})}getOrInitRedirectPersistenceManager(e){return a(this,null,function*(){if(!this.redirectPersistenceManager){let t=e&&R(e)||this._popupRedirectResolver;u(t,this,"argument-error"),this.redirectPersistenceManager=yield St.create(this,[R(t._redirectPersistence)],"redirectUser"),this.redirectUser=yield this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager})}_redirectUserForId(e){return a(this,null,function*(){var t,i;return this._isInitialized&&(yield this.queue(()=>a(this,null,function*(){}))),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((i=this.redirectUser)===null||i===void 0?void 0:i._redirectEventId)===e?this.redirectUser:null})}_persistUserIfCurrent(e){return a(this,null,function*(){if(e===this.currentUser)return this.queue(()=>a(this,null,function*(){return this.directlySetCurrentUser(e)}))})}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let i=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,r){if(this._deleted)return()=>{};let s=typeof t=="function"?t:t.next.bind(t),o=!1,c=this._isInitialized?Promise.resolve():this._initializationPromise;if(u(c,this,"internal-error"),c.then(()=>{o||s(this.currentUser)}),typeof t=="function"){let d=e.addObserver(t,i,r);return()=>{o=!0,d()}}else{let d=e.addObserver(t);return()=>{o=!0,d()}}}directlySetCurrentUser(e){return a(this,null,function*(){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?yield this.assertedPersistence.setCurrentUser(e):yield this.assertedPersistence.removeCurrentUser()})}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return u(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=ui(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getAdditionalHeaders(){return a(this,null,function*(){var e;let t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);let i=yield(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader();i&&(t["X-Firebase-Client"]=i);let r=yield this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t})}_getAppCheckToken(){return a(this,null,function*(){var e;let t=yield(e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken();return t?.error&&Ea(`Error while retrieving App Check token: ${t.error}`),t?.token})}};function _(n){return p(n)}var Pt=class{constructor(e){this.auth=e,this.observer=null,this.addObserver=mt(t=>this.observer=t)}get next(){return u(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};var rt={loadJS(){return a(this,null,function*(){throw new Error("Unable to load external scripts")})},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Wa(n){rt=n}function hi(n){return rt.loadJS(n)}function Ha(){return rt.recaptchaV2Script}function Ba(){return rt.recaptchaEnterpriseScript}function ja(){return rt.gapiScript}function ws(n){return`__${n}${Math.floor(Math.random()*1e6)}`}var za="recaptcha-enterprise",$a="NO_RECAPTCHA",Fn=class{constructor(e){this.type=za,this.auth=_(e)}verify(e="verify",t=!1){return a(this,null,function*(){function i(s){return a(this,null,function*(){if(!t){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise((o,c)=>a(this,null,function*(){Ra(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(d=>{if(d.recaptchaKey===void 0)c(new Error("recaptcha Enterprise site key undefined"));else{let l=new Ln(d);return s.tenantId==null?s._agentRecaptchaConfig=l:s._tenantRecaptchaConfigs[s.tenantId]=l,o(l.siteKey)}}).catch(d=>{c(d)})}))})}function r(s,o,c){let d=window.grecaptcha;qr(d)?d.enterprise.ready(()=>{d.enterprise.execute(s,{action:e}).then(l=>{o(l)}).catch(()=>{o($a)})}):c(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((s,o)=>{i(this.auth).then(c=>{if(!t&&qr(window.grecaptcha))r(c,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let d=Ba();d.length!==0&&(d+=c),hi(d).then(()=>{r(c,s,o)}).catch(l=>{o(l)})}}).catch(c=>{o(c)})})})}};function Xr(n,e,t,i=!1){return a(this,null,function*(){let r=new Fn(n),s;try{s=yield r.verify(t)}catch{s=yield r.verify(t,!0)}let o=Object.assign({},e);return i?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o})}function Je(n,e,t,i){return a(this,null,function*(){var r;if(!((r=n._getRecaptchaConfig())===null||r===void 0)&&r.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){let s=yield Xr(n,e,t,t==="getOobCode");return i(n,s)}else return i(n,e).catch(s=>a(this,null,function*(){if(s.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let o=yield Xr(n,e,t,t==="getOobCode");return i(n,o)}else return Promise.reject(s)}))})}function Ga(n,e){let t=e?.persistence||[],i=(Array.isArray(t)?t:[t]).map(R);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(i,e?.popupRedirectResolver)}function fi(n,e,t){let i=_(n);u(i._canInitEmulator,i,"emulator-config-failed"),u(/^https?:\/\//.test(e),i,"invalid-emulator-scheme");let r=!!t?.disableWarnings,s=Ts(e),{host:o,port:c}=qa(e),d=c===null?"":`:${c}`;i.config.emulator={url:`${s}//${o}${d}/`},i.settings.appVerificationDisabledForTesting=!0,i.emulatorConfig=Object.freeze({host:o,port:c,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:r})}),r||Ka()}function Ts(n){let e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function qa(n){let e=Ts(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};let i=t[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(i);if(r){let s=r[1];return{host:s,port:Qr(i.substr(s.length+1))}}else{let[s,o]=i.split(":");return{host:s,port:Qr(o)}}}function Qr(n){if(!n)return null;let e=Number(n);return isNaN(e)?null:e}function Ka(){function n(){let e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}var j=class{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return H("not implemented")}_getIdTokenResponse(e){return H("not implemented")}_linkToIdToken(e,t){return H("not implemented")}_getReauthenticationResolver(e){return H("not implemented")}};function bs(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:resetPassword",E(n,e))})}function Ja(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:update",e)})}function Ya(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:signUp",e)})}function Xa(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:update",E(n,e))})}function Qa(n,e){return a(this,null,function*(){return Y(n,"POST","/v1/accounts:signInWithPassword",E(n,e))})}function Ut(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:sendOobCode",E(n,e))})}function Za(n,e){return a(this,null,function*(){return Ut(n,e)})}function ec(n,e){return a(this,null,function*(){return Ut(n,e)})}function tc(n,e){return a(this,null,function*(){return Ut(n,e)})}function nc(n,e){return a(this,null,function*(){return Ut(n,e)})}function ic(n,e){return a(this,null,function*(){return Y(n,"POST","/v1/accounts:signInWithEmailLink",E(n,e))})}function rc(n,e){return a(this,null,function*(){return Y(n,"POST","/v1/accounts:signInWithEmailLink",E(n,e))})}var Ye=class n extends j{constructor(e,t,i,r=null){super("password",i),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new n(e,t,"password")}static _fromEmailAndCode(e,t,i=null){return new n(e,t,"emailLink",i)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;if(t?.email&&t?.password){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}_getIdTokenResponse(e){return a(this,null,function*(){switch(this.signInMethod){case"password":let t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Je(e,t,"signInWithPassword",Qa);case"emailLink":return ic(e,{email:this._email,oobCode:this._password});default:b(e,"internal-error")}})}_linkToIdToken(e,t){return a(this,null,function*(){switch(this.signInMethod){case"password":let i={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Je(e,i,"signUpPassword",Ya);case"emailLink":return rc(e,{idToken:t,email:this._email,oobCode:this._password});default:b(e,"internal-error")}})}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}};function K(n,e){return a(this,null,function*(){return Y(n,"POST","/v1/accounts:signInWithIdp",E(n,e))})}var sc="http://localhost",x=class n extends j{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new n(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):b("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e,{providerId:i,signInMethod:r}=t,s=lt(t,["providerId","signInMethod"]);if(!i||!r)return null;let o=new n(i,r);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){let t=this.buildRequest();return K(e,t)}_linkToIdToken(e,t){let i=this.buildRequest();return i.idToken=t,K(e,i)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,K(e,t)}buildRequest(){let e={requestUri:sc,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ae(t)}return e}};function oc(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:sendVerificationCode",E(n,e))})}function ac(n,e){return a(this,null,function*(){return Y(n,"POST","/v1/accounts:signInWithPhoneNumber",E(n,e))})}function cc(n,e){return a(this,null,function*(){let t=yield Y(n,"POST","/v1/accounts:signInWithPhoneNumber",E(n,e));if(t.temporaryProof)throw He(n,"account-exists-with-different-credential",t);return t})}var dc={USER_NOT_FOUND:"user-not-found"};function lc(n,e){return a(this,null,function*(){let t=Object.assign(Object.assign({},e),{operation:"REAUTH"});return Y(n,"POST","/v1/accounts:signInWithPhoneNumber",E(n,t),dc)})}var Pe=class n extends j{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new n({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new n({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return ac(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return cc(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return lc(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:i,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:i,code:r}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){typeof e=="string"&&(e=JSON.parse(e));let{verificationId:t,verificationCode:i,phoneNumber:r,temporaryProof:s}=e;return!i&&!t&&!r&&!s?null:new n({verificationId:t,verificationCode:i,phoneNumber:r,temporaryProof:s})}};function uc(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function hc(n){let e=X(be(n)).link,t=e?X(be(e)).deep_link_id:null,i=X(be(n)).deep_link_id;return(i?X(be(i)).link:null)||i||t||e||n}var Xe=class n{constructor(e){var t,i,r,s,o,c;let d=X(be(e)),l=(t=d.apiKey)!==null&&t!==void 0?t:null,h=(i=d.oobCode)!==null&&i!==void 0?i:null,f=uc((r=d.mode)!==null&&r!==void 0?r:null);u(l&&h&&f,"argument-error"),this.apiKey=l,this.operation=f,this.code=h,this.continueUrl=(s=d.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=d.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(c=d.tenantId)!==null&&c!==void 0?c:null}static parseLink(e){let t=hc(e);try{return new n(t)}catch{return null}}};var st=(()=>{class n{constructor(){this.providerId=n.PROVIDER_ID}static credential(t,i){return Ye._fromEmailAndPassword(t,i)}static credentialWithLink(t,i){let r=Xe.parseLink(i);return u(r,"argument-error"),Ye._fromEmailAndCode(t,r.code,r.tenantId)}}n.PROVIDER_ID="password",n.EMAIL_PASSWORD_SIGN_IN_METHOD="password",n.EMAIL_LINK_SIGN_IN_METHOD="emailLink";return n})(),U=class{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}};var ie=class extends U{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}},Ce=class n extends ie{static credentialFromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;return u("providerId"in t&&"signInMethod"in t,"argument-error"),x._fromParams(t)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return u(e.idToken||e.accessToken,"argument-error"),x._fromParams(Object.assign(Object.assign({},e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return n.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return n.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:i,oauthTokenSecret:r,pendingToken:s,nonce:o,providerId:c}=e;if(!i&&!r&&!t&&!s||!c)return null;try{return new n(c)._credential({idToken:t,accessToken:i,nonce:o,pendingToken:s})}catch{return null}}};var Ft=(()=>{class n extends ie{constructor(){super("facebook.com")}static credential(t){return x._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch{return null}}}n.FACEBOOK_SIGN_IN_METHOD="facebook.com",n.PROVIDER_ID="facebook.com";return n})(),Vt=(()=>{class n extends ie{constructor(){super("google.com"),this.addScope("profile")}static credential(t,i){return x._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:i})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;let{oauthIdToken:i,oauthAccessToken:r}=t;if(!i&&!r)return null;try{return n.credential(i,r)}catch{return null}}}n.GOOGLE_SIGN_IN_METHOD="google.com",n.PROVIDER_ID="google.com";return n})(),Wt=(()=>{class n extends ie{constructor(){super("github.com")}static credential(t){return x._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch{return null}}}n.GITHUB_SIGN_IN_METHOD="github.com",n.PROVIDER_ID="github.com";return n})(),fc="http://localhost",he=class n extends j{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){let t=this.buildRequest();return K(e,t)}_linkToIdToken(e,t){let i=this.buildRequest();return i.idToken=t,K(e,i)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,K(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e,{providerId:i,signInMethod:r,pendingToken:s}=t;return!i||!r||!s||i!==r?null:new n(i,s)}static _create(e,t){return new n(e,t)}buildRequest(){return{requestUri:fc,returnSecureToken:!0,pendingToken:this.pendingToken}}};var pc="saml.",Qe=class n extends U{constructor(e){u(e.startsWith(pc),"argument-error"),super(e)}static credentialFromResult(e){return n.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return n.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){let t=he.fromJSON(e);return u(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{pendingToken:t,providerId:i}=e;if(!t||!i)return null;try{return he._create(i,t)}catch{return null}}};var Ht=(()=>{class n extends ie{constructor(){super("twitter.com")}static credential(t,i){return x._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:i})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;let{oauthAccessToken:i,oauthTokenSecret:r}=t;if(!i||!r)return null;try{return n.credential(i,r)}catch{return null}}}n.TWITTER_SIGN_IN_METHOD="twitter.com",n.PROVIDER_ID="twitter.com";return n})();function As(n,e){return a(this,null,function*(){return Y(n,"POST","/v1/accounts:signUp",E(n,e))})}var F=class n{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static _fromIdTokenResponse(e,t,i,r=!1){return a(this,null,function*(){let s=yield ue._fromIdTokenResponse(e,i,r),o=Zr(i);return new n({user:s,providerId:o,_tokenResponse:i,operationType:t})})}static _forOperation(e,t,i){return a(this,null,function*(){yield e._updateTokensIfNecessary(i,!0);let r=Zr(i);return new n({user:e,providerId:r,_tokenResponse:i,operationType:t})})}};function Zr(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}function pi(n){return a(this,null,function*(){var e;if(v(n.app))return Promise.reject(S(n));let t=_(n);if(yield t._initializationPromise,!((e=t.currentUser)===null||e===void 0)&&e.isAnonymous)return new F({user:t.currentUser,providerId:null,operationType:"signIn"});let i=yield As(t,{returnSecureToken:!0}),r=yield F._fromIdTokenResponse(t,"signIn",i,!0);return yield t._updateCurrentUser(r.user),r})}var Vn=class n extends A{constructor(e,t,i,r){var s;super(t.code,t.message),this.operationType=i,this.user=r,Object.setPrototypeOf(this,n.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:t.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(e,t,i,r){return new n(e,t,i,r)}};function Ss(n,e,t,i){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?Vn._fromErrorAndOperation(n,s,e,i):s})}function Rs(n){return new Set(n.map(({providerId:e})=>e).filter(e=>!!e))}function mi(n,e){return a(this,null,function*(){let t=p(n);yield Bt(!0,t,e);let{providerUserInfo:i}=yield Ca(t.auth,{idToken:yield t.getIdToken(),deleteProvider:[e]}),r=Rs(i||[]);return t.providerData=t.providerData.filter(s=>r.has(s.providerId)),r.has("phone")||(t.phoneNumber=null),yield t.auth._persistUserIfCurrent(t),t})}function gi(n,e,t=!1){return a(this,null,function*(){let i=yield J(n,e._linkToIdToken(n.auth,yield n.getIdToken()),t);return F._forOperation(n,"link",i)})}function Bt(n,e,t){return a(this,null,function*(){yield Ke(e);let i=Rs(e.providerData),r=n===!1?"provider-already-linked":"no-such-provider";u(i.has(t)===n,e.auth,r)})}function Ps(n,e,t=!1){return a(this,null,function*(){let{auth:i}=n;if(v(i.app))return Promise.reject(S(i));let r="reauthenticate";try{let s=yield J(n,Ss(i,r,e,n),t);u(s.idToken,i,"internal-error");let o=xt(s.idToken);u(o,i,"internal-error");let{sub:c}=o;return u(n.uid===c,i,"user-mismatch"),F._forOperation(n,r,s)}catch(s){throw s?.code==="auth/user-not-found"&&b(i,"user-mismatch"),s}})}function Cs(n,e,t=!1){return a(this,null,function*(){if(v(n.app))return Promise.reject(S(n));let i="signIn",r=yield Ss(n,i,e),s=yield F._fromIdTokenResponse(n,i,r);return t||(yield n._updateCurrentUser(s.user)),s})}function Oe(n,e){return a(this,null,function*(){return Cs(_(n),e)})}function jt(n,e){return a(this,null,function*(){let t=p(n);return yield Bt(!1,t,e.providerId),gi(t,e)})}function zt(n,e){return a(this,null,function*(){return Ps(p(n),e)})}function mc(n,e){return a(this,null,function*(){return Y(n,"POST","/v1/accounts:signInWithCustomToken",E(n,e))})}function _i(n,e){return a(this,null,function*(){if(v(n.app))return Promise.reject(S(n));let t=_(n),i=yield mc(t,{token:e,returnSecureToken:!0}),r=yield F._fromIdTokenResponse(t,"signIn",i);return yield t._updateCurrentUser(r.user),r})}var fe=class{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?Wn._fromServerResponse(e,t):"totpInfo"in t?Hn._fromServerResponse(e,t):b(e,"internal-error")}},Wn=class n extends fe{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new n(t)}},Hn=class n extends fe{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new n(t)}};function $t(n,e,t){var i;u(((i=t.url)===null||i===void 0?void 0:i.length)>0,n,"invalid-continue-uri"),u(typeof t.dynamicLinkDomain>"u"||t.dynamicLinkDomain.length>0,n,"invalid-dynamic-link-domain"),e.continueUrl=t.url,e.dynamicLinkDomain=t.dynamicLinkDomain,e.canHandleCodeInApp=t.handleCodeInApp,t.iOS&&(u(t.iOS.bundleId.length>0,n,"missing-ios-bundle-id"),e.iOSBundleId=t.iOS.bundleId),t.android&&(u(t.android.packageName.length>0,n,"missing-android-pkg-name"),e.androidInstallApp=t.android.installApp,e.androidMinimumVersionCode=t.android.minimumVersion,e.androidPackageName=t.android.packageName)}function vi(n){return a(this,null,function*(){let e=_(n);e._getPasswordPolicyInternal()&&(yield e._updatePasswordPolicy())})}function Ii(n,e,t){return a(this,null,function*(){let i=_(n),r={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};t&&$t(i,r,t),yield Je(i,r,"getOobCode",ec)})}function Ei(n,e,t){return a(this,null,function*(){yield bs(p(n),{oobCode:e,newPassword:t}).catch(i=>a(this,null,function*(){throw i.code==="auth/password-does-not-meet-requirements"&&vi(n),i}))})}function yi(n,e){return a(this,null,function*(){yield Xa(p(n),{oobCode:e})})}function Gt(n,e){return a(this,null,function*(){let t=p(n),i=yield bs(t,{oobCode:e}),r=i.requestType;switch(u(r,t,"internal-error"),r){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":u(i.newEmail,t,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":u(i.mfaInfo,t,"internal-error");default:u(i.email,t,"internal-error")}let s=null;return i.mfaInfo&&(s=fe._fromServerResponse(_(t),i.mfaInfo)),{data:{email:(i.requestType==="VERIFY_AND_CHANGE_EMAIL"?i.newEmail:i.email)||null,previousEmail:(i.requestType==="VERIFY_AND_CHANGE_EMAIL"?i.email:i.newEmail)||null,multiFactorInfo:s},operation:r}})}function wi(n,e){return a(this,null,function*(){let{data:t}=yield Gt(p(n),e);return t.email})}function Ti(n,e,t){return a(this,null,function*(){if(v(n.app))return Promise.reject(S(n));let i=_(n),o=yield Je(i,{returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",As).catch(d=>{throw d.code==="auth/password-does-not-meet-requirements"&&vi(n),d}),c=yield F._fromIdTokenResponse(i,"signIn",o);return yield i._updateCurrentUser(c.user),c})}function bi(n,e,t){return v(n.app)?Promise.reject(S(n)):Oe(p(n),st.credential(e,t)).catch(i=>a(this,null,function*(){throw i.code==="auth/password-does-not-meet-requirements"&&vi(n),i}))}function Ai(n,e,t){return a(this,null,function*(){let i=_(n),r={requestType:"EMAIL_SIGNIN",email:e,clientType:"CLIENT_TYPE_WEB"};function s(o,c){u(c.handleCodeInApp,i,"argument-error"),c&&$t(i,o,c)}s(r,t),yield Je(i,r,"getOobCode",tc)})}function Si(n,e){let t=Xe.parseLink(e);return t?.operation==="EMAIL_SIGNIN"}function Ri(n,e,t){return a(this,null,function*(){if(v(n.app))return Promise.reject(S(n));let i=p(n),r=st.credentialWithLink(e,t||$e());return u(r._tenantId===(i.tenantId||null),i,"tenant-id-mismatch"),Oe(i,r)})}function gc(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:createAuthUri",E(n,e))})}function Pi(n,e){return a(this,null,function*(){let t=ci()?$e():"http://localhost",i={identifier:e,continueUri:t},{signinMethods:r}=yield gc(p(n),i);return r||[]})}function Ci(n,e){return a(this,null,function*(){let t=p(n),r={requestType:"VERIFY_EMAIL",idToken:yield n.getIdToken()};e&&$t(t.auth,r,e);let{email:s}=yield Za(t.auth,r);s!==n.email&&(yield n.reload())})}function ki(n,e,t){return a(this,null,function*(){let i=p(n),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:yield n.getIdToken(),newEmail:e};t&&$t(i.auth,s,t);let{email:o}=yield nc(i.auth,s);o!==n.email&&(yield n.reload())})}function _c(n,e){return a(this,null,function*(){return y(n,"POST","/v1/accounts:update",e)})}function Ni(i,r){return a(this,arguments,function*(n,{displayName:e,photoURL:t}){if(e===void 0&&t===void 0)return;let s=p(n),c={idToken:yield s.getIdToken(),displayName:e,photoUrl:t,returnSecureToken:!0},d=yield J(s,_c(s.auth,c));s.displayName=d.displayName||null,s.photoURL=d.photoUrl||null;let l=s.providerData.find(({providerId:h})=>h==="password");l&&(l.displayName=s.displayName,l.photoURL=s.photoURL),yield s._updateTokensIfNecessary(d)})}function Oi(n,e){let t=p(n);return v(t.auth.app)?Promise.reject(S(t.auth)):ks(t,e,null)}function Di(n,e){return ks(p(n),null,e)}function ks(n,e,t){return a(this,null,function*(){let{auth:i}=n,s={idToken:yield n.getIdToken(),returnSecureToken:!0};e&&(s.email=e),t&&(s.password=t);let o=yield J(n,Ja(i,s));yield n._updateTokensIfNecessary(o,!0)})}function vc(n){var e,t;if(!n)return null;let{providerId:i}=n,r=n.rawUserInfo?JSON.parse(n.rawUserInfo):{},s=n.isNewUser||n.kind==="identitytoolkit#SignupNewUserResponse";if(!i&&n?.idToken){let o=(t=(e=xt(n.idToken))===null||e===void 0?void 0:e.firebase)===null||t===void 0?void 0:t.sign_in_provider;if(o){let c=o!=="anonymous"&&o!=="custom"?o:null;return new te(s,c)}}if(!i)return null;switch(i){case"facebook.com":return new Bn(s,r);case"github.com":return new jn(s,r);case"google.com":return new zn(s,r);case"twitter.com":return new $n(s,r,n.screenName||null);case"custom":case"anonymous":return new te(s,null);default:return new te(s,i,r)}}var te=class{constructor(e,t,i={}){this.isNewUser=e,this.providerId=t,this.profile=i}},Ct=class extends te{constructor(e,t,i,r){super(e,t,i),this.username=r}},Bn=class extends te{constructor(e,t){super(e,"facebook.com",t)}},jn=class extends Ct{constructor(e,t){super(e,"github.com",t,typeof t?.login=="string"?t?.login:null)}},zn=class extends te{constructor(e,t){super(e,"google.com",t)}},$n=class extends Ct{constructor(e,t,i){super(e,"twitter.com",t,i)}};function Li(n){let{user:e,_tokenResponse:t}=n;return e.isAnonymous&&!t?{providerId:null,isNewUser:!1,profile:null}:vc(t)}var kt=class n{constructor(e,t,i){this.type=e,this.credential=t,this.user=i}static _fromIdtoken(e,t){return new n("enroll",e,t)}static _fromMfaPendingCredential(e){return new n("signin",e)}toJSON(){return{multiFactorSession:{[this.type==="enroll"?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var t,i;if(e?.multiFactorSession){if(!((t=e.multiFactorSession)===null||t===void 0)&&t.pendingCredential)return n._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(!((i=e.multiFactorSession)===null||i===void 0)&&i.idToken)return n._fromIdtoken(e.multiFactorSession.idToken)}return null}};var Gn=class n{constructor(e,t,i){this.session=e,this.hints=t,this.signInResolver=i}static _fromError(e,t){let i=_(e),r=t.customData._serverResponse,s=(r.mfaInfo||[]).map(c=>fe._fromServerResponse(i,c));u(r.mfaPendingCredential,i,"internal-error");let o=kt._fromMfaPendingCredential(r.mfaPendingCredential);return new n(o,s,c=>a(this,null,function*(){let d=yield c._process(i,o);delete r.mfaInfo,delete r.mfaPendingCredential;let l=Object.assign(Object.assign({},r),{idToken:d.idToken,refreshToken:d.refreshToken});switch(t.operationType){case"signIn":let h=yield F._fromIdTokenResponse(i,t.operationType,l);return yield i._updateCurrentUser(h.user),h;case"reauthenticate":return u(t.user,i,"internal-error"),F._forOperation(t.user,t.operationType,l);default:b(i,"internal-error")}}))}resolveSignIn(e){return a(this,null,function*(){let t=e;return this.signInResolver(t)})}};function Mi(n,e){var t;let i=p(n),r=e;return u(e.customData.operationType,i,"argument-error"),u((t=r.customData._serverResponse)===null||t===void 0?void 0:t.mfaPendingCredential,i,"argument-error"),Gn._fromError(i,r)}function Ic(n,e){return y(n,"POST","/v2/accounts/mfaEnrollment:start",E(n,e))}function Ec(n,e){return y(n,"POST","/v2/accounts/mfaEnrollment:finalize",E(n,e))}function yc(n,e){return y(n,"POST","/v2/accounts/mfaEnrollment:withdraw",E(n,e))}var qn=class n{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(i=>fe._fromServerResponse(e.auth,i)))})}static _fromUser(e){return new n(e)}getSession(){return a(this,null,function*(){return kt._fromIdtoken(yield this.user.getIdToken(),this.user)})}enroll(e,t){return a(this,null,function*(){let i=e,r=yield this.getSession(),s=yield J(this.user,i._process(this.user.auth,r,t));return yield this.user._updateTokensIfNecessary(s),this.user.reload()})}unenroll(e){return a(this,null,function*(){let t=typeof e=="string"?e:e.uid,i=yield this.user.getIdToken();try{let r=yield J(this.user,yc(this.user.auth,{idToken:i,mfaEnrollmentId:t}));this.enrolledFactors=this.enrolledFactors.filter(({uid:s})=>s!==t),yield this.user._updateTokensIfNecessary(r),yield this.user.reload()}catch(r){throw r}})}},kn=new WeakMap;function xi(n){let e=p(n);return kn.has(e)||kn.set(e,qn._fromUser(e)),kn.get(e)}var Nt="__sak";var Ot=class{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Nt,"1"),this.storage.removeItem(Nt),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}};function wc(){let n=I();return li(n)||ge(n)}var Tc=1e3,bc=10,Ac=(()=>{class n extends Ot{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,i)=>this.onStorageEvent(t,i),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=wc()&&Ua(),this.fallbackToPolling=ys(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(let i of Object.keys(this.listeners)){let r=this.storage.getItem(i),s=this.localCache[i];r!==s&&t(i,s,r)}}onStorageEvent(t,i=!1){if(!t.key){this.forAllChangedKeys((c,d,l)=>{this.notifyListeners(c,l)});return}let r=t.key;if(i?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){let c=this.storage.getItem(r);if(t.newValue!==c)t.newValue!==null?this.storage.setItem(r,t.newValue):this.storage.removeItem(r);else if(this.localCache[r]===t.newValue&&!i)return}let s=()=>{let c=this.storage.getItem(r);!i&&this.localCache[r]===c||this.notifyListeners(r,c)},o=this.storage.getItem(r);xa()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,bc):s()}notifyListeners(t,i){this.localCache[t]=i;let r=this.listeners[t];if(r)for(let s of Array.from(r))s(i&&JSON.parse(i))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,i,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:i,newValue:r}),!0)})},Tc)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,i){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(i)}_removeListener(t,i){this.listeners[t]&&(this.listeners[t].delete(i),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}_set(t,i){return a(this,null,function*(){yield oe(n.prototype,this,"_set").call(this,t,i),this.localCache[t]=JSON.stringify(i)})}_get(t){return a(this,null,function*(){let i=yield oe(n.prototype,this,"_get").call(this,t);return this.localCache[t]=JSON.stringify(i),i})}_remove(t){return a(this,null,function*(){yield oe(n.prototype,this,"_remove").call(this,t),delete this.localCache[t]})}}return n.type="LOCAL",n})(),De=Ac;var Sc=(()=>{class n extends Ot{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,i){}_removeListener(t,i){}}return n.type="SESSION",n})(),z=Sc;function Rc(n){return Promise.all(n.map(e=>a(this,null,function*(){try{return{fulfilled:!0,value:yield e}}catch(t){return{fulfilled:!1,reason:t}}})))}var Pc=(()=>{class n{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){let i=this.receivers.find(s=>s.isListeningto(t));if(i)return i;let r=new n(t);return this.receivers.push(r),r}isListeningto(t){return this.eventTarget===t}handleEvent(t){return a(this,null,function*(){let i=t,{eventId:r,eventType:s,data:o}=i.data,c=this.handlersMap[s];if(!c?.size)return;i.ports[0].postMessage({status:"ack",eventId:r,eventType:s});let d=Array.from(c).map(h=>a(this,null,function*(){return h(i.origin,o)})),l=yield Rc(d);i.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:l})})}_subscribe(t,i){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(i)}_unsubscribe(t,i){this.handlersMap[t]&&i&&this.handlersMap[t].delete(i),(!i||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}n.receivers=[];return n})();function _e(n="",e=10){let t="";for(let i=0;i<e;i++)t+=Math.floor(Math.random()*10);return n+t}var Kn=class{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}_send(e,t,i=50){return a(this,null,function*(){let r=typeof MessageChannel<"u"?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let s,o;return new Promise((c,d)=>{let l=_e("",20);r.port1.start();let h=setTimeout(()=>{d(new Error("unsupported_event"))},i);o={messageChannel:r,onMessage(f){let m=f;if(m.data.eventId===l)switch(m.data.status){case"ack":clearTimeout(h),s=setTimeout(()=>{d(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),c(m.data.response);break;default:clearTimeout(h),clearTimeout(s),d(new Error("invalid_response"));break}}},this.handlers.add(o),r.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[r.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})})}};function w(){return window}function Cc(n){w().location.href=n}function Ui(){return typeof w().WorkerGlobalScope<"u"&&typeof w().importScripts=="function"}function kc(){return a(this,null,function*(){if(!navigator?.serviceWorker)return null;try{return(yield navigator.serviceWorker.ready).active}catch{return null}})}function Nc(){var n;return((n=navigator?.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function Oc(){return Ui()?self:null}var Ns="firebaseLocalStorageDb",Dc=1,Dt="firebaseLocalStorage",Os="fbase_key",pe=class{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}};function qt(n,e){return n.transaction([Dt],e?"readwrite":"readonly").objectStore(Dt)}function Lc(){let n=indexedDB.deleteDatabase(Ns);return new pe(n).toPromise()}function Jn(){let n=indexedDB.open(Ns,Dc);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{let i=n.result;try{i.createObjectStore(Dt,{keyPath:Os})}catch(r){t(r)}}),n.addEventListener("success",()=>a(this,null,function*(){let i=n.result;i.objectStoreNames.contains(Dt)?e(i):(i.close(),yield Lc(),e(yield Jn()))}))})}function es(n,e,t){return a(this,null,function*(){let i=qt(n,!0).put({[Os]:e,value:t});return new pe(i).toPromise()})}function Mc(n,e){return a(this,null,function*(){let t=qt(n,!1).get(e),i=yield new pe(t).toPromise();return i===void 0?null:i.value})}function ts(n,e){let t=qt(n,!0).delete(e);return new pe(t).toPromise()}var xc=800,Uc=3,Fc=(()=>{class n{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}_openDb(){return a(this,null,function*(){return this.db?this.db:(this.db=yield Jn(),this.db)})}_withRetries(t){return a(this,null,function*(){let i=0;for(;;)try{let r=yield this._openDb();return yield t(r)}catch(r){if(i++>Uc)throw r;this.db&&(this.db.close(),this.db=void 0)}})}initializeServiceWorkerMessaging(){return a(this,null,function*(){return Ui()?this.initializeReceiver():this.initializeSender()})}initializeReceiver(){return a(this,null,function*(){this.receiver=Pc._getInstance(Oc()),this.receiver._subscribe("keyChanged",(t,i)=>a(this,null,function*(){return{keyProcessed:(yield this._poll()).includes(i.key)}})),this.receiver._subscribe("ping",(t,i)=>a(this,null,function*(){return["keyChanged"]}))})}initializeSender(){return a(this,null,function*(){var t,i;if(this.activeServiceWorker=yield kc(),!this.activeServiceWorker)return;this.sender=new Kn(this.activeServiceWorker);let r=yield this.sender._send("ping",{},800);r&&!((t=r[0])===null||t===void 0)&&t.fulfilled&&!((i=r[0])===null||i===void 0)&&i.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)})}notifyServiceWorker(t){return a(this,null,function*(){if(!(!this.sender||!this.activeServiceWorker||Nc()!==this.activeServiceWorker))try{yield this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}})}_isAvailable(){return a(this,null,function*(){try{if(!indexedDB)return!1;let t=yield Jn();return yield es(t,Nt,"1"),yield ts(t,Nt),!0}catch{}return!1})}_withPendingWrite(t){return a(this,null,function*(){this.pendingWrites++;try{yield t()}finally{this.pendingWrites--}})}_set(t,i){return a(this,null,function*(){return this._withPendingWrite(()=>a(this,null,function*(){return yield this._withRetries(r=>es(r,t,i)),this.localCache[t]=i,this.notifyServiceWorker(t)}))})}_get(t){return a(this,null,function*(){let i=yield this._withRetries(r=>Mc(r,t));return this.localCache[t]=i,i})}_remove(t){return a(this,null,function*(){return this._withPendingWrite(()=>a(this,null,function*(){return yield this._withRetries(i=>ts(i,t)),delete this.localCache[t],this.notifyServiceWorker(t)}))})}_poll(){return a(this,null,function*(){let t=yield this._withRetries(s=>{let o=qt(s,!1).getAll();return new pe(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];let i=[],r=new Set;if(t.length!==0)for(let{fbase_key:s,value:o}of t)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(o)&&(this.notifyListeners(s,o),i.push(s));for(let s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),i.push(s));return i})}notifyListeners(t,i){this.localCache[t]=i;let r=this.listeners[t];if(r)for(let s of Array.from(r))s(i)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>a(this,null,function*(){return this._poll()}),xc)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,i){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(i)}_removeListener(t,i){this.listeners[t]&&(this.listeners[t].delete(i),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}return n.type="LOCAL",n})(),ve=Fc;function Vc(n,e){return y(n,"POST","/v2/accounts/mfaSignIn:start",E(n,e))}function Wc(n,e){return y(n,"POST","/v2/accounts/mfaSignIn:finalize",E(n,e))}var Hc=500,Bc=6e4,wt=1e12,Yn=class{constructor(e){this.auth=e,this.counter=wt,this._widgets=new Map}render(e,t){let i=this.counter;return this._widgets.set(i,new Xn(e,this.auth.name,t||{})),this.counter++,i}reset(e){var t;let i=e||wt;(t=this._widgets.get(i))===null||t===void 0||t.delete(),this._widgets.delete(i)}getResponse(e){var t;let i=e||wt;return((t=this._widgets.get(i))===null||t===void 0?void 0:t.getResponse())||""}execute(e){return a(this,null,function*(){var t;let i=e||wt;return(t=this._widgets.get(i))===null||t===void 0||t.execute(),""})}},Xn=class{constructor(e,t,i){this.params=i,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};let r=typeof e=="string"?document.getElementById(e):e;u(r,"argument-error",{appName:t}),this.container=r,this.isVisible=this.params.size!=="invisible",this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),!this.timerId&&(this.timerId=window.setTimeout(()=>{this.responseToken=jc(50);let{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch{}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch{}this.isVisible&&this.execute()},Bc)},Hc))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}};function jc(n){let e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let i=0;i<n;i++)e.push(t.charAt(Math.floor(Math.random()*t.length)));return e.join("")}var Nn=ws("rcb"),zc=new le(3e4,6e4),Qn=class{constructor(){var e;this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!(!((e=w().grecaptcha)===null||e===void 0)&&e.render)}load(e,t=""){return u($c(t),e,"argument-error"),this.shouldResolveImmediately(t)&&Gr(w().grecaptcha)?Promise.resolve(w().grecaptcha):new Promise((i,r)=>{let s=w().setTimeout(()=>{r(T(e,"network-request-failed"))},zc.get());w()[Nn]=()=>{w().clearTimeout(s),delete w()[Nn];let c=w().grecaptcha;if(!c||!Gr(c)){r(T(e,"internal-error"));return}let d=c.render;c.render=(l,h)=>{let f=d(l,h);return this.counter++,f},this.hostLanguage=t,i(c)};let o=`${Ha()}?${ae({onload:Nn,render:"explicit",hl:t})}`;hi(o).catch(()=>{clearTimeout(s),r(T(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var t;return!!(!((t=w().grecaptcha)===null||t===void 0)&&t.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}};function $c(n){return n.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(n)}var Zn=class{load(e){return a(this,null,function*(){return new Yn(e)})}clearedOneInstance(){}};var Ds="recaptcha",Gc={theme:"light",type:"image"},Ze=class{constructor(e,t,i=Object.assign({},Gc)){this.parameters=i,this.type=Ds,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=_(e),this.isInvisible=this.parameters.size==="invisible",u(typeof document<"u",this.auth,"operation-not-supported-in-this-environment");let r=typeof t=="string"?document.getElementById(t):t;u(r,this.auth,"argument-error"),this.container=r,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new Zn:new Qn,this.validateStartingState()}verify(){return a(this,null,function*(){this.assertNotDestroyed();let e=yield this.render(),t=this.getAssertedRecaptcha(),i=t.getResponse(e);return i||new Promise(r=>{let s=o=>{o&&(this.tokenChangeListeners.delete(s),r(o))};this.tokenChangeListeners.add(s),this.isInvisible&&t.execute(e)})})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise?this.renderPromise:(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e}),this.renderPromise)}_reset(){this.assertNotDestroyed(),this.widgetId!==null&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(e=>{this.container.removeChild(e)})}validateStartingState(){u(!this.parameters.sitekey,this.auth,"argument-error"),u(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),u(typeof document<"u",this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(i=>i(t)),typeof e=="function")e(t);else if(typeof e=="string"){let i=w()[e];typeof i=="function"&&i(t)}}}assertNotDestroyed(){u(!this.destroyed,this.auth,"internal-error")}makeRenderPromise(){return a(this,null,function*(){if(yield this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){let t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId})}init(){return a(this,null,function*(){u(ci()&&!Ui(),this.auth,"internal-error"),yield qc(),this.recaptcha=yield this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);let e=yield Sa(this.auth);u(e,this.auth,"internal-error"),this.parameters.sitekey=e})}getAssertedRecaptcha(){return u(this.recaptcha,this.auth,"internal-error"),this.recaptcha}};function qc(){let n=null;return new Promise(e=>{if(document.readyState==="complete"){e();return}n=()=>e(),window.addEventListener("load",n)}).catch(e=>{throw n&&window.removeEventListener("load",n),e})}var et=class{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){let t=Pe._fromVerification(this.verificationId,e);return this.onConfirmation(t)}};function Fi(n,e,t){return a(this,null,function*(){if(v(n.app))return Promise.reject(S(n));let i=_(n),r=yield Kt(i,e,p(t));return new et(r,s=>Oe(i,s))})}function Vi(n,e,t){return a(this,null,function*(){let i=p(n);yield Bt(!1,i,"phone");let r=yield Kt(i.auth,e,p(t));return new et(r,s=>jt(i,s))})}function Wi(n,e,t){return a(this,null,function*(){let i=p(n);if(v(i.auth.app))return Promise.reject(S(i.auth));let r=yield Kt(i.auth,e,p(t));return new et(r,s=>zt(i,s))})}function Kt(n,e,t){return a(this,null,function*(){var i;let r=yield t.verify();try{u(typeof r=="string",n,"argument-error"),u(t.type===Ds,n,"argument-error");let s;if(typeof e=="string"?s={phoneNumber:e}:s=e,"session"in s){let o=s.session;if("phoneNumber"in s)return u(o.type==="enroll",n,"internal-error"),(yield Ic(n,{idToken:o.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,recaptchaToken:r}})).phoneSessionInfo.sessionInfo;{u(o.type==="signin",n,"internal-error");let c=((i=s.multiFactorHint)===null||i===void 0?void 0:i.uid)||s.multiFactorUid;return u(c,n,"missing-multi-factor-info"),(yield Vc(n,{mfaPendingCredential:o.credential,mfaEnrollmentId:c,phoneSignInInfo:{recaptchaToken:r}})).phoneResponseInfo.sessionInfo}}else{let{sessionInfo:o}=yield oc(n,{phoneNumber:s.phoneNumber,recaptchaToken:r});return o}}finally{t._reset()}})}function Hi(n,e){return a(this,null,function*(){let t=p(n);if(v(t.auth.app))return Promise.reject(S(t.auth));yield gi(t,e)})}var Ie=(()=>{class n{constructor(t){this.providerId=n.PROVIDER_ID,this.auth=_(t)}verifyPhoneNumber(t,i){return Kt(this.auth,t,p(i))}static credential(t,i){return Pe._fromVerification(t,i)}static credentialFromResult(t){let i=t;return n.credentialFromTaggedObject(i)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;let{phoneNumber:i,temporaryProof:r}=t;return i&&r?Pe._fromTokenResponse(i,r):null}}n.PROVIDER_ID="phone",n.PHONE_SIGN_IN_METHOD="phone";return n})();function Ee(n,e){return e?R(e):(u(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}var tt=class extends j{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return K(e,this._buildIdpRequest())}_linkToIdToken(e,t){return K(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return K(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}};function Kc(n){return Cs(n.auth,new tt(n),n.bypassAuthState)}function Jc(n){let{auth:e,user:t}=n;return u(t,e,"internal-error"),Ps(t,new tt(n),n.bypassAuthState)}function Yc(n){return a(this,null,function*(){let{auth:e,user:t}=n;return u(t,e,"internal-error"),gi(t,new tt(n),n.bypassAuthState)})}var Lt=class{constructor(e,t,i,r,s=!1){this.auth=e,this.resolver=i,this.user=r,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise((e,t)=>a(this,null,function*(){this.pendingPromise={resolve:e,reject:t};try{this.eventManager=yield this.resolver._initialize(this.auth),yield this.onExecution(),this.eventManager.registerConsumer(this)}catch(i){this.reject(i)}}))}onAuthEvent(e){return a(this,null,function*(){let{urlResponse:t,sessionId:i,postBody:r,tenantId:s,error:o,type:c}=e;if(o){this.reject(o);return}let d={auth:this.auth,requestUri:t,sessionId:i,tenantId:s||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(yield this.getIdpTask(c)(d))}catch(l){this.reject(l)}})}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Kc;case"linkViaPopup":case"linkViaRedirect":return Yc;case"reauthViaPopup":case"reauthViaRedirect":return Jc;default:b(this.auth,"internal-error")}}resolve(e){M(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){M(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}};var Xc=new le(2e3,1e4);function Bi(n,e,t){return a(this,null,function*(){if(v(n.app))return Promise.reject(T(n,"operation-not-supported-in-this-environment"));let i=_(n);ke(n,e,U);let r=Ee(i,t);return new $i(i,"signInViaPopup",e,r).executeNotNull()})}function ji(n,e,t){return a(this,null,function*(){let i=p(n);if(v(i.auth.app))return Promise.reject(T(i.auth,"operation-not-supported-in-this-environment"));ke(i.auth,e,U);let r=Ee(i.auth,t);return new $i(i.auth,"reauthViaPopup",e,r,i).executeNotNull()})}function zi(n,e,t){return a(this,null,function*(){let i=p(n);ke(i.auth,e,U);let r=Ee(i.auth,t);return new $i(i.auth,"linkViaPopup",e,r,i).executeNotNull()})}var $i=(()=>{class n extends Lt{constructor(t,i,r,s,o){super(t,i,s,o),this.provider=r,this.authWindow=null,this.pollId=null,n.currentPopupAction&&n.currentPopupAction.cancel(),n.currentPopupAction=this}executeNotNull(){return a(this,null,function*(){let t=yield this.execute();return u(t,this.auth,"internal-error"),t})}onExecution(){return a(this,null,function*(){M(this.filter.length===1,"Popup operations only handle one event");let t=_e();this.authWindow=yield this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(i=>{this.reject(i)}),this.resolver._isIframeWebStorageSupported(this.auth,i=>{i||this.reject(T(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()})}get eventId(){var t;return((t=this.authWindow)===null||t===void 0?void 0:t.associatedEvent)||null}cancel(){this.reject(T(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,n.currentPopupAction=null}pollUserCancellation(){let t=()=>{var i,r;if(!((r=(i=this.authWindow)===null||i===void 0?void 0:i.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(T(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,Xc.get())};t()}}n.currentPopupAction=null;return n})(),Qc="pendingRedirect",ze=new Map,ei=class n extends Lt{constructor(e,t,i=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,i),this.eventId=null}execute(){return a(this,null,function*(){let e=ze.get(this.auth._key());if(!e){try{let i=(yield Zc(this.resolver,this.auth))?yield oe(n.prototype,this,"execute").call(this):null;e=()=>Promise.resolve(i)}catch(t){e=()=>Promise.reject(t)}ze.set(this.auth._key(),e)}return this.bypassAuthState||ze.set(this.auth._key(),()=>Promise.resolve(null)),e()})}onAuthEvent(e){return a(this,null,function*(){if(e.type==="signInViaRedirect")return oe(n.prototype,this,"onAuthEvent").call(this,e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){let t=yield this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,oe(n.prototype,this,"onAuthEvent").call(this,e);this.resolve(null)}})}onExecution(){return a(this,null,function*(){})}cleanUp(){}};function Zc(n,e){return a(this,null,function*(){let t=xs(e),i=Ms(n);if(!(yield i._isAvailable()))return!1;let r=(yield i._get(t))==="true";return yield i._remove(t),r})}function Gi(n,e){return a(this,null,function*(){return Ms(n)._set(xs(e),"true")})}function Ls(){ze.clear()}function Le(n,e){ze.set(n._key(),e)}function Ms(n){return R(n._redirectPersistence)}function xs(n){return B(Qc,n.config.apiKey,n.name)}function qi(n,e,t){return ed(n,e,t)}function ed(n,e,t){return a(this,null,function*(){if(v(n.app))return Promise.reject(S(n));let i=_(n);ke(n,e,U),yield i._initializationPromise;let r=Ee(i,t);return yield Gi(r,i),r._openRedirect(i,e,"signInViaRedirect")})}function Ki(n,e,t){return td(n,e,t)}function td(n,e,t){return a(this,null,function*(){let i=p(n);if(ke(i.auth,e,U),v(i.auth.app))return Promise.reject(S(i.auth));yield i.auth._initializationPromise;let r=Ee(i.auth,t);yield Gi(r,i.auth);let s=yield Us(i);return r._openRedirect(i.auth,e,"reauthViaRedirect",s)})}function Ji(n,e,t){return nd(n,e,t)}function nd(n,e,t){return a(this,null,function*(){let i=p(n);ke(i.auth,e,U),yield i.auth._initializationPromise;let r=Ee(i.auth,t);yield Bt(!1,i,e.providerId),yield Gi(r,i.auth);let s=yield Us(i);return r._openRedirect(i.auth,e,"linkViaRedirect",s)})}function Yi(n,e){return a(this,null,function*(){return yield _(n)._initializationPromise,ye(n,e,!1)})}function ye(n,e,t=!1){return a(this,null,function*(){if(v(n.app))return Promise.reject(S(n));let i=_(n),r=Ee(i,e),o=yield new ei(i,r,t).execute();return o&&!t&&(delete o.user._redirectEventId,yield i._persistUserIfCurrent(o.user),yield i._setRedirectUser(null,e)),o})}function Us(n){return a(this,null,function*(){let e=_e(`${n.uid}:::`);return n._redirectEventId=e,yield n.auth._setRedirectUser(n),yield n.auth._persistUserIfCurrent(n),e})}var id=10*60*1e3,nt=class{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(i=>{this.isEventForConsumer(e,i)&&(t=!0,this.sendToConsumer(e,i),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!rd(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var i;if(e.error&&!Fs(e)){let r=((i=e.error.code)===null||i===void 0?void 0:i.split("auth/")[1])||"internal-error";t.onError(T(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let i=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&i}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=id&&this.cachedEventUids.clear(),this.cachedEventUids.has(ns(e))}saveEventToCache(e){this.cachedEventUids.add(ns(e)),this.lastProcessedEventTime=Date.now()}};function ns(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function Fs({type:n,error:e}){return n==="unknown"&&e?.code==="auth/no-auth-event"}function rd(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Fs(n);default:return!1}}function Xi(t){return a(this,arguments,function*(n,e={}){return y(n,"GET","/v1/projects",e)})}var sd=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,od=/^https?/;function ad(n){return a(this,null,function*(){if(n.config.emulator)return;let{authorizedDomains:e}=yield Xi(n);for(let t of e)try{if(cd(t))return}catch{}b(n,"unauthorized-domain")})}function cd(n){let e=$e(),{protocol:t,hostname:i}=new URL(e);if(n.startsWith("chrome-extension://")){let o=new URL(n);return o.hostname===""&&i===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===i}if(!od.test(t))return!1;if(sd.test(n))return i===n;let r=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+r+"|"+r+")$","i").test(i)}var dd=new le(3e4,6e4);function is(){let n=w().___jsl;if(n?.H){for(let e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function ld(n){return new Promise((e,t)=>{var i,r,s;function o(){is(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{is(),t(T(n,"network-request-failed"))},timeout:dd.get()})}if(!((r=(i=w().gapi)===null||i===void 0?void 0:i.iframes)===null||r===void 0)&&r.Iframe)e(gapi.iframes.getContext());else if(!((s=w().gapi)===null||s===void 0)&&s.load)o();else{let c=ws("iframefcb");return w()[c]=()=>{gapi.load?o():t(T(n,"network-request-failed"))},hi(`${ja()}?onload=${c}`).catch(d=>t(d))}}).catch(e=>{throw bt=null,e})}var bt=null;function ud(n){return bt=bt||ld(n),bt}var hd=new le(5e3,15e3),fd="__/auth/iframe",pd="emulator/auth/iframe",md={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},gd=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function _d(n){let e=n.config;u(e.authDomain,n,"auth-domain-config-required");let t=e.emulator?di(e,pd):`https://${n.config.authDomain}/${fd}`,i={apiKey:e.apiKey,appName:n.name,v:q},r=gd.get(n.config.apiHost);r&&(i.eid=r);let s=n._getFrameworks();return s.length&&(i.fw=s.join(",")),`${t}?${ae(i).slice(1)}`}function vd(n){return a(this,null,function*(){let e=yield ud(n),t=w().gapi;return u(t,n,"internal-error"),e.open({where:document.body,url:_d(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:md,dontclear:!0},i=>new Promise((r,s)=>a(this,null,function*(){yield i.restyle({setHideOnLeave:!1});let o=T(n,"network-request-failed"),c=w().setTimeout(()=>{s(o)},hd.get());function d(){w().clearTimeout(c),r(i)}i.ping(d).then(d,()=>{s(o)})})))})}var Id={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Ed=500,yd=600,wd="_blank",Td="http://localhost",it=class{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}};function bd(n,e,t,i=Ed,r=yd){let s=Math.max((window.screen.availHeight-r)/2,0).toString(),o=Math.max((window.screen.availWidth-i)/2,0).toString(),c="",d=Object.assign(Object.assign({},Id),{width:i.toString(),height:r.toString(),top:s,left:o}),l=I().toLowerCase();t&&(c=gs(l)?wd:t),ms(l)&&(e=e||Td,d.scrollbars="yes");let h=Object.entries(d).reduce((m,[P,se])=>`${m}${P}=${se},`,"");if(Ma(l)&&c!=="_self")return Ad(e||"",c),new it(null);let f=window.open(e||"",c,h);u(f,n,"popup-blocked");try{f.focus()}catch{}return new it(f)}function Ad(n,e){let t=document.createElement("a");t.href=n,t.target=e;let i=document.createEvent("MouseEvent");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(i)}var Sd="__/auth/handler",Rd="emulator/auth/handler",Pd=encodeURIComponent("fac");function Mt(n,e,t,i,r,s){return a(this,null,function*(){u(n.config.authDomain,n,"auth-domain-config-required"),u(n.config.apiKey,n,"invalid-api-key");let o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:i,v:q,eventId:r};if(e instanceof U){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",br(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(let[h,f]of Object.entries(s||{}))o[h]=f}if(e instanceof ie){let h=e.getScopes().filter(f=>f!=="");h.length>0&&(o.scopes=h.join(","))}n.tenantId&&(o.tid=n.tenantId);let c=o;for(let h of Object.keys(c))c[h]===void 0&&delete c[h];let d=yield n._getAppCheckToken(),l=d?`#${Pd}=${encodeURIComponent(d)}`:"";return`${Cd(n)}?${ae(c).slice(1)}${l}`})}function Cd({config:n}){return n.emulator?di(n,Rd):`https://${n.authDomain}/${Sd}`}var On="webStorageSupport",ti=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=z,this._completeRedirectFn=ye,this._overrideRedirectResult=Le}_openPopup(e,t,i,r){return a(this,null,function*(){var s;M((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");let o=yield Mt(e,t,i,$e(),r);return bd(e,o,_e())})}_openRedirect(e,t,i,r){return a(this,null,function*(){yield this._originValidation(e);let s=yield Mt(e,t,i,$e(),r);return Cc(s),new Promise(()=>{})})}_initialize(e){let t=e._key();if(this.eventManagers[t]){let{manager:r,promise:s}=this.eventManagers[t];return r?Promise.resolve(r):(M(s,"If manager is not set, promise should be"),s)}let i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}initAndGetManager(e){return a(this,null,function*(){let t=yield vd(e),i=new nt(e);return t.register("authEvent",r=>(u(r?.authEvent,e,"invalid-auth-event"),{status:i.onEvent(r.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:i},this.iframes[e._key()]=t,i})}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(On,{type:On},r=>{var s;let o=(s=r?.[0])===null||s===void 0?void 0:s[On];o!==void 0&&t(!!o),b(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=ad(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return ys()||li()||ge()}},Qi=ti,ni=class{constructor(e){this.factorId=e}_process(e,t,i){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,i);case"signin":return this._finalizeSignIn(e,t.credential);default:return H("unexpected MultiFactorSessionType")}}},ii=class n extends ni{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new n(e)}_finalizeEnroll(e,t,i){return Ec(e,{idToken:t,displayName:i,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return Wc(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}},Zi=(()=>{class n{constructor(){}static assertion(t){return ii._fromCredential(t)}}return n.FACTOR_ID="phone",n})();var rs="@firebase/auth",ss="1.7.3";var ri=class{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}getToken(e){return a(this,null,function*(){return this.assertAuthConfigured(),yield this.auth._initializationPromise,this.auth.currentUser?{accessToken:yield this.auth.currentUser.getIdToken(e)}:null})}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(i=>{e(i?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){u(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};function kd(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Nd(n){G(new C("auth",(e,{options:t})=>{let i=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:c}=i.options;u(o&&!o.includes(":"),"invalid-api-key",{appName:i.name});let d={apiKey:o,authDomain:c,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:ui(n)},l=new Rt(i,r,s,d);return Ga(l,t),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,i)=>{e.getProvider("auth-internal").initialize()})),G(new C("auth-internal",e=>{let t=_(e.getProvider("auth").getImmediate());return(i=>new ri(i))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),L(rs,ss,kd(n)),L(rs,ss,"esm2017")}var Od=5*60,$l=yr("authIdTokenMaxAge")||Od;function Dd(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}Wa({loadJS(n){return new Promise((e,t)=>{let i=document.createElement("script");i.setAttribute("src",n),i.onload=e,i.onerror=r=>{let s=T("internal-error");s.customData=r,t(s)},i.type="text/javascript",i.charset="UTF-8",Dd().appendChild(i)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Nd("Browser");function we(){return window}var Ld=2e3;function Md(n,e,t){return a(this,null,function*(){var i;let{BuildInfo:r}=we();M(e.sessionId,"AuthEvent did not contain a session ID");let s=yield Wd(e.sessionId),o={};return ge()?o.ibi=r.packageName:Ne()?o.apn=r.packageName:b(n,"operation-not-supported-in-this-environment"),r.displayName&&(o.appDisplayName=r.displayName),o.sessionId=s,Mt(n,t,e.type,void 0,(i=e.eventId)!==null&&i!==void 0?i:void 0,o)})}function xd(n){return a(this,null,function*(){let{BuildInfo:e}=we(),t={};ge()?t.iosBundleId=e.packageName:Ne()?t.androidPackageName=e.packageName:b(n,"operation-not-supported-in-this-environment"),yield Xi(n,t)})}function Ud(n){let{cordova:e}=we();return new Promise(t=>{e.plugins.browsertab.isAvailable(i=>{let r=null;i?e.plugins.browsertab.openUrl(n):r=e.InAppBrowser.open(n,Es()?"_blank":"_system","location=yes"),t(r)})})}function Fd(n,e,t){return a(this,null,function*(){let{cordova:i}=we(),r=()=>{};try{yield new Promise((s,o)=>{let c=null;function d(){var f;s();let m=(f=i.plugins.browsertab)===null||f===void 0?void 0:f.close;typeof m=="function"&&m(),typeof t?.close=="function"&&t.close()}function l(){c||(c=window.setTimeout(()=>{o(T(n,"redirect-cancelled-by-user"))},Ld))}function h(){document?.visibilityState==="visible"&&l()}e.addPassiveListener(d),document.addEventListener("resume",l,!1),Ne()&&document.addEventListener("visibilitychange",h,!1),r=()=>{e.removePassiveListener(d),document.removeEventListener("resume",l,!1),document.removeEventListener("visibilitychange",h,!1),c&&window.clearTimeout(c)}})}finally{r()}})}function Vd(n){var e,t,i,r,s,o,c,d,l,h;let f=we();u(typeof((e=f?.universalLinks)===null||e===void 0?void 0:e.subscribe)=="function",n,"invalid-cordova-configuration",{missingPlugin:"cordova-universal-links-plugin-fix"}),u(typeof((t=f?.BuildInfo)===null||t===void 0?void 0:t.packageName)<"u",n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-buildInfo"}),u(typeof((s=(r=(i=f?.cordova)===null||i===void 0?void 0:i.plugins)===null||r===void 0?void 0:r.browsertab)===null||s===void 0?void 0:s.openUrl)=="function",n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),u(typeof((d=(c=(o=f?.cordova)===null||o===void 0?void 0:o.plugins)===null||c===void 0?void 0:c.browsertab)===null||d===void 0?void 0:d.isAvailable)=="function",n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),u(typeof((h=(l=f?.cordova)===null||l===void 0?void 0:l.InAppBrowser)===null||h===void 0?void 0:h.open)=="function",n,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-inappbrowser"})}function Wd(n){return a(this,null,function*(){let e=Hd(n),t=yield crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")})}function Hd(n){if(M(/[0-9a-zA-Z]+/.test(n),"Can only convert alpha-numeric strings"),typeof TextEncoder<"u")return new TextEncoder().encode(n);let e=new ArrayBuffer(n.length),t=new Uint8Array(e);for(let i=0;i<n.length;i++)t[i]=n.charCodeAt(i);return t}var Bd=20,er=class extends nt{constructor(){super(...arguments),this.passiveListeners=new Set,this.initPromise=new Promise(e=>{this.resolveInialized=e})}addPassiveListener(e){this.passiveListeners.add(e)}removePassiveListener(e){this.passiveListeners.delete(e)}resetRedirect(){this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1}onEvent(e){return this.resolveInialized(),this.passiveListeners.forEach(t=>t(e)),super.onEvent(e)}initialized(){return a(this,null,function*(){yield this.initPromise})}};function jd(n,e,t=null){return{type:e,eventId:t,urlResponse:null,sessionId:Gd(),postBody:null,tenantId:n.tenantId,error:T(n,"no-auth-event")}}function zd(n,e){return tr()._set(nr(n),e)}function Vs(n){return a(this,null,function*(){let e=yield tr()._get(nr(n));return e&&(yield tr()._remove(nr(n))),e})}function $d(n,e){var t,i;let r=Kd(e);if(r.includes("/__/auth/callback")){let s=Jt(r),o=s.firebaseError?qd(decodeURIComponent(s.firebaseError)):null,c=(i=(t=o?.code)===null||t===void 0?void 0:t.split("auth/"))===null||i===void 0?void 0:i[1],d=c?T(c):null;return d?{type:n.type,eventId:n.eventId,tenantId:n.tenantId,error:d,urlResponse:null,sessionId:null,postBody:null}:{type:n.type,eventId:n.eventId,tenantId:n.tenantId,sessionId:n.sessionId,urlResponse:r,postBody:null}}return null}function Gd(){let n=[],e="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let t=0;t<Bd;t++){let i=Math.floor(Math.random()*e.length);n.push(e.charAt(i))}return n.join("")}function tr(){return R(De)}function nr(n){return B("authEvent",n.config.apiKey,n.name)}function qd(n){try{return JSON.parse(n)}catch{return null}}function Kd(n){let e=Jt(n),t=e.link?decodeURIComponent(e.link):void 0,i=Jt(t).link,r=e.deep_link_id?decodeURIComponent(e.deep_link_id):void 0;return Jt(r).link||r||i||t||n}function Jt(n){if(!n?.includes("?"))return{};let[e,...t]=n.split("?");return X(t.join("?"))}var Jd=500,ir=class{constructor(){this._redirectPersistence=z,this._shouldInitProactively=!0,this.eventManagers=new Map,this.originValidationPromises={},this._completeRedirectFn=ye,this._overrideRedirectResult=Le}_initialize(e){return a(this,null,function*(){let t=e._key(),i=this.eventManagers.get(t);return i||(i=new er(e),this.eventManagers.set(t,i),this.attachCallbackListeners(e,i)),i})}_openPopup(e){b(e,"operation-not-supported-in-this-environment")}_openRedirect(e,t,i,r){return a(this,null,function*(){Vd(e);let s=yield this._initialize(e);yield s.initialized(),s.resetRedirect(),Ls(),yield this._originValidation(e);let o=jd(e,i,r);yield zd(e,o);let c=yield Md(e,o,t),d=yield Ud(c);return Fd(e,s,d)})}_isIframeWebStorageSupported(e,t){throw new Error("Method not implemented.")}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=xd(e)),this.originValidationPromises[t]}attachCallbackListeners(e,t){let{universalLinks:i,handleOpenURL:r,BuildInfo:s}=we(),o=setTimeout(()=>a(this,null,function*(){yield Vs(e),t.onEvent(Ws())}),Jd),c=h=>a(this,null,function*(){clearTimeout(o);let f=yield Vs(e),m=null;f&&h?.url&&(m=$d(f,h.url)),t.onEvent(m||Ws())});typeof i<"u"&&typeof i.subscribe=="function"&&i.subscribe(null,c);let d=r,l=`${s.packageName.toLowerCase()}://`;we().handleOpenURL=h=>a(this,null,function*(){if(h.toLowerCase().startsWith(l)&&c({url:h}),typeof d=="function")try{d(h)}catch(f){console.error(f)}})}},Hs=ir;function Ws(){return{type:"unknown",eventId:null,sessionId:null,urlResponse:null,postBody:null,tenantId:null,error:T("no-auth-event")}}function Bs(n,e){_(n)._logFramework(e)}var Xd="@firebase/auth-compat",Qd="0.5.8";var Zd=1e3;function ct(){var n;return((n=self?.location)===null||n===void 0?void 0:n.protocol)||null}function el(){return ct()==="http:"||ct()==="https:"}function $s(n=I()){return!!((ct()==="file:"||ct()==="ionic:"||ct()==="capacitor:")&&n.toLowerCase().match(/iphone|ipad|ipod|android/))}function tl(){return Ue()||cn()}function nl(){return pt()&&document?.documentMode===11}function il(n=I()){return/Edge\/\d+/.test(n)}function rl(n=I()){return nl()||il(n)}function Gs(){try{let n=self.localStorage,e=_e();if(n)return n.setItem(e,"1"),n.removeItem(e),rl()?Te():!0}catch{return dr()&&Te()}return!1}function dr(){return typeof global<"u"&&"WorkerGlobalScope"in global&&"importScripts"in global}function rr(){return(el()||ft()||$s())&&!tl()&&Gs()&&!dr()}function qs(){return $s()&&typeof document<"u"}function sl(){return a(this,null,function*(){return qs()?new Promise(n=>{let e=setTimeout(()=>{n(!1)},Zd);document.addEventListener("deviceready",()=>{clearTimeout(e),n(!0)})}):!1})}function ol(){return typeof window<"u"?window:null}var N={LOCAL:"local",NONE:"none",SESSION:"session"},ot=u,Ks="persistence";function al(n,e){if(ot(Object.values(N).includes(e),n,"invalid-persistence-type"),Ue()){ot(e!==N.SESSION,n,"unsupported-persistence-type");return}if(cn()){ot(e===N.NONE,n,"unsupported-persistence-type");return}if(dr()){ot(e===N.NONE||e===N.LOCAL&&Te(),n,"unsupported-persistence-type");return}ot(e===N.NONE||Gs(),n,"unsupported-persistence-type")}function sr(n){return a(this,null,function*(){yield n._initializationPromise;let e=Js(),t=B(Ks,n.config.apiKey,n.name);e&&e.setItem(t,n._getPersistence())})}function cl(n,e){let t=Js();if(!t)return[];let i=B(Ks,n,e);switch(t.getItem(i)){case N.NONE:return[ne];case N.LOCAL:return[ve,z];case N.SESSION:return[z];default:return[]}}function Js(){var n;try{return((n=ol())===null||n===void 0?void 0:n.sessionStorage)||null}catch{return null}}var dl=u,$=class{constructor(){this.browserResolver=R(Qi),this.cordovaResolver=R(Hs),this.underlyingResolver=null,this._redirectPersistence=z,this._completeRedirectFn=ye,this._overrideRedirectResult=Le}_initialize(e){return a(this,null,function*(){return yield this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._initialize(e)})}_openPopup(e,t,i,r){return a(this,null,function*(){return yield this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openPopup(e,t,i,r)})}_openRedirect(e,t,i,r){return a(this,null,function*(){return yield this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openRedirect(e,t,i,r)})}_isIframeWebStorageSupported(e,t){this.assertedUnderlyingResolver._isIframeWebStorageSupported(e,t)}_originValidation(e){return this.assertedUnderlyingResolver._originValidation(e)}get _shouldInitProactively(){return qs()||this.browserResolver._shouldInitProactively}get assertedUnderlyingResolver(){return dl(this.underlyingResolver,"internal-error"),this.underlyingResolver}selectUnderlyingResolver(){return a(this,null,function*(){if(this.underlyingResolver)return;let e=yield sl();this.underlyingResolver=e?this.cordovaResolver:this.browserResolver})}};function Ys(n){return n.unwrap()}function ll(n){return n.wrapped()}function ul(n){return Xs(n)}function hl(n,e){var t;let i=(t=e.customData)===null||t===void 0?void 0:t._tokenResponse;if(e?.code==="auth/multi-factor-auth-required"){let r=e;r.resolver=new ar(n,Mi(n,e))}else if(i){let r=Xs(e),s=e;r&&(s.credential=r,s.tenantId=i.tenantId||void 0,s.email=i.email||void 0,s.phoneNumber=i.phoneNumber||void 0)}}function Xs(n){let{_tokenResponse:e}=n instanceof A?n.customData:n;if(!e)return null;if(!(n instanceof A)&&"temporaryProof"in e&&"phoneNumber"in e)return Ie.credentialFromResult(n);let t=e.providerId;if(!t||t===me.PASSWORD)return null;let i;switch(t){case me.GOOGLE:i=Vt;break;case me.FACEBOOK:i=Ft;break;case me.GITHUB:i=Wt;break;case me.TWITTER:i=Ht;break;default:let{oauthIdToken:r,oauthAccessToken:s,oauthTokenSecret:o,pendingToken:c,nonce:d}=e;return!s&&!o&&!r&&!c?null:c?t.startsWith("saml.")?he._create(t,c):x._fromParams({providerId:t,signInMethod:t,pendingToken:c,idToken:r,accessToken:s}):new Ce(t).credential({idToken:r,accessToken:s,rawNonce:d})}return n instanceof A?i.credentialFromError(n):i.credentialFromResult(n)}function k(n,e){return e.catch(t=>{throw t instanceof A&&hl(n,t),t}).then(t=>{let i=t.operationType,r=t.user;return{operationType:i,credential:ul(t),additionalUserInfo:Li(t),user:Me.getOrCreate(r)}})}function or(n,e){return a(this,null,function*(){let t=yield e;return{verificationId:t.verificationId,confirm:i=>k(n,t.confirm(i))}})}var ar=class{constructor(e,t){this.resolver=t,this.auth=ll(e)}get session(){return this.resolver.session}get hints(){return this.resolver.hints}resolveSignIn(e){return k(Ys(this.auth),this.resolver.resolveSignIn(e))}};var Me=class n{constructor(e){this._delegate=e,this.multiFactor=xi(e)}static getOrCreate(e){return n.USER_MAP.has(e)||n.USER_MAP.set(e,new n(e)),n.USER_MAP.get(e)}delete(){return this._delegate.delete()}reload(){return this._delegate.reload()}toJSON(){return this._delegate.toJSON()}getIdTokenResult(e){return this._delegate.getIdTokenResult(e)}getIdToken(e){return this._delegate.getIdToken(e)}linkAndRetrieveDataWithCredential(e){return this.linkWithCredential(e)}linkWithCredential(e){return a(this,null,function*(){return k(this.auth,jt(this._delegate,e))})}linkWithPhoneNumber(e,t){return a(this,null,function*(){return or(this.auth,Vi(this._delegate,e,t))})}linkWithPopup(e){return a(this,null,function*(){return k(this.auth,zi(this._delegate,e,$))})}linkWithRedirect(e){return a(this,null,function*(){return yield sr(_(this.auth)),Ji(this._delegate,e,$)})}reauthenticateAndRetrieveDataWithCredential(e){return this.reauthenticateWithCredential(e)}reauthenticateWithCredential(e){return a(this,null,function*(){return k(this.auth,zt(this._delegate,e))})}reauthenticateWithPhoneNumber(e,t){return or(this.auth,Wi(this._delegate,e,t))}reauthenticateWithPopup(e){return k(this.auth,ji(this._delegate,e,$))}reauthenticateWithRedirect(e){return a(this,null,function*(){return yield sr(_(this.auth)),Ki(this._delegate,e,$)})}sendEmailVerification(e){return Ci(this._delegate,e)}unlink(e){return a(this,null,function*(){return yield mi(this._delegate,e),this})}updateEmail(e){return Oi(this._delegate,e)}updatePassword(e){return Di(this._delegate,e)}updatePhoneNumber(e){return Hi(this._delegate,e)}updateProfile(e){return Ni(this._delegate,e)}verifyBeforeUpdateEmail(e,t){return ki(this._delegate,e,t)}get emailVerified(){return this._delegate.emailVerified}get isAnonymous(){return this._delegate.isAnonymous}get metadata(){return this._delegate.metadata}get phoneNumber(){return this._delegate.phoneNumber}get providerData(){return this._delegate.providerData}get refreshToken(){return this._delegate.refreshToken}get tenantId(){return this._delegate.tenantId}get displayName(){return this._delegate.displayName}get email(){return this._delegate.email}get photoURL(){return this._delegate.photoURL}get providerId(){return this._delegate.providerId}get uid(){return this._delegate.uid}get auth(){return this._delegate.auth}};Me.USER_MAP=new WeakMap;var at=u,js=(()=>{class n{constructor(t,i){if(this.app=t,i.isInitialized()){this._delegate=i.getImmediate(),this.linkUnderlyingAuth();return}let{apiKey:r}=t.options;at(r,"invalid-api-key",{appName:t.name}),at(r,"invalid-api-key",{appName:t.name});let s=typeof window<"u"?$:void 0;this._delegate=i.initialize({options:{persistence:fl(r,t.name),popupRedirectResolver:s}}),this._delegate._updateErrorMap(si),this.linkUnderlyingAuth()}get emulatorConfig(){return this._delegate.emulatorConfig}get currentUser(){return this._delegate.currentUser?Me.getOrCreate(this._delegate.currentUser):null}get languageCode(){return this._delegate.languageCode}set languageCode(t){this._delegate.languageCode=t}get settings(){return this._delegate.settings}get tenantId(){return this._delegate.tenantId}set tenantId(t){this._delegate.tenantId=t}useDeviceLanguage(){this._delegate.useDeviceLanguage()}signOut(){return this._delegate.signOut()}useEmulator(t,i){fi(this._delegate,t,i)}applyActionCode(t){return yi(this._delegate,t)}checkActionCode(t){return Gt(this._delegate,t)}confirmPasswordReset(t,i){return Ei(this._delegate,t,i)}createUserWithEmailAndPassword(t,i){return a(this,null,function*(){return k(this._delegate,Ti(this._delegate,t,i))})}fetchProvidersForEmail(t){return this.fetchSignInMethodsForEmail(t)}fetchSignInMethodsForEmail(t){return Pi(this._delegate,t)}isSignInWithEmailLink(t){return Si(this._delegate,t)}getRedirectResult(){return a(this,null,function*(){at(rr(),this._delegate,"operation-not-supported-in-this-environment");let t=yield Yi(this._delegate,$);return t?k(this._delegate,Promise.resolve(t)):{credential:null,user:null}})}addFrameworkForLogging(t){Bs(this._delegate,t)}onAuthStateChanged(t,i,r){let{next:s,error:o,complete:c}=zs(t,i,r);return this._delegate.onAuthStateChanged(s,o,c)}onIdTokenChanged(t,i,r){let{next:s,error:o,complete:c}=zs(t,i,r);return this._delegate.onIdTokenChanged(s,o,c)}sendSignInLinkToEmail(t,i){return Ai(this._delegate,t,i)}sendPasswordResetEmail(t,i){return Ii(this._delegate,t,i||void 0)}setPersistence(t){return a(this,null,function*(){al(this._delegate,t);let i;switch(t){case N.SESSION:i=z;break;case N.LOCAL:i=(yield R(ve)._isAvailable())?ve:De;break;case N.NONE:i=ne;break;default:return b("argument-error",{appName:this._delegate.name})}return this._delegate.setPersistence(i)})}signInAndRetrieveDataWithCredential(t){return this.signInWithCredential(t)}signInAnonymously(){return k(this._delegate,pi(this._delegate))}signInWithCredential(t){return k(this._delegate,Oe(this._delegate,t))}signInWithCustomToken(t){return k(this._delegate,_i(this._delegate,t))}signInWithEmailAndPassword(t,i){return k(this._delegate,bi(this._delegate,t,i))}signInWithEmailLink(t,i){return k(this._delegate,Ri(this._delegate,t,i))}signInWithPhoneNumber(t,i){return or(this._delegate,Fi(this._delegate,t,i))}signInWithPopup(t){return a(this,null,function*(){return at(rr(),this._delegate,"operation-not-supported-in-this-environment"),k(this._delegate,Bi(this._delegate,t,$))})}signInWithRedirect(t){return a(this,null,function*(){return at(rr(),this._delegate,"operation-not-supported-in-this-environment"),yield sr(this._delegate),qi(this._delegate,t,$)})}updateCurrentUser(t){return this._delegate.updateCurrentUser(t)}verifyPasswordResetCode(t){return wi(this._delegate,t)}unwrap(){return this._delegate}_delete(){return this._delegate._delete()}linkUnderlyingAuth(){this._delegate.wrapped=()=>this}}return n.Persistence=N,n})();function zs(n,e,t){let i=n;typeof n!="function"&&({next:i,error:e,complete:t}=n);let r=i;return{next:o=>r(o&&Me.getOrCreate(o)),error:e,complete:t}}function fl(n,e){let t=cl(n,e);if(typeof self<"u"&&!t.includes(ve)&&t.push(ve),typeof window<"u")for(let i of[De,z])t.includes(i)||t.push(i);return t.includes(ne)||t.push(ne),t}var dt=class{constructor(){this.providerId="phone",this._delegate=new Ie(Ys(yt.auth()))}static credential(e,t){return Ie.credential(e,t)}verifyPhoneNumber(e,t){return this._delegate.verifyPhoneNumber(e,t)}unwrap(){return this._delegate}};dt.PHONE_SIGN_IN_METHOD=Ie.PHONE_SIGN_IN_METHOD;dt.PROVIDER_ID=Ie.PROVIDER_ID;var pl=u,cr=class{constructor(e,t,i=yt.app()){var r;pl((r=i.options)===null||r===void 0?void 0:r.apiKey,"invalid-api-key",{appName:i.name}),this._delegate=new Ze(i.auth(),e,t),this.type=this._delegate.type}clear(){this._delegate.clear()}render(){return this._delegate.render()}verify(){return this._delegate.verify()}};var ml="auth-compat";function gl(n){n.INTERNAL.registerComponent(new C(ml,e=>{let t=e.getProvider("app-compat").getImmediate(),i=e.getProvider("auth");return new js(t,i)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:re.EMAIL_SIGNIN,PASSWORD_RESET:re.PASSWORD_RESET,RECOVER_EMAIL:re.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:re.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:re.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:re.VERIFY_EMAIL}},EmailAuthProvider:st,FacebookAuthProvider:Ft,GithubAuthProvider:Wt,GoogleAuthProvider:Vt,OAuthProvider:Ce,SAMLAuthProvider:Qe,PhoneAuthProvider:dt,PhoneMultiFactorGenerator:Zi,RecaptchaVerifier:cr,TwitterAuthProvider:Ht,Auth:js,AuthCredential:j,Error:A}).setInstantiationMode("LAZY").setMultipleInstances(!1)),n.registerVersion(Xd,Qd)}gl(yt);export{Er as a,ut as b,Te as c,O as d,C as e,Q as f,G as g,sa as h,L as i,Vt as j,yt as k};
@@ -0,0 +1 @@
1
+ import{a as ue}from"./chunk-662E5VTA.js";import{e as _e}from"./chunk-AL67KXJV.js";import{b as fe,g as be}from"./chunk-OHTJCLX7.js";import{b as te,e as y}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{c as ne,h as ie,i as oe,j as re,k as ae,l as se,o as de,p as ce,q as le,r as pe,u as me}from"./chunk-SP6QPE3M.js";import{a as M,c as ge,d as he,f as xe}from"./chunk-6F6NSBIF.js";import{$ as R,$a as U,Ab as a,Bb as C,Cb as B,Db as Y,Eb as I,Fb as L,Gb as T,Ha as w,Ia as c,Ja as p,Lb as G,Q as F,Rb as Q,Sb as K,Ub as $,Vc as S,Wa as f,Xc as v,Ya as m,_c as j,aa as A,fb as i,gb as r,ha as x,hb as l,ia as N,ib as k,ic as J,jb as E,kc as D,lb as z,lc as X,ob as u,oc as Z,pa as b,qa as _,qb as g,sc as ee,wb as W,xb as q,yb as H,zb as P}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var ve=(()=>{let t=class t{constructor(n,e,s){this.route=n,this.http=e,this.service=s}ngOnInit(){this.route.queryParams.subscribe(n=>{this.code=n.code})}addChannelLazada(){let n={Code:this.code};this.http.post("/api/ChannelAdd/AddLazada",n).subscribe(e=>{this.service.navigate(["/menu/channel"])})}};t.\u0275fac=function(e){return new(e||t)(p(S),p(y),p(v))},t.\u0275cmp=x({type:t,selectors:[["app-lazada"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,s){e&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"i",5),i(6,"div",6),a(7,"Success !"),r()(),i(8,"div",7)(9,"div"),a(10,"You have successfully authorized "),r(),i(11,"div"),a(12,"DEALPOS to manage your Lazada"),r(),i(13,"div"),a(14," Your Code is "),i(15,"span",8),a(16),r()(),i(17,"button",9),u("click",function(){return s.addChannelLazada()}),l(18,"i",10),a(19," Add to my Channel"),r()()()()()()),e&2&&(c(16),C(s.code))}});let o=t;return o})();var we=(()=>{let t=class t{constructor(){}getBrowserName(){let n=window.navigator.userAgent.toLowerCase();switch(!0){case(n.indexOf("edge")>-1||n.indexOf("edg")>-1):return"edge";case n.indexOf("opr")>-1:return"opera";case n.indexOf("chrome")>-1:return"chrome";case n.indexOf("trident")>-1:return"ie";case n.indexOf("firefox")>-1:return"firefox";case n.indexOf("safari")>-1:return"safari";default:return"other"}}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"});let o=t;return o})();function Le(o,t){if(o&1&&(i(0,"swiper-slide")(1,"div")(2,"a",2),l(3,"img",3),r()(),i(4,"a",4),a(5),r(),i(6,"p",5),a(7),r()()),o&2){let d=t.$implicit;c(2),m("href",d.href,w),c(),m("src",d.imgSrc,w),c(),m("href",d.href,w),c(),C(d.title),c(2),C(d.description)}}var Me=(()=>{let t=class t{constructor(){this.newsList=[]}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=x({type:t,selectors:[["POS-news-swiper"]],inputs:{newsList:"newsList"},decls:2,vars:1,consts:[["pagination","true","pagination-clickable","true","autoplay-delay","5000","autoplay-disable-on-interaction","false",2,"margin-top","30px"],[4,"ngFor","ngForOf"],["target","_blank",3,"href"],[1,"border-0","rounded-1","mb-8",2,"width","252px","height","152px",3,"src"],["target","_blank",1,"fw-bold","h5","text-success","header-title","fs-4",3,"href"],[2,"margin-bottom","3rem"]],template:function(e,s){e&1&&(i(0,"swiper-container",0),f(1,Le,8,5,"swiper-slide",1),r()),e&2&&(c(),m("ngForOf",s.newsList))},dependencies:[D],styles:["swiper-container[_ngcontent-%COMP%]{--swiper-pagination-bullet-inactive-color: #89b03e;--swiper-pagination-color: #89b03e}"]});let o=t;return o})();var Ae=["subdomainEl"],Ne=(o,t)=>({"rounded-end":o,"border-end-0":t});function ze(o,t){if(o&1&&(k(0),i(1,"div",36),l(2,"img",37),r(),E()),o&2){let d=t.$implicit;c(2),m("src",d.img,w)("title",d.title)("alt",d.title)}}function De(o,t){if(o&1){let d=z();k(0),i(1,"div",17)(2,"h3",18),a(3," DealPOS Omnichannel "),r(),i(4,"small",19),a(5," Multichannel Inventory Management Software "),r()(),i(6,"form",20)(7,"div",21)(8,"div",22)(9,"div",23)(10,"span"),l(11,"i",24),r()(),i(12,"input",25,1),T("ngModelChange",function(e){b(d);let s=g();return L(s.subdomain,e)||(s.subdomain=e),_(e)}),r(),i(14,"div")(15,"select",26),T("ngModelChange",function(e){b(d);let s=g();return L(s.domain,e)||(s.domain=e),_(e)}),i(16,"option",27),a(17,".dealpos.co.id"),r(),i(18,"option",28),a(19,".dealpos.net"),r(),i(20,"option",29),a(21,".dealpos.com"),r(),i(22,"option",30),a(23,".dealpos.app"),r()()()(),i(24,"div",31)(25,"button",32),u("click",function(){b(d);let e=g();return _(e.onNextState())}),a(26," Next "),r()(),i(27,"div",33)(28,"div",34),f(29,ze,3,3,"ng-container",35),r()()()(),E()}if(o&2){let d=g();c(12),I("ngModel",d.subdomain),c(3),I("ngModel",d.domain),c(14),m("ngForOf",d.channels)}}function je(o,t){o&1&&(i(0,"p"),a(1," Username is required "),r())}function Ve(o,t){if(o&1&&(k(0),i(1,"div",57),l(2,"div",58),i(3,"div",59),f(4,je,2,0,"p",47),r()(),E()),o&2){g();let d=P(14);c(4),m("ngIf",d.errors.required)}}function Fe(o,t){if(o&1){let d=z();i(0,"i",62),u("click",function(){b(d);let e=g(3);return _(e.hideShowPassword())}),r()}if(o&2){let d=g(3);U("fa "+d.passwordIcon)}}function Re(o,t){if(o&1&&(i(0,"span",60),f(1,Fe,1,2,"i",61),r()),o&2){let d=g(2);c(),m("ngIf",d.password)}}function Ue(o,t){o&1&&(i(0,"p"),a(1," Password is required "),r())}function We(o,t){if(o&1&&(k(0),i(1,"div",57),l(2,"div",58),i(3,"div",59),f(4,Ue,2,0,"p",47),r()(),E()),o&2){g();let d=P(21);c(4),m("ngIf",d.errors.required)}}function qe(o,t){if(o&1){let d=z();i(0,"div",38)(1,"h3",39),a(2,"Sign in"),r(),i(3,"h3",40),a(4," to "),i(5,"h6",41),a(6),r(),i(7,"i",42),u("click",function(){b(d);let e=g();return _(e.onEditDomain())}),r()()(),i(8,"form",43)(9,"div",44)(10,"div",23)(11,"span"),l(12,"i",45),r()(),i(13,"input",46,2),T("ngModelChange",function(e){b(d);let s=g();return L(s.username,e)||(s.username=e),_(e)}),r()(),f(15,Ve,5,1,"ng-container",47),i(16,"div",22)(17,"div",23)(18,"span"),l(19,"i",48),r()(),i(20,"input",49,3),T("ngModelChange",function(e){b(d);let s=g();return L(s.password,e)||(s.password=e),_(e)}),r(),f(22,Re,2,1,"span",50),r(),f(23,We,5,1,"ng-container",47),i(24,"div",51)(25,"button",52),u("click",function(){b(d);let e=g();return _(e.onLogin())}),a(26," Log in "),r()(),i(27,"div",53),l(28,"hr"),i(29,"span",54),a(30,"or"),r(),l(31,"hr"),r(),i(32,"div")(33,"button",55),u("click",function(e){b(d);let s=g();return _(s.onLoginByGoogle(e))}),l(34,"i",56),a(35," Sign In with Google "),r()()()}if(o&2){let d=P(14),n=P(21),e=g();c(6),Y(" (",e.subdomain,"",e.domain,") "),c(7),I("ngModel",e.username),c(2),m("ngIf",d.invalid&&(d.dirty||d.touched)),c(5),m("type",e.passwordType)("ngClass",G(9,Ne,e.browser=="edge",e.browser!="edge")),I("ngModel",e.password),c(2),m("ngIf",e.browser!="edge"),c(),m("ngIf",n.invalid&&(n.dirty||n.touched))}}var Oe=(()=>{let t=class t{constructor(n,e,s,h,ke){this._router=n,this.toastr=e,this.checkBrowser=s,this.authService=h,this.ngxPermission=ke,this.domain=".dealpos.co.id",this.loginState="FORM_DOMAIN",this.passwordType="password",this.passwordIcon="fa-eye",this.channels=[{title:"Shopee",img:M.SHOOPE},{title:"Tokopedia",img:M.TOKOPEDIA},{title:"Tiktok",img:M.TIKTOK},{title:"Woocommerce",img:M.WOOCOMMERCE},{title:"Lazada",img:M.LAZADA},{title:"Shopify",img:M.SHOPIFY}],this.version=fe.version,this.news$=h.getNews().pipe(F(1))}ngOnInit(){this.initLogin(),this.browser=this.checkBrowser.getBrowserName(),document.body.classList.add("login-body"),this.initChangeLogUrl()}initChangeLogUrl(){let n=`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${this.version}`;this.changelogUrl=n}ngAfterViewInit(){this.setAutoFocusDomain()}initLogin(){let n=JSON.parse(localStorage.getItem("Authorization"));if(n){this.username=n?.username,this.subdomain=n?.Host?.split(".")[0];let e=n?.Host?.split("dealpos");this.domain=`.dealpos${e[1]}`,this.authService.isActiveToken()&&this._router.navigate(["menu"])}}onNextState(){if(ge.IsEmpty(this.subdomain)){this.toastr.warning("Account Domain is required","Warning");return}this.parseSubdomain(),this.loginState="FORM_AUTH"}parseSubdomain(){let n=this.subdomain.indexOf(".dealpos");n!=-1&&(this.subdomain=this.subdomain.substring(0,n))}onEditDomain(){this.loginState="FORM_DOMAIN"}onLogin(){let n={Host:`${this.subdomain}${this.domain}`,Username:this.username,Password:this.password};this.authService.login(n).subscribe(e=>{this.onSuccessLogin(e)})}onLoginByGoogle(n){let e=`${this.subdomain}${this.domain}`;this.authService.loginWithGoogle(n,e).subscribe(s=>{this.onSuccessLogin(s)})}onSuccessLogin(n){this.ngxPermission.hasPermission([ue.dashboardView]).then(e=>{e?this._router.navigate(["menu/dashboard"]):n?.TotalChannel<1?this._router.navigate(["menu/channel"]):this._router.navigate(["menu/products"])})}setAutoFocusDomain(){this.subdomainEl.nativeElement.focus()}hideShowPassword(){this.passwordType=this.passwordType==="text"?"password":"text",this.passwordIcon=this.passwordIcon==="fa-eye"?"fa-eye-slash":"fa-eye"}ngOnDestroy(){document.body.classList.remove("login-body")}};t.\u0275fac=function(e){return new(e||t)(p(v),p(te),p(we),p(be),p(he))},t.\u0275cmp=x({type:t,selectors:[["app-login"]],viewQuery:function(e,s){if(e&1&&W(Ae,5),e&2){let h;q(h=H())&&(s.subdomainEl=h.first)}},decls:19,vars:7,consts:[["USERNAME_PASSWORD",""],["subdomainEl",""],["usernameCtrl","ngModel"],["passwordCtrl","ngModel"],[1,"container-fluid"],[1,"row","mx-auto","bg-white","login-pane"],[1,"col-md-5","order-md-first","order-last","border-end","features-pane","pt-12","pb-9"],[1,"fw-normal","fs-2","header-title","text-center"],[3,"newsList"],[1,"col-md-7","order-md-last","order-first","py-12","sign-in-pane"],[4,"ngIf","ngIfElse"],[1,"d-flex","copyright",2,"margin-left","20px"],[1,"align-self-center","me-5"],["target","_blank","href","http://www.dealpos.com"],[1,"version",2,"margin-right","18px"],["target","_blank",1,"text-dark","fst-italic",3,"href"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],[1,"text-md-start","text-center"],[1,"fs-2","header-title","me-2","fw-normal"],[1,"text-secondary-emphasis","fst-italic",2,"font-size","11px"],[2,"margin-top","38px"],[1,"form-block","mt-5"],[1,"input-group","input-group-lg","mt-8"],[1,"input-group-text","rounded-start","border-end-0",2,"width","52px"],[1,"fa-solid","fa-cloud"],["placeholder","Store Address","aria-label","Store Address","aria-describedby","basic-addon1","autofocus","","name","Store Address",1,"form-control","form-control-lg","rounded-end-0","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","ngModel"],["name","domainOption",1,"form-select","form-control","form-control-lg","border-start-0","border-start","rounded-end","rounded-start-0","domain-option",2,"height","58px",3,"ngModelChange","ngModel"],["selected","","value",".dealpos.co.id"],["value",".dealpos.net"],["value",".dealpos.com"],["value",".dealpos.app"],[1,"w-100",2,"margin-top","1.8rem"],["name","next","data-cy","next","type","submit",1,"btn","btn-xl","btn-success","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"d-flex","align-items-center","justify-content-center",2,"margin-top","2.1rem"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[4,"ngFor","ngForOf"],[1,""],[1,"border-0",2,"width","34px","height","34px",3,"src","title","alt"],[1,"d-flex","align-items-center","justify-content-start","mb-2"],[1,"robotoslab","fw-normal"],[1,"ms-2","fw-normal"],[1,"me-2","robotoslab","d-inline-block","text-success"],["title","Edit Store Address",1,"fa-solid","fa-edit","link-success","fs-5","pointer",3,"click"],[2,"margin-top","29px"],[1,"input-group","input-group-lg"],[1,"fas","fa-user","fa-lg"],["id","txtUsername","type","text","data-cy","username","required","","placeholder","Username","aria-label","Username","aria-describedby","basic-addon1","autofocus","","name","username",1,"form-control","form-control-lg","rounded-end","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"fas","fa-key","fa-lg"],["id","txtPassword","data-cy","password","placeholder","Password","aria-label","Password","aria-describedby","basic-addon1","autofocus","","name","password","required","",1,"form-control","form-control-lg","rounded-end","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","type","ngClass","ngModel"],["class","input-group-text border-start-0 rounded-end",4,"ngIf"],[1,"w-100","mt-8"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-success","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"divider","d-flex","align-items-center","justify-content-center"],[1,"mx-4","text-muted"],[1,"btn","btn-social-login","text-success","w-100","fw-bold",3,"click"],[1,"fa-brands","fa-google"],[1,"d-flex","justify-content-start","w-50","mb-4",2,"height","16px"],[2,"width","52px"],[1,"text-danger","ps-1"],[1,"input-group-text","border-start-0","rounded-end"],[3,"class","click",4,"ngIf"],[3,"click"]],template:function(e,s){if(e&1&&(i(0,"div",4)(1,"div",5)(2,"div",6)(3,"h3",7),a(4,"New Features"),r(),l(5,"POS-news-swiper",8),Q(6,"async"),r(),i(7,"div",9),f(8,De,30,3,"ng-container",10)(9,qe,36,12,"ng-template",null,0,$),r()(),i(11,"div",11)(12,"span",12),a(13,"powered by :"),r(),l(14,"a",13),r(),i(15,"div",14)(16,"a",15),a(17),l(18,"i",16),r()()()),e&2){let h=P(10);c(5),m("newsList",K(6,5,s.news$)),c(3),m("ngIf",s.loginState=="FORM_DOMAIN")("ngIfElse",h),c(8),m("href",s.changelogUrl,w),c(),B("version ",s.version,"")}},dependencies:[J,D,X,se,ce,le,ne,de,ie,oe,pe,ae,re,Me,Z],styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media (max-width: 768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width: 1300px) and (min-width: 1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media (max-width: 820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media (max-width: 768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media (min-width: 1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media (max-width: 768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media (min-width: 1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media (max-width: 768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}"]});let o=t;return o})();var Pe=(()=>{let t=class t{constructor(n,e,s){this.route=n,this.http=e,this.service=s}ngOnInit(){this.route.queryParams.subscribe(n=>{this.shopID=n.shop_id,this.code=n.code})}addShopee(){let n={ShopID:Number(this.shopID),Code:this.code};this.http.post("/api/ChannelAdd/ShopeeV2",n).subscribe(s=>{this.service.navigate(["/menu/channel"])})}};t.\u0275fac=function(e){return new(e||t)(p(S),p(y),p(v))},t.\u0275cmp=x({type:t,selectors:[["shopee-authorized"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-t",3,"click"],[1,"fas","fa-undo"]],template:function(e,s){e&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"i",5),i(6,"div",6),a(7,"Success !"),r()(),i(8,"div",7)(9,"div"),a(10,"You have successfully authorized "),r(),i(11,"div"),a(12,"DEALPOS to manage your Shopee"),r(),i(13,"div"),a(14," Your shopID is "),i(15,"span",8),a(16),r()(),i(17,"button",9),u("click",function(){return s.addShopee()}),l(18,"i",10),a(19," Add to my Channel"),r()()()()()()),e&2&&(c(16),C(s.shopID))},styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media (max-width: 768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width: 1300px) and (min-width: 1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media (max-width: 820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media (max-width: 768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media (min-width: 1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media (max-width: 768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media (min-width: 1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media (max-width: 768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});let o=t;return o})();var ye=(()=>{let t=class t{constructor(n,e,s){this.route=n,this.http=e,this.service=s}ngOnInit(){this.route.queryParams.subscribe(n=>{this.code=n.code,this.state=n.state})}addChannelTiktok(){let n={Code:this.code};this.http.post("/api/ChannelAdd/AddTiktok",n).subscribe(e=>{this.service.navigate(["/menu/channel"])})}};t.\u0275fac=function(e){return new(e||t)(p(S),p(y),p(v))},t.\u0275cmp=x({type:t,selectors:[["app-tiktok"]],decls:24,vars:2,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,s){e&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"i",5),i(6,"div",6),a(7,"Success !"),r()(),i(8,"div",7)(9,"div"),a(10,"You have successfully authorized "),r(),i(11,"div"),a(12,"DEALPOS to manage your Tiktok"),r(),i(13,"div"),a(14," Your Code is "),i(15,"span",8),a(16),r()(),i(17,"div"),a(18," Your State is "),i(19,"span",8),a(20),r()(),i(21,"button",9),u("click",function(){return s.addChannelTiktok()}),l(22,"i",10),a(23," Add to my Channel"),r()()()()()()),e&2&&(c(16),C(s.code),c(4),C(s.state))},styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media (max-width: 768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width: 1300px) and (min-width: 1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media (max-width: 820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media (max-width: 768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media (min-width: 1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media (max-width: 768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media (min-width: 1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media (max-width: 768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});let o=t;return o})();var He=[{path:"",component:Oe,data:{title:"Dealpos x Marketplace"}},{path:"shopee",component:Pe,data:{title:"Success"}},{path:"tiktok",component:ye,data:{title:"Success"}},{path:"lazada",component:ve,data:{title:"Success"}}],Se=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=N({type:t}),t.\u0275inj=A({imports:[j.forChild(He),j]});let o=t;return o})();var yt=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=N({type:t}),t.\u0275inj=A({imports:[ee,me,Se,_e,xe]});let o=t;return o})();export{yt as LoginModule};
@@ -0,0 +1 @@
1
+ import{$ as w,$a as f,Ab as g,Cb as y,E as ut,Ec as Ct,Fa as ft,Ga as $,Hc as bt,Ia as a,Ib as K,Ic as X,Ja as b,Lc as S,Mc as B,Na as vt,Oc as tt,Qa as U,Wa as A,Xa as H,Ya as l,Za as M,Zb as N,aa as ht,b as lt,ba as dt,c as C,ca as m,da as x,fb as d,gb as v,gc as Q,ha as Z,hb as E,ia as pt,ib as Y,j as ct,jb as q,la as mt,lb as J,lc as W,nb as gt,ob as R,p as z,pa as L,qa as G,qb as c,va as j,wc as Tt,xc as _t}from"./chunk-6DRNAUKE.js";import{a as u,b as I}from"./chunk-GRMIXZTT.js";var yt=["toast-component",""];function Ot(s,n){if(s&1){let e=J();d(0,"button",5),R("click",function(){L(e);let i=c();return G(i.remove())}),d(1,"span",6),g(2,"\xD7"),v()()}}function Dt(s,n){if(s&1&&(Y(0),g(1),q()),s&2){let e=c(2);a(),y("[",e.duplicatesCount+1,"]")}}function At(s,n){if(s&1&&(d(0,"div"),g(1),A(2,Dt,2,1,"ng-container",4),v()),s&2){let e=c();f(e.options.titleClass),H("aria-label",e.title),a(),y(" ",e.title," "),a(),l("ngIf",e.duplicatesCount)}}function Ht(s,n){if(s&1&&E(0,"div",7),s&2){let e=c();f(e.options.messageClass),l("innerHTML",e.message,$)}}function Mt(s,n){if(s&1&&(d(0,"div",8),g(1),v()),s&2){let e=c();f(e.options.messageClass),H("aria-label",e.message),a(),y(" ",e.message," ")}}function Et(s,n){if(s&1&&(d(0,"div"),E(1,"div",9),v()),s&2){let e=c();a(),M("width",e.width+"%")}}function Rt(s,n){if(s&1){let e=J();d(0,"button",5),R("click",function(){L(e);let i=c();return G(i.remove())}),d(1,"span",6),g(2,"\xD7"),v()()}}function jt(s,n){if(s&1&&(Y(0),g(1),q()),s&2){let e=c(2);a(),y("[",e.duplicatesCount+1,"]")}}function Nt(s,n){if(s&1&&(d(0,"div"),g(1),A(2,jt,2,1,"ng-container",4),v()),s&2){let e=c();f(e.options.titleClass),H("aria-label",e.title),a(),y(" ",e.title," "),a(),l("ngIf",e.duplicatesCount)}}function St(s,n){if(s&1&&E(0,"div",7),s&2){let e=c();f(e.options.messageClass),l("innerHTML",e.message,$)}}function Bt(s,n){if(s&1&&(d(0,"div",8),g(1),v()),s&2){let e=c();f(e.options.messageClass),H("aria-label",e.message),a(),y(" ",e.message," ")}}function Ft(s,n){if(s&1&&(d(0,"div"),E(1,"div",9),v()),s&2){let e=c();a(),M("width",e.width+"%")}}var et=class{_attachedHost;component;viewContainerRef;injector;constructor(n,e){this.component=n,this.injector=e}attach(n,e){return this._attachedHost=n,n.attach(this,e)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},it=class{_attachedPortal;_disposeFn;attach(n,e){return this._attachedPortal=n,this.attachComponentPortal(n,e)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},st=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new C;_activate=new C;_manualClose=new C;_resetTimeout=new C;_countDuplicate=new C;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(n,e){n&&this._resetTimeout.next(),e&&this._countDuplicate.next(++this.duplicatesCount)}},O=class{toastId;config;message;title;toastType;toastRef;_onTap=new C;_onAction=new C;constructor(n,e,t,i,o,r){this.toastId=n,this.config=e,this.message=t,this.title=i,this.toastType=o,this.toastRef=r,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},It={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},wt=new dt("ToastConfig"),nt=class extends it{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,e,t){super(),this._hostDomElement=n,this._componentFactoryResolver=e,this._appRef=t}attachComponentPortal(n,e){let t=this._componentFactoryResolver.resolveComponentFactory(n.component),i;return i=t.create(n.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),e?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},kt=(()=>{class s{_document=x(Q);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e=this._document.createElement("div");e.classList.add("overlay-container"),e.setAttribute("aria-live","polite"),this._document.body.appendChild(e),this._containerElement=e}static \u0275fac=function(t){return new(t||s)};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),ot=class{_portalHost;constructor(n){this._portalHost=n}attach(n,e=!0){return this._portalHost.attach(n,e)}detach(){return this._portalHost.detach()}},Pt=(()=>{class s{_overlayContainer=x(kt);_componentFactoryResolver=x(vt);_appRef=x(N);_document=x(Q);_paneElements=new Map;create(e,t){return this._createOverlayRef(this.getPaneElement(e,t))}getPaneElement(e="",t){return this._paneElements.get(t)||this._paneElements.set(t,{}),this._paneElements.get(t)[e]||(this._paneElements.get(t)[e]=this._createPaneElement(e,t)),this._paneElements.get(t)[e]}_createPaneElement(e,t){let i=this._document.createElement("div");return i.id="toast-container",i.classList.add(e),i.classList.add("toast-container"),t?t.getContainerElement().appendChild(i):this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalHost(e){return new nt(e,this._componentFactoryResolver,this._appRef)}_createOverlayRef(e){return new ot(this._createPortalHost(e))}static \u0275fac=function(t){return new(t||s)};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),F=(()=>{class s{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(e,t,i,o,r){this.overlay=t,this._injector=i,this.sanitizer=o,this.ngZone=r,this.toastrConfig=u(u({},e.default),e.config),e.config.iconClasses&&(this.toastrConfig.iconClasses=u(u({},e.default.iconClasses),e.config.iconClasses))}show(e,t,i={},o=""){return this._preBuildNotification(o,e,t,this.applyConfig(i))}success(e,t,i={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}error(e,t,i={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}info(e,t,i={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}warning(e,t,i={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}clear(e){for(let t of this.toasts)if(e!==void 0){if(t.toastId===e){t.toastRef.manualClose();return}}else t.toastRef.manualClose()}remove(e){let t=this._findToast(e);if(!t||(t.activeToast.toastRef.close(),this.toasts.splice(t.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let i=this.toasts[this.currentlyActive].toastRef;i.isInactive()||(this.currentlyActive=this.currentlyActive+1,i.activate())}return!0}findDuplicate(e="",t="",i,o){let{includeTitleDuplicates:r}=this.toastrConfig;for(let p of this.toasts){let T=r&&p.title===e;if((!r||T)&&p.message===t)return p.toastRef.onDuplicate(i,o),p}return null}applyConfig(e={}){return u(u({},this.toastrConfig),e)}_findToast(e){for(let t=0;t<this.toasts.length;t++)if(this.toasts[t].toastId===e)return{index:t,activeToast:this.toasts[t]};return null}_preBuildNotification(e,t,i,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(e,t,i,o)):this._buildNotification(e,t,i,o)}_buildNotification(e,t,i,o){if(!o.toastComponent)throw new Error("toastComponent required");let r=this.findDuplicate(i,t,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&i||t)&&this.toastrConfig.preventDuplicates&&r!==null)return r;this.previousToastMessage=t;let p=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(p=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let T=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let h=t;t&&o.enableHtml&&(h=this.sanitizer.sanitize(ft.HTML,t));let _=new st(T),D=new O(this.index,o,h,i,e,_),k=[{provide:O,useValue:D}],at=j.create({providers:k,parent:this._injector}),P=new et(o.toastComponent,at),rt=T.attach(P,o.newestOnTop);_.componentInstance=rt.instance;let V={toastId:this.index,title:i||"",message:t||"",toastRef:_,onShown:_.afterActivate(),onHidden:_.afterClosed(),onTap:D.onTap(),onAction:D.onAction(),portal:rt};return p||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{V.toastRef.activate()})),this.toasts.push(V),V}static \u0275fac=function(t){return new(t||s)(m(wt),m(Pt),m(j),m(Ct),m(U))};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),Vt=(()=>{class s{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=-1;toastClasses="";state;get displayStyle(){if(this.state.value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.ngZone=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}}}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state=I(u({},this.state),{value:"active"}),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width===0||this.width===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width=t/this.options.timeOut*100,this.options.progressAnimation==="increasing"&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=I(u({},this.state),{value:"active"}),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state.value!=="removed"&&(clearTimeout(this.timeout),this.state=I(u({},this.state),{value:"removed"}),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state.value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state.value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state.value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(e),t)):this.timeout=setTimeout(()=>e(),t)}outsideInterval(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(e),t)):this.intervalId=setInterval(()=>e(),t)}runInsideAngular(e){this.ngZone?this.ngZone.run(()=>e()):e()}static \u0275fac=function(t){return new(t||s)(b(F),b(O),b(U))};static \u0275cmp=Z({type:s,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(t,i){t&1&&R("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(gt("@flyInOut",i.state),f(i.toastClasses),M("display",i.displayStyle))},standalone:!0,features:[K],attrs:yt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&A(0,Ot,3,0,"button",0)(1,At,3,5,"div",1)(2,Ht,1,3,"div",2)(3,Mt,2,4,"div",3)(4,Et,2,2,"div",4),t&2&&(l("ngIf",i.options.closeButton),a(),l("ngIf",i.title),a(),l("ngIf",i.message&&i.options.enableHtml),a(),l("ngIf",i.message&&!i.options.enableHtml),a(),l("ngIf",i.options.progressBar))},dependencies:[W],encapsulation:2,data:{animation:[bt("flyInOut",[B("inactive",S({opacity:0})),B("active",S({opacity:1})),B("removed",S({opacity:0})),tt("inactive => active",X("{{ easeTime }}ms {{ easing }}")),tt("active => removed",X("{{ easeTime }}ms {{ easing }}"))])]}})}return s})(),zt=I(u({},It),{toastComponent:Vt}),Zt=(s={})=>mt([{provide:wt,useValue:{default:zt,config:s}}]),oe=(()=>{class s{static forRoot(e={}){return{ngModule:s,providers:[Zt(e)]}}static \u0275fac=function(t){return new(t||s)};static \u0275mod=pt({type:s});static \u0275inj=ht({})}return s})();var Lt=(()=>{class s{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=-1;toastClasses="";get displayStyle(){return this.state==="inactive"?"none":null}state="inactive";timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.appRef=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state="active",!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width===0||this.width===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width=t/this.options.timeOut*100,this.options.progressAnimation==="increasing"&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state="active",this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state!=="removed"&&(clearTimeout(this.timeout),this.state="removed",this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(t){return new(t||s)(b(F),b(O),b(N))};static \u0275cmp=Z({type:s,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(t,i){t&1&&R("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(f(i.toastClasses),M("display",i.displayStyle))},standalone:!0,features:[K],attrs:yt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&A(0,Rt,3,0,"button",0)(1,Nt,3,5,"div",1)(2,St,1,3,"div",2)(3,Bt,2,4,"div",3)(4,Ft,2,2,"div",4),t&2&&(l("ngIf",i.options.closeButton),a(),l("ngIf",i.title),a(),l("ngIf",i.message&&i.options.enableHtml),a(),l("ngIf",i.message&&!i.options.enableHtml),a(),l("ngIf",i.options.progressBar))},dependencies:[W],encapsulation:2})}return s})(),ae=I(u({},It),{toastComponent:Lt});var de=(()=>{let n=class n{constructor(t,i){this.http=t,this.toastr=i}get(t){return this.http.get(t).pipe(ut(i=>ct))}post(t,i,o={},r=1e5){return this.http.post(t,i,o).pipe(z(r))}postFile(t,i,o=1e5){return new lt(r=>{let p=localStorage.getItem("Token"),T=new Tt({"Content-Type":"application/json","Cache-Control":"no-cache"});p&&(T=T.append("Authorization","Bearer "+p)),this.http.post(t,i,{headers:T,observe:"response",responseType:"blob"}).pipe(z(o)).subscribe({next:h=>{r.next({title:h.headers.get("Content-Disposition"),file:h.body}),r.complete()},error:h=>{if(h.headers.get("Content-Type")==="application/json; charset=utf-8"){let _=new FileReader;_.addEventListener("loadend",D=>{let k=JSON.parse(D.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(h)){let P=this.errorMessageHandling(h);this.toastr.error(k??"An unknown error has occured!",P.header,{enableHtml:!0})}}),_.readAsText(h.error)}r.error(h)}})})}unauthorizedErrorHandling(t){let i=!1;return(t.status==401||t.status==403)&&(localStorage.getItem("Token")?this.toastr.error("Your session has expired. Please login again.","Unauthorized",{enableHtml:!0}):window.location.href="/",i=!0),i}errorMessageHandling(t){let i="API Error",o="Exception Message";return t.error?(i="API Error - "+t.status,t.status==451&&(i="Error"),t.error&&(o=t.error.Message)):t.Message&&(i="API Error - "+t.name,o=t.Message),{header:i,Message:o}}};n.\u0275fac=function(i){return new(i||n)(m(_t),m(F))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"});let s=n;return s})();export{O as a,F as b,Vt as c,oe as d,de as e};
@@ -0,0 +1 @@
1
+ import{e as $}from"./chunk-K3G6FMDF.js";import{c as d}from"./chunk-6F6NSBIF.js";import{$ as b,B as h,F as p,O as c,Q as l,V as g,X as m,Y as f,c as u,ca as P,d as n,q as s}from"./chunk-6DRNAUKE.js";var j=(()=>{let i=class i{constructor(t){this.http=t,this.pagination$=new n(null),this.destroy$=new u,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,e){e==0?this.disableNextButton=!0:this.disableNextButton=!(e<t.RowCount*t.PageNumber)}reloadPagination(t){d.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,e){t.RowCount=e,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new n(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(g(this.destroy$),h(t=>t!=null),p(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(s(e=>e.Data))),f(this.pagination$),c((t,e)=>{let[N,o]=t,[r]=e;return o.PageNumber==1?[r,o]:[N.concat(r),o]}),m(([t,e])=>{this.setPageNumberFooter(e),this.setPaginationButtonState(e,t.length)}),s(([t])=>t),l())}};i.\u0275fac=function(e){return new(e||i)(P($))},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let a=i;return a})();export{j as a};