From eb4f0d5e5604c9643cb1804c4c0dc7932993f7b8 Mon Sep 17 00:00:00 2001 From: Badisi Date: Tue, 19 Nov 2024 22:38:21 +0000 Subject: [PATCH] deploy(demo-app): bd5ef7604f7566f733ea7f4056d42d19123b5d2c --- demo-app/auth-js/index.html | 30 +++++++++++++++++++ demo-app/auth-js/main.8c554cfcbfa5594a.js | 1 - demo-app/auth-js/main.b8a77a848194a17d.js | 1 + demo-app/auth-js/runtime.1af42e8fcde6888f.js | 1 + demo-app/auth-js/styles.3e2c4c2556e33291.css | 1 + demo-app/auth-js/styles.b13a2ac962ee2141.js | 1 + demo-app/ngx-auth/3rdpartylicenses.txt | 28 +---------------- ...b6f14904117.js => 998.7d2c96e76000cb11.js} | 2 +- demo-app/ngx-auth/index.html | 4 +-- demo-app/ngx-auth/main.b4a8445448d3cf7a.js | 1 - demo-app/ngx-auth/main.d2fc577980f3ae1c.js | 1 + .../ngx-auth/polyfills.282413b354d3be9f.js | 1 + .../ngx-auth/polyfills.454dad1637b0f426.js | 1 - ...3caef3a.js => runtime.5f73b1b9becf6eb6.js} | 2 +- 14 files changed, 41 insertions(+), 34 deletions(-) create mode 100644 demo-app/auth-js/index.html delete mode 100644 demo-app/auth-js/main.8c554cfcbfa5594a.js create mode 100644 demo-app/auth-js/main.b8a77a848194a17d.js create mode 100644 demo-app/auth-js/runtime.1af42e8fcde6888f.js create mode 100644 demo-app/auth-js/styles.3e2c4c2556e33291.css create mode 100644 demo-app/auth-js/styles.b13a2ac962ee2141.js rename demo-app/ngx-auth/{998.e0dbcb6f14904117.js => 998.7d2c96e76000cb11.js} (90%) delete mode 100644 demo-app/ngx-auth/main.b4a8445448d3cf7a.js create mode 100644 demo-app/ngx-auth/main.d2fc577980f3ae1c.js create mode 100644 demo-app/ngx-auth/polyfills.282413b354d3be9f.js delete mode 100644 demo-app/ngx-auth/polyfills.454dad1637b0f426.js rename demo-app/ngx-auth/{runtime.edcb705153caef3a.js => runtime.5f73b1b9becf6eb6.js} (58%) diff --git a/demo-app/auth-js/index.html b/demo-app/auth-js/index.html new file mode 100644 index 0000000..114ec15 --- /dev/null +++ b/demo-app/auth-js/index.html @@ -0,0 +1,30 @@ + + + + + + demo-app | auth-js + + + + + + + + + + + diff --git a/demo-app/auth-js/main.8c554cfcbfa5594a.js b/demo-app/auth-js/main.8c554cfcbfa5594a.js deleted file mode 100644 index 688fe85..0000000 --- a/demo-app/auth-js/main.8c554cfcbfa5594a.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var e={436:function(e,t,n){var s;e.exports=(s=s||function(e,t){var s;if("undefined"!=typeof window&&window.crypto&&(s=window.crypto),"undefined"!=typeof self&&self.crypto&&(s=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(s=globalThis.crypto),!s&&"undefined"!=typeof window&&window.msCrypto&&(s=window.msCrypto),!s&&"undefined"!=typeof global&&global.crypto&&(s=global.crypto),!s)try{s=n(366)}catch(m){}var i=function(){if(s){if("function"==typeof s.getRandomValues)try{return s.getRandomValues(new Uint32Array(1))[0]}catch(m){}if("function"==typeof s.randomBytes)try{return s.randomBytes(4).readInt32LE()}catch(m){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},c=a.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=a.WordArray=c.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,s=this.sigBytes,i=e.sigBytes;if(this.clamp(),s%4)for(var r=0;r>>2]>>>24-r%4*8&255;t[s+r>>>2]|=o<<24-(s+r)%4*8}else for(var a=0;a>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-i%4*8&255;s.push((r>>>4).toString(16)),s.push((15&r).toString(16))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new l.init(n,t/2)}},h=d.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],i=0;i>>2]>>>24-i%4*8&255;s.push(String.fromCharCode(r))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;return new l.init(n,t)}},p=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},g=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,s=this._data,i=s.words,r=s.sigBytes,o=this.blockSize,a=r/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,d=e.min(4*c,r);if(c){for(var u=0;u>>6-o%4*2;i[r>>>2]|=a<<24-r%4*8,r++}return t.create(i,r)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,s=this._map;e.clamp();for(var i=[],r=0;r>>2]>>>24-r%4*8&255)<<16|(t[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|t[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a>>6*(3-a)&63));var c=s.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,s=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var r=0;r>>7)^(g<<14|g>>>18)^g>>>3,m=l[p-2],f=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;l[p]=_+l[p-7]+f+l[p-16]}var w=s&i^s&r^i&r,v=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),b=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&d^~a&u)+c[p]+l[p];h=u,u=d,d=a,a=o+b|0,o=r,r=i,i=s,s=b+(v+w)|0}n[0]=n[0]+s|0,n[1]=n[1]+i|0,n[2]=n[2]+r|0,n[3]=n[3]+o|0,n[4]=n[4]+a|0,n[5]=n[5]+d|0,n[6]=n[6]+u|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,s=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(s/4294967296),n[15+(i+64>>>9<<4)]=s,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(d),t.HmacSHA256=r._createHmacHelper(d)}(Math),s.SHA256)},566:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var s=n(753);e=n.hmd(e);var i="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=i&&e&&!e.nodeType&&e,o=r&&r.exports===i?s.A.Buffer:void 0,a=o?o.allocUnsafe:void 0;const c=function(e,t){if(t)return e.slice();var n=e.length,s=a?a(n):new e.constructor(n);return e.copy(s),s}},724:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});const s="object"==typeof global&&global&&global.Object===Object&&global},485:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var s=n(724);e=n.hmd(e);var i="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=i&&e&&!e.nodeType&&e,o=r&&r.exports===i&&s.A.process;const a=function(){try{var e=r&&r.require&&r.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(t){}}()},753:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var s=n(724),i="object"==typeof self&&self&&self.Object===Object&&self;const r=s.A||i||Function("return this")()},160:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var s=n(753);const i=function(){return!1};e=n.hmd(e);var r="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=r&&e&&!e.nodeType&&e,a=o&&o.exports===r?s.A.Buffer:void 0;const c=(a?a.isBuffer:void 0)||i},366:()=>{}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var r=t[s]={id:s,loaded:!1,exports:{}};return e[s].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(e){this.message=e}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var t="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var n=String(t).replace(/=+$/,"");if(n.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var s,i,r=0,o=0,a="";i=n.charAt(o++);~i&&(s=r%4?64*s+i:i,r++%4)?a+=String.fromCharCode(255&s>>(-2*r&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return a};function s(e){var n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(t(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(n)}catch(e){return t(n)}}function i(e){this.message=e}i.prototype=new Error,i.prototype.name="InvalidTokenError";const r=function(e,t){if("string"!=typeof e)throw new i("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(s(e.split(".")[n]))}catch(e){throw new i("Invalid token specified: "+e.message)}};var o;class AuthUtils{}o=AuthUtils,AuthUtils.isCordova=()=>!!(window.cordova||window.phonegap||window.PhoneGap),AuthUtils.isCapacitor=()=>{var e;return!(null==(e=window.Capacitor)||!e.isNativePlatform())},AuthUtils.isNativeMobile=()=>o.isCapacitor()||o.isCordova(),AuthUtils.decodeJwt=e=>{try{return e?r(e):e}catch(t){return console.warn("[@badisi/auth-js] Access token was not decoded as it is not a valid JWT."),e}},AuthUtils.isUrlMatching=(e,t)=>{if(void 0!==t){const n=new URL(e,"http://test"),s=new URL(t,"http://test");if(""!==s.pathname&&"/"!==s.pathname&&!n.pathname.includes(s.pathname))return!1;if("http://test"!==s.origin&&(n.protocol!==s.protocol||n.origin!==s.origin||!`${n.origin}${n.pathname}}`.includes(`${s.origin}${s.pathname}`)))return!1;let i=!0;return s.searchParams.forEach(((e,t)=>{n.searchParams.getAll(t).includes(e)||(i=!1)})),i}return!1},AuthUtils.getBaseUrl=()=>{var e;const t=document.baseURI||(null==(e=document.querySelector("base"))?void 0:e.href)||location.origin;return t.endsWith("/")?t:`${t}/`},AuthUtils.stringToURL=e=>{try{return new URL(e)}catch(t){const n=e.startsWith("/")?e.substring(1,e.length):e;return new URL(`${o.getBaseUrl()}${n}`)}};const a=document.createElement("template");a.innerHTML='\n \n \n \n \n \n';class AppElement extends HTMLElement{constructor(){var e;super(),this.demoAppMainEl=void 0,this.demoAppPlaygroundEl=void 0,this.demoAppDebugEl=void 0,this.authManagerSubs=[],this.listeners=[],this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(a.content,!0))}connectedCallback(){this.demoAppMainEl=this.shadowRoot.querySelector("demo-app-main"),this.demoAppPlaygroundEl=this.shadowRoot.querySelector("demo-app-playground"),this.demoAppDebugEl=this.shadowRoot.querySelector("demo-app-debug"),this.listenForHeaderEvents(),this.listenForPlaygroundEvents(),this.listenForAuthChanges()}disconnectedCallback(){this.authManagerSubs.forEach((e=>e.unsubscribe())),this.listeners.forEach((e=>e()))}async callPrivateApi(e,t){if(window.authManager&&e){var n;const s=null!=(n=await window.authManager.getAccessToken())?n:"",i=new XMLHttpRequest;i.onreadystatechange=()=>{if(4===i.readyState){var e;let s;try{var t;s=JSON.parse(null!=(t=i.responseText)?t:"")}catch(n){s=`${i.status} ${i.statusText}`}null==(e=this.demoAppPlaygroundEl)||e.setApiStatus(s,200!==i.status)}},i.open("GET",e,!0),i.setRequestHeader("Authorization",`Bearer ${s}`),null==t||t.split(";").forEach((e=>{if(e){var t,n;const s=e.split(":");i.setRequestHeader(null==(t=s[0])?void 0:t.trim(),(null==(n=s[1])?void 0:n.trim())||"")}})),i.send()}}refreshInfo(e,t){if(window.authManager&&this.demoAppMainEl&&this.demoAppDebugEl)switch(e){case"renewing":this.demoAppMainEl.isRenewing=t;break;case"authenticated":this.demoAppMainEl.isAuthenticated=t,this.demoAppDebugEl.isAuthenticated=t;break;case"userSession":this.demoAppDebugEl.userSession=t;break;case"accessToken":this.demoAppDebugEl.accessToken=t,this.demoAppDebugEl.accessTokenDecoded=AuthUtils.decodeJwt(t);break;case"idToken":this.demoAppDebugEl.idToken=t,this.demoAppDebugEl.idTokenDecoded=AuthUtils.decodeJwt(t);break;case"userProfile":this.demoAppDebugEl.userProfile=t}}listenForAuthChanges(){const e=window.authManager;e&&this.authManagerSubs.push(e.onRenewingChanged((e=>this.refreshInfo("renewing",e))),e.onAuthenticatedChanged((e=>this.refreshInfo("authenticated",e))),e.onUserSessionChanged((e=>this.refreshInfo("userSession",e))),e.onAccessTokenChanged((e=>this.refreshInfo("accessToken",e))),e.onIdTokenChanged((e=>this.refreshInfo("idToken",e))),e.onUserProfileChanged((e=>this.refreshInfo("userProfile",e))))}listenForPlaygroundEvents(){if(this.demoAppPlaygroundEl){const e=e=>{var t,n;this.callPrivateApi(null==(t=e.detail)?void 0:t.url,null==(n=e.detail)?void 0:n.headers)};this.demoAppPlaygroundEl.addEventListener("api",e),this.listeners.push((()=>{var t;return null==(t=this.demoAppPlaygroundEl)?void 0:t.removeEventListener("api",e)}))}}listenForHeaderEvents(){const e=window.authManager;if(e&&this.demoAppMainEl){const t=()=>{e.login()};this.demoAppMainEl.addEventListener("login",t);const n=()=>{e.logout({redirectUrl:"/"}).then((()=>{var e;const t=document.baseURI||(null==(e=document.querySelector("base"))?void 0:e.href)||location.origin;location.href=t.endsWith("/")?t:`${t}/`}))};this.demoAppMainEl.addEventListener("logout",n);const s=()=>{e.renew()};this.demoAppMainEl.addEventListener("silentRenew",s),this.listeners.push((()=>{var e;return null==(e=this.demoAppMainEl)?void 0:e.removeEventListener("login",t)}),(()=>{var e;return null==(e=this.demoAppMainEl)?void 0:e.removeEventListener("logout",n)}),(()=>{var e;return null==(e=this.demoAppMainEl)?void 0:e.removeEventListener("silentRenew",s)}))}}}customElements.define("app-root",AppElement);function c(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var l=0;function d(e){return"__private_"+l+++"_"+e}const u=function(){this.__data__=[],this.size=0};const h=function(e,t){return e===t||e!=e&&t!=t};const p=function(e,t){for(var n=e.length;n--;)if(h(e[n][0],t))return n;return-1};var g=Array.prototype.splice;const _=function(e){var t=this.__data__,n=p(t,e);return!(n<0)&&(n==t.length-1?t.pop():g.call(t,n,1),--this.size,!0)};const m=function(e){var t=this.__data__,n=p(t,e);return n<0?void 0:t[n][1]};const f=function(e){return p(this.__data__,e)>-1};const w=function(e,t){var n=this.__data__,s=p(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this};function v(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991};const Fe=function(e){return null!=e&&ze(e.length)&&!M(e)};const Je=function(e){return Me(e)&&Fe(e)};var Ke=n(160),Ve=Function.prototype,Ge=Object.prototype,Qe=Ve.toString,Xe=Ge.hasOwnProperty,Ye=Qe.call(Object);const Ze=function(e){if(!Me(e)||"[object Object]"!=L(e))return!1;var t=Oe(e);if(null===t)return!0;var n=Xe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Qe.call(n)==Ye};var et={};et["[object Float32Array]"]=et["[object Float64Array]"]=et["[object Int8Array]"]=et["[object Int16Array]"]=et["[object Int32Array]"]=et["[object Uint8Array]"]=et["[object Uint8ClampedArray]"]=et["[object Uint16Array]"]=et["[object Uint32Array]"]=!0,et["[object Arguments]"]=et["[object Array]"]=et["[object ArrayBuffer]"]=et["[object Boolean]"]=et["[object DataView]"]=et["[object Date]"]=et["[object Error]"]=et["[object Function]"]=et["[object Map]"]=et["[object Number]"]=et["[object Object]"]=et["[object RegExp]"]=et["[object Set]"]=et["[object String]"]=et["[object WeakMap]"]=!1;const tt=function(e){return Me(e)&&ze(e.length)&&!!et[L(e)]};const nt=function(e){return function(t){return e(t)}};var st=n(485),it=st.A&&st.A.isTypedArray;const rt=it?nt(it):tt;const ot=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var at=Object.prototype.hasOwnProperty;const ct=function(e,t,n){var s=e[t];at.call(e,t)&&h(s,n)&&(void 0!==n||t in e)||ke(e,t,n)};const lt=function(e,t,n,s){var i=!n;n||(n={});for(var r=-1,o=t.length;++r-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Tt);const Pt=function(e,t){return At(xt(e,t,St),e+"")};const Rt=function(e,t,n){if(!N(n))return!1;var s=typeof t;return!!("number"==s?Fe(n)&&ht(t,n.length):"string"==s&&t in n)&&h(n[t],e)};const It=function(e){return Pt((function(t,n){var s=-1,i=n.length,r=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(i--,r):void 0,o&&Rt(n[0],n[1],o)&&(r=i<3?void 0:r,i=1),t=Object(t);++s{},info:()=>{},warn:()=>{},error:()=>{}},Ft=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(Ft||{});(Lt=Ft||(Ft={})).reset=function(){Ot=3,jt=zt},Lt.setLevel=function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");Ot=e},Lt.setLogger=function(e){jt=e};var Jt=class{constructor(e){this._name=e}debug(...e){Ot>=4&&jt.debug(Jt._format(this._name,this._method),...e)}info(...e){Ot>=3&&jt.info(Jt._format(this._name,this._method),...e)}warn(...e){Ot>=2&&jt.warn(Jt._format(this._name,this._method),...e)}error(...e){Ot>=1&&jt.error(Jt._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new Jt(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){Ot>=4&&jt.debug(Jt._format(e),...t)}static info(e,...t){Ot>=3&&jt.info(Jt._format(e),...t)}static warn(e,...t){Ot>=2&&jt.warn(Jt._format(e),...t)}static error(e,...t){Ot>=1&&jt.error(Jt._format(e),...t)}};Ft.reset();var Kt,Vt,Gt,Qt=class{static _randomWord(){return Mt().lib.WordArray.random(1).words[0]}static generateUUIDv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^Qt._randomWord()&15>>+e/4).toString(16))).replace(/-/g,"")}static generateCodeVerifier(){return Qt.generateUUIDv4()+Qt.generateUUIDv4()+Qt.generateUUIDv4()}static generateCodeChallenge(e){try{const t=Ht()(e);return $t().stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){throw Jt.error("CryptoUtils.generateCodeChallenge",t),t}}static generateBasicAuth(e,t){const n=Bt().parse([e,t].join(":"));return $t().stringify(n)}},Xt=class{constructor(e){this._name=e,this._logger=new Jt(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},Yt=class{static decode(e){try{return r(e)}catch(t){throw Jt.error("JwtUtils.decode",t),t}}},Zt=class{static center({...e}){var t;return null==e.width&&(e.width=null!=(t=[800,720,600,480].find((e=>e<=window.outerWidth/1.618)))?t:360),null!=e.left||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),null!=e.height&&(null!=e.top||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}=${"boolean"!=typeof t?t:t?"yes":"no"}`)).join(",")}},en=class extends Xt{constructor(){super(...arguments),this._logger=new Jt(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-en.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=en.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=en.getEpochTime()+e;if(this.expiration===n&&this._timerHandle)return void t.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),t.debug("using duration",e),this._expiration=n;const s=Math.min(e,5);this._timerHandle=setInterval(this._callback,1e3*s)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},tn=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const n=new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"];return new URLSearchParams(n.slice(1))}},nn=class extends Error{constructor(e,t){var n,s,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw Jt.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=null!=(n=e.error_description)?n:null,this.error_uri=null!=(s=e.error_uri)?s:null,this.state=e.userState,this.session_state=null!=(i=e.session_state)?i:null,this.url_state=e.url_state}},sn=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},rn=class{constructor(e){this._logger=new Jt("AccessTokenEvents"),this._expiringTimer=new en("Access token expiring"),this._expiredTimer=new en("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&void 0!==e.expires_in){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let e=n-this._expiringNotificationTimeInSeconds;e<=0&&(e=1),t.debug("registering expiring timer, raising in",e,"seconds"),this._expiringTimer.init(e)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const s=n+1;t.debug("registering expired timer, raising in",s,"seconds"),this._expiredTimer.init(s)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},on=class{constructor(e,t,n,s,i){this._callback=e,this._client_id=t,this._intervalInSeconds=s,this._stopOnError=i,this._logger=new Jt("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=e=>{e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(e.data+" message from check session op iframe"))};const r=new URL(n);this._frame_origin=r.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=r.href}load(){return new Promise((e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)}))}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},an=class{constructor(){this._logger=new Jt("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},cn=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new Jt("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...s}=t;if(!n)return await fetch(e,s);const i=new AbortController,r=setTimeout((()=>i.abort()),1e3*n);try{return await fetch(e,{...t,signal:i.signal})}catch(o){if(o instanceof DOMException&&"AbortError"===o.name)throw new sn("Network timed out");throw o}finally{clearTimeout(r)}}async getJson(e,{token:t,credentials:n}={}){const s=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};let r;t&&(s.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);try{s.debug("url:",e),r=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:n})}catch(c){throw s.error("Network Error"),c}s.debug("HTTP response received, status",r.status);const o=r.headers.get("Content-Type");if(o&&!this._contentTypes.find((e=>o.startsWith(e)))&&s.throw(new Error(`Invalid response Content-Type: ${null!=o?o:"undefined"}, from URL: ${e}`)),r.ok&&this._jwtHandler&&(null==o?void 0:o.startsWith("application/jwt")))return await this._jwtHandler(await r.text());let a;try{a=await r.json()}catch(c){if(s.error("Error parsing JSON response",c),r.ok)throw c;throw new Error(`${r.statusText} (${r.status})`)}if(!r.ok){if(s.error("Error from server:",a),a.error)throw new nn(a);throw new Error(`${r.statusText} (${r.status}): ${JSON.stringify(a)}`)}return a}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:s,initCredentials:i}){const r=this._logger.create("postForm"),o={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let a;void 0!==n&&(o.Authorization="Basic "+n),this.appendExtraHeaders(o);try{r.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"POST",headers:o,body:t,timeoutInSeconds:s,credentials:i})}catch(u){throw r.error("Network error"),u}r.debug("HTTP response received, status",a.status);const c=a.headers.get("Content-Type");if(c&&!this._contentTypes.find((e=>c.startsWith(e))))throw new Error(`Invalid response Content-Type: ${null!=c?c:"undefined"}, from URL: ${e}`);const l=await a.text();let d={};if(l)try{d=JSON.parse(l)}catch(u){if(r.error("Error parsing JSON response",u),a.ok)throw u;throw new Error(`${a.statusText} (${a.status})`)}if(!a.ok){if(r.error("Error from server:",d),d.error)throw new nn(d,t);throw new Error(`${a.statusText} (${a.status}): ${JSON.stringify(d)}`)}return d}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),s=["authorization","accept","content-type"];0!==n.length&&n.forEach((n=>{if(s.includes(n.toLocaleLowerCase()))return void t.warn("Protected header could not be overridden",n,s);const i="function"==typeof this._extraHeaders[n]?this._extraHeaders[n]():this._extraHeaders[n];i&&""!==i&&(e[n]=i)}))}},ln=class{constructor(e){this._settings=e,this._logger=new Jt("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new cn(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),s=await this.getMetadata();if(n.debug("resolved"),void 0===s[e]){if(!0===t)return void n.warn("Metadata does not contain optional property");n.throw(new Error("Metadata does not contain property "+e))}return s[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},dn=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new Jt("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){this._logger.create(`get('${e}')`),e=this._prefix+e;return await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n{const t=this._logger.create("_getClaimsFromJwt");try{const n=Yt.decode(e);return t.debug("JWT decoding successful"),n}catch(n){throw t.error("Error parsing JWT response"),n}},this._jsonService=new cn(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const s=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",s),s}},pn=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new Jt("TokenClient"),this._jsonService=new cn(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:s=this._settings.client_secret,...i}){const r=this._logger.create("exchangeCode");n||r.throw(new Error("A client_id is required")),t||r.throw(new Error("A redirect_uri is required")),i.code||r.throw(new Error("A code is required"));const o=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[d,u]of Object.entries(i))null!=u&&o.set(d,u);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!s)throw r.throw(new Error("A client_secret is required")),null;a=Qt.generateBasicAuth(n,s);break;case"client_secret_post":o.append("client_id",n),s&&o.append("client_secret",s)}const c=await this._metadataService.getTokenEndpoint(!1);r.debug("got token endpoint");const l=await this._jsonService.postForm(c,{body:o,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return r.debug("got response"),l}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:s=this._settings.scope,...i}){const r=this._logger.create("exchangeCredentials");t||r.throw(new Error("A client_id is required"));const o=new URLSearchParams({grant_type:e,scope:s});for(const[d,u]of Object.entries(i))null!=u&&o.set(d,u);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw r.throw(new Error("A client_secret is required")),null;a=Qt.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const c=await this._metadataService.getTokenEndpoint(!1);r.debug("got token endpoint");const l=await this._jsonService.postForm(c,{body:o,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return r.debug("got response"),l}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:s,...i}){const r=this._logger.create("exchangeRefreshToken");t||r.throw(new Error("A client_id is required")),i.refresh_token||r.throw(new Error("A refresh_token is required"));const o=new URLSearchParams({grant_type:e});for(const[d,u]of Object.entries(i))Array.isArray(u)?u.forEach((e=>o.append(d,e))):null!=u&&o.set(d,u);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw r.throw(new Error("A client_secret is required")),null;a=Qt.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const c=await this._metadataService.getTokenEndpoint(!1);r.debug("got token endpoint");const l=await this._jsonService.postForm(c,{body:o,basicAuth:a,timeoutInSeconds:s,initCredentials:this._settings.fetchRequestCredentials});return r.debug("got response"),l}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const s=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);const i=new URLSearchParams;for(const[r,o]of Object.entries(e))null!=o&&i.set(r,o);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(s,{body:i}),n.debug("got response")}},gn=class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new Jt("ResponseValidator"),this._userInfoService=new hn(this._settings,this._metadataService),this._tokenClient=new pn(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&e.id_token&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){const n=this._logger.create("validateRefreshResponse");e.userState=t.data,null!=e.session_state||(e.session_state=t.session_state),null!=e.scope||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),n.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const s=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,s),n.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new nn(e)}_processSigninState(e,t){const n=this._logger.create("_processSigninState");if(t.id!==e.state&&n.throw(new Error("State does not match")),t.client_id||n.throw(new Error("No client_id on state")),t.authority||n.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&n.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&n.throw(new Error("client_id mismatch on settings vs. signin state")),n.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,null!=e.scope||(e.scope=t.scope),e.error)throw n.warn("Response was error",e.error),new nn(e);t.code_verifier&&!e.code&&n.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const s=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void s.debug("not loading user info");s.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);s.debug("user info claims received from user info endpoint"),n&&i.sub!==e.profile.sub&&s.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),s.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const s=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,s)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const s=this._logger.create("_validateIdTokenAttributes");s.debug("decoding ID Token JWT");const i=Yt.decode(null!=(n=e.id_token)?n:"");if(i.sub||s.throw(new Error("ID Token is missing a subject claim")),t){const e=Yt.decode(t);i.sub!==e.sub&&s.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==e.auth_time&&s.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==e.azp&&s.throw(new Error("azp in id_token does not match original azp")),!i.azp&&e.azp&&s.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}},_n=class{constructor(e){this.id=e.id||Qt.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=en.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new Jt("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(e){return Jt.createStatic("State","fromStorageString"),new _n(JSON.parse(e))}static async clearStaleState(e,t){const n=Jt.createStatic("State","clearStaleState"),s=en.getEpochTime()-t,i=await e.getAllKeys();n.debug("got keys",i);for(let o=0;ow.searchParams.append("resource",e)))}for(const[b,y]of Object.entries({response_mode:a,...f,...g}))null!=y&&w.searchParams.append(b,y.toString());this.url=w.href}},wn=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const e=decodeURIComponent(this.state).split(";");this.state=e[0],e.length>1&&(this.url_state=e.slice(1).join(";"))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-en.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+en.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},vn=class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:s,extraQueryParams:i,request_type:r,client_id:o}){if(this._logger=new Jt("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(e);n&&a.searchParams.append("id_token_hint",n),o&&a.searchParams.append("client_id",o),s&&(a.searchParams.append("post_logout_redirect_uri",s),t&&(this.state=new _n({data:t,request_type:r}),a.searchParams.append("state",this.state.id)));for(const[c,l]of Object.entries({...i}))null!=l&&a.searchParams.append(c,l.toString());this.url=a.href}},bn=class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},yn=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],Sn=["sub","iss","aud","exp","iat"],kn=class{constructor(e){this._settings=e,this._logger=new Jt("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let e;e=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:yn;for(const n of e)Sn.includes(n)||delete t[n]}return t}mergeClaims(e,t){const n={...e};for(const[s,i]of Object.entries(t))for(const e of Array.isArray(i)?i:[i]){const t=n[s];void 0===t?n[s]=e:Array.isArray(t)?t.includes(e)||t.push(e):n[s]!==e&&("object"==typeof e&&this._settings.mergeClaims?n[s]=this.mergeClaims(t,e):n[s]=[t,e])}return n}},En=class{constructor(e,t){this._logger=new Jt("OidcClient"),this.settings=e instanceof un?e:new un(e),this.metadataService=null!=t?t:new ln(this.settings),this._claimsService=new kn(this.settings),this._validator=new gn(this.settings,this.metadataService,this._claimsService),this._tokenClient=new pn(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:s,id_token_hint:i,login_hint:r,skipUserInfo:o,nonce:a,url_state:c,response_type:l=this.settings.response_type,scope:d=this.settings.scope,redirect_uri:u=this.settings.redirect_uri,prompt:h=this.settings.prompt,display:p=this.settings.display,max_age:g=this.settings.max_age,ui_locales:_=this.settings.ui_locales,acr_values:m=this.settings.acr_values,resource:f=this.settings.resource,response_mode:w=this.settings.response_mode,extraQueryParams:v=this.settings.extraQueryParams,extraTokenParams:b=this.settings.extraTokenParams}){const y=this._logger.create("createSigninRequest");if("code"!==l)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const S=await this.metadataService.getAuthorizationEndpoint();y.debug("Received authorization endpoint",S);const k=new fn({url:S,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:u,response_type:l,scope:d,state_data:e,url_state:c,prompt:h,display:p,max_age:g,ui_locales:_,id_token_hint:i,login_hint:r,acr_values:m,resource:f,request:t,request_uri:n,extraQueryParams:v,extraTokenParams:b,request_type:s,response_mode:w,client_secret:this.settings.client_secret,skipUserInfo:o,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const E=k.state;return await this.settings.stateStore.set(E.id,E.toStorageString()),k}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),s=new wn(tn.readParams(e,this.settings.response_mode));if(!s.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](s.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:mn.fromStorageString(i),response:s}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:s}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(s,n),s}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:s={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...s}),r=new wn(new URLSearchParams);return Object.assign(r,i),await this._validator.validateCredentialsResponse(r,n),r}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const s=this._logger.create("useRefreshToken");let i;if(void 0===this.settings.refreshTokenAllowedScope)i=e.scope;else{const t=this.settings.refreshTokenAllowedScope.split(" ");i=((null==(n=e.scope)?void 0:n.split(" "))||[]).filter((e=>t.includes(e))).join(" ")}const r=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,resource:e.resource,scope:i,timeoutInSeconds:t}),o=new wn(new URLSearchParams);return Object.assign(o,r),s.debug("validating response",o),await this._validator.validateRefreshResponse(o,{...e,scope:i}),o}async createSignoutRequest({state:e,id_token_hint:t,client_id:n,request_type:s,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:r=this.settings.extraQueryParams}={}){const o=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",a),n||!i||t||(n=this.settings.client_id);const c=new vn({url:a,id_token_hint:t,client_id:n,post_logout_redirect_uri:i,state_data:e,extraQueryParams:r,request_type:s});await this.clearStaleState();const l=c.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),c}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),s=new bn(tn.readParams(e,this.settings.response_mode));if(!s.state){if(n.debug("No state in response"),s.error)throw n.warn("Response was error:",s.error),new nn(s);return{state:void 0,response:s}}const i=await this.settings.stateStore[t?"remove":"get"](s.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:_n.fromStorageString(i),response:s}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:s}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(s,n)):t.debug("No state from storage; skipping response validation"),s}clearStaleState(){return this._logger.create("clearStaleState"),_n.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},xn=class{constructor(e){this._userManager=e,this._logger=new Jt("SessionMonitor"),this._start=async e=>{const t=e.session_state;if(!t)return;const n=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,n.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,n.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(t);else try{const e=await this._userManager.metadataService.getCheckSessionIframe();if(e){n.debug("initializing check session iframe");const s=this._userManager.settings.client_id,i=this._userManager.settings.checkSessionIntervalInSeconds,r=this._userManager.settings.stopCheckSessionOnError,o=new on(this._callback,s,e,i,r);await o.load(),this._checkSessionIFrame=o,o.start(t)}else n.warn("no check session iframe found in the metadata")}catch(s){n.error("Error from getCheckSessionIframe:",s instanceof Error?s.message:s)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const t=setInterval((async()=>{clearInterval(t);try{const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}catch(n){e.error("error from querySessionStatus",n instanceof Error?n.message:n)}}),1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const t=await this._userManager.querySessionStatus();let n=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(n=!1,this._checkSessionIFrame.start(t.session_state),t.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",t.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",t.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",t.sub):e.debug("subject no longer signed into OP"),n?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(t){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",t),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch((e=>{this._logger.error(e)}))}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}}},Cn=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=null!=(t=e.session_state)?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState,this.url_state=e.url_state}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-en.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+en.getEpochTime())}get expired(){const e=this.expires_in;if(void 0!==e)return e<=0}get scopes(){var e,t;return null!=(t=null==(e=this.scope)?void 0:e.split(" "))?t:[]}toStorageString(){return new Jt("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return Jt.createStatic("User","fromStorageString"),new Cn(JSON.parse(e))}},Tn="oidc-client",Un=class{constructor(){this._abort=new Xt("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:s}=await new Promise(((n,s)=>{const i=i=>{var r;const o=i.data,a=null!=(r=e.scriptOrigin)?r:window.location.origin;if(i.origin===a&&(null==o?void 0:o.source)===Tn){try{const n=tn.readParams(o.url,e.response_mode).get("state");if(n||t.warn("no state found in response url"),i.source!==this._window&&n!==e.state)return}catch(c){this._dispose(),s(new Error("Invalid response from window"))}n(o)}};window.addEventListener("message",i,!1),this._disposeHandlers.add((()=>window.removeEventListener("message",i,!1))),this._disposeHandlers.add(this._abort.addHandler((e=>{this._dispose(),s(e)})))}));return t.debug("got response from window"),this._dispose(),s||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,s=window.location.origin){e.postMessage({source:Tn,url:t,keepOpen:n},s)}},An={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Pn="_blank",Rn=60,In=2,On=10,jn=class extends un{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:s=An,popupWindowTarget:i=Pn,redirectMethod:r="assign",redirectTarget:o="self",iframeNotifyParentOrigin:a=e.iframeNotifyParentOrigin,iframeScriptOrigin:c=e.iframeScriptOrigin,silent_redirect_uri:l=e.redirect_uri,silentRequestTimeoutInSeconds:d=On,automaticSilentRenew:u=!0,validateSubOnSilentRenew:h=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:g=!1,monitorAnonymousSession:_=!1,checkSessionIntervalInSeconds:m=In,query_status_response_type:f="code",stopCheckSessionOnError:w=!0,revokeTokenTypes:v=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:y=!1,accessTokenExpiringNotificationTimeInSeconds:S=Rn,userStore:k}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=s,this.popupWindowTarget=i,this.redirectMethod=r,this.redirectTarget=o,this.iframeNotifyParentOrigin=a,this.iframeScriptOrigin=c,this.silent_redirect_uri=l,this.silentRequestTimeoutInSeconds=d,this.automaticSilentRenew=u,this.validateSubOnSilentRenew=h,this.includeIdTokenInSilentRenew=p,this.monitorSession=g,this.monitorAnonymousSession=_,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=w,this.query_status_response_type=f,this.revokeTokenTypes=v,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=y,this.accessTokenExpiringNotificationTimeInSeconds=S,k)this.userStore=k;else{const e="undefined"!=typeof window?window.sessionStorage:new an;this.userStore=new dn({store:e})}}},Ln=class extends Un{constructor({silentRequestTimeoutInSeconds:e=On}){super(),this._logger=new Jt("IFrameWindow"),this._timeoutInSeconds=e,this._frame=Ln.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout((()=>this._abort.raise(new sn("IFrame timed out without a response"))),1e3*this._timeoutInSeconds);return this._disposeHandlers.add((()=>clearTimeout(t))),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",(e=>{var t;const n=e.target;null==(t=n.parentNode)||t.removeChild(n),this._abort.raise(new Error("IFrame removed from DOM"))}),!0),null==(e=this._frame.contentWindow)||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},Nn=class{constructor(e){this._settings=e,this._logger=new Jt("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new Ln({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),Ln.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},Mn=class extends Un{constructor({popupWindowTarget:e=Pn,popupWindowFeatures:t={}}){super(),this._logger=new Jt("PopupWindow");const n=Zt.center({...An,...t});this._window=window.open(void 0,e,Zt.serialize(n)),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout((()=>{this._window&&"boolean"==typeof this._window.closed&&!this._window.closed?this.close():this._abort.raise(new Error("Popup blocked by user"))}),1e3*t.closePopupWindowAfterInSeconds)}async navigate(e){var t;null==(t=this._window)||t.focus();const n=setInterval((()=>{this._window&&!this._window.closed||this._abort.raise(new Error("Popup closed by user"))}),500);return this._disposeHandlers.add((()=>clearInterval(n))),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},qn=class{constructor(e){this._settings=e,this._logger=new Jt("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new Mn({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),Mn.notifyOpener(e,t)}},Hn=class{constructor(e){this._settings=e,this._logger=new Jt("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let s=window.self;"top"===t&&(s=null!=(n=window.top)?n:window.self);const i=s.location[e].bind(s.location);let r;return{navigate:async e=>{this._logger.create("navigate");const t=new Promise(((e,t)=>{r=t}));return i(e.url),await t},close:()=>{this._logger.create("close"),null==r||r(new Error("Redirect aborted")),s.stop()}}}async callback(){}},Wn=class extends rn{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new Jt("UserManagerEvents"),this._userLoaded=new Xt("User loaded"),this._userUnloaded=new Xt("User unloaded"),this._silentRenewError=new Xt("Silent renew error"),this._userSignedIn=new Xt("User signed in"),this._userSignedOut=new Xt("User signed out"),this._userSessionChanged=new Xt("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},$n=class{constructor(e){this._userManager=e,this._logger=new Jt("SilentRenewService"),this._isStarted=!1,this._retryTimer=new en("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(t){if(t instanceof sn)return e.warn("ErrorTimeout from signinSilent:",t,"retry in 5s"),void this._retryTimer.init(5);e.error("Error from signinSilent:",t),this._userManager.events._raiseSilentRenewError(t)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},Dn=class{constructor(e,t){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.resource=t,this.data=e.state}},Bn=class{constructor(e,t,n,s){this._logger=new Jt("UserManager"),this.settings=new jn(e),this._client=new En(e),this._redirectNavigator=null!=t?t:new Hn(this.settings),this._popupNavigator=null!=n?n:new qn(this.settings),this._iframeNavigator=null!=s?s:new Nn(this.settings),this._events=new Wn(this.settings),this._silentRenewService=new $n(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new xn(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,s=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},s)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const s=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});s.debug("got signin response");const r=await this._buildUser(i);return r.profile&&r.profile.sub?s.info("success, signed in subject",r.profile.sub):s.info("no subject"),r}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:s,...i}=e,r=this.settings.popup_redirect_uri;r||t.throw(new Error("No popup_redirect_uri configured"));const o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:s}),a=await this._signin({request_type:"si:p",redirect_uri:r,display:"popup",...i},o);return a&&(a.profile&&a.profile.sub?t.info("success, signed in subject",a.profile.sub):t.info("no subject")),a}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:s,resource:i,...r}=e;let o=await this._loadUser();if(null==o?void 0:o.refresh_token){n.debug("using refresh token");const e=new Dn(o,i);return await this._useRefreshToken(e)}const a=this.settings.silent_redirect_uri;let c;a||n.throw(new Error("No silent_redirect_uri configured")),o&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",o.profile.sub),c=o.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:s});return o=await this._signin({request_type:"si:s",redirect_uri:a,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==o?void 0:o.id_token:void 0,...r},l,c),o&&((null==(t=o.profile)?void 0:t.sub)?n.info("success, signed in subject",o.profile.sub):n.info("no subject")),o}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new Cn({...e,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...s}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const r=await this._loadUser(),o=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),a=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==r?void 0:r.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...s},o);try{const e=await this._client.processSigninResponse(a.url);return t.debug("got signin response"),e.session_state&&e.profile.sub?(t.info("success for subject",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid}):(t.info("success, user not authenticated"),null)}catch(c){if(this.settings.monitorAnonymousSession&&c instanceof nn)switch(c.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:c.session_state}}throw c}}async _signin(e,t,n){const s=await this._signinStart(e,t);return await this._signinEnd(s.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const s=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:s.url,state:s.state.id,response_mode:s.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(s){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),s}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),s=await this._client.processSigninResponse(e);n.debug("got signin response");return await this._buildUser(s,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),s=new Cn(e);if(t){if(t!==s.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",s.profile.sub),new nn({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(s),n.debug("user stored"),this._events.load(s),s}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...s}=e,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...s},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:s,...i}=e,r=this.settings.popup_post_logout_redirect_uri,o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:s});await this._signout({request_type:"so:p",post_logout_redirect_uri:r,state:null==r?void 0:{},...i},o),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const s=this._logger.create("_signoutStart");try{const i=await this._loadUser();s.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const r=e.id_token_hint||i&&i.id_token;r&&(s.debug("setting id_token_hint in signout request"),e.id_token_hint=r),await this.removeUser(),s.debug("user removed, creating signout request");const o=await this._client.createSignoutRequest(e);return s.debug("got signout request"),await t.navigate({url:o.url,state:null==(n=o.state)?void 0:n.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(i){throw s.debug("error after preparing navigator, closing navigator window"),t.close(),i}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:s,...i}=e,r=this.settings.includeIdTokenInSilentSignout?null==(t=await this._loadUser())?void 0:t.id_token:void 0,o=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:s});await this._signout({request_type:"so:s",post_logout_redirect_uri:o,id_token_hint:r,...i},a),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const s=t.filter((t=>"string"==typeof e[t]));if(s.length){for(const t of s)await this._client.revokeToken(e[t],t),n.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}else n.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),Cn.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}};class AuthManager{}class AuthSubscriptions{constructor(){this.subscribers=[],this.lastNotifiedValue=void 0}add(e){return this.subscribers.push(e),this.lastNotifiedValue&&e(...this.lastNotifiedValue),{unsubscribe:()=>this.unsubscribe(e)}}notify(...e){this.lastNotifiedValue=e,this.subscribers.forEach((t=>{t(...e)}))}unsubscribe(e){if(e){const t=this.subscribers.indexOf(e);-1!==t&&this.subscribers.splice(t,1)}else this.subscribers=[]}}const zn=window.localStorage,Fn=null==(Kt=window.Capacitor)||null==(Kt=Kt.Plugins)?void 0:Kt.Storage,Jn=null==(Vt=window.Capacitor)||null==(Vt=Vt.Plugins)?void 0:Vt.Preferences,Kn=null==(Gt=window.Capacitor)||null==(Gt=Gt.Plugins)?void 0:Gt.SecureStoragePlugin;class MobileStorage{constructor(){if(this._logger=new Jt("MobileStorage"),!Kn){let e="[@badisi/auth-js] This application is currently using an unsafe storage.\n\n";e+="\u24d8 Please follow the recommended guide and use `capacitor-secure-storage-plugin` instead.",console.warn(e)}Kn?this._logger.debug("Using `capacitor-secure-storage-plugin` implementation"):Jn?this._logger.debug("Using `@capacitor/preferences` implementation"):Fn?this._logger.debug("Using `@capacitor/storage` implementation"):this._logger.debug("Using `localStorage` implementation")}get length(){return async function(){return Kn?(await Kn.keys()).value.length:Jn?(await Jn.keys()).keys.length:Fn?(await Fn.keys()).keys.length:zn.length}()}async key(e){return Kn?(await Kn.keys()).value[e]:Jn?(await Jn.keys()).keys[e]:Fn?(await Fn.keys()).keys[e]:zn.key(e)}async clear(){this._logger.create("clear"),Kn?await Kn.clear():Jn?await Jn.clear():Fn?await Fn.clear():zn.clear()}async getItem(e){if(this._logger.create(`getItem('${e}')`),!Kn)return Jn?(await Jn.get({key:e})).value:Fn?(await Fn.get({key:e})).value:zn.getItem(e);try{return(await Kn.get({key:e})).value}catch(t){return null}}async setItem(e,t){this._logger.create(`setItem('${e}')`),Kn?await Kn.set({key:e,value:t}):Jn?await Jn.set({key:e,value:t}):Fn?await Fn.set({key:e,value:t}):zn.setItem(e,t)}async removeItem(e){if(this._logger.create(`removeItem('${e}')`),Kn)try{await Kn.remove({key:e})}catch(t){}else Jn?await Jn.remove({key:e}):Fn?await Fn.remove({key:e}):zn.removeItem(e)}}let Vn=function(e){return e.REDIRECT="REDIRECT",e.POPUP="POPUP",e}({});class UserSession{constructor(){this.expired=void 0,this.expires_in=void 0,this.expires_at=void 0}static deserialize(e){const t=new UserSession,n=Object.keys(t);for(const s of n)t[s]=e[s];return t}}function Gn(e,t){if(null==e)return{};var n,s,i={},r=Object.keys(e);for(s=0;s=0||(i[n]=e[n]);return i}var Qn,Xn;const Yn=null==(Qn=window.Capacitor)||null==(Qn=Qn.Plugins)?void 0:Qn.App,Zn=null==(Xn=window.Capacitor)||null==(Xn=Xn.Plugins)?void 0:Xn.Browser;class MobileWindow{constructor(e,t){if(this.redirectUrl=e,this.params=t,this._logger=new Jt("MobileWindow"),this.capacitorAppUrlOpenHandle=void 0,this.capacitorBrowserFinishedHandle=void 0,this.originalHandleOpenURL=window.handleOpenURL,this.timer=void 0,this.navigateLogger=void 0,this._resolve=void 0,this._reject=void 0,this._isClosed=!0,this._receivedResult=!1,!AuthUtils.isCapacitor()&&!AuthUtils.isCordova()){let e="[@badisi/auth-js] Required core dependency not found.\n\n";e+="\u24d8 Please follow the recommended guide and install either `Capacitor` or `Cordova` dependency.",console.error(e)}if(!Zn){let e="[@badisi/auth-js] Required plugin not found.\n\n";e+="\u24d8 Please follow the recommended guide and install either `@badisi/capacitor-browsertab` or `@capacitor/browser` plugin.",console.error(e)}Zn&&this._logger.debug("Using `@capacitor/browser` implementation")}async navigate(e){return this.navigateLogger=this._logger.create("navigate"),this.navigateLogger.debug("url",e.url),this._isClosed=!1,this._receivedResult=!1,new Promise(((t,n)=>{this._resolve=t,this._reject=n,this.installCustomUrlSchemeHandler().then((()=>{Zn&&this.useCapacitorBrowser(e)}))}))}async close(){const e=this._logger.create("close");this._isClosed||await(null==Zn?void 0:Zn.close().catch((t=>e.error(t)))),e.debug("success")}async cleanup(){var e,t;const n=this._logger.create("cleanup");window.handleOpenURL=this.originalHandleOpenURL,await(null==(e=this.capacitorBrowserFinishedHandle)?void 0:e.remove()),await(null==(t=this.capacitorAppUrlOpenHandle)?void 0:t.remove()),clearTimeout(this.timer),n.debug("success")}async onError(e){var t,n;null==(t=this.navigateLogger)||t.error("error response:",e),await this.close(),await this.cleanup(),null==(n=this._reject)||n.call(this,new Error(e)),this._receivedResult=!0}async onSuccess(e){var t,n;null==(t=this.navigateLogger)||t.debug("successful response:",e),await this.close(),await this.cleanup(),null==(n=this._resolve)||n.call(this,{url:e}),this._receivedResult=!0}async useCapacitorBrowser(e){this.capacitorBrowserFinishedHandle=await(null==Zn?void 0:Zn.addListener("browserFinished",(()=>{this._isClosed=!0,setTimeout((()=>{var e;this._receivedResult||(this.cleanup(),null==(e=this._reject)||e.call(this,"Capacitor browser closed by user"))}),1e3)}))),await(null==Zn?void 0:Zn.open({url:e.url,toolbarColor:this.params.mobileWindowToolbarColor,presentationStyle:this.params.mobileWindowPresentationStyle,width:this.params.mobileWindowWidth,height:this.params.mobileWindowWidth}))}async useBrowserTab(e){}async installCustomUrlSchemeHandler(){const e=this._logger.create("installCustomUrlSchemeHandler");this.timer=setTimeout((()=>{this.onError("Installing custom url scheme handler, timed out without a response")}),1e4),await this.cleanup(),AuthUtils.isCapacitor()?(e.debug("listening to Capacitor `appUrlOpen` event"),this.capacitorAppUrlOpenHandle=await(null==Yn||null==Yn.addListener?void 0:Yn.addListener("appUrlOpen",(({url:e})=>{AuthUtils.isUrlMatching(e,this.redirectUrl)&&this.onSuccess(e)})))):AuthUtils.isCordova()&&(e.debug("waiting for Cordova `handleOpenURL` callback"),window.handleOpenURL=e=>{var t;null==(t=this.originalHandleOpenURL)||t.call(this,e),AuthUtils.isUrlMatching(e,this.redirectUrl)&&this.onSuccess(e)}),e.debug("success")}}class MobileNavigator{constructor(){this._logger=new Jt("MobileNavigator")}prepare(e,t){return this._logger.create("prepare"),new MobileWindow(e,t)}}const es=["mobileWindowToolbarColor","mobileWindowPresentationStyle","mobileWindowWidth","mobileWindowHeight"],ts=["mobileWindowToolbarColor","mobileWindowPresentationStyle","mobileWindowWidth","mobileWindowHeight"];var ns=d("mobileNavigator");class OidcUserManager extends Bn{constructor(e){super(Object.assign({authority:e.authorityUrl,client_id:e.clientId,scope:e.scope,loadUserInfo:e.loadUserInfo,automaticSilentRenew:e.automaticSilentRenew},e.internal)),this.libSettings=e,Object.defineProperty(this,ns,{writable:!0,value:void 0}),c(this,ns)[ns]=new MobileNavigator}async signoutMobile(e={}){var t,n,s,i;const r=this._logger.create("signout"),{mobileWindowToolbarColor:o,mobileWindowPresentationStyle:a,mobileWindowWidth:l,mobileWindowHeight:d}=e,u=Gn(e,es),h={mobileWindowToolbarColor:null!=o?o:null==(t=this.libSettings.internal)?void 0:t.mobileWindowToolbarColor,mobileWindowPresentationStyle:null!=a?a:null==(n=this.libSettings.internal)?void 0:n.mobileWindowPresentationStyle,mobileWindowWidth:null!=l?l:null==(s=this.libSettings.internal)?void 0:s.mobileWindowWidth,mobileWindowHeight:null!=d?d:null==(i=this.libSettings.internal)?void 0:i.mobileWindowHeight},p=c(this,ns)[ns].prepare(this.settings.post_logout_redirect_uri,h);await this._signout(Object.assign({request_type:"so:m",post_logout_redirect_uri:this.settings.post_logout_redirect_uri},u),p),r.info("success")}async signinMobile(e={}){var t,n,s,i,r;const o=this._logger.create("signin"),{mobileWindowToolbarColor:a,mobileWindowPresentationStyle:l,mobileWindowWidth:d,mobileWindowHeight:u}=e,h=Gn(e,ts),p={mobileWindowToolbarColor:null!=a?a:null==(t=this.libSettings.internal)?void 0:t.mobileWindowToolbarColor,mobileWindowPresentationStyle:null!=l?l:null==(n=this.libSettings.internal)?void 0:n.mobileWindowPresentationStyle,mobileWindowWidth:null!=d?d:null==(s=this.libSettings.internal)?void 0:s.mobileWindowWidth,mobileWindowHeight:null!=u?u:null==(i=this.libSettings.internal)?void 0:i.mobileWindowHeight},g=c(this,ns)[ns].prepare(this.settings.redirect_uri,p),_=await this._signin(Object.assign({request_type:"si:m",redirect_uri:this.settings.redirect_uri},h),g);null!=_&&null!=(r=_.profile)&&r.sub?o.info("success, signed in subject",_.profile.sub):o.info("no subject")}}const ss="auth-js:oidc_manager:redirect_url",is={loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!1,automaticSilentRenew:!0,desktopNavigationType:Vn.REDIRECT,scope:"openid profile email phone",logLevel:Ft.NONE,internal:{response_type:"code",redirect_uri:"?oidc-callback=login",post_logout_redirect_uri:"?oidc-callback=logout",popup_redirect_uri:"oidc/callback/popup_redirect.html",popup_post_logout_redirect_uri:"oidc/callback/popup_redirect.html",silent_redirect_uri:"oidc/callback/silent_redirect.html",mobileWindowPresentationStyle:"popover"}};var rs=d("idTokenSubs"),os=d("accessTokenSubs"),as=d("userProfileSubs"),cs=d("userSessionSubs"),ls=d("authenticatedSubs"),ds=d("renewingSubs"),us=d("redirectSubs"),hs=d("userManagerSubs"),ps=d("idToken"),gs=d("accessToken"),_s=d("userProfile"),ms=d("userSession"),fs=d("isAuthenticated"),ws=d("isRenewing"),vs=d("userManager"),bs=d("settings"),ys=d("user"),Ss=d("assertNotInInceptionLoop"),ks=d("waitForRenew"),Es=d("postLogoutVerification"),xs=d("notifyRenew"),Cs=d("runSyncOrAsync"),Ts=d("redirect"),Us=d("removeUser"),As=d("signinSilent"),Ps=d("callSignin"),Rs=d("callSignout");class OIDCAuthManager extends AuthManager{constructor(...e){super(...e),Object.defineProperty(this,Rs,{value:$s}),Object.defineProperty(this,Ps,{value:Ws}),Object.defineProperty(this,As,{value:Hs}),Object.defineProperty(this,Us,{value:qs}),Object.defineProperty(this,Ts,{value:Ms}),Object.defineProperty(this,Cs,{value:Ns}),Object.defineProperty(this,xs,{value:Ls}),Object.defineProperty(this,Es,{value:js}),Object.defineProperty(this,ks,{value:Os}),Object.defineProperty(this,Ss,{value:Is}),Object.defineProperty(this,rs,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,os,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,as,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,cs,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,ls,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,ds,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,us,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,hs,{writable:!0,value:[]}),Object.defineProperty(this,ps,{writable:!0,value:void 0}),Object.defineProperty(this,gs,{writable:!0,value:void 0}),Object.defineProperty(this,_s,{writable:!0,value:void 0}),Object.defineProperty(this,ms,{writable:!0,value:void 0}),Object.defineProperty(this,fs,{writable:!0,value:!1}),Object.defineProperty(this,ws,{writable:!0,value:!1}),Object.defineProperty(this,vs,{writable:!0,value:void 0}),Object.defineProperty(this,bs,{writable:!0,value:is}),Object.defineProperty(this,ys,{writable:!0,value:void 0})}set user(e){c(this,ys)[ys]!==e&&(c(this,ys)[ys]=e,c(this,ps)[ps]=e?e.id_token:void 0,c(this,gs)[gs]=e?e.access_token:void 0,c(this,_s)[_s]=null!=e&&e.profile?e.profile:void 0,c(this,ms)[ms]=e?UserSession.deserialize(e):void 0,c(this,fs)[fs]=!(!e||e.expired),c(this,rs)[rs].notify(c(this,ps)[ps]),c(this,os)[os].notify(c(this,gs)[gs]),c(this,as)[as].notify(c(this,_s)[_s]),c(this,cs)[cs].notify(c(this,ms)[ms]),c(this,ls)[ls].notify(c(this,fs)[fs]))}async init(e){var t,n,s,i,r,o,a,l,d,u=this;Ft.setLevel(null!=(t=null!=(n=e.logLevel)?n:is.logLevel)?t:Ft.NONE),Ft.setLogger(console);const h=AuthUtils.isNativeMobile(),p=h?`${e.mobileScheme}://localhost/`:AuthUtils.getBaseUrl();if(c(this,bs)[bs]=It({},is,{internal:{userStore:new dn({store:h?new MobileStorage:new an}),redirect_uri:`${p}${null==(s=is.internal)?void 0:s.redirect_uri}`,post_logout_redirect_uri:`${p}${null==(i=is.internal)?void 0:i.post_logout_redirect_uri}`,popup_redirect_uri:`${p}${null==(r=is.internal)?void 0:r.popup_redirect_uri}`,popup_post_logout_redirect_uri:`${p}${null==(o=is.internal)?void 0:o.popup_post_logout_redirect_uri}`,silent_redirect_uri:`${p}${null==(a=is.internal)?void 0:a.silent_redirect_uri}`}},e),c(this,vs)[vs]=new OidcUserManager(c(this,bs)[bs]),c(this,hs)[hs].push(c(this,vs)[vs].events.addUserLoaded((e=>{this.user=e})),c(this,vs)[vs].events.addUserUnloaded((()=>{c(this,ys)[ys]&&(this.user=null,c(this,bs)[bs].loginRequired&&location.reload())})),c(this,vs)[vs].events.addSilentRenewError((async function(){await c(u,Us)[Us]()}))),c(this,Ss)[Ss](),AuthUtils.isUrlMatching(location.href,null==(l=c(this,bs)[bs].internal)?void 0:l.redirect_uri))await c(this,Cs)[Cs]((async function(){const e=sessionStorage.getItem(ss);await c(u,Ps)[Ps]((()=>c(u,vs)[vs].signinRedirectCallback(location.href)),e),sessionStorage.removeItem(ss)}));else if(AuthUtils.isUrlMatching(location.href,null==(d=c(this,bs)[bs].internal)?void 0:d.post_logout_redirect_uri))await c(this,Cs)[Cs]((async function(){const e=sessionStorage.getItem(ss);await c(u,Rs)[Rs]((()=>c(u,vs)[vs].signoutRedirectCallback(location.href)),e),sessionStorage.removeItem(ss)}));else if(c(this,bs)[bs].retrieveUserSession||c(this,bs)[bs].loginRequired){var g;const e=async function(){await c(u,Cs)[Cs]((()=>c(u,As)[As]().catch((async function(e){const{error:t,message:n}=e;if(c(u,bs)[bs].loginRequired&&(null!=t&&t.includes("_required")||null!=n&&n.includes("_required")))await u.login();else if(console.error("[OIDCAuthManager] User's session cannot be retrieved:",e.message),c(u,ls)[ls].notify(!1),c(u,bs)[bs].loginRequired)throw e}))))},t=await(null==(g=c(this,vs)[vs])?void 0:g.getUser());!t||t.expired?!h&&c(this,bs)[bs].retrieveUserSession?await e():c(this,bs)[bs].loginRequired?await this.login():this.user=null:this.user=t}else this.user=null}async logout(e){var t,n;const s=null!=(t=null==e?void 0:e.redirectUrl)?t:location.href;var i;if(AuthUtils.isNativeMobile())await c(this,Rs)[Rs]((()=>c(this,vs)[vs].signoutMobile(e)),s);else switch(null!=(i=null==e?void 0:e.desktopNavigationType)?i:c(this,bs)[bs].desktopNavigationType){case Vn.POPUP:await c(this,Rs)[Rs]((()=>c(this,vs)[vs].signoutPopup(e)),s);break;case Vn.REDIRECT:default:sessionStorage.setItem(ss,s),await(null==(n=c(this,vs)[vs])?void 0:n.signoutRedirect(e))}}async login(e){var t,n;const s=null!=(t=null==e?void 0:e.redirectUrl)?t:location.href;var i;if(AuthUtils.isNativeMobile())await c(this,Ps)[Ps]((()=>c(this,vs)[vs].signinMobile(e)),s);else switch(null!=(i=null==e?void 0:e.desktopNavigationType)?i:c(this,bs)[bs].desktopNavigationType){case Vn.POPUP:await c(this,Ps)[Ps]((()=>c(this,vs)[vs].signinPopup(e)),s);break;case Vn.REDIRECT:default:sessionStorage.setItem(ss,s),await(null==(n=c(this,vs)[vs])?void 0:n.signinRedirect(e))}return c(this,fs)[fs]}async renew(e){return c(this,As)[As](e).catch((e=>console.error(e)))}getSettings(){return c(this,bs)[bs]}isRenewing(){return c(this,ws)[ws]}async isAuthenticated(){return await c(this,ks)[ks]("isAuthenticated()"),c(this,fs)[fs]}async getUserProfile(){return await c(this,ks)[ks]("getUserProfile()"),c(this,_s)[_s]}async getUserSession(){return await c(this,ks)[ks]("getUserSession()"),c(this,ms)[ms]}async getIdToken(){return await c(this,ks)[ks]("getIdToken()"),c(this,ps)[ps]}async getIdTokenDecoded(){return await c(this,ks)[ks]("getIdTokenDecoded()"),AuthUtils.decodeJwt(c(this,ps)[ps])}async getAccessToken(){return await c(this,ks)[ks]("getAccessToken()"),c(this,gs)[gs]}async getAccessTokenDecoded(){return await c(this,ks)[ks]("getAccessTokenDecoded()"),AuthUtils.decodeJwt(c(this,gs)[gs])}destroy(){c(this,rs)[rs].unsubscribe(),c(this,os)[os].unsubscribe(),c(this,as)[as].unsubscribe(),c(this,cs)[cs].unsubscribe(),c(this,ls)[ls].unsubscribe(),c(this,ds)[ds].unsubscribe(),c(this,us)[us].unsubscribe(),c(this,hs)[hs].forEach((e=>e()))}onIdTokenChanged(e){return c(this,rs)[rs].add(e)}onAccessTokenChanged(e){return c(this,os)[os].add(e)}onUserProfileChanged(e){return c(this,as)[as].add(e)}onUserSessionChanged(e){return c(this,cs)[cs].add(e)}onAuthenticatedChanged(e){return c(this,ls)[ls].add(e)}onRenewingChanged(e){return c(this,ds)[ds].add(e)}onRedirect(e){return c(this,us)[us].add(e)}}function Is(){var e,t;[null==(e=c(this,bs)[bs].internal)?void 0:e.silent_redirect_uri,null==(t=c(this,bs)[bs].internal)?void 0:t.popup_redirect_uri].forEach((e=>{var t;const n=null==(t=new RegExp(/^.*\/(.*).html$/gm).exec(null!=e?e:""))?void 0:t[1],s=new Error(`[OIDCAuthManager] ${null!=e?e:"redirect uri"} was not found.`);if(s.stack=void 0,AuthUtils.isUrlMatching(location.href,e))throw s.message+="\n\n\u24d8 This usually means you forgot to include the redirect html files in your application assets.",s;if(location.href.includes(`/${n}.html`))throw s.message+="\n\n\u24d8 This usually means your redirect urls are misconfigured.",s}))}async function Os(e){const t=Date.now();for(;c(this,ws)[ws];){if(Date.now()>t+5e3){console.warn("[@badisi/auth-js]",`\`${e}\``,"timed out waiting for renew to finish.");break}await new Promise((e=>setTimeout(e,100)))}}function js(e){const t=AuthUtils.stringToURL(null!=e?e:"/");c(this,bs)[bs].loginRequired&&location.origin===t.origin&&location.reload()}function Ls(e){c(this,ws)[ws]=e,c(this,ds)[ds].notify(e)}async function Ns(e){c(this,bs)[bs].loginRequired?await e():e()}async function Ms(e,t){t&&(console.error(t),await c(this,Us)[Us]());const n=AuthUtils.stringToURL(null!=e?e:"/");location.origin===n.origin?(history.replaceState(history.state,"",n.href),c(this,us)[us].notify(n)):location.href=n.href}async function qs(){var e,t;this.user=null,await Promise.all([null==(e=c(this,vs)[vs])?void 0:e.clearStaleState(),null==(t=c(this,vs)[vs])?void 0:t.removeUser()])}async function Hs(e){c(this,xs)[xs](!0);try{var t;await(null==(t=c(this,vs)[vs])?void 0:t.signinSilent(e))}catch(n){throw await c(this,Us)[Us](),n}finally{c(this,xs)[xs](!1)}}async function Ws(e,t){try{c(this,xs)[xs](!0),await e().catch((e=>{var t;throw"Attempted to navigate on a disposed window"===(null==(t=e)?void 0:t.message)&&((e=new Error("[OIDCAuthManager] Attempted to navigate on a disposed window.")).stack=void 0,e.message+="\n\n\u24d8 This may be due to an ad blocker."),e})),await c(this,Ts)[Ts](t)}catch(n){throw await c(this,Ts)[Ts]("/",n),n}finally{c(this,xs)[xs](!1)}}async function $s(e,t){try{await e().catch((e=>{var t;throw"Attempted to navigate on a disposed window"===(null==(t=e)?void 0:t.message)&&((e=new Error("[OIDCAuthManager] Attempted to navigate on a disposed window.")).stack=void 0,e.message+="\n\n\u24d8 This may be due to an ad blocker."),e})),await c(this,Ts)[Ts](t),await c(this,Us)[Us]()}catch(n){throw t="/",await c(this,Ts)[Ts](t,n),n}finally{c(this,Es)[Es](t)}}const Ds=(e=>e.CapacitorPlatforms=(e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t};return n.addPlatform=(e,t)=>{n.platforms.set(e,t)},n.setPlatform=e=>{n.platforms.has(e)&&(n.currentPlatform=n.platforms.get(e))},n})(e))("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});Ds.addPlatform,Ds.setPlatform;var Bs;!function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"}(Bs||(Bs={}));class CapacitorException extends Error{constructor(e,t,n){super(e),this.message=e,this.code=t,this.data=n}}const zs=e=>{var t,n,s,i,r;const o=e.CapacitorCustomPlatform||null,a=e.Capacitor||{},c=a.Plugins=a.Plugins||{},l=e.CapacitorPlatforms,d=(null===(t=null==l?void 0:l.currentPlatform)||void 0===t?void 0:t.getPlatform)||(()=>null!==o?o.name:(e=>{var t,n;return(null==e?void 0:e.androidBridge)?"android":(null===(n=null===(t=null==e?void 0:e.webkit)||void 0===t?void 0:t.messageHandlers)||void 0===n?void 0:n.bridge)?"ios":"web"})(e)),u=(null===(n=null==l?void 0:l.currentPlatform)||void 0===n?void 0:n.isNativePlatform)||(()=>"web"!==d()),h=(null===(s=null==l?void 0:l.currentPlatform)||void 0===s?void 0:s.isPluginAvailable)||(e=>{const t=g.get(e);return!!(null==t?void 0:t.platforms.has(d()))||!!p(e)}),p=(null===(i=null==l?void 0:l.currentPlatform)||void 0===i?void 0:i.getPluginHeader)||(e=>{var t;return null===(t=a.PluginHeaders)||void 0===t?void 0:t.find((t=>t.name===e))}),g=new Map,_=(null===(r=null==l?void 0:l.currentPlatform)||void 0===r?void 0:r.registerPlugin)||((e,t={})=>{const n=g.get(e);if(n)return console.warn(`Capacitor plugin "${e}" already registered. Cannot register plugins twice.`),n.proxy;const s=d(),i=p(e);let r;const l=n=>{let c;const l=(...l)=>{const d=(async()=>(!r&&s in t?r=r="function"==typeof t[s]?await t[s]():t[s]:null!==o&&!r&&"web"in t&&(r=r="function"==typeof t.web?await t.web():t.web),r))().then((t=>{const r=((t,n)=>{var r,o;if(!i){if(t)return null===(o=t[n])||void 0===o?void 0:o.bind(t);throw new CapacitorException(`"${e}" plugin is not implemented on ${s}`,Bs.Unimplemented)}{const s=null==i?void 0:i.methods.find((e=>n===e.name));if(s)return"promise"===s.rtype?t=>a.nativePromise(e,n.toString(),t):(t,s)=>a.nativeCallback(e,n.toString(),t,s);if(t)return null===(r=t[n])||void 0===r?void 0:r.bind(t)}})(t,n);if(r){const e=r(...l);return c=null==e?void 0:e.remove,e}throw new CapacitorException(`"${e}.${n}()" is not implemented on ${s}`,Bs.Unimplemented)}));return"addListener"===n&&(d.remove=async()=>c()),d};return l.toString=()=>`${n.toString()}() { [capacitor code] }`,Object.defineProperty(l,"name",{value:n,writable:!1,configurable:!1}),l},u=l("addListener"),h=l("removeListener"),_=(e,t)=>{const n=u({eventName:e},t),s=async()=>{const s=await n;h({eventName:e,callbackId:s},t)},i=new Promise((e=>n.then((()=>e({remove:s})))));return i.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()},i},m=new Proxy({},{get(e,t){switch(t){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return i?_:u;case"removeListener":return h;default:return l(t)}}});return c[e]=m,g.set(e,{name:e,proxy:m,platforms:new Set([...Object.keys(t),...i?[s]:[]])}),m});return a.convertFileSrc||(a.convertFileSrc=e=>e),a.getPlatform=d,a.handleError=t=>e.console.error(t),a.isNativePlatform=u,a.isPluginAvailable=h,a.pluginMethodNoop=(e,t,n)=>Promise.reject(`${n} does not have an implementation of "${t}".`),a.registerPlugin=_,a.Exception=CapacitorException,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a.platform=a.getPlatform(),a.isNative=a.isNativePlatform(),a},Fs=(e=>e.Capacitor=zs(e))("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),Js=Fs.registerPlugin;Fs.Plugins;class WebPlugin{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const s=async()=>this.removeListener(e,t),i=Promise.resolve({remove:s});return Object.defineProperty(i,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()}}),i}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t){const n=this.listeners[e];n&&n.forEach((e=>e(t)))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:e=>{this.notifyListeners(t,e)}}}unimplemented(e="not implemented"){return new Fs.Exception(e,Bs.Unimplemented)}unavailable(e="not available"){return new Fs.Exception(e,Bs.Unavailable)}async removeListener(e,t){const n=this.listeners[e];if(!n)return;const s=n.indexOf(t);this.listeners[e].splice(s,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const Ks=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Vs=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class CapacitorCookiesPluginWeb extends WebPlugin{async getCookies(){const e=document.cookie,t={};return e.split(";").forEach((e=>{if(e.length<=0)return;let[n,s]=e.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=Vs(n).trim(),s=Vs(s).trim(),t[n]=s})),t}async setCookie(e){try{const t=Ks(e.key),n=Ks(e.value),s=`; expires=${(e.expires||"").replace("expires=","")}`,i=(e.path||"/").replace("path=",""),r=null!=e.url&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${n||""}${s}; path=${i}; ${r};`}catch(t){return Promise.reject(t)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${(new Date).toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}Js("CapacitorCookies",{web:()=>new CapacitorCookiesPluginWeb});const Gs=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),s=((e={})=>{const t=Object.keys(e);return Object.keys(e).map((e=>e.toLocaleLowerCase())).reduce(((n,s,i)=>(n[s]=e[t[i]],n)),{})})(e.headers)["content-type"]||"";if("string"==typeof e.data)n.body=e.data;else if(s.includes("application/x-www-form-urlencoded")){const t=new URLSearchParams;for(const[n,s]of Object.entries(e.data||{}))t.set(n,s);n.body=t.toString()}else if(s.includes("multipart/form-data")||e.data instanceof FormData){const t=new FormData;if(e.data instanceof FormData)e.data.forEach(((e,n)=>{t.append(n,e)}));else for(const n of Object.keys(e.data))t.append(n,e.data[n]);n.body=t;const s=new Headers(n.headers);s.delete("content-type"),n.headers=s}else(s.includes("application/json")||"object"==typeof e.data)&&(n.body=JSON.stringify(e.data));return n};class CapacitorHttpPluginWeb extends WebPlugin{async request(e){const t=Gs(e,e.webFetchExtra),n=((e,t=!0)=>e?Object.entries(e).reduce(((e,n)=>{const[s,i]=n;let r,o;return Array.isArray(i)?(o="",i.forEach((e=>{r=t?encodeURIComponent(e):e,o+=`${s}=${r}&`})),o.slice(0,-1)):(r=t?encodeURIComponent(i):i,o=`${s}=${r}`),`${e}&${o}`}),"").substr(1):null)(e.params,e.shouldEncodeUrlParams),s=n?`${e.url}?${n}`:e.url,i=await fetch(s,t),r=i.headers.get("content-type")||"";let o,a,{responseType:c="text"}=i.ok?e:{};switch(r.includes("application/json")&&(c="json"),c){case"arraybuffer":case"blob":a=await i.blob(),o=await(async e=>new Promise(((t,n)=>{const s=new FileReader;s.onload=()=>{const e=s.result;t(e.indexOf(",")>=0?e.split(",")[1]:e)},s.onerror=e=>n(e),s.readAsDataURL(e)})))(a);break;case"json":o=await i.json();break;default:o=await i.text()}const l={};return i.headers.forEach(((e,t)=>{l[t]=e})),{data:o,headers:l,status:i.status,url:i.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}Js("CapacitorHttp",{web:()=>new CapacitorHttpPluginWeb});const Qs='\n .flex {\n flex: 1;\n }\n\n .hidden {\n display: none !important;\n }\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .column {\n display: flex;\n flex-direction: column;\n }\n\n .card {\n border: 1px solid rgba(0, 0, 0, 0.12);\n border-radius: 4px;\n background-color: white;\n margin: 12px 6px;\n }\n\n .card .card-status {\n display: block;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n margin-left: 8px;\n background-color: #f2f2f2;\n }\n .card .card-status.error {\n background-color: #ef5350;\n }\n .card .card-status.success {\n background-color: #66bb6a;\n }\n\n .card .card-title {\n padding: 16px;\n font-size: 20px;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.87);\n align-items: center;\n }\n\n .card .box {\n height: 200px;\n border-top: 1px solid lightgray;\n word-break: break-all;\n overflow: auto;\n background-color: #f2f2f2;\n padding: 12px;\n }\n .card .box pre {\n margin: 0;\n }\n\n .card .card-actions {\n padding: 0 14px 8px 14px;\n min-height: 50px;\n }\n .card .card-actions .input {\n display: flex;\n align-items: center;\n }\n .card .card-actions .input:not(:last-child) {\n margin-bottom: 8px;\n }\n .card .card-actions .input label {\n width: 125px;\n text-align: right;\n margin-right: 14px;\n }\n .card .card-actions .input input {\n padding: 4px;\n }\n\n .json-key {\n color: rgb(124, 77, 255);\n }\n\n .json-value {\n color: rgb(67, 122, 237);\n }\n\n .json-string {\n color: rgb(83, 160, 83);\n }\n\n .json-date {\n color: rgb(200, 56, 198);\n }\n\n input {\n color: #5e35b1;\n padding: 10px;\n border: 1px solid #0000001f;\n border-radius: 4px;\n font-size: 14px;\n }\n\n input:invalid {\n border-color: #f44336;\n }\n\n input[type="checkbox"] {\n margin-right: 10px;\n }\n\n select {\n color: #5e35b1;\n padding: 8px 6px;\n border: 1px solid #0000001f;\n border-radius: 4px;\n }\n\n @media only screen and (max-width: 600px) {\n :host {\n padding: 0 !important;\n padding-bottom: 24px !important;\n }\n\n :host .card {\n border-left: 0;\n border-right: 0;\n border-radius: 0;\n margin: 0;\n margin-bottom: 6px;\n }\n }\n',Xs=(e,t=[])=>e?JSON.stringify(e,null,2).replace(/&/g,"&").replace(/\\"/g,""").replace(//g,">").replace(/^( *)("[\w-]+": )?("[^"]*"|[\w.+-]*)?([,[{])?$/gm,((e,n,s,i,r)=>{let o=n||"";const a=s?s.replace(/[": ]/g,""):void 0;if(a&&(o+=`${a}: `),i&&(o+=`${i}`,a&&t.includes(a))){const e=new Date(1e3*Number(i)),t=`${e.toDateString()}, ${e.toLocaleTimeString()}`;t&&(o+=` (${t})`)}return o+(r||"")})):"",Ys=document.createElement("template");Ys.innerHTML=`\n \n\n
\n
\n\n \n \n \n \n \n \n \n \n\n
\n \ud83d\udee1\ufe0fDemo app { }\n
\ud83d\udc48 choose an implementation
\n
\n\n
\n \n \n \n
\n\n
\n
\n`;class DemoAppHeaderElement extends HTMLElement{constructor(){var e;super(),this.listeners=[],this.implSelectEl=void 0,this.statusEl=void 0,this.versionEl=void 0,this.loginButtonEl=void 0,this.logoutButtonEl=void 0,this.silentRenewButtonEl=void 0,this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(Ys.content,!0)),this.implSelectEl=this.shadowRoot.querySelector("#implementation-select"),this.statusEl=this.shadowRoot.querySelector(".status"),this.versionEl=this.shadowRoot.querySelector(".version"),this.loginButtonEl=this.shadowRoot.querySelector("#login-button"),this.logoutButtonEl=this.shadowRoot.querySelector("#logout-button"),this.silentRenewButtonEl=this.shadowRoot.querySelector("#silent-renew-button")}set isRenewing(e){this.statusEl&&this.statusEl.classList[e?"add":"remove"]("loading")}set isAuthenticated(e){this.statusEl&&null!==e&&(this.statusEl.classList.remove("loading"),this.statusEl.title=e?"Authenticated":"Not authenticated",this.statusEl.classList[e?"add":"remove"]("authenticated"),this.statusEl.classList[e?"remove":"add"]("not-authenticated"))}connectedCallback(){if(window.location.href.includes(":4200")){const e=document.createElement("option");e.textContent="localhost",this.implSelectEl.appendChild(e)}else{window.appSettings.getImplementations().forEach((e=>{const t=document.createElement("option");t.value=String(e.label),t.textContent=e.label,this.implSelectEl.appendChild(t)}));const e=()=>{window.location.href=window.appSettings.getImplementations()[this.implSelectEl.selectedIndex].demoUrl};this.implSelectEl.addEventListener("change",e),this.listeners.push((()=>this.implSelectEl.removeEventListener("change",e)))}const e=()=>{var e;null==(e=this.shadowRoot)||null==(e=e.querySelector("header .title .tip"))||e.remove(),window.appSettings.setShowTip(!1)};window.appSettings.get().showTip?(this.implSelectEl.addEventListener("click",e,{once:!0}),this.listeners.push((()=>this.implSelectEl.removeEventListener("click",e)))):e(),this.refreshImplementation(),this.addEventListeners()}disconnectedCallback(){this.listeners.forEach((e=>e()))}addEventListeners(){var e,t,n;const s=()=>this.dispatchEvent(new Event("login",{bubbles:!0,composed:!0}));null==(e=this.loginButtonEl)||e.addEventListener("click",s);const i=()=>this.dispatchEvent(new Event("logout",{bubbles:!0,composed:!0}));null==(t=this.logoutButtonEl)||t.addEventListener("click",i);const r=()=>this.dispatchEvent(new Event("silentRenew",{bubbles:!0,composed:!0}));null==(n=this.silentRenewButtonEl)||n.addEventListener("click",r),this.listeners.push((()=>{var e;return null==(e=this.loginButtonEl)?void 0:e.removeEventListener("click",s)}),(()=>{var e;return null==(e=this.logoutButtonEl)?void 0:e.removeEventListener("click",i)}),(()=>{var e;return null==(e=this.silentRenewButtonEl)?void 0:e.removeEventListener("click",r)}))}refreshImplementation(){const e=window.appSettings.getImplementations();if(window.location.href.includes(":4200"))this.implSelectEl.selectedIndex=0,this.versionEl.innerHTML="@localhost";else{const t=e.findIndex((e=>window.location.href.includes(e.demoUrl))),n=-1!==t?e[t]:e[0];this.implSelectEl.selectedIndex=-1!==t?t:0,this.versionEl.innerHTML=n.version}}}window.customElements.define("demo-app-header",DemoAppHeaderElement);const Zs=document.createElement("template");Zs.innerHTML=`\n \n\n \n \n
\n \n
\n`;class DemoAppMainElement extends HTMLElement{constructor(){var e;super(),this.listeners=[],this.tabsContentEl=void 0,this.demoAppHeaderEl=void 0,this.tabs=[],this.views=[],this.currentTabIndex=-1,this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(Zs.content,!0)),this.tabsContentEl=this.shadowRoot.querySelector(".tabs-content"),this.demoAppHeaderEl=this.shadowRoot.querySelector("demo-app-header")}set isRenewing(e){this.demoAppHeaderEl.isRenewing=e}set isAuthenticated(e){this.demoAppHeaderEl.isAuthenticated=e}connectedCallback(){this.drawTabs(),this.showView(window.appSettings?window.appSettings.get().currentTabIndex:0)}disconnectedCallback(){this.listeners.forEach((e=>e()))}drawTabs(){const e=this.shadowRoot.querySelector("#views"),t=this.shadowRoot.querySelector("#tabs");e&&t&&(this.views=e.assignedElements(),this.views.forEach(((e,n)=>{e.style.display="none";const s=document.createElement("a");s.textContent=e.getAttribute("tabLabel")||"?";const i=()=>this.showView(n);s.addEventListener("click",i),this.listeners.push((()=>s.removeEventListener("click",i))),t.appendChild(s),this.tabs.push(s)})))}showView(e){var t;this.currentTabIndex!==e&&(this.currentTabIndex=e,this.tabs.forEach(((t,n)=>{t.classList[n!==e?"remove":"add"]("selected")})),this.views.forEach(((t,n)=>{t.style.display=n!==e?"none":"flex"})),null==(t=this.tabsContentEl)||t.scrollTo(0,0),window.appSettings.setCurrentTabIndex(e))}}window.customElements.define("demo-app-main",DemoAppMainElement);const ei=document.createElement("template");ei.innerHTML=`\n \n\n
\n
\n APIs access\n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n
\n \n
\n            
\n
\n
\n\n \n`;class DemoAppPlaygroundElement extends HTMLElement{constructor(){var e;super(),this.listeners=[],this.apiStatusEl=void 0,this.apiResponseEl=void 0,this.apiUrlEl=void 0,this.apiHeadersEl=void 0,this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(ei.content,!0)),this.apiStatusEl=this.shadowRoot.querySelector("#api-status"),this.apiResponseEl=this.shadowRoot.querySelector("#api-response"),this.apiUrlEl=this.shadowRoot.querySelector("#api-url-input"),this.apiHeadersEl=this.shadowRoot.querySelector("#api-headers-input")}connectedCallback(){var e,t,n;const s=null==(e=this.shadowRoot)?void 0:e.querySelector("#api-get-button"),i=()=>{const e=new CustomEvent("api",{bubbles:!0,composed:!0,detail:{url:this.apiUrlEl.value,headers:this.apiHeadersEl.value}});return this.dispatchEvent(e)};null==s||s.addEventListener("click",i);const r=()=>this.saveSettings({privateApiUrl:this.apiUrlEl.value});null==(t=this.apiUrlEl)||t.addEventListener("input",r);const o=()=>this.saveSettings({privateApiHeaders:this.apiHeadersEl.value});null==(n=this.apiHeadersEl)||n.addEventListener("input",o),this.listeners.push((()=>null==s?void 0:s.removeEventListener("click",i)),(()=>{var e;return null==(e=this.apiUrlEl)?void 0:e.removeEventListener("input",r)}),(()=>{var e;return null==(e=this.apiHeadersEl)?void 0:e.removeEventListener("input",o)}));const{otherSettings:a}=window.appSettings.getCurrentUserSettings();this.apiUrlEl.value=null==a?void 0:a.privateApiUrl,this.apiHeadersEl.value=null==a?void 0:a.privateApiHeaders}disconnectedCallback(){this.listeners.forEach((e=>e()))}setApiStatus(e,t){this.apiStatusEl.classList.remove(t?"success":"error"),this.apiStatusEl.classList.add(t?"error":"success"),this.apiResponseEl.innerHTML=Xs(e)}saveSettings(e){const t=window.appSettings.getCurrentUserSettings();t.otherSettings=Object.assign({},t.otherSettings,e),window.appSettings.addOrUpdateUserSettings(t)}}window.customElements.define("demo-app-playground",DemoAppPlaygroundElement);const ti=document.createElement("template");ti.innerHTML=`\n \n\n
\n
\n
Authenticated
\n \n
\n            
\n
\n\n
\n
User session
\n \n
\n            
\n
\n\n
\n
Access token
\n \n
\n                
\n            
\n
\n\n
\n
Id token
\n \n
\n                
\n            
\n
\n\n
\n
User profile
\n \n
\n            
\n
\n
\n`;class DemoAppDebugElement extends HTMLElement{constructor(){var e;super(),this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(ti.content,!0)),this.isAuthenticated=!1,this.userSession=void 0,this.accessToken=void 0,this.accessTokenDecoded=void 0,this.idToken=void 0,this.idTokenDecoded=void 0,this.userProfile=void 0}set isAuthenticated(e){null!==e&&this.update("#isAuthenticated",e)}set userSession(e){this.update("#userSession",Xs(e,["expires_at"]))}set accessToken(e){this.update("#accessToken",e)}set accessTokenDecoded(e){const t="string"!=typeof e?Xs(e,["exp","iat","auth_time"]):"(no decoded info as it is not a JWT token)";this.update("#accessTokenDecoded",t)}set idToken(e){this.update("#idToken",e)}set idTokenDecoded(e){this.update("#idTokenDecoded",Xs(e,["exp","iat","auth_time"]))}set userProfile(e){this.update("#userProfile",Xs(e))}update(e,t){var n;const s=null==(n=this.shadowRoot)?void 0:n.querySelector(e);var i,r;s&&(null==t||""===t?null==(i=s.closest(".info"))||i.classList.add("hidden"):(null==(r=s.closest(".info"))||r.classList.remove("hidden"),s.innerHTML=String(t)))}}window.customElements.define("demo-app-debug",DemoAppDebugElement);const ni=document.createElement("template");ni.innerHTML=`\n \n\n
\n \n
\n \n
\n
\n\n \n\n
\n
\n DELETE\n
\n
\n \n \n
\n
\n
\n`;class DemoAppSettingsElement extends HTMLElement{constructor(){var e;super(),this.listeners=[],this.formEl=void 0,this.formContentEl=void 0,this.selectEl=void 0,this.settingsNameEl=void 0,this.formIsDirty=!1,this.formIsNew=!1,this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(ni.content,!0))}connectedCallback(){var e,t,n,s,i;this.formEl=this.shadowRoot.querySelector("form"),this.formContentEl=this.shadowRoot.querySelector(".form-content"),this.selectEl=this.shadowRoot.querySelector("#settings-select"),this.settingsNameEl=this.shadowRoot.querySelector("#settingsName");const r=e=>{this.formIsDirty||"settings-select"===e.target.id||(this.formIsDirty=!0,this.classList.add("dirty"))};this.formEl.addEventListener("input",r),this.listeners.push((()=>this.formEl.removeEventListener("input",r))),this.refreshSelect();const o=()=>this.loadSettings(this.selectEl.value);null==(e=this.selectEl)||e.addEventListener("change",o),this.listeners.push((()=>this.selectEl.removeEventListener("change",o)));const a=null==(t=this.shadowRoot)?void 0:t.querySelector("#add-settings-button"),c=()=>this.add();null==a||a.addEventListener("click",c),this.listeners.push((()=>null==a?void 0:a.removeEventListener("click",c)));const l=null==(n=this.shadowRoot)?void 0:n.querySelector("#delete-settings-button"),d=()=>this.delete();null==l||l.addEventListener("click",d),this.listeners.push((()=>null==l?void 0:l.removeEventListener("click",d)));const u=null==(s=this.shadowRoot)?void 0:s.querySelector("#save-settings-button"),h=()=>this.saveAndReload();null==u||u.addEventListener("click",h),this.listeners.push((()=>null==u?void 0:u.removeEventListener("click",h)));const p=null==(i=this.shadowRoot)?void 0:i.querySelector("#cancel-settings-button"),g=()=>this.cancel();null==p||p.addEventListener("click",g),this.listeners.push((()=>null==p?void 0:p.removeEventListener("click",g))),this.refreshFormContent(window.appSettings.getCurrentUserSettings())}disconnectedCallback(){this.listeners.forEach((e=>e()))}loadSettings(e){window.appSettings.setCurrentUserSettings(e),location.reload()}add(){const e="New settings",t=document.createElement("option");t.selected=!0,t.value=e,t.textContent=e,this.selectEl.appendChild(t),this.formIsNew=!0,this.formIsDirty=!0,this.classList.add("dirty"),this.refreshFormContent({name:e,librarySettings:{}})}delete(){window.appSettings.deleteCurrentUserSettings(),location.reload()}cancel(){this.formIsNew=!1,this.formIsDirty=!1,this.classList.remove("dirty"),this.refreshSelect(),this.refreshFormContent(window.appSettings.getCurrentUserSettings())}setPathValue(e,t,n){const s=t.split(".");s.reduce(((e,t,i)=>(i===s.length-1?e[t]=n:Object.prototype.hasOwnProperty.call(e,t)||(e[t]={}),e[t])),e)}getPathValue(e,t){return t.split(".").reduce(((e,t)=>e?e[t]:e),e)}refreshSelect(){this.selectEl.innerHTML="";const{userSettings:e,currentUserSettingsId:t}=window.appSettings.get();e.sort(((e,t)=>e.name.localeCompare(t.name))).forEach((e=>{const n=document.createElement("option");n.selected=e.name===t,n.value=String(e.name),n.textContent=e.name,this.selectEl.appendChild(n)}))}refreshFormContent(e){this.formContentEl.innerHTML="";const{librarySettingsDefinition:t}=window.appSettings.get(),{name:n,librarySettings:s}=e;this.settingsNameEl.value=n,t.sort(((e,t)=>(t._sortIndex||0)-(e._sortIndex||0))).forEach((e=>{var t;const n=document.createElement("div");this.formContentEl.prepend(n);const i=document.createElement("label");i.htmlFor=e.name.replace(".",""),i.textContent=`${e.label}${e.required?" *":""}`;const r=document.createElement("list"===e.type?"select":"input");switch(r.id=e.name.replace(".",""),r.name=e.name.replace(".",""),r.required=!0===e.required,e.type){case"boolean":r.checked=this.getPathValue(s,e.name),r.type="checkbox",n.appendChild(r),n.appendChild(i);break;case"list":null==(t=e.values)||t.forEach((e=>{const t=document.createElement("option");t.value=String(e.value),t.textContent=e.label,r.appendChild(t)})),r.value=this.getPathValue(s,e.name),r.classList.add("flex"),n.classList.add("input","column"),n.appendChild(i),n.appendChild(r);break;default:{const t=this.getPathValue(s,e.name);"json"===e.type?r.value=t?JSON.stringify(t):"":r.value=null!=t?t:"",n.classList.add("input","column"),n.appendChild(i),n.appendChild(r);break}}}))}saveAndReload(){if(this.formEl.reportValidity()){const{librarySettingsDefinition:e}=window.appSettings.get(),t=this.formIsNew?{name:"",librarySettings:{}}:window.appSettings.getCurrentUserSettings();t.name=this.settingsNameEl.value,e.forEach((e=>{var n;const s=null==(n=this.shadowRoot)?void 0:n.querySelector(`#${e.name.replace(".","")}`);let i;switch(e.type){case"boolean":i=s.checked;break;case"list":default:i=s.value;break;case"json":try{const e=s.value;e&&""!==e.trim()&&(i=JSON.parse(e))}catch(r){console.error(r)}}this.setPathValue(t.librarySettings,e.name,i)})),window.appSettings.addOrUpdateUserSettings(t),this.formIsNew&&window.appSettings.setCurrentUserSettings(t.name),location.reload()}}}window.customElements.define("demo-app-settings",DemoAppSettingsElement);const si=JSON.parse('{"UU":"@badisi/auth-js","rE":"0.0.0-semantically-released","TB":"https://github.com/Badisi/auth-js/tree/main/projects/auth-js"}'),ii=JSON.parse('{"UU":"@badisi/ngx-auth","TB":"https://github.com/Badisi/auth-js/tree/main/projects/ngx-auth"}');const ri=[{name:"authorityUrl",label:"Authority url",type:"string",required:!0},{name:"clientId",label:"Client id",type:"string",required:!0},{name:"mobileScheme",label:"Custom mobile scheme name",type:"string"},{name:"scope",label:"Scope",type:"string"},{name:"internal.extraQueryParams",label:"Extra query params",type:"json"},{name:"desktopNavigationType",label:"Desktop navigation type",type:"list",values:[{label:"REDIRECT",value:Vn.REDIRECT},{label:"POPUP",value:Vn.POPUP}]},{name:"logLevel",label:"Log level",type:"list",values:[{label:"NONE",value:Ft.NONE},{label:"ERROR",value:Ft.ERROR},{label:"WARN",value:Ft.WARN},{label:"INFO",value:Ft.INFO},{label:"DEBUG",value:Ft.DEBUG}]},{name:"loginRequired",label:"Login required",type:"boolean"},{name:"retrieveUserSession",label:"Retrieve user's session",type:"boolean"},{name:"loadUserInfo",label:"Load user's info",type:"boolean"},{name:"automaticSilentRenew",label:"Automatic silent renew",type:"boolean"}],oi=[...ri,{name:"automaticLoginOn401",label:"Automatic login on 401",type:"boolean"},{name:"automaticInjectToken",label:"Automatic inject token",type:"boolean"}];oi.splice(3,0,{name:"authGuardRedirectUrl",label:"AuthGuard redirect url",type:"string"});const ai=(e=!1)=>{const t=[{name:"Auth0",otherSettings:{privateApiUrl:"https://dev-fijd1e9x.us.auth0.com/api/v2/users/auth0|631b171682c639d40cb84d5c",privateApiHeaders:""},librarySettings:{authorityUrl:"https://dev-fijd1e9x.us.auth0.com",clientId:"kRVVEnAWKMpxxpcodl0TqLXfIHgQvmmt",mobileScheme:"demo-app",scope:"openid profile email phone offline_access read:current_user",internal:{extraQueryParams:{audience:"https://dev-fijd1e9x.us.auth0.com/api/v2/"}},desktopNavigationType:Vn.REDIRECT,logLevel:Ft.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}},{name:"Zitadel",otherSettings:{privateApiUrl:"",privateApiHeaders:""},librarySettings:{authorityUrl:"https://auth-js-0pdipf.zitadel.cloud",clientId:"178200751804317953@demo-app",mobileScheme:"demo-app",scope:"openid profile email phone offline_access",desktopNavigationType:Vn.REDIRECT,logLevel:Ft.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}}];return e||t.push({name:"Keycloak (local)",otherSettings:{privateApiUrl:"/api/my-api",privateApiHeaders:""},librarySettings:{authorityUrl:"http://localhost:8080/auth/realms/demo",clientId:"demo-app",mobileScheme:"demo-app",scope:"openid profile email phone",desktopNavigationType:Vn.REDIRECT,logLevel:Ft.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}}),t},ci=new class DemoAppSettings{constructor(e,t){this.storageKey=e,this.defaultAppSettings=t,this.implementations=[{label:"VanillaJS",demoUrl:"https://badisi.github.io/auth-js/demo-app/auth-js",version:`${si.UU}@main`},{label:"Angular",demoUrl:"https://badisi.github.io/auth-js/demo-app/ngx-auth",version:`${ii.UU}@main`}],this.defaultAppSettings.librarySettingsDefinition.forEach(((e,t)=>e._sortIndex=t))}getImplementations(){return this.implementations}setShowTip(e){const t=this.get();t.showTip=e,this.saveAppSettings(t)}setCurrentTabIndex(e){const t=this.get();t.currentTabIndex=e,this.saveAppSettings(t)}addOrUpdateUserSettings(e){const t=this.get(),n=t.userSettings.findIndex((t=>t.name===e.name));-1!==n?t.userSettings[n]=e:t.userSettings.push(e),this.saveAppSettings(t)}deleteCurrentUserSettings(){const e=this.get(),{name:t}=this.getCurrentUserSettings(),n=e.userSettings.findIndex((e=>e.name===t));-1!==n&&(e.userSettings.splice(n,1),delete e.currentUserSettingsId,this.saveAppSettings(e))}setCurrentUserSettings(e){const t=this.get();-1!==t.userSettings.findIndex((t=>t.name===e))&&(t.currentUserSettingsId=e,this.saveAppSettings(t))}getCurrentUserSettings(){const e=this.get(),t=e.userSettings.findIndex((t=>t.name===e.currentUserSettingsId));return-1!==t?e.userSettings[t]:e.userSettings.sort(((e,t)=>e.name.localeCompare(t.name)))[0]}get(){const e=sessionStorage.getItem(this.storageKey);if(e){const t=Object.assign({},this.defaultAppSettings,JSON.parse(e));return this.defaultAppSettings.userSettings.forEach((e=>{t.userSettings.find((t=>t.name===e.name))||t.userSettings.push(e)})),t}return Object.assign({},this.defaultAppSettings)}saveAppSettings(e){delete e.librarySettingsDefinition,sessionStorage.setItem(this.storageKey,JSON.stringify(e))}}(`auth-js:${si.rE}:demo-app:settings`,{showTip:!0,currentTabIndex:0,userSettings:ai(!0),librarySettingsDefinition:ri});(()=>{window.appSettings=ci;const e=document.createElement("div");e.innerHTML="Loading...",document.body.appendChild(e),(async e=>await(async(e,t)=>{const n=new t;return await n.init(e),n})(e,OIDCAuthManager))(ci.getCurrentUserSettings().librarySettings).then((t=>{window.authManager=t,e.replaceWith(document.createElement("app-root"))})).catch((t=>{var n;console.error(t),e.innerHTML=`${t.message}
`,null==(n=document.body.querySelector("#loginButton"))||n.addEventListener("click",(()=>location.reload()),{once:!0})}))})()})()})(); \ No newline at end of file diff --git a/demo-app/auth-js/main.b8a77a848194a17d.js b/demo-app/auth-js/main.b8a77a848194a17d.js new file mode 100644 index 0000000..81e8514 --- /dev/null +++ b/demo-app/auth-js/main.b8a77a848194a17d.js @@ -0,0 +1 @@ +(self.webpackChunk=self.webpackChunk||[]).push([[792],{179:(e,t,n)=>{"use strict";function s(e){this.message=e}s.prototype=new Error,s.prototype.name="InvalidCharacterError";var i="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new s("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,r=0,o=0,a="";i=t.charAt(o++);~i&&(n=r%4?64*n+i:i,r++%4)?a+=String.fromCharCode(255&n>>(-2*r&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return a};function r(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(i(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return i(t)}}function o(e){this.message=e}o.prototype=new Error,o.prototype.name="InvalidTokenError";const a=function(e,t){if("string"!=typeof e)throw new o("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(r(e.split(".")[n]))}catch(e){throw new o("Invalid token specified: "+e.message)}};var c;class AuthUtils{}c=AuthUtils,AuthUtils.isCordova=()=>!!(window.cordova||window.phonegap||window.PhoneGap),AuthUtils.isCapacitor=()=>{var e;return!(null==(e=window.Capacitor)||!e.isNativePlatform())},AuthUtils.isNativeMobile=()=>c.isCapacitor()||c.isCordova(),AuthUtils.decodeJwt=e=>{try{return e?a(e):e}catch(t){return console.warn("[@badisi/auth-js] Access token was not decoded as it is not a valid JWT."),e}},AuthUtils.isUrlMatching=(e,t)=>{if(void 0!==t){const n=new URL(e,"http://test"),s=new URL(t,"http://test");if(""!==s.pathname&&"/"!==s.pathname&&!n.pathname.includes(s.pathname))return!1;if("http://test"!==s.origin&&(n.protocol!==s.protocol||n.origin!==s.origin||!`${n.origin}${n.pathname}}`.includes(`${s.origin}${s.pathname}`)))return!1;let i=!0;return s.searchParams.forEach(((e,t)=>{n.searchParams.getAll(t).includes(e)||(i=!1)})),i}return!1},AuthUtils.getBaseUrl=()=>{var e;const t=document.baseURI||(null==(e=document.querySelector("base"))?void 0:e.href)||location.origin;return t.endsWith("/")?t:`${t}/`},AuthUtils.stringToURL=e=>{try{return new URL(e)}catch(t){const n=e.startsWith("/")?e.substring(1,e.length):e;return new URL(`${c.getBaseUrl()}${n}`)}};const l=document.createElement("template");l.innerHTML='\n \n \n \n \n \n';class AppElement extends HTMLElement{constructor(){var e;super(),this.demoAppMainEl=void 0,this.demoAppPlaygroundEl=void 0,this.demoAppDebugEl=void 0,this.authManagerSubs=[],this.listeners=[],this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(l.content,!0))}connectedCallback(){this.demoAppMainEl=this.shadowRoot.querySelector("demo-app-main"),this.demoAppPlaygroundEl=this.shadowRoot.querySelector("demo-app-playground"),this.demoAppDebugEl=this.shadowRoot.querySelector("demo-app-debug"),this.listenForHeaderEvents(),this.listenForPlaygroundEvents(),this.listenForAuthChanges()}disconnectedCallback(){this.authManagerSubs.forEach((e=>e.unsubscribe())),this.listeners.forEach((e=>e()))}async callPrivateApi(e,t){if(window.authManager&&e){var n;const s=null!=(n=await window.authManager.getAccessToken())?n:"",i=new XMLHttpRequest;i.onreadystatechange=()=>{if(4===i.readyState){var e;let s;try{var t;s=JSON.parse(null!=(t=i.responseText)?t:"")}catch(n){s=`${i.status} ${i.statusText}`}null==(e=this.demoAppPlaygroundEl)||e.setApiStatus(s,200!==i.status)}},i.open("GET",e,!0),i.setRequestHeader("Authorization",`Bearer ${s}`),null==t||t.split(";").forEach((e=>{if(e){var t,n;const s=e.split(":");i.setRequestHeader(null==(t=s[0])?void 0:t.trim(),(null==(n=s[1])?void 0:n.trim())||"")}})),i.send()}}refreshInfo(e,t){if(window.authManager&&this.demoAppMainEl&&this.demoAppDebugEl)switch(e){case"renewing":this.demoAppMainEl.isRenewing=t;break;case"authenticated":this.demoAppMainEl.isAuthenticated=t,this.demoAppDebugEl.isAuthenticated=t;break;case"userSession":this.demoAppDebugEl.userSession=t;break;case"accessToken":this.demoAppDebugEl.accessToken=t,this.demoAppDebugEl.accessTokenDecoded=AuthUtils.decodeJwt(t);break;case"idToken":this.demoAppDebugEl.idToken=t,this.demoAppDebugEl.idTokenDecoded=AuthUtils.decodeJwt(t);break;case"userProfile":this.demoAppDebugEl.userProfile=t}}listenForAuthChanges(){const e=window.authManager;e&&this.authManagerSubs.push(e.onRenewingChanged((e=>this.refreshInfo("renewing",e))),e.onAuthenticatedChanged((e=>this.refreshInfo("authenticated",e))),e.onUserSessionChanged((e=>this.refreshInfo("userSession",e))),e.onAccessTokenChanged((e=>this.refreshInfo("accessToken",e))),e.onIdTokenChanged((e=>this.refreshInfo("idToken",e))),e.onUserProfileChanged((e=>this.refreshInfo("userProfile",e))))}listenForPlaygroundEvents(){if(this.demoAppPlaygroundEl){const e=e=>{var t,n;this.callPrivateApi(null==(t=e.detail)?void 0:t.url,null==(n=e.detail)?void 0:n.headers)};this.demoAppPlaygroundEl.addEventListener("api",e),this.listeners.push((()=>{var t;return null==(t=this.demoAppPlaygroundEl)?void 0:t.removeEventListener("api",e)}))}}listenForHeaderEvents(){const e=window.authManager;if(e&&this.demoAppMainEl){const t=()=>{e.login()};this.demoAppMainEl.addEventListener("login",t);const n=()=>{e.logout({redirectUrl:"/"}).then((()=>{var e;const t=document.baseURI||(null==(e=document.querySelector("base"))?void 0:e.href)||location.origin;location.href=t.endsWith("/")?t:`${t}/`}))};this.demoAppMainEl.addEventListener("logout",n);const s=()=>{e.renew()};this.demoAppMainEl.addEventListener("silentRenew",s),this.listeners.push((()=>{var e;return null==(e=this.demoAppMainEl)?void 0:e.removeEventListener("login",t)}),(()=>{var e;return null==(e=this.demoAppMainEl)?void 0:e.removeEventListener("logout",n)}),(()=>{var e;return null==(e=this.demoAppMainEl)?void 0:e.removeEventListener("silentRenew",s)}))}}}customElements.define("app-root",AppElement);function d(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var u=0;function h(e){return"__private_"+u+++"_"+e}const p=function(){this.__data__=[],this.size=0};const g=function(e,t){return e===t||e!=e&&t!=t};const _=function(e,t){for(var n=e.length;n--;)if(g(e[n][0],t))return n;return-1};var f=Array.prototype.splice;const m=function(e){var t=this.__data__,n=_(t,e);return!(n<0)&&(n==t.length-1?t.pop():f.call(t,n,1),--this.size,!0)};const w=function(e){var t=this.__data__,n=_(t,e);return n<0?void 0:t[n][1]};const v=function(e){return _(this.__data__,e)>-1};const b=function(e,t){var n=this.__data__,s=_(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this};function y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991};const Ke=function(e){return null!=e&&Je(e.length)&&!H(e)};const Ve=function(e){return He(e)&&Ke(e)};var Ge=n(160),Qe=Function.prototype,Xe=Object.prototype,Ye=Qe.toString,Ze=Xe.hasOwnProperty,et=Ye.call(Object);const tt=function(e){if(!He(e)||"[object Object]"!=M(e))return!1;var t=Le(e);if(null===t)return!0;var n=Ze.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ye.call(n)==et};var nt={};nt["[object Float32Array]"]=nt["[object Float64Array]"]=nt["[object Int8Array]"]=nt["[object Int16Array]"]=nt["[object Int32Array]"]=nt["[object Uint8Array]"]=nt["[object Uint8ClampedArray]"]=nt["[object Uint16Array]"]=nt["[object Uint32Array]"]=!0,nt["[object Arguments]"]=nt["[object Array]"]=nt["[object ArrayBuffer]"]=nt["[object Boolean]"]=nt["[object DataView]"]=nt["[object Date]"]=nt["[object Error]"]=nt["[object Function]"]=nt["[object Map]"]=nt["[object Number]"]=nt["[object Object]"]=nt["[object RegExp]"]=nt["[object Set]"]=nt["[object String]"]=nt["[object WeakMap]"]=!1;const st=function(e){return He(e)&&Je(e.length)&&!!nt[M(e)]};const it=function(e){return function(t){return e(t)}};var rt=n(485),ot=rt.A&&rt.A.isTypedArray;const at=ot?it(ot):st;const ct=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var lt=Object.prototype.hasOwnProperty;const dt=function(e,t,n){var s=e[t];lt.call(e,t)&&g(s,n)&&(void 0!==n||t in e)||xe(e,t,n)};const ut=function(e,t,n,s){var i=!n;n||(n={});for(var r=-1,o=t.length;++r-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(At);const It=function(e,t){return Rt(Tt(e,t,Et),e+"")};const Ot=function(e,t,n){if(!q(n))return!1;var s=typeof t;return!!("number"==s?Ke(n)&>(t,n.length):"string"==s&&t in n)&&g(n[t],e)};const jt=function(e){return It((function(t,n){var s=-1,i=n.length,r=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(i--,r):void 0,o&&Ot(n[0],n[1],o)&&(r=i<3?void 0:r,i=1),t=Object(t);++s{},info:()=>{},warn:()=>{},error:()=>{}},Kt=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(Kt||{});(Mt=Kt||(Kt={})).reset=function(){Lt=3,Nt=Jt},Mt.setLevel=function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");Lt=e},Mt.setLogger=function(e){Nt=e};var Vt=class{constructor(e){this._name=e}debug(...e){Lt>=4&&Nt.debug(Vt._format(this._name,this._method),...e)}info(...e){Lt>=3&&Nt.info(Vt._format(this._name,this._method),...e)}warn(...e){Lt>=2&&Nt.warn(Vt._format(this._name,this._method),...e)}error(...e){Lt>=1&&Nt.error(Vt._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new Vt(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){Lt>=4&&Nt.debug(Vt._format(e),...t)}static info(e,...t){Lt>=3&&Nt.info(Vt._format(e),...t)}static warn(e,...t){Lt>=2&&Nt.warn(Vt._format(e),...t)}static error(e,...t){Lt>=1&&Nt.error(Vt._format(e),...t)}};Kt.reset();var Gt,Qt,Xt,Yt=class{static _randomWord(){return Ht().lib.WordArray.random(1).words[0]}static generateUUIDv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^Yt._randomWord()&15>>+e/4).toString(16))).replace(/-/g,"")}static generateCodeVerifier(){return Yt.generateUUIDv4()+Yt.generateUUIDv4()+Yt.generateUUIDv4()}static generateCodeChallenge(e){try{const t=$t()(e);return Bt().stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){throw Vt.error("CryptoUtils.generateCodeChallenge",t),t}}static generateBasicAuth(e,t){const n=Ft().parse([e,t].join(":"));return Bt().stringify(n)}},Zt=class{constructor(e){this._name=e,this._logger=new Vt(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},en=class{static decode(e){try{return a(e)}catch(t){throw Vt.error("JwtUtils.decode",t),t}}},tn=class{static center({...e}){var t;return null==e.width&&(e.width=null!=(t=[800,720,600,480].find((e=>e<=window.outerWidth/1.618)))?t:360),null!=e.left||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),null!=e.height&&(null!=e.top||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}=${"boolean"!=typeof t?t:t?"yes":"no"}`)).join(",")}},nn=class extends Zt{constructor(){super(...arguments),this._logger=new Vt(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-nn.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=nn.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=nn.getEpochTime()+e;if(this.expiration===n&&this._timerHandle)return void t.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),t.debug("using duration",e),this._expiration=n;const s=Math.min(e,5);this._timerHandle=setInterval(this._callback,1e3*s)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},sn=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const n=new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"];return new URLSearchParams(n.slice(1))}},rn=class extends Error{constructor(e,t){var n,s,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw Vt.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=null!=(n=e.error_description)?n:null,this.error_uri=null!=(s=e.error_uri)?s:null,this.state=e.userState,this.session_state=null!=(i=e.session_state)?i:null,this.url_state=e.url_state}},on=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},an=class{constructor(e){this._logger=new Vt("AccessTokenEvents"),this._expiringTimer=new nn("Access token expiring"),this._expiredTimer=new nn("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&void 0!==e.expires_in){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let e=n-this._expiringNotificationTimeInSeconds;e<=0&&(e=1),t.debug("registering expiring timer, raising in",e,"seconds"),this._expiringTimer.init(e)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const s=n+1;t.debug("registering expired timer, raising in",s,"seconds"),this._expiredTimer.init(s)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},cn=class{constructor(e,t,n,s,i){this._callback=e,this._client_id=t,this._intervalInSeconds=s,this._stopOnError=i,this._logger=new Vt("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=e=>{e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(e.data+" message from check session op iframe"))};const r=new URL(n);this._frame_origin=r.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=r.href}load(){return new Promise((e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)}))}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},ln=class{constructor(){this._logger=new Vt("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},dn=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new Vt("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...s}=t;if(!n)return await fetch(e,s);const i=new AbortController,r=setTimeout((()=>i.abort()),1e3*n);try{return await fetch(e,{...t,signal:i.signal})}catch(o){if(o instanceof DOMException&&"AbortError"===o.name)throw new on("Network timed out");throw o}finally{clearTimeout(r)}}async getJson(e,{token:t,credentials:n}={}){const s=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};let r;t&&(s.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);try{s.debug("url:",e),r=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:n})}catch(c){throw s.error("Network Error"),c}s.debug("HTTP response received, status",r.status);const o=r.headers.get("Content-Type");if(o&&!this._contentTypes.find((e=>o.startsWith(e)))&&s.throw(new Error(`Invalid response Content-Type: ${null!=o?o:"undefined"}, from URL: ${e}`)),r.ok&&this._jwtHandler&&(null==o?void 0:o.startsWith("application/jwt")))return await this._jwtHandler(await r.text());let a;try{a=await r.json()}catch(c){if(s.error("Error parsing JSON response",c),r.ok)throw c;throw new Error(`${r.statusText} (${r.status})`)}if(!r.ok){if(s.error("Error from server:",a),a.error)throw new rn(a);throw new Error(`${r.statusText} (${r.status}): ${JSON.stringify(a)}`)}return a}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:s,initCredentials:i}){const r=this._logger.create("postForm"),o={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let a;void 0!==n&&(o.Authorization="Basic "+n),this.appendExtraHeaders(o);try{r.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"POST",headers:o,body:t,timeoutInSeconds:s,credentials:i})}catch(u){throw r.error("Network error"),u}r.debug("HTTP response received, status",a.status);const c=a.headers.get("Content-Type");if(c&&!this._contentTypes.find((e=>c.startsWith(e))))throw new Error(`Invalid response Content-Type: ${null!=c?c:"undefined"}, from URL: ${e}`);const l=await a.text();let d={};if(l)try{d=JSON.parse(l)}catch(u){if(r.error("Error parsing JSON response",u),a.ok)throw u;throw new Error(`${a.statusText} (${a.status})`)}if(!a.ok){if(r.error("Error from server:",d),d.error)throw new rn(d,t);throw new Error(`${a.statusText} (${a.status}): ${JSON.stringify(d)}`)}return d}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),s=["authorization","accept","content-type"];0!==n.length&&n.forEach((n=>{if(s.includes(n.toLocaleLowerCase()))return void t.warn("Protected header could not be overridden",n,s);const i="function"==typeof this._extraHeaders[n]?this._extraHeaders[n]():this._extraHeaders[n];i&&""!==i&&(e[n]=i)}))}},un=class{constructor(e){this._settings=e,this._logger=new Vt("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new dn(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),s=await this.getMetadata();if(n.debug("resolved"),void 0===s[e]){if(!0===t)return void n.warn("Metadata does not contain optional property");n.throw(new Error("Metadata does not contain property "+e))}return s[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},hn=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new Vt("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){this._logger.create(`get('${e}')`),e=this._prefix+e;return await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n{const t=this._logger.create("_getClaimsFromJwt");try{const n=en.decode(e);return t.debug("JWT decoding successful"),n}catch(n){throw t.error("Error parsing JWT response"),n}},this._jsonService=new dn(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const s=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",s),s}},_n=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new Vt("TokenClient"),this._jsonService=new dn(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:s=this._settings.client_secret,...i}){const r=this._logger.create("exchangeCode");n||r.throw(new Error("A client_id is required")),t||r.throw(new Error("A redirect_uri is required")),i.code||r.throw(new Error("A code is required"));const o=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[d,u]of Object.entries(i))null!=u&&o.set(d,u);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!s)throw r.throw(new Error("A client_secret is required")),null;a=Yt.generateBasicAuth(n,s);break;case"client_secret_post":o.append("client_id",n),s&&o.append("client_secret",s)}const c=await this._metadataService.getTokenEndpoint(!1);r.debug("got token endpoint");const l=await this._jsonService.postForm(c,{body:o,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return r.debug("got response"),l}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:s=this._settings.scope,...i}){const r=this._logger.create("exchangeCredentials");t||r.throw(new Error("A client_id is required"));const o=new URLSearchParams({grant_type:e,scope:s});for(const[d,u]of Object.entries(i))null!=u&&o.set(d,u);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw r.throw(new Error("A client_secret is required")),null;a=Yt.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const c=await this._metadataService.getTokenEndpoint(!1);r.debug("got token endpoint");const l=await this._jsonService.postForm(c,{body:o,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return r.debug("got response"),l}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:s,...i}){const r=this._logger.create("exchangeRefreshToken");t||r.throw(new Error("A client_id is required")),i.refresh_token||r.throw(new Error("A refresh_token is required"));const o=new URLSearchParams({grant_type:e});for(const[d,u]of Object.entries(i))Array.isArray(u)?u.forEach((e=>o.append(d,e))):null!=u&&o.set(d,u);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw r.throw(new Error("A client_secret is required")),null;a=Yt.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const c=await this._metadataService.getTokenEndpoint(!1);r.debug("got token endpoint");const l=await this._jsonService.postForm(c,{body:o,basicAuth:a,timeoutInSeconds:s,initCredentials:this._settings.fetchRequestCredentials});return r.debug("got response"),l}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const s=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);const i=new URLSearchParams;for(const[r,o]of Object.entries(e))null!=o&&i.set(r,o);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(s,{body:i}),n.debug("got response")}},fn=class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new Vt("ResponseValidator"),this._userInfoService=new gn(this._settings,this._metadataService),this._tokenClient=new _n(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&e.id_token&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){const n=this._logger.create("validateRefreshResponse");e.userState=t.data,null!=e.session_state||(e.session_state=t.session_state),null!=e.scope||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),n.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const s=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,s),n.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new rn(e)}_processSigninState(e,t){const n=this._logger.create("_processSigninState");if(t.id!==e.state&&n.throw(new Error("State does not match")),t.client_id||n.throw(new Error("No client_id on state")),t.authority||n.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&n.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&n.throw(new Error("client_id mismatch on settings vs. signin state")),n.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,null!=e.scope||(e.scope=t.scope),e.error)throw n.warn("Response was error",e.error),new rn(e);t.code_verifier&&!e.code&&n.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const s=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void s.debug("not loading user info");s.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);s.debug("user info claims received from user info endpoint"),n&&i.sub!==e.profile.sub&&s.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),s.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const s=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,s)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const s=this._logger.create("_validateIdTokenAttributes");s.debug("decoding ID Token JWT");const i=en.decode(null!=(n=e.id_token)?n:"");if(i.sub||s.throw(new Error("ID Token is missing a subject claim")),t){const e=en.decode(t);i.sub!==e.sub&&s.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==e.auth_time&&s.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==e.azp&&s.throw(new Error("azp in id_token does not match original azp")),!i.azp&&e.azp&&s.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}},mn=class{constructor(e){this.id=e.id||Yt.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=nn.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new Vt("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(e){return Vt.createStatic("State","fromStorageString"),new mn(JSON.parse(e))}static async clearStaleState(e,t){const n=Vt.createStatic("State","clearStaleState"),s=nn.getEpochTime()-t,i=await e.getAllKeys();n.debug("got keys",i);for(let o=0;ow.searchParams.append("resource",e)))}for(const[b,y]of Object.entries({response_mode:a,...m,...g}))null!=y&&w.searchParams.append(b,y.toString());this.url=w.href}},bn=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const e=decodeURIComponent(this.state).split(";");this.state=e[0],e.length>1&&(this.url_state=e.slice(1).join(";"))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-nn.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+nn.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},yn=class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:s,extraQueryParams:i,request_type:r,client_id:o}){if(this._logger=new Vt("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(e);n&&a.searchParams.append("id_token_hint",n),o&&a.searchParams.append("client_id",o),s&&(a.searchParams.append("post_logout_redirect_uri",s),t&&(this.state=new mn({data:t,request_type:r}),a.searchParams.append("state",this.state.id)));for(const[c,l]of Object.entries({...i}))null!=l&&a.searchParams.append(c,l.toString());this.url=a.href}},Sn=class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},kn=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],En=["sub","iss","aud","exp","iat"],xn=class{constructor(e){this._settings=e,this._logger=new Vt("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let e;e=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:kn;for(const n of e)En.includes(n)||delete t[n]}return t}mergeClaims(e,t){const n={...e};for(const[s,i]of Object.entries(t))for(const e of Array.isArray(i)?i:[i]){const t=n[s];void 0===t?n[s]=e:Array.isArray(t)?t.includes(e)||t.push(e):n[s]!==e&&("object"==typeof e&&this._settings.mergeClaims?n[s]=this.mergeClaims(t,e):n[s]=[t,e])}return n}},Cn=class{constructor(e,t){this._logger=new Vt("OidcClient"),this.settings=e instanceof pn?e:new pn(e),this.metadataService=null!=t?t:new un(this.settings),this._claimsService=new xn(this.settings),this._validator=new fn(this.settings,this.metadataService,this._claimsService),this._tokenClient=new _n(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:s,id_token_hint:i,login_hint:r,skipUserInfo:o,nonce:a,url_state:c,response_type:l=this.settings.response_type,scope:d=this.settings.scope,redirect_uri:u=this.settings.redirect_uri,prompt:h=this.settings.prompt,display:p=this.settings.display,max_age:g=this.settings.max_age,ui_locales:_=this.settings.ui_locales,acr_values:f=this.settings.acr_values,resource:m=this.settings.resource,response_mode:w=this.settings.response_mode,extraQueryParams:v=this.settings.extraQueryParams,extraTokenParams:b=this.settings.extraTokenParams}){const y=this._logger.create("createSigninRequest");if("code"!==l)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const S=await this.metadataService.getAuthorizationEndpoint();y.debug("Received authorization endpoint",S);const k=new vn({url:S,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:u,response_type:l,scope:d,state_data:e,url_state:c,prompt:h,display:p,max_age:g,ui_locales:_,id_token_hint:i,login_hint:r,acr_values:f,resource:m,request:t,request_uri:n,extraQueryParams:v,extraTokenParams:b,request_type:s,response_mode:w,client_secret:this.settings.client_secret,skipUserInfo:o,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const E=k.state;return await this.settings.stateStore.set(E.id,E.toStorageString()),k}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),s=new bn(sn.readParams(e,this.settings.response_mode));if(!s.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](s.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:wn.fromStorageString(i),response:s}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:s}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(s,n),s}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:s={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...s}),r=new bn(new URLSearchParams);return Object.assign(r,i),await this._validator.validateCredentialsResponse(r,n),r}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const s=this._logger.create("useRefreshToken");let i;if(void 0===this.settings.refreshTokenAllowedScope)i=e.scope;else{const t=this.settings.refreshTokenAllowedScope.split(" ");i=((null==(n=e.scope)?void 0:n.split(" "))||[]).filter((e=>t.includes(e))).join(" ")}const r=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,resource:e.resource,scope:i,timeoutInSeconds:t}),o=new bn(new URLSearchParams);return Object.assign(o,r),s.debug("validating response",o),await this._validator.validateRefreshResponse(o,{...e,scope:i}),o}async createSignoutRequest({state:e,id_token_hint:t,client_id:n,request_type:s,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:r=this.settings.extraQueryParams}={}){const o=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",a),n||!i||t||(n=this.settings.client_id);const c=new yn({url:a,id_token_hint:t,client_id:n,post_logout_redirect_uri:i,state_data:e,extraQueryParams:r,request_type:s});await this.clearStaleState();const l=c.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),c}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),s=new Sn(sn.readParams(e,this.settings.response_mode));if(!s.state){if(n.debug("No state in response"),s.error)throw n.warn("Response was error:",s.error),new rn(s);return{state:void 0,response:s}}const i=await this.settings.stateStore[t?"remove":"get"](s.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:mn.fromStorageString(i),response:s}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:s}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(s,n)):t.debug("No state from storage; skipping response validation"),s}clearStaleState(){return this._logger.create("clearStaleState"),mn.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},Tn=class{constructor(e){this._userManager=e,this._logger=new Vt("SessionMonitor"),this._start=async e=>{const t=e.session_state;if(!t)return;const n=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,n.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,n.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(t);else try{const e=await this._userManager.metadataService.getCheckSessionIframe();if(e){n.debug("initializing check session iframe");const s=this._userManager.settings.client_id,i=this._userManager.settings.checkSessionIntervalInSeconds,r=this._userManager.settings.stopCheckSessionOnError,o=new cn(this._callback,s,e,i,r);await o.load(),this._checkSessionIFrame=o,o.start(t)}else n.warn("no check session iframe found in the metadata")}catch(s){n.error("Error from getCheckSessionIframe:",s instanceof Error?s.message:s)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const t=setInterval((async()=>{clearInterval(t);try{const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}catch(n){e.error("error from querySessionStatus",n instanceof Error?n.message:n)}}),1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const t=await this._userManager.querySessionStatus();let n=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(n=!1,this._checkSessionIFrame.start(t.session_state),t.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",t.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",t.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",t.sub):e.debug("subject no longer signed into OP"),n?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(t){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",t),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch((e=>{this._logger.error(e)}))}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}}},Un=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=null!=(t=e.session_state)?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState,this.url_state=e.url_state}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-nn.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+nn.getEpochTime())}get expired(){const e=this.expires_in;if(void 0!==e)return e<=0}get scopes(){var e,t;return null!=(t=null==(e=this.scope)?void 0:e.split(" "))?t:[]}toStorageString(){return new Vt("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return Vt.createStatic("User","fromStorageString"),new Un(JSON.parse(e))}},An="oidc-client",Pn=class{constructor(){this._abort=new Zt("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:s}=await new Promise(((n,s)=>{const i=i=>{var r;const o=i.data,a=null!=(r=e.scriptOrigin)?r:window.location.origin;if(i.origin===a&&(null==o?void 0:o.source)===An){try{const n=sn.readParams(o.url,e.response_mode).get("state");if(n||t.warn("no state found in response url"),i.source!==this._window&&n!==e.state)return}catch(c){this._dispose(),s(new Error("Invalid response from window"))}n(o)}};window.addEventListener("message",i,!1),this._disposeHandlers.add((()=>window.removeEventListener("message",i,!1))),this._disposeHandlers.add(this._abort.addHandler((e=>{this._dispose(),s(e)})))}));return t.debug("got response from window"),this._dispose(),s||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,s=window.location.origin){e.postMessage({source:An,url:t,keepOpen:n},s)}},Rn={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},In="_blank",On=60,jn=2,Ln=10,Nn=class extends pn{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:s=Rn,popupWindowTarget:i=In,redirectMethod:r="assign",redirectTarget:o="self",iframeNotifyParentOrigin:a=e.iframeNotifyParentOrigin,iframeScriptOrigin:c=e.iframeScriptOrigin,silent_redirect_uri:l=e.redirect_uri,silentRequestTimeoutInSeconds:d=Ln,automaticSilentRenew:u=!0,validateSubOnSilentRenew:h=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:g=!1,monitorAnonymousSession:_=!1,checkSessionIntervalInSeconds:f=jn,query_status_response_type:m="code",stopCheckSessionOnError:w=!0,revokeTokenTypes:v=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:y=!1,accessTokenExpiringNotificationTimeInSeconds:S=On,userStore:k}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=s,this.popupWindowTarget=i,this.redirectMethod=r,this.redirectTarget=o,this.iframeNotifyParentOrigin=a,this.iframeScriptOrigin=c,this.silent_redirect_uri=l,this.silentRequestTimeoutInSeconds=d,this.automaticSilentRenew=u,this.validateSubOnSilentRenew=h,this.includeIdTokenInSilentRenew=p,this.monitorSession=g,this.monitorAnonymousSession=_,this.checkSessionIntervalInSeconds=f,this.stopCheckSessionOnError=w,this.query_status_response_type=m,this.revokeTokenTypes=v,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=y,this.accessTokenExpiringNotificationTimeInSeconds=S,k)this.userStore=k;else{const e="undefined"!=typeof window?window.sessionStorage:new ln;this.userStore=new hn({store:e})}}},Mn=class extends Pn{constructor({silentRequestTimeoutInSeconds:e=Ln}){super(),this._logger=new Vt("IFrameWindow"),this._timeoutInSeconds=e,this._frame=Mn.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout((()=>this._abort.raise(new on("IFrame timed out without a response"))),1e3*this._timeoutInSeconds);return this._disposeHandlers.add((()=>clearTimeout(t))),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",(e=>{var t;const n=e.target;null==(t=n.parentNode)||t.removeChild(n),this._abort.raise(new Error("IFrame removed from DOM"))}),!0),null==(e=this._frame.contentWindow)||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},qn=class{constructor(e){this._settings=e,this._logger=new Vt("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new Mn({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),Mn.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},Hn=class extends Pn{constructor({popupWindowTarget:e=In,popupWindowFeatures:t={}}){super(),this._logger=new Vt("PopupWindow");const n=tn.center({...Rn,...t});this._window=window.open(void 0,e,tn.serialize(n)),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout((()=>{this._window&&"boolean"==typeof this._window.closed&&!this._window.closed?this.close():this._abort.raise(new Error("Popup blocked by user"))}),1e3*t.closePopupWindowAfterInSeconds)}async navigate(e){var t;null==(t=this._window)||t.focus();const n=setInterval((()=>{this._window&&!this._window.closed||this._abort.raise(new Error("Popup closed by user"))}),500);return this._disposeHandlers.add((()=>clearInterval(n))),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},Wn=class{constructor(e){this._settings=e,this._logger=new Vt("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new Hn({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),Hn.notifyOpener(e,t)}},$n=class{constructor(e){this._settings=e,this._logger=new Vt("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let s=window.self;"top"===t&&(s=null!=(n=window.top)?n:window.self);const i=s.location[e].bind(s.location);let r;return{navigate:async e=>{this._logger.create("navigate");const t=new Promise(((e,t)=>{r=t}));return i(e.url),await t},close:()=>{this._logger.create("close"),null==r||r(new Error("Redirect aborted")),s.stop()}}}async callback(){}},Dn=class extends an{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new Vt("UserManagerEvents"),this._userLoaded=new Zt("User loaded"),this._userUnloaded=new Zt("User unloaded"),this._silentRenewError=new Zt("Silent renew error"),this._userSignedIn=new Zt("User signed in"),this._userSignedOut=new Zt("User signed out"),this._userSessionChanged=new Zt("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},Bn=class{constructor(e){this._userManager=e,this._logger=new Vt("SilentRenewService"),this._isStarted=!1,this._retryTimer=new nn("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(t){if(t instanceof on)return e.warn("ErrorTimeout from signinSilent:",t,"retry in 5s"),void this._retryTimer.init(5);e.error("Error from signinSilent:",t),this._userManager.events._raiseSilentRenewError(t)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},zn=class{constructor(e,t){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.resource=t,this.data=e.state}},Fn=class{constructor(e,t,n,s){this._logger=new Vt("UserManager"),this.settings=new Nn(e),this._client=new Cn(e),this._redirectNavigator=null!=t?t:new $n(this.settings),this._popupNavigator=null!=n?n:new Wn(this.settings),this._iframeNavigator=null!=s?s:new qn(this.settings),this._events=new Dn(this.settings),this._silentRenewService=new Bn(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new Tn(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,s=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},s)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const s=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});s.debug("got signin response");const r=await this._buildUser(i);return r.profile&&r.profile.sub?s.info("success, signed in subject",r.profile.sub):s.info("no subject"),r}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:s,...i}=e,r=this.settings.popup_redirect_uri;r||t.throw(new Error("No popup_redirect_uri configured"));const o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:s}),a=await this._signin({request_type:"si:p",redirect_uri:r,display:"popup",...i},o);return a&&(a.profile&&a.profile.sub?t.info("success, signed in subject",a.profile.sub):t.info("no subject")),a}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:s,resource:i,...r}=e;let o=await this._loadUser();if(null==o?void 0:o.refresh_token){n.debug("using refresh token");const e=new zn(o,i);return await this._useRefreshToken(e)}const a=this.settings.silent_redirect_uri;let c;a||n.throw(new Error("No silent_redirect_uri configured")),o&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",o.profile.sub),c=o.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:s});return o=await this._signin({request_type:"si:s",redirect_uri:a,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==o?void 0:o.id_token:void 0,...r},l,c),o&&((null==(t=o.profile)?void 0:t.sub)?n.info("success, signed in subject",o.profile.sub):n.info("no subject")),o}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new Un({...e,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...s}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const r=await this._loadUser(),o=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),a=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==r?void 0:r.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...s},o);try{const e=await this._client.processSigninResponse(a.url);return t.debug("got signin response"),e.session_state&&e.profile.sub?(t.info("success for subject",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid}):(t.info("success, user not authenticated"),null)}catch(c){if(this.settings.monitorAnonymousSession&&c instanceof rn)switch(c.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:c.session_state}}throw c}}async _signin(e,t,n){const s=await this._signinStart(e,t);return await this._signinEnd(s.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const s=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:s.url,state:s.state.id,response_mode:s.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(s){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),s}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),s=await this._client.processSigninResponse(e);n.debug("got signin response");return await this._buildUser(s,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),s=new Un(e);if(t){if(t!==s.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",s.profile.sub),new rn({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(s),n.debug("user stored"),this._events.load(s),s}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...s}=e,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...s},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:s,...i}=e,r=this.settings.popup_post_logout_redirect_uri,o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:s});await this._signout({request_type:"so:p",post_logout_redirect_uri:r,state:null==r?void 0:{},...i},o),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const s=this._logger.create("_signoutStart");try{const i=await this._loadUser();s.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const r=e.id_token_hint||i&&i.id_token;r&&(s.debug("setting id_token_hint in signout request"),e.id_token_hint=r),await this.removeUser(),s.debug("user removed, creating signout request");const o=await this._client.createSignoutRequest(e);return s.debug("got signout request"),await t.navigate({url:o.url,state:null==(n=o.state)?void 0:n.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(i){throw s.debug("error after preparing navigator, closing navigator window"),t.close(),i}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:s,...i}=e,r=this.settings.includeIdTokenInSilentSignout?null==(t=await this._loadUser())?void 0:t.id_token:void 0,o=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:s});await this._signout({request_type:"so:s",post_logout_redirect_uri:o,id_token_hint:r,...i},a),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const s=t.filter((t=>"string"==typeof e[t]));if(s.length){for(const t of s)await this._client.revokeToken(e[t],t),n.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}else n.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),Un.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}};class AuthManager{}class AuthSubscriptions{constructor(){this.subscribers=[],this.lastNotifiedValue=void 0}add(e){return this.subscribers.push(e),this.lastNotifiedValue&&e(...this.lastNotifiedValue),{unsubscribe:()=>this.unsubscribe(e)}}notify(...e){this.lastNotifiedValue=e,this.subscribers.forEach((t=>{t(...e)}))}unsubscribe(e){if(e){const t=this.subscribers.indexOf(e);-1!==t&&this.subscribers.splice(t,1)}else this.subscribers=[]}}const Jn=window.localStorage,Kn=null==(Gt=window.Capacitor)||null==(Gt=Gt.Plugins)?void 0:Gt.Storage,Vn=null==(Qt=window.Capacitor)||null==(Qt=Qt.Plugins)?void 0:Qt.Preferences,Gn=null==(Xt=window.Capacitor)||null==(Xt=Xt.Plugins)?void 0:Xt.SecureStoragePlugin;class MobileStorage{constructor(){if(this._logger=new Vt("MobileStorage"),!Gn){let e="[@badisi/auth-js] This application is currently using an unsafe storage.\n\n";e+="\u24d8 Please follow the recommended guide and use `capacitor-secure-storage-plugin` instead.",console.warn(e)}Gn?this._logger.debug("Using `capacitor-secure-storage-plugin` implementation"):Vn?this._logger.debug("Using `@capacitor/preferences` implementation"):Kn?this._logger.debug("Using `@capacitor/storage` implementation"):this._logger.debug("Using `localStorage` implementation")}get length(){return async function(){return Gn?(await Gn.keys()).value.length:Vn?(await Vn.keys()).keys.length:Kn?(await Kn.keys()).keys.length:Jn.length}()}async key(e){return Gn?(await Gn.keys()).value[e]:Vn?(await Vn.keys()).keys[e]:Kn?(await Kn.keys()).keys[e]:Jn.key(e)}async clear(){this._logger.create("clear"),Gn?await Gn.clear():Vn?await Vn.clear():Kn?await Kn.clear():Jn.clear()}async getItem(e){if(this._logger.create(`getItem('${e}')`),!Gn)return Vn?(await Vn.get({key:e})).value:Kn?(await Kn.get({key:e})).value:Jn.getItem(e);try{return(await Gn.get({key:e})).value}catch(t){return null}}async setItem(e,t){this._logger.create(`setItem('${e}')`),Gn?await Gn.set({key:e,value:t}):Vn?await Vn.set({key:e,value:t}):Kn?await Kn.set({key:e,value:t}):Jn.setItem(e,t)}async removeItem(e){if(this._logger.create(`removeItem('${e}')`),Gn)try{await Gn.remove({key:e})}catch(t){}else Vn?await Vn.remove({key:e}):Kn?await Kn.remove({key:e}):Jn.removeItem(e)}}let Qn=function(e){return e.REDIRECT="REDIRECT",e.POPUP="POPUP",e}({});class UserSession{constructor(){this.expired=void 0,this.expires_in=void 0,this.expires_at=void 0}static deserialize(e){const t=new UserSession,n=Object.keys(t);for(const s of n)t[s]=e[s];return t}}function Xn(e,t){if(null==e)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.includes(s))continue;n[s]=e[s]}return n}var Yn,Zn;const es=null==(Yn=window.Capacitor)||null==(Yn=Yn.Plugins)?void 0:Yn.App,ts=null==(Zn=window.Capacitor)||null==(Zn=Zn.Plugins)?void 0:Zn.Browser;class MobileWindow{constructor(e,t){if(this.redirectUrl=e,this.params=t,this._logger=new Vt("MobileWindow"),this.capacitorAppUrlOpenHandle=void 0,this.capacitorBrowserFinishedHandle=void 0,this.originalHandleOpenURL=window.handleOpenURL,this.timer=void 0,this.navigateLogger=void 0,this._resolve=void 0,this._reject=void 0,this._isClosed=!0,this._receivedResult=!1,!AuthUtils.isCapacitor()&&!AuthUtils.isCordova()){let e="[@badisi/auth-js] Required core dependency not found.\n\n";e+="\u24d8 Please follow the recommended guide and install either `Capacitor` or `Cordova` dependency.",console.error(e)}if(!ts){let e="[@badisi/auth-js] Required plugin not found.\n\n";e+="\u24d8 Please follow the recommended guide and install either `@badisi/capacitor-browsertab` or `@capacitor/browser` plugin.",console.error(e)}ts&&this._logger.debug("Using `@capacitor/browser` implementation")}async navigate(e){return this.navigateLogger=this._logger.create("navigate"),this.navigateLogger.debug("url",e.url),this._isClosed=!1,this._receivedResult=!1,new Promise(((t,n)=>{this._resolve=t,this._reject=n,this.installCustomUrlSchemeHandler().then((()=>{ts&&this.useCapacitorBrowser(e)}))}))}async close(){const e=this._logger.create("close");this._isClosed||await(null==ts?void 0:ts.close().catch((t=>e.error(t)))),e.debug("success")}async cleanup(){var e,t;const n=this._logger.create("cleanup");window.handleOpenURL=this.originalHandleOpenURL,await(null==(e=this.capacitorBrowserFinishedHandle)?void 0:e.remove()),await(null==(t=this.capacitorAppUrlOpenHandle)?void 0:t.remove()),clearTimeout(this.timer),n.debug("success")}async onError(e){var t,n;null==(t=this.navigateLogger)||t.error("error response:",e),await this.close(),await this.cleanup(),null==(n=this._reject)||n.call(this,new Error(e)),this._receivedResult=!0}async onSuccess(e){var t,n;null==(t=this.navigateLogger)||t.debug("successful response:",e),await this.close(),await this.cleanup(),null==(n=this._resolve)||n.call(this,{url:e}),this._receivedResult=!0}async useCapacitorBrowser(e){this.capacitorBrowserFinishedHandle=await(null==ts?void 0:ts.addListener("browserFinished",(()=>{this._isClosed=!0,setTimeout((()=>{var e;this._receivedResult||(this.cleanup(),null==(e=this._reject)||e.call(this,"Capacitor browser closed by user"))}),1e3)}))),await(null==ts?void 0:ts.open({url:e.url,toolbarColor:this.params.mobileWindowToolbarColor,presentationStyle:this.params.mobileWindowPresentationStyle,width:this.params.mobileWindowWidth,height:this.params.mobileWindowWidth}))}async useBrowserTab(e){}async installCustomUrlSchemeHandler(){const e=this._logger.create("installCustomUrlSchemeHandler");this.timer=setTimeout((()=>{this.onError("Installing custom url scheme handler, timed out without a response")}),1e4),await this.cleanup(),AuthUtils.isCapacitor()?(e.debug("listening to Capacitor `appUrlOpen` event"),this.capacitorAppUrlOpenHandle=await(null==es||null==es.addListener?void 0:es.addListener("appUrlOpen",(({url:e})=>{AuthUtils.isUrlMatching(e,this.redirectUrl)&&this.onSuccess(e)})))):AuthUtils.isCordova()&&(e.debug("waiting for Cordova `handleOpenURL` callback"),window.handleOpenURL=e=>{var t;null==(t=this.originalHandleOpenURL)||t.call(this,e),AuthUtils.isUrlMatching(e,this.redirectUrl)&&this.onSuccess(e)}),e.debug("success")}}class MobileNavigator{constructor(){this._logger=new Vt("MobileNavigator")}prepare(e,t){return this._logger.create("prepare"),new MobileWindow(e,t)}}const ns=["mobileWindowToolbarColor","mobileWindowPresentationStyle","mobileWindowWidth","mobileWindowHeight"],ss=["mobileWindowToolbarColor","mobileWindowPresentationStyle","mobileWindowWidth","mobileWindowHeight"];var is=h("mobileNavigator");class OidcUserManager extends Fn{constructor(e){super(Object.assign({authority:e.authorityUrl,client_id:e.clientId,scope:e.scope,loadUserInfo:e.loadUserInfo,automaticSilentRenew:e.automaticSilentRenew},e.internal)),this.libSettings=e,Object.defineProperty(this,is,{writable:!0,value:void 0}),d(this,is)[is]=new MobileNavigator}async signoutMobile(e={}){var t,n,s,i;const r=this._logger.create("signout"),{mobileWindowToolbarColor:o,mobileWindowPresentationStyle:a,mobileWindowWidth:c,mobileWindowHeight:l}=e,u=Xn(e,ns),h={mobileWindowToolbarColor:null!=o?o:null==(t=this.libSettings.internal)?void 0:t.mobileWindowToolbarColor,mobileWindowPresentationStyle:null!=a?a:null==(n=this.libSettings.internal)?void 0:n.mobileWindowPresentationStyle,mobileWindowWidth:null!=c?c:null==(s=this.libSettings.internal)?void 0:s.mobileWindowWidth,mobileWindowHeight:null!=l?l:null==(i=this.libSettings.internal)?void 0:i.mobileWindowHeight},p=d(this,is)[is].prepare(this.settings.post_logout_redirect_uri,h);await this._signout(Object.assign({request_type:"so:m",post_logout_redirect_uri:this.settings.post_logout_redirect_uri},u),p),r.info("success")}async signinMobile(e={}){var t,n,s,i,r;const o=this._logger.create("signin"),{mobileWindowToolbarColor:a,mobileWindowPresentationStyle:c,mobileWindowWidth:l,mobileWindowHeight:u}=e,h=Xn(e,ss),p={mobileWindowToolbarColor:null!=a?a:null==(t=this.libSettings.internal)?void 0:t.mobileWindowToolbarColor,mobileWindowPresentationStyle:null!=c?c:null==(n=this.libSettings.internal)?void 0:n.mobileWindowPresentationStyle,mobileWindowWidth:null!=l?l:null==(s=this.libSettings.internal)?void 0:s.mobileWindowWidth,mobileWindowHeight:null!=u?u:null==(i=this.libSettings.internal)?void 0:i.mobileWindowHeight},g=d(this,is)[is].prepare(this.settings.redirect_uri,p),_=await this._signin(Object.assign({request_type:"si:m",redirect_uri:this.settings.redirect_uri},h),g);null!=_&&null!=(r=_.profile)&&r.sub?o.info("success, signed in subject",_.profile.sub):o.info("no subject")}}const rs="auth-js:oidc_manager:redirect_url",os={loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!1,automaticSilentRenew:!0,desktopNavigationType:Qn.REDIRECT,scope:"openid profile email phone",logLevel:Kt.NONE,internal:{response_type:"code",redirect_uri:"?oidc-callback=login",post_logout_redirect_uri:"?oidc-callback=logout",popup_redirect_uri:"oidc/callback/popup_redirect.html",popup_post_logout_redirect_uri:"oidc/callback/popup_redirect.html",silent_redirect_uri:"oidc/callback/silent_redirect.html",mobileWindowPresentationStyle:"popover"}};var as=h("idTokenSubs"),cs=h("accessTokenSubs"),ls=h("userProfileSubs"),ds=h("userSessionSubs"),us=h("authenticatedSubs"),hs=h("renewingSubs"),ps=h("redirectSubs"),gs=h("userManagerSubs"),_s=h("idToken"),fs=h("accessToken"),ms=h("userProfile"),ws=h("userSession"),vs=h("isAuthenticated"),bs=h("isRenewing"),ys=h("userManager"),Ss=h("settings"),ks=h("user"),Es=h("assertNotInInceptionLoop"),xs=h("waitForRenew"),Cs=h("postLogoutVerification"),Ts=h("notifyRenew"),Us=h("runSyncOrAsync"),As=h("redirect"),Ps=h("removeUser"),Rs=h("signinSilent"),Is=h("callSignin"),Os=h("callSignout");class OIDCAuthManager extends AuthManager{constructor(...e){super(...e),Object.defineProperty(this,Os,{value:Bs}),Object.defineProperty(this,Is,{value:Ds}),Object.defineProperty(this,Rs,{value:$s}),Object.defineProperty(this,Ps,{value:Ws}),Object.defineProperty(this,As,{value:Hs}),Object.defineProperty(this,Us,{value:qs}),Object.defineProperty(this,Ts,{value:Ms}),Object.defineProperty(this,Cs,{value:Ns}),Object.defineProperty(this,xs,{value:Ls}),Object.defineProperty(this,Es,{value:js}),Object.defineProperty(this,as,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,cs,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,ls,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,ds,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,us,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,hs,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,ps,{writable:!0,value:new AuthSubscriptions}),Object.defineProperty(this,gs,{writable:!0,value:[]}),Object.defineProperty(this,_s,{writable:!0,value:void 0}),Object.defineProperty(this,fs,{writable:!0,value:void 0}),Object.defineProperty(this,ms,{writable:!0,value:void 0}),Object.defineProperty(this,ws,{writable:!0,value:void 0}),Object.defineProperty(this,vs,{writable:!0,value:!1}),Object.defineProperty(this,bs,{writable:!0,value:!1}),Object.defineProperty(this,ys,{writable:!0,value:void 0}),Object.defineProperty(this,Ss,{writable:!0,value:os}),Object.defineProperty(this,ks,{writable:!0,value:void 0})}set user(e){d(this,ks)[ks]!==e&&(d(this,ks)[ks]=e,d(this,_s)[_s]=e?e.id_token:void 0,d(this,fs)[fs]=e?e.access_token:void 0,d(this,ms)[ms]=null!=e&&e.profile?e.profile:void 0,d(this,ws)[ws]=e?UserSession.deserialize(e):void 0,d(this,vs)[vs]=!(!e||e.expired),d(this,as)[as].notify(d(this,_s)[_s]),d(this,cs)[cs].notify(d(this,fs)[fs]),d(this,ls)[ls].notify(d(this,ms)[ms]),d(this,ds)[ds].notify(d(this,ws)[ws]),d(this,us)[us].notify(d(this,vs)[vs]))}async init(e){var t,n,s,i,r,o,a,c,l,u=this;Kt.setLevel(null!=(t=null!=(n=e.logLevel)?n:os.logLevel)?t:Kt.NONE),Kt.setLogger(console);const h=AuthUtils.isNativeMobile(),p=h?`${e.mobileScheme}://localhost/`:AuthUtils.getBaseUrl();if(d(this,Ss)[Ss]=jt({},os,{internal:{userStore:new hn({store:h?new MobileStorage:new ln}),redirect_uri:`${p}${null==(s=os.internal)?void 0:s.redirect_uri}`,post_logout_redirect_uri:`${p}${null==(i=os.internal)?void 0:i.post_logout_redirect_uri}`,popup_redirect_uri:`${p}${null==(r=os.internal)?void 0:r.popup_redirect_uri}`,popup_post_logout_redirect_uri:`${p}${null==(o=os.internal)?void 0:o.popup_post_logout_redirect_uri}`,silent_redirect_uri:`${p}${null==(a=os.internal)?void 0:a.silent_redirect_uri}`}},e),d(this,ys)[ys]=new OidcUserManager(d(this,Ss)[Ss]),d(this,gs)[gs].push(d(this,ys)[ys].events.addUserLoaded((e=>{this.user=e})),d(this,ys)[ys].events.addUserUnloaded((()=>{d(this,ks)[ks]&&(this.user=null,d(this,Ss)[Ss].loginRequired&&location.reload())})),d(this,ys)[ys].events.addSilentRenewError((async function(){await d(u,Ps)[Ps]()}))),d(this,Es)[Es](),AuthUtils.isUrlMatching(location.href,null==(c=d(this,Ss)[Ss].internal)?void 0:c.redirect_uri))await d(this,Us)[Us]((async function(){const e=sessionStorage.getItem(rs);await d(u,Is)[Is]((()=>d(u,ys)[ys].signinRedirectCallback(location.href)),e),sessionStorage.removeItem(rs)}));else if(AuthUtils.isUrlMatching(location.href,null==(l=d(this,Ss)[Ss].internal)?void 0:l.post_logout_redirect_uri))await d(this,Us)[Us]((async function(){const e=sessionStorage.getItem(rs);await d(u,Os)[Os]((()=>d(u,ys)[ys].signoutRedirectCallback(location.href)),e),sessionStorage.removeItem(rs)}));else if(d(this,Ss)[Ss].retrieveUserSession||d(this,Ss)[Ss].loginRequired){var g;const e=await(null==(g=d(this,ys)[ys])?void 0:g.getUser());!e||e.expired?!h&&d(this,Ss)[Ss].retrieveUserSession?await d(this,Us)[Us]((()=>d(this,Rs)[Rs]().catch((async function(e){const{error:t,message:n}=e;if(d(u,Ss)[Ss].loginRequired&&(null!=t&&t.includes("_required")||null!=n&&n.includes("_required")))await u.login();else if(console.error("[OIDCAuthManager] User's session cannot be retrieved:",e.message),d(u,us)[us].notify(!1),d(u,Ss)[Ss].loginRequired)throw e})))):d(this,Ss)[Ss].loginRequired?await this.login():this.user=null:this.user=e}else this.user=null}async logout(e){var t,n;const s=null!=(t=null==e?void 0:e.redirectUrl)?t:location.href;var i;if(AuthUtils.isNativeMobile())await d(this,Os)[Os]((()=>d(this,ys)[ys].signoutMobile(e)),s);else switch(null!=(i=null==e?void 0:e.desktopNavigationType)?i:d(this,Ss)[Ss].desktopNavigationType){case Qn.POPUP:await d(this,Os)[Os]((()=>d(this,ys)[ys].signoutPopup(e)),s);break;case Qn.REDIRECT:default:sessionStorage.setItem(rs,s),await(null==(n=d(this,ys)[ys])?void 0:n.signoutRedirect(e))}}async login(e){var t,n;const s=null!=(t=null==e?void 0:e.redirectUrl)?t:location.href;var i;if(AuthUtils.isNativeMobile())await d(this,Is)[Is]((()=>d(this,ys)[ys].signinMobile(e)),s);else switch(null!=(i=null==e?void 0:e.desktopNavigationType)?i:d(this,Ss)[Ss].desktopNavigationType){case Qn.POPUP:await d(this,Is)[Is]((()=>d(this,ys)[ys].signinPopup(e)),s);break;case Qn.REDIRECT:default:sessionStorage.setItem(rs,s),await(null==(n=d(this,ys)[ys])?void 0:n.signinRedirect(e))}return d(this,vs)[vs]}async renew(e){return d(this,Rs)[Rs](e).catch((e=>console.error(e)))}getSettings(){return d(this,Ss)[Ss]}isRenewing(){return d(this,bs)[bs]}async isAuthenticated(){return await d(this,xs)[xs]("isAuthenticated()"),d(this,vs)[vs]}async getUserProfile(){return await d(this,xs)[xs]("getUserProfile()"),d(this,ms)[ms]}async getUserSession(){return await d(this,xs)[xs]("getUserSession()"),d(this,ws)[ws]}async getIdToken(){return await d(this,xs)[xs]("getIdToken()"),d(this,_s)[_s]}async getIdTokenDecoded(){return await d(this,xs)[xs]("getIdTokenDecoded()"),AuthUtils.decodeJwt(d(this,_s)[_s])}async getAccessToken(){return await d(this,xs)[xs]("getAccessToken()"),d(this,fs)[fs]}async getAccessTokenDecoded(){return await d(this,xs)[xs]("getAccessTokenDecoded()"),AuthUtils.decodeJwt(d(this,fs)[fs])}destroy(){d(this,as)[as].unsubscribe(),d(this,cs)[cs].unsubscribe(),d(this,ls)[ls].unsubscribe(),d(this,ds)[ds].unsubscribe(),d(this,us)[us].unsubscribe(),d(this,hs)[hs].unsubscribe(),d(this,ps)[ps].unsubscribe(),d(this,gs)[gs].forEach((e=>e()))}onIdTokenChanged(e){return d(this,as)[as].add(e)}onAccessTokenChanged(e){return d(this,cs)[cs].add(e)}onUserProfileChanged(e){return d(this,ls)[ls].add(e)}onUserSessionChanged(e){return d(this,ds)[ds].add(e)}onAuthenticatedChanged(e){return d(this,us)[us].add(e)}onRenewingChanged(e){return d(this,hs)[hs].add(e)}onRedirect(e){return d(this,ps)[ps].add(e)}}function js(){var e,t;[null==(e=d(this,Ss)[Ss].internal)?void 0:e.silent_redirect_uri,null==(t=d(this,Ss)[Ss].internal)?void 0:t.popup_redirect_uri].forEach((e=>{var t;const n=null==(t=new RegExp(/^.*\/(.*).html$/gm).exec(null!=e?e:""))?void 0:t[1],s=new Error(`[OIDCAuthManager] ${null!=e?e:"redirect uri"} was not found.`);if(s.stack=void 0,AuthUtils.isUrlMatching(location.href,e))throw s.message+="\n\n\u24d8 This usually means you forgot to include the redirect html files in your application assets.",s;if(location.href.includes(`/${n}.html`))throw s.message+="\n\n\u24d8 This usually means your redirect urls are misconfigured.",s}))}async function Ls(e){const t=Date.now();for(;d(this,bs)[bs];){if(Date.now()>t+5e3){console.warn("[@badisi/auth-js]",`\`${e}\``,"timed out waiting for renew to finish.");break}await new Promise((e=>setTimeout(e,100)))}}function Ns(e){const t=AuthUtils.stringToURL(null!=e?e:"/");d(this,Ss)[Ss].loginRequired&&location.origin===t.origin&&location.reload()}function Ms(e){d(this,bs)[bs]=e,d(this,hs)[hs].notify(e)}async function qs(e){d(this,Ss)[Ss].loginRequired?await e():e()}async function Hs(e,t){t&&(console.error(t),await d(this,Ps)[Ps]());const n=AuthUtils.stringToURL(null!=e?e:"/");location.origin===n.origin?(history.replaceState(history.state,"",n.href),d(this,ps)[ps].notify(n)):location.href=n.href}async function Ws(){var e,t;this.user=null,await Promise.all([null==(e=d(this,ys)[ys])?void 0:e.clearStaleState(),null==(t=d(this,ys)[ys])?void 0:t.removeUser()])}async function $s(e){d(this,Ts)[Ts](!0);try{var t;await(null==(t=d(this,ys)[ys])?void 0:t.signinSilent(e))}catch(n){throw await d(this,Ps)[Ps](),n}finally{d(this,Ts)[Ts](!1)}}async function Ds(e,t){try{d(this,Ts)[Ts](!0),await e().catch((e=>{var t;throw"Attempted to navigate on a disposed window"===(null==(t=e)?void 0:t.message)&&((e=new Error("[OIDCAuthManager] Attempted to navigate on a disposed window.")).stack=void 0,e.message+="\n\n\u24d8 This may be due to an ad blocker."),e})),await d(this,As)[As](t)}catch(n){throw await d(this,As)[As]("/",n),n}finally{d(this,Ts)[Ts](!1)}}async function Bs(e,t){try{await e().catch((e=>{var t;throw"Attempted to navigate on a disposed window"===(null==(t=e)?void 0:t.message)&&((e=new Error("[OIDCAuthManager] Attempted to navigate on a disposed window.")).stack=void 0,e.message+="\n\n\u24d8 This may be due to an ad blocker."),e})),await d(this,As)[As](t),await d(this,Ps)[Ps]()}catch(n){throw t="/",await d(this,As)[As](t,n),n}finally{d(this,Cs)[Cs](t)}}const zs=(e=>e.CapacitorPlatforms=(e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t};return n.addPlatform=(e,t)=>{n.platforms.set(e,t)},n.setPlatform=e=>{n.platforms.has(e)&&(n.currentPlatform=n.platforms.get(e))},n})(e))("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});zs.addPlatform,zs.setPlatform;var Fs;!function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"}(Fs||(Fs={}));class CapacitorException extends Error{constructor(e,t,n){super(e),this.message=e,this.code=t,this.data=n}}const Js=e=>{var t,n,s,i,r;const o=e.CapacitorCustomPlatform||null,a=e.Capacitor||{},c=a.Plugins=a.Plugins||{},l=e.CapacitorPlatforms,d=(null===(t=null==l?void 0:l.currentPlatform)||void 0===t?void 0:t.getPlatform)||(()=>null!==o?o.name:(e=>{var t,n;return(null==e?void 0:e.androidBridge)?"android":(null===(n=null===(t=null==e?void 0:e.webkit)||void 0===t?void 0:t.messageHandlers)||void 0===n?void 0:n.bridge)?"ios":"web"})(e)),u=(null===(n=null==l?void 0:l.currentPlatform)||void 0===n?void 0:n.isNativePlatform)||(()=>"web"!==d()),h=(null===(s=null==l?void 0:l.currentPlatform)||void 0===s?void 0:s.isPluginAvailable)||(e=>{const t=g.get(e);return!!(null==t?void 0:t.platforms.has(d()))||!!p(e)}),p=(null===(i=null==l?void 0:l.currentPlatform)||void 0===i?void 0:i.getPluginHeader)||(e=>{var t;return null===(t=a.PluginHeaders)||void 0===t?void 0:t.find((t=>t.name===e))}),g=new Map,_=(null===(r=null==l?void 0:l.currentPlatform)||void 0===r?void 0:r.registerPlugin)||((e,t={})=>{const n=g.get(e);if(n)return console.warn(`Capacitor plugin "${e}" already registered. Cannot register plugins twice.`),n.proxy;const s=d(),i=p(e);let r;const l=n=>{let c;const l=(...l)=>{const d=(async()=>(!r&&s in t?r=r="function"==typeof t[s]?await t[s]():t[s]:null!==o&&!r&&"web"in t&&(r=r="function"==typeof t.web?await t.web():t.web),r))().then((t=>{const r=((t,n)=>{var r,o;if(!i){if(t)return null===(o=t[n])||void 0===o?void 0:o.bind(t);throw new CapacitorException(`"${e}" plugin is not implemented on ${s}`,Fs.Unimplemented)}{const s=null==i?void 0:i.methods.find((e=>n===e.name));if(s)return"promise"===s.rtype?t=>a.nativePromise(e,n.toString(),t):(t,s)=>a.nativeCallback(e,n.toString(),t,s);if(t)return null===(r=t[n])||void 0===r?void 0:r.bind(t)}})(t,n);if(r){const e=r(...l);return c=null==e?void 0:e.remove,e}throw new CapacitorException(`"${e}.${n}()" is not implemented on ${s}`,Fs.Unimplemented)}));return"addListener"===n&&(d.remove=async()=>c()),d};return l.toString=()=>`${n.toString()}() { [capacitor code] }`,Object.defineProperty(l,"name",{value:n,writable:!1,configurable:!1}),l},u=l("addListener"),h=l("removeListener"),_=(e,t)=>{const n=u({eventName:e},t),s=async()=>{const s=await n;h({eventName:e,callbackId:s},t)},i=new Promise((e=>n.then((()=>e({remove:s})))));return i.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()},i},f=new Proxy({},{get(e,t){switch(t){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return i?_:u;case"removeListener":return h;default:return l(t)}}});return c[e]=f,g.set(e,{name:e,proxy:f,platforms:new Set([...Object.keys(t),...i?[s]:[]])}),f});return a.convertFileSrc||(a.convertFileSrc=e=>e),a.getPlatform=d,a.handleError=t=>e.console.error(t),a.isNativePlatform=u,a.isPluginAvailable=h,a.pluginMethodNoop=(e,t,n)=>Promise.reject(`${n} does not have an implementation of "${t}".`),a.registerPlugin=_,a.Exception=CapacitorException,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a.platform=a.getPlatform(),a.isNative=a.isNativePlatform(),a},Ks=(e=>e.Capacitor=Js(e))("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}),Vs=Ks.registerPlugin;Ks.Plugins;class WebPlugin{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const s=async()=>this.removeListener(e,t),i=Promise.resolve({remove:s});return Object.defineProperty(i,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()}}),i}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t){const n=this.listeners[e];n&&n.forEach((e=>e(t)))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:e=>{this.notifyListeners(t,e)}}}unimplemented(e="not implemented"){return new Ks.Exception(e,Fs.Unimplemented)}unavailable(e="not available"){return new Ks.Exception(e,Fs.Unavailable)}async removeListener(e,t){const n=this.listeners[e];if(!n)return;const s=n.indexOf(t);this.listeners[e].splice(s,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const Gs=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Qs=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class CapacitorCookiesPluginWeb extends WebPlugin{async getCookies(){const e=document.cookie,t={};return e.split(";").forEach((e=>{if(e.length<=0)return;let[n,s]=e.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=Qs(n).trim(),s=Qs(s).trim(),t[n]=s})),t}async setCookie(e){try{const t=Gs(e.key),n=Gs(e.value),s=`; expires=${(e.expires||"").replace("expires=","")}`,i=(e.path||"/").replace("path=",""),r=null!=e.url&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${n||""}${s}; path=${i}; ${r};`}catch(t){return Promise.reject(t)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${(new Date).toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}Vs("CapacitorCookies",{web:()=>new CapacitorCookiesPluginWeb});const Xs=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),s=((e={})=>{const t=Object.keys(e);return Object.keys(e).map((e=>e.toLocaleLowerCase())).reduce(((n,s,i)=>(n[s]=e[t[i]],n)),{})})(e.headers)["content-type"]||"";if("string"==typeof e.data)n.body=e.data;else if(s.includes("application/x-www-form-urlencoded")){const t=new URLSearchParams;for(const[n,s]of Object.entries(e.data||{}))t.set(n,s);n.body=t.toString()}else if(s.includes("multipart/form-data")||e.data instanceof FormData){const t=new FormData;if(e.data instanceof FormData)e.data.forEach(((e,n)=>{t.append(n,e)}));else for(const n of Object.keys(e.data))t.append(n,e.data[n]);n.body=t;const s=new Headers(n.headers);s.delete("content-type"),n.headers=s}else(s.includes("application/json")||"object"==typeof e.data)&&(n.body=JSON.stringify(e.data));return n};class CapacitorHttpPluginWeb extends WebPlugin{async request(e){const t=Xs(e,e.webFetchExtra),n=((e,t=!0)=>e?Object.entries(e).reduce(((e,n)=>{const[s,i]=n;let r,o;return Array.isArray(i)?(o="",i.forEach((e=>{r=t?encodeURIComponent(e):e,o+=`${s}=${r}&`})),o.slice(0,-1)):(r=t?encodeURIComponent(i):i,o=`${s}=${r}`),`${e}&${o}`}),"").substr(1):null)(e.params,e.shouldEncodeUrlParams),s=n?`${e.url}?${n}`:e.url,i=await fetch(s,t),r=i.headers.get("content-type")||"";let o,a,{responseType:c="text"}=i.ok?e:{};switch(r.includes("application/json")&&(c="json"),c){case"arraybuffer":case"blob":a=await i.blob(),o=await(async e=>new Promise(((t,n)=>{const s=new FileReader;s.onload=()=>{const e=s.result;t(e.indexOf(",")>=0?e.split(",")[1]:e)},s.onerror=e=>n(e),s.readAsDataURL(e)})))(a);break;case"json":o=await i.json();break;default:o=await i.text()}const l={};return i.headers.forEach(((e,t)=>{l[t]=e})),{data:o,headers:l,status:i.status,url:i.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}Vs("CapacitorHttp",{web:()=>new CapacitorHttpPluginWeb});const Ys='\n .flex {\n flex: 1;\n }\n\n .hidden {\n display: none !important;\n }\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .column {\n display: flex;\n flex-direction: column;\n }\n\n .card {\n border: 1px solid rgba(0, 0, 0, 0.12);\n border-radius: 4px;\n background-color: white;\n margin: 12px 6px;\n }\n\n .card .card-status {\n display: block;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n margin-left: 8px;\n background-color: #f2f2f2;\n }\n .card .card-status.error {\n background-color: #ef5350;\n }\n .card .card-status.success {\n background-color: #66bb6a;\n }\n\n .card .card-title {\n padding: 16px;\n font-size: 20px;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.87);\n align-items: center;\n }\n\n .card .box {\n height: 200px;\n border-top: 1px solid lightgray;\n word-break: break-all;\n overflow: auto;\n background-color: #f2f2f2;\n padding: 12px;\n }\n .card .box pre {\n margin: 0;\n }\n\n .card .card-actions {\n padding: 0 14px 8px 14px;\n min-height: 50px;\n }\n .card .card-actions .input {\n display: flex;\n align-items: center;\n }\n .card .card-actions .input:not(:last-child) {\n margin-bottom: 8px;\n }\n .card .card-actions .input label {\n width: 125px;\n text-align: right;\n margin-right: 14px;\n }\n .card .card-actions .input input {\n padding: 4px;\n }\n\n .json-key {\n color: rgb(124, 77, 255);\n }\n\n .json-value {\n color: rgb(67, 122, 237);\n }\n\n .json-string {\n color: rgb(83, 160, 83);\n }\n\n .json-date {\n color: rgb(200, 56, 198);\n }\n\n input {\n color: #5e35b1;\n padding: 10px;\n border: 1px solid #0000001f;\n border-radius: 4px;\n font-size: 14px;\n }\n\n input:invalid {\n border-color: #f44336;\n }\n\n input[type="checkbox"] {\n margin-right: 10px;\n }\n\n select {\n color: #5e35b1;\n padding: 8px 6px;\n border: 1px solid #0000001f;\n border-radius: 4px;\n }\n\n @media only screen and (max-width: 600px) {\n :host {\n padding: 0 !important;\n padding-bottom: 24px !important;\n }\n\n :host .card {\n border-left: 0;\n border-right: 0;\n border-radius: 0;\n margin: 0;\n margin-bottom: 6px;\n }\n }\n',Zs=(e,t=[])=>e?JSON.stringify(e,null,2).replace(/&/g,"&").replace(/\\"/g,""").replace(//g,">").replace(/^( *)("[\w-]+": )?("[^"]*"|[\w.+-]*)?([,[{])?$/gm,((e,n,s,i,r)=>{let o=n||"";const a=s?s.replace(/[": ]/g,""):void 0;if(a&&(o+=`${a}: `),i&&(o+=`${i}`,a&&t.includes(a))){const e=new Date(1e3*Number(i)),t=`${e.toDateString()}, ${e.toLocaleTimeString()}`;t&&(o+=` (${t})`)}return o+(r||"")})):"",ei=document.createElement("template");ei.innerHTML=`\n \n\n
\n
\n\n \n \n \n \n \n \n \n \n\n
\n \ud83d\udee1\ufe0fDemo app { }\n
\ud83d\udc48 choose an implementation
\n
\n\n
\n \n \n \n
\n\n
\n
\n`;class DemoAppHeaderElement extends HTMLElement{constructor(){var e;super(),this.listeners=[],this.implSelectEl=void 0,this.statusEl=void 0,this.versionEl=void 0,this.loginButtonEl=void 0,this.logoutButtonEl=void 0,this.silentRenewButtonEl=void 0,this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(ei.content,!0)),this.implSelectEl=this.shadowRoot.querySelector("#implementation-select"),this.statusEl=this.shadowRoot.querySelector(".status"),this.versionEl=this.shadowRoot.querySelector(".version"),this.loginButtonEl=this.shadowRoot.querySelector("#login-button"),this.logoutButtonEl=this.shadowRoot.querySelector("#logout-button"),this.silentRenewButtonEl=this.shadowRoot.querySelector("#silent-renew-button")}set isRenewing(e){this.statusEl&&this.statusEl.classList[e?"add":"remove"]("loading")}set isAuthenticated(e){this.statusEl&&null!==e&&(this.statusEl.classList.remove("loading"),this.statusEl.title=e?"Authenticated":"Not authenticated",this.statusEl.classList[e?"add":"remove"]("authenticated"),this.statusEl.classList[e?"remove":"add"]("not-authenticated"))}connectedCallback(){if(window.location.href.includes(":4200")){const e=document.createElement("option");e.textContent="localhost",this.implSelectEl.appendChild(e)}else{window.appSettings.getImplementations().forEach((e=>{const t=document.createElement("option");t.value=String(e.label),t.textContent=e.label,this.implSelectEl.appendChild(t)}));const e=()=>{window.location.href=window.appSettings.getImplementations()[this.implSelectEl.selectedIndex].demoUrl};this.implSelectEl.addEventListener("change",e),this.listeners.push((()=>this.implSelectEl.removeEventListener("change",e)))}const e=()=>{var e;null==(e=this.shadowRoot)||null==(e=e.querySelector("header .title .tip"))||e.remove(),window.appSettings.setShowTip(!1)};window.appSettings.get().showTip?(this.implSelectEl.addEventListener("click",e,{once:!0}),this.listeners.push((()=>this.implSelectEl.removeEventListener("click",e)))):e(),this.refreshImplementation(),this.addEventListeners()}disconnectedCallback(){this.listeners.forEach((e=>e()))}addEventListeners(){var e,t,n;const s=()=>this.dispatchEvent(new Event("login",{bubbles:!0,composed:!0}));null==(e=this.loginButtonEl)||e.addEventListener("click",s);const i=()=>this.dispatchEvent(new Event("logout",{bubbles:!0,composed:!0}));null==(t=this.logoutButtonEl)||t.addEventListener("click",i);const r=()=>this.dispatchEvent(new Event("silentRenew",{bubbles:!0,composed:!0}));null==(n=this.silentRenewButtonEl)||n.addEventListener("click",r),this.listeners.push((()=>{var e;return null==(e=this.loginButtonEl)?void 0:e.removeEventListener("click",s)}),(()=>{var e;return null==(e=this.logoutButtonEl)?void 0:e.removeEventListener("click",i)}),(()=>{var e;return null==(e=this.silentRenewButtonEl)?void 0:e.removeEventListener("click",r)}))}refreshImplementation(){const e=window.appSettings.getImplementations();if(window.location.href.includes(":4200"))this.implSelectEl.selectedIndex=0,this.versionEl.innerHTML="@localhost";else{const t=e.findIndex((e=>window.location.href.includes(e.demoUrl))),n=-1!==t?e[t]:e[0];this.implSelectEl.selectedIndex=-1!==t?t:0,this.versionEl.innerHTML=n.version}}}window.customElements.define("demo-app-header",DemoAppHeaderElement);const ti=document.createElement("template");ti.innerHTML=`\n \n\n \n \n
\n \n
\n`;class DemoAppMainElement extends HTMLElement{constructor(){var e;super(),this.listeners=[],this.tabsContentEl=void 0,this.demoAppHeaderEl=void 0,this.tabs=[],this.views=[],this.currentTabIndex=-1,this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(ti.content,!0)),this.tabsContentEl=this.shadowRoot.querySelector(".tabs-content"),this.demoAppHeaderEl=this.shadowRoot.querySelector("demo-app-header")}set isRenewing(e){this.demoAppHeaderEl.isRenewing=e}set isAuthenticated(e){this.demoAppHeaderEl.isAuthenticated=e}connectedCallback(){this.drawTabs(),this.showView(window.appSettings?window.appSettings.get().currentTabIndex:0)}disconnectedCallback(){this.listeners.forEach((e=>e()))}drawTabs(){const e=this.shadowRoot.querySelector("#views"),t=this.shadowRoot.querySelector("#tabs");e&&t&&(this.views=e.assignedElements(),this.views.forEach(((e,n)=>{e.style.display="none";const s=document.createElement("a");s.textContent=e.getAttribute("tabLabel")||"?";const i=()=>this.showView(n);s.addEventListener("click",i),this.listeners.push((()=>s.removeEventListener("click",i))),t.appendChild(s),this.tabs.push(s)})))}showView(e){var t;this.currentTabIndex!==e&&(this.currentTabIndex=e,this.tabs.forEach(((t,n)=>{t.classList[n!==e?"remove":"add"]("selected")})),this.views.forEach(((t,n)=>{t.style.display=n!==e?"none":"flex"})),null==(t=this.tabsContentEl)||t.scrollTo(0,0),window.appSettings.setCurrentTabIndex(e))}}window.customElements.define("demo-app-main",DemoAppMainElement);const ni=document.createElement("template");ni.innerHTML=`\n \n\n
\n
\n APIs access\n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n
\n \n
\n            
\n
\n
\n\n \n`;class DemoAppPlaygroundElement extends HTMLElement{constructor(){var e;super(),this.listeners=[],this.apiStatusEl=void 0,this.apiResponseEl=void 0,this.apiUrlEl=void 0,this.apiHeadersEl=void 0,this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(ni.content,!0)),this.apiStatusEl=this.shadowRoot.querySelector("#api-status"),this.apiResponseEl=this.shadowRoot.querySelector("#api-response"),this.apiUrlEl=this.shadowRoot.querySelector("#api-url-input"),this.apiHeadersEl=this.shadowRoot.querySelector("#api-headers-input")}connectedCallback(){var e,t,n;const s=null==(e=this.shadowRoot)?void 0:e.querySelector("#api-get-button"),i=()=>{const e=new CustomEvent("api",{bubbles:!0,composed:!0,detail:{url:this.apiUrlEl.value,headers:this.apiHeadersEl.value}});return this.dispatchEvent(e)};null==s||s.addEventListener("click",i);const r=()=>this.saveSettings({privateApiUrl:this.apiUrlEl.value});null==(t=this.apiUrlEl)||t.addEventListener("input",r);const o=()=>this.saveSettings({privateApiHeaders:this.apiHeadersEl.value});null==(n=this.apiHeadersEl)||n.addEventListener("input",o),this.listeners.push((()=>null==s?void 0:s.removeEventListener("click",i)),(()=>{var e;return null==(e=this.apiUrlEl)?void 0:e.removeEventListener("input",r)}),(()=>{var e;return null==(e=this.apiHeadersEl)?void 0:e.removeEventListener("input",o)}));const{otherSettings:a}=window.appSettings.getCurrentUserSettings();this.apiUrlEl.value=null==a?void 0:a.privateApiUrl,this.apiHeadersEl.value=null==a?void 0:a.privateApiHeaders}disconnectedCallback(){this.listeners.forEach((e=>e()))}setApiStatus(e,t){this.apiStatusEl.classList.remove(t?"success":"error"),this.apiStatusEl.classList.add(t?"error":"success"),this.apiResponseEl.innerHTML=Zs(e)}saveSettings(e){const t=window.appSettings.getCurrentUserSettings();t.otherSettings=Object.assign({},t.otherSettings,e),window.appSettings.addOrUpdateUserSettings(t)}}window.customElements.define("demo-app-playground",DemoAppPlaygroundElement);const si=document.createElement("template");si.innerHTML=`\n \n\n
\n
\n
Authenticated
\n \n
\n            
\n
\n\n
\n
User session
\n \n
\n            
\n
\n\n
\n
Access token
\n \n
\n                
\n            
\n
\n\n
\n
Id token
\n \n
\n                
\n            
\n
\n\n
\n
User profile
\n \n
\n            
\n
\n
\n`;class DemoAppDebugElement extends HTMLElement{constructor(){var e;super(),this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(si.content,!0)),this.isAuthenticated=!1,this.userSession=void 0,this.accessToken=void 0,this.accessTokenDecoded=void 0,this.idToken=void 0,this.idTokenDecoded=void 0,this.userProfile=void 0}set isAuthenticated(e){null!==e&&this.update("#isAuthenticated",e)}set userSession(e){this.update("#userSession",Zs(e,["expires_at"]))}set accessToken(e){this.update("#accessToken",e)}set accessTokenDecoded(e){const t="string"!=typeof e?Zs(e,["exp","iat","auth_time"]):"(no decoded info as it is not a JWT token)";this.update("#accessTokenDecoded",t)}set idToken(e){this.update("#idToken",e)}set idTokenDecoded(e){this.update("#idTokenDecoded",Zs(e,["exp","iat","auth_time"]))}set userProfile(e){this.update("#userProfile",Zs(e))}update(e,t){var n;const s=null==(n=this.shadowRoot)?void 0:n.querySelector(e);var i,r;s&&(null==t||""===t?null==(i=s.closest(".info"))||i.classList.add("hidden"):(null==(r=s.closest(".info"))||r.classList.remove("hidden"),s.innerHTML=String(t)))}}window.customElements.define("demo-app-debug",DemoAppDebugElement);const ii=document.createElement("template");ii.innerHTML=`\n \n\n
\n \n
\n \n
\n
\n\n \n\n
\n
\n DELETE\n
\n
\n \n \n
\n
\n
\n`;class DemoAppSettingsElement extends HTMLElement{constructor(){var e;super(),this.listeners=[],this.formEl=void 0,this.formContentEl=void 0,this.selectEl=void 0,this.settingsNameEl=void 0,this.formIsDirty=!1,this.formIsNew=!1,this.attachShadow({mode:"open"}),null==(e=this.shadowRoot)||e.appendChild(document.importNode(ii.content,!0))}connectedCallback(){var e,t,n,s,i;this.formEl=this.shadowRoot.querySelector("form"),this.formContentEl=this.shadowRoot.querySelector(".form-content"),this.selectEl=this.shadowRoot.querySelector("#settings-select"),this.settingsNameEl=this.shadowRoot.querySelector("#settingsName");const r=e=>{this.formIsDirty||"settings-select"===e.target.id||(this.formIsDirty=!0,this.classList.add("dirty"))};this.formEl.addEventListener("input",r),this.listeners.push((()=>this.formEl.removeEventListener("input",r))),this.refreshSelect();const o=()=>this.loadSettings(this.selectEl.value);null==(e=this.selectEl)||e.addEventListener("change",o),this.listeners.push((()=>this.selectEl.removeEventListener("change",o)));const a=null==(t=this.shadowRoot)?void 0:t.querySelector("#add-settings-button"),c=()=>this.add();null==a||a.addEventListener("click",c),this.listeners.push((()=>null==a?void 0:a.removeEventListener("click",c)));const l=null==(n=this.shadowRoot)?void 0:n.querySelector("#delete-settings-button"),d=()=>this.delete();null==l||l.addEventListener("click",d),this.listeners.push((()=>null==l?void 0:l.removeEventListener("click",d)));const u=null==(s=this.shadowRoot)?void 0:s.querySelector("#save-settings-button"),h=()=>this.saveAndReload();null==u||u.addEventListener("click",h),this.listeners.push((()=>null==u?void 0:u.removeEventListener("click",h)));const p=null==(i=this.shadowRoot)?void 0:i.querySelector("#cancel-settings-button"),g=()=>this.cancel();null==p||p.addEventListener("click",g),this.listeners.push((()=>null==p?void 0:p.removeEventListener("click",g))),this.refreshFormContent(window.appSettings.getCurrentUserSettings())}disconnectedCallback(){this.listeners.forEach((e=>e()))}loadSettings(e){window.appSettings.setCurrentUserSettings(e),location.reload()}add(){const e="New settings",t=document.createElement("option");t.selected=!0,t.value=e,t.textContent=e,this.selectEl.appendChild(t),this.formIsNew=!0,this.formIsDirty=!0,this.classList.add("dirty"),this.refreshFormContent({name:e,librarySettings:{}})}delete(){window.appSettings.deleteCurrentUserSettings(),location.reload()}cancel(){this.formIsNew=!1,this.formIsDirty=!1,this.classList.remove("dirty"),this.refreshSelect(),this.refreshFormContent(window.appSettings.getCurrentUserSettings())}setPathValue(e,t,n){const s=t.split(".");s.reduce(((e,t,i)=>(i===s.length-1?e[t]=n:Object.prototype.hasOwnProperty.call(e,t)||(e[t]={}),e[t])),e)}getPathValue(e,t){return t.split(".").reduce(((e,t)=>e?e[t]:e),e)}refreshSelect(){this.selectEl.innerHTML="";const{userSettings:e,currentUserSettingsId:t}=window.appSettings.get();e.sort(((e,t)=>e.name.localeCompare(t.name))).forEach((e=>{const n=document.createElement("option");n.selected=e.name===t,n.value=String(e.name),n.textContent=e.name,this.selectEl.appendChild(n)}))}refreshFormContent(e){this.formContentEl.innerHTML="";const{librarySettingsDefinition:t}=window.appSettings.get(),{name:n,librarySettings:s}=e;this.settingsNameEl.value=n,t.sort(((e,t)=>(t._sortIndex||0)-(e._sortIndex||0))).forEach((e=>{var t;const n=document.createElement("div");this.formContentEl.prepend(n);const i=document.createElement("label");i.htmlFor=e.name.replace(".",""),i.textContent=`${e.label}${e.required?" *":""}`;const r=document.createElement("list"===e.type?"select":"input");switch(r.id=e.name.replace(".",""),r.name=e.name.replace(".",""),r.required=!0===e.required,e.type){case"boolean":r.checked=this.getPathValue(s,e.name),r.type="checkbox",n.appendChild(r),n.appendChild(i);break;case"list":null==(t=e.values)||t.forEach((e=>{const t=document.createElement("option");t.value=String(e.value),t.textContent=e.label,r.appendChild(t)})),r.value=this.getPathValue(s,e.name),r.classList.add("flex"),n.classList.add("input","column"),n.appendChild(i),n.appendChild(r);break;default:{const t=this.getPathValue(s,e.name);"json"===e.type?r.value=t?JSON.stringify(t):"":r.value=null!=t?t:"",n.classList.add("input","column"),n.appendChild(i),n.appendChild(r);break}}}))}saveAndReload(){if(this.formEl.reportValidity()){const{librarySettingsDefinition:e}=window.appSettings.get(),t=this.formIsNew?{name:"",librarySettings:{}}:window.appSettings.getCurrentUserSettings();t.name=this.settingsNameEl.value,e.forEach((e=>{var n;const s=null==(n=this.shadowRoot)?void 0:n.querySelector(`#${e.name.replace(".","")}`);let i;switch(e.type){case"boolean":i=s.checked;break;case"list":default:i=s.value;break;case"json":try{const e=s.value;e&&""!==e.trim()&&(i=JSON.parse(e))}catch(r){console.error(r)}}this.setPathValue(t.librarySettings,e.name,i)})),window.appSettings.addOrUpdateUserSettings(t),this.formIsNew&&window.appSettings.setCurrentUserSettings(t.name),location.reload()}}}window.customElements.define("demo-app-settings",DemoAppSettingsElement);const ri=JSON.parse('{"UU":"@badisi/auth-js","rE":"0.0.0-semantically-released","TB":"https://github.com/Badisi/auth-js/tree/main/projects/auth-js"}'),oi=JSON.parse('{"UU":"@badisi/ngx-auth","TB":"https://github.com/Badisi/auth-js/tree/main/projects/ngx-auth"}');const ai=[{name:"authorityUrl",label:"Authority url",type:"string",required:!0},{name:"clientId",label:"Client id",type:"string",required:!0},{name:"mobileScheme",label:"Custom mobile scheme name",type:"string"},{name:"scope",label:"Scope",type:"string"},{name:"internal.extraQueryParams",label:"Extra query params",type:"json"},{name:"desktopNavigationType",label:"Desktop navigation type",type:"list",values:[{label:"REDIRECT",value:Qn.REDIRECT},{label:"POPUP",value:Qn.POPUP}]},{name:"logLevel",label:"Log level",type:"list",values:[{label:"NONE",value:Kt.NONE},{label:"ERROR",value:Kt.ERROR},{label:"WARN",value:Kt.WARN},{label:"INFO",value:Kt.INFO},{label:"DEBUG",value:Kt.DEBUG}]},{name:"loginRequired",label:"Login required",type:"boolean"},{name:"retrieveUserSession",label:"Retrieve user's session",type:"boolean"},{name:"loadUserInfo",label:"Load user's info",type:"boolean"},{name:"automaticSilentRenew",label:"Automatic silent renew",type:"boolean"}],ci=[...ai,{name:"automaticLoginOn401",label:"Automatic login on 401",type:"boolean"},{name:"automaticInjectToken",label:"Automatic inject token",type:"boolean"}];ci.splice(3,0,{name:"authGuardRedirectUrl",label:"AuthGuard redirect url",type:"string"});const li=(e=!1)=>{const t=[{name:"Auth0",otherSettings:{privateApiUrl:"https://dev-fijd1e9x.us.auth0.com/api/v2/users/auth0|631b171682c639d40cb84d5c",privateApiHeaders:""},librarySettings:{authorityUrl:"https://dev-fijd1e9x.us.auth0.com",clientId:"kRVVEnAWKMpxxpcodl0TqLXfIHgQvmmt",mobileScheme:"demo-app",scope:"openid profile email phone offline_access read:current_user",internal:{extraQueryParams:{audience:"https://dev-fijd1e9x.us.auth0.com/api/v2/"}},desktopNavigationType:Qn.REDIRECT,logLevel:Kt.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}},{name:"Zitadel",otherSettings:{privateApiUrl:"",privateApiHeaders:""},librarySettings:{authorityUrl:"https://auth-js-0pdipf.zitadel.cloud",clientId:"178200751804317953@demo-app",mobileScheme:"demo-app",scope:"openid profile email phone offline_access",desktopNavigationType:Qn.REDIRECT,logLevel:Kt.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}}];return e||t.push({name:"Keycloak (local)",otherSettings:{privateApiUrl:"/api/my-api",privateApiHeaders:""},librarySettings:{authorityUrl:"http://localhost:8080/auth/realms/demo",clientId:"demo-app",mobileScheme:"demo-app",scope:"openid profile email phone",desktopNavigationType:Qn.REDIRECT,logLevel:Kt.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}}),t},di=new class DemoAppSettings{constructor(e,t){this.storageKey=e,this.defaultAppSettings=t,this.implementations=[{label:"VanillaJS",demoUrl:"https://badisi.github.io/auth-js/demo-app/auth-js",version:`${ri.UU}@main`},{label:"Angular",demoUrl:"https://badisi.github.io/auth-js/demo-app/ngx-auth",version:`${oi.UU}@main`}],this.defaultAppSettings.librarySettingsDefinition.forEach(((e,t)=>e._sortIndex=t))}getImplementations(){return this.implementations}setShowTip(e){const t=this.get();t.showTip=e,this.saveAppSettings(t)}setCurrentTabIndex(e){const t=this.get();t.currentTabIndex=e,this.saveAppSettings(t)}addOrUpdateUserSettings(e){const t=this.get(),n=t.userSettings.findIndex((t=>t.name===e.name));-1!==n?t.userSettings[n]=e:t.userSettings.push(e),this.saveAppSettings(t)}deleteCurrentUserSettings(){const e=this.get(),{name:t}=this.getCurrentUserSettings(),n=e.userSettings.findIndex((e=>e.name===t));-1!==n&&(e.userSettings.splice(n,1),delete e.currentUserSettingsId,this.saveAppSettings(e))}setCurrentUserSettings(e){const t=this.get();-1!==t.userSettings.findIndex((t=>t.name===e))&&(t.currentUserSettingsId=e,this.saveAppSettings(t))}getCurrentUserSettings(){const e=this.get(),t=e.userSettings.findIndex((t=>t.name===e.currentUserSettingsId));return-1!==t?e.userSettings[t]:e.userSettings.sort(((e,t)=>e.name.localeCompare(t.name)))[0]}get(){const e=sessionStorage.getItem(this.storageKey);if(e){const t=Object.assign({},this.defaultAppSettings,JSON.parse(e));return this.defaultAppSettings.userSettings.forEach((e=>{t.userSettings.find((t=>t.name===e.name))||t.userSettings.push(e)})),t}return Object.assign({},this.defaultAppSettings)}saveAppSettings(e){delete e.librarySettingsDefinition,sessionStorage.setItem(this.storageKey,JSON.stringify(e))}}(`auth-js:${ri.rE}:demo-app:settings`,{showTip:!0,currentTabIndex:0,userSettings:li(!0),librarySettingsDefinition:ai});(()=>{window.appSettings=di;const e=document.createElement("div");e.innerHTML="Loading...",document.body.appendChild(e),(async e=>await(async(e,t)=>{const n=new t;return await n.init(e),n})(e,OIDCAuthManager))(di.getCurrentUserSettings().librarySettings).then((t=>{window.authManager=t,e.replaceWith(document.createElement("app-root"))})).catch((t=>{var n;console.error(t),e.innerHTML=`${t.message}
`,null==(n=document.body.querySelector("#loginButton"))||n.addEventListener("click",(()=>location.reload()),{once:!0})}))})()},436:function(e,t,n){var s;e.exports=(s=s||function(e,t){var s;if("undefined"!=typeof window&&window.crypto&&(s=window.crypto),"undefined"!=typeof self&&self.crypto&&(s=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(s=globalThis.crypto),!s&&"undefined"!=typeof window&&window.msCrypto&&(s=window.msCrypto),!s&&"undefined"!=typeof global&&global.crypto&&(s=global.crypto),!s)try{s=n(366)}catch(f){}var i=function(){if(s){if("function"==typeof s.getRandomValues)try{return s.getRandomValues(new Uint32Array(1))[0]}catch(f){}if("function"==typeof s.randomBytes)try{return s.randomBytes(4).readInt32LE()}catch(f){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},c=a.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=a.WordArray=c.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,s=this.sigBytes,i=e.sigBytes;if(this.clamp(),s%4)for(var r=0;r>>2]>>>24-r%4*8&255;t[s+r>>>2]|=o<<24-(s+r)%4*8}else for(var a=0;a>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-i%4*8&255;s.push((r>>>4).toString(16)),s.push((15&r).toString(16))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new l.init(n,t/2)}},h=d.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],i=0;i>>2]>>>24-i%4*8&255;s.push(String.fromCharCode(r))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;return new l.init(n,t)}},p=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},g=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,s=this._data,i=s.words,r=s.sigBytes,o=this.blockSize,a=r/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,d=e.min(4*c,r);if(c){for(var u=0;u>>6-o%4*2;i[r>>>2]|=a<<24-r%4*8,r++}return t.create(i,r)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,s=this._map;e.clamp();for(var i=[],r=0;r>>2]>>>24-r%4*8&255)<<16|(t[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|t[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a>>6*(3-a)&63));var c=s.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,s=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var r=0;r>>7)^(g<<14|g>>>18)^g>>>3,f=l[p-2],m=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;l[p]=_+l[p-7]+m+l[p-16]}var w=s&i^s&r^i&r,v=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),b=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&d^~a&u)+c[p]+l[p];h=u,u=d,d=a,a=o+b|0,o=r,r=i,i=s,s=b+(v+w)|0}n[0]=n[0]+s|0,n[1]=n[1]+i|0,n[2]=n[2]+r|0,n[3]=n[3]+o|0,n[4]=n[4]+a|0,n[5]=n[5]+d|0,n[6]=n[6]+u|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,s=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(s/4294967296),n[15+(i+64>>>9<<4)]=s,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(d),t.HmacSHA256=r._createHmacHelper(d)}(Math),s.SHA256)},566:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var s=n(753);e=n.hmd(e);var i="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=i&&e&&!e.nodeType&&e,o=r&&r.exports===i?s.A.Buffer:void 0,a=o?o.allocUnsafe:void 0;const c=function(e,t){if(t)return e.slice();var n=e.length,s=a?a(n):new e.constructor(n);return e.copy(s),s}},724:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});const s="object"==typeof global&&global&&global.Object===Object&&global},485:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var s=n(724);e=n.hmd(e);var i="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=i&&e&&!e.nodeType&&e,o=r&&r.exports===i&&s.A.process;const a=function(){try{var e=r&&r.require&&r.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(t){}}()},753:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var s=n(724),i="object"==typeof self&&self&&self.Object===Object&&self;const r=s.A||i||Function("return this")()},160:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var s=n(753);const i=function(){return!1};e=n.hmd(e);var r="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=r&&e&&!e.nodeType&&e,a=o&&o.exports===r?s.A.Buffer:void 0;const c=(a?a.isBuffer:void 0)||i},366:()=>{}},e=>{var t;t=179,e(e.s=t)}]); \ No newline at end of file diff --git a/demo-app/auth-js/runtime.1af42e8fcde6888f.js b/demo-app/auth-js/runtime.1af42e8fcde6888f.js new file mode 100644 index 0000000..e114a9a --- /dev/null +++ b/demo-app/auth-js/runtime.1af42e8fcde6888f.js @@ -0,0 +1 @@ +(()=>{"use strict";var e,r={},o={};function t(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={id:e,loaded:!1,exports:{}};return r[e].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}t.m=r,e=[],t.O=(r,o,n,a)=>{if(!o){var s=1/0;for(p=0;p=a)&&Object.keys(t.O).every((e=>t.O[e](o[i])))?o.splice(i--,1):(l=!1,a0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[o,n,a]},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={121:0};t.O.j=r=>0===e[r];var r=(r,o)=>{var n,a,[s,l,i]=o,d=0;if(s.some((r=>0!==e[r]))){for(n in l)t.o(l,n)&&(t.m[n]=l[n]);if(i)var p=i(t)}for(r&&r(o);d{}},s=>{var e;e=737,s(s.s=e)}]); \ No newline at end of file diff --git a/demo-app/ngx-auth/3rdpartylicenses.txt b/demo-app/ngx-auth/3rdpartylicenses.txt index 0842bcb..532e530 100644 --- a/demo-app/ngx-auth/3rdpartylicenses.txt +++ b/demo-app/ngx-auth/3rdpartylicenses.txt @@ -13,32 +13,6 @@ MIT @angular/router MIT -@babel/runtime -MIT -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - @badisi/auth-js GPL-3.0-only @@ -608,7 +582,7 @@ zone.js MIT The MIT License -Copyright (c) 2010-2023 Google LLC. https://angular.io/license +Copyright (c) 2010-2024 Google LLC. https://angular.io/license Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/demo-app/ngx-auth/998.e0dbcb6f14904117.js b/demo-app/ngx-auth/998.7d2c96e76000cb11.js similarity index 90% rename from demo-app/ngx-auth/998.e0dbcb6f14904117.js rename to demo-app/ngx-auth/998.7d2c96e76000cb11.js index 2cfbe75..6d6b449 100644 --- a/demo-app/ngx-auth/998.e0dbcb6f14904117.js +++ b/demo-app/ngx-auth/998.7d2c96e76000cb11.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdemo_app_ngx_auth=self.webpackChunkdemo_app_ngx_auth||[]).push([[998],{1998:(c,s,e)=>{e.r(s),e.d(s,{PageComponent:()=>l});var t=e(4438),o=e(8540);let l=(()=>{class n{constructor(){this.title="",this.route=(0,t.WQX)(o.nX)}ngOnInit(){this.title=this.route.snapshot.data.title}static#t=this.\u0275fac=function(a){return new(a||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["app-page"]],standalone:!0,features:[t.aNF],decls:2,vars:1,template:function(a,u){1&a&&(t.j41(0,"h2"),t.EFF(1),t.k0s()),2&a&&(t.R7$(),t.JRh(u.title))},styles:["[_nghost-%COMP%]{display:flex;justify-content:center;align-items:center;height:100%;color:#bdbdbd}"]})}return n})()}}]); \ No newline at end of file +"use strict";(self.webpackChunkdemo_app_ngx_auth=self.webpackChunkdemo_app_ngx_auth||[]).push([[998],{1998:(c,s,e)=>{e.r(s),e.d(s,{PageComponent:()=>l});var t=e(3953),o=e(8540);let l=(()=>{class n{constructor(){this.title="",this.route=(0,t.WQX)(o.nX)}ngOnInit(){this.title=this.route.snapshot.data.title}static#t=this.\u0275fac=function(a){return new(a||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["app-page"]],standalone:!0,features:[t.aNF],decls:2,vars:1,template:function(a,u){1&a&&(t.j41(0,"h2"),t.EFF(1),t.k0s()),2&a&&(t.R7$(),t.JRh(u.title))},styles:["[_nghost-%COMP%]{display:flex;justify-content:center;align-items:center;height:100%;color:#bdbdbd}"]})}return n})()}}]); \ No newline at end of file diff --git a/demo-app/ngx-auth/index.html b/demo-app/ngx-auth/index.html index b3d2b6f..226367a 100644 --- a/demo-app/ngx-auth/index.html +++ b/demo-app/ngx-auth/index.html @@ -8,7 +8,7 @@ - + @@ -21,6 +21,6 @@ } } - + diff --git a/demo-app/ngx-auth/main.b4a8445448d3cf7a.js b/demo-app/ngx-auth/main.b4a8445448d3cf7a.js deleted file mode 100644 index 118573d..0000000 --- a/demo-app/ngx-auth/main.b4a8445448d3cf7a.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkdemo_app_ngx_auth=self.webpackChunkdemo_app_ngx_auth||[]).push([[792],{3147:(Ue,he,O)=>{"use strict";var C=O(345),N=O(467),w=O(4438),j=O(7673),Q=O(1985),De=O(6648),J=O(274),be=O(5964),ge=O(6354),te=O(980),Z=O(5558),se=O(177);class Te{}class ae{}class Se{constructor(s){this.normalizedNames=new Map,this.lazyUpdate=null,s?"string"==typeof s?this.lazyInit=()=>{this.headers=new Map,s.split("\n").forEach(a=>{const u=a.indexOf(":");if(u>0){const m=a.slice(0,u),E=m.toLowerCase(),T=a.slice(u+1).trim();this.maybeSetNormalizedName(m,E),this.headers.has(E)?this.headers.get(E).push(T):this.headers.set(E,[T])}})}:typeof Headers<"u"&&s instanceof Headers?(this.headers=new Map,s.forEach((a,u)=>{this.setHeaderEntries(u,a)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(s).forEach(([a,u])=>{this.setHeaderEntries(a,u)})}:this.headers=new Map}has(s){return this.init(),this.headers.has(s.toLowerCase())}get(s){this.init();const a=this.headers.get(s.toLowerCase());return a&&a.length>0?a[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(s){return this.init(),this.headers.get(s.toLowerCase())||null}append(s,a){return this.clone({name:s,value:a,op:"a"})}set(s,a){return this.clone({name:s,value:a,op:"s"})}delete(s,a){return this.clone({name:s,value:a,op:"d"})}maybeSetNormalizedName(s,a){this.normalizedNames.has(a)||this.normalizedNames.set(a,s)}init(){this.lazyInit&&(this.lazyInit instanceof Se?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(s=>this.applyUpdate(s)),this.lazyUpdate=null))}copyFrom(s){s.init(),Array.from(s.headers.keys()).forEach(a=>{this.headers.set(a,s.headers.get(a)),this.normalizedNames.set(a,s.normalizedNames.get(a))})}clone(s){const a=new Se;return a.lazyInit=this.lazyInit&&this.lazyInit instanceof Se?this.lazyInit:this,a.lazyUpdate=(this.lazyUpdate||[]).concat([s]),a}applyUpdate(s){const a=s.name.toLowerCase();switch(s.op){case"a":case"s":let u=s.value;if("string"==typeof u&&(u=[u]),0===u.length)return;this.maybeSetNormalizedName(s.name,a);const m=("a"===s.op?this.headers.get(a):void 0)||[];m.push(...u),this.headers.set(a,m);break;case"d":const E=s.value;if(E){let T=this.headers.get(a);if(!T)return;T=T.filter(x=>-1===E.indexOf(x)),0===T.length?(this.headers.delete(a),this.normalizedNames.delete(a)):this.headers.set(a,T)}else this.headers.delete(a),this.normalizedNames.delete(a)}}setHeaderEntries(s,a){const u=(Array.isArray(a)?a:[a]).map(E=>E.toString()),m=s.toLowerCase();this.headers.set(m,u),this.maybeSetNormalizedName(s,m)}forEach(s){this.init(),Array.from(this.normalizedNames.keys()).forEach(a=>s(this.normalizedNames.get(a),this.headers.get(a)))}}class Ze{encodeKey(s){return pe(s)}encodeValue(s){return pe(s)}decodeKey(s){return decodeURIComponent(s)}decodeValue(s){return decodeURIComponent(s)}}const ye=/%(\d[a-f0-9])/gi,Be={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function pe(i){return encodeURIComponent(i).replace(ye,(s,a)=>Be[a]??s)}function de(i){return`${i}`}class Ce{constructor(s={}){if(this.updates=null,this.cloneFrom=null,this.encoder=s.encoder||new Ze,s.fromString){if(s.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function ie(i,s){const a=new Map;return i.length>0&&i.replace(/^\?/,"").split("&").forEach(m=>{const E=m.indexOf("="),[T,x]=-1==E?[s.decodeKey(m),""]:[s.decodeKey(m.slice(0,E)),s.decodeValue(m.slice(E+1))],V=a.get(T)||[];V.push(x),a.set(T,V)}),a}(s.fromString,this.encoder)}else s.fromObject?(this.map=new Map,Object.keys(s.fromObject).forEach(a=>{const u=s.fromObject[a],m=Array.isArray(u)?u.map(de):[de(u)];this.map.set(a,m)})):this.map=null}has(s){return this.init(),this.map.has(s)}get(s){this.init();const a=this.map.get(s);return a?a[0]:null}getAll(s){return this.init(),this.map.get(s)||null}keys(){return this.init(),Array.from(this.map.keys())}append(s,a){return this.clone({param:s,value:a,op:"a"})}appendAll(s){const a=[];return Object.keys(s).forEach(u=>{const m=s[u];Array.isArray(m)?m.forEach(E=>{a.push({param:u,value:E,op:"a"})}):a.push({param:u,value:m,op:"a"})}),this.clone(a)}set(s,a){return this.clone({param:s,value:a,op:"s"})}delete(s,a){return this.clone({param:s,value:a,op:"d"})}toString(){return this.init(),this.keys().map(s=>{const a=this.encoder.encodeKey(s);return this.map.get(s).map(u=>a+"="+this.encoder.encodeValue(u)).join("&")}).filter(s=>""!==s).join("&")}clone(s){const a=new Ce({encoder:this.encoder});return a.cloneFrom=this.cloneFrom||this,a.updates=(this.updates||[]).concat(s),a}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(s=>this.map.set(s,this.cloneFrom.map.get(s))),this.updates.forEach(s=>{switch(s.op){case"a":case"s":const a=("a"===s.op?this.map.get(s.param):void 0)||[];a.push(de(s.value)),this.map.set(s.param,a);break;case"d":if(void 0===s.value){this.map.delete(s.param);break}{let u=this.map.get(s.param)||[];const m=u.indexOf(de(s.value));-1!==m&&u.splice(m,1),u.length>0?this.map.set(s.param,u):this.map.delete(s.param)}}}),this.cloneFrom=this.updates=null)}}class Ae{constructor(){this.map=new Map}set(s,a){return this.map.set(s,a),this}get(s){return this.map.has(s)||this.map.set(s,s.defaultValue()),this.map.get(s)}delete(s){return this.map.delete(s),this}has(s){return this.map.has(s)}keys(){return this.map.keys()}}function Pe(i){return typeof ArrayBuffer<"u"&&i instanceof ArrayBuffer}function qe(i){return typeof Blob<"u"&&i instanceof Blob}function Je(i){return typeof FormData<"u"&&i instanceof FormData}class yn{constructor(s,a,u,m){let E;if(this.url=a,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=s.toUpperCase(),function Ie(i){switch(i){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||m?(this.body=void 0!==u?u:null,E=m):E=u,E&&(this.reportProgress=!!E.reportProgress,this.withCredentials=!!E.withCredentials,E.responseType&&(this.responseType=E.responseType),E.headers&&(this.headers=E.headers),E.context&&(this.context=E.context),E.params&&(this.params=E.params),this.transferCache=E.transferCache),this.headers??=new Se,this.context??=new Ae,this.params){const T=this.params.toString();if(0===T.length)this.urlWithParams=a;else{const x=a.indexOf("?");this.urlWithParams=a+(-1===x?"?":xOe.set(_t,s.setHeaders[_t]),z)),s.setParams&&(fe=Object.keys(s.setParams).reduce((Oe,_t)=>Oe.set(_t,s.setParams[_t]),fe)),new yn(a,u,T,{params:fe,headers:z,context:ve,reportProgress:V,responseType:m,withCredentials:x,transferCache:E})}}var tn=function(i){return i[i.Sent=0]="Sent",i[i.UploadProgress=1]="UploadProgress",i[i.ResponseHeader=2]="ResponseHeader",i[i.DownloadProgress=3]="DownloadProgress",i[i.Response=4]="Response",i[i.User=5]="User",i}(tn||{});class Rn{constructor(s,a=Y.Ok,u="OK"){this.headers=s.headers||new Se,this.status=void 0!==s.status?s.status:a,this.statusText=s.statusText||u,this.url=s.url||null,this.ok=this.status>=200&&this.status<300}}class mt extends Rn{constructor(s={}){super(s),this.type=tn.ResponseHeader}clone(s={}){return new mt({headers:s.headers||this.headers,status:void 0!==s.status?s.status:this.status,statusText:s.statusText||this.statusText,url:s.url||this.url||void 0})}}class dn extends Rn{constructor(s={}){super(s),this.type=tn.Response,this.body=void 0!==s.body?s.body:null}clone(s={}){return new dn({body:void 0!==s.body?s.body:this.body,headers:s.headers||this.headers,status:void 0!==s.status?s.status:this.status,statusText:s.statusText||this.statusText,url:s.url||this.url||void 0})}}class K extends Rn{constructor(s){super(s,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${s.url||"(unknown url)"}`:`Http failure response for ${s.url||"(unknown url)"}: ${s.status} ${s.statusText}`,this.error=s.error||null}}var Y=function(i){return i[i.Continue=100]="Continue",i[i.SwitchingProtocols=101]="SwitchingProtocols",i[i.Processing=102]="Processing",i[i.EarlyHints=103]="EarlyHints",i[i.Ok=200]="Ok",i[i.Created=201]="Created",i[i.Accepted=202]="Accepted",i[i.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",i[i.NoContent=204]="NoContent",i[i.ResetContent=205]="ResetContent",i[i.PartialContent=206]="PartialContent",i[i.MultiStatus=207]="MultiStatus",i[i.AlreadyReported=208]="AlreadyReported",i[i.ImUsed=226]="ImUsed",i[i.MultipleChoices=300]="MultipleChoices",i[i.MovedPermanently=301]="MovedPermanently",i[i.Found=302]="Found",i[i.SeeOther=303]="SeeOther",i[i.NotModified=304]="NotModified",i[i.UseProxy=305]="UseProxy",i[i.Unused=306]="Unused",i[i.TemporaryRedirect=307]="TemporaryRedirect",i[i.PermanentRedirect=308]="PermanentRedirect",i[i.BadRequest=400]="BadRequest",i[i.Unauthorized=401]="Unauthorized",i[i.PaymentRequired=402]="PaymentRequired",i[i.Forbidden=403]="Forbidden",i[i.NotFound=404]="NotFound",i[i.MethodNotAllowed=405]="MethodNotAllowed",i[i.NotAcceptable=406]="NotAcceptable",i[i.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",i[i.RequestTimeout=408]="RequestTimeout",i[i.Conflict=409]="Conflict",i[i.Gone=410]="Gone",i[i.LengthRequired=411]="LengthRequired",i[i.PreconditionFailed=412]="PreconditionFailed",i[i.PayloadTooLarge=413]="PayloadTooLarge",i[i.UriTooLong=414]="UriTooLong",i[i.UnsupportedMediaType=415]="UnsupportedMediaType",i[i.RangeNotSatisfiable=416]="RangeNotSatisfiable",i[i.ExpectationFailed=417]="ExpectationFailed",i[i.ImATeapot=418]="ImATeapot",i[i.MisdirectedRequest=421]="MisdirectedRequest",i[i.UnprocessableEntity=422]="UnprocessableEntity",i[i.Locked=423]="Locked",i[i.FailedDependency=424]="FailedDependency",i[i.TooEarly=425]="TooEarly",i[i.UpgradeRequired=426]="UpgradeRequired",i[i.PreconditionRequired=428]="PreconditionRequired",i[i.TooManyRequests=429]="TooManyRequests",i[i.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",i[i.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",i[i.InternalServerError=500]="InternalServerError",i[i.NotImplemented=501]="NotImplemented",i[i.BadGateway=502]="BadGateway",i[i.ServiceUnavailable=503]="ServiceUnavailable",i[i.GatewayTimeout=504]="GatewayTimeout",i[i.HttpVersionNotSupported=505]="HttpVersionNotSupported",i[i.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",i[i.InsufficientStorage=507]="InsufficientStorage",i[i.LoopDetected=508]="LoopDetected",i[i.NotExtended=510]="NotExtended",i[i.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",i}(Y||{});function ee(i,s){return{body:s,headers:i.headers,context:i.context,observe:i.observe,params:i.params,reportProgress:i.reportProgress,responseType:i.responseType,withCredentials:i.withCredentials,transferCache:i.transferCache}}let oe=(()=>{class i{constructor(a){this.handler=a}request(a,u,m={}){let E;if(a instanceof yn)E=a;else{let V,z;V=m.headers instanceof Se?m.headers:new Se(m.headers),m.params&&(z=m.params instanceof Ce?m.params:new Ce({fromObject:m.params})),E=new yn(a,u,void 0!==m.body?m.body:null,{headers:V,context:m.context,params:z,reportProgress:m.reportProgress,responseType:m.responseType||"json",withCredentials:m.withCredentials,transferCache:m.transferCache})}const T=(0,j.of)(E).pipe((0,J.H)(V=>this.handler.handle(V)));if(a instanceof yn||"events"===m.observe)return T;const x=T.pipe((0,be.p)(V=>V instanceof dn));switch(m.observe||"body"){case"body":switch(E.responseType){case"arraybuffer":return x.pipe((0,ge.T)(V=>{if(null!==V.body&&!(V.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return V.body}));case"blob":return x.pipe((0,ge.T)(V=>{if(null!==V.body&&!(V.body instanceof Blob))throw new Error("Response is not a Blob.");return V.body}));case"text":return x.pipe((0,ge.T)(V=>{if(null!==V.body&&"string"!=typeof V.body)throw new Error("Response is not a string.");return V.body}));default:return x.pipe((0,ge.T)(V=>V.body))}case"response":return x;default:throw new Error(`Unreachable: unhandled observe type ${m.observe}}`)}}delete(a,u={}){return this.request("DELETE",a,u)}get(a,u={}){return this.request("GET",a,u)}head(a,u={}){return this.request("HEAD",a,u)}jsonp(a,u){return this.request("JSONP",a,{params:(new Ce).append(u,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(a,u={}){return this.request("OPTIONS",a,u)}patch(a,u,m={}){return this.request("PATCH",a,ee(m,u))}post(a,u,m={}){return this.request("POST",a,ee(m,u))}put(a,u,m={}){return this.request("PUT",a,ee(m,u))}static#e=this.\u0275fac=function(u){return new(u||i)(w.KVO(Te))};static#t=this.\u0275prov=w.jDH({token:i,factory:i.\u0275fac})}return i})();function an(i,s){return s(i)}const On=new w.nKC(""),Kt=new w.nKC(""),jn=new w.nKC("");let wr=(()=>{class i extends Te{constructor(a,u){super(),this.backend=a,this.injector=u,this.chain=null,this.pendingTasks=(0,w.WQX)(w.TgB);const m=(0,w.WQX)(jn,{optional:!0});this.backend=m??a}handle(a){if(null===this.chain){const m=Array.from(new Set([...this.injector.get(On),...this.injector.get(Kt,[])]));this.chain=m.reduceRight((E,T)=>function pn(i,s,a){return(u,m)=>(0,w.N4e)(a,()=>s(u,E=>i(E,m)))}(E,T,this.injector),an)}const u=this.pendingTasks.add();return this.chain(a,m=>this.backend.handle(m)).pipe((0,te.j)(()=>this.pendingTasks.remove(u)))}static#e=this.\u0275fac=function(u){return new(u||i)(w.KVO(ae),w.KVO(w.uvJ))};static#t=this.\u0275prov=w.jDH({token:i,factory:i.\u0275fac})}return i})();const tt=/^\)\]\}',?\n/;let Tt=(()=>{class i{constructor(a){this.xhrFactory=a}handle(a){if("JSONP"===a.method)throw new w.wOt(-2800,!1);const u=this.xhrFactory;return(u.\u0275loadImpl?(0,De.H)(u.\u0275loadImpl()):(0,j.of)(null)).pipe((0,Z.n)(()=>new Q.c(E=>{const T=u.build();if(T.open(a.method,a.urlWithParams),a.withCredentials&&(T.withCredentials=!0),a.headers.forEach((ht,Ct)=>T.setRequestHeader(ht,Ct.join(","))),a.headers.has("Accept")||T.setRequestHeader("Accept","application/json, text/plain, */*"),!a.headers.has("Content-Type")){const ht=a.detectContentTypeHeader();null!==ht&&T.setRequestHeader("Content-Type",ht)}if(a.responseType){const ht=a.responseType.toLowerCase();T.responseType="json"!==ht?ht:"text"}const x=a.serializeBody();let V=null;const z=()=>{if(null!==V)return V;const ht=T.statusText||"OK",Ct=new Se(T.getAllResponseHeaders()),$t=function Mo(i){return"responseURL"in i&&i.responseURL?i.responseURL:/^X-Request-URL:/m.test(i.getAllResponseHeaders())?i.getResponseHeader("X-Request-URL"):null}(T)||a.url;return V=new mt({headers:Ct,status:T.status,statusText:ht,url:$t}),V},fe=()=>{let{headers:ht,status:Ct,statusText:$t,url:Xt}=z(),Ot=null;Ct!==Y.NoContent&&(Ot=typeof T.response>"u"?T.responseText:T.response),0===Ct&&(Ct=Ot?Y.Ok:0);let un=Ct>=200&&Ct<300;if("json"===a.responseType&&"string"==typeof Ot){const sn=Ot;Ot=Ot.replace(tt,"");try{Ot=""!==Ot?JSON.parse(Ot):null}catch(Qn){Ot=sn,un&&(un=!1,Ot={error:Qn,text:Ot})}}un?(E.next(new dn({body:Ot,headers:ht,status:Ct,statusText:$t,url:Xt||void 0})),E.complete()):E.error(new K({error:Ot,headers:ht,status:Ct,statusText:$t,url:Xt||void 0}))},ve=ht=>{const{url:Ct}=z(),$t=new K({error:ht,status:T.status||0,statusText:T.statusText||"Unknown Error",url:Ct||void 0});E.error($t)};let Oe=!1;const _t=ht=>{Oe||(E.next(z()),Oe=!0);let Ct={type:tn.DownloadProgress,loaded:ht.loaded};ht.lengthComputable&&(Ct.total=ht.total),"text"===a.responseType&&T.responseText&&(Ct.partialText=T.responseText),E.next(Ct)},Dt=ht=>{let Ct={type:tn.UploadProgress,loaded:ht.loaded};ht.lengthComputable&&(Ct.total=ht.total),E.next(Ct)};return T.addEventListener("load",fe),T.addEventListener("error",ve),T.addEventListener("timeout",ve),T.addEventListener("abort",ve),a.reportProgress&&(T.addEventListener("progress",_t),null!==x&&T.upload&&T.upload.addEventListener("progress",Dt)),T.send(x),E.next({type:tn.Sent}),()=>{T.removeEventListener("error",ve),T.removeEventListener("abort",ve),T.removeEventListener("load",fe),T.removeEventListener("timeout",ve),a.reportProgress&&(T.removeEventListener("progress",_t),null!==x&&T.upload&&T.upload.removeEventListener("progress",Dt)),T.readyState!==T.DONE&&T.abort()}})))}static#e=this.\u0275fac=function(u){return new(u||i)(w.KVO(se.N0))};static#t=this.\u0275prov=w.jDH({token:i,factory:i.\u0275fac})}return i})();const bt=new w.nKC(""),Qt=new w.nKC("",{providedIn:"root",factory:()=>"XSRF-TOKEN"}),fo=new w.nKC("",{providedIn:"root",factory:()=>"X-XSRF-TOKEN"});class St{}let lr=(()=>{class i{constructor(a,u,m){this.doc=a,this.platform=u,this.cookieName=m,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const a=this.doc.cookie||"";return a!==this.lastCookieString&&(this.parseCount++,this.lastToken=(0,se._b)(a,this.cookieName),this.lastCookieString=a),this.lastToken}static#e=this.\u0275fac=function(u){return new(u||i)(w.KVO(se.qQ),w.KVO(w.Agw),w.KVO(Qt))};static#t=this.\u0275prov=w.jDH({token:i,factory:i.\u0275fac})}return i})();function $(i,s){const a=i.url.toLowerCase();if(!(0,w.WQX)(bt)||"GET"===i.method||"HEAD"===i.method||a.startsWith("http://")||a.startsWith("https://"))return s(i);const u=(0,w.WQX)(St).getToken(),m=(0,w.WQX)(fo);return null!=u&&!i.headers.has(m)&&(i=i.clone({headers:i.headers.set(m,u)})),s(i)}var k=function(i){return i[i.Interceptors=0]="Interceptors",i[i.LegacyInterceptors=1]="LegacyInterceptors",i[i.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",i[i.NoXsrfProtection=3]="NoXsrfProtection",i[i.JsonpSupport=4]="JsonpSupport",i[i.RequestsMadeViaParent=5]="RequestsMadeViaParent",i[i.Fetch=6]="Fetch",i}(k||{});function ce(...i){const s=[oe,Tt,wr,{provide:Te,useExisting:wr},{provide:ae,useExisting:Tt},{provide:On,useValue:$,multi:!0},{provide:bt,useValue:!0},{provide:St,useClass:lr}];for(const a of i)s.push(...a.\u0275providers);return(0,w.EmA)(s)}function ke(i){return function B(i,s){return{\u0275kind:i,\u0275providers:s}}(k.Interceptors,i.map(s=>({provide:On,useValue:s,multi:!0})))}var Ii=O(8810),qr=O(6697),Ro=O(9437),Ke=O(8540);function ho(i){this.message=i}(ho.prototype=new Error).name="InvalidCharacterError";var No=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(i){var s=String(i).replace(/=+$/,"");if(s.length%4==1)throw new ho("'atob' failed: The string to be decoded is not correctly encoded.");for(var a,u,m=0,E=0,T="";u=s.charAt(E++);~u&&(a=m%4?64*a+u:u,m++%4)?T+=String.fromCharCode(255&a>>(-2*m&6)):0)u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(u);return T};function Oo(i){this.message=i}(Oo.prototype=new Error).name="InvalidTokenError";const cs=function ei(i,s){if("string"!=typeof i)throw new Oo("Invalid token specified");var a=!0===(s=s||{}).header?0:1;try{return JSON.parse(function ls(i){var s=i.replace(/-/g,"+").replace(/_/g,"/");switch(s.length%4){case 0:break;case 2:s+="==";break;case 3:s+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(No(s).replace(/(.)/g,function(u,m){var E=m.charCodeAt(0).toString(16).toUpperCase();return E.length<2&&(E="0"+E),"%"+E}))}catch{return No(s)}}(i.split(".")[a]))}catch(u){throw new Oo("Invalid token specified: "+u.message)}};let ln=(()=>{class i{static#e=this.isCordova=()=>!!(window.cordova||window.phonegap||window.PhoneGap);static#t=this.isCapacitor=()=>!!window.Capacitor?.isNativePlatform();static#n=this.isNativeMobile=()=>i.isCapacitor()||i.isCordova();static#i=this.decodeJwt=a=>{try{return a&&cs(a)}catch{return console.warn("[@badisi/auth-js] Access token was not decoded as it is not a valid JWT."),a}};static#s=this.isUrlMatching=(a,u)=>{if(void 0!==u){const m=new URL(a,"http://test"),E=new URL(u,"http://test");if(""!==E.pathname&&"/"!==E.pathname&&!m.pathname.includes(E.pathname)||"http://test"!==E.origin&&(m.protocol!==E.protocol||m.origin!==E.origin||!`${m.origin}${m.pathname}}`.includes(`${E.origin}${E.pathname}`)))return!1;let T=!0;return E.searchParams.forEach((x,V)=>{m.searchParams.getAll(V).includes(x)||(T=!1)}),T}return!1};static#a=this.getBaseUrl=()=>{const a=document.baseURI||document.querySelector("base")?.href||location.origin;return a.endsWith("/")?a:`${a}/`};static#l=this.stringToURL=a=>{try{return new URL(a)}catch{const u=a.startsWith("/")?a.substring(1,a.length):a;return new URL(`${i.getBaseUrl()}${u}`)}}}return i})();var Ql=O(1413);const us={now:()=>(us.delegate||Date).now(),delegate:void 0};class Pr extends Ql.B{constructor(s=1/0,a=1/0,u=us){super(),this._bufferSize=s,this._windowTime=a,this._timestampProvider=u,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=a===1/0,this._bufferSize=Math.max(1,s),this._windowTime=Math.max(1,a)}next(s){const{isStopped:a,_buffer:u,_infiniteTimeWindow:m,_timestampProvider:E,_windowTime:T}=this;a||(u.push(s),!m&&u.push(E.now()+T)),this._trimBuffer(),super.next(s)}_subscribe(s){this._throwIfClosed(),this._trimBuffer();const a=this._innerSubscribe(s),{_infiniteTimeWindow:u,_buffer:m}=this,E=m.slice();for(let T=0;T{let m,E=!0;a.subscribe((0,Mi._)(u,T=>{const x=s(T);(E||!i(m,x))&&(E=!1,m=x,u.next(T))}))})}function Ks(i,s){return i===s}const nr=function(){var i=(0,N.A)(function*(s,a){const u=new a;return yield u.init(s),u});return function(a,u){return i.apply(this,arguments)}}(),ut=function Xe(i,s){return i===s||i!=i&&s!=s},_n=function ur(i,s){for(var a=i.length;a--;)if(ut(i[a][0],s))return a;return-1};var Ti=Array.prototype.splice;function ni(i){var s=-1,a=null==i?0:i.length;for(this.clear();++s-1},ni.prototype.set=function Qs(i,s){var a=this.__data__,u=_n(a,i);return u<0?(++this.size,a.push([i,s])):a[u][1]=s,this};const Kr=ni,Oi="object"==typeof global&&global&&global.Object===Object&&global;var fn="object"==typeof self&&self&&self.Object===Object&&self;const je=Oi||fn||Function("return this")();var xi=je.Symbol,ri=Object.prototype,Xr=ri.hasOwnProperty,gs=ri.toString,po=xi?xi.toStringTag:void 0;var ki=Object.prototype.toString;var Er=xi?xi.toStringTag:void 0;const mo=function ta(i){return null==i?void 0===i?"[object Undefined]":"[object Null]":Er&&Er in Object(i)?function Zs(i){var s=Xr.call(i,po),a=i[po];try{i[po]=void 0;var u=!0}catch{}var m=gs.call(i);return u&&(s?i[po]=a:delete i[po]),m}(i):function Ys(i){return ki.call(i)}(i)},Qr=function dr(i){var s=typeof i;return null!=i&&("object"==s||"function"==s)},$n=function vs(i){if(!Qr(i))return!1;var s=mo(i);return"[object Function]"==s||"[object GeneratorFunction]"==s||"[object AsyncFunction]"==s||"[object Proxy]"==s};var i,oa=je["__core-js_shared__"],Sr=(i=/[^.]+$/.exec(oa&&oa.keys&&oa.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";var _s=Function.prototype.toString;var Lr=/^\[object .+?Constructor\]$/,Li=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Cs=function ia(i){return!(!Qr(i)||function Et(i){return!!Sr&&Sr in i}(i))&&($n(i)?Li:Lr).test(function ws(i){if(null!=i){try{return _s.call(i)}catch{}try{return i+""}catch{}}return""}(i))},Zr=function tc(i,s){var a=function Vi(i,s){return i?.[s]}(i,s);return Cs(a)?a:void 0},aa=Zr(je,"Map"),Mr=Zr(Object,"create");var ic=Object.prototype.hasOwnProperty;var ca=Object.prototype.hasOwnProperty;function Gt(i){var s=-1,a=null==i?0:i.length;for(this.clear();++s-1&&i%1==0&&i<=9007199254740991},eo=function Cu(i){return null!=i&&As(i.length)&&!$n(i)};var zn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Vr=zn&&"object"==typeof module&&module&&!module.nodeType&&module,zi=Vr&&Vr.exports===zn?je.Buffer:void 0;const Dn=(zi?zi.isBuffer:void 0)||function it(){return!1};var ma=Function.prototype.toString,Ar=Object.prototype.hasOwnProperty,fc=ma.call(Object);var b={};b["[object Float32Array]"]=b["[object Float64Array]"]=b["[object Int8Array]"]=b["[object Int16Array]"]=b["[object Int32Array]"]=b["[object Uint8Array]"]=b["[object Uint8ClampedArray]"]=b["[object Uint16Array]"]=b["[object Uint32Array]"]=!0,b["[object Arguments]"]=b["[object Array]"]=b["[object ArrayBuffer]"]=b["[object Boolean]"]=b["[object DataView]"]=b["[object Date]"]=b["[object Error]"]=b["[object Function]"]=b["[object Map]"]=b["[object Number]"]=b["[object Object]"]=b["[object RegExp]"]=b["[object Set]"]=b["[object String]"]=b["[object WeakMap]"]=!1;var Ee="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ge=Ee&&"object"==typeof module&&module&&!module.nodeType&&module,on=Ge&&Ge.exports===Ee&&Oi.process,ir=function(){try{return Ge&&Ge.require&&Ge.require("util").types||on&&on.binding&&on.binding("util")}catch{}}(),hi=ir&&ir.isTypedArray;const Bo=hi?function q(i){return function(s){return i(s)}}(hi):function A(i){return Yt(i)&&As(i.length)&&!!b[mo(i)]},jt=function dy(i,s){if(("constructor"!==s||"function"!=typeof i[s])&&"__proto__"!=s)return i[s]};var cl=Object.prototype.hasOwnProperty;const zp=function hr(i,s,a){var u=i[s];(!cl.call(i,s)||!ut(u,a)||void 0===a&&!(s in i))&&Gn(i,s,a)};var Kp=/^(?:0|[1-9]\d*)$/;const Ru=function Ho(i,s){var a=typeof i;return!!(s=s??9007199254740991)&&("number"==a||"symbol"!=a&&Kp.test(i))&&i>-1&&i%1==0&&i0){if(++s>=800)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}(fl);const pi=pr,Co=function If(i,s){return pi(function bf(i,s,a){return s=yt(void 0===s?i.length-1:s,0),function(){for(var u=arguments,m=-1,E=yt(u.length-s,0),T=Array(E);++m1?a[m-1]:void 0,T=m>2?a[2]:void 0;for(E=i.length>3&&"function"==typeof E?(m--,E):void 0,T&&function gi(i,s,a){if(!Qr(a))return!1;var u=typeof s;return!!("number"==u?eo(a)&&Ru(s,a.length):"string"==u&&s in a)&&ut(a[s],i)}(a[0],a[1],T)&&(E=m<3?void 0:E,m=1),s=Object(s);++u{},info:()=>{},warn:()=>{},error:()=>{}},qn=(i=>(i[i.NONE=0]="NONE",i[i.ERROR=1]="ERROR",i[i.WARN=2]="WARN",i[i.INFO=3]="INFO",i[i.DEBUG=4]="DEBUG",i))(qn||{});(i=>{i.reset=function s(){to=3,bo=Tf},i.setLevel=function a(m){if(!(0<=m&&m<=4))throw new Error("Invalid log level");to=m},i.setLogger=function u(m){bo=m}})(qn||(qn={}));var st=class{constructor(i){this._name=i}debug(...i){to>=4&&bo.debug(st._format(this._name,this._method),...i)}info(...i){to>=3&&bo.info(st._format(this._name,this._method),...i)}warn(...i){to>=2&&bo.warn(st._format(this._name,this._method),...i)}error(...i){to>=1&&bo.error(st._format(this._name,this._method),...i)}throw(i){throw this.error(i),i}create(i){const s=Object.create(this);return s._method=i,s.debug("begin"),s}static createStatic(i,s){const a=new st(`${i}.${s}`);return a.debug("begin"),a}static _format(i,s){const a=`[${i}]`;return s?`${a} ${s}:`:a}static debug(i,...s){to>=4&&bo.debug(st._format(i),...s)}static info(i,...s){to>=3&&bo.info(st._format(i),...s)}static warn(i,...s){to>=2&&bo.warn(st._format(i),...s)}static error(i,...s){to>=1&&bo.error(st._format(i),...s)}};qn.reset();var no=class{static _randomWord(){return Lu.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,s=>(+s^no._randomWord()&15>>+s/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return no.generateUUIDv4()+no.generateUUIDv4()+no.generateUUIDv4()}static generateCodeChallenge(i){try{const s=Vu(i);return hl.stringify(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(s){throw st.error("CryptoUtils.generateCodeChallenge",s),s}}static generateBasicAuth(i,s){const a=ig.parse([i,s].join(":"));return hl.stringify(a)}},qi=class{constructor(i){this._name=i,this._logger=new st(`Event('${this._name}')`),this._callbacks=[]}addHandler(i){return this._callbacks.push(i),()=>this.removeHandler(i)}removeHandler(i){const s=this._callbacks.lastIndexOf(i);s>=0&&this._callbacks.splice(s,1)}raise(...i){this._logger.debug("raise:",...i);for(const s of this._callbacks)s(...i)}},Ln=class{static decode(i){try{return cs(i)}catch(s){throw st.error("JwtUtils.decode",s),s}}},Ki=class{static center({...i}){var s;return null==i.width&&(i.width=null!=(s=[800,720,600,480].find(m=>m<=window.outerWidth/1.618))?s:360),null!=i.left||(i.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-i.width)/2))),null!=i.height&&(null!=i.top||(i.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-i.height)/2)))),i}static serialize(i){return Object.entries(i).filter(([,s])=>null!=s).map(([s,a])=>`${s}=${"boolean"!=typeof a?a:a?"yes":"no"}`).join(",")}},wt=class extends qi{constructor(){super(...arguments),this._logger=new st(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const i=this._expiration-wt.getEpochTime();this._logger.debug("timer completes in",i),this._expiration<=wt.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(i){const s=this._logger.create("init");i=Math.max(Math.floor(i),1);const a=wt.getEpochTime()+i;if(this.expiration===a&&this._timerHandle)return void s.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),s.debug("using duration",i),this._expiration=a;const u=Math.min(i,5);this._timerHandle=setInterval(this._callback,1e3*u)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},Uu=class{static readParams(i,s="query"){if(!i)throw new TypeError("Invalid URL");const u=new URL(i,"http://127.0.0.1")["fragment"===s?"hash":"search"];return new URLSearchParams(u.slice(1))}},Ns=class extends Error{constructor(i,s){var a,u,m;if(super(i.error_description||i.error||""),this.form=s,this.name="ErrorResponse",!i.error)throw st.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=i.error,this.error_description=null!=(a=i.error_description)?a:null,this.error_uri=null!=(u=i.error_uri)?u:null,this.state=i.userState,this.session_state=null!=(m=i.session_state)?m:null,this.url_state=i.url_state}},Bu=class extends Error{constructor(i){super(i),this.name="ErrorTimeout"}},Rf=class{constructor(i){this._logger=new st("AccessTokenEvents"),this._expiringTimer=new wt("Access token expiring"),this._expiredTimer=new wt("Access token expired"),this._expiringNotificationTimeInSeconds=i.expiringNotificationTimeInSeconds}load(i){const s=this._logger.create("load");if(i.access_token&&void 0!==i.expires_in){const a=i.expires_in;if(s.debug("access token present, remaining duration:",a),a>0){let m=a-this._expiringNotificationTimeInSeconds;m<=0&&(m=1),s.debug("registering expiring timer, raising in",m,"seconds"),this._expiringTimer.init(m)}else s.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const u=a+1;s.debug("registering expired timer, raising in",u,"seconds"),this._expiredTimer.init(u)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(i){return this._expiringTimer.addHandler(i)}removeAccessTokenExpiring(i){this._expiringTimer.removeHandler(i)}addAccessTokenExpired(i){return this._expiredTimer.addHandler(i)}removeAccessTokenExpired(i){this._expiredTimer.removeHandler(i)}},Nf=class{constructor(i,s,a,u,m){this._callback=i,this._client_id=s,this._intervalInSeconds=u,this._stopOnError=m,this._logger=new st("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=T=>{T.origin===this._frame_origin&&T.source===this._frame.contentWindow&&("error"===T.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===T.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(T.data+" message from check session op iframe"))};const E=new URL(a);this._frame_origin=E.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=E.href}load(){return new Promise(i=>{this._frame.onload=()=>{i()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(i){if(this._session_state===i)return;this._logger.create("start"),this.stop(),this._session_state=i;const s=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};s(),this._timer=setInterval(s,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},Os=class{constructor(){this._logger=new st("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(i){return this._logger.create(`getItem('${i}')`),this._data[i]}setItem(i,s){this._logger.create(`setItem('${i}')`),this._data[i]=s}removeItem(i){this._logger.create(`removeItem('${i}')`),delete this._data[i]}get length(){return Object.getOwnPropertyNames(this._data).length}key(i){return Object.getOwnPropertyNames(this._data)[i]}},ro=class{constructor(i=[],s=null,a={}){this._jwtHandler=s,this._extraHeaders=a,this._logger=new st("JsonService"),this._contentTypes=[],this._contentTypes.push(...i,"application/json"),s&&this._contentTypes.push("application/jwt")}fetchWithTimeout(i,s={}){return(0,N.A)(function*(){const{timeoutInSeconds:a,...u}=s;if(!a)return yield fetch(i,u);const m=new AbortController,E=setTimeout(()=>m.abort(),1e3*a);try{return yield fetch(i,{...s,signal:m.signal})}catch(T){throw T instanceof DOMException&&"AbortError"===T.name?new Bu("Network timed out"):T}finally{clearTimeout(E)}})()}getJson(i,{token:s,credentials:a}={}){var u=this;return(0,N.A)(function*(){const m=u._logger.create("getJson"),E={Accept:u._contentTypes.join(", ")};let T;s&&(m.debug("token passed, setting Authorization header"),E.Authorization="Bearer "+s),u.appendExtraHeaders(E);try{m.debug("url:",i),T=yield u.fetchWithTimeout(i,{method:"GET",headers:E,credentials:a})}catch(z){throw m.error("Network Error"),z}m.debug("HTTP response received, status",T.status);const x=T.headers.get("Content-Type");if(x&&!u._contentTypes.find(z=>x.startsWith(z))&&m.throw(new Error(`Invalid response Content-Type: ${x??"undefined"}, from URL: ${i}`)),T.ok&&u._jwtHandler&&x?.startsWith("application/jwt"))return yield u._jwtHandler(yield T.text());let V;try{V=yield T.json()}catch(z){throw m.error("Error parsing JSON response",z),T.ok?z:new Error(`${T.statusText} (${T.status})`)}if(!T.ok)throw m.error("Error from server:",V),V.error?new Ns(V):new Error(`${T.statusText} (${T.status}): ${JSON.stringify(V)}`);return V})()}postForm(i,{body:s,basicAuth:a,timeoutInSeconds:u,initCredentials:m}){var E=this;return(0,N.A)(function*(){const T=E._logger.create("postForm"),x={Accept:E._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let V;void 0!==a&&(x.Authorization="Basic "+a),E.appendExtraHeaders(x);try{T.debug("url:",i),V=yield E.fetchWithTimeout(i,{method:"POST",headers:x,body:s,timeoutInSeconds:u,credentials:m})}catch(Oe){throw T.error("Network error"),Oe}T.debug("HTTP response received, status",V.status);const z=V.headers.get("Content-Type");if(z&&!E._contentTypes.find(Oe=>z.startsWith(Oe)))throw new Error(`Invalid response Content-Type: ${z??"undefined"}, from URL: ${i}`);const fe=yield V.text();let ve={};if(fe)try{ve=JSON.parse(fe)}catch(Oe){throw T.error("Error parsing JSON response",Oe),V.ok?Oe:new Error(`${V.statusText} (${V.status})`)}if(!V.ok)throw T.error("Error from server:",ve),ve.error?new Ns(ve,s):new Error(`${V.statusText} (${V.status}): ${JSON.stringify(ve)}`);return ve})()}appendExtraHeaders(i){const s=this._logger.create("appendExtraHeaders"),a=Object.keys(this._extraHeaders),u=["authorization","accept","content-type"];0!==a.length&&a.forEach(m=>{if(u.includes(m.toLocaleLowerCase()))return void s.warn("Protected header could not be overridden",m,u);const E="function"==typeof this._extraHeaders[m]?this._extraHeaders[m]():this._extraHeaders[m];E&&""!==E&&(i[m]=E)})}},sg=class{constructor(i){this._settings=i,this._logger=new st("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new ro(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}getMetadata(){var i=this;return(0,N.A)(function*(){const s=i._logger.create("getMetadata");if(i._metadata)return s.debug("using cached values"),i._metadata;if(!i._metadataUrl)throw s.throw(new Error("No authority or metadataUrl configured on settings")),null;s.debug("getting metadata from",i._metadataUrl);const a=yield i._jsonService.getJson(i._metadataUrl,{credentials:i._fetchRequestCredentials});return s.debug("merging remote JSON with seed metadata"),i._metadata=Object.assign({},i._settings.metadataSeed,a),i._metadata})()}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(i=!0){return this._getMetadataProperty("token_endpoint",i)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(i=!0){return this._getMetadataProperty("revocation_endpoint",i)}getKeysEndpoint(i=!0){return this._getMetadataProperty("jwks_uri",i)}_getMetadataProperty(i,s=!1){var a=this;return(0,N.A)(function*(){const u=a._logger.create(`_getMetadataProperty('${i}')`),m=yield a.getMetadata();if(u.debug("resolved"),void 0===m[i]){if(!0===s)return void u.warn("Metadata does not contain optional property");u.throw(new Error("Metadata does not contain property "+i))}return m[i]})()}getSigningKeys(){var i=this;return(0,N.A)(function*(){const s=i._logger.create("getSigningKeys");if(i._signingKeys)return s.debug("returning signingKeys from cache"),i._signingKeys;const a=yield i.getKeysEndpoint(!1);s.debug("got jwks_uri",a);const u=yield i._jsonService.getJson(a);if(s.debug("got key set",u),!Array.isArray(u.keys))throw s.throw(new Error("Missing keys on keyset")),null;return i._signingKeys=u.keys,i._signingKeys})()}},wa=class{constructor({prefix:i="oidc.",store:s=localStorage}={}){this._logger=new st("WebStorageStateStore"),this._store=s,this._prefix=i}set(i,s){var a=this;return(0,N.A)(function*(){a._logger.create(`set('${i}')`),i=a._prefix+i,yield a._store.setItem(i,s)})()}get(i){var s=this;return(0,N.A)(function*(){return s._logger.create(`get('${i}')`),i=s._prefix+i,yield s._store.getItem(i)})()}remove(i){var s=this;return(0,N.A)(function*(){s._logger.create(`remove('${i}')`),i=s._prefix+i;const a=yield s._store.getItem(i);return yield s._store.removeItem(i),a})()}getAllKeys(){var i=this;return(0,N.A)(function*(){i._logger.create("getAllKeys");const s=yield i._store.length,a=[];for(let u=0;ux.append(ve,_t)):null!=Oe&&x.set(ve,Oe);let V;switch(E._settings.client_authentication){case"client_secret_basic":if(!a)throw T.throw(new Error("A client_secret is required")),null;V=no.generateBasicAuth(s,a);break;case"client_secret_post":x.append("client_id",s),a&&x.append("client_secret",a)}const z=yield E._metadataService.getTokenEndpoint(!1);T.debug("got token endpoint");const fe=yield E._jsonService.postForm(z,{body:x,basicAuth:V,timeoutInSeconds:u,initCredentials:E._settings.fetchRequestCredentials});return T.debug("got response"),fe})()}revoke(i){var s=this;return(0,N.A)(function*(){var a;const u=s._logger.create("revoke");i.token||u.throw(new Error("A token is required"));const m=yield s._metadataService.getRevocationEndpoint(!1);u.debug(`got revocation endpoint, revoking ${null!=(a=i.token_type_hint)?a:"default token type"}`);const E=new URLSearchParams;for(const[T,x]of Object.entries(i))null!=x&&E.set(T,x);E.set("client_id",s._settings.client_id),s._settings.client_secret&&E.set("client_secret",s._settings.client_secret),yield s._jsonService.postForm(m,{body:E}),u.debug("got response")})()}},$u=class{constructor(i,s,a){this._settings=i,this._metadataService=s,this._claimsService=a,this._logger=new st("ResponseValidator"),this._userInfoService=new pl(this._settings,this._metadataService),this._tokenClient=new Pf(this._settings,this._metadataService)}validateSigninResponse(i,s){var a=this;return(0,N.A)(function*(){const u=a._logger.create("validateSigninResponse");a._processSigninState(i,s),u.debug("state processed"),yield a._processCode(i,s),u.debug("code processed"),i.isOpenId&&a._validateIdTokenAttributes(i),u.debug("tokens validated"),yield a._processClaims(i,s?.skipUserInfo,i.isOpenId),u.debug("claims processed")})()}validateCredentialsResponse(i,s){var a=this;return(0,N.A)(function*(){const u=a._logger.create("validateCredentialsResponse");i.isOpenId&&i.id_token&&a._validateIdTokenAttributes(i),u.debug("tokens validated"),yield a._processClaims(i,s,i.isOpenId),u.debug("claims processed")})()}validateRefreshResponse(i,s){var a=this;return(0,N.A)(function*(){const E=a._logger.create("validateRefreshResponse");i.userState=s.data,null!=i.session_state||(i.session_state=s.session_state),null!=i.scope||(i.scope=s.scope),i.isOpenId&&i.id_token&&(a._validateIdTokenAttributes(i,s.id_token),E.debug("ID Token validated")),i.id_token||(i.id_token=s.id_token,i.profile=s.profile);const T=i.isOpenId&&!!i.id_token;yield a._processClaims(i,!1,T),E.debug("claims processed")})()}validateSignoutResponse(i,s){const a=this._logger.create("validateSignoutResponse");if(s.id!==i.state&&a.throw(new Error("State does not match")),a.debug("state validated"),i.userState=s.data,i.error)throw a.warn("Response was error",i.error),new Ns(i)}_processSigninState(i,s){const u=this._logger.create("_processSigninState");if(s.id!==i.state&&u.throw(new Error("State does not match")),s.client_id||u.throw(new Error("No client_id on state")),s.authority||u.throw(new Error("No authority on state")),this._settings.authority!==s.authority&&u.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==s.client_id&&u.throw(new Error("client_id mismatch on settings vs. signin state")),u.debug("state validated"),i.userState=s.data,i.url_state=s.url_state,null!=i.scope||(i.scope=s.scope),i.error)throw u.warn("Response was error",i.error),new Ns(i);s.code_verifier&&!i.code&&u.throw(new Error("Expected code in response"))}_processClaims(i,s=!1,a=!0){var u=this;return(0,N.A)(function*(){const m=u._logger.create("_processClaims");if(i.profile=u._claimsService.filterProtocolClaims(i.profile),s||!u._settings.loadUserInfo||!i.access_token)return void m.debug("not loading user info");m.debug("loading user info");const E=yield u._userInfoService.getClaims(i.access_token);m.debug("user info claims received from user info endpoint"),a&&E.sub!==i.profile.sub&&m.throw(new Error("subject from UserInfo response does not match subject in ID Token")),i.profile=u._claimsService.mergeClaims(i.profile,u._claimsService.filterProtocolClaims(E)),m.debug("user info claims received, updated profile:",i.profile)})()}_processCode(i,s){var a=this;return(0,N.A)(function*(){const u=a._logger.create("_processCode");if(i.code){u.debug("Validating code");const m=yield a._tokenClient.exchangeCode({client_id:s.client_id,client_secret:s.client_secret,code:i.code,redirect_uri:s.redirect_uri,code_verifier:s.code_verifier,...s.extraTokenParams});Object.assign(i,m)}else u.debug("No code to process")})()}_validateIdTokenAttributes(i,s){var a;const u=this._logger.create("_validateIdTokenAttributes");u.debug("decoding ID Token JWT");const m=Ln.decode(null!=(a=i.id_token)?a:"");if(m.sub||u.throw(new Error("ID Token is missing a subject claim")),s){const E=Ln.decode(s);m.sub!==E.sub&&u.throw(new Error("sub in id_token does not match current sub")),m.auth_time&&m.auth_time!==E.auth_time&&u.throw(new Error("auth_time in id_token does not match original auth_time")),m.azp&&m.azp!==E.azp&&u.throw(new Error("azp in id_token does not match original azp")),!m.azp&&E.azp&&u.throw(new Error("azp not in id_token, but present in original id_token"))}i.profile=m}},Da=class{constructor(i){this.id=i.id||no.generateUUIDv4(),this.data=i.data,this.created=i.created&&i.created>0?i.created:wt.getEpochTime(),this.request_type=i.request_type,this.url_state=i.url_state}toStorageString(){return new st("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(i){return st.createStatic("State","fromStorageString"),new Da(JSON.parse(i))}static clearStaleState(i,s){return(0,N.A)(function*(){const a=st.createStatic("State","clearStaleState"),u=wt.getEpochTime()-s,m=yield i.getAllKeys();a.debug("got keys",m);for(let E=0;EXt.searchParams.append("resource",sn));for(const[un,sn]of Object.entries({response_mode:x,...$t,...Dt}))null!=sn&&Xt.searchParams.append(un,sn.toString());this.url=Xt.href}},kf=class{constructor(i){if(this.access_token="",this.token_type="",this.profile={},this.state=i.get("state"),this.session_state=i.get("session_state"),this.state){const s=decodeURIComponent(this.state).split(";");this.state=s[0],s.length>1&&(this.url_state=s.slice(1).join(";"))}this.error=i.get("error"),this.error_description=i.get("error_description"),this.error_uri=i.get("error_uri"),this.code=i.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-wt.getEpochTime()}set expires_in(i){"string"==typeof i&&(i=Number(i)),void 0!==i&&i>=0&&(this.expires_at=Math.floor(i)+wt.getEpochTime())}get isOpenId(){var i;return(null==(i=this.scope)?void 0:i.split(" ").includes("openid"))||!!this.id_token}},Gu=class{constructor({url:i,state_data:s,id_token_hint:a,post_logout_redirect_uri:u,extraQueryParams:m,request_type:E,client_id:T}){if(this._logger=new st("SignoutRequest"),!i)throw this._logger.error("ctor: No url passed"),new Error("url");const x=new URL(i);a&&x.searchParams.append("id_token_hint",a),T&&x.searchParams.append("client_id",T),u&&(x.searchParams.append("post_logout_redirect_uri",u),s&&(this.state=new Da({data:s,request_type:E}),x.searchParams.append("state",this.state.id)));for(const[V,z]of Object.entries({...m}))null!=z&&x.searchParams.append(V,z.toString());this.url=x.href}},gl=class{constructor(i){this.state=i.get("state"),this.error=i.get("error"),this.error_description=i.get("error_description"),this.error_uri=i.get("error_uri")}},cg=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],ml=["sub","iss","aud","exp","iat"],zu=class{constructor(i){this._settings=i,this._logger=new st("ClaimsService")}filterProtocolClaims(i){const s={...i};if(this._settings.filterProtocolClaims){let a;a=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:cg;for(const u of a)ml.includes(u)||delete s[u]}return s}mergeClaims(i,s){const a={...i};for(const[u,m]of Object.entries(s))for(const E of Array.isArray(m)?m:[m]){const T=a[u];void 0===T?a[u]=E:Array.isArray(T)?T.includes(E)||T.push(E):a[u]!==E&&(a[u]="object"==typeof E&&this._settings.mergeClaims?this.mergeClaims(T,E):[T,E])}return a}},yc=class{constructor(i,s){this._logger=new st("OidcClient"),this.settings=i instanceof Xi?i:new Xi(i),this.metadataService=s??new sg(this.settings),this._claimsService=new zu(this.settings),this._validator=new $u(this.settings,this.metadataService,this._claimsService),this._tokenClient=new Pf(this.settings,this.metadataService)}createSigninRequest({state:i,request:s,request_uri:a,request_type:u,id_token_hint:m,login_hint:E,skipUserInfo:T,nonce:x,url_state:V,response_type:z=this.settings.response_type,scope:fe=this.settings.scope,redirect_uri:ve=this.settings.redirect_uri,prompt:Oe=this.settings.prompt,display:_t=this.settings.display,max_age:Dt=this.settings.max_age,ui_locales:ht=this.settings.ui_locales,acr_values:Ct=this.settings.acr_values,resource:$t=this.settings.resource,response_mode:Xt=this.settings.response_mode,extraQueryParams:Ot=this.settings.extraQueryParams,extraTokenParams:un=this.settings.extraTokenParams}){var sn=this;return(0,N.A)(function*(){const Qn=sn._logger.create("createSigninRequest");if("code"!==z)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const Mt=yield sn.metadataService.getAuthorizationEndpoint();Qn.debug("Received authorization endpoint",Mt);const Wt=new lg({url:Mt,authority:sn.settings.authority,client_id:sn.settings.client_id,redirect_uri:ve,response_type:z,scope:fe,state_data:i,url_state:V,prompt:Oe,display:_t,max_age:Dt,ui_locales:ht,id_token_hint:m,login_hint:E,acr_values:Ct,resource:$t,request:s,request_uri:a,extraQueryParams:Ot,extraTokenParams:un,request_type:u,response_mode:Xt,client_secret:sn.settings.client_secret,skipUserInfo:T,nonce:x,disablePKCE:sn.settings.disablePKCE});yield sn.clearStaleState();const ao=Wt.state;return yield sn.settings.stateStore.set(ao.id,ao.toStorageString()),Wt})()}readSigninResponseState(i,s=!1){var a=this;return(0,N.A)(function*(){const u=a._logger.create("readSigninResponseState"),m=new kf(Uu.readParams(i,a.settings.response_mode));if(!m.state)throw u.throw(new Error("No state in response")),null;const E=yield a.settings.stateStore[s?"remove":"get"](m.state);if(!E)throw u.throw(new Error("No matching state found in storage")),null;return{state:Wu.fromStorageString(E),response:m}})()}processSigninResponse(i){var s=this;return(0,N.A)(function*(){const a=s._logger.create("processSigninResponse"),{state:u,response:m}=yield s.readSigninResponseState(i,!0);return a.debug("received state from storage; validating response"),yield s._validator.validateSigninResponse(m,u),m})()}processResourceOwnerPasswordCredentials({username:i,password:s,skipUserInfo:a=!1,extraTokenParams:u={}}){var m=this;return(0,N.A)(function*(){const E=yield m._tokenClient.exchangeCredentials({username:i,password:s,...u}),T=new kf(new URLSearchParams);return Object.assign(T,E),yield m._validator.validateCredentialsResponse(T,a),T})()}useRefreshToken({state:i,timeoutInSeconds:s}){var a=this;return(0,N.A)(function*(){var u;const m=a._logger.create("useRefreshToken");let E;if(void 0===a.settings.refreshTokenAllowedScope)E=i.scope;else{const V=a.settings.refreshTokenAllowedScope.split(" ");E=((null==(u=i.scope)?void 0:u.split(" "))||[]).filter(fe=>V.includes(fe)).join(" ")}const T=yield a._tokenClient.exchangeRefreshToken({refresh_token:i.refresh_token,resource:i.resource,scope:E,timeoutInSeconds:s}),x=new kf(new URLSearchParams);return Object.assign(x,T),m.debug("validating response",x),yield a._validator.validateRefreshResponse(x,{...i,scope:E}),x})()}createSignoutRequest({state:i,id_token_hint:s,client_id:a,request_type:u,post_logout_redirect_uri:m=this.settings.post_logout_redirect_uri,extraQueryParams:E=this.settings.extraQueryParams}={}){var T=this;return(0,N.A)(function*(){const x=T._logger.create("createSignoutRequest"),V=yield T.metadataService.getEndSessionEndpoint();if(!V)throw x.throw(new Error("No end session endpoint")),null;x.debug("Received end session endpoint",V),!a&&m&&!s&&(a=T.settings.client_id);const z=new Gu({url:V,id_token_hint:s,client_id:a,post_logout_redirect_uri:m,state_data:i,extraQueryParams:E,request_type:u});yield T.clearStaleState();const fe=z.state;return fe&&(x.debug("Signout request has state to persist"),yield T.settings.stateStore.set(fe.id,fe.toStorageString())),z})()}readSignoutResponseState(i,s=!1){var a=this;return(0,N.A)(function*(){const u=a._logger.create("readSignoutResponseState"),m=new gl(Uu.readParams(i,a.settings.response_mode));if(!m.state){if(u.debug("No state in response"),m.error)throw u.warn("Response was error:",m.error),new Ns(m);return{state:void 0,response:m}}const E=yield a.settings.stateStore[s?"remove":"get"](m.state);if(!E)throw u.throw(new Error("No matching state found in storage")),null;return{state:Da.fromStorageString(E),response:m}})()}processSignoutResponse(i){var s=this;return(0,N.A)(function*(){const a=s._logger.create("processSignoutResponse"),{state:u,response:m}=yield s.readSignoutResponseState(i,!0);return u?(a.debug("Received state from storage; validating response"),s._validator.validateSignoutResponse(m,u)):a.debug("No state from storage; skipping response validation"),m})()}clearStaleState(){return this._logger.create("clearStaleState"),Da.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}revokeToken(i,s){var a=this;return(0,N.A)(function*(){return a._logger.create("revokeToken"),yield a._tokenClient.revoke({token:i,token_type_hint:s})})()}},my=class{constructor(i){var s=this;this._userManager=i,this._logger=new st("SessionMonitor"),this._start=function(){var a=(0,N.A)(function*(u){const m=u.session_state;if(!m)return;const E=s._logger.create("_start");if(u.profile?(s._sub=u.profile.sub,s._sid=u.profile.sid,E.debug("session_state",m,", sub",s._sub)):(s._sub=void 0,s._sid=void 0,E.debug("session_state",m,", anonymous user")),s._checkSessionIFrame)s._checkSessionIFrame.start(m);else try{const T=yield s._userManager.metadataService.getCheckSessionIframe();if(T){E.debug("initializing check session iframe");const fe=new Nf(s._callback,s._userManager.settings.client_id,T,s._userManager.settings.checkSessionIntervalInSeconds,s._userManager.settings.stopCheckSessionOnError);yield fe.load(),s._checkSessionIFrame=fe,fe.start(m)}else E.warn("no check session iframe found in the metadata")}catch(T){E.error("Error from getCheckSessionIframe:",T instanceof Error?T.message:T)}});return function(u){return a.apply(this,arguments)}}(),this._stop=()=>{const a=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const u=setInterval((0,N.A)(function*(){clearInterval(u);try{const m=yield s._userManager.querySessionStatus();m&&s._start({session_state:m.session_state,profile:m.sub&&m.sid?{sub:m.sub,sid:m.sid}:null})}catch(m){a.error("error from querySessionStatus",m instanceof Error?m.message:m)}}),1e3)}},this._callback=(0,N.A)(function*(){const a=s._logger.create("_callback");try{const u=yield s._userManager.querySessionStatus();let m=!0;u&&s._checkSessionIFrame?u.sub===s._sub?(m=!1,s._checkSessionIFrame.start(u.session_state),u.sid===s._sid?a.debug("same sub still logged in at OP, restarting check session iframe; session_state",u.session_state):(a.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",u.session_state),s._userManager.events._raiseUserSessionChanged())):a.debug("different subject signed into OP",u.sub):a.debug("subject no longer signed into OP"),m?s._sub?s._userManager.events._raiseUserSignedOut():s._userManager.events._raiseUserSignedIn():a.debug("no change in session detected, no event to raise")}catch(u){s._sub&&(a.debug("Error calling queryCurrentSigninSession; raising signed out event",u),s._userManager.events._raiseUserSignedOut())}}),i||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(a=>{this._logger.error(a)})}_init(){var i=this;return(0,N.A)(function*(){i._logger.create("_init");const s=yield i._userManager.getUser();if(s)i._start(s);else if(i._userManager.settings.monitorAnonymousSession){const a=yield i._userManager.querySessionStatus();a&&i._start({session_state:a.session_state,profile:a.sub&&a.sid?{sub:a.sub,sid:a.sid}:null})}})()}},vl=class{constructor(i){var s;this.id_token=i.id_token,this.session_state=null!=(s=i.session_state)?s:null,this.access_token=i.access_token,this.refresh_token=i.refresh_token,this.token_type=i.token_type,this.scope=i.scope,this.profile=i.profile,this.expires_at=i.expires_at,this.state=i.userState,this.url_state=i.url_state}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-wt.getEpochTime()}set expires_in(i){void 0!==i&&(this.expires_at=Math.floor(i)+wt.getEpochTime())}get expired(){const i=this.expires_in;if(void 0!==i)return i<=0}get scopes(){var i,s;return null!=(s=null==(i=this.scope)?void 0:i.split(" "))?s:[]}toStorageString(){return new st("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(i){return st.createStatic("User","fromStorageString"),new vl(JSON.parse(i))}},qu="oidc-client",Ff=class{constructor(){this._abort=new qi("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}navigate(i){var s=this;return(0,N.A)(function*(){const a=s._logger.create("navigate");if(!s._window)throw new Error("Attempted to navigate on a disposed window");a.debug("setting URL in window"),s._window.location.replace(i.url);const{url:u,keepOpen:m}=yield new Promise((E,T)=>{const x=V=>{var z;const fe=V.data,ve=null!=(z=i.scriptOrigin)?z:window.location.origin;if(V.origin===ve&&fe?.source===qu){try{const Oe=Uu.readParams(fe.url,i.response_mode).get("state");if(Oe||a.warn("no state found in response url"),V.source!==s._window&&Oe!==i.state)return}catch{s._dispose(),T(new Error("Invalid response from window"))}E(fe)}};window.addEventListener("message",x,!1),s._disposeHandlers.add(()=>window.removeEventListener("message",x,!1)),s._disposeHandlers.add(s._abort.addHandler(V=>{s._dispose(),T(V)}))});return a.debug("got response from window"),s._dispose(),m||s.close(),{url:u}})()}_dispose(){this._logger.create("_dispose");for(const i of this._disposeHandlers)i();this._disposeHandlers.clear()}static _notifyParent(i,s,a=!1,u=window.location.origin){i.postMessage({source:qu,url:s,keepOpen:a},u)}},Eo={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Lf="_blank",_c=60,Ku=2,Xu=10,wc=class extends Xi{constructor(i){const{popup_redirect_uri:s=i.redirect_uri,popup_post_logout_redirect_uri:a=i.post_logout_redirect_uri,popupWindowFeatures:u=Eo,popupWindowTarget:m=Lf,redirectMethod:E="assign",redirectTarget:T="self",iframeNotifyParentOrigin:x=i.iframeNotifyParentOrigin,iframeScriptOrigin:V=i.iframeScriptOrigin,silent_redirect_uri:z=i.redirect_uri,silentRequestTimeoutInSeconds:fe=Xu,automaticSilentRenew:ve=!0,validateSubOnSilentRenew:Oe=!0,includeIdTokenInSilentRenew:_t=!1,monitorSession:Dt=!1,monitorAnonymousSession:ht=!1,checkSessionIntervalInSeconds:Ct=Ku,query_status_response_type:$t="code",stopCheckSessionOnError:Xt=!0,revokeTokenTypes:Ot=["access_token","refresh_token"],revokeTokensOnSignout:un=!1,includeIdTokenInSilentSignout:sn=!1,accessTokenExpiringNotificationTimeInSeconds:Qn=_c,userStore:Mt}=i;if(super(i),this.popup_redirect_uri=s,this.popup_post_logout_redirect_uri=a,this.popupWindowFeatures=u,this.popupWindowTarget=m,this.redirectMethod=E,this.redirectTarget=T,this.iframeNotifyParentOrigin=x,this.iframeScriptOrigin=V,this.silent_redirect_uri=z,this.silentRequestTimeoutInSeconds=fe,this.automaticSilentRenew=ve,this.validateSubOnSilentRenew=Oe,this.includeIdTokenInSilentRenew=_t,this.monitorSession=Dt,this.monitorAnonymousSession=ht,this.checkSessionIntervalInSeconds=Ct,this.stopCheckSessionOnError=Xt,this.query_status_response_type=$t,this.revokeTokenTypes=Ot,this.revokeTokensOnSignout=un,this.includeIdTokenInSilentSignout=sn,this.accessTokenExpiringNotificationTimeInSeconds=Qn,Mt)this.userStore=Mt;else{const Wt=typeof window<"u"?window.sessionStorage:new Os;this.userStore=new wa({store:Wt})}}},yl=class extends Ff{constructor({silentRequestTimeoutInSeconds:i=Xu}){super(),this._logger=new st("IFrameWindow"),this._timeoutInSeconds=i,this._frame=yl.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const i=window.document.createElement("iframe");return i.style.visibility="hidden",i.style.position="fixed",i.style.left="-1000px",i.style.top="0",i.width="0",i.height="0",window.document.body.appendChild(i),i}navigate(i){var s=()=>super.navigate,a=this;return(0,N.A)(function*(){a._logger.debug("navigate: Using timeout of:",a._timeoutInSeconds);const u=setTimeout(()=>a._abort.raise(new Bu("IFrame timed out without a response")),1e3*a._timeoutInSeconds);return a._disposeHandlers.add(()=>clearTimeout(u)),yield s().call(a,i)})()}close(){var i;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",s=>{var a;const u=s.target;null==(a=u.parentNode)||a.removeChild(u),this._abort.raise(new Error("IFrame removed from DOM"))},!0),null==(i=this._frame.contentWindow)||i.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(i,s){return super._notifyParent(window.parent,i,!1,s)}},ug=class{constructor(i){this._settings=i,this._logger=new st("IFrameNavigator")}prepare({silentRequestTimeoutInSeconds:i=this._settings.silentRequestTimeoutInSeconds}){return(0,N.A)(function*(){return new yl({silentRequestTimeoutInSeconds:i})})()}callback(i){var s=this;return(0,N.A)(function*(){s._logger.create("callback"),yl.notifyParent(i,s._settings.iframeNotifyParentOrigin)})()}},Qu=class extends Ff{constructor({popupWindowTarget:i=Lf,popupWindowFeatures:s={}}){super(),this._logger=new st("PopupWindow");const a=Ki.center({...Eo,...s});this._window=window.open(void 0,i,Ki.serialize(a)),s.closePopupWindowAfterInSeconds&&s.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{this._window&&"boolean"==typeof this._window.closed&&!this._window.closed?this.close():this._abort.raise(new Error("Popup blocked by user"))},1e3*s.closePopupWindowAfterInSeconds)}navigate(i){var s=()=>super.navigate,a=this;return(0,N.A)(function*(){var u;null==(u=a._window)||u.focus();const m=setInterval(()=>{(!a._window||a._window.closed)&&a._abort.raise(new Error("Popup closed by user"))},500);return a._disposeHandlers.add(()=>clearInterval(m)),yield s().call(a,i)})()}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(i,s){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,i,s)}},jf=class{constructor(i){this._settings=i,this._logger=new st("PopupNavigator")}prepare({popupWindowFeatures:i=this._settings.popupWindowFeatures,popupWindowTarget:s=this._settings.popupWindowTarget}){return(0,N.A)(function*(){return new Qu({popupWindowFeatures:i,popupWindowTarget:s})})()}callback(i,{keepOpen:s=!1}){var a=this;return(0,N.A)(function*(){a._logger.create("callback"),Qu.notifyOpener(i,s)})()}},dg=class{constructor(i){this._settings=i,this._logger=new st("RedirectNavigator")}prepare({redirectMethod:i=this._settings.redirectMethod,redirectTarget:s=this._settings.redirectTarget}){var a=this;return(0,N.A)(function*(){var u;a._logger.create("prepare");let m=window.self;"top"===s&&(m=null!=(u=window.top)?u:window.self);const E=m.location[i].bind(m.location);let T;return{navigate:(x=(0,N.A)(function*(V){a._logger.create("navigate");const z=new Promise((fe,ve)=>{T=ve});return E(V.url),yield z}),function(z){return x.apply(this,arguments)}),close:()=>{a._logger.create("close"),T?.(new Error("Redirect aborted")),m.stop()}};var x})()}callback(){return(0,N.A)(function*(){})()}},Dc=class extends Rf{constructor(i){super({expiringNotificationTimeInSeconds:i.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new st("UserManagerEvents"),this._userLoaded=new qi("User loaded"),this._userUnloaded=new qi("User unloaded"),this._silentRenewError=new qi("Silent renew error"),this._userSignedIn=new qi("User signed in"),this._userSignedOut=new qi("User signed out"),this._userSessionChanged=new qi("User session changed")}load(i,s=!0){super.load(i),s&&this._userLoaded.raise(i)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(i){return this._userLoaded.addHandler(i)}removeUserLoaded(i){return this._userLoaded.removeHandler(i)}addUserUnloaded(i){return this._userUnloaded.addHandler(i)}removeUserUnloaded(i){return this._userUnloaded.removeHandler(i)}addSilentRenewError(i){return this._silentRenewError.addHandler(i)}removeSilentRenewError(i){return this._silentRenewError.removeHandler(i)}_raiseSilentRenewError(i){this._silentRenewError.raise(i)}addUserSignedIn(i){return this._userSignedIn.addHandler(i)}removeUserSignedIn(i){this._userSignedIn.removeHandler(i)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(i){return this._userSignedOut.addHandler(i)}removeUserSignedOut(i){this._userSignedOut.removeHandler(i)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(i){return this._userSessionChanged.addHandler(i)}removeUserSessionChanged(i){this._userSessionChanged.removeHandler(i)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},xs=class{constructor(i){var s=this;this._userManager=i,this._logger=new st("SilentRenewService"),this._isStarted=!1,this._retryTimer=new wt("Retry Silent Renew"),this._tokenExpiring=(0,N.A)(function*(){const a=s._logger.create("_tokenExpiring");try{yield s._userManager.signinSilent(),a.debug("silent token renewal successful")}catch(u){if(u instanceof Bu)return a.warn("ErrorTimeout from signinSilent:",u,"retry in 5s"),void s._retryTimer.init(5);a.error("Error from signinSilent:",u),s._userManager.events._raiseSilentRenewError(u)}})}start(){var i=this;return(0,N.A)(function*(){const s=i._logger.create("start");if(!i._isStarted){i._isStarted=!0,i._userManager.events.addAccessTokenExpiring(i._tokenExpiring),i._retryTimer.addHandler(i._tokenExpiring);try{yield i._userManager.getUser()}catch(a){s.error("getUser error",a)}}})()}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},fg=class{constructor(i,s){this.refresh_token=i.refresh_token,this.id_token=i.id_token,this.session_state=i.session_state,this.scope=i.scope,this.profile=i.profile,this.resource=s,this.data=i.state}},Bf=class{constructor(i,s,a,u){this._logger=new st("UserManager"),this.settings=new wc(i),this._client=new yc(i),this._redirectNavigator=s??new dg(this.settings),this._popupNavigator=a??new jf(this.settings),this._iframeNavigator=u??new ug(this.settings),this._events=new Dc(this.settings),this._silentRenewService=new xs(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new my(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}getUser(){var i=this;return(0,N.A)(function*(){const s=i._logger.create("getUser"),a=yield i._loadUser();return a?(s.info("user loaded"),i._events.load(a,!1),a):(s.info("user not found in storage"),null)})()}removeUser(){var i=this;return(0,N.A)(function*(){const s=i._logger.create("removeUser");yield i.storeUser(null),s.info("user removed from storage"),i._events.unload()})()}signinRedirect(i={}){var s=this;return(0,N.A)(function*(){s._logger.create("signinRedirect");const{redirectMethod:a,...u}=i,m=yield s._redirectNavigator.prepare({redirectMethod:a});yield s._signinStart({request_type:"si:r",...u},m)})()}signinRedirectCallback(i=window.location.href){var s=this;return(0,N.A)(function*(){const a=s._logger.create("signinRedirectCallback"),u=yield s._signinEnd(i);return u.profile&&u.profile.sub?a.info("success, signed in subject",u.profile.sub):a.info("no subject"),u})()}signinResourceOwnerCredentials({username:i,password:s,skipUserInfo:a=!1}){var u=this;return(0,N.A)(function*(){const m=u._logger.create("signinResourceOwnerCredential"),E=yield u._client.processResourceOwnerPasswordCredentials({username:i,password:s,skipUserInfo:a,extraTokenParams:u.settings.extraTokenParams});m.debug("got signin response");const T=yield u._buildUser(E);return T.profile&&T.profile.sub?m.info("success, signed in subject",T.profile.sub):m.info("no subject"),T})()}signinPopup(i={}){var s=this;return(0,N.A)(function*(){const a=s._logger.create("signinPopup"),{popupWindowFeatures:u,popupWindowTarget:m,...E}=i,T=s.settings.popup_redirect_uri;T||a.throw(new Error("No popup_redirect_uri configured"));const x=yield s._popupNavigator.prepare({popupWindowFeatures:u,popupWindowTarget:m}),V=yield s._signin({request_type:"si:p",redirect_uri:T,display:"popup",...E},x);return V&&(V.profile&&V.profile.sub?a.info("success, signed in subject",V.profile.sub):a.info("no subject")),V})()}signinPopupCallback(i=window.location.href,s=!1){var a=this;return(0,N.A)(function*(){const u=a._logger.create("signinPopupCallback");yield a._popupNavigator.callback(i,{keepOpen:s}),u.info("success")})()}signinSilent(i={}){var s=this;return(0,N.A)(function*(){var a;const u=s._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:m,resource:E,...T}=i;let x=yield s._loadUser();if(x?.refresh_token){u.debug("using refresh token");const ve=new fg(x,E);return yield s._useRefreshToken(ve)}const V=s.settings.silent_redirect_uri;let z;V||u.throw(new Error("No silent_redirect_uri configured")),x&&s.settings.validateSubOnSilentRenew&&(u.debug("subject prior to silent renew:",x.profile.sub),z=x.profile.sub);const fe=yield s._iframeNavigator.prepare({silentRequestTimeoutInSeconds:m});return x=yield s._signin({request_type:"si:s",redirect_uri:V,prompt:"none",id_token_hint:s.settings.includeIdTokenInSilentRenew?x?.id_token:void 0,...T},fe,z),x&&(null!=(a=x.profile)&&a.sub?u.info("success, signed in subject",x.profile.sub):u.info("no subject")),x})()}_useRefreshToken(i){var s=this;return(0,N.A)(function*(){const a=yield s._client.useRefreshToken({state:i,timeoutInSeconds:s.settings.silentRequestTimeoutInSeconds}),u=new vl({...i,...a});return yield s.storeUser(u),s._events.load(u),u})()}signinSilentCallback(i=window.location.href){var s=this;return(0,N.A)(function*(){const a=s._logger.create("signinSilentCallback");yield s._iframeNavigator.callback(i),a.info("success")})()}signinCallback(i=window.location.href){var s=this;return(0,N.A)(function*(){const{state:a}=yield s._client.readSigninResponseState(i);switch(a.request_type){case"si:r":return yield s.signinRedirectCallback(i);case"si:p":return yield s.signinPopupCallback(i);case"si:s":return yield s.signinSilentCallback(i);default:throw new Error("invalid response_type in state")}})()}signoutCallback(i=window.location.href,s=!1){var a=this;return(0,N.A)(function*(){const{state:u}=yield a._client.readSignoutResponseState(i);if(u)switch(u.request_type){case"so:r":yield a.signoutRedirectCallback(i);break;case"so:p":yield a.signoutPopupCallback(i,s);break;case"so:s":yield a.signoutSilentCallback(i);break;default:throw new Error("invalid response_type in state")}})()}querySessionStatus(i={}){var s=this;return(0,N.A)(function*(){const a=s._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:u,...m}=i,E=s.settings.silent_redirect_uri;E||a.throw(new Error("No silent_redirect_uri configured"));const T=yield s._loadUser(),x=yield s._iframeNavigator.prepare({silentRequestTimeoutInSeconds:u}),V=yield s._signinStart({request_type:"si:s",redirect_uri:E,prompt:"none",id_token_hint:s.settings.includeIdTokenInSilentRenew?T?.id_token:void 0,response_type:s.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...m},x);try{const z=yield s._client.processSigninResponse(V.url);return a.debug("got signin response"),z.session_state&&z.profile.sub?(a.info("success for subject",z.profile.sub),{session_state:z.session_state,sub:z.profile.sub,sid:z.profile.sid}):(a.info("success, user not authenticated"),null)}catch(z){if(s.settings.monitorAnonymousSession&&z instanceof Ns)switch(z.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return a.info("success for anonymous user"),{session_state:z.session_state}}throw z}})()}_signin(i,s,a){var u=this;return(0,N.A)(function*(){const m=yield u._signinStart(i,s);return yield u._signinEnd(m.url,a)})()}_signinStart(i,s){var a=this;return(0,N.A)(function*(){const u=a._logger.create("_signinStart");try{const m=yield a._client.createSigninRequest(i);return u.debug("got signin request"),yield s.navigate({url:m.url,state:m.state.id,response_mode:m.state.response_mode,scriptOrigin:a.settings.iframeScriptOrigin})}catch(m){throw u.debug("error after preparing navigator, closing navigator window"),s.close(),m}})()}_signinEnd(i,s){var a=this;return(0,N.A)(function*(){const u=a._logger.create("_signinEnd"),m=yield a._client.processSigninResponse(i);return u.debug("got signin response"),yield a._buildUser(m,s)})()}_buildUser(i,s){var a=this;return(0,N.A)(function*(){const u=a._logger.create("_buildUser"),m=new vl(i);if(s){if(s!==m.profile.sub)throw u.debug("current user does not match user returned from signin. sub from signin:",m.profile.sub),new Ns({...i,error:"login_required"});u.debug("current user matches user returned from signin")}return yield a.storeUser(m),u.debug("user stored"),a._events.load(m),m})()}signoutRedirect(i={}){var s=this;return(0,N.A)(function*(){const a=s._logger.create("signoutRedirect"),{redirectMethod:u,...m}=i,E=yield s._redirectNavigator.prepare({redirectMethod:u});yield s._signoutStart({request_type:"so:r",post_logout_redirect_uri:s.settings.post_logout_redirect_uri,...m},E),a.info("success")})()}signoutRedirectCallback(i=window.location.href){var s=this;return(0,N.A)(function*(){const a=s._logger.create("signoutRedirectCallback"),u=yield s._signoutEnd(i);return a.info("success"),u})()}signoutPopup(i={}){var s=this;return(0,N.A)(function*(){const a=s._logger.create("signoutPopup"),{popupWindowFeatures:u,popupWindowTarget:m,...E}=i,T=s.settings.popup_post_logout_redirect_uri,x=yield s._popupNavigator.prepare({popupWindowFeatures:u,popupWindowTarget:m});yield s._signout({request_type:"so:p",post_logout_redirect_uri:T,state:null==T?void 0:{},...E},x),a.info("success")})()}signoutPopupCallback(i=window.location.href,s=!1){var a=this;return(0,N.A)(function*(){const u=a._logger.create("signoutPopupCallback");yield a._popupNavigator.callback(i,{keepOpen:s}),u.info("success")})()}_signout(i,s){var a=this;return(0,N.A)(function*(){const u=yield a._signoutStart(i,s);return yield a._signoutEnd(u.url)})()}_signoutStart(i={},s){var a=this;return(0,N.A)(function*(){var u;const m=a._logger.create("_signoutStart");try{const E=yield a._loadUser();m.debug("loaded current user from storage"),a.settings.revokeTokensOnSignout&&(yield a._revokeInternal(E));const T=i.id_token_hint||E&&E.id_token;T&&(m.debug("setting id_token_hint in signout request"),i.id_token_hint=T),yield a.removeUser(),m.debug("user removed, creating signout request");const x=yield a._client.createSignoutRequest(i);return m.debug("got signout request"),yield s.navigate({url:x.url,state:null==(u=x.state)?void 0:u.id,scriptOrigin:a.settings.iframeScriptOrigin})}catch(E){throw m.debug("error after preparing navigator, closing navigator window"),s.close(),E}})()}_signoutEnd(i){var s=this;return(0,N.A)(function*(){const a=s._logger.create("_signoutEnd"),u=yield s._client.processSignoutResponse(i);return a.debug("got signout response"),u})()}signoutSilent(i={}){var s=this;return(0,N.A)(function*(){var a;const u=s._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:m,...E}=i,T=s.settings.includeIdTokenInSilentSignout?null==(a=yield s._loadUser())?void 0:a.id_token:void 0,x=s.settings.popup_post_logout_redirect_uri,V=yield s._iframeNavigator.prepare({silentRequestTimeoutInSeconds:m});yield s._signout({request_type:"so:s",post_logout_redirect_uri:x,id_token_hint:T,...E},V),u.info("success")})()}signoutSilentCallback(i=window.location.href){var s=this;return(0,N.A)(function*(){const a=s._logger.create("signoutSilentCallback");yield s._iframeNavigator.callback(i),a.info("success")})()}revokeTokens(i){var s=this;return(0,N.A)(function*(){const a=yield s._loadUser();yield s._revokeInternal(a,i)})()}_revokeInternal(i,s=this.settings.revokeTokenTypes){var a=this;return(0,N.A)(function*(){const u=a._logger.create("_revokeInternal");if(!i)return;const m=s.filter(E=>"string"==typeof i[E]);if(m.length){for(const E of m)yield a._client.revokeToken(i[E],E),u.info(`${E} revoked successfully`),"access_token"!==E&&(i[E]=null);yield a.storeUser(i),u.debug("user stored"),a._events.load(i)}else u.debug("no need to revoke due to no token(s)")})()}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}_loadUser(){var i=this;return(0,N.A)(function*(){const s=i._logger.create("_loadUser"),a=yield i.settings.userStore.get(i._userStoreKey);return a?(s.debug("user storageString loaded"),vl.fromStorageString(a)):(s.debug("no user storageString"),null)})()}storeUser(i){var s=this;return(0,N.A)(function*(){const a=s._logger.create("storeUser");if(i){a.debug("storing user");const u=i.toStorageString();yield s.settings.userStore.set(s._userStoreKey,u)}else s._logger.debug("removing user"),yield s.settings.userStore.remove(s._userStoreKey)})()}clearStaleState(){var i=this;return(0,N.A)(function*(){yield i._client.clearStaleState()})()}};class Ca{}class rn{constructor(){this.subscribers=[]}add(s){return this.subscribers.push(s),this.lastNotifiedValue&&s(...this.lastNotifiedValue),{unsubscribe:()=>this.unsubscribe(s)}}notify(...s){this.lastNotifiedValue=s,this.subscribers.forEach(a=>{a(...s)})}unsubscribe(s){if(s){const a=this.subscribers.indexOf(s);-1!==a&&this.subscribers.splice(a,1)}else this.subscribers=[]}}const ba=window.localStorage,Rr=window.Capacitor?.Plugins?.Storage,gr=window.Capacitor?.Plugins?.Preferences,Nr=window.Capacitor?.Plugins?.SecureStoragePlugin;class Hf{constructor(){if(this._logger=new st("MobileStorage"),!Nr){let s="[@badisi/auth-js] This application is currently using an unsafe storage.\n\n";s+="\u24d8 Please follow the recommended guide and use `capacitor-secure-storage-plugin` instead.",console.warn(s)}this._logger.debug(Nr?"Using `capacitor-secure-storage-plugin` implementation":gr?"Using `@capacitor/preferences` implementation":Rr?"Using `@capacitor/storage` implementation":"Using `localStorage` implementation")}get length(){return(0,N.A)(function*(){return Nr?(yield Nr.keys()).value.length:gr?(yield gr.keys()).keys.length:Rr?(yield Rr.keys()).keys.length:ba.length})()}key(s){return(0,N.A)(function*(){return Nr?(yield Nr.keys()).value[s]:gr?(yield gr.keys()).keys[s]:Rr?(yield Rr.keys()).keys[s]:ba.key(s)})()}clear(){var s=this;return(0,N.A)(function*(){s._logger.create("clear"),Nr?yield Nr.clear():gr?yield gr.clear():Rr?yield Rr.clear():ba.clear()})()}getItem(s){var a=this;return(0,N.A)(function*(){if(a._logger.create(`getItem('${s}')`),!Nr)return gr?(yield gr.get({key:s})).value:Rr?(yield Rr.get({key:s})).value:ba.getItem(s);try{return(yield Nr.get({key:s})).value}catch{return null}})()}setItem(s,a){var u=this;return(0,N.A)(function*(){u._logger.create(`setItem('${s}')`),Nr?yield Nr.set({key:s,value:a}):gr?yield gr.set({key:s,value:a}):Rr?yield Rr.set({key:s,value:a}):ba.setItem(s,a)})()}removeItem(s){var a=this;return(0,N.A)(function*(){if(a._logger.create(`removeItem('${s}')`),Nr)try{yield Nr.remove({key:s})}catch{}else gr?yield gr.remove({key:s}):Rr?yield Rr.remove({key:s}):ba.removeItem(s)})()}}var Or=function(i){return i.REDIRECT="REDIRECT",i.POPUP="POPUP",i}(Or||{});class Zu{constructor(){this.expired=void 0,this.expires_in=void 0,this.expires_at=void 0}static deserialize(s){const a=new Zu,u=Object.keys(a);for(const m of u)a[m]=s[m];return a}}const Ju=window.Capacitor?.Plugins?.App,mi=window.Capacitor?.Plugins?.Browser;class pg{constructor(s,a){if(this.redirectUrl=s,this.params=a,this._logger=new st("MobileWindow"),this.originalHandleOpenURL=window.handleOpenURL,this._isClosed=!0,this._receivedResult=!1,!ln.isCapacitor()&&!ln.isCordova()){let u="[@badisi/auth-js] Required core dependency not found.\n\n";u+="\u24d8 Please follow the recommended guide and install either `Capacitor` or `Cordova` dependency.",console.error(u)}if(!mi){let u="[@badisi/auth-js] Required plugin not found.\n\n";u+="\u24d8 Please follow the recommended guide and install either `@badisi/capacitor-browsertab` or `@capacitor/browser` plugin.",console.error(u)}mi&&this._logger.debug("Using `@capacitor/browser` implementation")}navigate(s){var a=this;return(0,N.A)(function*(){return a.navigateLogger=a._logger.create("navigate"),a.navigateLogger.debug("url",s.url),a._isClosed=!1,a._receivedResult=!1,new Promise((u,m)=>{a._resolve=u,a._reject=m,a.installCustomUrlSchemeHandler().then(()=>{mi&&a.useCapacitorBrowser(s)})})})()}close(){var s=this;return(0,N.A)(function*(){const a=s._logger.create("close");s._isClosed||(yield mi?.close().catch(u=>a.error(u))),a.debug("success")})()}cleanup(){var s=this;return(0,N.A)(function*(){const a=s._logger.create("cleanup");window.handleOpenURL=s.originalHandleOpenURL,yield s.capacitorBrowserFinishedHandle?.remove(),yield s.capacitorAppUrlOpenHandle?.remove(),clearTimeout(s.timer),a.debug("success")})()}onError(s){var a=this;return(0,N.A)(function*(){a.navigateLogger?.error("error response:",s),yield a.close(),yield a.cleanup(),a._reject?.(new Error(s)),a._receivedResult=!0})()}onSuccess(s){var a=this;return(0,N.A)(function*(){a.navigateLogger?.debug("successful response:",s),yield a.close(),yield a.cleanup(),a._resolve?.({url:s}),a._receivedResult=!0})()}useCapacitorBrowser(s){var a=this;return(0,N.A)(function*(){a.capacitorBrowserFinishedHandle=yield mi?.addListener("browserFinished",()=>{a._isClosed=!0,setTimeout(()=>{a._receivedResult||(a.cleanup(),a._reject?.("Capacitor browser closed by user"))},1e3)}),yield mi?.open({url:s.url,toolbarColor:a.params.mobileWindowToolbarColor,presentationStyle:a.params.mobileWindowPresentationStyle,width:a.params.mobileWindowWidth,height:a.params.mobileWindowWidth})})()}useBrowserTab(s){return(0,N.A)(function*(){})()}installCustomUrlSchemeHandler(){var s=this;return(0,N.A)(function*(){const a=s._logger.create("installCustomUrlSchemeHandler");s.timer=setTimeout(()=>{s.onError("Installing custom url scheme handler, timed out without a response")},1e4),yield s.cleanup(),ln.isCapacitor()?(a.debug("listening to Capacitor `appUrlOpen` event"),s.capacitorAppUrlOpenHandle=yield Ju?.addListener?.("appUrlOpen",({url:u})=>{ln.isUrlMatching(u,s.redirectUrl)&&s.onSuccess(u)})):ln.isCordova()&&(a.debug("waiting for Cordova `handleOpenURL` callback"),window.handleOpenURL=u=>{s.originalHandleOpenURL?.(u),ln.isUrlMatching(u,s.redirectUrl)&&s.onSuccess(u)}),a.debug("success")})()}}class gg{constructor(){this._logger=new st("MobileNavigator")}prepare(s,a){return this._logger.create("prepare"),new pg(s,a)}}class mg extends Bf{#e;constructor(s){super({authority:s.authorityUrl,client_id:s.clientId,scope:s.scope,loadUserInfo:s.loadUserInfo,automaticSilentRenew:s.automaticSilentRenew,...s.internal}),this.libSettings=s,this.#e=new gg}signoutMobile(s={}){var a=this;return(0,N.A)(function*(){const u=a._logger.create("signout"),{mobileWindowToolbarColor:m,mobileWindowPresentationStyle:E,mobileWindowWidth:T,mobileWindowHeight:x,...V}=s,fe=a.#e.prepare(a.settings.post_logout_redirect_uri,{mobileWindowToolbarColor:m??a.libSettings.internal?.mobileWindowToolbarColor,mobileWindowPresentationStyle:E??a.libSettings.internal?.mobileWindowPresentationStyle,mobileWindowWidth:T??a.libSettings.internal?.mobileWindowWidth,mobileWindowHeight:x??a.libSettings.internal?.mobileWindowHeight});yield a._signout({request_type:"so:m",post_logout_redirect_uri:a.settings.post_logout_redirect_uri,...V},fe),u.info("success")})()}signinMobile(s={}){var a=this;return(0,N.A)(function*(){const u=a._logger.create("signin"),{mobileWindowToolbarColor:m,mobileWindowPresentationStyle:E,mobileWindowWidth:T,mobileWindowHeight:x,...V}=s,fe=a.#e.prepare(a.settings.redirect_uri,{mobileWindowToolbarColor:m??a.libSettings.internal?.mobileWindowToolbarColor,mobileWindowPresentationStyle:E??a.libSettings.internal?.mobileWindowPresentationStyle,mobileWindowWidth:T??a.libSettings.internal?.mobileWindowWidth,mobileWindowHeight:x??a.libSettings.internal?.mobileWindowHeight}),ve=yield a._signin({request_type:"si:m",redirect_uri:a.settings.redirect_uri,...V},fe);ve?.profile?.sub?u.info("success, signed in subject",ve.profile.sub):u.info("no subject")})()}}const Ps="auth-js:oidc_manager:redirect_url",Qi={loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!1,automaticSilentRenew:!0,desktopNavigationType:Or.REDIRECT,scope:"openid profile email phone",logLevel:qn.NONE,internal:{response_type:"code",redirect_uri:"?oidc-callback=login",post_logout_redirect_uri:"?oidc-callback=logout",popup_redirect_uri:"oidc/callback/popup_redirect.html",popup_post_logout_redirect_uri:"oidc/callback/popup_redirect.html",silent_redirect_uri:"oidc/callback/silent_redirect.html",mobileWindowPresentationStyle:"popover"}};class Wf extends Ca{#e=new rn;#t=new rn;#n=new rn;#i=new rn;#s=new rn;#a=new rn;#l=new rn;#d=[];#c;#u;#h;#g;#p=!1;#_=!1;#o;#r=Qi;#w;set user(s){this.#w!==s&&(this.#w=s,this.#c=s?s.id_token:void 0,this.#u=s?s.access_token:void 0,this.#h=s?.profile?s.profile:void 0,this.#g=s?Zu.deserialize(s):void 0,this.#p=!(!s||s.expired),this.#e.notify(this.#c),this.#t.notify(this.#u),this.#n.notify(this.#h),this.#i.notify(this.#g),this.#s.notify(this.#p))}init(s){var a=this;return(0,N.A)(function*(){qn.setLevel(s.logLevel??Qi.logLevel??qn.NONE),qn.setLogger(console);const u=ln.isNativeMobile(),m=u?`${s.mobileScheme}://localhost/`:ln.getBaseUrl();if(a.#r=Fu({},Qi,{internal:{userStore:new wa({store:u?new Hf:new Os}),redirect_uri:`${m}${Qi.internal?.redirect_uri}`,post_logout_redirect_uri:`${m}${Qi.internal?.post_logout_redirect_uri}`,popup_redirect_uri:`${m}${Qi.internal?.popup_redirect_uri}`,popup_post_logout_redirect_uri:`${m}${Qi.internal?.popup_post_logout_redirect_uri}`,silent_redirect_uri:`${m}${Qi.internal?.silent_redirect_uri}`}},s),a.#o=new mg(a.#r),a.#d.push(a.#o.events.addUserLoaded(E=>{a.user=E}),a.#o.events.addUserUnloaded(()=>{a.#w&&(a.user=null,a.#r.loginRequired&&location.reload())}),a.#o.events.addSilentRenewError((0,N.A)(function*(){yield a.#y()}))),a.#S(),ln.isUrlMatching(location.href,a.#r.internal?.redirect_uri))yield a.#D((0,N.A)(function*(){const E=sessionStorage.getItem(Ps);yield a.#C(()=>a.#o.signinRedirectCallback(location.href),E),sessionStorage.removeItem(Ps)}));else if(ln.isUrlMatching(location.href,a.#r.internal?.post_logout_redirect_uri))yield a.#D((0,N.A)(function*(){const E=sessionStorage.getItem(Ps);yield a.#b(()=>a.#o.signoutRedirectCallback(location.href),E),sessionStorage.removeItem(Ps)}));else if(a.#r.retrieveUserSession||a.#r.loginRequired){const E=function(){var x=(0,N.A)(function*(){yield a.#D(()=>a.#E().catch(function(){var V=(0,N.A)(function*(z){const{error:fe,message:ve}=z;if(a.#r.loginRequired&&(fe?.includes("_required")||ve?.includes("_required")))yield a.login();else if(console.error("[OIDCAuthManager] User's session cannot be retrieved:",z.message),a.#s.notify(!1),a.#r.loginRequired)throw z});return function(z){return V.apply(this,arguments)}}()))});return function(){return x.apply(this,arguments)}}(),T=yield a.#o?.getUser();!T||T.expired?!u&&a.#r.retrieveUserSession?yield E():a.#r.loginRequired?yield a.login():a.user=null:a.user=T}else a.user=null})()}logout(s){var a=this;return(0,N.A)(function*(){const u=s?.redirectUrl??location.href;ln.isNativeMobile()?yield a.#b(()=>a.#o.signoutMobile(s),u):(s?.desktopNavigationType??a.#r.desktopNavigationType)===Or.POPUP?yield a.#b(()=>a.#o.signoutPopup(s),u):(sessionStorage.setItem(Ps,u),yield a.#o?.signoutRedirect(s))})()}login(s){var a=this;return(0,N.A)(function*(){const u=s?.redirectUrl??location.href;return ln.isNativeMobile()?yield a.#C(()=>a.#o.signinMobile(s),u):(s?.desktopNavigationType??a.#r.desktopNavigationType)===Or.POPUP?yield a.#C(()=>a.#o.signinPopup(s),u):(sessionStorage.setItem(Ps,u),yield a.#o?.signinRedirect(s)),a.#p})()}renew(s){var a=this;return(0,N.A)(function*(){return a.#E(s).catch(u=>console.error(u))})()}getSettings(){return this.#r}isRenewing(){return this.#_}isAuthenticated(){var s=this;return(0,N.A)(function*(){return yield s.#f("isAuthenticated()"),s.#p})()}getUserProfile(){var s=this;return(0,N.A)(function*(){return yield s.#f("getUserProfile()"),s.#h})()}getUserSession(){var s=this;return(0,N.A)(function*(){return yield s.#f("getUserSession()"),s.#g})()}getIdToken(){var s=this;return(0,N.A)(function*(){return yield s.#f("getIdToken()"),s.#c})()}getIdTokenDecoded(){var s=this;return(0,N.A)(function*(){return yield s.#f("getIdTokenDecoded()"),ln.decodeJwt(s.#c)})()}getAccessToken(){var s=this;return(0,N.A)(function*(){return yield s.#f("getAccessToken()"),s.#u})()}getAccessTokenDecoded(){var s=this;return(0,N.A)(function*(){return yield s.#f("getAccessTokenDecoded()"),ln.decodeJwt(s.#u)})()}destroy(){this.#e.unsubscribe(),this.#t.unsubscribe(),this.#n.unsubscribe(),this.#i.unsubscribe(),this.#s.unsubscribe(),this.#a.unsubscribe(),this.#l.unsubscribe(),this.#d.forEach(s=>s())}onIdTokenChanged(s){return this.#e.add(s)}onAccessTokenChanged(s){return this.#t.add(s)}onUserProfileChanged(s){return this.#n.add(s)}onUserSessionChanged(s){return this.#i.add(s)}onAuthenticatedChanged(s){return this.#s.add(s)}onRenewingChanged(s){return this.#a.add(s)}onRedirect(s){return this.#l.add(s)}#S(){[this.#r.internal?.silent_redirect_uri,this.#r.internal?.popup_redirect_uri].forEach(s=>{const a=new RegExp(/^.*\/(.*).html$/gm).exec(s??"")?.[1],u=new Error(`[OIDCAuthManager] ${s??"redirect uri"} was not found.`);if(u.stack=void 0,ln.isUrlMatching(location.href,s))throw u.message+="\n\n\u24d8 This usually means you forgot to include the redirect html files in your application assets.",u;if(location.href.includes(`/${a}.html`))throw u.message+="\n\n\u24d8 This usually means your redirect urls are misconfigured.",u})}#f(s){var a=this;return(0,N.A)(function*(){const u=Date.now();for(;a.#_;){if(Date.now()>u+5e3){console.warn("[@badisi/auth-js]",`\`${s}\``,"timed out waiting for renew to finish.");break}yield new Promise(m=>setTimeout(m,100))}})()}#I(s){const a=ln.stringToURL(s??"/");this.#r.loginRequired&&location.origin===a.origin&&location.reload()}#m(s){this.#_=s,this.#a.notify(s)}#D(s){var a=this;return(0,N.A)(function*(){a.#r.loginRequired?yield s():s()})()}#v(s,a){var u=this;return(0,N.A)(function*(){a&&(console.error(a),yield u.#y());const m=ln.stringToURL(s??"/");location.origin===m.origin?(history.replaceState(history.state,"",m.href),u.#l.notify(m)):location.href=m.href})()}#y(){var s=this;return(0,N.A)(function*(){s.user=null,yield Promise.all([s.#o?.clearStaleState(),s.#o?.removeUser()])})()}#E(s){var a=this;return(0,N.A)(function*(){a.#m(!0);try{yield a.#o?.signinSilent(s)}catch(u){throw yield a.#y(),u}finally{a.#m(!1)}})()}#C(s,a){var u=this;return(0,N.A)(function*(){try{u.#m(!0),yield s().catch(m=>{throw"Attempted to navigate on a disposed window"===m?.message&&((m=new Error("[OIDCAuthManager] Attempted to navigate on a disposed window.")).stack=void 0,m.message+="\n\n\u24d8 This may be due to an ad blocker."),m}),yield u.#v(a)}catch(m){throw yield u.#v("/",m),m}finally{u.#m(!1)}})()}#b(s,a){var u=this;return(0,N.A)(function*(){try{yield s().catch(m=>{throw"Attempted to navigate on a disposed window"===m?.message&&((m=new Error("[OIDCAuthManager] Attempted to navigate on a disposed window.")).stack=void 0,m.message+="\n\n\u24d8 This may be due to an ad blocker."),m}),yield u.#v(a),yield u.#y()}catch(m){throw a="/",yield u.#v(a,m),m}finally{u.#I(a)}})()}}const vg=function(){var i=(0,N.A)(function*(s){return yield nr(s,Wf)});return function(a){return i.apply(this,arguments)}}(),yg={automaticLoginOn401:!0,automaticInjectToken:{include:i=>{const s=new URL(i,"http://default-base");return s.hostname.startsWith("api")||s.pathname.startsWith("/api")||!1}}},_g=new w.nKC("AUTH_MANAGER"),Gf=function(){var i=(0,N.A)(function*(s){return{provide:_g,useValue:yield vg({...yg,...s}),multi:!1}});return function(a){return i.apply(this,arguments)}}();let bc=(()=>{class i{#e;#t;#n;#i;#s;#a;#l;#d;#c;#u;constructor(){this.#e=(0,w.WQX)(_g),this.#t=(0,w.WQX)(w.SKi),this.#n=(0,w.WQX)(Ke.Ix),this.#i=new Pr(1),this.#s=new Pr(1),this.#a=new Pr(1),this.#l=new Pr(1),this.#d=new Pr(1),this.#c=new Pr(1),this.#u=[],this.isRenewing$=this.#c.asObservable().pipe(cr()),this.isAuthenticated$=this.#d.asObservable().pipe(cr()),this.userProfile$=this.#a.asObservable().pipe(cr()),this.userSession$=this.#l.asObservable().pipe(cr()),this.idToken$=this.#i.asObservable().pipe(cr()),this.idTokenDecoded$=this.#i.asObservable().pipe(cr(),(0,ge.T)(a=>ln.decodeJwt(a))),this.accessToken$=this.#s.asObservable().pipe(cr()),this.accessTokenDecoded$=this.#s.asObservable().pipe(cr(),(0,ge.T)(a=>ln.decodeJwt(a))),this.#h()}ngOnDestroy(){this.#u.forEach(a=>a.unsubscribe())}login(a){var u=this;return(0,N.A)(function*(){return u.#e.login(a)})()}logout(a){var u=this;return(0,N.A)(function*(){return u.#e.logout(a)})()}renew(a){var u=this;return(0,N.A)(function*(){return u.#e.renew(a)})()}getSettings(){return this.#e.getSettings()}isRenewing(){return this.#e.isRenewing()}isAuthenticated(){var a=this;return(0,N.A)(function*(){return a.#e.isAuthenticated()})()}getUserProfile(){var a=this;return(0,N.A)(function*(){return a.#e.getUserProfile()})()}getUserSession(){var a=this;return(0,N.A)(function*(){return a.#e.getUserSession()})()}getIdToken(){var a=this;return(0,N.A)(function*(){return a.#e.getIdToken()})()}getIdTokenDecoded(){var a=this;return(0,N.A)(function*(){return a.#e.getIdTokenDecoded()})()}getAccessToken(){var a=this;return(0,N.A)(function*(){return a.#e.getAccessToken()})()}getAccessTokenDecoded(){var a=this;return(0,N.A)(function*(){return a.#e.getAccessTokenDecoded()})()}#h(){this.#u.push(this.#e.onIdTokenChanged(a=>this.#t.run(()=>this.#i.next(a))),this.#e.onAccessTokenChanged(a=>this.#t.run(()=>this.#s.next(a))),this.#e.onUserProfileChanged(a=>this.#t.run(()=>this.#a.next(a))),this.#e.onUserSessionChanged(a=>this.#t.run(()=>this.#l.next(a))),this.#e.onAuthenticatedChanged(a=>this.#t.run(()=>this.#d.next(a))),this.#e.onRenewingChanged(a=>this.#t.run(()=>this.#c.next(a))),this.#e.onRedirect(a=>{this.#n.getCurrentNavigation()||this.#t.run(()=>{const u=a.href.replace(ln.getBaseUrl(),"");this.#n.navigateByUrl(u)})}))}static#g=this.\u0275fac=function(u){return new(u||i)};static#p=this.\u0275prov=w.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();const jr=(i,s)=>{const u=(fe,ve)=>{const Oe=(fe=>{try{return new URL(fe).href}catch{return new URL(`${location.origin}${fe.startsWith("/")?"":"/"}${fe}`).href}})(fe);if("function"==typeof ve)return ve(Oe);if("string"==typeof ve){const _t=ve.replace(/\//g,"\\/").replace(/\./g,"\\.").replace(/\*\*/g,"*").replace(/\*/g,".*");return null!==new RegExp(_t).exec(Oe)}return null!==ve.exec(Oe)},T=(0,w.WQX)(bc),x=T.getSettings(),V=x?.automaticLoginOn401??!1;return(fe=T,ve=i,Oe=x?.automaticInjectToken??!1,fe.accessToken$.pipe((0,qr.s)(1),(0,ge.T)(_t=>{if(!1!==Oe&&_t&&((fe,ve)=>{let Oe=!1;if("boolean"==typeof ve)Oe=ve;else{const{include:_t,exclude:Dt}=ve??{};Array.isArray(_t)?Oe=_t.some(ht=>u(fe.url,ht)):_t&&(Oe=u(fe.url,_t)),Array.isArray(Dt)?Dt.some(ht=>u(fe.url,ht))&&(Oe=!1):Dt&&u(fe.url,Dt)&&(Oe=!1)}return Oe})(ve,Oe)){const Dt=ve.headers?ve.headers:new Se;return ve.clone({headers:Dt.append("Authorization",`Bearer ${_t}`)})}return ve}))).pipe((0,Z.n)(fe=>s(fe)),(0,Ro.W)(fe=>(V&&401===fe.status&&T.login(),(0,Ii.$)(()=>fe))));var fe,ve,Oe};var zf=O(4402),vy=O(3073),Yu=O(8750),vi=O(3794),qf=O(6450),Ea=O(8496);function Kf(...i){const s=(0,vi.ms)(i),{args:a,keys:u}=(0,vy.D)(i),m=new Q.c(E=>{const{length:T}=a;if(!T)return void E.complete();const x=new Array(T);let V=T,z=T;for(let fe=0;fe{ve||(ve=!0,z--),x[fe]=Oe},()=>V--,void 0,()=>{(!V||!ve)&&(z||E.next(u?(0,Ea.e)(u,x):x),E.complete())}))}});return s?m.pipe((0,qf.I)(s)):m}let ks=(()=>{class i{#e=(0,w.WQX)(bc);#t=(0,w.WQX)(Ke.Ix);canLoad(a){const u=this.#t.getCurrentNavigation()?.extractedUrl?.toString();return this.#a(a.data,u)}canActivate(a,u){return this.#a(a.data,u.url)}canActivateChild(a,u){return this.#a(a.data,u.url)}isAuthorized(){return!0}#n(a){return!(!a?.then||"function"!=typeof a.then)}#i(a){const u=E=>"boolean"==typeof E?(0,j.of)(E):(0,zf.A)(E)?E:this.#n(E)?(0,De.H)(E):(0,j.of)(!1),m=a?.authGuardValidator;return"function"==typeof m?Kf({userProfile:this.#e.userProfile$.pipe((0,qr.s)(1)),accessToken:this.#e.accessTokenDecoded$.pipe((0,qr.s)(1))}).pipe((0,Z.n)(({userProfile:E,accessToken:T})=>u(m(E,T)))):m?(console.error("authGuardValidator must be a function"),(0,j.of)(!1)):u(this.isAuthorized())}#s(a=location.href){return this.#e.isAuthenticated$.pipe((0,qr.s)(1),(0,Z.n)(u=>u?(0,j.of)(u):(0,De.H)(this.#e.login({redirectUrl:a})).pipe((0,Ro.W)(()=>(0,j.of)(!1)))))}#a(a,u=location.href){return this.#s(u).pipe((0,Z.n)(m=>m?this.#i(a):(0,j.of)(!1)),(0,ge.T)(m=>{if(!m){const E=a?.authGuardRedirectUrl||this.#e.getSettings()?.authGuardRedirectUrl;return this.#t.parseUrl(E||this.#t.url)}return!0}))}static#l=this.\u0275fac=function(u){return new(u||i)};static#d=this.\u0275prov=w.jDH({token:i,factory:i.\u0275fac})}return i})(),yy=(()=>{class i{static#e=this.\u0275fac=function(u){return new(u||i)};static#t=this.\u0275cmp=w.VBU({type:i,selectors:[["app-root"]],standalone:!0,features:[w.aNF],decls:1,vars:0,template:function(u,m){1&u&&w.nrm(0,"router-outlet")},dependencies:[Ke.n3],encapsulation:2})}return i})(),wg=(()=>{class i{constructor(a,u){this._renderer=a,this._elementRef=u,this.onChange=m=>{},this.onTouched=()=>{}}setProperty(a,u){this._renderer.setProperty(this._elementRef.nativeElement,a,u)}registerOnTouched(a){this.onTouched=a}registerOnChange(a){this.onChange=a}setDisabledState(a){this.setProperty("disabled",a)}static#e=this.\u0275fac=function(u){return new(u||i)(w.rXU(w.sFG),w.rXU(w.aKT))};static#t=this.\u0275dir=w.FsC({type:i})}return i})(),Sa=(()=>{class i extends wg{static#e=this.\u0275fac=(()=>{let a;return function(m){return(a||(a=w.xGo(i)))(m||i)}})();static#t=this.\u0275dir=w.FsC({type:i,features:[w.Vt3]})}return i})();const yi=new w.nKC(""),wl={provide:yi,useExisting:(0,w.Rfq)(()=>Ia),multi:!0},Cg=new w.nKC("");let Ia=(()=>{class i extends wg{constructor(a,u,m){super(a,u),this._compositionMode=m,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function Qf(){const i=(0,se.QT)()?(0,se.QT)().getUserAgent():"";return/android (\d+)/.test(i.toLowerCase())}())}writeValue(a){this.setProperty("value",a??"")}_handleInput(a){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(a)}_compositionStart(){this._composing=!0}_compositionEnd(a){this._composing=!1,this._compositionMode&&this.onChange(a)}static#e=this.\u0275fac=function(u){return new(u||i)(w.rXU(w.sFG),w.rXU(w.aKT),w.rXU(Cg,8))};static#t=this.\u0275dir=w.FsC({type:i,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(u,m){1&u&&w.bIt("input",function(T){return m._handleInput(T.target.value)})("blur",function(){return m.onTouched()})("compositionstart",function(){return m._compositionStart()})("compositionend",function(T){return m._compositionEnd(T.target.value)})},features:[w.Jv_([wl]),w.Vt3]})}return i})();const Vn=new w.nKC(""),oo=new w.nKC("");function th(i){return null!=i}function mr(i){return(0,w.jNT)(i)?(0,De.H)(i):i}function Ic(i){let s={};return i.forEach(a=>{s=null!=a?{...s,...a}:s}),0===Object.keys(s).length?null:s}function nd(i,s){return s.map(a=>a(i))}function Xn(i){return i.map(s=>function rd(i){return!i.validate}(s)?s:a=>s.validate(a))}function Mc(i){return null!=i?function Ma(i){if(!i)return null;const s=i.filter(th);return 0==s.length?null:function(a){return Ic(nd(a,s))}}(Xn(i)):null}function id(i){return null!=i?function od(i){if(!i)return null;const s=i.filter(th);return 0==s.length?null:function(a){return Kf(nd(a,s).map(mr)).pipe((0,ge.T)(Ic))}}(Xn(i)):null}function sd(i,s){return null===i?[s]:Array.isArray(i)?[...i,s]:[i,s]}function ld(i){return i?Array.isArray(i)?i:[i]:[]}function bl(i,s){return Array.isArray(i)?i.includes(s):i===s}function rh(i,s){const a=ld(s);return ld(i).forEach(m=>{bl(a,m)||a.push(m)}),a}function oh(i,s){return ld(s).filter(a=>!bl(i,a))}class ih{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(s){this._rawValidators=s||[],this._composedValidatorFn=Mc(this._rawValidators)}_setAsyncValidators(s){this._rawAsyncValidators=s||[],this._composedAsyncValidatorFn=id(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(s){this._onDestroyCallbacks.push(s)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(s=>s()),this._onDestroyCallbacks=[]}reset(s=void 0){this.control&&this.control.reset(s)}hasError(s,a){return!!this.control&&this.control.hasError(s,a)}getError(s,a){return this.control?this.control.getError(s,a):null}}class vr extends ih{get formDirective(){return null}get path(){return null}}class _i extends ih{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class cd{constructor(s){this._cd=s}get isTouched(){return!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return!!this._cd?.submitted}}let dd=(()=>{class i extends cd{constructor(a){super(a)}static#e=this.\u0275fac=function(u){return new(u||i)(w.rXU(_i,2))};static#t=this.\u0275dir=w.FsC({type:i,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(u,m){2&u&&w.AVh("ng-untouched",m.isUntouched)("ng-touched",m.isTouched)("ng-pristine",m.isPristine)("ng-dirty",m.isDirty)("ng-valid",m.isValid)("ng-invalid",m.isInvalid)("ng-pending",m.isPending)},features:[w.Vt3]})}return i})();const Ta="VALID",Ac="INVALID",Vs="PENDING",Us="DISABLED";function Rc(i){return null!=i&&!Array.isArray(i)&&"object"==typeof i}class Aa{constructor(s,a){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=!1,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._assignValidators(s),this._assignAsyncValidators(a)}get validator(){return this._composedValidatorFn}set validator(s){this._rawValidators=this._composedValidatorFn=s}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(s){this._rawAsyncValidators=this._composedAsyncValidatorFn=s}get parent(){return this._parent}get valid(){return this.status===Ta}get invalid(){return this.status===Ac}get pending(){return this.status==Vs}get disabled(){return this.status===Us}get enabled(){return this.status!==Us}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(s){this._assignValidators(s)}setAsyncValidators(s){this._assignAsyncValidators(s)}addValidators(s){this.setValidators(rh(s,this._rawValidators))}addAsyncValidators(s){this.setAsyncValidators(rh(s,this._rawAsyncValidators))}removeValidators(s){this.setValidators(oh(s,this._rawValidators))}removeAsyncValidators(s){this.setAsyncValidators(oh(s,this._rawAsyncValidators))}hasValidator(s){return bl(this._rawValidators,s)}hasAsyncValidator(s){return bl(this._rawAsyncValidators,s)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(s={}){this.touched=!0,this._parent&&!s.onlySelf&&this._parent.markAsTouched(s)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(s=>s.markAllAsTouched())}markAsUntouched(s={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(a=>{a.markAsUntouched({onlySelf:!0})}),this._parent&&!s.onlySelf&&this._parent._updateTouched(s)}markAsDirty(s={}){this.pristine=!1,this._parent&&!s.onlySelf&&this._parent.markAsDirty(s)}markAsPristine(s={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(a=>{a.markAsPristine({onlySelf:!0})}),this._parent&&!s.onlySelf&&this._parent._updatePristine(s)}markAsPending(s={}){this.status=Vs,!1!==s.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!s.onlySelf&&this._parent.markAsPending(s)}disable(s={}){const a=this._parentMarkedDirty(s.onlySelf);this.status=Us,this.errors=null,this._forEachChild(u=>{u.disable({...s,onlySelf:!0})}),this._updateValue(),!1!==s.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...s,skipPristineCheck:a}),this._onDisabledChange.forEach(u=>u(!0))}enable(s={}){const a=this._parentMarkedDirty(s.onlySelf);this.status=Ta,this._forEachChild(u=>{u.enable({...s,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:s.emitEvent}),this._updateAncestors({...s,skipPristineCheck:a}),this._onDisabledChange.forEach(u=>u(!1))}_updateAncestors(s){this._parent&&!s.onlySelf&&(this._parent.updateValueAndValidity(s),s.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(s){this._parent=s}getRawValue(){return this.value}updateValueAndValidity(s={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Ta||this.status===Vs)&&this._runAsyncValidator(s.emitEvent)),!1!==s.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!s.onlySelf&&this._parent.updateValueAndValidity(s)}_updateTreeValidity(s={emitEvent:!0}){this._forEachChild(a=>a._updateTreeValidity(s)),this.updateValueAndValidity({onlySelf:!0,emitEvent:s.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Us:Ta}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(s){if(this.asyncValidator){this.status=Vs,this._hasOwnPendingAsyncValidator=!0;const a=mr(this.asyncValidator(this));this._asyncValidationSubscription=a.subscribe(u=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(u,{emitEvent:s})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(s,a={}){this.errors=s,this._updateControlsErrors(!1!==a.emitEvent)}get(s){let a=s;return null==a||(Array.isArray(a)||(a=a.split(".")),0===a.length)?null:a.reduce((u,m)=>u&&u._find(m),this)}getError(s,a){const u=a?this.get(a):this;return u&&u.errors?u.errors[s]:null}hasError(s,a){return!!this.getError(s,a)}get root(){let s=this;for(;s._parent;)s=s._parent;return s}_updateControlsErrors(s){this.status=this._calculateStatus(),s&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(s)}_initObservables(){this.valueChanges=new w.bkB,this.statusChanges=new w.bkB}_calculateStatus(){return this._allControlsDisabled()?Us:this.errors?Ac:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Vs)?Vs:this._anyControlsHaveStatus(Ac)?Ac:Ta}_anyControlsHaveStatus(s){return this._anyControls(a=>a.status===s)}_anyControlsDirty(){return this._anyControls(s=>s.dirty)}_anyControlsTouched(){return this._anyControls(s=>s.touched)}_updatePristine(s={}){this.pristine=!this._anyControlsDirty(),this._parent&&!s.onlySelf&&this._parent._updatePristine(s)}_updateTouched(s={}){this.touched=this._anyControlsTouched(),this._parent&&!s.onlySelf&&this._parent._updateTouched(s)}_registerOnCollectionChange(s){this._onCollectionChange=s}_setUpdateStrategy(s){Rc(s)&&null!=s.updateOn&&(this._updateOn=s.updateOn)}_parentMarkedDirty(s){return!s&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}_find(s){return null}_assignValidators(s){this._rawValidators=Array.isArray(s)?s.slice():s,this._composedValidatorFn=function by(i){return Array.isArray(i)?Mc(i):i||null}(this._rawValidators)}_assignAsyncValidators(s){this._rawAsyncValidators=Array.isArray(s)?s.slice():s,this._composedAsyncValidatorFn=function Ng(i){return Array.isArray(i)?id(i):i||null}(this._rawAsyncValidators)}}const Wo=new w.nKC("CallSetDisabledState",{providedIn:"root",factory:()=>js}),js="always";function Bs(i,s,a=js){(function Il(i,s){const a=function nh(i){return i._rawValidators}(i);null!==s.validator?i.setValidators(sd(a,s.validator)):"function"==typeof a&&i.setValidators([a]);const u=function ad(i){return i._rawAsyncValidators}(i);null!==s.asyncValidator?i.setAsyncValidators(sd(u,s.asyncValidator)):"function"==typeof u&&i.setAsyncValidators([u]);const m=()=>i.updateValueAndValidity();Hs(s._rawValidators,m),Hs(s._rawAsyncValidators,m)})(i,s),s.valueAccessor.writeValue(i.value),(i.disabled||"always"===a)&&s.valueAccessor.setDisabledState?.(i.disabled),function Pg(i,s){s.valueAccessor.registerOnChange(a=>{i._pendingValue=a,i._pendingChange=!0,i._pendingDirty=!0,"change"===i.updateOn&&hh(i,s)})}(i,s),function kg(i,s){const a=(u,m)=>{s.valueAccessor.writeValue(u),m&&s.viewToModelUpdate(u)};i.registerOnChange(a),s._registerOnDestroy(()=>{i._unregisterOnChange(a)})}(i,s),function fh(i,s){s.valueAccessor.registerOnTouched(()=>{i._pendingTouched=!0,"blur"===i.updateOn&&i._pendingChange&&hh(i,s),"submit"!==i.updateOn&&i.markAsTouched()})}(i,s),function Ey(i,s){if(s.valueAccessor.setDisabledState){const a=u=>{s.valueAccessor.setDisabledState(u)};i.registerOnDisabledChange(a),s._registerOnDestroy(()=>{i._unregisterOnDisabledChange(a)})}}(i,s)}function Hs(i,s){i.forEach(a=>{a.registerOnValidatorChange&&a.registerOnValidatorChange(s)})}function hh(i,s){i._pendingDirty&&i.markAsDirty(),i.setValue(i._pendingValue,{emitModelToViewChange:!1}),s.viewToModelUpdate(i._pendingValue),i._pendingChange=!1}function xc(i,s){const a=i.indexOf(s);a>-1&&i.splice(a,1)}function Tl(i){return"object"==typeof i&&null!==i&&2===Object.keys(i).length&&"value"in i&&"disabled"in i}Promise.resolve();const Al=class extends Aa{constructor(s=null,a,u){super(function lh(i){return(Rc(i)?i.validators:i)||null}(a),function pd(i,s){return(Rc(s)?s.asyncValidators:i)||null}(u,a)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(s),this._setUpdateStrategy(a),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Rc(a)&&(a.nonNullable||a.initialValueIsDefault)&&(this.defaultValue=Tl(s)?s.value:s)}setValue(s,a={}){this.value=this._pendingValue=s,this._onChange.length&&!1!==a.emitModelToViewChange&&this._onChange.forEach(u=>u(this.value,!1!==a.emitViewToModelChange)),this.updateValueAndValidity(a)}patchValue(s,a={}){this.setValue(s,a)}reset(s=this.defaultValue,a={}){this._applyFormState(s),this.markAsPristine(a),this.markAsUntouched(a),this.setValue(this.value,a),this._pendingChange=!1}_updateValue(){}_anyControls(s){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(s){this._onChange.push(s)}_unregisterOnChange(s){xc(this._onChange,s)}registerOnDisabledChange(s){this._onDisabledChange.push(s)}_unregisterOnDisabledChange(s){xc(this._onDisabledChange,s)}_forEachChild(s){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(s){Tl(s)?(this.value=this._pendingValue=s.value,s.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=s}},Pc={provide:_i,useExisting:(0,w.Rfq)(()=>Fc)},kc=Promise.resolve();let Fc=(()=>{class i extends _i{constructor(a,u,m,E,T,x){super(),this._changeDetectorRef=T,this.callSetDisabledState=x,this.control=new Al,this._registered=!1,this.name="",this.update=new w.bkB,this._parent=a,this._setValidators(u),this._setAsyncValidators(m),this.valueAccessor=function Ws(i,s){if(!s)return null;let a,u,m;return Array.isArray(s),s.forEach(E=>{E.constructor===Ia?a=E:function Iy(i){return Object.getPrototypeOf(i.constructor)===Sa}(E)?u=E:m=E}),m||u||a||null}(0,E)}ngOnChanges(a){if(this._checkForErrors(),!this._registered||"name"in a){if(this._registered&&(this._checkName(),this.formDirective)){const u=a.name.previousValue;this.formDirective.removeControl({name:u,path:this._getPath(u)})}this._setUpControl()}"isDisabled"in a&&this._updateDisabled(a),function vd(i,s){if(!i.hasOwnProperty("model"))return!1;const a=i.model;return!!a.isFirstChange()||!Object.is(s,a.currentValue)}(a,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(a){this.viewModel=a,this.update.emit(a)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Bs(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(a){kc.then(()=>{this.control.setValue(a,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(a){const u=a.isDisabled.currentValue,m=0!==u&&(0,w.L39)(u);kc.then(()=>{m&&!this.control.disabled?this.control.disable():!m&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(a){return this._parent?function wi(i,s){return[...s.path,i]}(a,this._parent):[a]}static#e=this.\u0275fac=function(u){return new(u||i)(w.rXU(vr,9),w.rXU(Vn,10),w.rXU(oo,10),w.rXU(yi,10),w.rXU(w.gRc,8),w.rXU(Wo,8))};static#t=this.\u0275dir=w.FsC({type:i,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[w.Mj6.None,"disabled","isDisabled"],model:[w.Mj6.None,"ngModel","model"],options:[w.Mj6.None,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[w.Jv_([Pc]),w.Vt3,w.OA$]})}return i})(),om=(()=>{class i{static#e=this.\u0275fac=function(u){return new(u||i)};static#t=this.\u0275mod=w.$C({type:i});static#n=this.\u0275inj=w.G2t({})}return i})(),am=(()=>{class i{static withConfig(a){return{ngModule:i,providers:[{provide:Wo,useValue:a.callSetDisabledState??js}]}}static#e=this.\u0275fac=function(u){return new(u||i)};static#t=this.\u0275mod=w.$C({type:i});static#n=this.\u0275inj=w.G2t({imports:[om]})}return i})();typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"&&global;var xl=function(i){return i.Unimplemented="UNIMPLEMENTED",i.Unavailable="UNAVAILABLE",i}(xl||{});class Pl extends Error{constructor(s,a,u){super(s),this.message=s,this.code=a,this.data=u}}const By=i=>{var s,a,u,m,E;const T=i.CapacitorCustomPlatform||null,x=i.Capacitor||{},V=x.Plugins=x.Plugins||{},z=i.CapacitorPlatforms,ve=(null===(s=z?.currentPlatform)||void 0===s?void 0:s.getPlatform)||(()=>null!==T?T.name:(i=>{var s,a;return i?.androidBridge?"android":null!==(a=null===(s=i?.webkit)||void 0===s?void 0:s.messageHandlers)&&void 0!==a&&a.bridge?"ios":"web"})(i)),_t=(null===(a=z?.currentPlatform)||void 0===a?void 0:a.isNativePlatform)||(()=>"web"!==ve()),ht=(null===(u=z?.currentPlatform)||void 0===u?void 0:u.isPluginAvailable)||(Mt=>{const Wt=un.get(Mt);return!(!Wt?.platforms.has(ve())&&!$t(Mt))}),$t=(null===(m=z?.currentPlatform)||void 0===m?void 0:m.getPluginHeader)||(Mt=>{var Wt;return null===(Wt=x.PluginHeaders)||void 0===Wt?void 0:Wt.find(ao=>ao.name===Mt)}),un=new Map,Qn=(null===(E=z?.currentPlatform)||void 0===E?void 0:E.registerPlugin)||((Mt,Wt={})=>{const ao=un.get(Mt);if(ao)return console.warn(`Capacitor plugin "${Mt}" already registered. Cannot register plugins twice.`),ao.proxy;const zo=ve(),qo=$t(Mt);let So;const ka=function(){var In=(0,N.A)(function*(){return!So&&zo in Wt?So=So="function"==typeof Wt[zo]?yield Wt[zo]():Wt[zo]:null!==T&&!So&&"web"in Wt&&(So=So="function"==typeof Wt.web?yield Wt.web():Wt.web),So});return function(){return In.apply(this,arguments)}}(),ot=In=>{let yr;const Br=(...Hr)=>{const Ko=ka().then(_r=>{const ts=((In,yr)=>{var Br,Hr;if(!qo){if(In)return null===(Hr=In[yr])||void 0===Hr?void 0:Hr.bind(In);throw new Pl(`"${Mt}" plugin is not implemented on ${zo}`,xl.Unimplemented)}{const Ko=qo?.methods.find(_r=>yr===_r.name);if(Ko)return"promise"===Ko.rtype?_r=>x.nativePromise(Mt,yr.toString(),_r):(_r,ts)=>x.nativeCallback(Mt,yr.toString(),_r,ts);if(In)return null===(Br=In[yr])||void 0===Br?void 0:Br.bind(In)}})(_r,In);if(ts){const Fa=ts(...Hr);return yr=Fa?.remove,Fa}throw new Pl(`"${Mt}.${In}()" is not implemented on ${zo}`,xl.Unimplemented)});return"addListener"===In&&(Ko.remove=(0,N.A)(function*(){return yr()})),Ko};return Br.toString=()=>`${In.toString()}() { [capacitor code] }`,Object.defineProperty(Br,"name",{value:In,writable:!1,configurable:!1}),Br},Ul=ot("addListener"),jl=ot("removeListener"),es=(In,yr)=>{const Br=Ul({eventName:In},yr),Hr=function(){var _r=(0,N.A)(function*(){const ts=yield Br;jl({eventName:In,callbackId:ts},yr)});return function(){return _r.apply(this,arguments)}}(),Ko=new Promise(_r=>Br.then(()=>_r({remove:Hr})));return Ko.remove=(0,N.A)(function*(){console.warn("Using addListener() without 'await' is deprecated."),yield Hr()}),Ko},Od=new Proxy({},{get(In,yr){switch(yr){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return qo?es:Ul;case"removeListener":return jl;default:return ot(yr)}}});return V[Mt]=Od,un.set(Mt,{name:Mt,proxy:Od,platforms:new Set([...Object.keys(Wt),...qo?[zo]:[]])}),Od});return x.convertFileSrc||(x.convertFileSrc=Mt=>Mt),x.getPlatform=ve,x.handleError=Mt=>i.console.error(Mt),x.isNativePlatform=_t,x.isPluginAvailable=ht,x.pluginMethodNoop=(Mt,Wt,ao)=>Promise.reject(`${ao} does not have an implementation of "${Wt}".`),x.registerPlugin=Qn,x.Exception=Pl,x.DEBUG=!!x.DEBUG,x.isLoggingEnabled=!!x.isLoggingEnabled,x.platform=x.getPlatform(),x.isNative=x.isNativePlatform(),x},Bc=(i=>i.Capacitor=By(i))(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),cm=Bc.registerPlugin;class um{constructor(s){this.listeners={},this.windowListeners={},s&&(console.warn(`Capacitor WebPlugin "${s.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=s)}addListener(s,a){var u=this;this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(a);const E=this.windowListeners[s];E&&!E.registered&&this.addWindowListener(E);const T=function(){var V=(0,N.A)(function*(){return u.removeListener(s,a)});return function(){return V.apply(this,arguments)}}(),x=Promise.resolve({remove:T});return Object.defineProperty(x,"remove",{value:(V=(0,N.A)(function*(){console.warn("Using addListener() without 'await' is deprecated."),yield T()}),function(){return V.apply(this,arguments)})}),x;var V}removeAllListeners(){var s=this;return(0,N.A)(function*(){s.listeners={};for(const a in s.windowListeners)s.removeWindowListener(s.windowListeners[a]);s.windowListeners={}})()}notifyListeners(s,a){const u=this.listeners[s];u&&u.forEach(m=>m(a))}hasListeners(s){return!!this.listeners[s].length}registerWindowListener(s,a){this.windowListeners[a]={registered:!1,windowEventName:s,pluginEventName:a,handler:u=>{this.notifyListeners(a,u)}}}unimplemented(s="not implemented"){return new Bc.Exception(s,xl.Unimplemented)}unavailable(s="not available"){return new Bc.Exception(s,xl.Unavailable)}removeListener(s,a){var u=this;return(0,N.A)(function*(){const m=u.listeners[s];if(!m)return;const E=m.indexOf(a);u.listeners[s].splice(E,1),u.listeners[s].length||u.removeWindowListener(u.windowListeners[s])})()}addWindowListener(s){window.addEventListener(s.windowEventName,s.handler),s.registered=!0}removeWindowListener(s){s&&(window.removeEventListener(s.windowEventName,s.handler),s.registered=!1)}}const kl=i=>encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Fl=i=>i.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Td extends um{getCookies(){return(0,N.A)(function*(){const s=document.cookie,a={};return s.split(";").forEach(u=>{if(u.length<=0)return;let[m,E]=u.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");m=Fl(m).trim(),E=Fl(E).trim(),a[m]=E}),a})()}setCookie(s){return(0,N.A)(function*(){try{const a=kl(s.key),u=kl(s.value),m=`; expires=${(s.expires||"").replace("expires=","")}`,E=(s.path||"/").replace("path=",""),T=null!=s.url&&s.url.length>0?`domain=${s.url}`:"";document.cookie=`${a}=${u||""}${m}; path=${E}; ${T};`}catch(a){return Promise.reject(a)}})()}deleteCookie(s){return(0,N.A)(function*(){try{document.cookie=`${s.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}})()}clearCookies(){return(0,N.A)(function*(){try{const s=document.cookie.split(";")||[];for(const a of s)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${(new Date).toUTCString()};path=/`)}catch(s){return Promise.reject(s)}})()}clearAllCookies(){var s=this;return(0,N.A)(function*(){try{yield s.clearCookies()}catch(a){return Promise.reject(a)}})()}}cm("CapacitorCookies",{web:()=>new Td});const Vh=function(){var i=(0,N.A)(function*(s){return new Promise((a,u)=>{const m=new FileReader;m.onload=()=>{const E=m.result;a(E.indexOf(",")>=0?E.split(",")[1]:E)},m.onerror=E=>u(E),m.readAsDataURL(s)})});return function(a){return i.apply(this,arguments)}}();class xa extends um{request(s){return(0,N.A)(function*(){const a=((i,s={})=>{const a=Object.assign({method:i.method||"GET",headers:i.headers},s),m=((i={})=>{const s=Object.keys(i);return Object.keys(i).map(m=>m.toLocaleLowerCase()).reduce((m,E,T)=>(m[E]=i[s[T]],m),{})})(i.headers)["content-type"]||"";if("string"==typeof i.data)a.body=i.data;else if(m.includes("application/x-www-form-urlencoded")){const E=new URLSearchParams;for(const[T,x]of Object.entries(i.data||{}))E.set(T,x);a.body=E.toString()}else if(m.includes("multipart/form-data")||i.data instanceof FormData){const E=new FormData;if(i.data instanceof FormData)i.data.forEach((x,V)=>{E.append(V,x)});else for(const x of Object.keys(i.data))E.append(x,i.data[x]);a.body=E;const T=new Headers(a.headers);T.delete("content-type"),a.headers=T}else(m.includes("application/json")||"object"==typeof i.data)&&(a.body=JSON.stringify(i.data));return a})(s,s.webFetchExtra),u=((i,s=!0)=>i?Object.entries(i).reduce((u,m)=>{const[E,T]=m;let x,V;return Array.isArray(T)?(V="",T.forEach(z=>{x=s?encodeURIComponent(z):z,V+=`${E}=${x}&`}),V.slice(0,-1)):(x=s?encodeURIComponent(T):T,V=`${E}=${x}`),`${u}&${V}`},"").substr(1):null)(s.params,s.shouldEncodeUrlParams),m=u?`${s.url}?${u}`:s.url,E=yield fetch(m,a),T=E.headers.get("content-type")||"";let V,z,{responseType:x="text"}=E.ok?s:{};switch(T.includes("application/json")&&(x="json"),x){case"arraybuffer":case"blob":z=yield E.blob(),V=yield Vh(z);break;case"json":V=yield E.json();break;default:V=yield E.text()}const fe={};return E.headers.forEach((ve,Oe)=>{fe[Oe]=ve}),{data:V,headers:fe,status:E.status,url:E.url}})()}get(s){var a=this;return(0,N.A)(function*(){return a.request(Object.assign(Object.assign({},s),{method:"GET"}))})()}post(s){var a=this;return(0,N.A)(function*(){return a.request(Object.assign(Object.assign({},s),{method:"POST"}))})()}put(s){var a=this;return(0,N.A)(function*(){return a.request(Object.assign(Object.assign({},s),{method:"PUT"}))})()}patch(s){var a=this;return(0,N.A)(function*(){return a.request(Object.assign(Object.assign({},s),{method:"PATCH"}))})()}delete(s){var a=this;return(0,N.A)(function*(){return a.request(Object.assign(Object.assign({},s),{method:"DELETE"}))})()}}cm("CapacitorHttp",{web:()=>new xa});const so='\n .flex {\n flex: 1;\n }\n\n .hidden {\n display: none !important;\n }\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .column {\n display: flex;\n flex-direction: column;\n }\n\n .card {\n border: 1px solid rgba(0, 0, 0, 0.12);\n border-radius: 4px;\n background-color: white;\n margin: 12px 6px;\n }\n\n .card .card-status {\n display: block;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n margin-left: 8px;\n background-color: #f2f2f2;\n }\n .card .card-status.error {\n background-color: #ef5350;\n }\n .card .card-status.success {\n background-color: #66bb6a;\n }\n\n .card .card-title {\n padding: 16px;\n font-size: 20px;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.87);\n align-items: center;\n }\n\n .card .box {\n height: 200px;\n border-top: 1px solid lightgray;\n word-break: break-all;\n overflow: auto;\n background-color: #f2f2f2;\n padding: 12px;\n }\n .card .box pre {\n margin: 0;\n }\n\n .card .card-actions {\n padding: 0 14px 8px 14px;\n min-height: 50px;\n }\n .card .card-actions .input {\n display: flex;\n align-items: center;\n }\n .card .card-actions .input:not(:last-child) {\n margin-bottom: 8px;\n }\n .card .card-actions .input label {\n width: 125px;\n text-align: right;\n margin-right: 14px;\n }\n .card .card-actions .input input {\n padding: 4px;\n }\n\n .json-key {\n color: rgb(124, 77, 255);\n }\n\n .json-value {\n color: rgb(67, 122, 237);\n }\n\n .json-string {\n color: rgb(83, 160, 83);\n }\n\n .json-date {\n color: rgb(200, 56, 198);\n }\n\n input {\n color: #5e35b1;\n padding: 10px;\n border: 1px solid #0000001f;\n border-radius: 4px;\n font-size: 14px;\n }\n\n input:invalid {\n border-color: #f44336;\n }\n\n input[type="checkbox"] {\n margin-right: 10px;\n }\n\n select {\n color: #5e35b1;\n padding: 8px 6px;\n border: 1px solid #0000001f;\n border-radius: 4px;\n }\n\n @media only screen and (max-width: 600px) {\n :host {\n padding: 0 !important;\n padding-bottom: 24px !important;\n }\n\n :host .card {\n border-left: 0;\n border-right: 0;\n border-radius: 0;\n margin: 0;\n margin-bottom: 6px;\n }\n }\n',Pa=(i,s=[])=>i?JSON.stringify(i,null,2).replace(/&/g,"&").replace(/\\"/g,""").replace(//g,">").replace(/^( *)("[\w-]+": )?("[^"]*"|[\w.+-]*)?([,[{])?$/gm,(m,E,T,x,V)=>{let z=E||"";const fe=T?T.replace(/[": ]/g,""):void 0;if(fe&&(z+=`${fe}: `),x&&(z+=`${x}`,fe&&s.includes(fe))){const ve=new Date(1e3*Number(x)),Oe=`${ve.toDateString()}, ${ve.toLocaleTimeString()}`;Oe&&(z+=` (${Oe})`)}return z+(V||"")}):"",pm=document.createElement("template");pm.innerHTML=`\n \n\n
\n
\n\n \n \n \n \n \n \n \n \n\n
\n \u{1f6e1}\ufe0fDemo app { }\n
\u{1f448} choose an implementation
\n
\n\n
\n \n \n \n
\n\n
\n
\n`;class gm extends HTMLElement{constructor(){super(),this.listeners=[],this.attachShadow({mode:"open"}),this.shadowRoot?.appendChild(document.importNode(pm.content,!0)),this.implSelectEl=this.shadowRoot.querySelector("#implementation-select"),this.statusEl=this.shadowRoot.querySelector(".status"),this.versionEl=this.shadowRoot.querySelector(".version"),this.loginButtonEl=this.shadowRoot.querySelector("#login-button"),this.logoutButtonEl=this.shadowRoot.querySelector("#logout-button"),this.silentRenewButtonEl=this.shadowRoot.querySelector("#silent-renew-button")}set isRenewing(s){this.statusEl&&this.statusEl.classList[s?"add":"remove"]("loading")}set isAuthenticated(s){this.statusEl&&null!==s&&(this.statusEl.classList.remove("loading"),this.statusEl.title=s?"Authenticated":"Not authenticated",this.statusEl.classList[s?"add":"remove"]("authenticated"),this.statusEl.classList[s?"remove":"add"]("not-authenticated"))}connectedCallback(){if(window.location.href.includes(":4200")){const a=document.createElement("option");a.textContent="localhost",this.implSelectEl.appendChild(a)}else{window.appSettings.getImplementations().forEach(u=>{const m=document.createElement("option");m.value=String(u.label),m.textContent=u.label,this.implSelectEl.appendChild(m)});const a=()=>{window.location.href=window.appSettings.getImplementations()[this.implSelectEl.selectedIndex].demoUrl};this.implSelectEl.addEventListener("change",a),this.listeners.push(()=>this.implSelectEl.removeEventListener("change",a))}const s=()=>{this.shadowRoot?.querySelector("header .title .tip")?.remove(),window.appSettings.setShowTip(!1)};window.appSettings.get().showTip?(this.implSelectEl.addEventListener("click",s,{once:!0}),this.listeners.push(()=>this.implSelectEl.removeEventListener("click",s))):s(),this.refreshImplementation(),this.addEventListeners()}disconnectedCallback(){this.listeners.forEach(s=>s())}addEventListeners(){const s=()=>this.dispatchEvent(new Event("login",{bubbles:!0,composed:!0}));this.loginButtonEl?.addEventListener("click",s);const a=()=>this.dispatchEvent(new Event("logout",{bubbles:!0,composed:!0}));this.logoutButtonEl?.addEventListener("click",a);const u=()=>this.dispatchEvent(new Event("silentRenew",{bubbles:!0,composed:!0}));this.silentRenewButtonEl?.addEventListener("click",u),this.listeners.push(()=>this.loginButtonEl?.removeEventListener("click",s),()=>this.logoutButtonEl?.removeEventListener("click",a),()=>this.silentRenewButtonEl?.removeEventListener("click",u))}refreshImplementation(){const s=window.appSettings.getImplementations();if(window.location.href.includes(":4200"))this.implSelectEl.selectedIndex=0,this.versionEl.innerHTML="@localhost";else{const a=s.findIndex(m=>window.location.href.includes(m.demoUrl)),u=-1!==a?s[a]:s[0];this.implSelectEl.selectedIndex=-1!==a?a:0,this.versionEl.innerHTML=u.version}}}window.customElements.define("demo-app-header",gm);const mm=document.createElement("template");mm.innerHTML=`\n \n\n \n \n
\n \n
\n`;class $y extends HTMLElement{constructor(){super(),this.listeners=[],this.tabs=[],this.views=[],this.currentTabIndex=-1,this.attachShadow({mode:"open"}),this.shadowRoot?.appendChild(document.importNode(mm.content,!0)),this.tabsContentEl=this.shadowRoot.querySelector(".tabs-content"),this.demoAppHeaderEl=this.shadowRoot.querySelector("demo-app-header")}set isRenewing(s){this.demoAppHeaderEl.isRenewing=s}set isAuthenticated(s){this.demoAppHeaderEl.isAuthenticated=s}connectedCallback(){this.drawTabs(),this.showView(window.appSettings?window.appSettings.get().currentTabIndex:0)}disconnectedCallback(){this.listeners.forEach(s=>s())}drawTabs(){const s=this.shadowRoot.querySelector("#views"),a=this.shadowRoot.querySelector("#tabs");s&&a&&(this.views=s.assignedElements(),this.views.forEach((u,m)=>{u.style.display="none";const E=document.createElement("a");E.textContent=u.getAttribute("tabLabel")||"?";const T=()=>this.showView(m);E.addEventListener("click",T),this.listeners.push(()=>E.removeEventListener("click",T)),a.appendChild(E),this.tabs.push(E)}))}showView(s){this.currentTabIndex!==s&&(this.currentTabIndex=s,this.tabs.forEach((a,u)=>{a.classList[u!==s?"remove":"add"]("selected")}),this.views.forEach((a,u)=>{a.style.display=u!==s?"none":"flex"}),this.tabsContentEl?.scrollTo(0,0),window.appSettings.setCurrentTabIndex(s))}}window.customElements.define("demo-app-main",$y);const Ad=document.createElement("template");Ad.innerHTML=`\n \n\n
\n
\n APIs access\n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n
\n \n
\n            
\n
\n
\n\n \n`;class jh extends HTMLElement{constructor(){super(),this.listeners=[],this.attachShadow({mode:"open"}),this.shadowRoot?.appendChild(document.importNode(Ad.content,!0)),this.apiStatusEl=this.shadowRoot.querySelector("#api-status"),this.apiResponseEl=this.shadowRoot.querySelector("#api-response"),this.apiUrlEl=this.shadowRoot.querySelector("#api-url-input"),this.apiHeadersEl=this.shadowRoot.querySelector("#api-headers-input")}connectedCallback(){const s=this.shadowRoot?.querySelector("#api-get-button"),a=()=>{const T=new CustomEvent("api",{bubbles:!0,composed:!0,detail:{url:this.apiUrlEl.value,headers:this.apiHeadersEl.value}});return this.dispatchEvent(T)};s?.addEventListener("click",a);const u=()=>this.saveSettings({privateApiUrl:this.apiUrlEl.value});this.apiUrlEl?.addEventListener("input",u);const m=()=>this.saveSettings({privateApiHeaders:this.apiHeadersEl.value});this.apiHeadersEl?.addEventListener("input",m),this.listeners.push(()=>s?.removeEventListener("click",a),()=>this.apiUrlEl?.removeEventListener("input",u),()=>this.apiHeadersEl?.removeEventListener("input",m));const{otherSettings:E}=window.appSettings.getCurrentUserSettings();this.apiUrlEl.value=E?.privateApiUrl,this.apiHeadersEl.value=E?.privateApiHeaders}disconnectedCallback(){this.listeners.forEach(s=>s())}setApiStatus(s,a){this.apiStatusEl.classList.remove(a?"success":"error"),this.apiStatusEl.classList.add(a?"error":"success"),this.apiResponseEl.innerHTML=Pa(s)}saveSettings(s){const a=window.appSettings.getCurrentUserSettings();a.otherSettings={...a.otherSettings,...s},window.appSettings.addOrUpdateUserSettings(a)}}window.customElements.define("demo-app-playground",jh);const vm=document.createElement("template");vm.innerHTML=`\n \n\n
\n
\n
Authenticated
\n \n
\n            
\n
\n\n
\n
User session
\n \n
\n            
\n
\n\n
\n
Access token
\n \n
\n                
\n            
\n
\n\n
\n
Id token
\n \n
\n                
\n            
\n
\n\n
\n
User profile
\n \n
\n            
\n
\n
\n`;class Hc extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot?.appendChild(document.importNode(vm.content,!0)),this.isAuthenticated=!1,this.userSession=void 0,this.accessToken=void 0,this.accessTokenDecoded=void 0,this.idToken=void 0,this.idTokenDecoded=void 0,this.userProfile=void 0}set isAuthenticated(s){null!==s&&this.update("#isAuthenticated",s)}set userSession(s){this.update("#userSession",Pa(s,["expires_at"]))}set accessToken(s){this.update("#accessToken",s)}set accessTokenDecoded(s){const a="string"!=typeof s?Pa(s,["exp","iat","auth_time"]):"(no decoded info as it is not a JWT token)";this.update("#accessTokenDecoded",a)}set idToken(s){this.update("#idToken",s)}set idTokenDecoded(s){this.update("#idTokenDecoded",Pa(s,["exp","iat","auth_time"]))}set userProfile(s){this.update("#userProfile",Pa(s))}update(s,a){const u=this.shadowRoot?.querySelector(s);u&&(null==a||""===a?u.closest(".info")?.classList.add("hidden"):(u.closest(".info")?.classList.remove("hidden"),u.innerHTML=String(a)))}}window.customElements.define("demo-app-debug",Hc);const $c=document.createElement("template");$c.innerHTML=`\n \n\n
\n \n
\n \n
\n
\n\n \n\n
\n
\n DELETE\n
\n
\n \n \n
\n
\n
\n`;class Rd extends HTMLElement{constructor(){super(),this.listeners=[],this.formIsDirty=!1,this.formIsNew=!1,this.attachShadow({mode:"open"}),this.shadowRoot?.appendChild(document.importNode($c.content,!0))}connectedCallback(){this.formEl=this.shadowRoot.querySelector("form"),this.formContentEl=this.shadowRoot.querySelector(".form-content"),this.selectEl=this.shadowRoot.querySelector("#settings-select"),this.settingsNameEl=this.shadowRoot.querySelector("#settingsName");const s=ve=>{!this.formIsDirty&&"settings-select"!==ve.target.id&&(this.formIsDirty=!0,this.classList.add("dirty"))};this.formEl.addEventListener("input",s),this.listeners.push(()=>this.formEl.removeEventListener("input",s)),this.refreshSelect();const a=()=>this.loadSettings(this.selectEl.value);this.selectEl?.addEventListener("change",a),this.listeners.push(()=>this.selectEl.removeEventListener("change",a));const u=this.shadowRoot?.querySelector("#add-settings-button"),m=()=>this.add();u?.addEventListener("click",m),this.listeners.push(()=>u?.removeEventListener("click",m));const E=this.shadowRoot?.querySelector("#delete-settings-button"),T=()=>this.delete();E?.addEventListener("click",T),this.listeners.push(()=>E?.removeEventListener("click",T));const x=this.shadowRoot?.querySelector("#save-settings-button"),V=()=>this.saveAndReload();x?.addEventListener("click",V),this.listeners.push(()=>x?.removeEventListener("click",V));const z=this.shadowRoot?.querySelector("#cancel-settings-button"),fe=()=>this.cancel();z?.addEventListener("click",fe),this.listeners.push(()=>z?.removeEventListener("click",fe)),this.refreshFormContent(window.appSettings.getCurrentUserSettings())}disconnectedCallback(){this.listeners.forEach(s=>s())}loadSettings(s){window.appSettings.setCurrentUserSettings(s),location.reload()}add(){const s="New settings",a=document.createElement("option");a.selected=!0,a.value=s,a.textContent=s,this.selectEl.appendChild(a),this.formIsNew=!0,this.formIsDirty=!0,this.classList.add("dirty"),this.refreshFormContent({name:s,librarySettings:{}})}delete(){window.appSettings.deleteCurrentUserSettings(),location.reload()}cancel(){this.formIsNew=!1,this.formIsDirty=!1,this.classList.remove("dirty"),this.refreshSelect(),this.refreshFormContent(window.appSettings.getCurrentUserSettings())}setPathValue(s,a,u){const m=a.split(".");m.reduce((E,T,x)=>(x===m.length-1?E[T]=u:Object.prototype.hasOwnProperty.call(E,T)||(E[T]={}),E[T]),s)}getPathValue(s,a){return a.split(".").reduce((u,m)=>u&&u[m],s)}refreshSelect(){this.selectEl.innerHTML="";const{userSettings:s,currentUserSettingsId:a}=window.appSettings.get();s.sort((u,m)=>u.name.localeCompare(m.name)).forEach(u=>{const m=document.createElement("option");m.selected=u.name===a,m.value=String(u.name),m.textContent=u.name,this.selectEl.appendChild(m)})}refreshFormContent(s){this.formContentEl.innerHTML="";const{librarySettingsDefinition:a}=window.appSettings.get(),{name:u,librarySettings:m}=s;this.settingsNameEl.value=u,a.sort((E,T)=>(T._sortIndex||0)-(E._sortIndex||0)).forEach(E=>{const T=document.createElement("div");this.formContentEl.prepend(T);const x=document.createElement("label");x.htmlFor=E.name.replace(".",""),x.textContent=`${E.label}${E.required?" *":""}`;const V=document.createElement("list"===E.type?"select":"input");switch(V.id=E.name.replace(".",""),V.name=E.name.replace(".",""),V.required=!0===E.required,E.type){case"boolean":V.checked=this.getPathValue(m,E.name),V.type="checkbox",T.appendChild(V),T.appendChild(x);break;case"list":E.values?.forEach(z=>{const fe=document.createElement("option");fe.value=String(z.value),fe.textContent=z.label,V.appendChild(fe)}),V.value=this.getPathValue(m,E.name),V.classList.add("flex"),T.classList.add("input","column"),T.appendChild(x),T.appendChild(V);break;default:{const z=this.getPathValue(m,E.name);V.value="json"===E.type?z?JSON.stringify(z):"":z??"",T.classList.add("input","column"),T.appendChild(x),T.appendChild(V);break}}})}saveAndReload(){if(this.formEl.reportValidity()){const{librarySettingsDefinition:s}=window.appSettings.get(),a=this.formIsNew?{name:"",librarySettings:{}}:window.appSettings.getCurrentUserSettings();a.name=this.settingsNameEl.value,s.forEach(u=>{const m=this.shadowRoot?.querySelector(`#${u.name.replace(".","")}`);let E;switch(u.type){case"boolean":E=m.checked;break;case"list":default:E=m.value;break;case"json":try{const T=m.value;T&&""!==T.trim()&&(E=JSON.parse(T))}catch(T){console.error(T)}}this.setPathValue(a.librarySettings,u.name,E)}),window.appSettings.addOrUpdateUserSettings(a),this.formIsNew&&window.appSettings.setCurrentUserSettings(a.name),location.reload()}}}window.customElements.define("demo-app-settings",Rd);const Bh=JSON.parse('{"UU":"@badisi/auth-js","TB":"https://github.com/Badisi/auth-js/tree/main/projects/auth-js"}'),Yi=JSON.parse('{"UU":"@badisi/ngx-auth","rE":"0.0.0-semantically-released","TB":"https://github.com/Badisi/auth-js/tree/main/projects/ngx-auth"}'),Wc=[{name:"authorityUrl",label:"Authority url",type:"string",required:!0},{name:"clientId",label:"Client id",type:"string",required:!0},{name:"mobileScheme",label:"Custom mobile scheme name",type:"string"},{name:"scope",label:"Scope",type:"string"},{name:"internal.extraQueryParams",label:"Extra query params",type:"json"},{name:"desktopNavigationType",label:"Desktop navigation type",type:"list",values:[{label:"REDIRECT",value:Or.REDIRECT},{label:"POPUP",value:Or.POPUP}]},{name:"logLevel",label:"Log level",type:"list",values:[{label:"NONE",value:qn.NONE},{label:"ERROR",value:qn.ERROR},{label:"WARN",value:qn.WARN},{label:"INFO",value:qn.INFO},{label:"DEBUG",value:qn.DEBUG}]},{name:"loginRequired",label:"Login required",type:"boolean"},{name:"retrieveUserSession",label:"Retrieve user's session",type:"boolean"},{name:"loadUserInfo",label:"Load user's info",type:"boolean"},{name:"automaticSilentRenew",label:"Automatic silent renew",type:"boolean"},{name:"automaticLoginOn401",label:"Automatic login on 401",type:"boolean"},{name:"automaticInjectToken",label:"Automatic inject token",type:"boolean"}];Wc.splice(3,0,{name:"authGuardRedirectUrl",label:"AuthGuard redirect url",type:"string"});const Gc=Wc,Hh=["demoAppPlayground"],Dm=["queryParamsInput"],Ll=[{path:"",children:[{path:"",component:(()=>{class i{constructor(){this.router=(0,w.WQX)(Ke.Ix),this.authService=(0,w.WQX)(bc),this.httpClient=(0,w.WQX)(oe)}ngAfterViewInit(){setTimeout(()=>{const a=window.appSettings.getCurrentUserSettings().otherSettings;if(this.roles=a?.roles,this.queryParams=a?.queryParams,this.queryParams){let u="";Object.entries(this.queryParams).forEach(([m,E],T)=>{T>0&&(u+="&"),u+=`${m}=${E}`}),this.queryParamsInputEl.nativeElement.value=u}})}callPrivateApi(a){const{url:u,headers:m}=a.detail;if(u){let E=new Se;m?.split(";").forEach(x=>{if(x){const V=x.split(":");E=E.append(V[0]?.trim(),V[1]?.trim()||"")}});const T=this.demoAppPlaygroundEl?.nativeElement;this.httpClient.get(u,m?{headers:E}:{}).subscribe({next:x=>T?.setApiStatus(x,!1),error:x=>T?.setApiStatus(x,!0)})}}saveSettings(){(this.demoAppPlaygroundEl?.nativeElement).saveSettings({roles:this.roles,queryParams:this.queryParams})}onQueryParamsInputChange(a){const u={};a?.split("&").forEach(m=>{const E=m.split("=");2===E.length&&(u[E[0]]=E[1])}),this.queryParams=u,this.saveSettings()}static#e=this.\u0275fac=function(u){return new(u||i)};static#t=this.\u0275cmp=w.VBU({type:i,selectors:[["app-demo"]],viewQuery:function(u,m){if(1&u&&(w.GBs(Hh,5),w.GBs(Dm,5)),2&u){let E;w.mGM(E=w.lsd())&&(m.demoAppPlaygroundEl=E.first),w.mGM(E=w.lsd())&&(m.queryParamsInputEl=E.first)}},standalone:!0,features:[w.aNF],decls:48,vars:32,consts:[["demoAppPlayground",""],["queryParamsInput",""],[3,"login","logout","silentRenew","isRenewing","isAuthenticated"],["tabLabel","Playground",3,"api"],[1,"card","routes"],[1,"card-title"],[1,"card-actions","column"],[1,"route","query-params"],[1,"info"],["placeholder","param1=one¶m2=two",3,"input"],[1,"route"],["routerLink","/",3,"queryParams"],["routerLink","/public",3,"queryParams"],["routerLink","/private",3,"queryParams"],["routerLink","/protected",3,"queryParams"],["id","roles-input",3,"input","keydown.enter","ngModelChange","ngModel"],[1,"box"],["tabLabel","Debug",3,"isAuthenticated","userProfile","userSession","idToken","idTokenDecoded","accessToken","accessTokenDecoded"],["tabLabel","Settings"]],template:function(u,m){if(1&u){const E=w.RV6();w.j41(0,"demo-app-main",2),w.nI1(1,"async"),w.nI1(2,"async"),w.bIt("login",function(){return w.eBV(E),w.Njj(m.authService.login())})("logout",function(){return w.eBV(E),w.Njj(m.authService.logout({redirectUrl:"/"}))})("silentRenew",function(){return w.eBV(E),w.Njj(m.authService.renew())}),w.j41(3,"demo-app-playground",3,0),w.bIt("api",function(x){return w.eBV(E),w.Njj(m.callPrivateApi(x))}),w.j41(5,"div",4)(6,"div",5),w.EFF(7,"Routes access"),w.k0s(),w.j41(8,"div",6)(9,"div",7)(10,"div",8)(11,"label"),w.EFF(12,"Query params"),w.k0s(),w.j41(13,"input",9,1),w.bIt("input",function(){w.eBV(E);const x=w.sdS(14);return w.Njj(m.onQueryParamsInputChange(x.value))}),w.k0s()()(),w.j41(15,"div",10)(16,"button",11),w.EFF(17,"HOME"),w.k0s(),w.j41(18,"div",8),w.EFF(19,"Home page"),w.k0s()(),w.j41(20,"div",10)(21,"button",12),w.EFF(22,"PUBLIC"),w.k0s(),w.j41(23,"div",8),w.EFF(24,"Public content (no login required)"),w.k0s()(),w.j41(25,"div",10)(26,"button",13),w.EFF(27,"PRIVATE"),w.k0s(),w.j41(28,"div",8),w.EFF(29,"Private content (login required)"),w.k0s()(),w.j41(30,"div",10)(31,"button",14),w.EFF(32,"PROTECTED"),w.k0s(),w.j41(33,"div",8),w.EFF(34,"Protected content (login required + role(s): "),w.j41(35,"input",15),w.bIt("input",function(){return w.eBV(E),w.Njj(m.saveSettings())})("keydown.enter",function(){return w.eBV(E),w.Njj(m.router.navigateByUrl("/protected"))}),w.mxI("ngModelChange",function(x){return w.eBV(E),w.DH7(m.roles,x)||(m.roles=x),w.Njj(x)}),w.k0s(),w.EFF(36,") "),w.k0s()()(),w.j41(37,"div",16),w.nrm(38,"router-outlet"),w.k0s()()(),w.nrm(39,"demo-app-debug",17),w.nI1(40,"async"),w.nI1(41,"async"),w.nI1(42,"async"),w.nI1(43,"async"),w.nI1(44,"async"),w.nI1(45,"async"),w.nI1(46,"async"),w.nrm(47,"demo-app-settings",18),w.k0s()}2&u&&(w.Y8G("isRenewing",w.bMT(1,14,m.authService.isRenewing$))("isAuthenticated",w.bMT(2,16,m.authService.isAuthenticated$)),w.R7$(16),w.Y8G("queryParams",m.queryParams),w.R7$(5),w.Y8G("queryParams",m.queryParams),w.R7$(5),w.Y8G("queryParams",m.queryParams),w.R7$(5),w.Y8G("queryParams",m.queryParams),w.R7$(4),w.R50("ngModel",m.roles),w.R7$(4),w.Y8G("isAuthenticated",w.bMT(40,18,m.authService.isAuthenticated$))("userProfile",w.bMT(41,20,m.authService.userProfile$))("userSession",w.bMT(42,22,m.authService.userSession$))("idToken",w.bMT(43,24,m.authService.idToken$))("idTokenDecoded",w.bMT(44,26,m.authService.idTokenDecoded$))("accessToken",w.bMT(45,28,m.authService.accessToken$))("accessTokenDecoded",w.bMT(46,30,m.authService.accessTokenDecoded$)))},dependencies:[se.Jj,am,Ia,dd,Fc,Ke.n3,Ke.Wk],styles:[":host .card.routes{margin-top:20px}:host .card.routes .route{display:flex;align-items:center}:host .card.routes .route.query-params{margin:0 0 10px 10px}:host .card.routes .route.query-params label{font-size:16px;color:#000;margin-right:12px}:host .card.routes .route.query-params input{width:500px}:host .card.routes .route button{padding:2px 10px;min-width:104px;margin:8px 12px 8px 8px}:host .card.routes .route input{margin:0 2px;padding:4px}:host .card.routes .route .info{padding-bottom:2px;font-size:14px;line-height:22px;text-align:left;color:#0000008a}:host .card.routes .box{height:100px}@media only screen and (max-width: 600px){:host .card.routes{margin-top:12px}:host .card.routes .route{margin-left:3px!important}:host .card.routes .route.query-params .info{display:flex;flex-direction:column;flex:1;gap:8px}:host .card.routes .route.query-params .info input{margin:0;width:inherit;align-self:normal}:host .card.routes .route #roles-input{width:90%}:host .card.routes .route button{margin-left:3px}}\n",".flex{flex:1}.hidden{display:none!important}.row{display:flex;flex-direction:row}.column{display:flex;flex-direction:column}.card{border:1px solid rgba(0,0,0,.12);border-radius:4px;background-color:#fff;margin:12px 6px}.card .card-status{display:block;width:10px;height:10px;border-radius:50%;margin-left:8px;background-color:#f2f2f2}.card .card-status.error{background-color:#ef5350}.card .card-status.success{background-color:#66bb6a}.card .card-title{padding:16px;font-size:20px;font-weight:500;color:#000000de;align-items:center}.card .box{height:200px;border-top:1px solid lightgray;word-break:break-all;overflow:auto;background-color:#f2f2f2;padding:12px}.card .box pre{margin:0}.card .card-actions{padding:0 14px 8px;min-height:50px}.card .card-actions .input{display:flex;align-items:center}.card .card-actions .input:not(:last-child){margin-bottom:8px}.card .card-actions .input label{width:125px;text-align:right;margin-right:14px}.card .card-actions .input input{padding:4px}.json-key{color:#7c4dff}.json-value{color:#437aed}.json-string{color:#53a053}.json-date{color:#c838c6}input{color:#5e35b1;padding:10px;border:1px solid rgba(0,0,0,.1215686275);border-radius:4px;font-size:14px}input:invalid{border-color:#f44336}input[type=checkbox]{margin-right:10px}select{color:#5e35b1;padding:8px 6px;border:1px solid rgba(0,0,0,.1215686275);border-radius:4px}@media only screen and (max-width: 600px){:host{padding:0 0 24px!important}:host .card{border-left:0;border-right:0;border-radius:0;margin:0 0 6px}}\n"],encapsulation:3})}return i})(),children:[{path:"public",loadComponent:()=>O.e(998).then(O.bind(O,1998)).then(i=>i.PageComponent),runGuardsAndResolvers:"always",data:{title:"PUBLIC CONTENT"}},{path:"private",loadComponent:()=>O.e(998).then(O.bind(O,1998)).then(i=>i.PageComponent),runGuardsAndResolvers:"always",canLoad:[ks],canActivate:[ks],canActivateChild:[ks],data:{title:"PRIVATE CONTENT"}},{path:"forbidden",loadComponent:()=>O.e(998).then(O.bind(O,1998)).then(i=>i.PageComponent),runGuardsAndResolvers:"always",data:{title:"ACCESS FORBIDDEN"}},{path:"protected",loadComponent:()=>O.e(998).then(O.bind(O,1998)).then(i=>i.PageComponent),runGuardsAndResolvers:"always",canLoad:[ks],canActivate:[ks],canActivateChild:[ks],data:{title:"PROTECTED CONTENT",authGuardValidator:(i,s)=>{const{otherSettings:a,librarySettings:u}=window.appSettings.getCurrentUserSettings(),m=a&&a.roles?.split(",")||[];let E;if(u.authorityUrl.includes("auth0"))E=s?.["http://ngx-auth.com/roles"];else if(u.authorityUrl.includes("zitadel")){const T=s?.["urn:zitadel:iam:org:project:roles"];E=Object.keys(T??{})}else E=s.resource_access?.account?.roles;return m.every(T=>(E??[]).includes(T))}}}]}]},{path:"**",pathMatch:"full",redirectTo:""}],Vl={providers:[ce(),(0,Ke.lh)(Ll,(0,Ke.Ii)({onSameUrlNavigation:"reload"}))]},zc=new class Nd{constructor(s,a){this.storageKey=s,this.defaultAppSettings=a,this.implementations=[{label:"VanillaJS",demoUrl:"https://badisi.github.io/auth-js/demo-app/auth-js",version:`${Bh.UU}@main`},{label:"Angular",demoUrl:"https://badisi.github.io/auth-js/demo-app/ngx-auth",version:`${Yi.UU}@main`}],this.defaultAppSettings.librarySettingsDefinition.forEach((u,m)=>u._sortIndex=m)}getImplementations(){return this.implementations}setShowTip(s){const a=this.get();a.showTip=s,this.saveAppSettings(a)}setCurrentTabIndex(s){const a=this.get();a.currentTabIndex=s,this.saveAppSettings(a)}addOrUpdateUserSettings(s){const a=this.get(),u=a.userSettings.findIndex(m=>m.name===s.name);-1!==u?a.userSettings[u]=s:a.userSettings.push(s),this.saveAppSettings(a)}deleteCurrentUserSettings(){const s=this.get(),{name:a}=this.getCurrentUserSettings(),u=s.userSettings.findIndex(m=>m.name===a);-1!==u&&(s.userSettings.splice(u,1),delete s.currentUserSettingsId,this.saveAppSettings(s))}setCurrentUserSettings(s){const a=this.get();-1!==a.userSettings.findIndex(m=>m.name===s)&&(a.currentUserSettingsId=s,this.saveAppSettings(a))}getCurrentUserSettings(){const s=this.get(),a=s.userSettings.findIndex(u=>u.name===s.currentUserSettingsId);return-1!==a?s.userSettings[a]:s.userSettings.sort((u,m)=>u.name.localeCompare(m.name))[0]}get(){const s=sessionStorage.getItem(this.storageKey);if(s){const a={...this.defaultAppSettings,...JSON.parse(s)};return this.defaultAppSettings.userSettings.forEach(u=>{a.userSettings.find(m=>m.name===u.name)||a.userSettings.push(u)}),a}return{...this.defaultAppSettings}}saveAppSettings(s){delete s.librarySettingsDefinition,sessionStorage.setItem(this.storageKey,JSON.stringify(s))}}(`ngx-auth:${Yi.rE}:demo-app:settings`,{showTip:!0,currentTabIndex:0,userSettings:((i=!1)=>{const s=((i=!1)=>{const s=[{name:"Auth0",otherSettings:{privateApiUrl:"https://dev-fijd1e9x.us.auth0.com/api/v2/users/auth0|631b171682c639d40cb84d5c",privateApiHeaders:""},librarySettings:{authorityUrl:"https://dev-fijd1e9x.us.auth0.com",clientId:"kRVVEnAWKMpxxpcodl0TqLXfIHgQvmmt",mobileScheme:"demo-app",scope:"openid profile email phone offline_access read:current_user",internal:{extraQueryParams:{audience:"https://dev-fijd1e9x.us.auth0.com/api/v2/"}},desktopNavigationType:Or.REDIRECT,logLevel:qn.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}},{name:"Zitadel",otherSettings:{privateApiUrl:"",privateApiHeaders:""},librarySettings:{authorityUrl:"https://auth-js-0pdipf.zitadel.cloud",clientId:"178200751804317953@demo-app",mobileScheme:"demo-app",scope:"openid profile email phone offline_access",desktopNavigationType:Or.REDIRECT,logLevel:qn.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}}];return i||s.push({name:"Keycloak (local)",otherSettings:{privateApiUrl:"/api/my-api",privateApiHeaders:""},librarySettings:{authorityUrl:"http://localhost:8080/auth/realms/demo",clientId:"demo-app",mobileScheme:"demo-app",scope:"openid profile email phone",desktopNavigationType:Or.REDIRECT,logLevel:qn.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}}),s})(i),a=[{name:"Auth0",otherSettings:{...s[0].otherSettings,roles:"view-profile"},librarySettings:{...s[0].librarySettings,authGuardRedirectUrl:"/forbidden",automaticLoginOn401:!0,automaticInjectToken:!0}},{name:"Zitadel",otherSettings:{...s[1].otherSettings,roles:"view-profile"},librarySettings:{...s[1].librarySettings,authGuardRedirectUrl:"/forbidden",automaticLoginOn401:!0,automaticInjectToken:!0}}];return i||a.push({name:"Keycloak (local)",otherSettings:{...s[s.length-1].otherSettings,roles:"view-profile"},librarySettings:{...s[s.length-1].librarySettings,authGuardRedirectUrl:"/forbidden",automaticLoginOn401:!0,automaticInjectToken:!0}}),a})(!(0,w.naY)()),librarySettingsDefinition:Gc});(()=>{window.appSettings=zc;const i=document.createElement("div");i.innerHTML="Loading...",document.body.appendChild(i),Gf(zc.getCurrentUserSettings().librarySettings).then(s=>{i.replaceWith(document.createElement("app-root")),Vl.providers.push((i=>(0,w.EmA)([i,ks,ce(ke([jr]))]))(s)),(0,C.B8)(yy,Vl).catch(a=>console.error(a))}).catch(s=>{const a=s instanceof Error?s.message:s;i.innerHTML=`${a}
`,document.body.querySelector("#loginButton")?.addEventListener("click",()=>location.reload(),{once:!0})})})()},7656:function(Ue,he,O){var C;Ue.exports=(C=C||function(N,w){var j;if(typeof window<"u"&&window.crypto&&(j=window.crypto),typeof self<"u"&&self.crypto&&(j=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(j=globalThis.crypto),!j&&typeof window<"u"&&window.msCrypto&&(j=window.msCrypto),!j&&typeof global<"u"&&global.crypto&&(j=global.crypto),!j)try{j=O(477)}catch{}var Q=function(){if(j){if("function"==typeof j.getRandomValues)try{return j.getRandomValues(new Uint32Array(1))[0]}catch{}if("function"==typeof j.randomBytes)try{return j.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},De=Object.create||function(){function ie(){}return function(ye){var Be;return ie.prototype=ye,Be=new ie,ie.prototype=null,Be}}(),J={},be=J.lib={},ge=be.Base=function(){return{extend:function(ie){var ye=De(this);return ie&&ye.mixIn(ie),(!ye.hasOwnProperty("init")||this.init===ye.init)&&(ye.init=function(){ye.$super.init.apply(this,arguments)}),ye.init.prototype=ye,ye.$super=this,ye},create:function(){var ie=this.extend();return ie.init.apply(ie,arguments),ie},init:function(){},mixIn:function(ie){for(var ye in ie)ie.hasOwnProperty(ye)&&(this[ye]=ie[ye]);ie.hasOwnProperty("toString")&&(this.toString=ie.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),te=be.WordArray=ge.extend({init:function(ie,ye){ie=this.words=ie||[],this.sigBytes=null!=ye?ye:4*ie.length},toString:function(ie){return(ie||se).stringify(this)},concat:function(ie){var ye=this.words,Be=ie.words,pe=this.sigBytes,de=ie.sigBytes;if(this.clamp(),pe%4)for(var Ce=0;Ce>>2]|=(Be[Ce>>>2]>>>24-Ce%4*8&255)<<24-(pe+Ce)%4*8;else for(var Ae=0;Ae>>2]=Be[Ae>>>2];return this.sigBytes+=de,this},clamp:function(){var ie=this.words,ye=this.sigBytes;ie[ye>>>2]&=4294967295<<32-ye%4*8,ie.length=N.ceil(ye/4)},clone:function(){var ie=ge.clone.call(this);return ie.words=this.words.slice(0),ie},random:function(ie){for(var ye=[],Be=0;Be>>2]>>>24-de%4*8&255;pe.push((Ce>>>4).toString(16)),pe.push((15&Ce).toString(16))}return pe.join("")},parse:function(ie){for(var ye=ie.length,Be=[],pe=0;pe>>3]|=parseInt(ie.substr(pe,2),16)<<24-pe%8*4;return new te.init(Be,ye/2)}},Te=Z.Latin1={stringify:function(ie){for(var ye=ie.words,Be=ie.sigBytes,pe=[],de=0;de>>2]>>>24-de%4*8&255));return pe.join("")},parse:function(ie){for(var ye=ie.length,Be=[],pe=0;pe>>2]|=(255&ie.charCodeAt(pe))<<24-pe%4*8;return new te.init(Be,ye)}},ae=Z.Utf8={stringify:function(ie){try{return decodeURIComponent(escape(Te.stringify(ie)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(ie){return Te.parse(unescape(encodeURIComponent(ie)))}},Se=be.BufferedBlockAlgorithm=ge.extend({reset:function(){this._data=new te.init,this._nDataBytes=0},_append:function(ie){"string"==typeof ie&&(ie=ae.parse(ie)),this._data.concat(ie),this._nDataBytes+=ie.sigBytes},_process:function(ie){var ye,Be=this._data,pe=Be.words,de=Be.sigBytes,Ce=this.blockSize,Ae=de/(4*Ce),Ie=(Ae=ie?N.ceil(Ae):N.max((0|Ae)-this._minBufferSize,0))*Ce,Pe=N.min(4*Ie,de);if(Ie){for(var qe=0;qe>>2]>>>24-Te%4*8&255)<<16|(ge[Te+1>>>2]>>>24-(Te+1)%4*8&255)<<8|ge[Te+2>>>2]>>>24-(Te+2)%4*8&255,ie=0;ie<4&&Te+.75*ie>>6*(3-ie)&63));var ye=Z.charAt(64);if(ye)for(;se.length%4;)se.push(ye);return se.join("")},parse:function(be){var ge=be.length,te=this._map,Z=this._reverseMap;if(!Z){Z=this._reverseMap=[];for(var se=0;se>>6-Te%4*2;Z[se>>>2]|=(ae|Se)<<24-se%4*8,se++}return j.create(Z,se)}(be,ge,Z)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},C.enc.Base64)},627:function(Ue,he,O){Ue.exports=O(7656).enc.Utf8},5168:function(Ue,he,O){var C;Ue.exports=(C=O(7656),function(N){var w=C,j=w.lib,Q=j.WordArray,De=j.Hasher,J=w.algo,be=[],ge=[];!function(){function se(ze){for(var Ze=N.sqrt(ze),ie=2;ie<=Ze;ie++)if(!(ze%ie))return!1;return!0}function Te(ze){return 4294967296*(ze-(0|ze))|0}for(var ae=2,Se=0;Se<64;)se(ae)&&(Se<8&&(be[Se]=Te(N.pow(ae,.5))),ge[Se]=Te(N.pow(ae,1/3)),Se++),ae++}();var te=[],Z=J.SHA256=De.extend({_doReset:function(){this._hash=new Q.init(be.slice(0))},_doProcessBlock:function(se,Te){for(var ae=this._hash.words,Se=ae[0],ze=ae[1],Ze=ae[2],ie=ae[3],ye=ae[4],Be=ae[5],pe=ae[6],de=ae[7],Ce=0;Ce<64;Ce++){if(Ce<16)te[Ce]=0|se[Te+Ce];else{var We=te[Ce-15],Ie=te[Ce-2];te[Ce]=((We<<25|We>>>7)^(We<<14|We>>>18)^We>>>3)+te[Ce-7]+((Ie<<15|Ie>>>17)^(Ie<<13|Ie>>>19)^Ie>>>10)+te[Ce-16]}var Je=Se&ze^Se&Ze^ze&Ze,tn=de+((ye<<26|ye>>>6)^(ye<<21|ye>>>11)^(ye<<7|ye>>>25))+(ye&Be^~ye&pe)+ge[Ce]+te[Ce];de=pe,pe=Be,Be=ye,ye=ie+tn|0,ie=Ze,Ze=ze,ze=Se,Se=tn+(((Se<<30|Se>>>2)^(Se<<19|Se>>>13)^(Se<<10|Se>>>22))+Je)|0}ae[0]=ae[0]+Se|0,ae[1]=ae[1]+ze|0,ae[2]=ae[2]+Ze|0,ae[3]=ae[3]+ie|0,ae[4]=ae[4]+ye|0,ae[5]=ae[5]+Be|0,ae[6]=ae[6]+pe|0,ae[7]=ae[7]+de|0},_doFinalize:function(){var se=this._data,Te=se.words,ae=8*this._nDataBytes,Se=8*se.sigBytes;return Te[Se>>>5]|=128<<24-Se%32,Te[14+(Se+64>>>9<<4)]=N.floor(ae/4294967296),Te[15+(Se+64>>>9<<4)]=ae,se.sigBytes=4*Te.length,this._process(),this._hash},clone:function(){var se=De.clone.call(this);return se._hash=this._hash.clone(),se}});w.SHA256=De._createHelper(Z),w.HmacSHA256=De._createHmacHelper(Z)}(Math),C.SHA256)},4412:(Ue,he,O)=>{"use strict";O.d(he,{t:()=>N});var C=O(1413);class N extends C.B{constructor(j){super(),this._value=j}get value(){return this.getValue()}_subscribe(j){const Q=super._subscribe(j);return!Q.closed&&j.next(this._value),Q}getValue(){const{hasError:j,thrownError:Q,_value:De}=this;if(j)throw Q;return this._throwIfClosed(),De}next(j){super.next(this._value=j)}}},1985:(Ue,he,O)=>{"use strict";O.d(he,{c:()=>be});var C=O(7707),N=O(8359),w=O(3494),j=O(1203),Q=O(1026),De=O(8071),J=O(9786);let be=(()=>{class se{constructor(ae){ae&&(this._subscribe=ae)}lift(ae){const Se=new se;return Se.source=this,Se.operator=ae,Se}subscribe(ae,Se,ze){const Ze=function Z(se){return se&&se instanceof C.vU||function te(se){return se&&(0,De.T)(se.next)&&(0,De.T)(se.error)&&(0,De.T)(se.complete)}(se)&&(0,N.Uv)(se)}(ae)?ae:new C.Ms(ae,Se,ze);return(0,J.Y)(()=>{const{operator:ie,source:ye}=this;Ze.add(ie?ie.call(Ze,ye):ye?this._subscribe(Ze):this._trySubscribe(Ze))}),Ze}_trySubscribe(ae){try{return this._subscribe(ae)}catch(Se){ae.error(Se)}}forEach(ae,Se){return new(Se=ge(Se))((ze,Ze)=>{const ie=new C.Ms({next:ye=>{try{ae(ye)}catch(Be){Ze(Be),ie.unsubscribe()}},error:Ze,complete:ze});this.subscribe(ie)})}_subscribe(ae){var Se;return null===(Se=this.source)||void 0===Se?void 0:Se.subscribe(ae)}[w.s](){return this}pipe(...ae){return(0,j.m)(ae)(this)}toPromise(ae){return new(ae=ge(ae))((Se,ze)=>{let Ze;this.subscribe(ie=>Ze=ie,ie=>ze(ie),()=>Se(Ze))})}}return se.create=Te=>new se(Te),se})();function ge(se){var Te;return null!==(Te=se??Q.$.Promise)&&void 0!==Te?Te:Promise}},1413:(Ue,he,O)=>{"use strict";O.d(he,{B:()=>J});var C=O(1985),N=O(8359);const j=(0,O(1853).L)(ge=>function(){ge(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Q=O(7908),De=O(9786);let J=(()=>{class ge extends C.c{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(Z){const se=new be(this,this);return se.operator=Z,se}_throwIfClosed(){if(this.closed)throw new j}next(Z){(0,De.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const se of this.currentObservers)se.next(Z)}})}error(Z){(0,De.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=Z;const{observers:se}=this;for(;se.length;)se.shift().error(Z)}})}complete(){(0,De.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:Z}=this;for(;Z.length;)Z.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var Z;return(null===(Z=this.observers)||void 0===Z?void 0:Z.length)>0}_trySubscribe(Z){return this._throwIfClosed(),super._trySubscribe(Z)}_subscribe(Z){return this._throwIfClosed(),this._checkFinalizedStatuses(Z),this._innerSubscribe(Z)}_innerSubscribe(Z){const{hasError:se,isStopped:Te,observers:ae}=this;return se||Te?N.Kn:(this.currentObservers=null,ae.push(Z),new N.yU(()=>{this.currentObservers=null,(0,Q.o)(ae,Z)}))}_checkFinalizedStatuses(Z){const{hasError:se,thrownError:Te,isStopped:ae}=this;se?Z.error(Te):ae&&Z.complete()}asObservable(){const Z=new C.c;return Z.source=this,Z}}return ge.create=(te,Z)=>new be(te,Z),ge})();class be extends J{constructor(te,Z){super(),this.destination=te,this.source=Z}next(te){var Z,se;null===(se=null===(Z=this.destination)||void 0===Z?void 0:Z.next)||void 0===se||se.call(Z,te)}error(te){var Z,se;null===(se=null===(Z=this.destination)||void 0===Z?void 0:Z.error)||void 0===se||se.call(Z,te)}complete(){var te,Z;null===(Z=null===(te=this.destination)||void 0===te?void 0:te.complete)||void 0===Z||Z.call(te)}_subscribe(te){var Z,se;return null!==(se=null===(Z=this.source)||void 0===Z?void 0:Z.subscribe(te))&&void 0!==se?se:N.Kn}}},7707:(Ue,he,O)=>{"use strict";O.d(he,{Ms:()=>ze,vU:()=>se});var C=O(8071),N=O(8359),w=O(1026),j=O(5334),Q=O(5343);const De=ge("C",void 0,void 0);function ge(pe,de,Ce){return{kind:pe,value:de,error:Ce}}var te=O(9270),Z=O(9786);class se extends N.yU{constructor(de){super(),this.isStopped=!1,de?(this.destination=de,(0,N.Uv)(de)&&de.add(this)):this.destination=Be}static create(de,Ce,We){return new ze(de,Ce,We)}next(de){this.isStopped?ye(function be(pe){return ge("N",pe,void 0)}(de),this):this._next(de)}error(de){this.isStopped?ye(function J(pe){return ge("E",void 0,pe)}(de),this):(this.isStopped=!0,this._error(de))}complete(){this.isStopped?ye(De,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(de){this.destination.next(de)}_error(de){try{this.destination.error(de)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Te=Function.prototype.bind;function ae(pe,de){return Te.call(pe,de)}class Se{constructor(de){this.partialObserver=de}next(de){const{partialObserver:Ce}=this;if(Ce.next)try{Ce.next(de)}catch(We){Ze(We)}}error(de){const{partialObserver:Ce}=this;if(Ce.error)try{Ce.error(de)}catch(We){Ze(We)}else Ze(de)}complete(){const{partialObserver:de}=this;if(de.complete)try{de.complete()}catch(Ce){Ze(Ce)}}}class ze extends se{constructor(de,Ce,We){let Ae;if(super(),(0,C.T)(de)||!de)Ae={next:de??void 0,error:Ce??void 0,complete:We??void 0};else{let Ie;this&&w.$.useDeprecatedNextContext?(Ie=Object.create(de),Ie.unsubscribe=()=>this.unsubscribe(),Ae={next:de.next&&ae(de.next,Ie),error:de.error&&ae(de.error,Ie),complete:de.complete&&ae(de.complete,Ie)}):Ae=de}this.destination=new Se(Ae)}}function Ze(pe){w.$.useDeprecatedSynchronousErrorHandling?(0,Z.l)(pe):(0,j.m)(pe)}function ye(pe,de){const{onStoppedNotification:Ce}=w.$;Ce&&te.f.setTimeout(()=>Ce(pe,de))}const Be={closed:!0,next:Q.l,error:function ie(pe){throw pe},complete:Q.l}},8359:(Ue,he,O)=>{"use strict";O.d(he,{Kn:()=>De,yU:()=>Q,Uv:()=>J});var C=O(8071);const w=(0,O(1853).L)(ge=>function(Z){ge(this),this.message=Z?`${Z.length} errors occurred during unsubscription:\n${Z.map((se,Te)=>`${Te+1}) ${se.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=Z});var j=O(7908);class Q{constructor(te){this.initialTeardown=te,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let te;if(!this.closed){this.closed=!0;const{_parentage:Z}=this;if(Z)if(this._parentage=null,Array.isArray(Z))for(const ae of Z)ae.remove(this);else Z.remove(this);const{initialTeardown:se}=this;if((0,C.T)(se))try{se()}catch(ae){te=ae instanceof w?ae.errors:[ae]}const{_finalizers:Te}=this;if(Te){this._finalizers=null;for(const ae of Te)try{be(ae)}catch(Se){te=te??[],Se instanceof w?te=[...te,...Se.errors]:te.push(Se)}}if(te)throw new w(te)}}add(te){var Z;if(te&&te!==this)if(this.closed)be(te);else{if(te instanceof Q){if(te.closed||te._hasParent(this))return;te._addParent(this)}(this._finalizers=null!==(Z=this._finalizers)&&void 0!==Z?Z:[]).push(te)}}_hasParent(te){const{_parentage:Z}=this;return Z===te||Array.isArray(Z)&&Z.includes(te)}_addParent(te){const{_parentage:Z}=this;this._parentage=Array.isArray(Z)?(Z.push(te),Z):Z?[Z,te]:te}_removeParent(te){const{_parentage:Z}=this;Z===te?this._parentage=null:Array.isArray(Z)&&(0,j.o)(Z,te)}remove(te){const{_finalizers:Z}=this;Z&&(0,j.o)(Z,te),te instanceof Q&&te._removeParent(this)}}Q.EMPTY=(()=>{const ge=new Q;return ge.closed=!0,ge})();const De=Q.EMPTY;function J(ge){return ge instanceof Q||ge&&"closed"in ge&&(0,C.T)(ge.remove)&&(0,C.T)(ge.add)&&(0,C.T)(ge.unsubscribe)}function be(ge){(0,C.T)(ge)?ge():ge.unsubscribe()}},1026:(Ue,he,O)=>{"use strict";O.d(he,{$:()=>C});const C={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},983:(Ue,he,O)=>{"use strict";O.d(he,{w:()=>N});const N=new(O(1985).c)(Q=>Q.complete())},6648:(Ue,he,O)=>{"use strict";O.d(he,{H:()=>We});var C=O(8750),N=O(5225),w=O(9974),j=O(4360);function Q(Ae,Ie=0){return(0,w.N)((Pe,qe)=>{Pe.subscribe((0,j._)(qe,Je=>(0,N.N)(qe,Ae,()=>qe.next(Je),Ie),()=>(0,N.N)(qe,Ae,()=>qe.complete(),Ie),Je=>(0,N.N)(qe,Ae,()=>qe.error(Je),Ie)))})}function De(Ae,Ie=0){return(0,w.N)((Pe,qe)=>{qe.add(Ae.schedule(()=>Pe.subscribe(qe),Ie))})}var ge=O(1985),Z=O(4761),se=O(8071);function ae(Ae,Ie){if(!Ae)throw new Error("Iterable cannot be null");return new ge.c(Pe=>{(0,N.N)(Pe,Ie,()=>{const qe=Ae[Symbol.asyncIterator]();(0,N.N)(Pe,Ie,()=>{qe.next().then(Je=>{Je.done?Pe.complete():Pe.next(Je.value)})},0,!0)})})}var Se=O(5055),ze=O(9858),Ze=O(7441),ie=O(5397),ye=O(7953),Be=O(591),pe=O(5196);function We(Ae,Ie){return Ie?function Ce(Ae,Ie){if(null!=Ae){if((0,Se.l)(Ae))return function J(Ae,Ie){return(0,C.Tg)(Ae).pipe(De(Ie),Q(Ie))}(Ae,Ie);if((0,Ze.X)(Ae))return function te(Ae,Ie){return new ge.c(Pe=>{let qe=0;return Ie.schedule(function(){qe===Ae.length?Pe.complete():(Pe.next(Ae[qe++]),Pe.closed||this.schedule())})})}(Ae,Ie);if((0,ze.y)(Ae))return function be(Ae,Ie){return(0,C.Tg)(Ae).pipe(De(Ie),Q(Ie))}(Ae,Ie);if((0,ye.T)(Ae))return ae(Ae,Ie);if((0,ie.x)(Ae))return function Te(Ae,Ie){return new ge.c(Pe=>{let qe;return(0,N.N)(Pe,Ie,()=>{qe=Ae[Z.l](),(0,N.N)(Pe,Ie,()=>{let Je,er;try{({value:Je,done:er}=qe.next())}catch(yn){return void Pe.error(yn)}er?Pe.complete():Pe.next(Je)},0,!0)}),()=>(0,se.T)(qe?.return)&&qe.return()})}(Ae,Ie);if((0,pe.U)(Ae))return function de(Ae,Ie){return ae((0,pe.C)(Ae),Ie)}(Ae,Ie)}throw(0,Be.L)(Ae)}(Ae,Ie):(0,C.Tg)(Ae)}},8750:(Ue,he,O)=>{"use strict";O.d(he,{Tg:()=>Te});var C=O(1635),N=O(7441),w=O(9858),j=O(1985),Q=O(5055),De=O(7953),J=O(591),be=O(5397),ge=O(5196),te=O(8071),Z=O(5334),se=O(3494);function Te(pe){if(pe instanceof j.c)return pe;if(null!=pe){if((0,Q.l)(pe))return function ae(pe){return new j.c(de=>{const Ce=pe[se.s]();if((0,te.T)(Ce.subscribe))return Ce.subscribe(de);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(pe);if((0,N.X)(pe))return function Se(pe){return new j.c(de=>{for(let Ce=0;Ce{pe.then(Ce=>{de.closed||(de.next(Ce),de.complete())},Ce=>de.error(Ce)).then(null,Z.m)})}(pe);if((0,De.T)(pe))return ie(pe);if((0,be.x)(pe))return function Ze(pe){return new j.c(de=>{for(const Ce of pe)if(de.next(Ce),de.closed)return;de.complete()})}(pe);if((0,ge.U)(pe))return function ye(pe){return ie((0,ge.C)(pe))}(pe)}throw(0,J.L)(pe)}function ie(pe){return new j.c(de=>{(function Be(pe,de){var Ce,We,Ae,Ie;return(0,C.sH)(this,void 0,void 0,function*(){try{for(Ce=(0,C.xN)(pe);!(We=yield Ce.next()).done;)if(de.next(We.value),de.closed)return}catch(Pe){Ae={error:Pe}}finally{try{We&&!We.done&&(Ie=Ce.return)&&(yield Ie.call(Ce))}finally{if(Ae)throw Ae.error}}de.complete()})})(pe,de).catch(Ce=>de.error(Ce))})}},7673:(Ue,he,O)=>{"use strict";O.d(he,{of:()=>w});var C=O(3794),N=O(6648);function w(...j){const Q=(0,C.lI)(j);return(0,N.H)(j,Q)}},8810:(Ue,he,O)=>{"use strict";O.d(he,{$:()=>w});var C=O(1985),N=O(8071);function w(j,Q){const De=(0,N.T)(j)?j:()=>j,J=be=>be.error(De());return new C.c(Q?be=>Q.schedule(J,0,be):J)}},4360:(Ue,he,O)=>{"use strict";O.d(he,{_:()=>N});var C=O(7707);function N(j,Q,De,J,be){return new w(j,Q,De,J,be)}class w extends C.vU{constructor(Q,De,J,be,ge,te){super(Q),this.onFinalize=ge,this.shouldUnsubscribe=te,this._next=De?function(Z){try{De(Z)}catch(se){Q.error(se)}}:super._next,this._error=be?function(Z){try{be(Z)}catch(se){Q.error(se)}finally{this.unsubscribe()}}:super._error,this._complete=J?function(){try{J()}catch(Z){Q.error(Z)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var Q;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:De}=this;super.unsubscribe(),!De&&(null===(Q=this.onFinalize)||void 0===Q||Q.call(this))}}}},9437:(Ue,he,O)=>{"use strict";O.d(he,{W:()=>j});var C=O(8750),N=O(4360),w=O(9974);function j(Q){return(0,w.N)((De,J)=>{let te,be=null,ge=!1;be=De.subscribe((0,N._)(J,void 0,void 0,Z=>{te=(0,C.Tg)(Q(Z,j(Q)(De))),be?(be.unsubscribe(),be=null,te.subscribe(J)):ge=!0})),ge&&(be.unsubscribe(),be=null,te.subscribe(J))})}},274:(Ue,he,O)=>{"use strict";O.d(he,{H:()=>w});var C=O(1397),N=O(8071);function w(j,Q){return(0,N.T)(Q)?(0,C.Z)(j,Q,1):(0,C.Z)(j,1)}},5964:(Ue,he,O)=>{"use strict";O.d(he,{p:()=>w});var C=O(9974),N=O(4360);function w(j,Q){return(0,C.N)((De,J)=>{let be=0;De.subscribe((0,N._)(J,ge=>j.call(Q,ge,be++)&&J.next(ge)))})}},980:(Ue,he,O)=>{"use strict";O.d(he,{j:()=>N});var C=O(9974);function N(w){return(0,C.N)((j,Q)=>{try{j.subscribe(Q)}finally{Q.add(w)}})}},6354:(Ue,he,O)=>{"use strict";O.d(he,{T:()=>w});var C=O(9974),N=O(4360);function w(j,Q){return(0,C.N)((De,J)=>{let be=0;De.subscribe((0,N._)(J,ge=>{J.next(j.call(Q,ge,be++))}))})}},1397:(Ue,he,O)=>{"use strict";O.d(he,{Z:()=>be});var C=O(6354),N=O(8750),w=O(9974),j=O(5225),Q=O(4360),J=O(8071);function be(ge,te,Z=1/0){return(0,J.T)(te)?be((se,Te)=>(0,C.T)((ae,Se)=>te(se,ae,Te,Se))((0,N.Tg)(ge(se,Te))),Z):("number"==typeof te&&(Z=te),(0,w.N)((se,Te)=>function De(ge,te,Z,se,Te,ae,Se,ze){const Ze=[];let ie=0,ye=0,Be=!1;const pe=()=>{Be&&!Ze.length&&!ie&&te.complete()},de=We=>ie{ae&&te.next(We),ie++;let Ae=!1;(0,N.Tg)(Z(We,ye++)).subscribe((0,Q._)(te,Ie=>{Te?.(Ie),ae?de(Ie):te.next(Ie)},()=>{Ae=!0},void 0,()=>{if(Ae)try{for(ie--;Ze.length&&ieCe(Ie)):Ce(Ie)}pe()}catch(Ie){te.error(Ie)}}))};return ge.subscribe((0,Q._)(te,de,()=>{Be=!0,pe()})),()=>{ze?.()}}(se,Te,ge,Z)))}},5558:(Ue,he,O)=>{"use strict";O.d(he,{n:()=>j});var C=O(8750),N=O(9974),w=O(4360);function j(Q,De){return(0,N.N)((J,be)=>{let ge=null,te=0,Z=!1;const se=()=>Z&&!ge&&be.complete();J.subscribe((0,w._)(be,Te=>{ge?.unsubscribe();let ae=0;const Se=te++;(0,C.Tg)(Q(Te,Se)).subscribe(ge=(0,w._)(be,ze=>be.next(De?De(Te,ze,Se,ae++):ze),()=>{ge=null,se()}))},()=>{Z=!0,se()}))})}},6697:(Ue,he,O)=>{"use strict";O.d(he,{s:()=>j});var C=O(983),N=O(9974),w=O(4360);function j(Q){return Q<=0?()=>C.w:(0,N.N)((De,J)=>{let be=0;De.subscribe((0,w._)(J,ge=>{++be<=Q&&(J.next(ge),Q<=be&&J.complete())}))})}},9270:(Ue,he,O)=>{"use strict";O.d(he,{f:()=>C});const C={setTimeout(N,w,...j){const{delegate:Q}=C;return Q?.setTimeout?Q.setTimeout(N,w,...j):setTimeout(N,w,...j)},clearTimeout(N){const{delegate:w}=C;return(w?.clearTimeout||clearTimeout)(N)},delegate:void 0}},4761:(Ue,he,O)=>{"use strict";O.d(he,{l:()=>N});const N=function C(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}()},3494:(Ue,he,O)=>{"use strict";O.d(he,{s:()=>C});const C="function"==typeof Symbol&&Symbol.observable||"@@observable"},3794:(Ue,he,O)=>{"use strict";O.d(he,{ms:()=>j,lI:()=>Q});var C=O(8071);function w(J){return J[J.length-1]}function j(J){return(0,C.T)(w(J))?J.pop():void 0}function Q(J){return function N(J){return J&&(0,C.T)(J.schedule)}(w(J))?J.pop():void 0}},3073:(Ue,he,O)=>{"use strict";O.d(he,{D:()=>Q});const{isArray:C}=Array,{getPrototypeOf:N,prototype:w,keys:j}=Object;function Q(J){if(1===J.length){const be=J[0];if(C(be))return{args:be,keys:null};if(function De(J){return J&&"object"==typeof J&&N(J)===w}(be)){const ge=j(be);return{args:ge.map(te=>be[te]),keys:ge}}}return{args:J,keys:null}}},7908:(Ue,he,O)=>{"use strict";function C(N,w){if(N){const j=N.indexOf(w);0<=j&&N.splice(j,1)}}O.d(he,{o:()=>C})},1853:(Ue,he,O)=>{"use strict";function C(N){const j=N(Q=>{Error.call(Q),Q.stack=(new Error).stack});return j.prototype=Object.create(Error.prototype),j.prototype.constructor=j,j}O.d(he,{L:()=>C})},8496:(Ue,he,O)=>{"use strict";function C(N,w){return N.reduce((j,Q,De)=>(j[Q]=w[De],j),{})}O.d(he,{e:()=>C})},9786:(Ue,he,O)=>{"use strict";O.d(he,{Y:()=>w,l:()=>j});var C=O(1026);let N=null;function w(Q){if(C.$.useDeprecatedSynchronousErrorHandling){const De=!N;if(De&&(N={errorThrown:!1,error:null}),Q(),De){const{errorThrown:J,error:be}=N;if(N=null,J)throw be}}else Q()}function j(Q){C.$.useDeprecatedSynchronousErrorHandling&&N&&(N.errorThrown=!0,N.error=Q)}},5225:(Ue,he,O)=>{"use strict";function C(N,w,j,Q=0,De=!1){const J=w.schedule(function(){j(),De?N.add(this.schedule(null,Q)):this.unsubscribe()},Q);if(N.add(J),!De)return J}O.d(he,{N:()=>C})},3669:(Ue,he,O)=>{"use strict";function C(N){return N}O.d(he,{D:()=>C})},7441:(Ue,he,O)=>{"use strict";O.d(he,{X:()=>C});const C=N=>N&&"number"==typeof N.length&&"function"!=typeof N},7953:(Ue,he,O)=>{"use strict";O.d(he,{T:()=>N});var C=O(8071);function N(w){return Symbol.asyncIterator&&(0,C.T)(w?.[Symbol.asyncIterator])}},8071:(Ue,he,O)=>{"use strict";function C(N){return"function"==typeof N}O.d(he,{T:()=>C})},5055:(Ue,he,O)=>{"use strict";O.d(he,{l:()=>w});var C=O(3494),N=O(8071);function w(j){return(0,N.T)(j[C.s])}},5397:(Ue,he,O)=>{"use strict";O.d(he,{x:()=>w});var C=O(4761),N=O(8071);function w(j){return(0,N.T)(j?.[C.l])}},4402:(Ue,he,O)=>{"use strict";O.d(he,{A:()=>w});var C=O(1985),N=O(8071);function w(j){return!!j&&(j instanceof C.c||(0,N.T)(j.lift)&&(0,N.T)(j.subscribe))}},9858:(Ue,he,O)=>{"use strict";O.d(he,{y:()=>N});var C=O(8071);function N(w){return(0,C.T)(w?.then)}},5196:(Ue,he,O)=>{"use strict";O.d(he,{C:()=>w,U:()=>j});var C=O(1635),N=O(8071);function w(Q){return(0,C.AQ)(this,arguments,function*(){const J=Q.getReader();try{for(;;){const{value:be,done:ge}=yield(0,C.N3)(J.read());if(ge)return yield(0,C.N3)(void 0);yield yield(0,C.N3)(be)}}finally{J.releaseLock()}})}function j(Q){return(0,N.T)(Q?.getReader)}},9974:(Ue,he,O)=>{"use strict";O.d(he,{N:()=>w,S:()=>N});var C=O(8071);function N(j){return(0,C.T)(j?.lift)}function w(j){return Q=>{if(N(Q))return Q.lift(function(De){try{return j(De,this)}catch(J){this.error(J)}});throw new TypeError("Unable to lift unknown Observable type")}}},6450:(Ue,he,O)=>{"use strict";O.d(he,{I:()=>j});var C=O(6354);const{isArray:N}=Array;function j(Q){return(0,C.T)(De=>function w(Q,De){return N(De)?Q(...De):Q(De)}(Q,De))}},5343:(Ue,he,O)=>{"use strict";function C(){}O.d(he,{l:()=>C})},1203:(Ue,he,O)=>{"use strict";O.d(he,{F:()=>N,m:()=>w});var C=O(3669);function N(...j){return w(j)}function w(j){return 0===j.length?C.D:1===j.length?j[0]:function(De){return j.reduce((J,be)=>be(J),De)}}},5334:(Ue,he,O)=>{"use strict";O.d(he,{m:()=>w});var C=O(1026),N=O(9270);function w(j){N.f.setTimeout(()=>{const{onUnhandledError:Q}=C.$;if(!Q)throw j;Q(j)})}},591:(Ue,he,O)=>{"use strict";function C(N){return new TypeError(`You provided ${null!==N&&"object"==typeof N?"an invalid object":`'${N}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}O.d(he,{L:()=>C})},477:()=>{},177:(Ue,he,O)=>{"use strict";O.d(he,{AJ:()=>Xr,Jj:()=>pt,N0:()=>mo,QT:()=>w,VF:()=>Q,Vy:()=>Js,ZD:()=>j,_b:()=>Ii,aZ:()=>ie,hb:()=>ae,qQ:()=>J});var C=O(4438);let N=null;function w(){return N}function j(g){N??=g}class Q{}const J=new C.nKC("");let be=(()=>{class g{historyGo(_){throw new Error("")}static#e=this.\u0275fac=function(S){return new(S||g)};static#t=this.\u0275prov=C.jDH({token:g,factory:()=>(0,C.WQX)(te),providedIn:"platform"})}return g})(),te=(()=>{class g extends be{constructor(){super(),this._doc=(0,C.WQX)(J),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return w().getBaseHref(this._doc)}onPopState(_){const S=w().getGlobalEventTarget(this._doc,"window");return S.addEventListener("popstate",_,!1),()=>S.removeEventListener("popstate",_)}onHashChange(_){const S=w().getGlobalEventTarget(this._doc,"window");return S.addEventListener("hashchange",_,!1),()=>S.removeEventListener("hashchange",_)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(_){this._location.pathname=_}pushState(_,S,P){this._history.pushState(_,S,P)}replaceState(_,S,P){this._history.replaceState(_,S,P)}forward(){this._history.forward()}back(){this._history.back()}historyGo(_=0){this._history.go(_)}getState(){return this._history.state}static#e=this.\u0275fac=function(S){return new(S||g)};static#t=this.\u0275prov=C.jDH({token:g,factory:()=>new g,providedIn:"platform"})}return g})();function Z(g,M){if(0==g.length)return M;if(0==M.length)return g;let _=0;return g.endsWith("/")&&_++,M.startsWith("/")&&_++,2==_?g+M.substring(1):1==_?g+M:g+"/"+M}function se(g){const M=g.match(/#|\?|$/),_=M&&M.index||g.length;return g.slice(0,_-("/"===g[_-1]?1:0))+g.slice(_)}function Te(g){return g&&"?"!==g[0]?"?"+g:g}let ae=(()=>{class g{historyGo(_){throw new Error("")}static#e=this.\u0275fac=function(S){return new(S||g)};static#t=this.\u0275prov=C.jDH({token:g,factory:()=>(0,C.WQX)(ze),providedIn:"root"})}return g})();const Se=new C.nKC("");let ze=(()=>{class g extends ae{constructor(_,S){super(),this._platformLocation=_,this._removeListenerFns=[],this._baseHref=S??this._platformLocation.getBaseHrefFromDOM()??(0,C.WQX)(J).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(_){this._removeListenerFns.push(this._platformLocation.onPopState(_),this._platformLocation.onHashChange(_))}getBaseHref(){return this._baseHref}prepareExternalUrl(_){return Z(this._baseHref,_)}path(_=!1){const S=this._platformLocation.pathname+Te(this._platformLocation.search),P=this._platformLocation.hash;return P&&_?`${S}${P}`:S}pushState(_,S,P,X){const le=this.prepareExternalUrl(P+Te(X));this._platformLocation.pushState(_,S,le)}replaceState(_,S,P,X){const le=this.prepareExternalUrl(P+Te(X));this._platformLocation.replaceState(_,S,le)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(_=0){this._platformLocation.historyGo?.(_)}static#e=this.\u0275fac=function(S){return new(S||g)(C.KVO(be),C.KVO(Se,8))};static#t=this.\u0275prov=C.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}return g})(),ie=(()=>{class g{constructor(_){this._subject=new C.bkB,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=_;const S=this._locationStrategy.getBaseHref();this._basePath=function de(g){if(new RegExp("^(https?:)?//").test(g)){const[,_]=g.split(/\/\/[^\/]+/);return _}return g}(se(pe(S))),this._locationStrategy.onPopState(P=>{this._subject.emit({url:this.path(!0),pop:!0,state:P.state,type:P.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(_=!1){return this.normalize(this._locationStrategy.path(_))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(_,S=""){return this.path()==this.normalize(_+Te(S))}normalize(_){return g.stripTrailingSlash(function Be(g,M){if(!g||!M.startsWith(g))return M;const _=M.substring(g.length);return""===_||["/",";","?","#"].includes(_[0])?_:M}(this._basePath,pe(_)))}prepareExternalUrl(_){return _&&"/"!==_[0]&&(_="/"+_),this._locationStrategy.prepareExternalUrl(_)}go(_,S="",P=null){this._locationStrategy.pushState(P,"",_,S),this._notifyUrlChangeListeners(this.prepareExternalUrl(_+Te(S)),P)}replaceState(_,S="",P=null){this._locationStrategy.replaceState(P,"",_,S),this._notifyUrlChangeListeners(this.prepareExternalUrl(_+Te(S)),P)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(_=0){this._locationStrategy.historyGo?.(_)}onUrlChange(_){return this._urlChangeListeners.push(_),this._urlChangeSubscription??=this.subscribe(S=>{this._notifyUrlChangeListeners(S.url,S.state)}),()=>{const S=this._urlChangeListeners.indexOf(_);this._urlChangeListeners.splice(S,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(_="",S){this._urlChangeListeners.forEach(P=>P(_,S))}subscribe(_,S,P){return this._subject.subscribe({next:_,error:S,complete:P})}static#e=this.normalizeQueryParams=Te;static#t=this.joinWithSlash=Z;static#n=this.stripTrailingSlash=se;static#i=this.\u0275fac=function(S){return new(S||g)(C.KVO(ae))};static#s=this.\u0275prov=C.jDH({token:g,factory:()=>function ye(){return new ie((0,C.KVO)(ae))}(),providedIn:"root"})}return g})();function pe(g){return g.replace(/\/index.html$/,"")}function Ii(g,M){M=encodeURIComponent(M);for(const _ of g.split(";")){const S=_.indexOf("="),[P,X]=-1==S?[_,""]:[_.slice(0,S),_.slice(S+1)];if(P.trim()===M)return decodeURIComponent(X)}return null}class xo{createSubscription(M,_){return(0,C.O8t)(()=>M.subscribe({next:_,error:S=>{throw S}}))}dispose(M){(0,C.O8t)(()=>M.unsubscribe())}}class Ti{createSubscription(M,_){return M.then(_,S=>{throw S})}dispose(M){}}const Ai=new Ti,Ri=new xo;let pt=(()=>{class g{constructor(_){this._latestValue=null,this.markForCheckOnValueUpdate=!0,this._subscription=null,this._obj=null,this._strategy=null,this._ref=_}ngOnDestroy(){this._subscription&&this._dispose(),this._ref=null}transform(_){if(!this._obj){if(_)try{this.markForCheckOnValueUpdate=!1,this._subscribe(_)}finally{this.markForCheckOnValueUpdate=!0}return this._latestValue}return _!==this._obj?(this._dispose(),this.transform(_)):this._latestValue}_subscribe(_){this._obj=_,this._strategy=this._selectStrategy(_),this._subscription=this._strategy.createSubscription(_,S=>this._updateLatestValue(_,S))}_selectStrategy(_){if((0,C.jNT)(_))return Ai;if((0,C.zjR)(_))return Ri;throw function _n(g,M){return new C.wOt(2100,!1)}()}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(_,S){_===this._obj&&(this._latestValue=S,this.markForCheckOnValueUpdate&&this._ref?.markForCheck())}static#e=this.\u0275fac=function(S){return new(S||g)(C.rXU(C.gRc,16))};static#t=this.\u0275pipe=C.EJ8({name:"async",type:g,pure:!1,standalone:!0})}return g})();const Xr="browser",gs="server";function Js(g){return g===gs}class mo{}},4438:(Ue,he,O)=>{"use strict";O.d(he,{iLQ:()=>Yv,sZ2:()=>Ta,o8S:()=>Ba,BIS:()=>pd,gRc:()=>gb,Ql9:()=>LA,Ocv:()=>GA,Z63:()=>oi,aKT:()=>wl,uvJ:()=>Gn,zcH:()=>vi,bkB:()=>Kn,$GK:()=>pt,nKC:()=>Ke,zZn:()=>jr,_q3:()=>ay,MKu:()=>ly,xe9:()=>Sp,Co$:()=>lw,Vns:()=>Hl,SKi:()=>Un,Agw:()=>Us,PLl:()=>Vs,sFG:()=>h0,_9s:()=>y_,czy:()=>Hc,C4Q:()=>Vd,NYb:()=>AA,giA:()=>nb,RxE:()=>KC,c1b:()=>tp,gXe:()=>vo,L39:()=>UR,Ol2:()=>iv,w6W:()=>hS,Rfq:()=>lr,WQX:()=>je,naY:()=>QA,QuC:()=>Wn,EmA:()=>Is,N4e:()=>wo,O8t:()=>BR,H3F:()=>XC,H8p:()=>fr,KH2:()=>gu,TgB:()=>Zc,wOt:()=>Ne,WHO:()=>eb,e01:()=>tb,H5H:()=>Nv,Zy3:()=>xr,mq5:()=>dD,JZv:()=>tt,TL3:()=>ER,LfX:()=>Jo,plB:()=>La,jNT:()=>Zv,zjR:()=>rb,TL$:()=>Cy,Tbb:()=>Qt,Vt3:()=>nv,Mj6:()=>Lr,GFd:()=>aw,OA$:()=>b,Jv_:()=>bC,aNF:()=>EC,R7$:()=>Ul,BMQ:()=>mv,AVh:()=>Cv,wni:()=>ZD,VBU:()=>la,FsC:()=>Ya,jDH:()=>It,G2t:()=>Ei,$C:()=>ca,EJ8:()=>Es,rXU:()=>es,nrm:()=>Tv,k0s:()=>gp,j41:()=>pp,RV6:()=>lD,xGo:()=>Rr,KVO:()=>fn,kS0:()=>Or,bIt:()=>Pv,lsd:()=>eC,nI1:()=>NC,bMT:()=>OC,Y8G:()=>wv,mGM:()=>YD,sdS:()=>tC,Njj:()=>Ef,eBV:()=>bf,n$t:()=>sm,EFF:()=>dC,JRh:()=>Lv,DH7:()=>DC,mxI:()=>jv,R50:()=>Uv,GBs:()=>JD}),O(467);let w=null,Q=1;const De=Symbol("SIGNAL");function J(e){const t=w;return w=e,t}function ae(e){if((!We(e)||e.dirty)&&(e.dirty||e.lastCleanEpoch!==Q)){if(!e.producerMustRecompute(e)&&!Be(e))return e.dirty=!1,void(e.lastCleanEpoch=Q);e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=Q}}function Be(e){Ae(e);for(let t=0;t0}function Ae(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}let Rn=null;var Vt=O(1413),pn=O(8359),sr=O(4412),On=O(6354);const jn="https://g.co/ng/security#xss";class Ne extends Error{constructor(t,n){super(xr(t,n)),this.code=t}}function xr(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}function lt(e){return{toString:e}.toString()}const Wr="__parameters__";function gn(e,t,n){return lt(()=>{const r=function bn(e){return function(...n){if(e){const r=e(...n);for(const o in r)this[o]=r[o]}}}(t);function o(...l){if(this instanceof o)return r.apply(this,l),this;const c=new o(...l);return d.annotation=c,d;function d(p,D,I){const R=p.hasOwnProperty(Wr)?p[Wr]:Object.defineProperty(p,Wr,{value:[]})[Wr];for(;R.length<=I;)R.push(null);return(R[I]=R[I]||[]).push(c),p}}return n&&(o.prototype=Object.create(n.prototype)),o.prototype.ngMetadataName=e,o.annotationCls=o,o})}const tt=globalThis;function bt(e){for(let t in e)if(e[t]===bt)return t;throw Error("Could not find renamed property on target object.")}function To(e,t){for(const n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function Qt(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Qt).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function Cr(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const St=bt({__forward_ref__:bt});function lr(e){return e.__forward_ref__=lr,e.toString=function(){return Qt(this())},e}function $(e){return G(e)?e():e}function G(e){return"function"==typeof e&&e.hasOwnProperty(St)&&e.__forward_ref__===lr}function It(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Ei(e){return{providers:e.providers||[],imports:e.imports||[]}}function Si(e){return Yo(e,qs)||Yo(e,qr)}function Jo(e){return null!==Si(e)}function Yo(e,t){return e.hasOwnProperty(t)?e[t]:null}function zr(e){return e&&(e.hasOwnProperty(Ii)||e.hasOwnProperty(Ro))?e[Ii]:null}const qs=bt({\u0275prov:bt}),Ii=bt({\u0275inj:bt}),qr=bt({ngInjectableDef:bt}),Ro=bt({ngInjectorDef:bt});class Ke{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof n?this.__NG_ELEMENT_ID__=n:void 0!==n&&(this.\u0275prov=It({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function ti(e){return e&&!!e.\u0275providers}const kr=bt({\u0275cmp:bt}),Mi=bt({\u0275dir:bt}),cr=bt({\u0275pipe:bt}),Ks=bt({\u0275mod:bt}),nr=bt({\u0275fac:bt}),ct=bt({__NG_ELEMENT_ID__:bt}),br=bt({__NG_ENV_ID__:bt});function Xe(e){return"string"==typeof e?e:null==e?"":String(e)}function Ri(e,t){throw new Ne(-201,!1)}var pt=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(pt||{});let ds;function Xs(){return ds}function Pn(e){const t=ds;return ds=e,t}function Qs(e,t,n){const r=Si(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:n&pt.Optional?null:void 0!==t?t:void Ri()}const Kr={},fs="__NG_DI_FLAG__",Ni="ngTempTokenPath",hs=/\n/gm,Xa="__source";let Po;function Fr(e){const t=Po;return Po=e,t}function Oi(e,t=pt.Default){if(void 0===Po)throw new Ne(-203,!1);return null===Po?Qs(e,void 0,t):Po.get(e,t&pt.Optional?null:void 0,t)}function fn(e,t=pt.Default){return(Xs()||Oi)($(e),t)}function je(e,t=pt.Default){return fn(e,xi(t))}function xi(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function Fo(e){const t=[];for(let n=0;nArray.isArray(n)?Er(n,t):t(n))}function ta(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function mo(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Fn(e,t,n){let r=$n(e,t);return r>=0?e[1|r]=n:(r=~r,function na(e,t,n,r){let o=e.length;if(o==t)e.push(n,r);else if(1===o)e.push(r,e[0]),e[0]=n;else{for(o--,e.push(e[o-1],e[o]);o>t;)e[o]=e[o-2],o--;e[t]=n,e[t+1]=r}}(e,r,t,n)),r}function vs(e,t){const n=$n(e,t);if(n>=0)return e[1|n]}function $n(e,t){return function ys(e,t,n){let r=0,o=e.length>>n;for(;o!==r;){const l=r+(o-r>>1),c=e[l<t?o=l:r=l+1}return~(o<t){c=l-1;break}}}for(;l-1){let l;for(;++ol?"":o[I+1].toLowerCase(),2&r&&D!==R){if(En(r))return!1;c=!0}}}}else{if(!c&&!En(r)&&!En(p))return!1;if(c&&En(p))continue;c=!1,r=p|1&r}}return En(r)||c}function En(e){return!(1&e)}function aa(e,t,n,r){if(null===t)return-1;let o=0;if(r||!n){let l=!1;for(;o-1)for(n++;n0?'="'+d+'"':"")+"]"}else 8&r?o+="."+c:4&r&&(o+=" "+c);else""!==o&&!En(c)&&(t+=Za(l,o),o=""),r=c,l=l||!En(r);n++}return""!==o&&(t+=Za(l,o)),t}function la(e){return lt(()=>{const t=ua(e),n={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===Fi.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||vo.Emulated,styles:e.styles||Et,_:null,schemas:e.schemas||null,tView:null,id:""};Ss(n);const r=e.dependencies;return n.directiveDefs=yo(r,!1),n.pipeDefs=yo(r,!0),n.id=function Jr(e){let t=0;const n=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,e.consts,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery].join("|");for(const o of n)t=Math.imul(31,t)+o.charCodeAt(0)|0;return t+=2147483648,"c"+t}(n),n})}function bs(e){return dt(e)||cn(e)}function Vo(e){return null!==e}function ca(e){return lt(()=>({type:e.type,bootstrap:e.bootstrap||Et,declarations:e.declarations||Et,imports:e.imports||Et,exports:e.exports||Et,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function Ja(e,t){if(null==e)return Sr;const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r];let l,c,d=Lr.None;Array.isArray(o)?(d=o[0],l=o[1],c=o[2]??l):(l=o,c=o),t?(n[l]=d!==Lr.None?[r,d]:r,t[l]=c):n[l]=r}return n}function Ya(e){return lt(()=>{const t=ua(e);return Ss(t),t})}function Es(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function dt(e){return e[kr]||null}function cn(e){return e[Mi]||null}function Gt(e){return e[cr]||null}function Wn(e){const t=dt(e)||cn(e)||Gt(e);return null!==t&&t.standalone}function Sn(e,t){const n=e[Ks]||null;if(!n&&!0===t)throw new Error(`Type ${Qt(e)} does not have '\u0275mod' property.`);return n}function ua(e){const t={};return{type:e.type,providersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputTransforms:null,inputConfig:e.inputs||Sr,exportAs:e.exportAs||null,standalone:!0===e.standalone,signals:!0===e.signals,selectors:e.selectors||Et,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:Ja(e.inputs,t),outputs:Ja(e.outputs),debugInfo:null}}function Ss(e){e.features?.forEach(t=>t(e))}function yo(e,t){if(!e)return null;const n=t?Gt:bs;return()=>("function"==typeof e?e():e).map(r=>n(r)).filter(Vo)}function Is(e){return{\u0275providers:e}}function fa(...e){return{\u0275providers:Ui(0,e),\u0275fromNgModule:!0}}function Ui(e,...t){const n=[],r=new Set;let o;const l=c=>{n.push(c)};return Er(t,c=>{const d=c;si(d,l,[],r)&&(o||=[],o.push(d))}),void 0!==o&&ha(o,l),n}function ha(e,t){for(let n=0;n{t(l,r)})}}function si(e,t,n,r){if(!(e=$(e)))return!1;let o=null,l=zr(e);const c=!l&&dt(e);if(l||c){if(c&&!c.standalone)return!1;o=e}else{const p=e.ngModule;if(l=zr(p),!l)return!1;o=p}const d=r.has(o);if(c){if(d)return!1;if(r.add(o),c.dependencies){const p="function"==typeof c.dependencies?c.dependencies():c.dependencies;for(const D of p)si(D,t,n,r)}}else{if(!l)return!1;{if(null!=l.imports&&!d){let D;r.add(o);try{Er(l.imports,I=>{si(I,t,n,r)&&(D||=[],D.push(I))})}finally{}void 0!==D&&ha(D,t)}if(!d){const D=go(o)||(()=>new o);t({provide:o,useFactory:D,deps:Et},o),t({provide:_s,useValue:o,multi:!0},o),t({provide:oi,useValue:()=>fn(o),multi:!0},o)}const p=l.providers;if(null!=p&&!d){const D=e;ji(p,I=>{t(I,D)})}}}return o!==e&&void 0!==e.providers}function ji(e,t){for(let n of e)ti(n)&&(n=n.\u0275providers),Array.isArray(n)?ji(n,t):t(n)}const sc=bt({provide:String,useValue:bt});function Yr(e){return null!==e&&"object"==typeof e&&sc in e}function _o(e){return"function"==typeof e}const fr=new Ke(""),Ms={},rl={};let ai;function Bi(){return void 0===ai&&(ai=new ws),ai}class Gn{}class li extends Gn{get destroyed(){return this._destroyed}constructor(t,n,r,o){super(),this.parent=n,this.source=r,this.scopes=o,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,$i(t,c=>this.processProvider(c)),this.records.set(Yl,ci(void 0,this)),o.has("environment")&&this.records.set(Gn,ci(void 0,this));const l=this.records.get(fr);null!=l&&"string"==typeof l.value&&this.scopes.add(l.value),this.injectorDefTypes=new Set(this.get(_s,Et,pt.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;const t=J(null);try{for(const r of this._ngOnDestroyHooks)r.ngOnDestroy();const n=this._onDestroyHooks;this._onDestroyHooks=[];for(const r of n)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),J(t)}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const n=Fr(this),r=Pn(void 0);try{return t()}finally{Fr(n),Pn(r)}}get(t,n=Kr,r=pt.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(br))return t[br](this);r=xi(r);const l=Fr(this),c=Pn(void 0);try{if(!(r&pt.SkipSelf)){let p=this.records.get(t);if(void 0===p){const D=function uc(e){return"function"==typeof e||"object"==typeof e&&e instanceof Ke}(t)&&Si(t);p=D&&this.injectableDefInScope(D)?ci(Hi(t),Ms):null,this.records.set(t,p)}if(null!=p)return this.hydrate(t,p)}return(r&pt.Self?Bi():this.parent).get(t,n=r&pt.Optional&&n===Kr?null:n)}catch(d){if("NullInjectorError"===d.name){if((d[Ni]=d[Ni]||[]).unshift(Qt(t)),l)throw d;return function gs(e,t,n,r){const o=e[Ni];throw t[Xa]&&o.unshift(t[Xa]),e.message=function po(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let o=Qt(t);if(Array.isArray(t))o=t.map(Qt).join(" -> ");else if("object"==typeof t){let l=[];for(let c in t)if(t.hasOwnProperty(c)){let d=t[c];l.push(c+":"+("string"==typeof d?JSON.stringify(d):Qt(d)))}o=`{${l.join(", ")}}`}return`${n}${r?"("+r+")":""}[${o}]: ${e.replace(hs,"\n ")}`}("\n"+e.message,o,n,r),e.ngTokenPath=o,e[Ni]=null,e}(d,t,"R3InjectorError",this.source)}throw d}finally{Pn(c),Fr(l)}}resolveInjectorInitializers(){const t=J(null),n=Fr(this),r=Pn(void 0);try{const l=this.get(oi,Et,pt.Self);for(const c of l)c()}finally{Fr(n),Pn(r),J(t)}}toString(){const t=[],n=this.records;for(const r of n.keys())t.push(Qt(r));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Ne(205,!1)}processProvider(t){let n=_o(t=$(t))?t:$(t&&t.provide);const r=function lc(e){return Yr(e)?ci(void 0,e.useValue):ci(cc(e),Ms)}(t);if(!_o(t)&&!0===t.multi){let o=this.records.get(n);o||(o=ci(void 0,Ms,!0),o.factory=()=>Fo(o.multi),this.records.set(n,o)),n=t,o.multi.push(t)}this.records.set(n,r)}hydrate(t,n){const r=J(null);try{return n.value===Ms&&(n.value=rl,n.value=n.factory()),"object"==typeof n.value&&n.value&&function il(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{J(r)}}injectableDefInScope(t){if(!t.providedIn)return!1;const n=$(t.providedIn);return"string"==typeof n?"any"===n||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(t){const n=this._onDestroyHooks.indexOf(t);-1!==n&&this._onDestroyHooks.splice(n,1)}}function Hi(e){const t=Si(e),n=null!==t?t.factory:go(e);if(null!==n)return n;if(e instanceof Ke)throw new Ne(204,!1);if(e instanceof Function)return function ac(e){if(e.length>0)throw new Ne(204,!1);const n=function zs(e){return e&&(e[qs]||e[qr])||null}(e);return null!==n?()=>n.factory(e):()=>new e}(e);throw new Ne(204,!1)}function cc(e,t,n){let r;if(_o(e)){const o=$(e);return go(o)||Hi(o)}if(Yr(e))r=()=>$(e.useValue);else if(function tl(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...Fo(e.deps||[]));else if(function el(e){return!(!e||!e.useExisting)}(e))r=()=>fn($(e.useExisting));else{const o=$(e&&(e.useClass||e.provide));if(!function ol(e){return!!e.deps}(e))return go(o)||Hi(o);r=()=>new o(...Fo(e.deps))}return r}function ci(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function $i(e,t){for(const n of e)Array.isArray(n)?$i(n,t):n&&ti(n)?$i(n.\u0275providers,t):t(n)}function wo(e,t){e instanceof li&&e.assertNotDestroyed();const r=Fr(e),o=Pn(void 0);try{return t()}finally{Fr(r),Pn(o)}}const vt=0,me=1,Le=2,Pt=3,vn=4,zt=5,Yt=6,rr=7,Bt=8,wn=9,Tr=10,Qe=11,or=12,dc=13,Uo=14,qt=15,ui=16,Wi=17,Do=18,As=19,Cu=20,eo=21,Gi=22,jo=23,it=25,pa=1,Vr=7,zi=9,hn=10;var ga=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(ga||{});function Dn(e){return Array.isArray(e)&&"object"==typeof e[pa]}function Cn(e){return Array.isArray(e)&&!0===e[pa]}function ll(e){return!!(4&e.flags)}function di(e){return e.componentOffset>-1}function ma(e){return!(1&~e.flags)}function Ar(e){return!!e.template}function fc(e){return!!(512&e[Le])}class h{constructor(t,n,r){this.previousValue=t,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}}function y(e,t,n,r){null!==t?t.applyValueToInputSignal(t,r):e[n]=r}function b(){return A}function A(e){return e.type.prototype.ngOnChanges&&(e.setInput=q),F}function F(){const e=Ee(this),t=e?.current;if(t){const n=e.previous;if(n===Sr)e.previous=t;else for(let r in t)n[r]=t[r];e.current=null,this.ngOnChanges(t)}}function q(e,t,n,r,o){const l=this.declaredInputs[r],c=Ee(e)||function Ge(e,t){return e[H]=t}(e,{previous:Sr,current:null}),d=c.current||(c.current={}),p=c.previous,D=p[l];d[l]=new h(D&&D.currentValue,n,p===Sr),y(e,t,o,n)}b.ngInherit=!0;const H="__ngSimpleChanges__";function Ee(e){return e[H]||null}const ir=function(e,t,n){};let va=!1;function jt(e){for(;Array.isArray(e);)e=e[vt];return e}function cl(e,t){return jt(t[e])}function hr(e,t){return jt(t[e.index])}function ul(e,t){return e.data[t]}function ya(e,t){return e[t]}function Ur(e,t){const n=t[e];return Dn(n)?n:n[vt]}function Au(e){return!(128&~e[Le])}function Ho(e,t){return null==t?null:e[t]}function Ru(e){e[Wi]=0}function Xp(e){1024&e[Le]||(e[Le]|=1024,Au(e)&&dl(e))}function Nu(e){return!!(9216&e[Le]||e[jo]?.dirty)}function Ou(e){e[Tr].changeDetectionScheduler?.notify(1),Nu(e)?dl(e):64&e[Le]&&(function Bo(){return va}()?(e[Le]|=1024,dl(e)):e[Tr].changeDetectionScheduler?.notify())}function dl(e){e[Tr].changeDetectionScheduler?.notify();let t=Rs(e);for(;null!==t&&!(8192&t[Le])&&(t[Le]|=8192,Au(t));)t=Rs(t)}function gc(e,t){if(!(256&~e[Le]))throw new Ne(911,!1);null===e[eo]&&(e[eo]=[]),e[eo].push(t)}function Rs(e){const t=e[Pt];return Cn(t)?t[Pt]:t}const rt={lFrame:qn(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function wf(){return rt.bindingsEnabled}function ne(){return rt.lFrame.lView}function yt(){return rt.lFrame.tView}function bf(e){return rt.lFrame.contextLView=e,e[Bt]}function Ef(e){return rt.lFrame.contextLView=null,e}function Ht(){let e=Sf();for(;null!==e&&64===e.type;)e=e.parent;return e}function Sf(){return rt.lFrame.currentTNode}function $o(e,t){const n=rt.lFrame;n.currentTNode=e,n.isParent=t}function Pu(){return rt.lFrame.isParent}function Co(){return rt.lFrame.bindingIndex++}function py(e,t){const n=rt.lFrame;n.bindingIndex=n.bindingRootIndex=e,Fu(t)}function Fu(e){rt.lFrame.currentDirectiveIndex=e}function Vu(){return rt.lFrame.currentQueryIndex}function hl(e){rt.lFrame.currentQueryIndex=e}function ig(e){const t=e[me];return 2===t.type?t.declTNode:1===t.type?e[zt]:null}function Tf(e,t,n){if(n&pt.SkipSelf){let o=t,l=e;for(;!(o=o.parent,null!==o||n&pt.Host||(o=ig(l),null===o||(l=l[Uo],10&o.type))););if(null===o)return!1;t=o,e=l}const r=rt.lFrame=bo();return r.currentTNode=t,r.lView=e,!0}function to(e){const t=bo(),n=e[me];rt.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function bo(){const e=rt.lFrame,t=null===e?null:e.child;return null===t?qn(e):t}function qn(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function st(){const e=rt.lFrame;return rt.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const Af=st;function no(){const e=st();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Ln(){return rt.lFrame.selectedIndex}function Ki(e){rt.lFrame.selectedIndex=e}function wt(){const e=rt.lFrame;return ul(e.tView,e.selectedIndex)}let Nf=!0;function Os(){return Nf}function ro(e){Nf=e}function wa(e,t){for(let n=t.directiveStart,r=t.directiveEnd;n=r)break}else t[p]<0&&(e[Wi]+=65536),(d>14>16&&(3&e[Le])===t&&(e[Le]+=16384,xf(d,l)):xf(d,l)}const Xi=-1;class pl{constructor(t,n,r){this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=r}}function Gu(e){return e!==Xi}function gl(e){return 32767&e}function ml(e,t){let n=function cg(e){return e>>16}(e),r=t;for(;n>0;)r=r[Uo],n--;return r}let zu=!0;function yc(e){const t=zu;return zu=e,t}const vl=255,qu=5;let Ff=0;const Eo={};function _c(e,t){const n=Xu(e,t);if(-1!==n)return n;const r=t[me];r.firstCreatePass&&(e.injectorIndex=t.length,Ku(r.data,e),Ku(t,null),Ku(r.blueprint,null));const o=wc(e,t),l=e.injectorIndex;if(Gu(o)){const c=gl(o),d=ml(o,t),p=d[me].data;for(let D=0;D<8;D++)t[l+D]=d[c+D]|p[c+D]}return t[l+8]=o,l}function Ku(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Xu(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function wc(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,r=null,o=t;for(;null!==o;){if(r=Hf(o),null===r)return Xi;if(n++,o=o[Uo],-1!==r.injectorIndex)return r.injectorIndex|n<<16}return Xi}function yl(e,t,n){!function Lf(e,t,n){let r;"string"==typeof n?r=n.charCodeAt(0)||0:n.hasOwnProperty(ct)&&(r=n[ct]),null==r&&(r=n[ct]=Ff++);const o=r&vl;t.data[e+(o>>qu)]|=1<=0?t&vl:ba:t}(n);if("function"==typeof l){if(!Tf(t,e,r))return r&pt.Host?Vf(o,0,r):Uf(t,n,r,o);try{let c;if(c=l(r),null!=c||r&pt.Optional)return c;Ri()}finally{Af()}}else if("number"==typeof l){let c=null,d=Xu(e,t),p=Xi,D=r&pt.Host?t[qt][zt]:null;for((-1===d||r&pt.SkipSelf)&&(p=-1===d?wc(e,t):t[d+8],p!==Xi&&hg(r,!1)?(c=t[me],d=gl(p),t=ml(p,t)):d=-1);-1!==d;){const I=t[me];if(Bf(l,d,I.data)){const R=dg(d,t,n,c,r,D);if(R!==Eo)return R}p=t[d+8],p!==Xi&&hg(r,t[me].data[d+8]===D)&&Bf(l,d,t)?(c=I,d=gl(p),t=ml(p,t)):d=-1}}return o}function dg(e,t,n,r,o,l){const c=t[me],d=c.data[e+8],I=Dc(d,c,n,null==r?di(d)&&zu:r!=c&&!!(3&d.type),o&pt.Host&&l===d);return null!==I?xs(t,c,I,d):Eo}function Dc(e,t,n,r,o){const l=e.providerIndexes,c=t.data,d=1048575&l,p=e.directiveStart,I=l>>20,L=o?d+I:e.directiveEnd;for(let U=r?d:d+I;U=p&&W.type===n)return U}if(o){const U=c[p];if(U&&Ar(U)&&U.type===n)return p}return null}function xs(e,t,n,r){let o=e[n];const l=t.data;if(function Pf(e){return e instanceof pl}(o)){const c=o;c.resolving&&function xo(e,t){throw t&&t.join(" > "),new Ne(-200,e)}(function ut(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():Xe(e)}(l[n]));const d=yc(c.canSeeViewProviders);c.resolving=!0;const D=c.injectImpl?Pn(c.injectImpl):null;Tf(e,r,pt.Default);try{o=e[n]=c.factory(void 0,l,e,r),t.firstCreatePass&&n>=r.directiveStart&&function sg(e,t,n){const{ngOnChanges:r,ngOnInit:o,ngDoCheck:l}=t.type.prototype;if(r){const c=A(t);(n.preOrderHooks??=[]).push(e,c),(n.preOrderCheckHooks??=[]).push(e,c)}o&&(n.preOrderHooks??=[]).push(0-e,o),l&&((n.preOrderHooks??=[]).push(e,l),(n.preOrderCheckHooks??=[]).push(e,l))}(n,l[n],t)}finally{null!==D&&Pn(D),yc(d),c.resolving=!1,Af()}}return o}function Bf(e,t,n){return!!(n[t+(e>>qu)]&1<{const t=e.prototype.constructor,n=t[nr]||gr(t),r=Object.prototype;let o=Object.getPrototypeOf(e.prototype).constructor;for(;o&&o!==r;){const l=o[nr]||gr(o);if(l&&l!==n)return l;o=Object.getPrototypeOf(o)}return l=>new l})}function gr(e){return G(e)?()=>{const t=gr($(e));return t&&t()}:go(e)}function Hf(e){const t=e[me],n=t.type;return 2===n?t.declTNode:1===n?e[zt]:null}function Or(e){return function ug(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const r=n.length;let o=0;for(;o{class e{static#e=this.THROW_IF_NOT_FOUND=Kr;static#t=this.NULL=new ws;static create(n,r){if(Array.isArray(n))return Gf({name:""},r,n,"");{const o=n.name??"";return Gf({name:o},n.parent,n.providers,o)}}static#n=this.\u0275prov=It({token:e,providedIn:"any",factory:()=>fn(Yl)});static#i=this.__NG_ELEMENT_ID__=-1}return e})();function Yu(e){return e.ngOriginalError}class vi{constructor(){this._console=console}handleError(t){const n=this._findOriginalError(t);this._console.error("ERROR",t),n&&this._console.error("ORIGINAL ERROR",n)}_findOriginalError(t){let n=t&&Yu(t);for(;n&&Yu(n);)n=Yu(n);return n||null}}const qf=new Ke("",{providedIn:"root",factory:()=>je(vi).handleError.bind(void 0)});let Ea=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=ks;static#t=this.__NG_ENV_ID__=n=>n}return e})();class Kf extends Ea{constructor(t){super(),this._lView=t}onDestroy(t){return gc(this._lView,t),()=>function xu(e,t){if(null===e[eo])return;const n=e[eo].indexOf(t);-1!==n&&e[eo].splice(n,1)}(this._lView,t)}}function ks(){return new Kf(ne())}function Dg(){return Fs(Ht(),ne())}function Fs(e,t){return new wl(hr(e,t))}let wl=(()=>{class e{constructor(n){this.nativeElement=n}static#e=this.__NG_ELEMENT_ID__=Dg}return e})();function Qf(e){return e instanceof wl?e.nativeElement:e}function Ia(e){return t=>{setTimeout(e,void 0,t)}}const Kn=class Cg extends Vt.B{constructor(t=!1){super(),this.destroyRef=void 0,this.__isAsync=t,function sl(){return void 0!==Xs()||null!=function ko(){return Po}()}()&&(this.destroyRef=je(Ea,{optional:!0})??void 0)}emit(t){const n=J(null);try{super.next(t)}finally{J(n)}}subscribe(t,n,r){let o=t,l=n||(()=>null),c=r;if(t&&"object"==typeof t){const p=t;o=p.next?.bind(p),l=p.error?.bind(p),c=p.complete?.bind(p)}this.__isAsync&&(l=Ia(l),o&&(o=Ia(o)),c&&(c=Ia(c)));const d=super.subscribe({next:o,error:l,complete:c});return t instanceof pn.yU&&t.add(d),d}};function Zf(){return this._results[Symbol.iterator]()}class Vn{static#e=Symbol.iterator;get changes(){return this._changes??=new Kn}constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._onDirty=void 0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;const n=Vn.prototype;n[Symbol.iterator]||(n[Symbol.iterator]=Zf)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,n){return this._results.reduce(t,n)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,n){this.dirty=!1;const r=function Hn(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function ea(e,t,n){if(e.length!==t.length)return!1;for(let r=0;rAc}),Ac="ng",Vs=new Ke(""),Us=new Ke("",{providedIn:"platform",factory:()=>"unknown"}),pd=new Ke("",{providedIn:"root",factory:()=>function Ls(){if(void 0!==ah)return ah;if(typeof document<"u")return document;throw new Ne(210,!1)}().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let fh=()=>null;function Nc(e,t,n=!1){return fh(e,t,n)}const mh=new Ke("",{providedIn:"root",factory:()=>!1});let Pc;function _h(e){return function kc(){if(void 0===Pc&&(Pc=null,tt.trustedTypes))try{Pc=tt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Pc}()?.createScriptURL(e)||e}class Cd{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${jn})`}}function Di(e){return e instanceof Cd?e.changingThisBreaksApplicationSecurity:e}function Na(e,t){const n=function zg(e){return e instanceof Cd&&e.getTypeName()||null}(e);if(null!=n&&n!==t){if("ResourceURL"===n&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${n} (see ${jn})`)}return n===t}const Sh=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;var Oa=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}(Oa||{});function nm(e){const t=jc();return t?t.sanitize(Oa.URL,e)||"":Na(e,"URL")?Di(e):function Ed(e){return(e=String(e)).match(Sh)?e:"unsafe:"+e}(Xe(e))}function rm(e){const t=jc();if(t)return _h(t.sanitize(Oa.RESOURCE_URL,e)||"");if(Na(e,"ResourceURL"))return _h(Di(e));throw new Ne(904,!1)}function sm(e,t,n){return function Py(e,t){return"src"===t&&("embed"===e||"frame"===e||"iframe"===e||"media"===e||"script"===e)||"href"===t&&("base"===e||"link"===e)?rm:nm}(t,n)(e)}function jc(){const e=ne();return e&&e[Tr].sanitizer}function io(e){return e instanceof Function?e():e}var Hc=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(Hc||{});let $c;function Rd(e,t){return $c(e,t)}function Yi(e,t,n,r,o){if(null!=r){let l,c=!1;Cn(r)?l=r:Dn(r)&&(c=!0,r=r[vt]);const d=jt(r);0===e&&null!==n?null==o?E(t,n,d):m(t,n,d,o||null,!0):1===e&&null!==n?m(t,n,d,o||null,!0):2===e?function un(e,t,n){const r=z(e,t);r&&function x(e,t,n,r){e.removeChild(t,n,r)}(e,r,t,n)}(t,d,c):3===e&&t.destroyNode(d),null!=l&&function zo(e,t,n,r,o){const l=n[Vr];l!==jt(n)&&Yi(t,e,r,l,o);for(let d=hn;d0&&(e[n-1][vn]=r[vn]);const l=mo(e,hn+t);!function _m(e,t){Hh(e,t),t[vt]=null,t[zt]=null}(r[me],r);const c=l[Do];null!==c&&c.detachView(l[me]),r[Pt]=null,r[vn]=null,r[Le]&=-129}return r}function Vl(e,t){if(!(256&t[Le])){const n=t[Qe];n.destroyNode&&Mt(e,t,n,3,null,null),function Dm(e){let t=e[or];if(!t)return zc(e[me],e);for(;t;){let n=null;if(Dn(t))n=t[or];else{const r=t[hn];r&&(n=r)}if(!n){for(;t&&!t[vn]&&t!==e;)Dn(t)&&zc(t[me],t),t=t[Pt];null===t&&(t=e),Dn(t)&&zc(t[me],t),n=t&&t[vn]}t=n}}(t)}}function zc(e,t){if(256&t[Le])return;const n=J(null);try{t[Le]&=-129,t[Le]|=256,t[jo]&&function pe(e){if(Ae(e),We(e))for(let t=0;t=0?r[c]():r[-c].unsubscribe(),l+=2}else n[l].call(r[n[l+1]]);null!==r&&(t[rr]=null);const o=t[eo];if(null!==o){t[eo]=null;for(let l=0;l-1){const{encapsulation:l}=e.data[r.directiveStart+o];if(l===vo.None||l===vo.Emulated)return null}return hr(r,n)}}(e,t.parent,n)}function m(e,t,n,r,o){e.insertBefore(t,n,r,o)}function E(e,t,n){e.appendChild(t,n)}function T(e,t,n,r,o){null!==r?m(e,t,n,r,o):E(e,t,n)}function z(e,t){return e.parentNode(t)}let Dt,_t=function Oe(e,t,n){return 40&e.type?hr(e,n):null};function Ct(e,t,n,r){const o=a(e,r,t),l=t[Qe],d=function ve(e,t,n){return _t(e,t,n)}(r.parent||t[zt],r,t);if(null!=o)if(Array.isArray(n))for(let p=0;pit&&jl(e,t,it,!1),ir(c?2:0,o),n(r,o)}finally{Ki(l),ir(c?3:1,o)}}function Fa(e,t,n){if(ll(t)){const r=J(null);try{const l=t.directiveEnd;for(let c=t.directiveStart;cnull;function Ky(e,t,n,r,o){for(let l in t){if(!t.hasOwnProperty(l))continue;const c=t[l];if(void 0===c)continue;r??={};let d,p=Lr.None;Array.isArray(c)?(d=c[0],p=c[1]):d=c;let D=l;if(null!==o){if(!o.hasOwnProperty(l))continue;D=o[l]}0===e?Xy(r,n,D,d,p):Xy(r,n,D,d)}return r}function Xy(e,t,n,r,o){let l;e.hasOwnProperty(n)?(l=e[n]).push(t,r):l=e[n]=[t,r],void 0!==o&&l.push(o)}function lo(e,t,n,r,o,l,c,d){const p=hr(t,n);let I,D=t.inputs;!d&&null!=D&&(I=D[r])?(Rm(e,n,I,r,o),di(t)&&function dE(e,t){const n=Ur(t,e);16&n[Le]||(n[Le]|=64)}(n,t.index)):3&t.type&&(r=function uE(e){return"class"===e?"className":"for"===e?"htmlFor":"formaction"===e?"formAction":"innerHtml"===e?"innerHTML":"readonly"===e?"readOnly":"tabindex"===e?"tabIndex":e}(r),o=null!=c?c(o,t.value||"",r):o,l.setProperty(p,r,o))}function Qy(e,t,n,r,o,l){for(let D=0;D0;){const n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(c)!=d&&c.push(d),c.push(n,r,l)}}(e,t,r,_r(e,n,o.hostVars,ot),o)}function ns(e,t,n,r,o,l){const c=hr(e,t);!function Tm(e,t,n,r,o,l,c){if(null==l)e.removeAttribute(t,o,n);else{const d=null==c?Xe(l):c(l,r||"",o);e.setAttribute(t,o,d,n)}}(t[Qe],c,l,e.value,n,r,o)}function bE(e,t,n,r,o,l){const c=l[t];if(null!==c)for(let d=0;d0&&(n[o-1][vn]=t),r!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{},consumerIsAlwaysLive:!0,consumerMarkedDirty:e=>{dl(e.lView)},consumerOnSignalRead(){this.lView[jo]=this}},s_=100;function Gh(e,t=!0,n=0){const r=e[Tr],o=r.rendererFactory;o.begin?.();try{!function OE(e,t){xm(e,t);let n=0;for(;Nu(e);){if(n===s_)throw new Ne(103,!1);n++,xm(e,1)}}(e,n)}catch(c){throw t&&Wh(e,c),c}finally{o.end?.(),r.inlineEffectRunner?.flush()}}function xE(e,t,n,r){const o=t[Le];if(!(256&~o))return;t[Tr].inlineEffectRunner?.flush(),to(t);let c=null,d=null;(function PE(e){return 2!==e.type})(e)&&(d=function TE(e){return e[jo]??function AE(e){const t=i_.pop()??Object.create(NE);return t.lView=e,t}(e)}(t),c=function ie(e){return e&&(e.nextProducerIndex=0),J(e)}(d));try{Ru(t),function If(e){return rt.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==n&&ts(e,t,n,2,r);const p=!(3&~o);if(p){const R=e.preOrderCheckHooks;null!==R&&mc(t,R,null)}else{const R=e.preOrderHooks;null!==R&&vc(t,R,0,null),Hu(t,0)}if(function kE(e){for(let t=_i(e);null!==t;t=cd(t)){if(!(t[Le]&ga.HasTransplantedViews))continue;const n=t[zi];for(let r=0;re.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}(d,c),function RE(e){e.lView[jo]!==e&&(e.lView=null,i_.push(e))}(d)),no()}}function a_(e,t){for(let n=_i(e);null!==n;n=cd(n))for(let r=hn;r-1&&(Ll(t,r),mo(n,r))}this._attachedToViewContainer=!1}Vl(this._lView[me],this._lView)}onDestroy(t){gc(this._lView,t)}markForCheck(){Fd(this._cdRefInjectingView||this._lView)}detach(){this._lView[Le]&=-129}reattach(){Ou(this._lView),this._lView[Le]|=128}detectChanges(){this._lView[Le]|=1024,Gh(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new Ne(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,Hh(this._lView[me],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new Ne(902,!1);this._appRef=t,Ou(this._lView)}}let Vd=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=UE}return e})();const LE=Vd,VE=class extends LE{constructor(t,n,r){super(),this._declarationLView=t,this._declarationTContainer=n,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,n){return this.createEmbeddedViewImpl(t,n)}createEmbeddedViewImpl(t,n,r){const o=function xd(e,t,n,r){const o=J(null);try{const l=t.tView,p=Br(e,l,n,4096&e[Le]?4096:16,null,t,null,null,r?.injector??null,r?.embeddedViewInjector??null,r?.dehydratedView??null);p[ui]=e[t.index];const I=e[Do];return null!==I&&(p[Do]=I.createEmbeddedView(l)),Nm(l,p,n),p}finally{J(o)}}(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:n,dehydratedView:r});return new Ld(o)}};function UE(){return zh(Ht(),ne())}function zh(e,t){return 4&e.type?new VE(t,e,Fs(e,t)):null}class Um{}class u0{}class m_{}class f0{resolveComponentFactory(t){throw function d0(e){const t=Error(`No component factory found for ${Qt(e)}.`);return t.ngComponent=e,t}(t)}}let Zh=(()=>{class e{static#e=this.NULL=new f0}return e})();class y_{}let h0=(()=>{class e{constructor(){this.destroyNode=null}static#e=this.__NG_ELEMENT_ID__=()=>function p0(){const e=ne(),n=Ur(Ht().index,e);return(Dn(n)?n:e)[Qe]}()}return e})(),g0=(()=>{class e{static#e=this.\u0275prov=It({token:e,providedIn:"root",factory:()=>null})}return e})();const jm={},__=new Set;function w_(...e){}class Un{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Kn(!1),this.onMicrotaskEmpty=new Kn(!1),this.onStable=new Kn(!1),this.onError=new Kn(!1),typeof Zone>"u")throw new Ne(908,!1);Zone.assertZonePatched();const o=this;o._nesting=0,o._outer=o._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(o._inner=o._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(o._inner=o._inner.fork(Zone.longStackTraceZoneSpec)),o.shouldCoalesceEventChangeDetection=!r&&n,o.shouldCoalesceRunChangeDetection=r,o.lastRequestAnimationFrameId=-1,o.nativeRequestAnimationFrame=function m0(){const e="function"==typeof tt.requestAnimationFrame;let t=tt[e?"requestAnimationFrame":"setTimeout"],n=tt[e?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&t&&n){const r=t[Zone.__symbol__("OriginalDelegate")];r&&(t=r);const o=n[Zone.__symbol__("OriginalDelegate")];o&&(n=o)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:n}}().nativeRequestAnimationFrame,function _0(e){const t=()=>{!function y0(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(tt,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,Hm(e),e.isCheckStableRunning=!0,Bm(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),Hm(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,r,o,l,c,d)=>{if(function w0(e){return!(!Array.isArray(e)||1!==e.length)&&!0===e[0].data?.__ignore_ng_zone__}(d))return n.invokeTask(o,l,c,d);try{return D_(e),n.invokeTask(o,l,c,d)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===l.type||e.shouldCoalesceRunChangeDetection)&&t(),C_(e)}},onInvoke:(n,r,o,l,c,d,p)=>{try{return D_(e),n.invoke(o,l,c,d,p)}finally{e.shouldCoalesceRunChangeDetection&&t(),C_(e)}},onHasTask:(n,r,o,l)=>{n.hasTask(o,l),r===o&&("microTask"==l.change?(e._hasPendingMicrotasks=l.microTask,Hm(e),Bm(e)):"macroTask"==l.change&&(e.hasPendingMacrotasks=l.macroTask))},onHandleError:(n,r,o,l)=>(n.handleError(o,l),e.runOutsideAngular(()=>e.onError.emit(l)),!1)})}(o)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Un.isInAngularZone())throw new Ne(909,!1)}static assertNotInAngularZone(){if(Un.isInAngularZone())throw new Ne(909,!1)}run(t,n,r){return this._inner.run(t,n,r)}runTask(t,n,r,o){const l=this._inner,c=l.scheduleEventTask("NgZoneEvent: "+o,t,v0,w_,w_);try{return l.runTask(c,n,r)}finally{l.cancelTask(c)}}runGuarded(t,n,r){return this._inner.runGuarded(t,n,r)}runOutsideAngular(t){return this._outer.run(t)}}const v0={};function Bm(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Hm(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function D_(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function C_(e){e._nesting--,Bm(e)}let $d=(()=>{class e{constructor(){this.handler=null,this.internalCallbacks=[]}execute(){this.executeInternalCallbacks(),this.handler?.execute()}executeInternalCallbacks(){const n=[...this.internalCallbacks];this.internalCallbacks.length=0;for(const r of n)r()}ngOnDestroy(){this.handler?.destroy(),this.handler=null,this.internalCallbacks.length=0}static#e=this.\u0275prov=It({token:e,providedIn:"root",factory:()=>new e})}return e})();function La(e){return!!Sn(e)}function Yh(e,t,n){let r=n?e.styles:null,o=n?e.classes:null,l=0;if(null!==t)for(let c=0;c0&&ka(e,n,l.join(" "))}}(U,Yn,re,r),void 0!==n&&function x0(e,t,n){const r=e.projection=[];for(let o=0;o{class e{static#e=this.__NG_ELEMENT_ID__=k0}return e})();function k0(){return x_(Ht(),ne())}const F0=tp,N_=class extends F0{constructor(t,n,r){super(),this._lContainer=t,this._hostTNode=n,this._hostLView=r}get element(){return Fs(this._hostTNode,this._hostLView)}get injector(){return new rn(this._hostTNode,this._hostLView)}get parentInjector(){const t=wc(this._hostTNode,this._hostLView);if(Gu(t)){const n=ml(t,this._hostLView),r=gl(t);return new rn(n[me].data[r+8],n)}return new rn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const n=O_(this._lContainer);return null!==n&&n[t]||null}get length(){return this._lContainer.length-hn}createEmbeddedView(t,n,r){let o,l;"number"==typeof r?o=r:null!=r&&(o=r.index,l=r.injector);const d=t.createEmbeddedViewImpl(n||{},l,null);return this.insertImpl(d,o,Kc(this._hostTNode,null)),d}createComponent(t,n,r,o,l){const c=t&&!function le(e){return"function"==typeof e}(t);let d;if(c)d=n;else{const W=n||{};d=W.index,r=W.injector,o=W.projectableNodes,l=W.environmentInjector||W.ngModuleRef}const p=c?t:new zd(dt(t)),D=r||this.parentInjector;if(!l&&null==p.ngModule){const re=(c?D:this.parentInjector).get(Gn,null);re&&(l=re)}dt(p.componentType??{});const U=p.create(D,o,null,l);return this.insertImpl(U.hostView,d,Kc(this._hostTNode,null)),U}insert(t,n){return this.insertImpl(t,n,!0)}insertImpl(t,n,r){const o=t._lView;if(function Kp(e){return Cn(e[Pt])}(o)){const d=this.indexOf(t);if(-1!==d)this.detach(d);else{const p=o[Pt],D=new N_(p,p[zt],p[Pt]);D.detach(D.indexOf(t))}}const l=this._adjustIndex(n),c=this._lContainer;return Pd(c,o,l,r),t.attachToViewContainerRef(),ta(zm(c),l,t),t}move(t,n){return this.insert(t,n)}indexOf(t){const n=O_(this._lContainer);return null!==n?n.indexOf(t):-1}remove(t){const n=this._adjustIndex(t,-1),r=Ll(this._lContainer,n);r&&(mo(zm(this._lContainer),n),Vl(r[me],r))}detach(t){const n=this._adjustIndex(t,-1),r=Ll(this._lContainer,n);return r&&null!=mo(zm(this._lContainer),n)?new Ld(r):null}_adjustIndex(t,n=0){return t??this.length+n}};function O_(e){return e[8]}function zm(e){return e[8]||(e[8]=[])}function x_(e,t){let n;const r=t[e.index];return Cn(r)?n=r:(n=function Jy(e,t,n,r){return[e,!0,0,t,null,r,null,n,null,null]}(r,t,null,e),t[e.index]=n,$h(t,n)),P_(n,t,e,r),new N_(n,e,t)}let P_=function F_(e,t,n,r){if(e[Vr])return;let o;o=8&n.type?jt(r):function L0(e,t){const n=e[Qe],r=n.createComment(""),o=hr(t,e);return m(n,z(n,o),r,function fe(e,t){return e.nextSibling(t)}(n,o),!1),r}(t,n),e[Vr]=o};class Km{constructor(t){this.queryList=t,this.matches=null}clone(){return new Km(this.queryList)}setDirty(){this.queryList.setDirty()}}class Xm{constructor(t=[]){this.queries=t}createEmbeddedView(t){const n=t.queries;if(null!==n){const r=null!==t.contentQueries?t.contentQueries[0]:n.length,o=[];for(let l=0;lt.trim())}(t):t}}class Qm{constructor(t=[]){this.queries=t}elementStart(t,n){for(let r=0;r0)r.push(c[d/2]);else{const D=l[d+1],I=t[-p];for(let R=hn;R=0;r--){const o=e[r];o.hostVars=t+=o.hostVars,o.hostAttrs=Li(o.hostAttrs,n=Li(n,o.hostAttrs))}}(r)}function rS(e,t){for(const n in t.inputs){if(!t.inputs.hasOwnProperty(n)||e.inputs.hasOwnProperty(n))continue;const r=t.inputs[n];if(void 0!==r&&(e.inputs[n]=r,e.declaredInputs[n]=t.declaredInputs[n],null!==t.inputTransforms)){const o=Array.isArray(r)?r[0]:r;if(!t.inputTransforms.hasOwnProperty(o))continue;e.inputTransforms??={},e.inputTransforms[o]=t.inputTransforms[o]}}}function rp(e){return e===Sr?{}:e===Et?[]:e}function iS(e,t){const n=e.viewQuery;e.viewQuery=n?(r,o)=>{t(r,o),n(r,o)}:t}function sS(e,t){const n=e.contentQueries;e.contentQueries=n?(r,o,l)=>{t(r,o,l),n(r,o,l)}:t}function aS(e,t){const n=e.hostBindings;e.hostBindings=n?(r,o)=>{t(r,o),n(r,o)}:t}function aw(e){const t=e.inputConfig,n={};for(const r in t)if(t.hasOwnProperty(r)){const o=t[r];Array.isArray(o)&&o[3]&&(n[r]=o[3])}e.inputTransforms=n}class Hl{}class lw{}function hS(e,t){return new rv(e,t??null,[])}class rv extends Hl{constructor(t,n,r){super(),this._parent=n,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new A_(this);const o=Sn(t);this._bootstrapComponents=io(o.bootstrap),this._r3Injector=bc(t,n,[{provide:Hl,useValue:this},{provide:Zh,useValue:this.componentFactoryResolver},...r],Qt(t),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(t)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class ov extends lw{constructor(t){super(),this.moduleType=t}create(t){return new rv(this.moduleType,t,[])}}class cw extends Hl{constructor(t){super(),this.componentFactoryResolver=new A_(this),this.instance=null;const n=new li([...t.providers,{provide:Hl,useValue:this},{provide:Zh,useValue:this.componentFactoryResolver}],t.parent||Bi(),t.debugName,new Set(["environment"]));this.injector=n,t.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function iv(e,t,n=null){return new cw({providers:e,parent:t,debugName:n,runEnvironmentInitializers:!0}).injector}let Zc=(()=>{class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new sr.t(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const n=this.taskId++;return this.pendingTasks.add(n),n}remove(n){this.pendingTasks.delete(n),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=It({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function ip(e){return!!sv(e)&&(Array.isArray(e)||!(e instanceof Map)&&Symbol.iterator in e)}function sv(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function Mn(e,t,n){return!Object.is(e[t],n)&&(e[t]=n,!0)}function mv(e,t,n,r){const o=ne();return Mn(o,Co(),t)&&(yt(),ns(wt(),o,e,t,n,r)),mv}function fp(e,t){return e<<17|t<<2}function ja(e){return e>>17&32767}function vv(e){return 2|e}function Gl(e){return(131068&e)>>2}function yv(e,t){return-131069&e|t<<2}function _v(e){return 1|e}function Hw(e,t,n,r){const o=e[n+1],l=null===t;let c=r?ja(o):Gl(o),d=!1;for(;0!==c&&(!1===d||l);){const D=e[c+1];iI(e[c],t)&&(d=!0,e[c+1]=r?_v(D):vv(D)),c=r?ja(D):Gl(D)}d&&(e[n+1]=r?vv(o):_v(o))}function iI(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&$n(e,t)>=0}function wv(e,t,n){const r=ne();return Mn(r,Co(),t)&&lo(yt(),wt(),r,e,t,r[Qe],n,!1),wv}function Dv(e,t,n,r,o){const c=o?"class":"style";Rm(e,n,t.inputs[c],c,r)}function Cv(e,t){return function Ci(e,t,n,r){const o=ne(),l=yt(),c=function gi(e){const t=rt.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}(2);l.firstUpdatePass&&function Zw(e,t,n,r){const o=e.data;if(null===o[n+1]){const l=o[Ln()],c=function Qw(e,t){return t>=e.expandoStartIndex}(e,n);(function tD(e,t){return!!(e.flags&(t?8:16))})(l,r)&&null===t&&!c&&(t=!1),t=function pI(e,t,n,r){const o=function Lu(e){const t=rt.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}(e);let l=r?t.residualClasses:t.residualStyles;if(null===o)0===(r?t.classBindings:t.styleBindings)&&(n=ef(n=bv(null,e,t,n,r),t.attrs,r),l=null);else{const c=t.directiveStylingLast;if(-1===c||e[c]!==o)if(n=bv(o,e,t,n,r),null===l){let p=function gI(e,t,n){const r=n?t.classBindings:t.styleBindings;if(0!==Gl(r))return e[ja(r)]}(e,t,r);void 0!==p&&Array.isArray(p)&&(p=bv(null,e,t,p[1],r),p=ef(p,t.attrs,r),function mI(e,t,n,r){e[ja(n?t.classBindings:t.styleBindings)]=r}(e,t,r,p))}else l=function vI(e,t,n){let r;const o=t.directiveEnd;for(let l=1+t.directiveStylingLast;l0)&&(D=!0)):I=n,o)if(0!==p){const L=ja(e[d+1]);e[r+1]=fp(L,d),0!==L&&(e[L+1]=yv(e[L+1],r)),e[d+1]=function tI(e,t){return 131071&e|t<<17}(e[d+1],r)}else e[r+1]=fp(d,0),0!==d&&(e[d+1]=yv(e[d+1],r)),d=r;else e[r+1]=fp(p,0),0===d?d=r:e[p+1]=yv(e[p+1],r),p=r;D&&(e[r+1]=vv(e[r+1])),Hw(e,I,r,!0),Hw(e,I,r,!1),function oI(e,t,n,r,o){const l=o?e.residualClasses:e.residualStyles;null!=l&&"string"==typeof t&&$n(l,t)>=0&&(n[r+1]=_v(n[r+1]))}(t,I,e,r,l),c=fp(d,p),l?t.classBindings=c:t.styleBindings=c}(o,l,t,n,c,r)}}(l,e,c,r),t!==ot&&Mn(o,c,t)&&function Yw(e,t,n,r,o,l,c,d){if(!(3&t.type))return;const p=e.data,D=p[d+1],I=function nI(e){return!(1&~e)}(D)?eD(p,t,n,o,Gl(D),c):void 0;hp(I)||(hp(l)||function eI(e){return!(2&~e)}(D)&&(l=eD(p,null,n,o,d,c)),function qo(e,t,n,r,o){if(t)o?e.addClass(n,r):e.removeClass(n,r);else{let l=-1===r.indexOf("-")?void 0:Hc.DashCase;null==o?e.removeStyle(n,r,l):("string"==typeof o&&o.endsWith("!important")&&(o=o.slice(0,-10),l|=Hc.Important),e.setStyle(n,r,o,l))}}(r,c,cl(Ln(),n),o,l))}(l,l.data[Ln()],o,o[Qe],e,o[c+1]=function DI(e,t){return null==e||""===e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Qt(Di(e)))),e}(t,n),r,c)}(e,t,null,!0),Cv}function bv(e,t,n,r,o){let l=null;const c=n.directiveEnd;let d=n.directiveStylingLast;for(-1===d?d=n.directiveStart:d++;d0;){const p=e[o],D=Array.isArray(p),I=D?p[1]:p,R=null===I;let L=n[o+1];L===ot&&(L=R?Et:void 0);let U=R?vs(L,r):I===r?L:void 0;if(D&&!hp(U)&&(U=vs(p,r)),hp(U)&&(d=U,c))return d;const W=e[o+1];o=c?ja(W):Gl(W)}if(null!==t){let p=l?t.residualClasses:t.residualStyles;null!=p&&(d=vs(p,r))}return d}function hp(e){return void 0!==e}function pp(e,t,n,r){const o=ne(),l=yt(),c=it+e,d=o[Qe],p=l.firstCreatePass?function WI(e,t,n,r,o,l){const c=t.consts,p=Hr(t,e,2,r,Ho(c,o));return function Im(e,t,n,r){if(wf()){const o=null===r?null:{"":-1},l=function vE(e,t){const n=e.directiveRegistry;let r=null,o=null;if(n)for(let l=0;l(ro(!0),Gc(r,o,function Rf(){return rt.lFrame.currentNamespace}()));function lD(){return ne()}const zl=void 0;var ZI=["en",[["a","p"],["AM","PM"],zl],[["AM","PM"],zl,zl],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],zl,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],zl,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",zl,"{1} 'at' {0}",zl],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function QI(e){const n=Math.floor(Math.abs(e)),r=e.toString().replace(/^[^.]*\.?/,"").length;return 1===n&&0===r?1:5}];let pu={};function Nv(e){const t=function JI(e){return e.toLowerCase().replace(/_/g,"-")}(e);let n=fD(t);if(n)return n;const r=t.split("-")[0];if(n=fD(r),n)return n;if("en"===r)return ZI;throw new Ne(701,!1)}function dD(e){return Nv(e)[gu.PluralCase]}function fD(e){return e in pu||(pu[e]=tt.ng&&tt.ng.common&&tt.ng.common.locales&&tt.ng.common.locales[e]),pu[e]}var gu=function(e){return e[e.LocaleId=0]="LocaleId",e[e.DayPeriodsFormat=1]="DayPeriodsFormat",e[e.DayPeriodsStandalone=2]="DayPeriodsStandalone",e[e.DaysFormat=3]="DaysFormat",e[e.DaysStandalone=4]="DaysStandalone",e[e.MonthsFormat=5]="MonthsFormat",e[e.MonthsStandalone=6]="MonthsStandalone",e[e.Eras=7]="Eras",e[e.FirstDayOfWeek=8]="FirstDayOfWeek",e[e.WeekendRange=9]="WeekendRange",e[e.DateFormat=10]="DateFormat",e[e.TimeFormat=11]="TimeFormat",e[e.DateTimeFormat=12]="DateTimeFormat",e[e.NumberSymbols=13]="NumberSymbols",e[e.NumberFormats=14]="NumberFormats",e[e.CurrencyCode=15]="CurrencyCode",e[e.CurrencySymbol=16]="CurrencySymbol",e[e.CurrencyName=17]="CurrencyName",e[e.Currencies=18]="Currencies",e[e.Directionality=19]="Directionality",e[e.PluralCase=20]="PluralCase",e[e.ExtraData=21]="ExtraData",e}(gu||{});const mu="en-US";let hD=mu;function Pv(e,t,n,r){const o=ne(),l=yt(),c=Ht();return kv(l,o,o[Qe],c,e,t,r),Pv}function kv(e,t,n,r,o,l,c){const d=ma(r),D=e.firstCreatePass&&t_(e),I=t[Bt],R=e_(t);let L=!0;if(3&r.type||c){const re=hr(r,t),we=c?c(re):re,Re=R.length,ue=c?kt=>c(jt(kt[r.index])):r.index;let nt=null;if(!c&&d&&(nt=function KM(e,t,n,r){const o=e.cleanup;if(null!=o)for(let l=0;lp?d[p]:null}"string"==typeof c&&(l+=2)}return null}(e,t,o,r.index)),null!==nt)(nt.__ngLastListenerFn__||nt).__ngNextListenerFn__=l,nt.__ngLastListenerFn__=l,L=!1;else{l=BD(r,t,I,l,!1);const kt=n.listen(we,o,l);R.push(l,kt),D&&D.push(o,ue,Re,Re+1)}}else l=BD(r,t,I,l,!1);const U=r.outputs;let W;if(L&&null!==U&&(W=U[o])){const re=W.length;if(re)for(let we=0;we-1?Ur(e.index,t):t);let p=jD(t,n,r,c),D=l.__ngNextListenerFn__;for(;D;)p=jD(t,n,D,c)&&p,D=D.__ngNextListenerFn__;return o&&!1===p&&c.preventDefault(),p}}function ZD(e,t,n,r){!function B_(e,t,n,r){const o=yt();if(o.firstCreatePass){const l=Ht();H_(o,new L_(t,n,r),l.index),function z0(e,t){const n=e.contentQueries||(e.contentQueries=[]);t!==(n.length?n[n.length-1]:-1)&&n.push(e.queries.length-1,t)}(o,e),!(2&~n)&&(o.staticContentQueries=!0)}return U_(o,ne(),n)}(e,t,n,r)}function JD(e,t,n){!function j_(e,t,n){const r=yt();return r.firstCreatePass&&(H_(r,new L_(e,t,n),-1),!(2&~t)&&(r.staticViewQueries=!0)),U_(r,ne(),t)}(e,t,n)}function YD(e){const t=ne(),n=yt(),r=Vu();hl(r+1);const o=ev(n,r);if(e.dirty&&function qp(e){return!(4&~e[Le])}(t)===!(2&~o.metadata.flags)){if(null===o.matches)e.reset([]);else{const l=$_(t,r);e.reset(l,Qf),e.notifyOnChanges()}return!0}return!1}function eC(){return function Ym(e,t){return e[Do].queries[t].queryList}(ne(),Vu())}function tC(e){return ya(function tg(){return rt.lFrame.contextLView}(),it+e)}function dC(e,t=""){const n=ne(),r=yt(),o=e+it,l=r.firstCreatePass?Hr(r,o,1,t,null):r.data[o],c=fC(r,n,l,t,e);n[o]=c,Os()&&Ct(r,n,c,l),$o(l,!1)}let fC=(e,t,n,r,o)=>(ro(!0),function Nd(e,t){return e.createText(t)}(t[Qe],r));function Lv(e){return Vv("",e,""),Lv}function Vv(e,t,n){const r=ne(),o=function iu(e,t,n,r){return Mn(e,Co(),n)?t+Xe(n)+r:ot}(r,e,t,n);return o!==ot&&function Gs(e,t,n){const r=cl(t,e);!function ym(e,t,n){e.setValue(t,n)}(e[Qe],r,n)}(r,Ln(),o),Vv}function Uv(e,t,n){z_(t)&&(t=t());const r=ne();return Mn(r,Co(),t)&&lo(yt(),wt(),r,e,t,r[Qe],n,!1),Uv}function DC(e,t){const n=z_(e);return n&&e.set(t),n}function jv(e,t){const n=ne(),r=yt(),o=Ht();return kv(r,n,n[Qe],o,e,t),jv}function Bv(e,t,n,r,o){if(e=$(e),Array.isArray(e))for(let l=0;l>20;if(_o(e)||!e.multi){const U=new pl(D,o,es),W=$v(p,t,o?I:I+L,R);-1===W?(yl(_c(d,c),l,p),Hv(l,e,t.length),t.push(p),d.directiveStart++,d.directiveEnd++,o&&(d.providerIndexes+=1048576),n.push(U),c.push(U)):(n[W]=U,c[W]=U)}else{const U=$v(p,t,I+L,R),W=$v(p,t,I,I+L),we=W>=0&&n[W];if(o&&!we||!o&&!(U>=0&&n[U])){yl(_c(d,c),l,p);const Re=function vT(e,t,n,r,o){const l=new pl(e,n,es);return l.multi=[],l.index=t,l.componentProviders=0,CC(l,o,r&&!n),l}(o?mT:gT,n.length,o,r,D);!o&&we&&(n[W].providerFactory=Re),Hv(l,e,t.length,0),t.push(p),d.directiveStart++,d.directiveEnd++,o&&(d.providerIndexes+=1048576),n.push(Re),c.push(Re)}else Hv(l,e,U>-1?U:W,CC(n[o?W:U],D,!o&&r));!o&&r&&we&&n[W].componentProviders++}}}function Hv(e,t,n,r){const o=_o(t),l=function nl(e){return!!e.useClass}(t);if(o||l){const p=(l?$(t.useClass):t).prototype.ngOnDestroy;if(p){const D=e.destroyHooks||(e.destroyHooks=[]);if(!o&&t.multi){const I=D.indexOf(n);-1===I?D.push(n,[r,p]):D[I+1].push(r,p)}else D.push(n,p)}}}function CC(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function $v(e,t,n,r){for(let o=n;o{n.providersResolver=(r,o)=>function pT(e,t,n){const r=yt();if(r.firstCreatePass){const o=Ar(e);Bv(n,r.data,r.blueprint,o,!0),Bv(t,r.data,r.blueprint,o,!1)}}(r,o?o(e):e,t)}}let yT=(()=>{class e{constructor(n){this._injector=n,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n)){const r=Ui(0,n.type),o=r.length>0?iv([r],this._injector,`Standalone[${n.type.name}]`):null;this.cachedInjectors.set(n,o)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(const n of this.cachedInjectors.values())null!==n&&n.destroy()}finally{this.cachedInjectors.clear()}}static#e=this.\u0275prov=It({token:e,providedIn:"environment",factory:()=>new e(fn(Gn))})}return e})();function EC(e){(function rs(e){__.has(e)||(__.add(e),performance?.mark?.("mark_feature_usage",{detail:{feature:e}}))})("NgStandalone"),e.getStandaloneInjector=t=>t.get(yT).getOrCreateStandaloneInjector(e)}function IC(e,t,n,r,o,l){const c=t+n;return Mn(e,c,o)?function os(e,t,n){return e[t]=n}(e,c+1,l?r.call(l,o):r(o)):function cf(e,t){const n=e[t];return n===ot?void 0:n}(e,c+1)}function NC(e,t){const n=yt();let r;const o=e+it;n.firstCreatePass?(r=function NT(e,t){if(t)for(let n=t.length-1;n>=0;n--){const r=t[n];if(e===r.name)return r}}(t,n.pipeRegistry),n.data[o]=r,r.onDestroy&&(n.destroyHooks??=[]).push(o,r.onDestroy)):r=n.data[o];const l=r.factory||(r.factory=go(r.type)),d=Pn(es);try{const p=yc(!1),D=l();return yc(p),function nT(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}(n,ne(),o,D),D}finally{Pn(d)}}function OC(e,t,n){const r=e+it,o=ne(),l=ya(o,r);return function uf(e,t){return e[me].data[t].pure}(o,r)?IC(o,function pr(){const e=rt.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}(),t,l.transform,n,l):l.transform(n)}class KC{constructor(t){this.full=t;const n=t.split(".");this.major=n[0],this.minor=n[1],this.patch=n.slice(2).join(".")}}let XC=(()=>{class e{log(n){console.log(n)}warn(n){console.warn(n)}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=It({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();const eb=new Ke(""),tb=new Ke("");let Qv,AA=(()=>{class e{constructor(n,r,o){this._ngZone=n,this.registry=r,this._pendingCount=0,this._isZoneStable=!0,this._callbacks=[],this.taskTrackingZone=null,Qv||(function RA(e){Qv=e}(o),o.addToWindow(r)),this._watchAngularEvents(),n.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Un.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;0!==this._callbacks.length;){let n=this._callbacks.pop();clearTimeout(n.timeoutId),n.doneCb()}});else{let n=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(n)||(clearTimeout(r.timeoutId),!1))}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(n=>({source:n.source,creationLocation:n.creationLocation,data:n.data})):[]}addCallback(n,r,o){let l=-1;r&&r>0&&(l=setTimeout(()=>{this._callbacks=this._callbacks.filter(c=>c.timeoutId!==l),n()},r)),this._callbacks.push({doneCb:n,timeoutId:l,updateCb:o})}whenStable(n,r,o){if(o&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(n,r,o),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(n){this.registry.registerApplication(n,this)}unregisterApplication(n){this.registry.unregisterApplication(n)}findProviders(n,r,o){return[]}static#e=this.\u0275fac=function(r){return new(r||e)(fn(Un),fn(nb),fn(tb))};static#t=this.\u0275prov=It({token:e,factory:e.\u0275fac})}return e})(),nb=(()=>{class e{constructor(){this._applications=new Map}registerApplication(n,r){this._applications.set(n,r)}unregisterApplication(n){this._applications.delete(n)}unregisterAllApplications(){this._applications.clear()}getTestability(n){return this._applications.get(n)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(n,r=!0){return Qv?.findTestabilityInTree(this,n,r)??null}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=It({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();function Zv(e){return!!e&&"function"==typeof e.then}function rb(e){return!!e&&"function"==typeof e.subscribe}const NA=new Ke("");let Jv=(()=>{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((n,r)=>{this.resolve=n,this.reject=r}),this.appInits=je(NA,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const n=[];for(const o of this.appInits){const l=o();if(Zv(l))n.push(l);else if(rb(l)){const c=new Promise((d,p)=>{l.subscribe({complete:d,error:p})});n.push(c)}}const r=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{r()}).catch(o=>{this.reject(o)}),0===n.length&&r(),this.initialized=!0}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=It({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Yv=new Ke("");let Ba=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=je(qf),this.afterRenderEffectManager=je($d),this.externalTestViews=new Set,this.beforeRender=new Vt.B,this.afterTick=new Vt.B,this.componentTypes=[],this.components=[],this.isStable=je(Zc).hasPendingTasks.pipe((0,On.T)(n=>!n)),this._injector=je(Gn)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(n,r){const o=n instanceof m_;if(!this._injector.get(Jv).done)throw!o&&Wn(n),new Ne(405,!1);let c;c=o?n:this._injector.get(Zh).resolveComponentFactory(n),this.componentTypes.push(c.componentType);const d=function OA(e){return e.isBoundToModule}(c)?void 0:this._injector.get(Hl),D=c.create(jr.NULL,[],r||c.selector,d),I=D.location.nativeElement,R=D.injector.get(eb,null);return R?.registerApplication(I),D.onDestroy(()=>{this.detachView(D.hostView),bp(this.components,D),R?.unregisterApplication(I)}),this._loadComponent(D),D}tick(){this._tick(!0)}_tick(n){if(this._runningTick)throw new Ne(101,!1);const r=J(null);try{this._runningTick=!0,this.detectChangesInAttachedViews(n)}catch(o){this.internalErrorHandler(o)}finally{this.afterTick.next(),this._runningTick=!1,J(r)}}detectChangesInAttachedViews(n){let r=0;const o=this.afterRenderEffectManager;for(;;){if(r===s_)throw new Ne(103,!1);if(n){const l=0===r;this.beforeRender.next(l);for(let{_lView:c,notifyErrorHandler:d}of this._views)PA(c,l,d)}if(r++,o.executeInternalCallbacks(),![...this.externalTestViews.keys(),...this._views].some(({_lView:l})=>ey(l))&&(o.execute(),![...this.externalTestViews.keys(),...this._views].some(({_lView:l})=>ey(l))))break}}attachView(n){const r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){const r=n;bp(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView),this.tick(),this.components.push(n);const r=this._injector.get(Yv,[]);[...this._bootstrapListeners,...r].forEach(o=>o(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>bp(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new Ne(406,!1);const n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=It({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function bp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}function PA(e,t,n){!t&&!ey(e)||function kA(e,t,n){let r;n?(r=0,e[Le]|=1024):r=64&e[Le]?0:1,Gh(e,t,r)}(e,n,t)}function ey(e){return Nu(e)}class FA{constructor(t,n){this.ngModuleFactory=t,this.componentFactories=n}}let LA=(()=>{class e{compileModuleSync(n){return new ov(n)}compileModuleAsync(n){return Promise.resolve(this.compileModuleSync(n))}compileModuleAndAllComponentsSync(n){const r=this.compileModuleSync(n),l=io(Sn(n).declarations).reduce((c,d)=>{const p=dt(d);return p&&c.push(new zd(p)),c},[]);return new FA(r,l)}compileModuleAndAllComponentsAsync(n){return Promise.resolve(this.compileModuleAndAllComponentsSync(n))}clearCache(){}clearCacheFor(n){}getModuleId(n){}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=It({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),jA=(()=>{class e{constructor(){this.zone=je(Un),this.applicationRef=je(Ba)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=It({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function lb(e){return[{provide:Un,useFactory:e},{provide:oi,multi:!0,useFactory:()=>{const t=je(jA,{optional:!0});return()=>t.initialize()}},{provide:oi,multi:!0,useFactory:()=>{const t=je($A);return()=>{t.initialize()}}},{provide:qf,useFactory:BA}]}function BA(){const e=je(Un),t=je(vi);return n=>e.runOutsideAngular(()=>t.handleError(n))}function HA(e){return Is([[],lb(()=>new Un(function cb(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}(e)))])}let $A=(()=>{class e{constructor(){this.subscription=new pn.yU,this.initialized=!1,this.zone=je(Un),this.pendingTasks=je(Zc)}initialize(){if(this.initialized)return;this.initialized=!0;let n=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(n=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{Un.assertNotInAngularZone(),queueMicrotask(()=>{null!==n&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(n),n=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{Un.assertInAngularZone(),n??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=It({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Sp=new Ke("",{providedIn:"root",factory:()=>je(Sp,pt.Optional|pt.SkipSelf)||function WA(){return typeof $localize<"u"&&$localize.locale||mu}()}),GA=new Ke("",{providedIn:"root",factory:()=>"USD"}),ty=new Ke("");let Ha=null;function QA(){return!1}let gb=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=ZA}return e})();function ZA(e){return function JA(e,t,n){if(di(e)&&!n){const r=Ur(e.index,t);return new Ld(r,r)}return 47&e.type?new Ld(t[qt],t):null}(Ht(),ne(),!(16&~e))}class _b{constructor(){}supports(t){return ip(t)}create(t){return new rR(t)}}const nR=(e,t)=>t;class rR{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||nR}forEachItem(t){let n;for(n=this._itHead;null!==n;n=n._next)t(n)}forEachOperation(t){let n=this._itHead,r=this._removalsHead,o=0,l=null;for(;n||r;){const c=!r||n&&n.currentIndex{c=this._trackByFn(o,d),null!==n&&Object.is(n.trackById,c)?(r&&(n=this._verifyReinsertion(n,d,c,o)),Object.is(n.item,d)||this._addIdentityChange(n,d)):(n=this._mismatch(n,d,c,o),r=!0),n=n._next,o++}),this.length=o;return this._truncate(n),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,n,r,o){let l;return null===t?l=this._itTail:(l=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._reinsertAfter(t,l,o)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(r,o))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._moveAfter(t,l,o)):t=this._addAfter(new oR(n,r),l,o),t}_verifyReinsertion(t,n,r,o){let l=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==l?t=this._reinsertAfter(l,t._prev,o):t.currentIndex!=o&&(t.currentIndex=o,this._addToMoves(t,o)),t}_truncate(t){for(;null!==t;){const n=t._next;this._addToRemovals(this._unlink(t)),t=n}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,n,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const o=t._prevRemoved,l=t._nextRemoved;return null===o?this._removalsHead=l:o._nextRemoved=l,null===l?this._removalsTail=o:l._prevRemoved=o,this._insertAfter(t,n,r),this._addToMoves(t,r),t}_moveAfter(t,n,r){return this._unlink(t),this._insertAfter(t,n,r),this._addToMoves(t,r),t}_addAfter(t,n,r){return this._insertAfter(t,n,r),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,n,r){const o=null===n?this._itHead:n._next;return t._next=o,t._prev=n,null===o?this._itTail=t:o._prev=t,null===n?this._itHead=t:n._next=t,null===this._linkedRecords&&(this._linkedRecords=new wb),this._linkedRecords.put(t),t.currentIndex=r,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const n=t._prev,r=t._next;return null===n?this._itHead=r:n._next=r,null===r?this._itTail=n:r._prev=n,t}_addToMoves(t,n){return t.previousIndex===n||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new wb),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,n){return t.item=n,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class oR{constructor(t,n){this.item=t,this.trackById=n,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class iR{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,n){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===n||n<=r.currentIndex)&&Object.is(r.trackById,t))return r;return null}remove(t){const n=t._prevDup,r=t._nextDup;return null===n?this._head=r:n._nextDup=r,null===r?this._tail=n:r._prevDup=n,null===this._head}}class wb{constructor(){this.map=new Map}put(t){const n=t.trackById;let r=this.map.get(n);r||(r=new iR,this.map.set(n,r)),r.add(t)}get(t,n){const o=this.map.get(t);return o?o.get(t,n):null}remove(t){const n=t.trackById;return this.map.get(n).remove(t)&&this.map.delete(n),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Db(e,t,n){const r=e.previousIndex;if(null===r)return r;let o=0;return n&&r{if(n&&n.key===o)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{const l=this._getOrCreateRecordForKey(o,r);n=this._insertBeforeOrAppend(n,l)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,n){if(t){const r=t._prev;return n._next=t,n._prev=r,t._prev=n,r&&(r._next=n),t===this._mapHead&&(this._mapHead=n),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(t,n){if(this._records.has(t)){const o=this._records.get(t);this._maybeAddToChanges(o,n);const l=o._prev,c=o._next;return l&&(l._next=c),c&&(c._prev=l),o._next=null,o._prev=null,o}const r=new aR(t);return this._records.set(t,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,n){Object.is(n,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=n,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,n){t instanceof Map?t.forEach(n):Object.keys(t).forEach(r=>n(t[r],r))}}class aR{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function bb(){return new ay([new _b])}let ay=(()=>{class e{static#e=this.\u0275prov=It({token:e,providedIn:"root",factory:bb});constructor(n){this.factories=n}static create(n,r){if(null!=r){const o=r.factories.slice();n=n.concat(o)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||bb()),deps:[[e,new ki,new Pi]]}}find(n){const r=this.factories.find(o=>o.supports(n));if(null!=r)return r;throw new Ne(901,!1)}}return e})();function Eb(){return new ly([new Cb])}let ly=(()=>{class e{static#e=this.\u0275prov=It({token:e,providedIn:"root",factory:Eb});constructor(n){this.factories=n}static create(n,r){if(r){const o=r.factories.slice();n=n.concat(o)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||Eb()),deps:[[e,new ki,new Pi]]}}find(n){const r=this.factories.find(o=>o.supports(n));if(r)return r;throw new Ne(901,!1)}}return e})();function ER(e){try{const{rootComponent:t,appProviders:n,platformProviders:r}=e,o=function XA(e=[]){if(Ha)return Ha;const t=function fb(e=[],t){return jr.create({name:t,providers:[{provide:fr,useValue:"platform"},{provide:ty,useValue:new Set([()=>Ha=null])},...e]})}(e);return Ha=t,function ob(){!function dn(e){Rn=e}(()=>{throw new Ne(600,!1)})}(),function hb(e){e.get(Vs,null)?.forEach(n=>n())}(t),t}(r),l=[HA(),...n||[]],d=new cw({providers:l,parent:o,debugName:"",runEnvironmentInitializers:!1}).injector,p=d.get(Un);return p.run(()=>{d.resolveInjectorInitializers();const D=d.get(vi,null);let I;p.runOutsideAngular(()=>{I=p.onError.subscribe({next:U=>{D.handleError(U)}})});const R=()=>d.destroy(),L=o.get(ty);return L.add(R),d.onDestroy(()=>{I.unsubscribe(),L.delete(R)}),function ib(e,t,n){try{const r=n();return Zv(r)?r.catch(o=>{throw t.runOutsideAngular(()=>e.handleError(o)),o}):r}catch(r){throw t.runOutsideAngular(()=>e.handleError(r)),r}}(D,p,()=>{const U=d.get(Jv);return U.runInitializers(),U.donePromise.then(()=>{!function pD(e){"string"==typeof e&&(hD=e.toLowerCase().replace(/_/g,"-"))}(d.get(Sp,mu)||mu);const re=d.get(Ba);return void 0!==t&&re.bootstrap(t),re})})})}catch(t){return Promise.reject(t)}}function UR(e){return"boolean"==typeof e?e:null!=e&&"false"!==e}function BR(e){const t=J(null);try{return e()}finally{J(t)}}},345:(Ue,he,O)=>{"use strict";O.d(he,{B8:()=>ee,hE:()=>jn});var C=O(4438),N=O(177);class w extends N.VF{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class j extends w{static makeCurrent(){(0,N.ZD)(new j)}onAndCancel(G,k,B){return G.addEventListener(k,B),()=>{G.removeEventListener(k,B)}}dispatchEvent(G,k){G.dispatchEvent(k)}remove(G){G.parentNode&&G.parentNode.removeChild(G)}createElement(G,k){return(k=k||this.getDefaultDocument()).createElement(G)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(G){return G.nodeType===Node.ELEMENT_NODE}isShadowRoot(G){return G instanceof DocumentFragment}getGlobalEventTarget(G,k){return"window"===k?window:"document"===k?G:"body"===k?G.body:null}getBaseHref(G){const k=function De(){return Q=Q||document.querySelector("base"),Q?Q.getAttribute("href"):null}();return null==k?null:function J($){return new URL($,document.baseURI).pathname}(k)}resetBaseElement(){Q=null}getUserAgent(){return window.navigator.userAgent}getCookie(G){return(0,N._b)(document.cookie,G)}}let Q=null,ge=(()=>{class ${build(){return new XMLHttpRequest}static#e=this.\u0275fac=function(B){return new(B||$)};static#t=this.\u0275prov=C.jDH({token:$,factory:$.\u0275fac})}return $})();const te=new C.nKC("");let Z=(()=>{class ${constructor(k,B){this._zone=B,this._eventNameToPlugin=new Map,k.forEach(ce=>{ce.manager=this}),this._plugins=k.slice().reverse()}addEventListener(k,B,ce){return this._findPluginFor(B).addEventListener(k,B,ce)}getZone(){return this._zone}_findPluginFor(k){let B=this._eventNameToPlugin.get(k);if(B)return B;if(B=this._plugins.find(ke=>ke.supports(k)),!B)throw new C.wOt(5101,!1);return this._eventNameToPlugin.set(k,B),B}static#e=this.\u0275fac=function(B){return new(B||$)(C.KVO(te),C.KVO(C.SKi))};static#t=this.\u0275prov=C.jDH({token:$,factory:$.\u0275fac})}return $})();class se{constructor(G){this._doc=G}}const Te="ng-app-id";let ae=(()=>{class ${constructor(k,B,ce,ke={}){this.doc=k,this.appId=B,this.nonce=ce,this.platformId=ke,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=(0,N.Vy)(ke),this.resetHostNodes()}addStyles(k){for(const B of k)1===this.changeUsageCount(B,1)&&this.onStyleAdded(B)}removeStyles(k){for(const B of k)this.changeUsageCount(B,-1)<=0&&this.onStyleRemoved(B)}ngOnDestroy(){const k=this.styleNodesInDOM;k&&(k.forEach(B=>B.remove()),k.clear());for(const B of this.getAllStyles())this.onStyleRemoved(B);this.resetHostNodes()}addHost(k){this.hostNodes.add(k);for(const B of this.getAllStyles())this.addStyleToHost(k,B)}removeHost(k){this.hostNodes.delete(k)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(k){for(const B of this.hostNodes)this.addStyleToHost(B,k)}onStyleRemoved(k){const B=this.styleRef;B.get(k)?.elements?.forEach(ce=>ce.remove()),B.delete(k)}collectServerRenderedStyles(){const k=this.doc.head?.querySelectorAll(`style[${Te}="${this.appId}"]`);if(k?.length){const B=new Map;return k.forEach(ce=>{null!=ce.textContent&&B.set(ce.textContent,ce)}),B}return null}changeUsageCount(k,B){const ce=this.styleRef;if(ce.has(k)){const ke=ce.get(k);return ke.usage+=B,ke.usage}return ce.set(k,{usage:B,elements:[]}),B}getStyleElement(k,B){const ce=this.styleNodesInDOM,ke=ce?.get(B);if(ke?.parentNode===k)return ce.delete(B),ke.removeAttribute(Te),ke;{const He=this.doc.createElement("style");return this.nonce&&He.setAttribute("nonce",this.nonce),He.textContent=B,this.platformIsServer&&He.setAttribute(Te,this.appId),k.appendChild(He),He}}addStyleToHost(k,B){const ce=this.getStyleElement(k,B),ke=this.styleRef,He=ke.get(B)?.elements;He?He.push(ce):ke.set(B,{elements:[ce],usage:1})}resetHostNodes(){const k=this.hostNodes;k.clear(),k.add(this.doc.head)}static#e=this.\u0275fac=function(B){return new(B||$)(C.KVO(N.qQ),C.KVO(C.sZ2),C.KVO(C.BIS,8),C.KVO(C.Agw))};static#t=this.\u0275prov=C.jDH({token:$,factory:$.\u0275fac})}return $})();const Se={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},ze=/%COMP%/g,pe=new C.nKC("",{providedIn:"root",factory:()=>!0});function We($,G){return G.map(k=>k.replace(ze,$))}let Ae=(()=>{class ${constructor(k,B,ce,ke,He,At,nn,mn=null){this.eventManager=k,this.sharedStylesHost=B,this.appId=ce,this.removeStylesOnCompDestroy=ke,this.doc=He,this.platformId=At,this.ngZone=nn,this.nonce=mn,this.rendererByCompId=new Map,this.platformIsServer=(0,N.Vy)(At),this.defaultRenderer=new Ie(k,He,nn,this.platformIsServer)}createRenderer(k,B){if(!k||!B)return this.defaultRenderer;this.platformIsServer&&B.encapsulation===C.gXe.ShadowDom&&(B={...B,encapsulation:C.gXe.Emulated});const ce=this.getOrCreateRenderer(k,B);return ce instanceof tn?ce.applyToHost(k):ce instanceof yn&&ce.applyStyles(),ce}getOrCreateRenderer(k,B){const ce=this.rendererByCompId;let ke=ce.get(B.id);if(!ke){const He=this.doc,At=this.ngZone,nn=this.eventManager,mn=this.sharedStylesHost,Gr=this.removeStylesOnCompDestroy,Bn=this.platformIsServer;switch(B.encapsulation){case C.gXe.Emulated:ke=new tn(nn,mn,B,this.appId,Gr,He,At,Bn);break;case C.gXe.ShadowDom:return new er(nn,mn,k,B,He,At,this.nonce,Bn);default:ke=new yn(nn,mn,B,Gr,He,At,Bn)}ce.set(B.id,ke)}return ke}ngOnDestroy(){this.rendererByCompId.clear()}static#e=this.\u0275fac=function(B){return new(B||$)(C.KVO(Z),C.KVO(ae),C.KVO(C.sZ2),C.KVO(pe),C.KVO(N.qQ),C.KVO(C.Agw),C.KVO(C.SKi),C.KVO(C.BIS))};static#t=this.\u0275prov=C.jDH({token:$,factory:$.\u0275fac})}return $})();class Ie{constructor(G,k,B,ce){this.eventManager=G,this.doc=k,this.ngZone=B,this.platformIsServer=ce,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(G,k){return k?this.doc.createElementNS(Se[k]||k,G):this.doc.createElement(G)}createComment(G){return this.doc.createComment(G)}createText(G){return this.doc.createTextNode(G)}appendChild(G,k){(Je(G)?G.content:G).appendChild(k)}insertBefore(G,k,B){G&&(Je(G)?G.content:G).insertBefore(k,B)}removeChild(G,k){G&&G.removeChild(k)}selectRootElement(G,k){let B="string"==typeof G?this.doc.querySelector(G):G;if(!B)throw new C.wOt(-5104,!1);return k||(B.textContent=""),B}parentNode(G){return G.parentNode}nextSibling(G){return G.nextSibling}setAttribute(G,k,B,ce){if(ce){k=ce+":"+k;const ke=Se[ce];ke?G.setAttributeNS(ke,k,B):G.setAttribute(k,B)}else G.setAttribute(k,B)}removeAttribute(G,k,B){if(B){const ce=Se[B];ce?G.removeAttributeNS(ce,k):G.removeAttribute(`${B}:${k}`)}else G.removeAttribute(k)}addClass(G,k){G.classList.add(k)}removeClass(G,k){G.classList.remove(k)}setStyle(G,k,B,ce){ce&(C.czy.DashCase|C.czy.Important)?G.style.setProperty(k,B,ce&C.czy.Important?"important":""):G.style[k]=B}removeStyle(G,k,B){B&C.czy.DashCase?G.style.removeProperty(k):G.style[k]=""}setProperty(G,k,B){null!=G&&(G[k]=B)}setValue(G,k){G.nodeValue=k}listen(G,k,B){if("string"==typeof G&&!(G=(0,N.QT)().getGlobalEventTarget(this.doc,G)))throw new Error(`Unsupported event target ${G} for event ${k}`);return this.eventManager.addEventListener(G,k,this.decoratePreventDefault(B))}decoratePreventDefault(G){return k=>{if("__ngUnwrap__"===k)return G;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>G(k)):G(k))&&k.preventDefault()}}}function Je($){return"TEMPLATE"===$.tagName&&void 0!==$.content}class er extends Ie{constructor(G,k,B,ce,ke,He,At,nn){super(G,ke,He,nn),this.sharedStylesHost=k,this.hostEl=B,this.shadowRoot=B.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const mn=We(ce.id,ce.styles);for(const Gr of mn){const Bn=document.createElement("style");At&&Bn.setAttribute("nonce",At),Bn.textContent=Gr,this.shadowRoot.appendChild(Bn)}}nodeOrShadowRoot(G){return G===this.hostEl?this.shadowRoot:G}appendChild(G,k){return super.appendChild(this.nodeOrShadowRoot(G),k)}insertBefore(G,k,B){return super.insertBefore(this.nodeOrShadowRoot(G),k,B)}removeChild(G,k){return super.removeChild(this.nodeOrShadowRoot(G),k)}parentNode(G){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(G)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class yn extends Ie{constructor(G,k,B,ce,ke,He,At,nn){super(G,ke,He,At),this.sharedStylesHost=k,this.removeStylesOnCompDestroy=ce,this.styles=nn?We(nn,B.styles):B.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class tn extends yn{constructor(G,k,B,ce,ke,He,At,nn){const mn=ce+"-"+B.id;super(G,k,B,ke,He,At,nn,mn),this.contentAttr=function de($){return"_ngcontent-%COMP%".replace(ze,$)}(mn),this.hostAttr=function Ce($){return"_nghost-%COMP%".replace(ze,$)}(mn)}applyToHost(G){this.applyStyles(),this.setAttribute(G,this.hostAttr,"")}createElement(G,k){const B=super.createElement(G,k);return super.setAttribute(B,this.contentAttr,""),B}}let Rn=(()=>{class $ extends se{constructor(k){super(k)}supports(k){return!0}addEventListener(k,B,ce){return k.addEventListener(B,ce,!1),()=>this.removeEventListener(k,B,ce)}removeEventListener(k,B,ce){return k.removeEventListener(B,ce)}static#e=this.\u0275fac=function(B){return new(B||$)(C.KVO(N.qQ))};static#t=this.\u0275prov=C.jDH({token:$,factory:$.\u0275fac})}return $})();const mt=["alt","control","meta","shift"],dn={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},K={alt:$=>$.altKey,control:$=>$.ctrlKey,meta:$=>$.metaKey,shift:$=>$.shiftKey};let Y=(()=>{class $ extends se{constructor(k){super(k)}supports(k){return null!=$.parseEventName(k)}addEventListener(k,B,ce){const ke=$.parseEventName(B),He=$.eventCallback(ke.fullKey,ce,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>(0,N.QT)().onAndCancel(k,ke.domEventName,He))}static parseEventName(k){const B=k.toLowerCase().split("."),ce=B.shift();if(0===B.length||"keydown"!==ce&&"keyup"!==ce)return null;const ke=$._normalizeKey(B.pop());let He="",At=B.indexOf("code");if(At>-1&&(B.splice(At,1),He="code."),mt.forEach(mn=>{const Gr=B.indexOf(mn);Gr>-1&&(B.splice(Gr,1),He+=mn+".")}),He+=ke,0!=B.length||0===ke.length)return null;const nn={};return nn.domEventName=ce,nn.fullKey=He,nn}static matchEventFullKeyCode(k,B){let ce=dn[k.key]||k.key,ke="";return B.indexOf("code.")>-1&&(ce=k.code,ke="code."),!(null==ce||!ce)&&(ce=ce.toLowerCase()," "===ce?ce="space":"."===ce&&(ce="dot"),mt.forEach(He=>{He!==ce&&(0,K[He])(k)&&(ke+=He+".")}),ke+=ce,ke===B)}static eventCallback(k,B,ce){return ke=>{$.matchEventFullKeyCode(ke,k)&&ce.runGuarded(()=>B(ke))}}static _normalizeKey(k){return"esc"===k?"escape":k}static#e=this.\u0275fac=function(B){return new(B||$)(C.KVO(N.qQ))};static#t=this.\u0275prov=C.jDH({token:$,factory:$.\u0275fac})}return $})();function ee($,G){return(0,C.TL3)({rootComponent:$,...Me(G)})}function Me($){return{appProviders:[...pn,...$?.providers??[]],platformProviders:Fe}}const Fe=[{provide:C.Agw,useValue:N.AJ},{provide:C.PLl,useValue:function Ve(){j.makeCurrent()},multi:!0},{provide:N.qQ,useFactory:function Nn(){return(0,C.TL$)(document),document},deps:[]}],pn=[{provide:C.H8p,useValue:"root"},{provide:C.zcH,useFactory:function gt(){return new C.zcH},deps:[]},{provide:te,useClass:Rn,multi:!0,deps:[N.qQ,C.SKi,C.Agw]},{provide:te,useClass:Y,multi:!0,deps:[N.qQ]},Ae,ae,Z,{provide:C._9s,useExisting:Ae},{provide:N.N0,useClass:ge,deps:[]},[]];let jn=(()=>{class ${constructor(k){this._doc=k}getTitle(){return this._doc.title}setTitle(k){this._doc.title=k||""}static#e=this.\u0275fac=function(B){return new(B||$)(C.KVO(N.qQ))};static#t=this.\u0275prov=C.jDH({token:$,factory:$.\u0275fac,providedIn:"root"})}return $})()},8540:(Ue,he,O)=>{"use strict";O.d(he,{nX:()=>Xr,Ix:()=>or,Wk:()=>qt,n3:()=>ea,lh:()=>it,Ii:()=>bu});var C=O(4438),N=O(4402),w=O(6648),j=O(7673),Q=O(4412);const J=(0,O(1853).L)(f=>function(){f(this),this.name="EmptyError",this.message="no elements in sequence"});var be=O(1985),ge=O(3073),te=O(3669),Z=O(6450),se=O(3794),Te=O(8496),ae=O(4360),Se=O(5225);function ze(...f){const v=(0,se.lI)(f),h=(0,se.ms)(f),{args:y,keys:b}=(0,ge.D)(f);if(0===y.length)return(0,w.H)([],v);const A=new be.c(function Ze(f,v,h=te.D){return y=>{ie(v,()=>{const{length:b}=f,A=new Array(b);let F=b,q=b;for(let H=0;H{const Ee=(0,w.H)(f[H],v);let Ge=!1;Ee.subscribe((0,ae._)(y,at=>{A[H]=at,Ge||(Ge=!0,q--),q||y.next(h(A.slice()))},()=>{--F||y.complete()}))},y)},y)}}(y,v,b?F=>(0,Te.e)(b,F):te.D));return h?A.pipe((0,Z.I)(h)):A}function ie(f,v,h){f?(0,Se.N)(h,f,v):v()}var ye=O(1397);function de(...f){return function pe(){return function Be(f=1/0){return(0,ye.Z)(te.D,f)}(1)}()((0,w.H)(f,(0,se.lI)(f)))}var Ce=O(8750);function We(f){return new be.c(v=>{(0,Ce.Tg)(f()).subscribe(v)})}var Ae=O(1203),Ie=O(8810),Pe=O(983),qe=O(8359),Je=O(9974);function er(){return(0,Je.N)((f,v)=>{let h=null;f._refCount++;const y=(0,ae._)(v,void 0,void 0,void 0,()=>{if(!f||f._refCount<=0||0<--f._refCount)return void(h=null);const b=f._connection,A=h;h=null,b&&(!A||b===A)&&b.unsubscribe(),v.unsubscribe()});f.subscribe(y),y.closed||(h=f.connect())})}class yn extends be.c{constructor(v,h){super(),this.source=v,this.subjectFactory=h,this._subject=null,this._refCount=0,this._connection=null,(0,Je.S)(v)&&(this.lift=v.lift)}_subscribe(v){return this.getSubject().subscribe(v)}getSubject(){const v=this._subject;return(!v||v.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:v}=this;this._subject=this._connection=null,v?.unsubscribe()}connect(){let v=this._connection;if(!v){v=this._connection=new qe.yU;const h=this.getSubject();v.add(this.source.subscribe((0,ae._)(h,void 0,()=>{this._teardown(),h.complete()},y=>{this._teardown(),h.error(y)},()=>this._teardown()))),v.closed&&(this._connection=null,v=qe.yU.EMPTY)}return v}refCount(){return er()(this)}}var tn=O(1413),Rn=O(177),mt=O(6354),dn=O(5558),K=O(6697),ee=O(5964);function oe(f){return(0,Je.N)((v,h)=>{let y=!1;v.subscribe((0,ae._)(h,b=>{y=!0,h.next(b)},()=>{y||h.next(f),h.complete()}))})}function Me(f=_e){return(0,Je.N)((v,h)=>{let y=!1;v.subscribe((0,ae._)(h,b=>{y=!0,h.next(b)},()=>y?h.complete():h.error(f())))})}function _e(){return new J}function Ve(f,v){const h=arguments.length>=2;return y=>y.pipe(f?(0,ee.p)((b,A)=>f(b,A,y)):te.D,(0,K.s)(1),h?oe(v):Me(()=>new J))}var gt=O(274),Nn=O(8071);function Fe(f,v,h){const y=(0,Nn.T)(f)||v||h?{next:f,error:v,complete:h}:f;return y?(0,Je.N)((b,A)=>{var F;null===(F=y.subscribe)||void 0===F||F.call(y);let q=!0;b.subscribe((0,ae._)(A,H=>{var Ee;null===(Ee=y.next)||void 0===Ee||Ee.call(y,H),A.next(H)},()=>{var H;q=!1,null===(H=y.complete)||void 0===H||H.call(y),A.complete()},H=>{var Ee;q=!1,null===(Ee=y.error)||void 0===Ee||Ee.call(y,H),A.error(H)},()=>{var H,Ee;q&&(null===(H=y.unsubscribe)||void 0===H||H.call(y)),null===(Ee=y.finalize)||void 0===Ee||Ee.call(y)}))}):te.D}var xt=O(9437);function pn(f){return f<=0?()=>Pe.w:(0,Je.N)((v,h)=>{let y=[];v.subscribe((0,ae._)(h,b=>{y.push(b),f{for(const b of y)h.next(b);h.complete()},void 0,()=>{y=null}))})}var Kt=O(980),jn=O(5343),xr=O(345);const Ye="primary",wr=Symbol("RouteTitle");class as{constructor(v){this.params=v||{}}has(v){return Object.prototype.hasOwnProperty.call(this.params,v)}get(v){if(this.has(v)){const h=this.params[v];return Array.isArray(h)?h[0]:h}return null}getAll(v){if(this.has(v)){const h=this.params[v];return Array.isArray(h)?h:[h]}return[]}get keys(){return Object.keys(this.params)}}function Qo(f){return new as(f)}function Dr(f,v,h){const y=h.path.split("/");if(y.length>f.length||"full"===h.pathMatch&&(v.hasChildren()||y.lengthy[A]===b)}return f===v}function tr(f){return f.length>0?f[f.length-1]:null}function bn(f){return(0,N.A)(f)?f:(0,C.jNT)(f)?(0,w.H)(Promise.resolve(f)):(0,j.of)(f)}const gn={exact:function Tt(f,v,h){if(!G(f.segments,v.segments)||!Cr(f.segments,v.segments,h)||f.numberOfChildren!==v.numberOfChildren)return!1;for(const y in v.children)if(!f.children[y]||!Tt(f.children[y],v.children[y],h))return!1;return!0},subset:To},$a={exact:function Mo(f,v){return et(f,v)},subset:function bt(f,v){return Object.keys(v).length<=Object.keys(f).length&&Object.keys(v).every(h=>ar(f[h],v[h]))},ignored:()=>!0};function tt(f,v,h){return gn[h.paths](f.root,v.root,h.matrixParams)&&$a[h.queryParams](f.queryParams,v.queryParams)&&!("exact"===h.fragment&&f.fragment!==v.fragment)}function To(f,v,h){return Qt(f,v,v.segments,h)}function Qt(f,v,h,y){if(f.segments.length>h.length){const b=f.segments.slice(0,h.length);return!(!G(b,h)||v.hasChildren()||!Cr(b,h,y))}if(f.segments.length===h.length){if(!G(f.segments,h)||!Cr(f.segments,h,y))return!1;for(const b in v.children)if(!f.children[b]||!To(f.children[b],v.children[b],y))return!1;return!0}{const b=h.slice(0,f.segments.length),A=h.slice(f.segments.length);return!!(G(f.segments,b)&&Cr(f.segments,b,y)&&f.children[Ye])&&Qt(f.children[Ye],v,A,y)}}function Cr(f,v,h){return v.every((y,b)=>$a[h](f[b].parameters,y.parameters))}class fo{constructor(v=new St([],{}),h={},y=null){this.root=v,this.queryParams=h,this.fragment=y}get queryParamMap(){return this._queryParamMap??=Qo(this.queryParams),this._queryParamMap}toString(){return ke.serialize(this)}}class St{constructor(v,h){this.segments=v,this.children=h,this.parent=null,Object.values(h).forEach(y=>y.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return He(this)}}class lr{constructor(v,h){this.path=v,this.parameters=h}get parameterMap(){return this._parameterMap??=Qo(this.parameters),this._parameterMap}toString(){return Kl(this)}}function G(f,v){return f.length===v.length&&f.every((h,y)=>h.path===v[y].path)}let B=(()=>{class f{static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=C.jDH({token:f,factory:()=>new ce,providedIn:"root"})}return f})();class ce{parse(v){const h=new Si(v);return new fo(h.parseRootSegment(),h.parseQueryParams(),h.parseFragment())}serialize(v){const h=`/${At(v.root,!0)}`,y=function $e(f){const v=Object.entries(f).map(([h,y])=>Array.isArray(y)?y.map(b=>`${mn(h)}=${mn(b)}`).join("&"):`${mn(h)}=${mn(y)}`).filter(h=>h);return v.length?`?${v.join("&")}`:""}(v.queryParams);return`${h}${y}${"string"==typeof v.fragment?`#${function Gr(f){return encodeURI(f)}(v.fragment)}`:""}`}}const ke=new ce;function He(f){return f.segments.map(v=>Kl(v)).join("/")}function At(f,v){if(!f.hasChildren())return He(f);if(v){const h=f.children[Ye]?At(f.children[Ye],!1):"",y=[];return Object.entries(f.children).forEach(([b,A])=>{b!==Ye&&y.push(`${b}:${At(A,!1)}`)}),y.length>0?`${h}(${y.join("//")})`:h}{const h=function k(f,v){let h=[];return Object.entries(f.children).forEach(([y,b])=>{y===Ye&&(h=h.concat(v(b,y)))}),Object.entries(f.children).forEach(([y,b])=>{y!==Ye&&(h=h.concat(v(b,y)))}),h}(f,(y,b)=>b===Ye?[At(f.children[Ye],!1)]:[`${b}:${At(y,!1)}`]);return 1===Object.keys(f.children).length&&null!=f.children[Ye]?`${He(f)}/${h[0]}`:`${He(f)}/(${h.join("//")})`}}function nn(f){return encodeURIComponent(f).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function mn(f){return nn(f).replace(/%3B/gi,";")}function Bn(f){return nn(f).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Ao(f){return decodeURIComponent(f)}function Wa(f){return Ao(f.replace(/\+/g,"%20"))}function Kl(f){return`${Bn(f.path)}${function xn(f){return Object.entries(f).map(([v,h])=>`;${Bn(v)}=${Bn(h)}`).join("")}(f.parameters)}`}const Ga=/^[^\/()?;#]+/;function Zo(f){const v=f.match(Ga);return v?v[0]:""}const za=/^[^\/()?;=#]+/,Ka=/^[^=?&#]+/,Xl=/^[^&#]+/;class Si{constructor(v){this.url=v,this.remaining=v}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new St([],{}):new St([],this.parseChildren())}parseQueryParams(){const v={};if(this.consumeOptional("?"))do{this.parseQueryParam(v)}while(this.consumeOptional("&"));return v}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const v=[];for(this.peekStartsWith("(")||v.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),v.push(this.parseSegment());let h={};this.peekStartsWith("/(")&&(this.capture("/"),h=this.parseParens(!0));let y={};return this.peekStartsWith("(")&&(y=this.parseParens(!1)),(v.length>0||Object.keys(h).length>0)&&(y[Ye]=new St(v,h)),y}parseSegment(){const v=Zo(this.remaining);if(""===v&&this.peekStartsWith(";"))throw new C.wOt(4009,!1);return this.capture(v),new lr(Ao(v),this.parseMatrixParams())}parseMatrixParams(){const v={};for(;this.consumeOptional(";");)this.parseParam(v);return v}parseParam(v){const h=function qa(f){const v=f.match(za);return v?v[0]:""}(this.remaining);if(!h)return;this.capture(h);let y="";if(this.consumeOptional("=")){const b=Zo(this.remaining);b&&(y=b,this.capture(y))}v[Ao(h)]=Ao(y)}parseQueryParam(v){const h=function It(f){const v=f.match(Ka);return v?v[0]:""}(this.remaining);if(!h)return;this.capture(h);let y="";if(this.consumeOptional("=")){const F=function Ei(f){const v=f.match(Xl);return v?v[0]:""}(this.remaining);F&&(y=F,this.capture(y))}const b=Wa(h),A=Wa(y);if(v.hasOwnProperty(b)){let F=v[b];Array.isArray(F)||(F=[F],v[b]=F),F.push(A)}else v[b]=A}parseParens(v){const h={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const y=Zo(this.remaining),b=this.remaining[y.length];if("/"!==b&&")"!==b&&";"!==b)throw new C.wOt(4010,!1);let A;y.indexOf(":")>-1?(A=y.slice(0,y.indexOf(":")),this.capture(A),this.capture(":")):v&&(A=Ye);const F=this.parseChildren();h[A]=1===Object.keys(F).length?F[Ye]:new St([],F),this.consumeOptional("//")}return h}peekStartsWith(v){return this.remaining.startsWith(v)}consumeOptional(v){return!!this.peekStartsWith(v)&&(this.remaining=this.remaining.substring(v.length),!0)}capture(v){if(!this.consumeOptional(v))throw new C.wOt(4011,!1)}}function Jo(f){return f.segments.length>0?new St([],{[Ye]:f}):f}function Yo(f){const v={};for(const[y,b]of Object.entries(f.children)){const A=Yo(b);if(y===Ye&&0===A.segments.length&&A.hasChildren())for(const[F,q]of Object.entries(A.children))v[F]=q;else(A.segments.length>0||A.hasChildren())&&(v[y]=A)}return function zs(f){if(1===f.numberOfChildren&&f.children[Ye]){const v=f.children[Ye];return new St(f.segments.concat(v.segments),v.children)}return f}(new St(f.segments,v))}function zr(f){return f instanceof fo}function Ii(f){let v;const b=Jo(function h(A){const F={};for(const H of A.children){const Ee=h(H);F[H.outlet]=Ee}const q=new St(A.url,F);return A===f&&(v=q),q}(f.root));return v??b}function qr(f,v,h,y){let b=f;for(;b.parent;)b=b.parent;if(0===v.length)return ho(b,b,b,h,y);const A=function Oo(f){if("string"==typeof f[0]&&1===f.length&&"/"===f[0])return new ls(!0,0,f);let v=0,h=!1;const y=f.reduce((b,A,F)=>{if("object"==typeof A&&null!=A){if(A.outlets){const q={};return Object.entries(A.outlets).forEach(([H,Ee])=>{q[H]="string"==typeof Ee?Ee.split("/"):Ee}),[...b,{outlets:q}]}if(A.segmentPath)return[...b,A.segmentPath]}return"string"!=typeof A?[...b,A]:0===F?(A.split("/").forEach((q,H)=>{0==H&&"."===q||(0==H&&""===q?h=!0:".."===q?v++:""!=q&&b.push(q))}),b):[...b,A]},[]);return new ls(h,v,y)}(v);if(A.toRoot())return ho(b,b,new St([],{}),h,y);const F=function cs(f,v,h){if(f.isAbsolute)return new ei(v,!0,0);if(!h)return new ei(v,!1,NaN);if(null===h.parent)return new ei(h,!0,0);const y=Ro(f.commands[0])?0:1;return function ln(f,v,h){let y=f,b=v,A=h;for(;A>b;){if(A-=b,y=y.parent,!y)throw new C.wOt(4005,!1);b=y.segments.length}return new ei(y,!1,b-A)}(h,h.segments.length-1+y,f.numberOfDoubleDots)}(A,b,f),q=F.processChildren?Pr(F.segmentGroup,F.index,A.commands):us(F.segmentGroup,F.index,A.commands);return ho(b,F.segmentGroup,q,h,y)}function Ro(f){return"object"==typeof f&&null!=f&&!f.outlets&&!f.segmentPath}function Ke(f){return"object"==typeof f&&null!=f&&f.outlets}function ho(f,v,h,y,b){let F,A={};y&&Object.entries(y).forEach(([H,Ee])=>{A[H]=Array.isArray(Ee)?Ee.map(Ge=>`${Ge}`):`${Ee}`}),F=f===v?h:No(f,v,h);const q=Jo(Yo(F));return new fo(q,A,b)}function No(f,v,h){const y={};return Object.entries(f.children).forEach(([b,A])=>{y[b]=A===v?h:No(A,v,h)}),new St(f.segments,y)}class ls{constructor(v,h,y){if(this.isAbsolute=v,this.numberOfDoubleDots=h,this.commands=y,v&&y.length>0&&Ro(y[0]))throw new C.wOt(4003,!1);const b=y.find(Ke);if(b&&b!==tr(y))throw new C.wOt(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class ei{constructor(v,h,y){this.segmentGroup=v,this.processChildren=h,this.index=y}}function us(f,v,h){if(f??=new St([],{}),0===f.segments.length&&f.hasChildren())return Pr(f,v,h);const y=function ti(f,v,h){let y=0,b=v;const A={match:!1,pathIndex:0,commandIndex:0};for(;b=h.length)return A;const F=f.segments[b],q=h[y];if(Ke(q))break;const H=`${q}`,Ee=y0&&void 0===H)break;if(H&&Ee&&"object"==typeof Ee&&void 0===Ee.outlets){if(!Ks(H,Ee,F))return A;y+=2}else{if(!Ks(H,{},F))return A;y++}b++}return{match:!0,pathIndex:b,commandIndex:y}}(f,v,h),b=h.slice(y.commandIndex);if(y.match&&y.pathIndexA!==Ye)&&f.children[Ye]&&1===f.numberOfChildren&&0===f.children[Ye].segments.length){const A=Pr(f.children[Ye],v,h);return new St(f.segments,A.children)}return Object.entries(y).forEach(([A,F])=>{"string"==typeof F&&(F=[F]),null!==F&&(b[A]=us(f.children[A],v,F))}),Object.entries(f.children).forEach(([A,F])=>{void 0===y[A]&&(b[A]=F)}),new St(f.segments,b)}}function kr(f,v,h){const y=f.segments.slice(0,v);let b=0;for(;b{"string"==typeof y&&(y=[y]),null!==y&&(v[h]=kr(new St([],{}),0,y))}),v}function cr(f){const v={};return Object.entries(f).forEach(([h,y])=>v[h]=`${y}`),v}function Ks(f,v,h){return f==h.path&&et(v,h.parameters)}const nr="imperative";var ct=function(f){return f[f.NavigationStart=0]="NavigationStart",f[f.NavigationEnd=1]="NavigationEnd",f[f.NavigationCancel=2]="NavigationCancel",f[f.NavigationError=3]="NavigationError",f[f.RoutesRecognized=4]="RoutesRecognized",f[f.ResolveStart=5]="ResolveStart",f[f.ResolveEnd=6]="ResolveEnd",f[f.GuardsCheckStart=7]="GuardsCheckStart",f[f.GuardsCheckEnd=8]="GuardsCheckEnd",f[f.RouteConfigLoadStart=9]="RouteConfigLoadStart",f[f.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",f[f.ChildActivationStart=11]="ChildActivationStart",f[f.ChildActivationEnd=12]="ChildActivationEnd",f[f.ActivationStart=13]="ActivationStart",f[f.ActivationEnd=14]="ActivationEnd",f[f.Scroll=15]="Scroll",f[f.NavigationSkipped=16]="NavigationSkipped",f}(ct||{});class br{constructor(v,h){this.id=v,this.url=h}}class Xe extends br{constructor(v,h,y="imperative",b=null){super(v,h),this.type=ct.NavigationStart,this.navigationTrigger=y,this.restoredState=b}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class ut extends br{constructor(v,h,y){super(v,h),this.urlAfterRedirects=y,this.type=ct.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var ur=function(f){return f[f.Redirect=0]="Redirect",f[f.SupersededByNewNavigation=1]="SupersededByNewNavigation",f[f.NoDataFromResolver=2]="NoDataFromResolver",f[f.GuardRejected=3]="GuardRejected",f}(ur||{}),_n=function(f){return f[f.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",f[f.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",f}(_n||{});class xo extends br{constructor(v,h,y,b){super(v,h),this.reason=y,this.code=b,this.type=ct.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Ti extends br{constructor(v,h,y,b){super(v,h),this.reason=y,this.code=b,this.type=ct.NavigationSkipped}}class Ai extends br{constructor(v,h,y,b){super(v,h),this.error=y,this.target=b,this.type=ct.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class Ri extends br{constructor(v,h,y,b){super(v,h),this.urlAfterRedirects=y,this.state=b,this.type=ct.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class pt extends br{constructor(v,h,y,b){super(v,h),this.urlAfterRedirects=y,this.state=b,this.type=ct.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class ds extends br{constructor(v,h,y,b,A){super(v,h),this.urlAfterRedirects=y,this.state=b,this.shouldActivate=A,this.type=ct.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Xs extends br{constructor(v,h,y,b){super(v,h),this.urlAfterRedirects=y,this.state=b,this.type=ct.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Pn extends br{constructor(v,h,y,b){super(v,h),this.urlAfterRedirects=y,this.state=b,this.type=ct.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Qs{constructor(v){this.route=v,this.type=ct.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Zl{constructor(v){this.route=v,this.type=ct.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class ni{constructor(v){this.snapshot=v,this.type=ct.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Kr{constructor(v){this.snapshot=v,this.type=ct.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class fs{constructor(v){this.snapshot=v,this.type=ct.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Ni{constructor(v){this.snapshot=v,this.type=ct.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class hs{}class ps{constructor(v){this.url=v}}class Po{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new ko,this.attachRef=null}}let ko=(()=>{class f{constructor(){this.contexts=new Map}onChildOutletCreated(h,y){const b=this.getOrCreateContext(h);b.outlet=y,this.contexts.set(h,b)}onChildOutletDestroyed(h){const y=this.getContext(h);y&&(y.outlet=null,y.attachRef=null)}onOutletDeactivated(){const h=this.contexts;return this.contexts=new Map,h}onOutletReAttached(h){this.contexts=h}getOrCreateContext(h){let y=this.getContext(h);return y||(y=new Po,this.contexts.set(h,y)),y}getContext(h){return this.contexts.get(h)||null}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=C.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();class Fr{constructor(v){this._root=v}get root(){return this._root.value}parent(v){const h=this.pathFromRoot(v);return h.length>1?h[h.length-2]:null}children(v){const h=Oi(v,this._root);return h?h.children.map(y=>y.value):[]}firstChild(v){const h=Oi(v,this._root);return h&&h.children.length>0?h.children[0].value:null}siblings(v){const h=fn(v,this._root);return h.length<2?[]:h[h.length-2].children.map(b=>b.value).filter(b=>b!==v)}pathFromRoot(v){return fn(v,this._root).map(h=>h.value)}}function Oi(f,v){if(f===v.value)return v;for(const h of v.children){const y=Oi(f,h);if(y)return y}return null}function fn(f,v){if(f===v.value)return[v];for(const h of v.children){const y=fn(f,h);if(y.length)return y.unshift(v),y}return[]}class kn{constructor(v,h){this.value=v,this.children=h}toString(){return`TreeNode(${this.value})`}}function je(f){const v={};return f&&f.children.forEach(h=>v[h.value.outlet]=h),v}class xi extends Fr{constructor(v,h){super(v),this.snapshot=h,Pi(this,v)}toString(){return this.snapshot.toString()}}function Fo(f){const v=function ri(f){const A=new po([],{},{},"",{},Ye,f,null,{});return new Zs("",new kn(A,[]))}(f),h=new Q.t([new lr("",{})]),y=new Q.t({}),b=new Q.t({}),A=new Q.t({}),F=new Q.t(""),q=new Xr(h,y,A,F,b,Ye,f,v.root);return q.snapshot=v.root,new xi(new kn(q,[]),v)}class Xr{constructor(v,h,y,b,A,F,q,H){this.urlSubject=v,this.paramsSubject=h,this.queryParamsSubject=y,this.fragmentSubject=b,this.dataSubject=A,this.outlet=F,this.component=q,this._futureSnapshot=H,this.title=this.dataSubject?.pipe((0,mt.T)(Ee=>Ee[wr]))??(0,j.of)(void 0),this.url=v,this.params=h,this.queryParams=y,this.fragment=b,this.data=A}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe((0,mt.T)(v=>Qo(v))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe((0,mt.T)(v=>Qo(v))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function gs(f,v,h="emptyOnly"){let y;const{routeConfig:b}=f;return y=null===v||"always"!==h&&""!==b?.path&&(v.component||v.routeConfig?.loadComponent)?{params:{...f.params},data:{...f.data},resolve:{...f.data,...f._resolvedData??{}}}:{params:{...v.params,...f.params},data:{...v.data,...f.data},resolve:{...f.data,...v.data,...b?.data,...f._resolvedData}},b&&go(b)&&(y.resolve[wr]=b.title),y}class po{get title(){return this.data?.[wr]}constructor(v,h,y,b,A,F,q,H,Ee){this.url=v,this.params=h,this.queryParams=y,this.fragment=b,this.data=A,this.outlet=F,this.component=q,this.routeConfig=H,this._resolve=Ee}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=Qo(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Qo(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(y=>y.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class Zs extends Fr{constructor(v,h){super(h),this.url=v,Pi(this,h)}toString(){return Js(this._root)}}function Pi(f,v){v.value._routerState=f,v.children.forEach(h=>Pi(f,h))}function Js(f){const v=f.children.length>0?` { ${f.children.map(Js).join(", ")} } `:"";return`${f.value}${v}`}function ki(f){if(f.snapshot){const v=f.snapshot,h=f._futureSnapshot;f.snapshot=h,et(v.queryParams,h.queryParams)||f.queryParamsSubject.next(h.queryParams),v.fragment!==h.fragment&&f.fragmentSubject.next(h.fragment),et(v.params,h.params)||f.paramsSubject.next(h.params),function lt(f,v){if(f.length!==v.length)return!1;for(let h=0;het(h.parameters,v[y].parameters))}(f.url,v.url);return h&&!(!f.parent!=!v.parent)&&(!f.parent||Ys(f.parent,v.parent))}function go(f){return"string"==typeof f.title||null===f.title}let ea=(()=>{class f{constructor(){this.activated=null,this._activatedRoute=null,this.name=Ye,this.activateEvents=new C.bkB,this.deactivateEvents=new C.bkB,this.attachEvents=new C.bkB,this.detachEvents=new C.bkB,this.parentContexts=(0,C.WQX)(ko),this.location=(0,C.WQX)(C.c1b),this.changeDetector=(0,C.WQX)(C.gRc),this.environmentInjector=(0,C.WQX)(C.uvJ),this.inputBinder=(0,C.WQX)(Er,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(h){if(h.name){const{firstChange:y,previousValue:b}=h.name;if(y)return;this.isTrackedInParentContexts(b)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(b)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(h){return this.parentContexts.getContext(h)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const h=this.parentContexts.getContext(this.name);h?.route&&(h.attachRef?this.attach(h.attachRef,h.route):this.activateWith(h.route,h.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new C.wOt(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new C.wOt(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new C.wOt(4012,!1);this.location.detach();const h=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(h.instance),h}attach(h,y){this.activated=h,this._activatedRoute=y,this.location.insert(h.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(h.instance)}deactivate(){if(this.activated){const h=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(h)}}activateWith(h,y){if(this.isActivated)throw new C.wOt(4013,!1);this._activatedRoute=h;const b=this.location,F=h.snapshot.component,q=this.parentContexts.getOrCreateContext(this.name).children,H=new Hn(h,q,b.injector);this.activated=b.createComponent(F,{index:b.length,injector:H,environmentInjector:y??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275dir=C.FsC({type:f,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[C.OA$]})}return f})();class Hn{constructor(v,h,y){this.route=v,this.childContexts=h,this.parent=y,this.__ngOutletInjector=!0}get(v,h){return v===Xr?this.route:v===ko?this.childContexts:this.parent.get(v,h)}}const Er=new C.nKC("");function dr(f,v,h){if(h&&f.shouldReuseRoute(v.value,h.value.snapshot)){const y=h.value;y._futureSnapshot=v.value;const b=function Qr(f,v,h){return v.children.map(y=>{for(const b of h.children)if(f.shouldReuseRoute(y.value,b.value.snapshot))return dr(f,y,b);return dr(f,y)})}(f,v,h);return new kn(y,b)}{if(f.shouldAttach(v.value)){const A=f.retrieve(v.value);if(null!==A){const F=A.route;return F.value._futureSnapshot=v.value,F.children=v.children.map(q=>dr(f,q)),F}}const y=function ms(f){return new Xr(new Q.t(f.url),new Q.t(f.params),new Q.t(f.queryParams),new Q.t(f.fragment),new Q.t(f.data),f.outlet,f.component,f)}(v.value),b=v.children.map(A=>dr(f,A));return new kn(y,b)}}const na="ngNavigationCancelingError";function ra(f,v){const{redirectTo:h,navigationBehaviorOptions:y}=zr(v)?{redirectTo:v,navigationBehaviorOptions:void 0}:v,b=Fn(!1,ur.Redirect);return b.url=h,b.navigationBehaviorOptions=y,b}function Fn(f,v){const h=new Error(`NavigationCancelingError: ${f||""}`);return h[na]=!0,h.cancellationCode=v,h}function $n(f){return!!f&&f[na]}let oa=(()=>{class f{static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275cmp=C.VBU({type:f,selectors:[["ng-component"]],standalone:!0,features:[C.aNF],decls:1,vars:0,template:function(y,b){1&y&&C.nrm(0,"router-outlet")},dependencies:[ea],encapsulation:2})}return f})();function Lr(f){const v=f.children&&f.children.map(Lr),h=v?{...f,children:v}:{...f};return!h.component&&!h.loadComponent&&(v||h.loadChildren)&&h.outlet&&h.outlet!==Ye&&(h.component=oa),h}function Ir(f){return f.outlet||Ye}function Lo(f){if(!f)return null;if(f.routeConfig?._injector)return f.routeConfig._injector;for(let v=f.parent;v;v=v.parent){const h=v.routeConfig;if(h?._loadedInjector)return h._loadedInjector;if(h?._injector)return h._injector}return null}class ia{constructor(v,h,y,b,A){this.routeReuseStrategy=v,this.futureState=h,this.currState=y,this.forwardEvent=b,this.inputBindingEnabled=A}activate(v){const h=this.futureState._root,y=this.currState?this.currState._root:null;this.deactivateChildRoutes(h,y,v),ki(this.futureState.root),this.activateChildRoutes(h,y,v)}deactivateChildRoutes(v,h,y){const b=je(h);v.children.forEach(A=>{const F=A.value.outlet;this.deactivateRoutes(A,b[F],y),delete b[F]}),Object.values(b).forEach(A=>{this.deactivateRouteAndItsChildren(A,y)})}deactivateRoutes(v,h,y){const b=v.value,A=h?h.value:null;if(b===A)if(b.component){const F=y.getContext(b.outlet);F&&this.deactivateChildRoutes(v,h,F.children)}else this.deactivateChildRoutes(v,h,y);else A&&this.deactivateRouteAndItsChildren(h,y)}deactivateRouteAndItsChildren(v,h){v.value.component&&this.routeReuseStrategy.shouldDetach(v.value.snapshot)?this.detachAndStoreRouteSubtree(v,h):this.deactivateRouteAndOutlet(v,h)}detachAndStoreRouteSubtree(v,h){const y=h.getContext(v.value.outlet),b=y&&v.value.component?y.children:h,A=je(v);for(const F of Object.values(A))this.deactivateRouteAndItsChildren(F,b);if(y&&y.outlet){const F=y.outlet.detach(),q=y.children.onOutletDeactivated();this.routeReuseStrategy.store(v.value.snapshot,{componentRef:F,route:v,contexts:q})}}deactivateRouteAndOutlet(v,h){const y=h.getContext(v.value.outlet),b=y&&v.value.component?y.children:h,A=je(v);for(const F of Object.values(A))this.deactivateRouteAndItsChildren(F,b);y&&(y.outlet&&(y.outlet.deactivate(),y.children.onOutletDeactivated()),y.attachRef=null,y.route=null)}activateChildRoutes(v,h,y){const b=je(h);v.children.forEach(A=>{this.activateRoutes(A,b[A.value.outlet],y),this.forwardEvent(new Ni(A.value.snapshot))}),v.children.length&&this.forwardEvent(new Kr(v.value.snapshot))}activateRoutes(v,h,y){const b=v.value,A=h?h.value:null;if(ki(b),b===A)if(b.component){const F=y.getOrCreateContext(b.outlet);this.activateChildRoutes(v,h,F.children)}else this.activateChildRoutes(v,h,y);else if(b.component){const F=y.getOrCreateContext(b.outlet);if(this.routeReuseStrategy.shouldAttach(b.snapshot)){const q=this.routeReuseStrategy.retrieve(b.snapshot);this.routeReuseStrategy.store(b.snapshot,null),F.children.onOutletReAttached(q.contexts),F.attachRef=q.componentRef,F.route=q.route.value,F.outlet&&F.outlet.attach(q.componentRef,q.route.value),ki(q.route.value),this.activateChildRoutes(v,null,F.children)}else{const q=Lo(b.snapshot);F.attachRef=null,F.route=b,F.injector=q,F.outlet&&F.outlet.activateWith(b,F.injector),this.activateChildRoutes(v,null,F.children)}}else this.activateChildRoutes(v,null,y)}}class Cs{constructor(v){this.path=v,this.route=this.path[this.path.length-1]}}class Vi{constructor(v,h){this.component=v,this.route=h}}function sa(f,v,h){const y=f._root;return En(y,v?v._root:null,h,[y.value])}function Zr(f,v){const h=Symbol(),y=v.get(f,h);return y===h?"function"!=typeof f||(0,C.LfX)(f)?v.get(f):f:y}function En(f,v,h,y,b={canDeactivateChecks:[],canActivateChecks:[]}){const A=je(v);return f.children.forEach(F=>{(function aa(f,v,h,y,b={canDeactivateChecks:[],canActivateChecks:[]}){const A=f.value,F=v?v.value:null,q=h?h.getContext(f.value.outlet):null;if(F&&A.routeConfig===F.routeConfig){const H=function Qa(f,v,h){if("function"==typeof h)return h(f,v);switch(h){case"pathParamsChange":return!G(f.url,v.url);case"pathParamsOrQueryParamsChange":return!G(f.url,v.url)||!et(f.queryParams,v.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Ys(f,v)||!et(f.queryParams,v.queryParams);default:return!Ys(f,v)}}(F,A,A.routeConfig.runGuardsAndResolvers);H?b.canActivateChecks.push(new Cs(y)):(A.data=F.data,A._resolvedData=F._resolvedData),En(f,v,A.component?q?q.children:null:h,y,b),H&&q&&q.outlet&&q.outlet.isActivated&&b.canDeactivateChecks.push(new Vi(q.outlet.component,F))}else F&&Mr(v,q,b),b.canActivateChecks.push(new Cs(y)),En(f,null,A.component?q?q.children:null:h,y,b)})(F,A[F.value.outlet],h,y.concat([F.value]),b),delete A[F.value.outlet]}),Object.entries(A).forEach(([F,q])=>Mr(q,h.getContext(F),b)),b}function Mr(f,v,h){const y=je(f),b=f.value;Object.entries(y).forEach(([A,F])=>{Mr(F,b.component?v?v.children.getContext(A):null:v,h)}),h.canDeactivateChecks.push(new Vi(b.component&&v&&v.outlet&&v.outlet.isActivated?v.outlet.component:null,b))}function ii(f){return"function"==typeof f}function la(f){return f instanceof J||"EmptyError"===f?.name}const bs=Symbol("INITIAL_VALUE");function Vo(){return(0,dn.n)(f=>ze(f.map(v=>v.pipe((0,K.s)(1),function Y(...f){const v=(0,se.lI)(f);return(0,Je.N)((h,y)=>{(v?de(f,h,v):de(f,h)).subscribe(y)})}(bs)))).pipe((0,mt.T)(v=>{for(const h of v)if(!0!==h){if(h===bs)return bs;if(!1===h||h instanceof fo)return h}return!0}),(0,ee.p)(v=>v!==bs),(0,K.s)(1)))}function ua(f){return(0,Ae.F)(Fe(v=>{if(zr(v))throw ra(0,v)}),(0,mt.T)(v=>!0===v))}class yo{constructor(v){this.segmentGroup=v||null}}class da extends Error{constructor(v){super(),this.urlTree=v}}function Jr(f){return(0,Ie.$)(new yo(f))}class ha{constructor(v,h){this.urlSerializer=v,this.urlTree=h}lineralizeSegments(v,h){let y=[],b=h.root;for(;;){if(y=y.concat(b.segments),0===b.numberOfChildren)return(0,j.of)(y);if(b.numberOfChildren>1||!b.children[Ye])return(0,Ie.$)(new C.wOt(4e3,!1));b=b.children[Ye]}}applyRedirectCommands(v,h,y){const b=this.applyRedirectCreateUrlTree(h,this.urlSerializer.parse(h),v,y);if(h.startsWith("/"))throw new da(b);return b}applyRedirectCreateUrlTree(v,h,y,b){const A=this.createSegmentGroup(v,h.root,y,b);return new fo(A,this.createQueryParams(h.queryParams,this.urlTree.queryParams),h.fragment)}createQueryParams(v,h){const y={};return Object.entries(v).forEach(([b,A])=>{if("string"==typeof A&&A.startsWith(":")){const q=A.substring(1);y[b]=h[q]}else y[b]=A}),y}createSegmentGroup(v,h,y,b){const A=this.createSegments(v,h.segments,y,b);let F={};return Object.entries(h.children).forEach(([q,H])=>{F[q]=this.createSegmentGroup(v,H,y,b)}),new St(A,F)}createSegments(v,h,y,b){return h.map(A=>A.path.startsWith(":")?this.findPosParam(v,A,b):this.findOrReturn(A,y))}findPosParam(v,h,y){const b=y[h.path.substring(1)];if(!b)throw new C.wOt(4001,!1);return b}findOrReturn(v,h){let y=0;for(const b of h){if(b.path===v.path)return h.splice(y),b;y++}return v}}const si={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function Du(f,v,h,y,b){const A=ji(f,v,h);return A.matched?(y=function ys(f,v){return f.providers&&!f._injector&&(f._injector=(0,C.Ol2)(f.providers,v,`Route: ${f.path}`)),f._injector??v}(v,y),function Ss(f,v,h,y){const b=v.canMatch;if(!b||0===b.length)return(0,j.of)(!0);const A=b.map(F=>{const q=Zr(F,f);return bn(function ic(f){return f&&ii(f.canMatch)}(q)?q.canMatch(v,h):(0,C.N4e)(f,()=>q(v,h)))});return(0,j.of)(A).pipe(Vo(),ua())}(y,v,h).pipe((0,mt.T)(F=>!0===F?A:{...si}))):(0,j.of)(A)}function ji(f,v,h){if("**"===v.path)return function sc(f){return{matched:!0,parameters:f.length>0?tr(f).parameters:{},consumedSegments:f,remainingSegments:[],positionalParamSegments:{}}}(h);if(""===v.path)return"full"===v.pathMatch&&(f.hasChildren()||h.length>0)?{...si}:{matched:!0,consumedSegments:[],remainingSegments:h,parameters:{},positionalParamSegments:{}};const b=(v.matcher||Dr)(h,f,v);if(!b)return{...si};const A={};Object.entries(b.posParams??{}).forEach(([q,H])=>{A[q]=H.path});const F=b.consumed.length>0?{...A,...b.consumed[b.consumed.length-1].parameters}:A;return{matched:!0,consumedSegments:b.consumed,remainingSegments:h.slice(b.consumed.length),parameters:F,positionalParamSegments:b.posParams??{}}}function Yr(f,v,h,y){return h.length>0&&function _o(f,v,h){return h.some(y=>fr(f,v,y)&&Ir(y)!==Ye)}(f,h,y)?{segmentGroup:new St(v,tl(y,new St(h,f.children))),slicedSegments:[]}:0===h.length&&function nl(f,v,h){return h.some(y=>fr(f,v,y))}(f,h,y)?{segmentGroup:new St(f.segments,el(f,h,y,f.children)),slicedSegments:h}:{segmentGroup:new St(f.segments,f.children),slicedSegments:h}}function el(f,v,h,y){const b={};for(const A of h)if(fr(f,v,A)&&!y[Ir(A)]){const F=new St([],{});b[Ir(A)]=F}return{...y,...b}}function tl(f,v){const h={};h[Ye]=v;for(const y of f)if(""===y.path&&Ir(y)!==Ye){const b=new St([],{});h[Ir(y)]=b}return h}function fr(f,v,h){return(!(f.hasChildren()||v.length>0)||"full"!==h.pathMatch)&&""===h.path}class ai{}class li{constructor(v,h,y,b,A,F,q){this.injector=v,this.configLoader=h,this.rootComponentType=y,this.config=b,this.urlTree=A,this.paramsInheritanceStrategy=F,this.urlSerializer=q,this.applyRedirects=new ha(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(v){return new C.wOt(4002,`'${v.segmentGroup}'`)}recognize(){const v=Yr(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(v).pipe((0,mt.T)(h=>{const y=new po([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},Ye,this.rootComponentType,null,{}),b=new kn(y,h),A=new Zs("",b),F=function qs(f,v,h=null,y=null){return qr(Ii(f),v,h,y)}(y,[],this.urlTree.queryParams,this.urlTree.fragment);return F.queryParams=this.urlTree.queryParams,A.url=this.urlSerializer.serialize(F),this.inheritParamsAndData(A._root,null),{state:A,tree:F}}))}match(v){return this.processSegmentGroup(this.injector,this.config,v,Ye).pipe((0,xt.W)(y=>{if(y instanceof da)return this.urlTree=y.urlTree,this.match(y.urlTree.root);throw y instanceof yo?this.noMatchError(y):y}))}inheritParamsAndData(v,h){const y=v.value,b=gs(y,h,this.paramsInheritanceStrategy);y.params=Object.freeze(b.params),y.data=Object.freeze(b.data),v.children.forEach(A=>this.inheritParamsAndData(A,y))}processSegmentGroup(v,h,y,b){return 0===y.segments.length&&y.hasChildren()?this.processChildren(v,h,y):this.processSegment(v,h,y,y.segments,b,!0).pipe((0,mt.T)(A=>A instanceof kn?[A]:[]))}processChildren(v,h,y){const b=[];for(const A of Object.keys(y.children))"primary"===A?b.unshift(A):b.push(A);return(0,w.H)(b).pipe((0,gt.H)(A=>{const F=y.children[A],q=function Ds(f,v){const h=f.filter(y=>Ir(y)===v);return h.push(...f.filter(y=>Ir(y)!==v)),h}(h,A);return this.processSegmentGroup(v,q,F,A)}),function Vt(f,v){return(0,Je.N)(function an(f,v,h,y,b){return(A,F)=>{let q=h,H=v,Ee=0;A.subscribe((0,ae._)(F,Ge=>{const at=Ee++;H=q?f(H,Ge,at):(q=!0,Ge),y&&F.next(H)},b&&(()=>{q&&F.next(H),F.complete()})))}}(f,v,arguments.length>=2,!0))}((A,F)=>(A.push(...F),A)),oe(null),function sr(f,v){const h=arguments.length>=2;return y=>y.pipe(f?(0,ee.p)((b,A)=>f(b,A,y)):te.D,pn(1),h?oe(v):Me(()=>new J))}(),(0,ye.Z)(A=>{if(null===A)return Jr(y);const F=lc(A);return function Hi(f){f.sort((v,h)=>v.value.outlet===Ye?-1:h.value.outlet===Ye?1:v.value.outlet.localeCompare(h.value.outlet))}(F),(0,j.of)(F)}))}processSegment(v,h,y,b,A,F){return(0,w.H)(h).pipe((0,gt.H)(q=>this.processSegmentAgainstRoute(q._injector??v,h,q,y,b,A,F).pipe((0,xt.W)(H=>{if(H instanceof yo)return(0,j.of)(null);throw H}))),Ve(q=>!!q),(0,xt.W)(q=>{if(la(q))return function rl(f,v,h){return 0===v.length&&!f.children[h]}(y,b,A)?(0,j.of)(new ai):Jr(y);throw q}))}processSegmentAgainstRoute(v,h,y,b,A,F,q){return function Ms(f,v,h,y){return!!(Ir(f)===y||y!==Ye&&fr(v,h,f))&&ji(v,f,h).matched}(y,b,A,F)?void 0===y.redirectTo?this.matchSegmentAgainstRoute(v,b,y,A,F):this.allowRedirects&&q?this.expandSegmentAgainstRouteUsingRedirect(v,b,h,y,A,F):Jr(b):Jr(b)}expandSegmentAgainstRouteUsingRedirect(v,h,y,b,A,F){const{matched:q,consumedSegments:H,positionalParamSegments:Ee,remainingSegments:Ge}=ji(h,b,A);if(!q)return Jr(h);b.redirectTo.startsWith("/")&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const at=this.applyRedirects.applyRedirectCommands(H,b.redirectTo,Ee);return this.applyRedirects.lineralizeSegments(b,at).pipe((0,ye.Z)(on=>this.processSegment(v,y,h,on.concat(Ge),F,!1)))}matchSegmentAgainstRoute(v,h,y,b,A){const F=Du(h,y,b,v);return"**"===y.path&&(h.children={}),F.pipe((0,dn.n)(q=>q.matched?this.getChildConfig(v=y._injector??v,y,b).pipe((0,dn.n)(({routes:H})=>{const Ee=y._loadedInjector??v,{consumedSegments:Ge,remainingSegments:at,parameters:on}=q,ir=new po(Ge,on,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,function ci(f){return f.data||{}}(y),Ir(y),y.component??y._loadedComponent??null,y,function ol(f){return f.resolve||{}}(y)),{segmentGroup:fi,slicedSegments:hi}=Yr(h,Ge,at,H);if(0===hi.length&&fi.hasChildren())return this.processChildren(Ee,H,fi).pipe((0,mt.T)(Bo=>null===Bo?null:new kn(ir,Bo)));if(0===H.length&&0===hi.length)return(0,j.of)(new kn(ir,[]));const va=Ir(y)===A;return this.processSegment(Ee,H,fi,hi,va?Ye:A,!0).pipe((0,mt.T)(Bo=>new kn(ir,Bo instanceof kn?[Bo]:[])))})):Jr(h)))}getChildConfig(v,h,y){return h.children?(0,j.of)({routes:h.children,injector:v}):h.loadChildren?void 0!==h._loadedRoutes?(0,j.of)({routes:h._loadedRoutes,injector:h._loadedInjector}):function Sn(f,v,h,y){const b=v.canLoad;if(void 0===b||0===b.length)return(0,j.of)(!0);const A=b.map(F=>{const q=Zr(F,f);return bn(function nc(f){return f&&ii(f.canLoad)}(q)?q.canLoad(v,h):(0,C.N4e)(f,()=>q(v,h)))});return(0,j.of)(A).pipe(Vo(),ua())}(v,h,y).pipe((0,ye.Z)(b=>b?this.configLoader.loadChildren(v,h).pipe(Fe(A=>{h._loadedRoutes=A.routes,h._loadedInjector=A.injector})):function Ui(f){return(0,Ie.$)(Fn(!1,ur.GuardRejected))}())):(0,j.of)({routes:[],injector:v})}}function ac(f){const v=f.value.routeConfig;return v&&""===v.path}function lc(f){const v=[],h=new Set;for(const y of f){if(!ac(y)){v.push(y);continue}const b=v.find(A=>y.value.routeConfig===A.value.routeConfig);void 0!==b?(b.children.push(...y.children),h.add(b)):v.push(y)}for(const y of h){const b=lc(y.children);v.push(new kn(y.value,b))}return v.filter(y=>!h.has(y))}function $i(f){const v=f.children.map(h=>$i(h)).flat();return[f,...v]}function g(f){return(0,dn.n)(v=>{const h=f(v);return h?(0,w.H)(h).pipe((0,mt.T)(()=>v)):(0,j.of)(v)})}let M=(()=>{class f{buildTitle(h){let y,b=h.root;for(;void 0!==b;)y=this.getResolvedTitleForRoute(b)??y,b=b.children.find(A=>A.outlet===Ye);return y}getResolvedTitleForRoute(h){return h.data[wr]}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=C.jDH({token:f,factory:()=>(0,C.WQX)(_),providedIn:"root"})}return f})(),_=(()=>{class f extends M{constructor(h){super(),this.title=h}updateTitle(h){const y=this.buildTitle(h);void 0!==y&&this.title.setTitle(y)}static#e=this.\u0275fac=function(y){return new(y||f)(C.KVO(xr.hE))};static#t=this.\u0275prov=C.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();const S=new C.nKC("",{providedIn:"root",factory:()=>({})}),P=new C.nKC("");let X=(()=>{class f{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=(0,C.WQX)(C.Ql9)}loadComponent(h){if(this.componentLoaders.get(h))return this.componentLoaders.get(h);if(h._loadedComponent)return(0,j.of)(h._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(h);const y=bn(h.loadComponent()).pipe((0,mt.T)(Ft),Fe(A=>{this.onLoadEndListener&&this.onLoadEndListener(h),h._loadedComponent=A}),(0,Kt.j)(()=>{this.componentLoaders.delete(h)})),b=new yn(y,()=>new tn.B).pipe(er());return this.componentLoaders.set(h,b),b}loadChildren(h,y){if(this.childrenLoaders.get(y))return this.childrenLoaders.get(y);if(y._loadedRoutes)return(0,j.of)({routes:y._loadedRoutes,injector:y._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(y);const A=function le(f,v,h,y){return bn(f.loadChildren()).pipe((0,mt.T)(Ft),(0,ye.Z)(b=>b instanceof C.Co$||Array.isArray(b)?(0,j.of)(b):(0,w.H)(v.compileModuleAsync(b))),(0,mt.T)(b=>{y&&y(f);let A,F,q=!1;return Array.isArray(b)?(F=b,!0):(A=b.create(h).injector,F=A.get(P,[],{optional:!0,self:!0}).flat()),{routes:F.map(Lr),injector:A}}))}(y,this.compiler,h,this.onLoadEndListener).pipe((0,Kt.j)(()=>{this.childrenLoaders.delete(y)})),F=new yn(A,()=>new tn.B).pipe(er());return this.childrenLoaders.set(y,F),F}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=C.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();function Ft(f){return function xe(f){return f&&"object"==typeof f&&"default"in f}(f)?f.default:f}let Nt=(()=>{class f{static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=C.jDH({token:f,factory:()=>(0,C.WQX)(Lt),providedIn:"root"})}return f})(),Lt=(()=>{class f{shouldProcessUrl(h){return!0}extract(h){return h}merge(h,y){return h}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=C.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();const ft=new C.nKC("");let vt=(()=>{class f{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new tn.B,this.transitionAbortSubject=new tn.B,this.configLoader=(0,C.WQX)(X),this.environmentInjector=(0,C.WQX)(C.uvJ),this.urlSerializer=(0,C.WQX)(B),this.rootContexts=(0,C.WQX)(ko),this.location=(0,C.WQX)(Rn.aZ),this.inputBindingEnabled=null!==(0,C.WQX)(Er,{optional:!0}),this.titleStrategy=(0,C.WQX)(M),this.options=(0,C.WQX)(S,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=(0,C.WQX)(Nt),this.createViewTransition=(0,C.WQX)(ft,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>(0,j.of)(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=b=>this.events.next(new Zl(b)),this.configLoader.onLoadStartListener=b=>this.events.next(new Qs(b))}complete(){this.transitions?.complete()}handleNavigationRequest(h){const y=++this.navigationId;this.transitions?.next({...this.transitions.value,...h,id:y})}setupNavigations(h,y,b){return this.transitions=new Q.t({id:0,currentUrlTree:y,currentRawUrl:y,extractedUrl:this.urlHandlingStrategy.extract(y),urlAfterRedirects:this.urlHandlingStrategy.extract(y),rawUrl:y,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:nr,restoredState:null,currentSnapshot:b.snapshot,targetSnapshot:null,currentRouterState:b,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe((0,ee.p)(A=>0!==A.id),(0,mt.T)(A=>({...A,extractedUrl:this.urlHandlingStrategy.extract(A.rawUrl)})),(0,dn.n)(A=>{let F=!1,q=!1;return(0,j.of)(A).pipe((0,dn.n)(H=>{if(this.navigationId>A.id)return this.cancelNavigationTransition(A,"",ur.SupersededByNewNavigation),Pe.w;this.currentTransition=A,this.currentNavigation={id:H.id,initialUrl:H.rawUrl,extractedUrl:H.extractedUrl,trigger:H.source,extras:H.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null};const Ee=!h.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!Ee&&"reload"!==(H.extras.onSameUrlNavigation??h.onSameUrlNavigation)){const at="";return this.events.next(new Ti(H.id,this.urlSerializer.serialize(H.rawUrl),at,_n.IgnoredSameUrlNavigation)),H.resolve(null),Pe.w}if(this.urlHandlingStrategy.shouldProcessUrl(H.rawUrl))return(0,j.of)(H).pipe((0,dn.n)(at=>{const on=this.transitions?.getValue();return this.events.next(new Xe(at.id,this.urlSerializer.serialize(at.extractedUrl),at.source,at.restoredState)),on!==this.transitions?.getValue()?Pe.w:Promise.resolve(at)}),function il(f,v,h,y,b,A){return(0,ye.Z)(F=>function Bi(f,v,h,y,b,A,F="emptyOnly"){return new li(f,v,h,y,b,F,A).recognize()}(f,v,h,y,F.extractedUrl,b,A).pipe((0,mt.T)(({state:q,tree:H})=>({...F,targetSnapshot:q,urlAfterRedirects:H}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,h.config,this.urlSerializer,this.paramsInheritanceStrategy),Fe(at=>{A.targetSnapshot=at.targetSnapshot,A.urlAfterRedirects=at.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:at.urlAfterRedirects};const on=new Ri(at.id,this.urlSerializer.serialize(at.extractedUrl),this.urlSerializer.serialize(at.urlAfterRedirects),at.targetSnapshot);this.events.next(on)}));if(Ee&&this.urlHandlingStrategy.shouldProcessUrl(H.currentRawUrl)){const{id:at,extractedUrl:on,source:ir,restoredState:fi,extras:hi}=H,va=new Xe(at,this.urlSerializer.serialize(on),ir,fi);this.events.next(va);const Bo=Fo(this.rootComponentType).snapshot;return this.currentTransition=A={...H,targetSnapshot:Bo,urlAfterRedirects:on,extras:{...hi,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=on,(0,j.of)(A)}{const at="";return this.events.next(new Ti(H.id,this.urlSerializer.serialize(H.extractedUrl),at,_n.IgnoredByUrlHandlingStrategy)),H.resolve(null),Pe.w}}),Fe(H=>{const Ee=new pt(H.id,this.urlSerializer.serialize(H.extractedUrl),this.urlSerializer.serialize(H.urlAfterRedirects),H.targetSnapshot);this.events.next(Ee)}),(0,mt.T)(H=>(this.currentTransition=A={...H,guards:sa(H.targetSnapshot,H.currentSnapshot,this.rootContexts)},A)),function ca(f,v){return(0,ye.Z)(h=>{const{targetSnapshot:y,currentSnapshot:b,guards:{canActivateChecks:A,canDeactivateChecks:F}}=h;return 0===F.length&&0===A.length?(0,j.of)({...h,guardsResult:!0}):function Ja(f,v,h,y){return(0,w.H)(f).pipe((0,ye.Z)(b=>function Wn(f,v,h,y,b){const A=v&&v.routeConfig?v.routeConfig.canDeactivate:null;if(!A||0===A.length)return(0,j.of)(!0);const F=A.map(q=>{const H=Lo(v)??b,Ee=Zr(q,H);return bn(function oc(f){return f&&ii(f.canDeactivate)}(Ee)?Ee.canDeactivate(f,v,h,y):(0,C.N4e)(H,()=>Ee(f,v,h,y))).pipe(Ve())});return(0,j.of)(F).pipe(Vo())}(b.component,b.route,h,v,y)),Ve(b=>!0!==b,!0))}(F,y,b,f).pipe((0,ye.Z)(q=>q&&function Ut(f){return"boolean"==typeof f}(q)?function Ya(f,v,h,y){return(0,w.H)(v).pipe((0,gt.H)(b=>de(function dt(f,v){return null!==f&&v&&v(new ni(f)),(0,j.of)(!0)}(b.route.parent,y),function Es(f,v){return null!==f&&v&&v(new fs(f)),(0,j.of)(!0)}(b.route,y),function Gt(f,v,h){const y=v[v.length-1],A=v.slice(0,v.length-1).reverse().map(F=>function tc(f){const v=f.routeConfig?f.routeConfig.canActivateChild:null;return v&&0!==v.length?{node:f,guards:v}:null}(F)).filter(F=>null!==F).map(F=>We(()=>{const q=F.guards.map(H=>{const Ee=Lo(F.node)??h,Ge=Zr(H,Ee);return bn(function rc(f){return f&&ii(f.canActivateChild)}(Ge)?Ge.canActivateChild(y,f):(0,C.N4e)(Ee,()=>Ge(y,f))).pipe(Ve())});return(0,j.of)(q).pipe(Vo())}));return(0,j.of)(A).pipe(Vo())}(f,b.path,h),function cn(f,v,h){const y=v.routeConfig?v.routeConfig.canActivate:null;if(!y||0===y.length)return(0,j.of)(!0);const b=y.map(A=>We(()=>{const F=Lo(v)??h,q=Zr(A,F);return bn(function Za(f){return f&&ii(f.canActivate)}(q)?q.canActivate(v,f):(0,C.N4e)(F,()=>q(v,f))).pipe(Ve())}));return(0,j.of)(b).pipe(Vo())}(f,b.route,h))),Ve(b=>!0!==b,!0))}(y,A,f,v):(0,j.of)(q)),(0,mt.T)(q=>({...h,guardsResult:q})))})}(this.environmentInjector,H=>this.events.next(H)),Fe(H=>{if(A.guardsResult=H.guardsResult,zr(H.guardsResult))throw ra(0,H.guardsResult);const Ee=new ds(H.id,this.urlSerializer.serialize(H.extractedUrl),this.urlSerializer.serialize(H.urlAfterRedirects),H.targetSnapshot,!!H.guardsResult);this.events.next(Ee)}),(0,ee.p)(H=>!!H.guardsResult||(this.cancelNavigationTransition(H,"",ur.GuardRejected),!1)),g(H=>{if(H.guards.canActivateChecks.length)return(0,j.of)(H).pipe(Fe(Ee=>{const Ge=new Xs(Ee.id,this.urlSerializer.serialize(Ee.extractedUrl),this.urlSerializer.serialize(Ee.urlAfterRedirects),Ee.targetSnapshot);this.events.next(Ge)}),(0,dn.n)(Ee=>{let Ge=!1;return(0,j.of)(Ee).pipe(function uc(f,v){return(0,ye.Z)(h=>{const{targetSnapshot:y,guards:{canActivateChecks:b}}=h;if(!b.length)return(0,j.of)(h);const A=new Set(b.map(H=>H.route)),F=new Set;for(const H of A)if(!F.has(H))for(const Ee of $i(H))F.add(Ee);let q=0;return(0,w.H)(F).pipe((0,gt.H)(H=>A.has(H)?function wo(f,v,h,y){const b=f.routeConfig,A=f._resolve;return void 0!==b?.title&&!go(b)&&(A[wr]=b.title),function sl(f,v,h,y){const b=Wr(f);if(0===b.length)return(0,j.of)({});const A={};return(0,w.H)(b).pipe((0,ye.Z)(F=>function Ts(f,v,h,y){const b=Lo(v)??y,A=Zr(f,b);return bn(A.resolve?A.resolve(v,h):(0,C.N4e)(b,()=>A(v,h)))}(f[F],v,h,y).pipe(Ve(),Fe(q=>{A[F]=q}))),pn(1),function On(f){return(0,mt.T)(()=>f)}(A),(0,xt.W)(F=>la(F)?Pe.w:(0,Ie.$)(F)))}(A,f,v,y).pipe((0,mt.T)(F=>(f._resolvedData=F,f.data=gs(f,f.parent,h).resolve,null)))}(H,y,f,v):(H.data=gs(H,H.parent,f).resolve,(0,j.of)(void 0))),Fe(()=>q++),pn(1),(0,ye.Z)(H=>q===F.size?(0,j.of)(h):Pe.w))})}(this.paramsInheritanceStrategy,this.environmentInjector),Fe({next:()=>Ge=!0,complete:()=>{Ge||this.cancelNavigationTransition(Ee,"",ur.NoDataFromResolver)}}))}),Fe(Ee=>{const Ge=new Pn(Ee.id,this.urlSerializer.serialize(Ee.extractedUrl),this.urlSerializer.serialize(Ee.urlAfterRedirects),Ee.targetSnapshot);this.events.next(Ge)}))}),g(H=>{const Ee=Ge=>{const at=[];Ge.routeConfig?.loadComponent&&!Ge.routeConfig._loadedComponent&&at.push(this.configLoader.loadComponent(Ge.routeConfig).pipe(Fe(on=>{Ge.component=on}),(0,mt.T)(()=>{})));for(const on of Ge.children)at.push(...Ee(on));return at};return ze(Ee(H.targetSnapshot.root)).pipe(oe(null),(0,K.s)(1))}),g(()=>this.afterPreactivation()),(0,dn.n)(()=>{const{currentSnapshot:H,targetSnapshot:Ee}=A,Ge=this.createViewTransition?.(this.environmentInjector,H.root,Ee.root);return Ge?(0,w.H)(Ge).pipe((0,mt.T)(()=>A)):(0,j.of)(A)}),(0,mt.T)(H=>{const Ee=function mo(f,v,h){const y=dr(f,v._root,h?h._root:void 0);return new xi(y,v)}(h.routeReuseStrategy,H.targetSnapshot,H.currentRouterState);return this.currentTransition=A={...H,targetRouterState:Ee},this.currentNavigation.targetRouterState=Ee,A}),Fe(()=>{this.events.next(new hs)}),((f,v,h,y)=>(0,mt.T)(b=>(new ia(v,b.targetRouterState,b.currentRouterState,h,y).activate(f),b)))(this.rootContexts,h.routeReuseStrategy,H=>this.events.next(H),this.inputBindingEnabled),(0,K.s)(1),Fe({next:H=>{F=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new ut(H.id,this.urlSerializer.serialize(H.extractedUrl),this.urlSerializer.serialize(H.urlAfterRedirects))),this.titleStrategy?.updateTitle(H.targetRouterState.snapshot),H.resolve(!0)},complete:()=>{F=!0}}),function Ne(f){return(0,Je.N)((v,h)=>{(0,Ce.Tg)(f).subscribe((0,ae._)(h,()=>h.complete(),jn.l)),!h.closed&&v.subscribe(h)})}(this.transitionAbortSubject.pipe(Fe(H=>{throw H}))),(0,Kt.j)(()=>{!F&&!q&&this.cancelNavigationTransition(A,"",ur.SupersededByNewNavigation),this.currentTransition?.id===A.id&&(this.currentNavigation=null,this.currentTransition=null)}),(0,xt.W)(H=>{if(q=!0,$n(H))this.events.next(new xo(A.id,this.urlSerializer.serialize(A.extractedUrl),H.message,H.cancellationCode)),function vs(f){return $n(f)&&zr(f.url)}(H)?this.events.next(new ps(H.url)):A.resolve(!1);else{this.events.next(new Ai(A.id,this.urlSerializer.serialize(A.extractedUrl),H,A.targetSnapshot??void 0));try{A.resolve(h.errorHandler(H))}catch(Ee){this.options.resolveNavigationPromiseOnError?A.resolve(!1):A.reject(Ee)}}return Pe.w}))}))}cancelNavigationTransition(h,y,b){const A=new xo(h.id,this.urlSerializer.serialize(h.extractedUrl),y,b);this.events.next(A),h.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){return this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))).toString()!==this.currentTransition?.extractedUrl.toString()&&!this.currentTransition?.extras.skipLocationChange}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=C.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();function me(f){return f!==nr}let Le=(()=>{class f{static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=C.jDH({token:f,factory:()=>(0,C.WQX)(vn),providedIn:"root"})}return f})();class Pt{shouldDetach(v){return!1}store(v,h){}shouldAttach(v){return!1}retrieve(v){return null}shouldReuseRoute(v,h){return v.routeConfig===h.routeConfig}}let vn=(()=>{class f extends Pt{static#e=this.\u0275fac=(()=>{let h;return function(b){return(h||(h=C.xGo(f)))(b||f)}})();static#t=this.\u0275prov=C.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})(),zt=(()=>{class f{static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=C.jDH({token:f,factory:()=>(0,C.WQX)(Yt),providedIn:"root"})}return f})(),Yt=(()=>{class f extends zt{constructor(){super(...arguments),this.location=(0,C.WQX)(Rn.aZ),this.urlSerializer=(0,C.WQX)(B),this.options=(0,C.WQX)(S,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=(0,C.WQX)(Nt),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new fo,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=Fo(null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(h){return this.location.subscribe(y=>{"popstate"===y.type&&h(y.url,y.state)})}handleRouterEvent(h,y){if(h instanceof Xe)this.stateMemento=this.createStateMemento();else if(h instanceof Ti)this.rawUrlTree=y.initialUrl;else if(h instanceof Ri){if("eager"===this.urlUpdateStrategy&&!y.extras.skipLocationChange){const b=this.urlHandlingStrategy.merge(y.finalUrl,y.initialUrl);this.setBrowserUrl(b,y)}}else h instanceof hs?(this.currentUrlTree=y.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(y.finalUrl,y.initialUrl),this.routerState=y.targetRouterState,"deferred"===this.urlUpdateStrategy&&(y.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,y))):h instanceof xo&&(h.code===ur.GuardRejected||h.code===ur.NoDataFromResolver)?this.restoreHistory(y):h instanceof Ai?this.restoreHistory(y,!0):h instanceof ut&&(this.lastSuccessfulId=h.id,this.currentPageId=this.browserPageId)}setBrowserUrl(h,y){const b=this.urlSerializer.serialize(h);if(this.location.isCurrentPathEqualTo(b)||y.extras.replaceUrl){const F={...y.extras.state,...this.generateNgRouterState(y.id,this.browserPageId)};this.location.replaceState(b,"",F)}else{const A={...y.extras.state,...this.generateNgRouterState(y.id,this.browserPageId+1)};this.location.go(b,"",A)}}restoreHistory(h,y=!1){if("computed"===this.canceledNavigationResolution){const A=this.currentPageId-this.browserPageId;0!==A?this.location.historyGo(A):this.currentUrlTree===h.finalUrl&&0===A&&(this.resetState(h),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(y&&this.resetState(h),this.resetUrlToCurrentUrlTree())}resetState(h){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,h.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(h,y){return"computed"===this.canceledNavigationResolution?{navigationId:h,\u0275routerPageId:y}:{navigationId:h}}static#e=this.\u0275fac=(()=>{let h;return function(b){return(h||(h=C.xGo(f)))(b||f)}})();static#t=this.\u0275prov=C.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();var rr=function(f){return f[f.COMPLETE=0]="COMPLETE",f[f.FAILED=1]="FAILED",f[f.REDIRECTING=2]="REDIRECTING",f}(rr||{});function wn(f){throw f}const Tr={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},Qe={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let or=(()=>{class f{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.isNgZoneEnabled=!1,this.console=(0,C.WQX)(C.H3F),this.stateManager=(0,C.WQX)(zt),this.options=(0,C.WQX)(S,{optional:!0})||{},this.pendingTasks=(0,C.WQX)(C.TgB),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=(0,C.WQX)(vt),this.urlSerializer=(0,C.WQX)(B),this.location=(0,C.WQX)(Rn.aZ),this.urlHandlingStrategy=(0,C.WQX)(Nt),this._events=new tn.B,this.errorHandler=this.options.errorHandler||wn,this.navigated=!1,this.routeReuseStrategy=(0,C.WQX)(Le),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=(0,C.WQX)(P,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!(0,C.WQX)(Er,{optional:!0}),this.eventsSubscription=new qe.yU,this.isNgZoneEnabled=(0,C.WQX)(C.SKi)instanceof C.SKi&&C.SKi.isInAngularZone(),this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:h=>{this.console.warn(h)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const h=this.navigationTransitions.events.subscribe(y=>{try{const b=this.navigationTransitions.currentTransition,A=this.navigationTransitions.currentNavigation;if(null!==b&&null!==A)if(this.stateManager.handleRouterEvent(y,A),y instanceof xo&&y.code!==ur.Redirect&&y.code!==ur.SupersededByNewNavigation)this.navigated=!0;else if(y instanceof ut)this.navigated=!0;else if(y instanceof ps){const F=this.urlHandlingStrategy.merge(y.url,b.currentRawUrl),q={info:b.extras.info,skipLocationChange:b.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||me(b.source)};this.scheduleNavigation(F,nr,null,q,{resolve:b.resolve,reject:b.reject,promise:b.promise})}(function Uo(f){return!(f instanceof hs||f instanceof ps)})(y)&&this._events.next(y)}catch(b){this.navigationTransitions.transitionAbortSubject.next(b)}});this.eventsSubscription.add(h)}resetRootComponentType(h){this.routerState.root.component=h,this.navigationTransitions.rootComponentType=h}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),nr,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((h,y)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(h,"popstate",y)},0)})}navigateToSyncWithBrowser(h,y,b){const A={replaceUrl:!0},F=b?.navigationId?b:null;if(b){const H={...b};delete H.navigationId,delete H.\u0275routerPageId,0!==Object.keys(H).length&&(A.state=H)}const q=this.parseUrl(h);this.scheduleNavigation(q,y,F,A)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(h){this.config=h.map(Lr),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(h,y={}){const{relativeTo:b,queryParams:A,fragment:F,queryParamsHandling:q,preserveFragment:H}=y,Ee=H?this.currentUrlTree.fragment:F;let at,Ge=null;switch(q){case"merge":Ge={...this.currentUrlTree.queryParams,...A};break;case"preserve":Ge=this.currentUrlTree.queryParams;break;default:Ge=A||null}null!==Ge&&(Ge=this.removeEmptyProps(Ge));try{at=Ii(b?b.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof h[0]||!h[0].startsWith("/"))&&(h=[]),at=this.currentUrlTree.root}return qr(at,h,Ge,Ee??null)}navigateByUrl(h,y={skipLocationChange:!1}){const b=zr(h)?h:this.parseUrl(h),A=this.urlHandlingStrategy.merge(b,this.rawUrlTree);return this.scheduleNavigation(A,nr,null,y)}navigate(h,y={skipLocationChange:!1}){return function dc(f){for(let v=0;v(null!=A&&(y[b]=A),y),{})}scheduleNavigation(h,y,b,A,F){if(this.disposed)return Promise.resolve(!1);let q,H,Ee;F?(q=F.resolve,H=F.reject,Ee=F.promise):Ee=new Promise((at,on)=>{q=at,H=on});const Ge=this.pendingTasks.add();return function Bt(f,v){f.events.pipe((0,ee.p)(h=>h instanceof ut||h instanceof xo||h instanceof Ai||h instanceof Ti),(0,mt.T)(h=>h instanceof ut||h instanceof Ti?rr.COMPLETE:h instanceof xo&&(h.code===ur.Redirect||h.code===ur.SupersededByNewNavigation)?rr.REDIRECTING:rr.FAILED),(0,ee.p)(h=>h!==rr.REDIRECTING),(0,K.s)(1)).subscribe(()=>{v()})}(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(Ge))}),this.navigationTransitions.handleNavigationRequest({source:y,restoredState:b,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:h,extras:A,resolve:q,reject:H,promise:Ee,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),Ee.catch(at=>Promise.reject(at))}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=C.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})(),qt=(()=>{class f{constructor(h,y,b,A,F,q){this.router=h,this.route=y,this.tabIndexAttribute=b,this.renderer=A,this.el=F,this.locationStrategy=q,this.href=null,this.commands=null,this.onChanges=new tn.B,this.preserveFragment=!1,this.skipLocationChange=!1,this.replaceUrl=!1;const H=F.nativeElement.tagName?.toLowerCase();this.isAnchorElement="a"===H||"area"===H,this.isAnchorElement?this.subscription=h.events.subscribe(Ee=>{Ee instanceof ut&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(h){null!=this.tabIndexAttribute||this.isAnchorElement||this.applyAttributeValue("tabindex",h)}ngOnChanges(h){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}set routerLink(h){null!=h?(this.commands=Array.isArray(h)?h:[h],this.setTabIndexIfNotOnNativeEl("0")):(this.commands=null,this.setTabIndexIfNotOnNativeEl(null))}onClick(h,y,b,A,F){const q=this.urlTree;return!!(null===q||this.isAnchorElement&&(0!==h||y||b||A||F||"string"==typeof this.target&&"_self"!=this.target))||(this.router.navigateByUrl(q,{skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info}),!this.isAnchorElement)}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){const h=this.urlTree;this.href=null!==h&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(h)):null;const y=null===this.href?null:(0,C.n$t)(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",y)}applyAttributeValue(h,y){const b=this.renderer,A=this.el.nativeElement;null!==y?b.setAttribute(A,h,y):b.removeAttribute(A,h)}get urlTree(){return null===this.commands?null:this.router.createUrlTree(this.commands,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static#e=this.\u0275fac=function(y){return new(y||f)(C.rXU(or),C.rXU(Xr),C.kS0("tabindex"),C.rXU(C.sFG),C.rXU(C.aKT),C.rXU(Rn.hb))};static#t=this.\u0275dir=C.FsC({type:f,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(y,b){1&y&&C.bIt("click",function(F){return b.onClick(F.button,F.ctrlKey,F.shiftKey,F.altKey,F.metaKey)}),2&y&&C.BMQ("target",b.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[C.Mj6.HasDecoratorInputTransform,"preserveFragment","preserveFragment",C.L39],skipLocationChange:[C.Mj6.HasDecoratorInputTransform,"skipLocationChange","skipLocationChange",C.L39],replaceUrl:[C.Mj6.HasDecoratorInputTransform,"replaceUrl","replaceUrl",C.L39],routerLink:"routerLink"},standalone:!0,features:[C.GFd,C.OA$]})}return f})();const Gi=new C.nKC("");function it(f,...v){return(0,C.EmA)([{provide:P,multi:!0,useValue:f},[],{provide:Xr,useFactory:pa,deps:[or]},{provide:C.iLQ,multi:!0,useFactory:ga},v.map(h=>h.\u0275providers)])}function pa(f){return f.routerState.root}function ga(){const f=(0,C.WQX)(C.zZn);return v=>{const h=f.get(C.o8S);if(v!==h.components[0])return;const y=f.get(or),b=f.get(Dn);1===f.get(Cn)&&y.initialNavigation(),f.get(Ar,null,C.$GK.Optional)?.setUpPreloading(),f.get(Gi,null,C.$GK.Optional)?.init(),y.resetRootComponentType(h.componentTypes[0]),b.closed||(b.next(),b.complete(),b.unsubscribe())}}const Dn=new C.nKC("",{factory:()=>new tn.B}),Cn=new C.nKC("",{providedIn:"root",factory:()=>1}),Ar=new C.nKC("");function bu(f){return function zn(f,v){return{\u0275kind:f,\u0275providers:v}}(5,[{provide:S,useValue:f}])}},467:(Ue,he,O)=>{"use strict";function C(w,j,Q,De,J,be,ge){try{var te=w[be](ge),Z=te.value}catch(se){return void Q(se)}te.done?j(Z):Promise.resolve(Z).then(De,J)}function N(w){return function(){var j=this,Q=arguments;return new Promise(function(De,J){var be=w.apply(j,Q);function ge(Z){C(be,De,J,ge,te,"next",Z)}function te(Z){C(be,De,J,ge,te,"throw",Z)}ge(void 0)})}}O.d(he,{A:()=>N})},1635:(Ue,he,O)=>{"use strict";function se(K,Y,ee,oe){return new(ee||(ee=Promise))(function(_e,Ve){function gt(xt){try{Fe(oe.next(xt))}catch(an){Ve(an)}}function Nn(xt){try{Fe(oe.throw(xt))}catch(an){Ve(an)}}function Fe(xt){xt.done?_e(xt.value):function Me(_e){return _e instanceof ee?_e:new ee(function(Ve){Ve(_e)})}(xt.value).then(gt,Nn)}Fe((oe=oe.apply(K,Y||[])).next())})}function pe(K){return this instanceof pe?(this.v=K,this):new pe(K)}function de(K,Y,ee){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Me,oe=ee.apply(K,Y||[]),_e=[];return Me={},Ve("next"),Ve("throw"),Ve("return"),Me[Symbol.asyncIterator]=function(){return this},Me;function Ve(Vt){oe[Vt]&&(Me[Vt]=function(pn){return new Promise(function(sr,On){_e.push([Vt,pn,sr,On])>1||gt(Vt,pn)})})}function gt(Vt,pn){try{!function Nn(Vt){Vt.value instanceof pe?Promise.resolve(Vt.value.v).then(Fe,xt):an(_e[0][2],Vt)}(oe[Vt](pn))}catch(sr){an(_e[0][3],sr)}}function Fe(Vt){gt("next",Vt)}function xt(Vt){gt("throw",Vt)}function an(Vt,pn){Vt(pn),_e.shift(),_e.length&>(_e[0][0],_e[0][1])}}function We(K){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var ee,Y=K[Symbol.asyncIterator];return Y?Y.call(K):(K=function ze(K){var Y="function"==typeof Symbol&&Symbol.iterator,ee=Y&&K[Y],oe=0;if(ee)return ee.call(K);if(K&&"number"==typeof K.length)return{next:function(){return K&&oe>=K.length&&(K=void 0),{value:K&&K[oe++],done:!K}}};throw new TypeError(Y?"Object is not iterable.":"Symbol.iterator is not defined.")}(K),ee={},oe("next"),oe("throw"),oe("return"),ee[Symbol.asyncIterator]=function(){return this},ee);function oe(_e){ee[_e]=K[_e]&&function(Ve){return new Promise(function(gt,Nn){!function Me(_e,Ve,gt,Nn){Promise.resolve(Nn).then(function(Fe){_e({value:Fe,done:gt})},Ve)}(gt,Nn,(Ve=K[_e](Ve)).done,Ve.value)})}}}O.d(he,{AQ:()=>de,N3:()=>pe,sH:()=>se,xN:()=>We}),"function"==typeof SuppressedError&&SuppressedError}},Ue=>{Ue(Ue.s=3147)}]); \ No newline at end of file diff --git a/demo-app/ngx-auth/main.d2fc577980f3ae1c.js b/demo-app/ngx-auth/main.d2fc577980f3ae1c.js new file mode 100644 index 0000000..c8b8370 --- /dev/null +++ b/demo-app/ngx-auth/main.d2fc577980f3ae1c.js @@ -0,0 +1 @@ +(self.webpackChunkdemo_app_ngx_auth=self.webpackChunkdemo_app_ngx_auth||[]).push([[792],{111:($e,he,O)=>{"use strict";var S=O(345);function U(o,s,a,u,m,D,M){try{var N=o[D](M),B=N.value}catch(K){return void a(K)}N.done?s(B):Promise.resolve(B).then(u,m)}function x(o){return function(){var s=this,a=arguments;return new Promise(function(u,m){var D=o.apply(s,a);function M(B){U(D,u,m,M,N,"next",B)}function N(B){U(D,u,m,M,N,"throw",B)}M(void 0)})}}var _=O(3953),W=O(7673),oe=O(1985),_e=O(6648),Me=O(274),Ae=O(5964),Y=O(6354),J=O(980),ae=O(5558),Ie=O(177);class se{}class Oe{}class Ue{constructor(s){this.normalizedNames=new Map,this.lazyUpdate=null,s?"string"==typeof s?this.lazyInit=()=>{this.headers=new Map,s.split("\n").forEach(a=>{const u=a.indexOf(":");if(u>0){const m=a.slice(0,u),D=m.toLowerCase(),M=a.slice(u+1).trim();this.maybeSetNormalizedName(m,D),this.headers.has(D)?this.headers.get(D).push(M):this.headers.set(D,[M])}})}:typeof Headers<"u"&&s instanceof Headers?(this.headers=new Map,s.forEach((a,u)=>{this.setHeaderEntries(u,a)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(s).forEach(([a,u])=>{this.setHeaderEntries(a,u)})}:this.headers=new Map}has(s){return this.init(),this.headers.has(s.toLowerCase())}get(s){this.init();const a=this.headers.get(s.toLowerCase());return a&&a.length>0?a[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(s){return this.init(),this.headers.get(s.toLowerCase())||null}append(s,a){return this.clone({name:s,value:a,op:"a"})}set(s,a){return this.clone({name:s,value:a,op:"s"})}delete(s,a){return this.clone({name:s,value:a,op:"d"})}maybeSetNormalizedName(s,a){this.normalizedNames.has(a)||this.normalizedNames.set(a,s)}init(){this.lazyInit&&(this.lazyInit instanceof Ue?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(s=>this.applyUpdate(s)),this.lazyUpdate=null))}copyFrom(s){s.init(),Array.from(s.headers.keys()).forEach(a=>{this.headers.set(a,s.headers.get(a)),this.normalizedNames.set(a,s.normalizedNames.get(a))})}clone(s){const a=new Ue;return a.lazyInit=this.lazyInit&&this.lazyInit instanceof Ue?this.lazyInit:this,a.lazyUpdate=(this.lazyUpdate||[]).concat([s]),a}applyUpdate(s){const a=s.name.toLowerCase();switch(s.op){case"a":case"s":let u=s.value;if("string"==typeof u&&(u=[u]),0===u.length)return;this.maybeSetNormalizedName(s.name,a);const m=("a"===s.op?this.headers.get(a):void 0)||[];m.push(...u),this.headers.set(a,m);break;case"d":const D=s.value;if(D){let M=this.headers.get(a);if(!M)return;M=M.filter(N=>-1===D.indexOf(N)),0===M.length?(this.headers.delete(a),this.normalizedNames.delete(a)):this.headers.set(a,M)}else this.headers.delete(a),this.normalizedNames.delete(a)}}setHeaderEntries(s,a){const u=(Array.isArray(a)?a:[a]).map(D=>D.toString()),m=s.toLowerCase();this.headers.set(m,u),this.maybeSetNormalizedName(s,m)}forEach(s){this.init(),Array.from(this.normalizedNames.keys()).forEach(a=>s(this.normalizedNames.get(a),this.headers.get(a)))}}class ie{encodeKey(s){return de(s)}encodeValue(s){return de(s)}decodeKey(s){return decodeURIComponent(s)}decodeValue(s){return decodeURIComponent(s)}}const ze=/%(\d[a-f0-9])/gi,ge={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function de(o){return encodeURIComponent(o).replace(ze,(s,a)=>ge[a]??s)}function be(o){return`${o}`}class Ge{constructor(s={}){if(this.updates=null,this.cloneFrom=null,this.encoder=s.encoder||new ie,s.fromString){if(s.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function ve(o,s){const a=new Map;return o.length>0&&o.replace(/^\?/,"").split("&").forEach(m=>{const D=m.indexOf("="),[M,N]=-1==D?[s.decodeKey(m),""]:[s.decodeKey(m.slice(0,D)),s.decodeValue(m.slice(D+1))],B=a.get(M)||[];B.push(N),a.set(M,B)}),a}(s.fromString,this.encoder)}else s.fromObject?(this.map=new Map,Object.keys(s.fromObject).forEach(a=>{const u=s.fromObject[a],m=Array.isArray(u)?u.map(be):[be(u)];this.map.set(a,m)})):this.map=null}has(s){return this.init(),this.map.has(s)}get(s){this.init();const a=this.map.get(s);return a?a[0]:null}getAll(s){return this.init(),this.map.get(s)||null}keys(){return this.init(),Array.from(this.map.keys())}append(s,a){return this.clone({param:s,value:a,op:"a"})}appendAll(s){const a=[];return Object.keys(s).forEach(u=>{const m=s[u];Array.isArray(m)?m.forEach(D=>{a.push({param:u,value:D,op:"a"})}):a.push({param:u,value:m,op:"a"})}),this.clone(a)}set(s,a){return this.clone({param:s,value:a,op:"s"})}delete(s,a){return this.clone({param:s,value:a,op:"d"})}toString(){return this.init(),this.keys().map(s=>{const a=this.encoder.encodeKey(s);return this.map.get(s).map(u=>a+"="+this.encoder.encodeValue(u)).join("&")}).filter(s=>""!==s).join("&")}clone(s){const a=new Ge({encoder:this.encoder});return a.cloneFrom=this.cloneFrom||this,a.updates=(this.updates||[]).concat(s),a}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(s=>this.map.set(s,this.cloneFrom.map.get(s))),this.updates.forEach(s=>{switch(s.op){case"a":case"s":const a=("a"===s.op?this.map.get(s.param):void 0)||[];a.push(be(s.value)),this.map.set(s.param,a);break;case"d":if(void 0===s.value){this.map.delete(s.param);break}{let u=this.map.get(s.param)||[];const m=u.indexOf(be(s.value));-1!==m&&u.splice(m,1),u.length>0?this.map.set(s.param,u):this.map.delete(s.param)}}}),this.cloneFrom=this.updates=null)}}class Te{constructor(){this.map=new Map}set(s,a){return this.map.set(s,a),this}get(s){return this.map.has(s)||this.map.set(s,s.defaultValue()),this.map.get(s)}delete(s){return this.map.delete(s),this}has(s){return this.map.has(s)}keys(){return this.map.keys()}}function Ke(o){return typeof ArrayBuffer<"u"&&o instanceof ArrayBuffer}function Qe(o){return typeof Blob<"u"&&o instanceof Blob}function mn(o){return typeof FormData<"u"&&o instanceof FormData}class an{constructor(s,a,u,m){let D;if(this.url=a,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=s.toUpperCase(),function Le(o){switch(o){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||m?(this.body=void 0!==u?u:null,D=m):D=u,D&&(this.reportProgress=!!D.reportProgress,this.withCredentials=!!D.withCredentials,D.responseType&&(this.responseType=D.responseType),D.headers&&(this.headers=D.headers),D.context&&(this.context=D.context),D.params&&(this.params=D.params),this.transferCache=D.transferCache),this.headers??=new Ue,this.context??=new Te,this.params){const M=this.params.toString();if(0===M.length)this.urlWithParams=a;else{const N=a.indexOf("?");this.urlWithParams=a+(-1===N?"?":NFe.set(ct,s.setHeaders[ct]),K)),s.setParams&&(fe=Object.keys(s.setParams).reduce((Fe,ct)=>Fe.set(ct,s.setParams[ct]),fe)),new an(a,u,M,{params:fe,headers:K,context:Se,reportProgress:B,responseType:m,withCredentials:N,transferCache:D})}}var cn=function(o){return o[o.Sent=0]="Sent",o[o.UploadProgress=1]="UploadProgress",o[o.ResponseHeader=2]="ResponseHeader",o[o.DownloadProgress=3]="DownloadProgress",o[o.Response=4]="Response",o[o.User=5]="User",o}(cn||{});class pt{constructor(s,a=200,u="OK"){this.headers=s.headers||new Ue,this.status=void 0!==s.status?s.status:a,this.statusText=s.statusText||u,this.url=s.url||null,this.ok=this.status>=200&&this.status<300}}class vn extends pt{constructor(s={}){super(s),this.type=cn.ResponseHeader}clone(s={}){return new vn({headers:s.headers||this.headers,status:void 0!==s.status?s.status:this.status,statusText:s.statusText||this.statusText,url:s.url||this.url||void 0})}}class z extends pt{constructor(s={}){super(s),this.type=cn.Response,this.body=void 0!==s.body?s.body:null}clone(s={}){return new z({body:void 0!==s.body?s.body:this.body,headers:s.headers||this.headers,status:void 0!==s.status?s.status:this.status,statusText:s.statusText||this.statusText,url:s.url||this.url||void 0})}}class Z extends pt{constructor(s){super(s,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${s.url||"(unknown url)"}`:`Http failure response for ${s.url||"(unknown url)"}: ${s.status} ${s.statusText}`,this.error=s.error||null}}function pe(o,s){return{body:s,headers:o.headers,context:o.context,observe:o.observe,params:o.params,reportProgress:o.reportProgress,responseType:o.responseType,withCredentials:o.withCredentials,transferCache:o.transferCache}}let Ve=(()=>{class o{constructor(a){this.handler=a}request(a,u,m={}){let D;if(a instanceof an)D=a;else{let B,K;B=m.headers instanceof Ue?m.headers:new Ue(m.headers),m.params&&(K=m.params instanceof Ge?m.params:new Ge({fromObject:m.params})),D=new an(a,u,void 0!==m.body?m.body:null,{headers:B,context:m.context,params:K,reportProgress:m.reportProgress,responseType:m.responseType||"json",withCredentials:m.withCredentials,transferCache:m.transferCache})}const M=(0,W.of)(D).pipe((0,Me.H)(B=>this.handler.handle(B)));if(a instanceof an||"events"===m.observe)return M;const N=M.pipe((0,Ae.p)(B=>B instanceof z));switch(m.observe||"body"){case"body":switch(D.responseType){case"arraybuffer":return N.pipe((0,Y.T)(B=>{if(null!==B.body&&!(B.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return B.body}));case"blob":return N.pipe((0,Y.T)(B=>{if(null!==B.body&&!(B.body instanceof Blob))throw new Error("Response is not a Blob.");return B.body}));case"text":return N.pipe((0,Y.T)(B=>{if(null!==B.body&&"string"!=typeof B.body)throw new Error("Response is not a string.");return B.body}));default:return N.pipe((0,Y.T)(B=>B.body))}case"response":return N;default:throw new Error(`Unreachable: unhandled observe type ${m.observe}}`)}}delete(a,u={}){return this.request("DELETE",a,u)}get(a,u={}){return this.request("GET",a,u)}head(a,u={}){return this.request("HEAD",a,u)}jsonp(a,u){return this.request("JSONP",a,{params:(new Ge).append(u,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(a,u={}){return this.request("OPTIONS",a,u)}patch(a,u,m={}){return this.request("PATCH",a,pe(m,u))}post(a,u,m={}){return this.request("POST",a,pe(m,u))}put(a,u,m={}){return this.request("PUT",a,pe(m,u))}static#e=this.\u0275fac=function(u){return new(u||o)(_.KVO(se))};static#t=this.\u0275prov=_.jDH({token:o,factory:o.\u0275fac})}return o})();const gt=/^\)\]\}',?\n/;function je(o){if(o.url)return o.url;const s="X-Request-URL".toLocaleLowerCase();return o.headers.get(s)}let _t=(()=>{class o{constructor(){this.fetchImpl=(0,_.WQX)(ln,{optional:!0})?.fetch??fetch.bind(globalThis),this.ngZone=(0,_.WQX)(_.SKi)}handle(a){return new oe.c(u=>{const m=new AbortController;return this.doRequest(a,m.signal,u).then(mr,D=>u.error(new Z({error:D}))),()=>m.abort()})}doRequest(a,u,m){var D=this;return x(function*(){const M=D.createRequestInit(a);let N;try{const vt=D.ngZone.runOutsideAngular(()=>D.fetchImpl(a.urlWithParams,{signal:u,...M}));(function It(o){o.then(mr,mr)})(vt),m.next({type:cn.Sent}),N=yield vt}catch(vt){return void m.error(new Z({error:vt,status:vt.status??0,statusText:vt.statusText,url:a.urlWithParams,headers:vt.headers}))}const B=new Ue(N.headers),K=N.statusText,fe=je(N)??a.urlWithParams;let Se=N.status,Fe=null;if(a.reportProgress&&m.next(new vn({headers:B,status:Se,statusText:K,url:fe})),N.body){const vt=N.headers.get("content-length"),ft=[],yt=N.body.getReader();let Ft,St,en=0;const gn=typeof Zone<"u"&&Zone.current;yield D.ngZone.runOutsideAngular(x(function*(){for(;;){const{done:Fn,value:Nt}=yield yt.read();if(Fn)break;if(ft.push(Nt),en+=Nt.length,a.reportProgress){St="text"===a.responseType?(St??"")+(Ft??=new TextDecoder).decode(Nt,{stream:!0}):void 0;const jt=()=>m.next({type:cn.DownloadProgress,total:vt?+vt:void 0,loaded:en,partialText:St});gn?gn.run(jt):jt()}}}));const pn=D.concatChunks(ft,en);try{const Fn=N.headers.get("Content-Type")??"";Fe=D.parseBody(a,pn,Fn)}catch(Fn){return void m.error(new Z({error:Fn,headers:new Ue(N.headers),status:N.status,statusText:N.statusText,url:je(N)??a.urlWithParams}))}}0===Se&&(Se=Fe?200:0),Se>=200&&Se<300?(m.next(new z({body:Fe,headers:B,status:Se,statusText:K,url:fe})),m.complete()):m.error(new Z({error:Fe,headers:B,status:Se,statusText:K,url:fe}))})()}parseBody(a,u,m){switch(a.responseType){case"json":const D=(new TextDecoder).decode(u).replace(gt,"");return""===D?null:JSON.parse(D);case"text":return(new TextDecoder).decode(u);case"blob":return new Blob([u],{type:m});case"arraybuffer":return u.buffer}}createRequestInit(a){const u={},m=a.withCredentials?"include":void 0;if(a.headers.forEach((D,M)=>u[D]=M.join(",")),a.headers.has("Accept")||(u.Accept="application/json, text/plain, */*"),!a.headers.has("Content-Type")){const D=a.detectContentTypeHeader();null!==D&&(u["Content-Type"]=D)}return{body:a.serializeBody(),method:a.method,headers:u,credentials:m}}concatChunks(a,u){const m=new Uint8Array(u);let D=0;for(const M of a)m.set(M,D),D+=M.length;return m}static#e=this.\u0275fac=function(u){return new(u||o)};static#t=this.\u0275prov=_.jDH({token:o,factory:o.\u0275fac})}return o})();class ln{}function mr(){}function tn(o,s){return s(o)}const or=new _.nKC(""),Fi=new _.nKC(""),tt=new _.nKC("",{providedIn:"root",factory:()=>!0});let sr=(()=>{class o extends se{constructor(a,u){super(),this.backend=a,this.injector=u,this.chain=null,this.pendingTasks=(0,_.WQX)(_.TgB),this.contributeToStability=(0,_.WQX)(tt)}handle(a){if(null===this.chain){const u=Array.from(new Set([...this.injector.get(or),...this.injector.get(Fi,[])]));this.chain=u.reduceRight((m,D)=>function Bt(o,s,a){return(u,m)=>(0,_.N4e)(a,()=>s(u,D=>o(D,m)))}(m,D,this.injector),tn)}if(this.contributeToStability){const u=this.pendingTasks.add();return this.chain(a,m=>this.backend.handle(m)).pipe((0,J.j)(()=>this.pendingTasks.remove(u)))}return this.chain(a,u=>this.backend.handle(u))}static#e=this.\u0275fac=function(u){return new(u||o)(_.KVO(Oe),_.KVO(_.uvJ))};static#t=this.\u0275prov=_.jDH({token:o,factory:o.\u0275fac})}return o})();const Ht=/^\)\]\}',?\n/;let To=(()=>{class o{constructor(a){this.xhrFactory=a}handle(a){if("JSONP"===a.method)throw new _.wOt(-2800,!1);const u=this.xhrFactory;return(u.\u0275loadImpl?(0,_e.H)(u.\u0275loadImpl()):(0,W.of)(null)).pipe((0,ae.n)(()=>new oe.c(D=>{const M=u.build();if(M.open(a.method,a.urlWithParams),a.withCredentials&&(M.withCredentials=!0),a.headers.forEach((ft,yt)=>M.setRequestHeader(ft,yt.join(","))),a.headers.has("Accept")||M.setRequestHeader("Accept","application/json, text/plain, */*"),!a.headers.has("Content-Type")){const ft=a.detectContentTypeHeader();null!==ft&&M.setRequestHeader("Content-Type",ft)}if(a.responseType){const ft=a.responseType.toLowerCase();M.responseType="json"!==ft?ft:"text"}const N=a.serializeBody();let B=null;const K=()=>{if(null!==B)return B;const ft=M.statusText||"OK",yt=new Ue(M.getAllResponseHeaders()),en=function Yi(o){return"responseURL"in o&&o.responseURL?o.responseURL:/^X-Request-URL:/m.test(o.getAllResponseHeaders())?o.getResponseHeader("X-Request-URL"):null}(M)||a.url;return B=new vn({headers:yt,status:M.status,statusText:ft,url:en}),B},fe=()=>{let{headers:ft,status:yt,statusText:en,url:Ft}=K(),St=null;204!==yt&&(St=typeof M.response>"u"?M.responseText:M.response),0===yt&&(yt=St?200:0);let gn=yt>=200&&yt<300;if("json"===a.responseType&&"string"==typeof St){const pn=St;St=St.replace(Ht,"");try{St=""!==St?JSON.parse(St):null}catch(Fn){St=pn,gn&&(gn=!1,St={error:Fn,text:St})}}gn?(D.next(new z({body:St,headers:ft,status:yt,statusText:en,url:Ft||void 0})),D.complete()):D.error(new Z({error:St,headers:ft,status:yt,statusText:en,url:Ft||void 0}))},Se=ft=>{const{url:yt}=K(),en=new Z({error:ft,status:M.status||0,statusText:M.statusText||"Unknown Error",url:yt||void 0});D.error(en)};let Fe=!1;const ct=ft=>{Fe||(D.next(K()),Fe=!0);let yt={type:cn.DownloadProgress,loaded:ft.loaded};ft.lengthComputable&&(yt.total=ft.total),"text"===a.responseType&&M.responseText&&(yt.partialText=M.responseText),D.next(yt)},vt=ft=>{let yt={type:cn.UploadProgress,loaded:ft.loaded};ft.lengthComputable&&(yt.total=ft.total),D.next(yt)};return M.addEventListener("load",fe),M.addEventListener("error",Se),M.addEventListener("timeout",Se),M.addEventListener("abort",Se),a.reportProgress&&(M.addEventListener("progress",ct),null!==N&&M.upload&&M.upload.addEventListener("progress",vt)),M.send(N),D.next({type:cn.Sent}),()=>{M.removeEventListener("error",Se),M.removeEventListener("abort",Se),M.removeEventListener("load",fe),M.removeEventListener("timeout",Se),a.reportProgress&&(M.removeEventListener("progress",ct),null!==N&&M.upload&&M.upload.removeEventListener("progress",vt)),M.readyState!==M.DONE&&M.abort()}})))}static#e=this.\u0275fac=function(u){return new(u||o)(_.KVO(Ie.N0))};static#t=this.\u0275prov=_.jDH({token:o,factory:o.\u0275fac})}return o})();const vr=new _.nKC(""),Et=new _.nKC("",{providedIn:"root",factory:()=>"XSRF-TOKEN"}),Gr=new _.nKC("",{providedIn:"root",factory:()=>"X-XSRF-TOKEN"});class Q{}let X=(()=>{class o{constructor(a,u,m){this.doc=a,this.platform=u,this.cookieName=m,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const a=this.doc.cookie||"";return a!==this.lastCookieString&&(this.parseCount++,this.lastToken=(0,Ie._b)(a,this.cookieName),this.lastCookieString=a),this.lastToken}static#e=this.\u0275fac=function(u){return new(u||o)(_.KVO(Ie.qQ),_.KVO(_.Agw),_.KVO(Et))};static#t=this.\u0275prov=_.jDH({token:o,factory:o.\u0275fac})}return o})();function F(o,s){const a=o.url.toLowerCase();if(!(0,_.WQX)(vr)||"GET"===o.method||"HEAD"===o.method||a.startsWith("http://")||a.startsWith("https://"))return s(o);const u=(0,_.WQX)(Q).getToken(),m=(0,_.WQX)(Gr);return null!=u&&!o.headers.has(m)&&(o=o.clone({headers:o.headers.set(m,u)})),s(o)}var ce=function(o){return o[o.Interceptors=0]="Interceptors",o[o.LegacyInterceptors=1]="LegacyInterceptors",o[o.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",o[o.NoXsrfProtection=3]="NoXsrfProtection",o[o.JsonpSupport=4]="JsonpSupport",o[o.RequestsMadeViaParent=5]="RequestsMadeViaParent",o[o.Fetch=6]="Fetch",o}(ce||{});function Ye(...o){const s=[Ve,To,sr,{provide:se,useExisting:sr},{provide:Oe,useFactory:()=>(0,_.WQX)(_t,{optional:!0})??(0,_.WQX)(To)},{provide:or,useValue:F,multi:!0},{provide:vr,useValue:!0},{provide:Q,useClass:X}];for(const a of o)s.push(...a.\u0275providers);return(0,_.EmA)(s)}function Ot(o){return function xe(o,s){return{\u0275kind:o,\u0275providers:s}}(ce.Interceptors,o.map(s=>({provide:or,useValue:s,multi:!0})))}var va=O(8810),Mr=O(6697),hc=O(9437),zr=O(8540);function fs(o){this.message=o}(fs.prototype=new Error).name="InvalidCharacterError";var mi=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(o){var s=String(o).replace(/=+$/,"");if(s.length%4==1)throw new fs("'atob' failed: The string to be decoded is not correctly encoded.");for(var a,u,m=0,D=0,M="";u=s.charAt(D++);~u&&(a=m%4?64*a+u:u,m++%4)?M+=String.fromCharCode(255&a>>(-2*m&6)):0)u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(u);return M};function qr(o){this.message=o}(qr.prototype=new Error).name="InvalidTokenError";const ro=function ya(o,s){if("string"!=typeof o)throw new qr("Invalid token specified");var a=!0===(s=s||{}).header?0:1;try{return JSON.parse(function Wr(o){var s=o.replace(/-/g,"+").replace(/_/g,"/");switch(s.length%4){case 0:break;case 2:s+="==";break;case 3:s+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(mi(s).replace(/(.)/g,function(u,m){var D=m.charCodeAt(0).toString(16).toUpperCase();return D.length<2&&(D="0"+D),"%"+D}))}catch{return mi(s)}}(o.split(".")[a]))}catch(u){throw new qr("Invalid token specified: "+u.message)}};let nn=(()=>{class o{static#e=this.isCordova=()=>!!(window.cordova||window.phonegap||window.PhoneGap);static#t=this.isCapacitor=()=>!!window.Capacitor?.isNativePlatform();static#n=this.isNativeMobile=()=>o.isCapacitor()||o.isCordova();static#o=this.decodeJwt=a=>{try{return a&&ro(a)}catch{return console.warn("[@badisi/auth-js] Access token was not decoded as it is not a valid JWT."),a}};static#s=this.isUrlMatching=(a,u)=>{if(void 0!==u){const m=new URL(a,"http://test"),D=new URL(u,"http://test");if(""!==D.pathname&&"/"!==D.pathname&&!m.pathname.includes(D.pathname)||"http://test"!==D.origin&&(m.protocol!==D.protocol||m.origin!==D.origin||!`${m.origin}${m.pathname}}`.includes(`${D.origin}${D.pathname}`)))return!1;let M=!0;return D.searchParams.forEach((N,B)=>{m.searchParams.getAll(B).includes(N)||(M=!1)}),M}return!1};static#a=this.getBaseUrl=()=>{const a=document.baseURI||document.querySelector("base")?.href||location.origin;return a.endsWith("/")?a:`${a}/`};static#c=this.stringToURL=a=>{try{return new URL(a)}catch{const u=a.startsWith("/")?a.substring(1,a.length):a;return new URL(`${o.getBaseUrl()}${u}`)}}}return o})();var _a=O(1413);const Vi={now:()=>(Vi.delegate||Date).now(),delegate:void 0};class dt extends _a.B{constructor(s=1/0,a=1/0,u=Vi){super(),this._bufferSize=s,this._windowTime=a,this._timestampProvider=u,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=a===1/0,this._bufferSize=Math.max(1,s),this._windowTime=Math.max(1,a)}next(s){const{isStopped:a,_buffer:u,_infiniteTimeWindow:m,_timestampProvider:D,_windowTime:M}=this;a||(u.push(s),!m&&u.push(D.now()+M)),this._trimBuffer(),super.next(s)}_subscribe(s){this._throwIfClosed(),this._trimBuffer();const a=this._innerSubscribe(s),{_infiniteTimeWindow:u,_buffer:m}=this,D=m.slice();for(let M=0;M{let m,D=!0;a.subscribe((0,vi._)(u,M=>{const N=s(M);(D||!o(m,N))&&(D=!1,m=N,u.next(M))}))})}function wa(o,s){return o===s}const Ar=function(){var o=x(function*(s,a){const u=new a;return yield u.init(s),u});return function(a,u){return o.apply(this,arguments)}}(),Oo=function gs(o,s){return o===s||o!=o&&s!=s},xo=function ms(o,s){for(var a=o.length;a--;)if(Oo(o[a][0],s))return a;return-1};var pc=Array.prototype.splice;function oo(o){var s=-1,a=null==o?0:o.length;for(this.clear();++s-1},oo.prototype.set=function vs(o,s){var a=this.__data__,u=xo(a,o);return u<0?(++this.size,a.push([o,s])):a[u][1]=s,this};const so=oo,ba="object"==typeof global&&global&&global.Object===Object&&global;var ao="object"==typeof self&&self&&self.Object===Object&&self;const Kr=ba||ao||Function("return this")();var Pl=Kr.Symbol,_s=Object.prototype,Rr=_s.hasOwnProperty,co=_s.toString,Xr=Pl?Pl.toStringTag:void 0;var Qr=Object.prototype.toString;var lr=Pl?Pl.toStringTag:void 0;const wr=function Zr(o){return null==o?void 0===o?"[object Undefined]":"[object Null]":lr&&lr in Object(o)?function Sa(o){var s=Rr.call(o,Xr),a=o[Xr];try{o[Xr]=void 0;var u=!0}catch{}var m=co.call(o);return u&&(s?o[Xr]=a:delete o[Xr]),m}(o):function lo(o){return Qr.call(o)}(o)},Nr=function yi(o){var s=typeof o;return null!=o&&("object"==s||"function"==s)},Ia=function gd(o){if(!Nr(o))return!1;var s=wr(o);return"[object Function]"==s||"[object GeneratorFunction]"==s||"[object AsyncFunction]"==s||"[object Proxy]"==s};var o,Ct=Kr["__core-js_shared__"],Xt=(o=/[^.]+$/.exec(Ct&&Ct.keys&&Ct.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"";var Es=Function.prototype.toString;var Ds=/^\[object .+?Constructor\]$/,Lt=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const bs=function vd(o){return!(!Nr(o)||function ws(o){return!!Xt&&Xt in o}(o))&&(Ia(o)?Lt:Ds).test(function Ze(o){if(null!=o){try{return Es.call(o)}catch{}try{return o+""}catch{}}return""}(o))},wc=function Ll(o,s){var a=function Uo(o,s){return o?.[s]}(o,s);return bs(a)?a:void 0},We=wc(Kr,"Map"),Vo=wc(Object,"create");var Ss=Object.prototype.hasOwnProperty;var Ts=Object.prototype.hasOwnProperty;function Un(o){var s=-1,a=null==o?0:o.length;for(this.clear();++s-1&&o%1==0&&o<=9007199254740991},tr=function bt(o){return null!=o&&Dr(o.length)&&!Ia(o)};var Gi="object"==typeof exports&&exports&&!exports.nodeType&&exports,ni=Gi&&"object"==typeof module&&module&&!module.nodeType&&module,Ko=ni&&ni.exports===Gi?Kr.Buffer:void 0;const Ls=(Ko?Ko.isBuffer:void 0)||function Dc(){return!1};var Ic=Function.prototype.toString,vh=Object.prototype.hasOwnProperty,yh=Ic.call(Object);var j={};j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j["[object Arguments]"]=j["[object Array]"]=j["[object ArrayBuffer]"]=j["[object Boolean]"]=j["[object DataView]"]=j["[object Date]"]=j["[object Error]"]=j["[object Function]"]=j["[object Map]"]=j["[object Number]"]=j["[object Object]"]=j["[object RegExp]"]=j["[object Set]"]=j["[object String]"]=j["[object WeakMap]"]=!1;var br="object"==typeof exports&&exports&&!exports.nodeType&&exports,rn=br&&"object"==typeof module&&module&&!module.nodeType&&module,Bn=rn&&rn.exports===br&&ba.process,Us=function(){try{return rn&&rn.require&&rn.require("util").types||Bn&&Bn.binding&&Bn.binding("util")}catch{}}(),Xo=Us&&Us.isTypedArray;const Qo=Xo?function et(o){return function(s){return o(s)}}(Xo):function ye(o){return ti(o)&&Dr(o.length)&&!!j[wr(o)]},Tc=function Kg(o,s){if(("constructor"!==s||"function"!=typeof o[s])&&"__proto__"!=s)return o[s]};var Xg=Object.prototype.hasOwnProperty;const eu=function Od(o,s,a){var u=o[s];(!Xg.call(o,s)||!Oo(u,a)||void 0===a&&!(s in o))&<(o,s,a)};var Ah=/^(?:0|[1-9]\d*)$/;const Rh=function ja(o,s){var a=typeof o;return!!(s=s??9007199254740991)&&("number"==a||"symbol"!=a&&Ah.test(o))&&o>-1&&o%1==0&&o0){if(++s>=800)return arguments[0]}else s=0;return o.apply(void 0,arguments)}}(ur);const $a=Fh,Vs=function sn(o,s){return $a(function qe(o,s,a){return s=De(void 0===s?o.length-1:s,0),function(){for(var u=arguments,m=-1,D=De(u.length-s,0),M=Array(D);++m1?a[m-1]:void 0,M=m>2?a[2]:void 0;for(D=o.length>3&&"function"==typeof D?(m--,D):void 0,M&&function Ga(o,s,a){if(!Nr(a))return!1;var u=typeof s;return!!("number"==u?tr(a)&&Rh(s,a.length):"string"==u&&s in a)&&Oo(a[s],o)}(a[0],a[1],M)&&(D=m<3?void 0:D,m=1),s=Object(s);++u{},info:()=>{},warn:()=>{},error:()=>{}},wt=(o=>(o[o.NONE=0]="NONE",o[o.ERROR=1]="ERROR",o[o.WARN=2]="WARN",o[o.INFO=3]="INFO",o[o.DEBUG=4]="DEBUG",o))(wt||{});(o=>{o.reset=function s(){Ur=3,dr=Wi},o.setLevel=function a(m){if(!(0<=m&&m<=4))throw new Error("Invalid log level");Ur=m},o.setLogger=function u(m){dr=m}})(wt||(wt={}));var rt=class{constructor(o){this._name=o}debug(...o){Ur>=4&&dr.debug(rt._format(this._name,this._method),...o)}info(...o){Ur>=3&&dr.info(rt._format(this._name,this._method),...o)}warn(...o){Ur>=2&&dr.warn(rt._format(this._name,this._method),...o)}error(...o){Ur>=1&&dr.error(rt._format(this._name,this._method),...o)}throw(o){throw this.error(o),o}create(o){const s=Object.create(this);return s._method=o,s.debug("begin"),s}static createStatic(o,s){const a=new rt(`${o}.${s}`);return a.debug("begin"),a}static _format(o,s){const a=`[${o}]`;return s?`${a} ${s}:`:a}static debug(o,...s){Ur>=4&&dr.debug(rt._format(o),...s)}static info(o,...s){Ur>=3&&dr.info(rt._format(o),...s)}static warn(o,...s){Ur>=2&&dr.warn(rt._format(o),...s)}static error(o,...s){Ur>=1&&dr.error(rt._format(o),...s)}};wt.reset();var Yt=class{static _randomWord(){return oi.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,s=>(+s^Yt._randomWord()&15>>+s/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Yt.generateUUIDv4()+Yt.generateUUIDv4()+Yt.generateUUIDv4()}static generateCodeChallenge(o){try{const s=He(o);return su.stringify(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(s){throw rt.error("CryptoUtils.generateCodeChallenge",s),s}}static generateBasicAuth(o,s){const a=Ac.parse([o,s].join(":"));return su.stringify(a)}},qi=class{constructor(o){this._name=o,this._logger=new rt(`Event('${this._name}')`),this._callbacks=[]}addHandler(o){return this._callbacks.push(o),()=>this.removeHandler(o)}removeHandler(o){const s=this._callbacks.lastIndexOf(o);s>=0&&this._callbacks.splice(s,1)}raise(...o){this._logger.debug("raise:",...o);for(const s of this._callbacks)s(...o)}},vo=class{static decode(o){try{return ro(o)}catch(s){throw rt.error("JwtUtils.decode",s),s}}},Rc=class{static center({...o}){var s;return null==o.width&&(o.width=null!=(s=[800,720,600,480].find(m=>m<=window.outerWidth/1.618))?s:360),null!=o.left||(o.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-o.width)/2))),null!=o.height&&(null!=o.top||(o.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-o.height)/2)))),o}static serialize(o){return Object.entries(o).filter(([,s])=>null!=s).map(([s,a])=>`${s}=${"boolean"!=typeof a?a:a?"yes":"no"}`).join(",")}},dn=class extends qi{constructor(){super(...arguments),this._logger=new rt(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const o=this._expiration-dn.getEpochTime();this._logger.debug("timer completes in",o),this._expiration<=dn.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(o){const s=this._logger.create("init");o=Math.max(Math.floor(o),1);const a=dn.getEpochTime()+o;if(this.expiration===a&&this._timerHandle)return void s.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),s.debug("using duration",o),this._expiration=a;const u=Math.min(o,5);this._timerHandle=setInterval(this._callback,1e3*u)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},js=class{static readParams(o,s="query"){if(!o)throw new TypeError("Invalid URL");const u=new URL(o,"http://127.0.0.1")["fragment"===s?"hash":"search"];return new URLSearchParams(u.slice(1))}},Bs=class extends Error{constructor(o,s){var a,u,m;if(super(o.error_description||o.error||""),this.form=s,this.name="ErrorResponse",!o.error)throw rt.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=o.error,this.error_description=null!=(a=o.error_description)?a:null,this.error_uri=null!=(u=o.error_uri)?u:null,this.state=o.userState,this.session_state=null!=(m=o.session_state)?m:null,this.url_state=o.url_state}},Nc=class extends Error{constructor(o){super(o),this.name="ErrorTimeout"}},Lh=class{constructor(o){this._logger=new rt("AccessTokenEvents"),this._expiringTimer=new dn("Access token expiring"),this._expiredTimer=new dn("Access token expired"),this._expiringNotificationTimeInSeconds=o.expiringNotificationTimeInSeconds}load(o){const s=this._logger.create("load");if(o.access_token&&void 0!==o.expires_in){const a=o.expires_in;if(s.debug("access token present, remaining duration:",a),a>0){let m=a-this._expiringNotificationTimeInSeconds;m<=0&&(m=1),s.debug("registering expiring timer, raising in",m,"seconds"),this._expiringTimer.init(m)}else s.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const u=a+1;s.debug("registering expired timer, raising in",u,"seconds"),this._expiredTimer.init(u)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(o){return this._expiringTimer.addHandler(o)}removeAccessTokenExpiring(o){this._expiringTimer.removeHandler(o)}addAccessTokenExpired(o){return this._expiredTimer.addHandler(o)}removeAccessTokenExpired(o){this._expiredTimer.removeHandler(o)}},cm=class{constructor(o,s,a,u,m){this._callback=o,this._client_id=s,this._intervalInSeconds=u,this._stopOnError=m,this._logger=new rt("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=M=>{M.origin===this._frame_origin&&M.source===this._frame.contentWindow&&("error"===M.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===M.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(M.data+" message from check session op iframe"))};const D=new URL(a);this._frame_origin=D.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=D.href}load(){return new Promise(o=>{this._frame.onload=()=>{o()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(o){if(this._session_state===o)return;this._logger.create("start"),this.stop(),this._session_state=o;const s=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};s(),this._timer=setInterval(s,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},Oc=class{constructor(){this._logger=new rt("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(o){return this._logger.create(`getItem('${o}')`),this._data[o]}setItem(o,s){this._logger.create(`setItem('${o}')`),this._data[o]=s}removeItem(o){this._logger.create(`removeItem('${o}')`),delete this._data[o]}get length(){return Object.getOwnPropertyNames(this._data).length}key(o){return Object.getOwnPropertyNames(this._data)[o]}},Uh=class{constructor(o=[],s=null,a={}){this._jwtHandler=s,this._extraHeaders=a,this._logger=new rt("JsonService"),this._contentTypes=[],this._contentTypes.push(...o,"application/json"),s&&this._contentTypes.push("application/jwt")}fetchWithTimeout(o,s={}){return x(function*(){const{timeoutInSeconds:a,...u}=s;if(!a)return yield fetch(o,u);const m=new AbortController,D=setTimeout(()=>m.abort(),1e3*a);try{return yield fetch(o,{...s,signal:m.signal})}catch(M){throw M instanceof DOMException&&"AbortError"===M.name?new Nc("Network timed out"):M}finally{clearTimeout(D)}})()}getJson(o,{token:s,credentials:a}={}){var u=this;return x(function*(){const m=u._logger.create("getJson"),D={Accept:u._contentTypes.join(", ")};let M;s&&(m.debug("token passed, setting Authorization header"),D.Authorization="Bearer "+s),u.appendExtraHeaders(D);try{m.debug("url:",o),M=yield u.fetchWithTimeout(o,{method:"GET",headers:D,credentials:a})}catch(K){throw m.error("Network Error"),K}m.debug("HTTP response received, status",M.status);const N=M.headers.get("Content-Type");if(N&&!u._contentTypes.find(K=>N.startsWith(K))&&m.throw(new Error(`Invalid response Content-Type: ${N??"undefined"}, from URL: ${o}`)),M.ok&&u._jwtHandler&&N?.startsWith("application/jwt"))return yield u._jwtHandler(yield M.text());let B;try{B=yield M.json()}catch(K){throw m.error("Error parsing JSON response",K),M.ok?K:new Error(`${M.statusText} (${M.status})`)}if(!M.ok)throw m.error("Error from server:",B),B.error?new Bs(B):new Error(`${M.statusText} (${M.status}): ${JSON.stringify(B)}`);return B})()}postForm(o,{body:s,basicAuth:a,timeoutInSeconds:u,initCredentials:m}){var D=this;return x(function*(){const M=D._logger.create("postForm"),N={Accept:D._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let B;void 0!==a&&(N.Authorization="Basic "+a),D.appendExtraHeaders(N);try{M.debug("url:",o),B=yield D.fetchWithTimeout(o,{method:"POST",headers:N,body:s,timeoutInSeconds:u,credentials:m})}catch(Fe){throw M.error("Network error"),Fe}M.debug("HTTP response received, status",B.status);const K=B.headers.get("Content-Type");if(K&&!D._contentTypes.find(Fe=>K.startsWith(Fe)))throw new Error(`Invalid response Content-Type: ${K??"undefined"}, from URL: ${o}`);const fe=yield B.text();let Se={};if(fe)try{Se=JSON.parse(fe)}catch(Fe){throw M.error("Error parsing JSON response",Fe),B.ok?Fe:new Error(`${B.statusText} (${B.status})`)}if(!B.ok)throw M.error("Error from server:",Se),Se.error?new Bs(Se,s):new Error(`${B.statusText} (${B.status}): ${JSON.stringify(Se)}`);return Se})()}appendExtraHeaders(o){const s=this._logger.create("appendExtraHeaders"),a=Object.keys(this._extraHeaders),u=["authorization","accept","content-type"];0!==a.length&&a.forEach(m=>{if(u.includes(m.toLocaleLowerCase()))return void s.warn("Protected header could not be overridden",m,u);const D="function"==typeof this._extraHeaders[m]?this._extraHeaders[m]():this._extraHeaders[m];D&&""!==D&&(o[m]=D)})}},T_=class{constructor(o){this._settings=o,this._logger=new rt("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new Uh(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}getMetadata(){var o=this;return x(function*(){const s=o._logger.create("getMetadata");if(o._metadata)return s.debug("using cached values"),o._metadata;if(!o._metadataUrl)throw s.throw(new Error("No authority or metadataUrl configured on settings")),null;s.debug("getting metadata from",o._metadataUrl);const a=yield o._jsonService.getJson(o._metadataUrl,{credentials:o._fetchRequestCredentials});return s.debug("merging remote JSON with seed metadata"),o._metadata=Object.assign({},o._settings.metadataSeed,a),o._metadata})()}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(o=!0){return this._getMetadataProperty("token_endpoint",o)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(o=!0){return this._getMetadataProperty("revocation_endpoint",o)}getKeysEndpoint(o=!0){return this._getMetadataProperty("jwks_uri",o)}_getMetadataProperty(o,s=!1){var a=this;return x(function*(){const u=a._logger.create(`_getMetadataProperty('${o}')`),m=yield a.getMetadata();if(u.debug("resolved"),void 0===m[o]){if(!0===s)return void u.warn("Metadata does not contain optional property");u.throw(new Error("Metadata does not contain property "+o))}return m[o]})()}getSigningKeys(){var o=this;return x(function*(){const s=o._logger.create("getSigningKeys");if(o._signingKeys)return s.debug("returning signingKeys from cache"),o._signingKeys;const a=yield o.getKeysEndpoint(!1);s.debug("got jwks_uri",a);const u=yield o._jsonService.getJson(a);if(s.debug("got key set",u),!Array.isArray(u.keys))throw s.throw(new Error("Missing keys on keyset")),null;return o._signingKeys=u.keys,o._signingKeys})()}},Vh=class{constructor({prefix:o="oidc.",store:s=localStorage}={}){this._logger=new rt("WebStorageStateStore"),this._store=s,this._prefix=o}set(o,s){var a=this;return x(function*(){a._logger.create(`set('${o}')`),o=a._prefix+o,yield a._store.setItem(o,s)})()}get(o){var s=this;return x(function*(){return s._logger.create(`get('${o}')`),o=s._prefix+o,yield s._store.getItem(o)})()}remove(o){var s=this;return x(function*(){s._logger.create(`remove('${o}')`),o=s._prefix+o;const a=yield s._store.getItem(o);return yield s._store.removeItem(o),a})()}getAllKeys(){var o=this;return x(function*(){o._logger.create("getAllKeys");const s=yield o._store.length,a=[];for(let u=0;uN.append(Se,ct)):null!=Fe&&N.set(Se,Fe);let B;switch(D._settings.client_authentication){case"client_secret_basic":if(!a)throw M.throw(new Error("A client_secret is required")),null;B=Yt.generateBasicAuth(s,a);break;case"client_secret_post":N.append("client_id",s),a&&N.append("client_secret",a)}const K=yield D._metadataService.getTokenEndpoint(!1);M.debug("got token endpoint");const fe=yield D._jsonService.postForm(K,{body:N,basicAuth:B,timeoutInSeconds:u,initCredentials:D._settings.fetchRequestCredentials});return M.debug("got response"),fe})()}revoke(o){var s=this;return x(function*(){var a;const u=s._logger.create("revoke");o.token||u.throw(new Error("A token is required"));const m=yield s._metadataService.getRevocationEndpoint(!1);u.debug(`got revocation endpoint, revoking ${null!=(a=o.token_type_hint)?a:"default token type"}`);const D=new URLSearchParams;for(const[M,N]of Object.entries(o))null!=N&&D.set(M,N);D.set("client_id",s._settings.client_id),s._settings.client_secret&&D.set("client_secret",s._settings.client_secret),yield s._jsonService.postForm(m,{body:D}),u.debug("got response")})()}},Bh=class{constructor(o,s,a){this._settings=o,this._metadataService=s,this._claimsService=a,this._logger=new rt("ResponseValidator"),this._userInfoService=new P_(this._settings,this._metadataService),this._tokenClient=new lm(this._settings,this._metadataService)}validateSigninResponse(o,s){var a=this;return x(function*(){const u=a._logger.create("validateSigninResponse");a._processSigninState(o,s),u.debug("state processed"),yield a._processCode(o,s),u.debug("code processed"),o.isOpenId&&a._validateIdTokenAttributes(o),u.debug("tokens validated"),yield a._processClaims(o,s?.skipUserInfo,o.isOpenId),u.debug("claims processed")})()}validateCredentialsResponse(o,s){var a=this;return x(function*(){const u=a._logger.create("validateCredentialsResponse");o.isOpenId&&o.id_token&&a._validateIdTokenAttributes(o),u.debug("tokens validated"),yield a._processClaims(o,s,o.isOpenId),u.debug("claims processed")})()}validateRefreshResponse(o,s){var a=this;return x(function*(){const D=a._logger.create("validateRefreshResponse");o.userState=s.data,null!=o.session_state||(o.session_state=s.session_state),null!=o.scope||(o.scope=s.scope),o.isOpenId&&o.id_token&&(a._validateIdTokenAttributes(o,s.id_token),D.debug("ID Token validated")),o.id_token||(o.id_token=s.id_token,o.profile=s.profile);const M=o.isOpenId&&!!o.id_token;yield a._processClaims(o,!1,M),D.debug("claims processed")})()}validateSignoutResponse(o,s){const a=this._logger.create("validateSignoutResponse");if(s.id!==o.state&&a.throw(new Error("State does not match")),a.debug("state validated"),o.userState=s.data,o.error)throw a.warn("Response was error",o.error),new Bs(o)}_processSigninState(o,s){const u=this._logger.create("_processSigninState");if(s.id!==o.state&&u.throw(new Error("State does not match")),s.client_id||u.throw(new Error("No client_id on state")),s.authority||u.throw(new Error("No authority on state")),this._settings.authority!==s.authority&&u.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==s.client_id&&u.throw(new Error("client_id mismatch on settings vs. signin state")),u.debug("state validated"),o.userState=s.data,o.url_state=s.url_state,null!=o.scope||(o.scope=s.scope),o.error)throw u.warn("Response was error",o.error),new Bs(o);s.code_verifier&&!o.code&&u.throw(new Error("Expected code in response"))}_processClaims(o,s=!1,a=!0){var u=this;return x(function*(){const m=u._logger.create("_processClaims");if(o.profile=u._claimsService.filterProtocolClaims(o.profile),s||!u._settings.loadUserInfo||!o.access_token)return void m.debug("not loading user info");m.debug("loading user info");const D=yield u._userInfoService.getClaims(o.access_token);m.debug("user info claims received from user info endpoint"),a&&D.sub!==o.profile.sub&&m.throw(new Error("subject from UserInfo response does not match subject in ID Token")),o.profile=u._claimsService.mergeClaims(o.profile,u._claimsService.filterProtocolClaims(D)),m.debug("user info claims received, updated profile:",o.profile)})()}_processCode(o,s){var a=this;return x(function*(){const u=a._logger.create("_processCode");if(o.code){u.debug("Validating code");const m=yield a._tokenClient.exchangeCode({client_id:s.client_id,client_secret:s.client_secret,code:o.code,redirect_uri:s.redirect_uri,code_verifier:s.code_verifier,...s.extraTokenParams});Object.assign(o,m)}else u.debug("No code to process")})()}_validateIdTokenAttributes(o,s){var a;const u=this._logger.create("_validateIdTokenAttributes");u.debug("decoding ID Token JWT");const m=vo.decode(null!=(a=o.id_token)?a:"");if(m.sub||u.throw(new Error("ID Token is missing a subject claim")),s){const D=vo.decode(s);m.sub!==D.sub&&u.throw(new Error("sub in id_token does not match current sub")),m.auth_time&&m.auth_time!==D.auth_time&&u.throw(new Error("auth_time in id_token does not match original auth_time")),m.azp&&m.azp!==D.azp&&u.throw(new Error("azp in id_token does not match original azp")),!m.azp&&D.azp&&u.throw(new Error("azp not in id_token, but present in original id_token"))}o.profile=m}},Hs=class{constructor(o){this.id=o.id||Yt.generateUUIDv4(),this.data=o.data,this.created=o.created&&o.created>0?o.created:dn.getEpochTime(),this.request_type=o.request_type,this.url_state=o.url_state}toStorageString(){return new rt("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(o){return rt.createStatic("State","fromStorageString"),new Hs(JSON.parse(o))}static clearStaleState(o,s){return x(function*(){const a=rt.createStatic("State","clearStaleState"),u=dn.getEpochTime()-s,m=yield o.getAllKeys();a.debug("got keys",m);for(let D=0;DFt.searchParams.append("resource",pn));for(const[gn,pn]of Object.entries({response_mode:N,...en,...vt}))null!=pn&&Ft.searchParams.append(gn,pn.toString());this.url=Ft.href}},$h=class{constructor(o){if(this.access_token="",this.token_type="",this.profile={},this.state=o.get("state"),this.session_state=o.get("session_state"),this.state){const s=decodeURIComponent(this.state).split(";");this.state=s[0],s.length>1&&(this.url_state=s.slice(1).join(";"))}this.error=o.get("error"),this.error_description=o.get("error_description"),this.error_uri=o.get("error_uri"),this.code=o.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-dn.getEpochTime()}set expires_in(o){"string"==typeof o&&(o=Number(o)),void 0!==o&&o>=0&&(this.expires_at=Math.floor(o)+dn.getEpochTime())}get isOpenId(){var o;return(null==(o=this.scope)?void 0:o.split(" ").includes("openid"))||!!this.id_token}},um=class{constructor({url:o,state_data:s,id_token_hint:a,post_logout_redirect_uri:u,extraQueryParams:m,request_type:D,client_id:M}){if(this._logger=new rt("SignoutRequest"),!o)throw this._logger.error("ctor: No url passed"),new Error("url");const N=new URL(o);a&&N.searchParams.append("id_token_hint",a),M&&N.searchParams.append("client_id",M),u&&(N.searchParams.append("post_logout_redirect_uri",u),s&&(this.state=new Hs({data:s,request_type:D}),N.searchParams.append("state",this.state.id)));for(const[B,K]of Object.entries({...m}))null!=K&&N.searchParams.append(B,K.toString());this.url=N.href}},Gh=class{constructor(o){this.state=o.get("state"),this.error=o.get("error"),this.error_description=o.get("error_description"),this.error_uri=o.get("error_uri")}},kd=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],zh=["sub","iss","aud","exp","iat"],dm=class{constructor(o){this._settings=o,this._logger=new rt("ClaimsService")}filterProtocolClaims(o){const s={...o};if(this._settings.filterProtocolClaims){let a;a=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:kd;for(const u of a)zh.includes(u)||delete s[u]}return s}mergeClaims(o,s){const a={...o};for(const[u,m]of Object.entries(s))for(const D of Array.isArray(m)?m:[m]){const M=a[u];void 0===M?a[u]=D:Array.isArray(M)?M.includes(D)||M.push(D):a[u]!==D&&(a[u]="object"==typeof D&&this._settings.mergeClaims?this.mergeClaims(M,D):[M,D])}return a}},fm=class{constructor(o,s){this._logger=new rt("OidcClient"),this.settings=o instanceof jh?o:new jh(o),this.metadataService=s??new T_(this.settings),this._claimsService=new dm(this.settings),this._validator=new Bh(this.settings,this.metadataService,this._claimsService),this._tokenClient=new lm(this.settings,this.metadataService)}createSigninRequest({state:o,request:s,request_uri:a,request_type:u,id_token_hint:m,login_hint:D,skipUserInfo:M,nonce:N,url_state:B,response_type:K=this.settings.response_type,scope:fe=this.settings.scope,redirect_uri:Se=this.settings.redirect_uri,prompt:Fe=this.settings.prompt,display:ct=this.settings.display,max_age:vt=this.settings.max_age,ui_locales:ft=this.settings.ui_locales,acr_values:yt=this.settings.acr_values,resource:en=this.settings.resource,response_mode:Ft=this.settings.response_mode,extraQueryParams:St=this.settings.extraQueryParams,extraTokenParams:gn=this.settings.extraTokenParams}){var pn=this;return x(function*(){const Fn=pn._logger.create("createSigninRequest");if("code"!==K)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const Nt=yield pn.metadataService.getAuthorizationEndpoint();Fn.debug("Received authorization endpoint",Nt);const jt=new k_({url:Nt,authority:pn.settings.authority,client_id:pn.settings.client_id,redirect_uri:Se,response_type:K,scope:fe,state_data:o,url_state:B,prompt:Fe,display:ct,max_age:vt,ui_locales:ft,id_token_hint:m,login_hint:D,acr_values:yt,resource:en,request:s,request_uri:a,extraQueryParams:St,extraTokenParams:gn,request_type:u,response_mode:Ft,client_secret:pn.settings.client_secret,skipUserInfo:M,nonce:N,disablePKCE:pn.settings.disablePKCE});yield pn.clearStaleState();const ci=jt.state;return yield pn.settings.stateStore.set(ci.id,ci.toStorageString()),jt})()}readSigninResponseState(o,s=!1){var a=this;return x(function*(){const u=a._logger.create("readSigninResponseState"),m=new $h(js.readParams(o,a.settings.response_mode));if(!m.state)throw u.throw(new Error("No state in response")),null;const D=yield a.settings.stateStore[s?"remove":"get"](m.state);if(!D)throw u.throw(new Error("No matching state found in storage")),null;return{state:Hh.fromStorageString(D),response:m}})()}processSigninResponse(o){var s=this;return x(function*(){const a=s._logger.create("processSigninResponse"),{state:u,response:m}=yield s.readSigninResponseState(o,!0);return a.debug("received state from storage; validating response"),yield s._validator.validateSigninResponse(m,u),m})()}processResourceOwnerPasswordCredentials({username:o,password:s,skipUserInfo:a=!1,extraTokenParams:u={}}){var m=this;return x(function*(){const D=yield m._tokenClient.exchangeCredentials({username:o,password:s,...u}),M=new $h(new URLSearchParams);return Object.assign(M,D),yield m._validator.validateCredentialsResponse(M,a),M})()}useRefreshToken({state:o,timeoutInSeconds:s}){var a=this;return x(function*(){var u;const m=a._logger.create("useRefreshToken");let D;if(void 0===a.settings.refreshTokenAllowedScope)D=o.scope;else{const B=a.settings.refreshTokenAllowedScope.split(" ");D=((null==(u=o.scope)?void 0:u.split(" "))||[]).filter(fe=>B.includes(fe)).join(" ")}const M=yield a._tokenClient.exchangeRefreshToken({refresh_token:o.refresh_token,resource:o.resource,scope:D,timeoutInSeconds:s}),N=new $h(new URLSearchParams);return Object.assign(N,M),m.debug("validating response",N),yield a._validator.validateRefreshResponse(N,{...o,scope:D}),N})()}createSignoutRequest({state:o,id_token_hint:s,client_id:a,request_type:u,post_logout_redirect_uri:m=this.settings.post_logout_redirect_uri,extraQueryParams:D=this.settings.extraQueryParams}={}){var M=this;return x(function*(){const N=M._logger.create("createSignoutRequest"),B=yield M.metadataService.getEndSessionEndpoint();if(!B)throw N.throw(new Error("No end session endpoint")),null;N.debug("Received end session endpoint",B),!a&&m&&!s&&(a=M.settings.client_id);const K=new um({url:B,id_token_hint:s,client_id:a,post_logout_redirect_uri:m,state_data:o,extraQueryParams:D,request_type:u});yield M.clearStaleState();const fe=K.state;return fe&&(N.debug("Signout request has state to persist"),yield M.settings.stateStore.set(fe.id,fe.toStorageString())),K})()}readSignoutResponseState(o,s=!1){var a=this;return x(function*(){const u=a._logger.create("readSignoutResponseState"),m=new Gh(js.readParams(o,a.settings.response_mode));if(!m.state){if(u.debug("No state in response"),m.error)throw u.warn("Response was error:",m.error),new Bs(m);return{state:void 0,response:m}}const D=yield a.settings.stateStore[s?"remove":"get"](m.state);if(!D)throw u.throw(new Error("No matching state found in storage")),null;return{state:Hs.fromStorageString(D),response:m}})()}processSignoutResponse(o){var s=this;return x(function*(){const a=s._logger.create("processSignoutResponse"),{state:u,response:m}=yield s.readSignoutResponseState(o,!0);return u?(a.debug("Received state from storage; validating response"),s._validator.validateSignoutResponse(m,u)):a.debug("No state from storage; skipping response validation"),m})()}clearStaleState(){return this._logger.create("clearStaleState"),Hs.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}revokeToken(o,s){var a=this;return x(function*(){return a._logger.create("revokeToken"),yield a._tokenClient.revoke({token:o,token_type_hint:s})})()}},Wh=class{constructor(o){var s=this;this._userManager=o,this._logger=new rt("SessionMonitor"),this._start=function(){var a=x(function*(u){const m=u.session_state;if(!m)return;const D=s._logger.create("_start");if(u.profile?(s._sub=u.profile.sub,s._sid=u.profile.sid,D.debug("session_state",m,", sub",s._sub)):(s._sub=void 0,s._sid=void 0,D.debug("session_state",m,", anonymous user")),s._checkSessionIFrame)s._checkSessionIFrame.start(m);else try{const M=yield s._userManager.metadataService.getCheckSessionIframe();if(M){D.debug("initializing check session iframe");const fe=new cm(s._callback,s._userManager.settings.client_id,M,s._userManager.settings.checkSessionIntervalInSeconds,s._userManager.settings.stopCheckSessionOnError);yield fe.load(),s._checkSessionIFrame=fe,fe.start(m)}else D.warn("no check session iframe found in the metadata")}catch(M){D.error("Error from getCheckSessionIframe:",M instanceof Error?M.message:M)}});return function(u){return a.apply(this,arguments)}}(),this._stop=()=>{const a=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const u=setInterval(x(function*(){clearInterval(u);try{const m=yield s._userManager.querySessionStatus();m&&s._start({session_state:m.session_state,profile:m.sub&&m.sid?{sub:m.sub,sid:m.sid}:null})}catch(m){a.error("error from querySessionStatus",m instanceof Error?m.message:m)}}),1e3)}},this._callback=x(function*(){const a=s._logger.create("_callback");try{const u=yield s._userManager.querySessionStatus();let m=!0;u&&s._checkSessionIFrame?u.sub===s._sub?(m=!1,s._checkSessionIFrame.start(u.session_state),u.sid===s._sid?a.debug("same sub still logged in at OP, restarting check session iframe; session_state",u.session_state):(a.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",u.session_state),s._userManager.events._raiseUserSessionChanged())):a.debug("different subject signed into OP",u.sub):a.debug("subject no longer signed into OP"),m?s._sub?s._userManager.events._raiseUserSignedOut():s._userManager.events._raiseUserSignedIn():a.debug("no change in session detected, no event to raise")}catch(u){s._sub&&(a.debug("Error calling queryCurrentSigninSession; raising signed out event",u),s._userManager.events._raiseUserSignedOut())}}),o||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(a=>{this._logger.error(a)})}_init(){var o=this;return x(function*(){o._logger.create("_init");const s=yield o._userManager.getUser();if(s)o._start(s);else if(o._userManager.settings.monitorAnonymousSession){const a=yield o._userManager.querySessionStatus();a&&o._start({session_state:a.session_state,profile:a.sub&&a.sid?{sub:a.sub,sid:a.sid}:null})}})()}},xc=class{constructor(o){var s;this.id_token=o.id_token,this.session_state=null!=(s=o.session_state)?s:null,this.access_token=o.access_token,this.refresh_token=o.refresh_token,this.token_type=o.token_type,this.scope=o.scope,this.profile=o.profile,this.expires_at=o.expires_at,this.state=o.userState,this.url_state=o.url_state}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-dn.getEpochTime()}set expires_in(o){void 0!==o&&(this.expires_at=Math.floor(o)+dn.getEpochTime())}get expired(){const o=this.expires_in;if(void 0!==o)return o<=0}get scopes(){var o,s;return null!=(s=null==(o=this.scope)?void 0:o.split(" "))?s:[]}toStorageString(){return new rt("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(o){return rt.createStatic("User","fromStorageString"),new xc(JSON.parse(o))}},qh="oidc-client",cu=class{constructor(){this._abort=new qi("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}navigate(o){var s=this;return x(function*(){const a=s._logger.create("navigate");if(!s._window)throw new Error("Attempted to navigate on a disposed window");a.debug("setting URL in window"),s._window.location.replace(o.url);const{url:u,keepOpen:m}=yield new Promise((D,M)=>{const N=B=>{var K;const fe=B.data,Se=null!=(K=o.scriptOrigin)?K:window.location.origin;if(B.origin===Se&&fe?.source===qh){try{const Fe=js.readParams(fe.url,o.response_mode).get("state");if(Fe||a.warn("no state found in response url"),B.source!==s._window&&Fe!==o.state)return}catch{s._dispose(),M(new Error("Invalid response from window"))}D(fe)}};window.addEventListener("message",N,!1),s._disposeHandlers.add(()=>window.removeEventListener("message",N,!1)),s._disposeHandlers.add(s._abort.addHandler(B=>{s._dispose(),M(B)}))});return a.debug("got response from window"),s._dispose(),m||s.close(),{url:u}})()}_dispose(){this._logger.create("_dispose");for(const o of this._disposeHandlers)o();this._disposeHandlers.clear()}static _notifyParent(o,s,a=!1,u=window.location.origin){o.postMessage({source:qh,url:s,keepOpen:a},u)}},Kh={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Di="_blank",Xh=60,Qh=2,Rt=10,Fd=class extends jh{constructor(o){const{popup_redirect_uri:s=o.redirect_uri,popup_post_logout_redirect_uri:a=o.post_logout_redirect_uri,popupWindowFeatures:u=Kh,popupWindowTarget:m=Di,redirectMethod:D="assign",redirectTarget:M="self",iframeNotifyParentOrigin:N=o.iframeNotifyParentOrigin,iframeScriptOrigin:B=o.iframeScriptOrigin,silent_redirect_uri:K=o.redirect_uri,silentRequestTimeoutInSeconds:fe=Rt,automaticSilentRenew:Se=!0,validateSubOnSilentRenew:Fe=!0,includeIdTokenInSilentRenew:ct=!1,monitorSession:vt=!1,monitorAnonymousSession:ft=!1,checkSessionIntervalInSeconds:yt=Qh,query_status_response_type:en="code",stopCheckSessionOnError:Ft=!0,revokeTokenTypes:St=["access_token","refresh_token"],revokeTokensOnSignout:gn=!1,includeIdTokenInSilentSignout:pn=!1,accessTokenExpiringNotificationTimeInSeconds:Fn=Xh,userStore:Nt}=o;if(super(o),this.popup_redirect_uri=s,this.popup_post_logout_redirect_uri=a,this.popupWindowFeatures=u,this.popupWindowTarget=m,this.redirectMethod=D,this.redirectTarget=M,this.iframeNotifyParentOrigin=N,this.iframeScriptOrigin=B,this.silent_redirect_uri=K,this.silentRequestTimeoutInSeconds=fe,this.automaticSilentRenew=Se,this.validateSubOnSilentRenew=Fe,this.includeIdTokenInSilentRenew=ct,this.monitorSession=vt,this.monitorAnonymousSession=ft,this.checkSessionIntervalInSeconds=yt,this.stopCheckSessionOnError=Ft,this.query_status_response_type=en,this.revokeTokenTypes=St,this.revokeTokensOnSignout=gn,this.includeIdTokenInSilentSignout=pn,this.accessTokenExpiringNotificationTimeInSeconds=Fn,Nt)this.userStore=Nt;else{const jt=typeof window<"u"?window.sessionStorage:new Oc;this.userStore=new Vh({store:jt})}}},$s=class extends cu{constructor({silentRequestTimeoutInSeconds:o=Rt}){super(),this._logger=new rt("IFrameWindow"),this._timeoutInSeconds=o,this._frame=$s.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const o=window.document.createElement("iframe");return o.style.visibility="hidden",o.style.position="fixed",o.style.left="-1000px",o.style.top="0",o.width="0",o.height="0",window.document.body.appendChild(o),o}navigate(o){var s=()=>super.navigate,a=this;return x(function*(){a._logger.debug("navigate: Using timeout of:",a._timeoutInSeconds);const u=setTimeout(()=>a._abort.raise(new Nc("IFrame timed out without a response")),1e3*a._timeoutInSeconds);return a._disposeHandlers.add(()=>clearTimeout(u)),yield s().call(a,o)})()}close(){var o;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",s=>{var a;const u=s.target;null==(a=u.parentNode)||a.removeChild(u),this._abort.raise(new Error("IFrame removed from DOM"))},!0),null==(o=this._frame.contentWindow)||o.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(o,s){return super._notifyParent(window.parent,o,!1,s)}},fr=class{constructor(o){this._settings=o,this._logger=new rt("IFrameNavigator")}prepare({silentRequestTimeoutInSeconds:o=this._settings.silentRequestTimeoutInSeconds}){return x(function*(){return new $s({silentRequestTimeoutInSeconds:o})})()}callback(o){var s=this;return x(function*(){s._logger.create("callback"),$s.notifyParent(o,s._settings.iframeNotifyParentOrigin)})()}},Jo=class extends cu{constructor({popupWindowTarget:o=Di,popupWindowFeatures:s={}}){super(),this._logger=new rt("PopupWindow");const a=Rc.center({...Kh,...s});this._window=window.open(void 0,o,Rc.serialize(a)),s.closePopupWindowAfterInSeconds&&s.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{this._window&&"boolean"==typeof this._window.closed&&!this._window.closed?this.close():this._abort.raise(new Error("Popup blocked by user"))},1e3*s.closePopupWindowAfterInSeconds)}navigate(o){var s=()=>super.navigate,a=this;return x(function*(){var u;null==(u=a._window)||u.focus();const m=setInterval(()=>{(!a._window||a._window.closed)&&a._abort.raise(new Error("Popup closed by user"))},500);return a._disposeHandlers.add(()=>clearInterval(m)),yield s().call(a,o)})()}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(o,s){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,o,s)}},Vr=class{constructor(o){this._settings=o,this._logger=new rt("PopupNavigator")}prepare({popupWindowFeatures:o=this._settings.popupWindowFeatures,popupWindowTarget:s=this._settings.popupWindowTarget}){return x(function*(){return new Jo({popupWindowFeatures:o,popupWindowTarget:s})})()}callback(o,{keepOpen:s=!1}){var a=this;return x(function*(){a._logger.create("callback"),Jo.notifyOpener(o,s)})()}},pm=class{constructor(o){this._settings=o,this._logger=new rt("RedirectNavigator")}prepare({redirectMethod:o=this._settings.redirectMethod,redirectTarget:s=this._settings.redirectTarget}){var a=this;return x(function*(){var u;a._logger.create("prepare");let m=window.self;"top"===s&&(m=null!=(u=window.top)?u:window.self);const D=m.location[o].bind(m.location);let M;return{navigate:(N=x(function*(B){a._logger.create("navigate");const K=new Promise((fe,Se)=>{M=Se});return D(B.url),yield K}),function(K){return N.apply(this,arguments)}),close:()=>{a._logger.create("close"),M?.(new Error("Redirect aborted")),m.stop()}};var N})()}callback(){return x(function*(){})()}},Ld=class extends Lh{constructor(o){super({expiringNotificationTimeInSeconds:o.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new rt("UserManagerEvents"),this._userLoaded=new qi("User loaded"),this._userUnloaded=new qi("User unloaded"),this._silentRenewError=new qi("Silent renew error"),this._userSignedIn=new qi("User signed in"),this._userSignedOut=new qi("User signed out"),this._userSessionChanged=new qi("User session changed")}load(o,s=!0){super.load(o),s&&this._userLoaded.raise(o)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(o){return this._userLoaded.addHandler(o)}removeUserLoaded(o){return this._userLoaded.removeHandler(o)}addUserUnloaded(o){return this._userUnloaded.addHandler(o)}removeUserUnloaded(o){return this._userUnloaded.removeHandler(o)}addSilentRenewError(o){return this._silentRenewError.addHandler(o)}removeSilentRenewError(o){return this._silentRenewError.removeHandler(o)}_raiseSilentRenewError(o){this._silentRenewError.raise(o)}addUserSignedIn(o){return this._userSignedIn.addHandler(o)}removeUserSignedIn(o){this._userSignedIn.removeHandler(o)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(o){return this._userSignedOut.addHandler(o)}removeUserSignedOut(o){this._userSignedOut.removeHandler(o)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(o){return this._userSessionChanged.addHandler(o)}removeUserSessionChanged(o){this._userSessionChanged.removeHandler(o)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},gm=class{constructor(o){var s=this;this._userManager=o,this._logger=new rt("SilentRenewService"),this._isStarted=!1,this._retryTimer=new dn("Retry Silent Renew"),this._tokenExpiring=x(function*(){const a=s._logger.create("_tokenExpiring");try{yield s._userManager.signinSilent(),a.debug("silent token renewal successful")}catch(u){if(u instanceof Nc)return a.warn("ErrorTimeout from signinSilent:",u,"retry in 5s"),void s._retryTimer.init(5);a.error("Error from signinSilent:",u),s._userManager.events._raiseSilentRenewError(u)}})}start(){var o=this;return x(function*(){const s=o._logger.create("start");if(!o._isStarted){o._isStarted=!0,o._userManager.events.addAccessTokenExpiring(o._tokenExpiring),o._retryTimer.addHandler(o._tokenExpiring);try{yield o._userManager.getUser()}catch(a){s.error("getUser error",a)}}})()}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},si=class{constructor(o,s){this.refresh_token=o.refresh_token,this.id_token=o.id_token,this.session_state=o.session_state,this.scope=o.scope,this.profile=o.profile,this.resource=s,this.data=o.state}},Zh=class{constructor(o,s,a,u){this._logger=new rt("UserManager"),this.settings=new Fd(o),this._client=new fm(o),this._redirectNavigator=s??new pm(this.settings),this._popupNavigator=a??new Vr(this.settings),this._iframeNavigator=u??new fr(this.settings),this._events=new Ld(this.settings),this._silentRenewService=new gm(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new Wh(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}getUser(){var o=this;return x(function*(){const s=o._logger.create("getUser"),a=yield o._loadUser();return a?(s.info("user loaded"),o._events.load(a,!1),a):(s.info("user not found in storage"),null)})()}removeUser(){var o=this;return x(function*(){const s=o._logger.create("removeUser");yield o.storeUser(null),s.info("user removed from storage"),o._events.unload()})()}signinRedirect(o={}){var s=this;return x(function*(){s._logger.create("signinRedirect");const{redirectMethod:a,...u}=o,m=yield s._redirectNavigator.prepare({redirectMethod:a});yield s._signinStart({request_type:"si:r",...u},m)})()}signinRedirectCallback(o=window.location.href){var s=this;return x(function*(){const a=s._logger.create("signinRedirectCallback"),u=yield s._signinEnd(o);return u.profile&&u.profile.sub?a.info("success, signed in subject",u.profile.sub):a.info("no subject"),u})()}signinResourceOwnerCredentials({username:o,password:s,skipUserInfo:a=!1}){var u=this;return x(function*(){const m=u._logger.create("signinResourceOwnerCredential"),D=yield u._client.processResourceOwnerPasswordCredentials({username:o,password:s,skipUserInfo:a,extraTokenParams:u.settings.extraTokenParams});m.debug("got signin response");const M=yield u._buildUser(D);return M.profile&&M.profile.sub?m.info("success, signed in subject",M.profile.sub):m.info("no subject"),M})()}signinPopup(o={}){var s=this;return x(function*(){const a=s._logger.create("signinPopup"),{popupWindowFeatures:u,popupWindowTarget:m,...D}=o,M=s.settings.popup_redirect_uri;M||a.throw(new Error("No popup_redirect_uri configured"));const N=yield s._popupNavigator.prepare({popupWindowFeatures:u,popupWindowTarget:m}),B=yield s._signin({request_type:"si:p",redirect_uri:M,display:"popup",...D},N);return B&&(B.profile&&B.profile.sub?a.info("success, signed in subject",B.profile.sub):a.info("no subject")),B})()}signinPopupCallback(o=window.location.href,s=!1){var a=this;return x(function*(){const u=a._logger.create("signinPopupCallback");yield a._popupNavigator.callback(o,{keepOpen:s}),u.info("success")})()}signinSilent(o={}){var s=this;return x(function*(){var a;const u=s._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:m,resource:D,...M}=o;let N=yield s._loadUser();if(N?.refresh_token){u.debug("using refresh token");const Se=new si(N,D);return yield s._useRefreshToken(Se)}const B=s.settings.silent_redirect_uri;let K;B||u.throw(new Error("No silent_redirect_uri configured")),N&&s.settings.validateSubOnSilentRenew&&(u.debug("subject prior to silent renew:",N.profile.sub),K=N.profile.sub);const fe=yield s._iframeNavigator.prepare({silentRequestTimeoutInSeconds:m});return N=yield s._signin({request_type:"si:s",redirect_uri:B,prompt:"none",id_token_hint:s.settings.includeIdTokenInSilentRenew?N?.id_token:void 0,...M},fe,K),N&&(null!=(a=N.profile)&&a.sub?u.info("success, signed in subject",N.profile.sub):u.info("no subject")),N})()}_useRefreshToken(o){var s=this;return x(function*(){const a=yield s._client.useRefreshToken({state:o,timeoutInSeconds:s.settings.silentRequestTimeoutInSeconds}),u=new xc({...o,...a});return yield s.storeUser(u),s._events.load(u),u})()}signinSilentCallback(o=window.location.href){var s=this;return x(function*(){const a=s._logger.create("signinSilentCallback");yield s._iframeNavigator.callback(o),a.info("success")})()}signinCallback(o=window.location.href){var s=this;return x(function*(){const{state:a}=yield s._client.readSigninResponseState(o);switch(a.request_type){case"si:r":return yield s.signinRedirectCallback(o);case"si:p":return yield s.signinPopupCallback(o);case"si:s":return yield s.signinSilentCallback(o);default:throw new Error("invalid response_type in state")}})()}signoutCallback(o=window.location.href,s=!1){var a=this;return x(function*(){const{state:u}=yield a._client.readSignoutResponseState(o);if(u)switch(u.request_type){case"so:r":yield a.signoutRedirectCallback(o);break;case"so:p":yield a.signoutPopupCallback(o,s);break;case"so:s":yield a.signoutSilentCallback(o);break;default:throw new Error("invalid response_type in state")}})()}querySessionStatus(o={}){var s=this;return x(function*(){const a=s._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:u,...m}=o,D=s.settings.silent_redirect_uri;D||a.throw(new Error("No silent_redirect_uri configured"));const M=yield s._loadUser(),N=yield s._iframeNavigator.prepare({silentRequestTimeoutInSeconds:u}),B=yield s._signinStart({request_type:"si:s",redirect_uri:D,prompt:"none",id_token_hint:s.settings.includeIdTokenInSilentRenew?M?.id_token:void 0,response_type:s.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...m},N);try{const K=yield s._client.processSigninResponse(B.url);return a.debug("got signin response"),K.session_state&&K.profile.sub?(a.info("success for subject",K.profile.sub),{session_state:K.session_state,sub:K.profile.sub,sid:K.profile.sid}):(a.info("success, user not authenticated"),null)}catch(K){if(s.settings.monitorAnonymousSession&&K instanceof Bs)switch(K.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return a.info("success for anonymous user"),{session_state:K.session_state}}throw K}})()}_signin(o,s,a){var u=this;return x(function*(){const m=yield u._signinStart(o,s);return yield u._signinEnd(m.url,a)})()}_signinStart(o,s){var a=this;return x(function*(){const u=a._logger.create("_signinStart");try{const m=yield a._client.createSigninRequest(o);return u.debug("got signin request"),yield s.navigate({url:m.url,state:m.state.id,response_mode:m.state.response_mode,scriptOrigin:a.settings.iframeScriptOrigin})}catch(m){throw u.debug("error after preparing navigator, closing navigator window"),s.close(),m}})()}_signinEnd(o,s){var a=this;return x(function*(){const u=a._logger.create("_signinEnd"),m=yield a._client.processSigninResponse(o);return u.debug("got signin response"),yield a._buildUser(m,s)})()}_buildUser(o,s){var a=this;return x(function*(){const u=a._logger.create("_buildUser"),m=new xc(o);if(s){if(s!==m.profile.sub)throw u.debug("current user does not match user returned from signin. sub from signin:",m.profile.sub),new Bs({...o,error:"login_required"});u.debug("current user matches user returned from signin")}return yield a.storeUser(m),u.debug("user stored"),a._events.load(m),m})()}signoutRedirect(o={}){var s=this;return x(function*(){const a=s._logger.create("signoutRedirect"),{redirectMethod:u,...m}=o,D=yield s._redirectNavigator.prepare({redirectMethod:u});yield s._signoutStart({request_type:"so:r",post_logout_redirect_uri:s.settings.post_logout_redirect_uri,...m},D),a.info("success")})()}signoutRedirectCallback(o=window.location.href){var s=this;return x(function*(){const a=s._logger.create("signoutRedirectCallback"),u=yield s._signoutEnd(o);return a.info("success"),u})()}signoutPopup(o={}){var s=this;return x(function*(){const a=s._logger.create("signoutPopup"),{popupWindowFeatures:u,popupWindowTarget:m,...D}=o,M=s.settings.popup_post_logout_redirect_uri,N=yield s._popupNavigator.prepare({popupWindowFeatures:u,popupWindowTarget:m});yield s._signout({request_type:"so:p",post_logout_redirect_uri:M,state:null==M?void 0:{},...D},N),a.info("success")})()}signoutPopupCallback(o=window.location.href,s=!1){var a=this;return x(function*(){const u=a._logger.create("signoutPopupCallback");yield a._popupNavigator.callback(o,{keepOpen:s}),u.info("success")})()}_signout(o,s){var a=this;return x(function*(){const u=yield a._signoutStart(o,s);return yield a._signoutEnd(u.url)})()}_signoutStart(o={},s){var a=this;return x(function*(){var u;const m=a._logger.create("_signoutStart");try{const D=yield a._loadUser();m.debug("loaded current user from storage"),a.settings.revokeTokensOnSignout&&(yield a._revokeInternal(D));const M=o.id_token_hint||D&&D.id_token;M&&(m.debug("setting id_token_hint in signout request"),o.id_token_hint=M),yield a.removeUser(),m.debug("user removed, creating signout request");const N=yield a._client.createSignoutRequest(o);return m.debug("got signout request"),yield s.navigate({url:N.url,state:null==(u=N.state)?void 0:u.id,scriptOrigin:a.settings.iframeScriptOrigin})}catch(D){throw m.debug("error after preparing navigator, closing navigator window"),s.close(),D}})()}_signoutEnd(o){var s=this;return x(function*(){const a=s._logger.create("_signoutEnd"),u=yield s._client.processSignoutResponse(o);return a.debug("got signout response"),u})()}signoutSilent(o={}){var s=this;return x(function*(){var a;const u=s._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:m,...D}=o,M=s.settings.includeIdTokenInSilentSignout?null==(a=yield s._loadUser())?void 0:a.id_token:void 0,N=s.settings.popup_post_logout_redirect_uri,B=yield s._iframeNavigator.prepare({silentRequestTimeoutInSeconds:m});yield s._signout({request_type:"so:s",post_logout_redirect_uri:N,id_token_hint:M,...D},B),u.info("success")})()}signoutSilentCallback(o=window.location.href){var s=this;return x(function*(){const a=s._logger.create("signoutSilentCallback");yield s._iframeNavigator.callback(o),a.info("success")})()}revokeTokens(o){var s=this;return x(function*(){const a=yield s._loadUser();yield s._revokeInternal(a,o)})()}_revokeInternal(o,s=this.settings.revokeTokenTypes){var a=this;return x(function*(){const u=a._logger.create("_revokeInternal");if(!o)return;const m=s.filter(D=>"string"==typeof o[D]);if(m.length){for(const D of m)yield a._client.revokeToken(o[D],D),u.info(`${D} revoked successfully`),"access_token"!==D&&(o[D]=null);yield a.storeUser(o),u.debug("user stored"),a._events.load(o)}else u.debug("no need to revoke due to no token(s)")})()}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}_loadUser(){var o=this;return x(function*(){const s=o._logger.create("_loadUser"),a=yield o.settings.userStore.get(o._userStoreKey);return a?(s.debug("user storageString loaded"),xc.fromStorageString(a)):(s.debug("no user storageString"),null)})()}storeUser(o){var s=this;return x(function*(){const a=s._logger.create("storeUser");if(o){a.debug("storing user");const u=o.toStorageString();yield s.settings.userStore.set(s._userStoreKey,u)}else s._logger.debug("removing user"),yield s.settings.userStore.remove(s._userStoreKey)})()}clearStaleState(){var o=this;return x(function*(){yield o._client.clearStaleState()})()}};class kc{}class yo{constructor(){this.subscribers=[]}add(s){return this.subscribers.push(s),this.lastNotifiedValue&&s(...this.lastNotifiedValue),{unsubscribe:()=>this.unsubscribe(s)}}notify(...s){this.lastNotifiedValue=s,this.subscribers.forEach(a=>{a(...s)})}unsubscribe(s){if(s){const a=this.subscribers.indexOf(s);-1!==a&&this.subscribers.splice(a,1)}else this.subscribers=[]}}const _o=window.localStorage,nr=window.Capacitor?.Plugins?.Storage,hr=window.Capacitor?.Plugins?.Preferences,fn=window.Capacitor?.Plugins?.SecureStoragePlugin;class at{constructor(){if(this._logger=new rt("MobileStorage"),!fn){let s="[@badisi/auth-js] This application is currently using an unsafe storage.\n\n";s+="\u24d8 Please follow the recommended guide and use `capacitor-secure-storage-plugin` instead.",console.warn(s)}this._logger.debug(fn?"Using `capacitor-secure-storage-plugin` implementation":hr?"Using `@capacitor/preferences` implementation":nr?"Using `@capacitor/storage` implementation":"Using `localStorage` implementation")}get length(){return x(function*(){return fn?(yield fn.keys()).value.length:hr?(yield hr.keys()).keys.length:nr?(yield nr.keys()).keys.length:_o.length})()}key(s){return x(function*(){return fn?(yield fn.keys()).value[s]:hr?(yield hr.keys()).keys[s]:nr?(yield nr.keys()).keys[s]:_o.key(s)})()}clear(){var s=this;return x(function*(){s._logger.create("clear"),fn?yield fn.clear():hr?yield hr.clear():nr?yield nr.clear():_o.clear()})()}getItem(s){var a=this;return x(function*(){if(a._logger.create(`getItem('${s}')`),!fn)return hr?(yield hr.get({key:s})).value:nr?(yield nr.get({key:s})).value:_o.getItem(s);try{return(yield fn.get({key:s})).value}catch{return null}})()}setItem(s,a){var u=this;return x(function*(){u._logger.create(`setItem('${s}')`),fn?yield fn.set({key:s,value:a}):hr?yield hr.set({key:s,value:a}):nr?yield nr.set({key:s,value:a}):_o.setItem(s,a)})()}removeItem(s){var a=this;return x(function*(){if(a._logger.create(`removeItem('${s}')`),fn)try{yield fn.remove({key:s})}catch{}else hr?yield hr.remove({key:s}):nr?yield nr.remove({key:s}):_o.removeItem(s)})()}}var Sr=function(o){return o.REDIRECT="REDIRECT",o.POPUP="POPUP",o}(Sr||{});class Fc{constructor(){this.expired=void 0,this.expires_in=void 0,this.expires_at=void 0}static deserialize(s){const a=new Fc,u=Object.keys(a);for(const m of u)a[m]=s[m];return a}}const L_=window.Capacitor?.Plugins?.App,Wa=window.Capacitor?.Plugins?.Browser;class ym{constructor(s,a){if(this.redirectUrl=s,this.params=a,this._logger=new rt("MobileWindow"),this.originalHandleOpenURL=window.handleOpenURL,this._isClosed=!0,this._receivedResult=!1,!nn.isCapacitor()&&!nn.isCordova()){let u="[@badisi/auth-js] Required core dependency not found.\n\n";u+="\u24d8 Please follow the recommended guide and install either `Capacitor` or `Cordova` dependency.",console.error(u)}if(!Wa){let u="[@badisi/auth-js] Required plugin not found.\n\n";u+="\u24d8 Please follow the recommended guide and install either `@badisi/capacitor-browsertab` or `@capacitor/browser` plugin.",console.error(u)}Wa&&this._logger.debug("Using `@capacitor/browser` implementation")}navigate(s){var a=this;return x(function*(){return a.navigateLogger=a._logger.create("navigate"),a.navigateLogger.debug("url",s.url),a._isClosed=!1,a._receivedResult=!1,new Promise((u,m)=>{a._resolve=u,a._reject=m,a.installCustomUrlSchemeHandler().then(()=>{Wa&&a.useCapacitorBrowser(s)})})})()}close(){var s=this;return x(function*(){const a=s._logger.create("close");s._isClosed||(yield Wa?.close().catch(u=>a.error(u))),a.debug("success")})()}cleanup(){var s=this;return x(function*(){const a=s._logger.create("cleanup");window.handleOpenURL=s.originalHandleOpenURL,yield s.capacitorBrowserFinishedHandle?.remove(),yield s.capacitorAppUrlOpenHandle?.remove(),clearTimeout(s.timer),a.debug("success")})()}onError(s){var a=this;return x(function*(){a.navigateLogger?.error("error response:",s),yield a.close(),yield a.cleanup(),a._reject?.(new Error(s)),a._receivedResult=!0})()}onSuccess(s){var a=this;return x(function*(){a.navigateLogger?.debug("successful response:",s),yield a.close(),yield a.cleanup(),a._resolve?.({url:s}),a._receivedResult=!0})()}useCapacitorBrowser(s){var a=this;return x(function*(){a.capacitorBrowserFinishedHandle=yield Wa?.addListener("browserFinished",()=>{a._isClosed=!0,setTimeout(()=>{a._receivedResult||(a.cleanup(),a._reject?.("Capacitor browser closed by user"))},1e3)}),yield Wa?.open({url:s.url,toolbarColor:a.params.mobileWindowToolbarColor,presentationStyle:a.params.mobileWindowPresentationStyle,width:a.params.mobileWindowWidth,height:a.params.mobileWindowWidth})})()}useBrowserTab(s){return x(function*(){})()}installCustomUrlSchemeHandler(){var s=this;return x(function*(){const a=s._logger.create("installCustomUrlSchemeHandler");s.timer=setTimeout(()=>{s.onError("Installing custom url scheme handler, timed out without a response")},1e4),yield s.cleanup(),nn.isCapacitor()?(a.debug("listening to Capacitor `appUrlOpen` event"),s.capacitorAppUrlOpenHandle=yield L_?.addListener?.("appUrlOpen",({url:u})=>{nn.isUrlMatching(u,s.redirectUrl)&&s.onSuccess(u)})):nn.isCordova()&&(a.debug("waiting for Cordova `handleOpenURL` callback"),window.handleOpenURL=u=>{s.originalHandleOpenURL?.(u),nn.isUrlMatching(u,s.redirectUrl)&&s.onSuccess(u)}),a.debug("success")})()}}class Yh{constructor(){this._logger=new rt("MobileNavigator")}prepare(s,a){return this._logger.create("prepare"),new ym(s,a)}}class Gs extends Zh{#e;constructor(s){super({authority:s.authorityUrl,client_id:s.clientId,scope:s.scope,loadUserInfo:s.loadUserInfo,automaticSilentRenew:s.automaticSilentRenew,...s.internal}),this.libSettings=s,this.#e=new Yh}signoutMobile(s={}){var a=this;return x(function*(){const u=a._logger.create("signout"),{mobileWindowToolbarColor:m,mobileWindowPresentationStyle:D,mobileWindowWidth:M,mobileWindowHeight:N,...B}=s,fe=a.#e.prepare(a.settings.post_logout_redirect_uri,{mobileWindowToolbarColor:m??a.libSettings.internal?.mobileWindowToolbarColor,mobileWindowPresentationStyle:D??a.libSettings.internal?.mobileWindowPresentationStyle,mobileWindowWidth:M??a.libSettings.internal?.mobileWindowWidth,mobileWindowHeight:N??a.libSettings.internal?.mobileWindowHeight});yield a._signout({request_type:"so:m",post_logout_redirect_uri:a.settings.post_logout_redirect_uri,...B},fe),u.info("success")})()}signinMobile(s={}){var a=this;return x(function*(){const u=a._logger.create("signin"),{mobileWindowToolbarColor:m,mobileWindowPresentationStyle:D,mobileWindowWidth:M,mobileWindowHeight:N,...B}=s,fe=a.#e.prepare(a.settings.redirect_uri,{mobileWindowToolbarColor:m??a.libSettings.internal?.mobileWindowToolbarColor,mobileWindowPresentationStyle:D??a.libSettings.internal?.mobileWindowPresentationStyle,mobileWindowWidth:M??a.libSettings.internal?.mobileWindowWidth,mobileWindowHeight:N??a.libSettings.internal?.mobileWindowHeight}),Se=yield a._signin({request_type:"si:m",redirect_uri:a.settings.redirect_uri,...B},fe);Se?.profile?.sub?u.info("success, signed in subject",Se.profile.sub):u.info("no subject")})()}}const qa="auth-js:oidc_manager:redirect_url",Yo={loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!1,automaticSilentRenew:!0,desktopNavigationType:Sr.REDIRECT,scope:"openid profile email phone",logLevel:wt.NONE,internal:{response_type:"code",redirect_uri:"?oidc-callback=login",post_logout_redirect_uri:"?oidc-callback=logout",popup_redirect_uri:"oidc/callback/popup_redirect.html",popup_post_logout_redirect_uri:"oidc/callback/popup_redirect.html",silent_redirect_uri:"oidc/callback/silent_redirect.html",mobileWindowPresentationStyle:"popover"}};class _m extends kc{#e=new yo;#t=new yo;#n=new yo;#o=new yo;#s=new yo;#a=new yo;#c=new yo;#d=[];#l;#u;#h;#g;#p=!1;#_=!1;#i;#r=Yo;#w;set user(s){this.#w!==s&&(this.#w=s,this.#l=s?s.id_token:void 0,this.#u=s?s.access_token:void 0,this.#h=s?.profile?s.profile:void 0,this.#g=s?Fc.deserialize(s):void 0,this.#p=!(!s||s.expired),this.#e.notify(this.#l),this.#t.notify(this.#u),this.#n.notify(this.#h),this.#o.notify(this.#g),this.#s.notify(this.#p))}init(s){var a=this;return x(function*(){wt.setLevel(s.logLevel??Yo.logLevel??wt.NONE),wt.setLogger(console);const u=nn.isNativeMobile(),m=u?`${s.mobileScheme}://localhost/`:nn.getBaseUrl();if(a.#r=ou({},Yo,{internal:{userStore:new Vh({store:u?new at:new Oc}),redirect_uri:`${m}${Yo.internal?.redirect_uri}`,post_logout_redirect_uri:`${m}${Yo.internal?.post_logout_redirect_uri}`,popup_redirect_uri:`${m}${Yo.internal?.popup_redirect_uri}`,popup_post_logout_redirect_uri:`${m}${Yo.internal?.popup_post_logout_redirect_uri}`,silent_redirect_uri:`${m}${Yo.internal?.silent_redirect_uri}`}},s),a.#i=new Gs(a.#r),a.#d.push(a.#i.events.addUserLoaded(D=>{a.user=D}),a.#i.events.addUserUnloaded(()=>{a.#w&&(a.user=null,a.#r.loginRequired&&location.reload())}),a.#i.events.addSilentRenewError(x(function*(){yield a.#y()}))),a.#S(),nn.isUrlMatching(location.href,a.#r.internal?.redirect_uri))yield a.#E(x(function*(){const D=sessionStorage.getItem(qa);yield a.#C(()=>a.#i.signinRedirectCallback(location.href),D),sessionStorage.removeItem(qa)}));else if(nn.isUrlMatching(location.href,a.#r.internal?.post_logout_redirect_uri))yield a.#E(x(function*(){const D=sessionStorage.getItem(qa);yield a.#D(()=>a.#i.signoutRedirectCallback(location.href),D),sessionStorage.removeItem(qa)}));else if(a.#r.retrieveUserSession||a.#r.loginRequired){const D=yield a.#i?.getUser();!D||D.expired?!u&&a.#r.retrieveUserSession?yield a.#E(()=>a.#b().catch(function(){var M=x(function*(N){const{error:B,message:K}=N;if(a.#r.loginRequired&&(B?.includes("_required")||K?.includes("_required")))yield a.login();else if(console.error("[OIDCAuthManager] User's session cannot be retrieved:",N.message),a.#s.notify(!1),a.#r.loginRequired)throw N});return function(N){return M.apply(this,arguments)}}())):a.#r.loginRequired?yield a.login():a.user=null:a.user=D}else a.user=null})()}logout(s){var a=this;return x(function*(){const u=s?.redirectUrl??location.href;nn.isNativeMobile()?yield a.#D(()=>a.#i.signoutMobile(s),u):(s?.desktopNavigationType??a.#r.desktopNavigationType)===Sr.POPUP?yield a.#D(()=>a.#i.signoutPopup(s),u):(sessionStorage.setItem(qa,u),yield a.#i?.signoutRedirect(s))})()}login(s){var a=this;return x(function*(){const u=s?.redirectUrl??location.href;return nn.isNativeMobile()?yield a.#C(()=>a.#i.signinMobile(s),u):(s?.desktopNavigationType??a.#r.desktopNavigationType)===Sr.POPUP?yield a.#C(()=>a.#i.signinPopup(s),u):(sessionStorage.setItem(qa,u),yield a.#i?.signinRedirect(s)),a.#p})()}renew(s){var a=this;return x(function*(){return a.#b(s).catch(u=>console.error(u))})()}getSettings(){return this.#r}isRenewing(){return this.#_}isAuthenticated(){var s=this;return x(function*(){return yield s.#f("isAuthenticated()"),s.#p})()}getUserProfile(){var s=this;return x(function*(){return yield s.#f("getUserProfile()"),s.#h})()}getUserSession(){var s=this;return x(function*(){return yield s.#f("getUserSession()"),s.#g})()}getIdToken(){var s=this;return x(function*(){return yield s.#f("getIdToken()"),s.#l})()}getIdTokenDecoded(){var s=this;return x(function*(){return yield s.#f("getIdTokenDecoded()"),nn.decodeJwt(s.#l)})()}getAccessToken(){var s=this;return x(function*(){return yield s.#f("getAccessToken()"),s.#u})()}getAccessTokenDecoded(){var s=this;return x(function*(){return yield s.#f("getAccessTokenDecoded()"),nn.decodeJwt(s.#u)})()}destroy(){this.#e.unsubscribe(),this.#t.unsubscribe(),this.#n.unsubscribe(),this.#o.unsubscribe(),this.#s.unsubscribe(),this.#a.unsubscribe(),this.#c.unsubscribe(),this.#d.forEach(s=>s())}onIdTokenChanged(s){return this.#e.add(s)}onAccessTokenChanged(s){return this.#t.add(s)}onUserProfileChanged(s){return this.#n.add(s)}onUserSessionChanged(s){return this.#o.add(s)}onAuthenticatedChanged(s){return this.#s.add(s)}onRenewingChanged(s){return this.#a.add(s)}onRedirect(s){return this.#c.add(s)}#S(){[this.#r.internal?.silent_redirect_uri,this.#r.internal?.popup_redirect_uri].forEach(s=>{const a=new RegExp(/^.*\/(.*).html$/gm).exec(s??"")?.[1],u=new Error(`[OIDCAuthManager] ${s??"redirect uri"} was not found.`);if(u.stack=void 0,nn.isUrlMatching(location.href,s))throw u.message+="\n\n\u24d8 This usually means you forgot to include the redirect html files in your application assets.",u;if(location.href.includes(`/${a}.html`))throw u.message+="\n\n\u24d8 This usually means your redirect urls are misconfigured.",u})}#f(s){var a=this;return x(function*(){const u=Date.now();for(;a.#_;){if(Date.now()>u+5e3){console.warn("[@badisi/auth-js]",`\`${s}\``,"timed out waiting for renew to finish.");break}yield new Promise(m=>setTimeout(m,100))}})()}#I(s){const a=nn.stringToURL(s??"/");this.#r.loginRequired&&location.origin===a.origin&&location.reload()}#m(s){this.#_=s,this.#a.notify(s)}#E(s){var a=this;return x(function*(){a.#r.loginRequired?yield s():s()})()}#v(s,a){var u=this;return x(function*(){a&&(console.error(a),yield u.#y());const m=nn.stringToURL(s??"/");location.origin===m.origin?(history.replaceState(history.state,"",m.href),u.#c.notify(m)):location.href=m.href})()}#y(){var s=this;return x(function*(){s.user=null,yield Promise.all([s.#i?.clearStaleState(),s.#i?.removeUser()])})()}#b(s){var a=this;return x(function*(){a.#m(!0);try{yield a.#i?.signinSilent(s)}catch(u){throw yield a.#y(),u}finally{a.#m(!1)}})()}#C(s,a){var u=this;return x(function*(){try{u.#m(!0),yield s().catch(m=>{throw"Attempted to navigate on a disposed window"===m?.message&&((m=new Error("[OIDCAuthManager] Attempted to navigate on a disposed window.")).stack=void 0,m.message+="\n\n\u24d8 This may be due to an ad blocker."),m}),yield u.#v(a)}catch(m){throw yield u.#v("/",m),m}finally{u.#m(!1)}})()}#D(s,a){var u=this;return x(function*(){try{yield s().catch(m=>{throw"Attempted to navigate on a disposed window"===m?.message&&((m=new Error("[OIDCAuthManager] Attempted to navigate on a disposed window.")).stack=void 0,m.message+="\n\n\u24d8 This may be due to an ad blocker."),m}),yield u.#v(a),yield u.#y()}catch(m){throw a="/",yield u.#v(a,m),m}finally{u.#I(a)}})()}}const wm=function(){var o=x(function*(s){return yield Ar(s,_m)});return function(a){return o.apply(this,arguments)}}(),Em={automaticLoginOn401:!0,automaticInjectToken:{include:o=>{const s=new URL(o,"http://default-base");return s.hostname.startsWith("api")||s.pathname.startsWith("/api")||!1}}},te=new _.nKC("AUTH_MANAGER"),ht=function(){var o=x(function*(s){return{provide:te,useValue:yield wm({...Em,...s}),multi:!1}});return function(a){return o.apply(this,arguments)}}();let lu=(()=>{class o{#e;#t;#n;#o;#s;#a;#c;#d;#l;#u;constructor(){this.#e=(0,_.WQX)(te),this.#t=(0,_.WQX)(_.SKi),this.#n=(0,_.WQX)(zr.Ix),this.#o=new dt(1),this.#s=new dt(1),this.#a=new dt(1),this.#c=new dt(1),this.#d=new dt(1),this.#l=new dt(1),this.#u=[],this.isRenewing$=this.#l.asObservable().pipe(Mt()),this.isAuthenticated$=this.#d.asObservable().pipe(Mt()),this.userProfile$=this.#a.asObservable().pipe(Mt()),this.userSession$=this.#c.asObservable().pipe(Mt()),this.idToken$=this.#o.asObservable().pipe(Mt()),this.idTokenDecoded$=this.#o.asObservable().pipe(Mt(),(0,Y.T)(a=>nn.decodeJwt(a))),this.accessToken$=this.#s.asObservable().pipe(Mt()),this.accessTokenDecoded$=this.#s.asObservable().pipe(Mt(),(0,Y.T)(a=>nn.decodeJwt(a))),this.#h()}ngOnDestroy(){this.#u.forEach(a=>a.unsubscribe())}login(a){var u=this;return x(function*(){return u.#e.login(a)})()}logout(a){var u=this;return x(function*(){return u.#e.logout(a)})()}renew(a){var u=this;return x(function*(){return u.#e.renew(a)})()}getSettings(){return this.#e.getSettings()}isRenewing(){return this.#e.isRenewing()}isAuthenticated(){var a=this;return x(function*(){return a.#e.isAuthenticated()})()}getUserProfile(){var a=this;return x(function*(){return a.#e.getUserProfile()})()}getUserSession(){var a=this;return x(function*(){return a.#e.getUserSession()})()}getIdToken(){var a=this;return x(function*(){return a.#e.getIdToken()})()}getIdTokenDecoded(){var a=this;return x(function*(){return a.#e.getIdTokenDecoded()})()}getAccessToken(){var a=this;return x(function*(){return a.#e.getAccessToken()})()}getAccessTokenDecoded(){var a=this;return x(function*(){return a.#e.getAccessTokenDecoded()})()}#h(){this.#u.push(this.#e.onIdTokenChanged(a=>this.#t.run(()=>this.#o.next(a))),this.#e.onAccessTokenChanged(a=>this.#t.run(()=>this.#s.next(a))),this.#e.onUserProfileChanged(a=>this.#t.run(()=>this.#a.next(a))),this.#e.onUserSessionChanged(a=>this.#t.run(()=>this.#c.next(a))),this.#e.onAuthenticatedChanged(a=>this.#t.run(()=>this.#d.next(a))),this.#e.onRenewingChanged(a=>this.#t.run(()=>this.#l.next(a))),this.#e.onRedirect(a=>{this.#n.getCurrentNavigation()||this.#t.run(()=>{const u=a.href.replace(nn.getBaseUrl(),"");this.#n.navigateByUrl(u)})}))}static#g=this.\u0275fac=function(u){return new(u||o)};static#p=this.\u0275prov=_.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();const ep=(o,s)=>{const u=(fe,Se)=>{const Fe=(fe=>{try{return new URL(fe).href}catch{return new URL(`${location.origin}${fe.startsWith("/")?"":"/"}${fe}`).href}})(fe);if("function"==typeof Se)return Se(Fe);if("string"==typeof Se){const ct=Se.replace(/\//g,"\\/").replace(/\./g,"\\.").replace(/\*\*/g,"*").replace(/\*/g,".*");return null!==new RegExp(ct).exec(Fe)}return null!==Se.exec(Fe)},M=(0,_.WQX)(lu),N=M.getSettings(),B=N?.automaticLoginOn401??!1;return(fe=M,Se=o,Fe=N?.automaticInjectToken??!1,fe.accessToken$.pipe((0,Mr.s)(1),(0,Y.T)(ct=>{if(!1!==Fe&&ct&&((fe,Se)=>{let Fe=!1;if("boolean"==typeof Se)Fe=Se;else{const{include:ct,exclude:vt}=Se??{};Array.isArray(ct)?Fe=ct.some(ft=>u(fe.url,ft)):ct&&(Fe=u(fe.url,ct)),Array.isArray(vt)?vt.some(ft=>u(fe.url,ft))&&(Fe=!1):vt&&u(fe.url,vt)&&(Fe=!1)}return Fe})(Se,Fe)){const vt=Se.headers?Se.headers:new Ue;return Se.clone({headers:vt.append("Authorization",`Bearer ${ct}`)})}return Se}))).pipe((0,ae.n)(fe=>s(fe)),(0,hc.W)(fe=>(B&&401===fe.status&&M.login(),(0,va.$)(()=>fe))));var fe,Se,Fe};var tp=O(4402),Lc=O(3073),bi=O(8750),Vd=O(3794),jd=O(6450),np=O(8496);function Cm(...o){const s=(0,Vd.ms)(o),{args:a,keys:u}=(0,Lc.D)(o),m=new oe.c(D=>{const{length:M}=a;if(!M)return void D.complete();const N=new Array(M);let B=M,K=M;for(let fe=0;fe{Se||(Se=!0,K--),N[fe]=Fe},()=>B--,void 0,()=>{(!B||!Se)&&(K||D.next(u?(0,np.e)(u,N):N),D.complete())}))}});return s?m.pipe((0,jd.I)(s)):m}let Ka=(()=>{class o{#e=(0,_.WQX)(lu);#t=(0,_.WQX)(zr.Ix);canLoad(a){const u=this.#t.getCurrentNavigation()?.extractedUrl?.toString();return this.#a(a.data,u)}canActivate(a,u){return this.#a(a.data,u.url)}canActivateChild(a,u){return this.#a(a.data,u.url)}isAuthorized(){return!0}#n(a){return!(!a?.then||"function"!=typeof a.then)}#o(a){const u=D=>"boolean"==typeof D?(0,W.of)(D):(0,tp.A)(D)?D:this.#n(D)?(0,_e.H)(D):(0,W.of)(!1),m=a?.authGuardValidator;return"function"==typeof m?Cm({userProfile:this.#e.userProfile$.pipe((0,Mr.s)(1)),accessToken:this.#e.accessTokenDecoded$.pipe((0,Mr.s)(1))}).pipe((0,ae.n)(({userProfile:D,accessToken:M})=>u(m(D,M)))):m?(console.error("authGuardValidator must be a function"),(0,W.of)(!1)):u(this.isAuthorized())}#s(a=location.href){return this.#e.isAuthenticated$.pipe((0,Mr.s)(1),(0,ae.n)(u=>u?(0,W.of)(u):(0,_e.H)(this.#e.login({redirectUrl:a})).pipe((0,hc.W)(()=>(0,W.of)(!1)))))}#a(a,u=location.href){return this.#s(u).pipe((0,ae.n)(m=>m?this.#o(a):(0,W.of)(!1)),(0,Y.T)(m=>{if(!m){const D=a?.authGuardRedirectUrl||this.#e.getSettings()?.authGuardRedirectUrl;return this.#t.parseUrl(D||this.#t.url)}return!0}))}static#c=this.\u0275fac=function(u){return new(u||o)};static#d=this.\u0275prov=_.jDH({token:o,factory:o.\u0275fac})}return o})(),ip=(()=>{class o{static#e=this.\u0275fac=function(u){return new(u||o)};static#t=this.\u0275cmp=_.VBU({type:o,selectors:[["app-root"]],standalone:!0,features:[_.aNF],decls:1,vars:0,template:function(u,m){1&u&&_.nrm(0,"router-outlet")},dependencies:[zr.n3],encapsulation:2})}return o})(),rr=(()=>{class o{constructor(a,u){this._renderer=a,this._elementRef=u,this.onChange=m=>{},this.onTouched=()=>{}}setProperty(a,u){this._renderer.setProperty(this._elementRef.nativeElement,a,u)}registerOnTouched(a){this.onTouched=a}registerOnChange(a){this.onChange=a}setDisabledState(a){this.setProperty("disabled",a)}static#e=this.\u0275fac=function(u){return new(u||o)(_.rXU(_.sFG),_.rXU(_.aKT))};static#t=this.\u0275dir=_.FsC({type:o})}return o})(),pr=(()=>{class o extends rr{static#e=this.\u0275fac=(()=>{let a;return function(m){return(a||(a=_.xGo(o)))(m||o)}})();static#t=this.\u0275dir=_.FsC({type:o,features:[_.Vt3]})}return o})();const Si=new _.nKC(""),bm={provide:Si,useExisting:(0,_.Rfq)(()=>uu),multi:!0},Sm=new _.nKC("");let uu=(()=>{class o extends rr{constructor(a,u,m){super(a,u),this._compositionMode=m,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function op(){const o=(0,Ie.QT)()?(0,Ie.QT)().getUserAgent():"";return/android (\d+)/.test(o.toLowerCase())}())}writeValue(a){this.setProperty("value",a??"")}_handleInput(a){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(a)}_compositionStart(){this._composing=!0}_compositionEnd(a){this._composing=!1,this._compositionMode&&this.onChange(a)}static#e=this.\u0275fac=function(u){return new(u||o)(_.rXU(_.sFG),_.rXU(_.aKT),_.rXU(Sm,8))};static#t=this.\u0275dir=_.FsC({type:o,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(u,m){1&u&&_.bIt("input",function(M){return m._handleInput(M.target.value)})("blur",function(){return m.onTouched()})("compositionstart",function(){return m._compositionStart()})("compositionend",function(M){return m._compositionEnd(M.target.value)})},features:[_.Jv_([bm]),_.Vt3]})}return o})();const Pn=new _.nKC(""),Ti=new _.nKC("");function Wt(o){return null!=o}function ap(o){return(0,_.jNT)(o)?(0,_e.H)(o):o}function cp(o){let s={};return o.forEach(a=>{s=null!=a?{...s,...a}:s}),0===Object.keys(s).length?null:s}function lp(o,s){return s.map(a=>a(o))}function zd(o){return o.map(s=>function Mm(o){return!o.validate}(s)?s:a=>s.validate(a))}function zs(o){return null!=o?function Wd(o){if(!o)return null;const s=o.filter(Wt);return 0==s.length?null:function(a){return cp(lp(a,s))}}(zd(o)):null}function qd(o){return null!=o?function Mi(o){if(!o)return null;const s=o.filter(Wt);return 0==s.length?null:function(a){return Cm(lp(a,s).map(ap)).pipe((0,Y.T)(cp))}}(zd(o)):null}function Uc(o,s){return null===o?[s]:Array.isArray(o)?[...o,s]:[o,s]}function Bc(o){return o?Array.isArray(o)?o:[o]:[]}function Hc(o,s){return Array.isArray(o)?o.includes(s):o===s}function Kd(o,s){const a=Bc(s);return Bc(o).forEach(m=>{Hc(a,m)||a.push(m)}),a}function up(o,s){return Bc(s).filter(a=>!Hc(o,a))}class Ws{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(s){this._rawValidators=s||[],this._composedValidatorFn=zs(this._rawValidators)}_setAsyncValidators(s){this._rawAsyncValidators=s||[],this._composedAsyncValidatorFn=qd(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(s){this._onDestroyCallbacks.push(s)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(s=>s()),this._onDestroyCallbacks=[]}reset(s=void 0){this.control&&this.control.reset(s)}hasError(s,a){return!!this.control&&this.control.hasError(s,a)}getError(s,a){return this.control?this.control.getError(s,a):null}}class In extends Ws{get formDirective(){return null}get path(){return null}}class es extends Ws{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}class pu{constructor(s){this._cd=s}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}}let dp=(()=>{class o extends pu{constructor(a){super(a)}static#e=this.\u0275fac=function(u){return new(u||o)(_.rXU(es,2))};static#t=this.\u0275dir=_.FsC({type:o,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(u,m){2&u&&_.AVh("ng-untouched",m.isUntouched)("ng-touched",m.isTouched)("ng-pristine",m.isPristine)("ng-dirty",m.isDirty)("ng-valid",m.isValid)("ng-invalid",m.isInvalid)("ng-pending",m.isPending)},features:[_.Vt3]})}return o})();const Qa="VALID",Ks="INVALID",ts="PENDING",Wc="DISABLED";class Xs{}class Zd extends Xs{constructor(s,a){super(),this.value=s,this.source=a}}class gu extends Xs{constructor(s,a){super(),this.pristine=s,this.source=a}}class mu extends Xs{constructor(s,a){super(),this.touched=s,this.source=a}}class vu extends Xs{constructor(s,a){super(),this.status=s,this.source=a}}function wo(o){return null!=o&&!Array.isArray(o)&&"object"==typeof o}class wu{constructor(s,a){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=null,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this._status=(0,_.EWP)(()=>this.statusReactive()),this.statusReactive=(0,_.vPA)(void 0),this._pristine=(0,_.EWP)(()=>this.pristineReactive()),this.pristineReactive=(0,_.vPA)(!0),this._touched=(0,_.EWP)(()=>this.touchedReactive()),this.touchedReactive=(0,_.vPA)(!1),this._events=new _a.B,this.events=this._events.asObservable(),this._onDisabledChange=[],this._assignValidators(s),this._assignAsyncValidators(a)}get validator(){return this._composedValidatorFn}set validator(s){this._rawValidators=this._composedValidatorFn=s}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(s){this._rawAsyncValidators=this._composedAsyncValidatorFn=s}get parent(){return this._parent}get status(){return(0,_.O8t)(this.statusReactive)}set status(s){(0,_.O8t)(()=>this.statusReactive.set(s))}get valid(){return this.status===Qa}get invalid(){return this.status===Ks}get pending(){return this.status==ts}get disabled(){return this.status===Wc}get enabled(){return this.status!==Wc}get pristine(){return(0,_.O8t)(this.pristineReactive)}set pristine(s){(0,_.O8t)(()=>this.pristineReactive.set(s))}get dirty(){return!this.pristine}get touched(){return(0,_.O8t)(this.touchedReactive)}set touched(s){(0,_.O8t)(()=>this.touchedReactive.set(s))}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(s){this._assignValidators(s)}setAsyncValidators(s){this._assignAsyncValidators(s)}addValidators(s){this.setValidators(Kd(s,this._rawValidators))}addAsyncValidators(s){this.setAsyncValidators(Kd(s,this._rawAsyncValidators))}removeValidators(s){this.setValidators(up(s,this._rawValidators))}removeAsyncValidators(s){this.setAsyncValidators(up(s,this._rawAsyncValidators))}hasValidator(s){return Hc(this._rawValidators,s)}hasAsyncValidator(s){return Hc(this._rawAsyncValidators,s)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(s={}){const a=!1===this.touched;this.touched=!0;const u=s.sourceControl??this;this._parent&&!s.onlySelf&&this._parent.markAsTouched({...s,sourceControl:u}),a&&!1!==s.emitEvent&&this._events.next(new mu(!0,u))}markAllAsTouched(s={}){this.markAsTouched({onlySelf:!0,emitEvent:s.emitEvent,sourceControl:this}),this._forEachChild(a=>a.markAllAsTouched(s))}markAsUntouched(s={}){const a=!0===this.touched;this.touched=!1,this._pendingTouched=!1;const u=s.sourceControl??this;this._forEachChild(m=>{m.markAsUntouched({onlySelf:!0,emitEvent:s.emitEvent,sourceControl:u})}),this._parent&&!s.onlySelf&&this._parent._updateTouched(s,u),a&&!1!==s.emitEvent&&this._events.next(new mu(!1,u))}markAsDirty(s={}){const a=!0===this.pristine;this.pristine=!1;const u=s.sourceControl??this;this._parent&&!s.onlySelf&&this._parent.markAsDirty({...s,sourceControl:u}),a&&!1!==s.emitEvent&&this._events.next(new gu(!1,u))}markAsPristine(s={}){const a=!1===this.pristine;this.pristine=!0,this._pendingDirty=!1;const u=s.sourceControl??this;this._forEachChild(m=>{m.markAsPristine({onlySelf:!0,emitEvent:s.emitEvent})}),this._parent&&!s.onlySelf&&this._parent._updatePristine(s,u),a&&!1!==s.emitEvent&&this._events.next(new gu(!0,u))}markAsPending(s={}){this.status=ts;const a=s.sourceControl??this;!1!==s.emitEvent&&(this._events.next(new vu(this.status,a)),this.statusChanges.emit(this.status)),this._parent&&!s.onlySelf&&this._parent.markAsPending({...s,sourceControl:a})}disable(s={}){const a=this._parentMarkedDirty(s.onlySelf);this.status=Wc,this.errors=null,this._forEachChild(m=>{m.disable({...s,onlySelf:!0})}),this._updateValue();const u=s.sourceControl??this;!1!==s.emitEvent&&(this._events.next(new Zd(this.value,u)),this._events.next(new vu(this.status,u)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...s,skipPristineCheck:a},this),this._onDisabledChange.forEach(m=>m(!0))}enable(s={}){const a=this._parentMarkedDirty(s.onlySelf);this.status=Qa,this._forEachChild(u=>{u.enable({...s,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:s.emitEvent}),this._updateAncestors({...s,skipPristineCheck:a},this),this._onDisabledChange.forEach(u=>u(!1))}_updateAncestors(s,a){this._parent&&!s.onlySelf&&(this._parent.updateValueAndValidity(s),s.skipPristineCheck||this._parent._updatePristine({},a),this._parent._updateTouched({},a))}setParent(s){this._parent=s}getRawValue(){return this.value}updateValueAndValidity(s={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){const u=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Qa||this.status===ts)&&this._runAsyncValidator(u,s.emitEvent)}const a=s.sourceControl??this;!1!==s.emitEvent&&(this._events.next(new Zd(this.value,a)),this._events.next(new vu(this.status,a)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!s.onlySelf&&this._parent.updateValueAndValidity({...s,sourceControl:a})}_updateTreeValidity(s={emitEvent:!0}){this._forEachChild(a=>a._updateTreeValidity(s)),this.updateValueAndValidity({onlySelf:!0,emitEvent:s.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Wc:Qa}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(s,a){if(this.asyncValidator){this.status=ts,this._hasOwnPendingAsyncValidator={emitEvent:!1!==a};const u=ap(this.asyncValidator(this));this._asyncValidationSubscription=u.subscribe(m=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(m,{emitEvent:a,shouldHaveEmitted:s})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();const s=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,s}return!1}setErrors(s,a={}){this.errors=s,this._updateControlsErrors(!1!==a.emitEvent,this,a.shouldHaveEmitted)}get(s){let a=s;return null==a||(Array.isArray(a)||(a=a.split(".")),0===a.length)?null:a.reduce((u,m)=>u&&u._find(m),this)}getError(s,a){const u=a?this.get(a):this;return u&&u.errors?u.errors[s]:null}hasError(s,a){return!!this.getError(s,a)}get root(){let s=this;for(;s._parent;)s=s._parent;return s}_updateControlsErrors(s,a,u){this.status=this._calculateStatus(),s&&this.statusChanges.emit(this.status),(s||u)&&this._events.next(new vu(this.status,a)),this._parent&&this._parent._updateControlsErrors(s,a,u)}_initObservables(){this.valueChanges=new _.bkB,this.statusChanges=new _.bkB}_calculateStatus(){return this._allControlsDisabled()?Wc:this.errors?Ks:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(ts)?ts:this._anyControlsHaveStatus(Ks)?Ks:Qa}_anyControlsHaveStatus(s){return this._anyControls(a=>a.status===s)}_anyControlsDirty(){return this._anyControls(s=>s.dirty)}_anyControlsTouched(){return this._anyControls(s=>s.touched)}_updatePristine(s,a){const u=!this._anyControlsDirty(),m=this.pristine!==u;this.pristine=u,this._parent&&!s.onlySelf&&this._parent._updatePristine(s,a),m&&this._events.next(new gu(this.pristine,a))}_updateTouched(s={},a){this.touched=this._anyControlsTouched(),this._events.next(new mu(this.touched,a)),this._parent&&!s.onlySelf&&this._parent._updateTouched(s,a)}_registerOnCollectionChange(s){this._onCollectionChange=s}_setUpdateStrategy(s){wo(s)&&null!=s.updateOn&&(this._updateOn=s.updateOn)}_parentMarkedDirty(s){return!s&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}_find(s){return null}_assignValidators(s){this._rawValidators=Array.isArray(s)?s.slice():s,this._composedValidatorFn=function gp(o){return Array.isArray(o)?zs(o):o||null}(this._rawValidators)}_assignAsyncValidators(s){this._rawAsyncValidators=Array.isArray(s)?s.slice():s,this._composedAsyncValidatorFn=function Za(o){return Array.isArray(o)?qd(o):o||null}(this._rawAsyncValidators)}}const ns=new _.nKC("CallSetDisabledState",{providedIn:"root",factory:()=>Zs}),Zs="always";function Xc(o,s,a=Zs){(function ef(o,s){const a=function Vc(o){return o._rawValidators}(o);null!==s.validator?o.setValidators(Uc(a,s.validator)):"function"==typeof a&&o.setValidators([a]);const u=function jc(o){return o._rawAsyncValidators}(o);null!==s.asyncValidator?o.setAsyncValidators(Uc(u,s.asyncValidator)):"function"==typeof u&&o.setAsyncValidators([u]);const m=()=>o.updateValueAndValidity();Cu(s._rawValidators,m),Cu(s._rawAsyncValidators,m)})(o,s),s.valueAccessor.writeValue(o.value),(o.disabled||"always"===a)&&s.valueAccessor.setDisabledState?.(o.disabled),function Fm(o,s){s.valueAccessor.registerOnChange(a=>{o._pendingValue=a,o._pendingChange=!0,o._pendingDirty=!0,"change"===o.updateOn&&Um(o,s)})}(o,s),function yp(o,s){const a=(u,m)=>{s.valueAccessor.writeValue(u),m&&s.viewToModelUpdate(u)};o.registerOnChange(a),s._registerOnDestroy(()=>{o._unregisterOnChange(a)})}(o,s),function Lm(o,s){s.valueAccessor.registerOnTouched(()=>{o._pendingTouched=!0,"blur"===o.updateOn&&o._pendingChange&&Um(o,s),"submit"!==o.updateOn&&o.markAsTouched()})}(o,s),function vp(o,s){if(s.valueAccessor.setDisabledState){const a=u=>{s.valueAccessor.setDisabledState(u)};o.registerOnDisabledChange(a),s._registerOnDestroy(()=>{o._unregisterOnDisabledChange(a)})}}(o,s)}function Cu(o,s){o.forEach(a=>{a.registerOnValidatorChange&&a.registerOnValidatorChange(s)})}function Um(o,s){o._pendingDirty&&o.markAsDirty(),o.setValue(o._pendingValue,{emitModelToViewChange:!1}),s.viewToModelUpdate(o._pendingValue),o._pendingChange=!1}function Yc(o,s){const a=o.indexOf(s);a>-1&&o.splice(a,1)}function rf(o){return"object"==typeof o&&null!==o&&2===Object.keys(o).length&&"value"in o&&"disabled"in o}Promise.resolve();const sf=class extends wu{constructor(s=null,a,u){super(function Jd(o){return(wo(o)?o.validators:o)||null}(a),function _u(o,s){return(wo(s)?s.asyncValidators:o)||null}(u,a)),this.defaultValue=null,this._onChange=[],this._pendingChange=!1,this._applyFormState(s),this._setUpdateStrategy(a),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),wo(a)&&(a.nonNullable||a.initialValueIsDefault)&&(this.defaultValue=rf(s)?s.value:s)}setValue(s,a={}){this.value=this._pendingValue=s,this._onChange.length&&!1!==a.emitModelToViewChange&&this._onChange.forEach(u=>u(this.value,!1!==a.emitViewToModelChange)),this.updateValueAndValidity(a)}patchValue(s,a={}){this.setValue(s,a)}reset(s=this.defaultValue,a={}){this._applyFormState(s),this.markAsPristine(a),this.markAsUntouched(a),this.setValue(this.value,a),this._pendingChange=!1}_updateValue(){}_anyControls(s){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(s){this._onChange.push(s)}_unregisterOnChange(s){Yc(this._onChange,s)}registerOnDisabledChange(s){this._onDisabledChange.push(s)}_unregisterOnDisabledChange(s){Yc(this._onDisabledChange,s)}_forEachChild(s){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(s){rf(s)?(this.value=this._pendingValue=s.value,s.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=s}},cf={provide:es,useExisting:(0,_.Rfq)(()=>Du)},lf=Promise.resolve();let Du=(()=>{class o extends es{constructor(a,u,m,D,M,N){super(),this._changeDetectorRef=M,this.callSetDisabledState=N,this.control=new sf,this._registered=!1,this.name="",this.update=new _.bkB,this._parent=a,this._setValidators(u),this._setAsyncValidators(m),this.valueAccessor=function nf(o,s){if(!s)return null;let a,u,m;return Array.isArray(s),s.forEach(D=>{D.constructor===uu?a=D:function wp(o){return Object.getPrototypeOf(o.constructor)===pr}(D)?u=D:m=D}),m||u||a||null}(0,D)}ngOnChanges(a){if(this._checkForErrors(),!this._registered||"name"in a){if(this._registered&&(this._checkName(),this.formDirective)){const u=a.name.previousValue;this.formDirective.removeControl({name:u,path:this._getPath(u)})}this._setUpControl()}"isDisabled"in a&&this._updateDisabled(a),function Zc(o,s){if(!o.hasOwnProperty("model"))return!1;const a=o.model;return!!a.isFirstChange()||!Object.is(s,a.currentValue)}(a,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(a){this.viewModel=a,this.update.emit(a)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){Xc(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(a){lf.then(()=>{this.control.setValue(a,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(a){const u=a.isDisabled.currentValue,m=0!==u&&(0,_.L39)(u);lf.then(()=>{m&&!this.control.disabled?this.control.disable():!m&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(a){return this._parent?function Kc(o,s){return[...s.path,o]}(a,this._parent):[a]}static#e=this.\u0275fac=function(u){return new(u||o)(_.rXU(In,9),_.rXU(Pn,10),_.rXU(Ti,10),_.rXU(Si,10),_.rXU(_.gRc,8),_.rXU(ns,8))};static#t=this.\u0275dir=_.FsC({type:o,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[_.Jv_([cf]),_.Vt3,_.OA$]})}return o})(),Pp=(()=>{class o{static#e=this.\u0275fac=function(u){return new(u||o)};static#t=this.\u0275mod=_.$C({type:o});static#n=this.\u0275inj=_.G2t({})}return o})(),ov=(()=>{class o{static withConfig(a){return{ngModule:o,providers:[{provide:ns,useValue:a.callSetDisabledState??Zs}]}}static#e=this.\u0275fac=function(u){return new(u||o)};static#t=this.\u0275mod=_.$C({type:o});static#n=this.\u0275inj=_.G2t({imports:[Pp]})}return o})();typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"&&global;var il=function(o){return o.Unimplemented="UNIMPLEMENTED",o.Unavailable="UNAVAILABLE",o}(il||{});class Tu extends Error{constructor(s,a,u){super(s),this.message=s,this.code=a,this.data=u}}const sv=o=>{var s,a,u,m,D;const M=o.CapacitorCustomPlatform||null,N=o.Capacitor||{},B=N.Plugins=N.Plugins||{},K=o.CapacitorPlatforms,Se=(null===(s=K?.currentPlatform)||void 0===s?void 0:s.getPlatform)||(()=>null!==M?M.name:(o=>{var s,a;return o?.androidBridge?"android":null!==(a=null===(s=o?.webkit)||void 0===s?void 0:s.messageHandlers)&&void 0!==a&&a.bridge?"ios":"web"})(o)),ct=(null===(a=K?.currentPlatform)||void 0===a?void 0:a.isNativePlatform)||(()=>"web"!==Se()),ft=(null===(u=K?.currentPlatform)||void 0===u?void 0:u.isPluginAvailable)||(Nt=>{const jt=gn.get(Nt);return!(!jt?.platforms.has(Se())&&!en(Nt))}),en=(null===(m=K?.currentPlatform)||void 0===m?void 0:m.getPluginHeader)||(Nt=>{var jt;return null===(jt=N.PluginHeaders)||void 0===jt?void 0:jt.find(ci=>ci.name===Nt)}),gn=new Map,Fn=(null===(D=K?.currentPlatform)||void 0===D?void 0:D.registerPlugin)||((Nt,jt={})=>{const ci=gn.get(Nt);if(ci)return console.warn(`Capacitor plugin "${Nt}" already registered. Cannot register plugins twice.`),ci.proxy;const Ri=Se(),Ni=en(Nt);let Oi;const ul=function(){var $n=x(function*(){return!Oi&&Ri in jt?Oi=Oi="function"==typeof jt[Ri]?yield jt[Ri]():jt[Ri]:null!==M&&!Oi&&"web"in jt&&(Oi=Oi="function"==typeof jt.web?yield jt.web():jt.web),Oi});return function(){return $n.apply(this,arguments)}}(),dl=$n=>{let Ir;const Do=(...ia)=>{const oa=ul().then(li=>{const sa=(($n,Ir)=>{var Do,ia;if(!Ni){if($n)return null===(ia=$n[Ir])||void 0===ia?void 0:ia.bind($n);throw new Tu(`"${Nt}" plugin is not implemented on ${Ri}`,il.Unimplemented)}{const oa=Ni?.methods.find(li=>Ir===li.name);if(oa)return"promise"===oa.rtype?li=>N.nativePromise(Nt,Ir.toString(),li):(li,sa)=>N.nativeCallback(Nt,Ir.toString(),li,sa);if($n)return null===(Do=$n[Ir])||void 0===Do?void 0:Do.bind($n)}})(li,$n);if(sa){const ku=sa(...ia);return Ir=ku?.remove,ku}throw new Tu(`"${Nt}.${$n}()" is not implemented on ${Ri}`,il.Unimplemented)});return"addListener"===$n&&(oa.remove=x(function*(){return Ir()})),oa};return Do.toString=()=>`${$n.toString()}() { [capacitor code] }`,Object.defineProperty(Do,"name",{value:$n,writable:!1,configurable:!1}),Do},Pu=dl("addListener"),xi=dl("removeListener"),ra=($n,Ir)=>{const Do=Pu({eventName:$n},Ir),ia=function(){var li=x(function*(){const sa=yield Do;xi({eventName:$n,callbackId:sa},Ir)});return function(){return li.apply(this,arguments)}}(),oa=new Promise(li=>Do.then(()=>li({remove:ia})));return oa.remove=x(function*(){console.warn("Using addListener() without 'await' is deprecated."),yield ia()}),oa},Mf=new Proxy({},{get($n,Ir){switch(Ir){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return Ni?ra:Pu;case"removeListener":return xi;default:return dl(Ir)}}});return B[Nt]=Mf,gn.set(Nt,{name:Nt,proxy:Mf,platforms:new Set([...Object.keys(jt),...Ni?[Ri]:[]])}),Mf});return N.convertFileSrc||(N.convertFileSrc=Nt=>Nt),N.getPlatform=Se,N.handleError=Nt=>o.console.error(Nt),N.isNativePlatform=ct,N.isPluginAvailable=ft,N.pluginMethodNoop=(Nt,jt,ci)=>Promise.reject(`${ci} does not have an implementation of "${jt}".`),N.registerPlugin=Fn,N.Exception=Tu,N.DEBUG=!!N.DEBUG,N.isLoggingEnabled=!!N.isLoggingEnabled,N.platform=N.getPlatform(),N.isNative=N.isNativePlatform(),N},rs=(o=>o.Capacitor=sv(o))(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Lp=rs.registerPlugin;class cv{constructor(s){this.listeners={},this.windowListeners={},s&&(console.warn(`Capacitor WebPlugin "${s.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=s)}addListener(s,a){var u=this;this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(a);const D=this.windowListeners[s];D&&!D.registered&&this.addWindowListener(D);const M=function(){var B=x(function*(){return u.removeListener(s,a)});return function(){return B.apply(this,arguments)}}(),N=Promise.resolve({remove:M});return Object.defineProperty(N,"remove",{value:(B=x(function*(){console.warn("Using addListener() without 'await' is deprecated."),yield M()}),function(){return B.apply(this,arguments)})}),N;var B}removeAllListeners(){var s=this;return x(function*(){s.listeners={};for(const a in s.windowListeners)s.removeWindowListener(s.windowListeners[a]);s.windowListeners={}})()}notifyListeners(s,a){const u=this.listeners[s];u&&u.forEach(m=>m(a))}hasListeners(s){return!!this.listeners[s].length}registerWindowListener(s,a){this.windowListeners[a]={registered:!1,windowEventName:s,pluginEventName:a,handler:u=>{this.notifyListeners(a,u)}}}unimplemented(s="not implemented"){return new rs.Exception(s,il.Unimplemented)}unavailable(s="not available"){return new rs.Exception(s,il.Unavailable)}removeListener(s,a){var u=this;return x(function*(){const m=u.listeners[s];if(!m)return;const D=m.indexOf(a);u.listeners[s].splice(D,1),u.listeners[s].length||u.removeWindowListener(u.windowListeners[s])})()}addWindowListener(s){window.addEventListener(s.windowEventName,s.handler),s.registered=!0}removeWindowListener(s){s&&(window.removeEventListener(s.windowEventName,s.handler),s.registered=!1)}}const Up=o=>encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Vp=o=>o.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class lv extends cv{getCookies(){return x(function*(){const s=document.cookie,a={};return s.split(";").forEach(u=>{if(u.length<=0)return;let[m,D]=u.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");m=Vp(m).trim(),D=Vp(D).trim(),a[m]=D}),a})()}setCookie(s){return x(function*(){try{const a=Up(s.key),u=Up(s.value),m=`; expires=${(s.expires||"").replace("expires=","")}`,D=(s.path||"/").replace("path=",""),M=null!=s.url&&s.url.length>0?`domain=${s.url}`:"";document.cookie=`${a}=${u||""}${m}; path=${D}; ${M};`}catch(a){return Promise.reject(a)}})()}deleteCookie(s){return x(function*(){try{document.cookie=`${s.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}})()}clearCookies(){return x(function*(){try{const s=document.cookie.split(";")||[];for(const a of s)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${(new Date).toUTCString()};path=/`)}catch(s){return Promise.reject(s)}})()}clearAllCookies(){var s=this;return x(function*(){try{yield s.clearCookies()}catch(a){return Promise.reject(a)}})()}}Lp("CapacitorCookies",{web:()=>new lv});const sw=function(){var o=x(function*(s){return new Promise((a,u)=>{const m=new FileReader;m.onload=()=>{const D=m.result;a(D.indexOf(",")>=0?D.split(",")[1]:D)},m.onerror=D=>u(D),m.readAsDataURL(s)})});return function(a){return o.apply(this,arguments)}}();class Sf extends cv{request(s){return x(function*(){const a=((o,s={})=>{const a=Object.assign({method:o.method||"GET",headers:o.headers},s),m=((o={})=>{const s=Object.keys(o);return Object.keys(o).map(m=>m.toLocaleLowerCase()).reduce((m,D,M)=>(m[D]=o[s[M]],m),{})})(o.headers)["content-type"]||"";if("string"==typeof o.data)a.body=o.data;else if(m.includes("application/x-www-form-urlencoded")){const D=new URLSearchParams;for(const[M,N]of Object.entries(o.data||{}))D.set(M,N);a.body=D.toString()}else if(m.includes("multipart/form-data")||o.data instanceof FormData){const D=new FormData;if(o.data instanceof FormData)o.data.forEach((N,B)=>{D.append(B,N)});else for(const N of Object.keys(o.data))D.append(N,o.data[N]);a.body=D;const M=new Headers(a.headers);M.delete("content-type"),a.headers=M}else(m.includes("application/json")||"object"==typeof o.data)&&(a.body=JSON.stringify(o.data));return a})(s,s.webFetchExtra),u=((o,s=!0)=>o?Object.entries(o).reduce((u,m)=>{const[D,M]=m;let N,B;return Array.isArray(M)?(B="",M.forEach(K=>{N=s?encodeURIComponent(K):K,B+=`${D}=${N}&`}),B.slice(0,-1)):(N=s?encodeURIComponent(M):M,B=`${D}=${N}`),`${u}&${B}`},"").substr(1):null)(s.params,s.shouldEncodeUrlParams),m=u?`${s.url}?${u}`:s.url,D=yield fetch(m,a),M=D.headers.get("content-type")||"";let B,K,{responseType:N="text"}=D.ok?s:{};switch(M.includes("application/json")&&(N="json"),N){case"arraybuffer":case"blob":K=yield D.blob(),B=yield sw(K);break;case"json":B=yield D.json();break;default:B=yield D.text()}const fe={};return D.headers.forEach((Se,Fe)=>{fe[Fe]=Se}),{data:B,headers:fe,status:D.status,url:D.url}})()}get(s){var a=this;return x(function*(){return a.request(Object.assign(Object.assign({},s),{method:"GET"}))})()}post(s){var a=this;return x(function*(){return a.request(Object.assign(Object.assign({},s),{method:"POST"}))})()}put(s){var a=this;return x(function*(){return a.request(Object.assign(Object.assign({},s),{method:"PUT"}))})()}patch(s){var a=this;return x(function*(){return a.request(Object.assign(Object.assign({},s),{method:"PATCH"}))})()}delete(s){var a=this;return x(function*(){return a.request(Object.assign(Object.assign({},s),{method:"DELETE"}))})()}}Lp("CapacitorHttp",{web:()=>new Sf});const is='\n .flex {\n flex: 1;\n }\n\n .hidden {\n display: none !important;\n }\n\n .row {\n display: flex;\n flex-direction: row;\n }\n\n .column {\n display: flex;\n flex-direction: column;\n }\n\n .card {\n border: 1px solid rgba(0, 0, 0, 0.12);\n border-radius: 4px;\n background-color: white;\n margin: 12px 6px;\n }\n\n .card .card-status {\n display: block;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n margin-left: 8px;\n background-color: #f2f2f2;\n }\n .card .card-status.error {\n background-color: #ef5350;\n }\n .card .card-status.success {\n background-color: #66bb6a;\n }\n\n .card .card-title {\n padding: 16px;\n font-size: 20px;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.87);\n align-items: center;\n }\n\n .card .box {\n height: 200px;\n border-top: 1px solid lightgray;\n word-break: break-all;\n overflow: auto;\n background-color: #f2f2f2;\n padding: 12px;\n }\n .card .box pre {\n margin: 0;\n }\n\n .card .card-actions {\n padding: 0 14px 8px 14px;\n min-height: 50px;\n }\n .card .card-actions .input {\n display: flex;\n align-items: center;\n }\n .card .card-actions .input:not(:last-child) {\n margin-bottom: 8px;\n }\n .card .card-actions .input label {\n width: 125px;\n text-align: right;\n margin-right: 14px;\n }\n .card .card-actions .input input {\n padding: 4px;\n }\n\n .json-key {\n color: rgb(124, 77, 255);\n }\n\n .json-value {\n color: rgb(67, 122, 237);\n }\n\n .json-string {\n color: rgb(83, 160, 83);\n }\n\n .json-date {\n color: rgb(200, 56, 198);\n }\n\n input {\n color: #5e35b1;\n padding: 10px;\n border: 1px solid #0000001f;\n border-radius: 4px;\n font-size: 14px;\n }\n\n input:invalid {\n border-color: #f44336;\n }\n\n input[type="checkbox"] {\n margin-right: 10px;\n }\n\n select {\n color: #5e35b1;\n padding: 8px 6px;\n border: 1px solid #0000001f;\n border-radius: 4px;\n }\n\n @media only screen and (max-width: 600px) {\n :host {\n padding: 0 !important;\n padding-bottom: 24px !important;\n }\n\n :host .card {\n border-left: 0;\n border-right: 0;\n border-radius: 0;\n margin: 0;\n margin-bottom: 6px;\n }\n }\n',ta=(o,s=[])=>o?JSON.stringify(o,null,2).replace(/&/g,"&").replace(/\\"/g,""").replace(//g,">").replace(/^( *)("[\w-]+": )?("[^"]*"|[\w.+-]*)?([,[{])?$/gm,(m,D,M,N,B)=>{let K=D||"";const fe=M?M.replace(/[": ]/g,""):void 0;if(fe&&(K+=`${fe}: `),N&&(K+=`${N}`,fe&&s.includes(fe))){const Se=new Date(1e3*Number(N)),Fe=`${Se.toDateString()}, ${Se.toLocaleTimeString()}`;Fe&&(K+=` (${Fe})`)}return K+(B||"")}):"",nc=document.createElement("template");nc.innerHTML=`\n \n\n
\n
\n\n \n \n \n \n \n \n \n \n\n
\n \u{1f6e1}\ufe0fDemo app { }\n
\u{1f448} choose an implementation
\n
\n\n
\n \n \n \n
\n\n
\n
\n`;class Au extends HTMLElement{constructor(){super(),this.listeners=[],this.attachShadow({mode:"open"}),this.shadowRoot?.appendChild(document.importNode(nc.content,!0)),this.implSelectEl=this.shadowRoot.querySelector("#implementation-select"),this.statusEl=this.shadowRoot.querySelector(".status"),this.versionEl=this.shadowRoot.querySelector(".version"),this.loginButtonEl=this.shadowRoot.querySelector("#login-button"),this.logoutButtonEl=this.shadowRoot.querySelector("#logout-button"),this.silentRenewButtonEl=this.shadowRoot.querySelector("#silent-renew-button")}set isRenewing(s){this.statusEl&&this.statusEl.classList[s?"add":"remove"]("loading")}set isAuthenticated(s){this.statusEl&&null!==s&&(this.statusEl.classList.remove("loading"),this.statusEl.title=s?"Authenticated":"Not authenticated",this.statusEl.classList[s?"add":"remove"]("authenticated"),this.statusEl.classList[s?"remove":"add"]("not-authenticated"))}connectedCallback(){if(window.location.href.includes(":4200")){const a=document.createElement("option");a.textContent="localhost",this.implSelectEl.appendChild(a)}else{window.appSettings.getImplementations().forEach(u=>{const m=document.createElement("option");m.value=String(u.label),m.textContent=u.label,this.implSelectEl.appendChild(m)});const a=()=>{window.location.href=window.appSettings.getImplementations()[this.implSelectEl.selectedIndex].demoUrl};this.implSelectEl.addEventListener("change",a),this.listeners.push(()=>this.implSelectEl.removeEventListener("change",a))}const s=()=>{this.shadowRoot?.querySelector("header .title .tip")?.remove(),window.appSettings.setShowTip(!1)};window.appSettings.get().showTip?(this.implSelectEl.addEventListener("click",s,{once:!0}),this.listeners.push(()=>this.implSelectEl.removeEventListener("click",s))):s(),this.refreshImplementation(),this.addEventListeners()}disconnectedCallback(){this.listeners.forEach(s=>s())}addEventListeners(){const s=()=>this.dispatchEvent(new Event("login",{bubbles:!0,composed:!0}));this.loginButtonEl?.addEventListener("click",s);const a=()=>this.dispatchEvent(new Event("logout",{bubbles:!0,composed:!0}));this.logoutButtonEl?.addEventListener("click",a);const u=()=>this.dispatchEvent(new Event("silentRenew",{bubbles:!0,composed:!0}));this.silentRenewButtonEl?.addEventListener("click",u),this.listeners.push(()=>this.loginButtonEl?.removeEventListener("click",s),()=>this.logoutButtonEl?.removeEventListener("click",a),()=>this.silentRenewButtonEl?.removeEventListener("click",u))}refreshImplementation(){const s=window.appSettings.getImplementations();if(window.location.href.includes(":4200"))this.implSelectEl.selectedIndex=0,this.versionEl.innerHTML="@localhost";else{const a=s.findIndex(m=>window.location.href.includes(m.demoUrl)),u=-1!==a?s[a]:s[0];this.implSelectEl.selectedIndex=-1!==a?a:0,this.versionEl.innerHTML=u.version}}}window.customElements.define("demo-app-header",Au);const na=document.createElement("template");na.innerHTML=`\n \n\n \n \n
\n \n
\n`;class If extends HTMLElement{constructor(){super(),this.listeners=[],this.tabs=[],this.views=[],this.currentTabIndex=-1,this.attachShadow({mode:"open"}),this.shadowRoot?.appendChild(document.importNode(na.content,!0)),this.tabsContentEl=this.shadowRoot.querySelector(".tabs-content"),this.demoAppHeaderEl=this.shadowRoot.querySelector("demo-app-header")}set isRenewing(s){this.demoAppHeaderEl.isRenewing=s}set isAuthenticated(s){this.demoAppHeaderEl.isAuthenticated=s}connectedCallback(){this.drawTabs(),this.showView(window.appSettings?window.appSettings.get().currentTabIndex:0)}disconnectedCallback(){this.listeners.forEach(s=>s())}drawTabs(){const s=this.shadowRoot.querySelector("#views"),a=this.shadowRoot.querySelector("#tabs");s&&a&&(this.views=s.assignedElements(),this.views.forEach((u,m)=>{u.style.display="none";const D=document.createElement("a");D.textContent=u.getAttribute("tabLabel")||"?";const M=()=>this.showView(m);D.addEventListener("click",M),this.listeners.push(()=>D.removeEventListener("click",M)),a.appendChild(D),this.tabs.push(D)}))}showView(s){this.currentTabIndex!==s&&(this.currentTabIndex=s,this.tabs.forEach((a,u)=>{a.classList[u!==s?"remove":"add"]("selected")}),this.views.forEach((a,u)=>{a.style.display=u!==s?"none":"flex"}),this.tabsContentEl?.scrollTo(0,0),window.appSettings.setCurrentTabIndex(s))}}window.customElements.define("demo-app-main",If);const sl=document.createElement("template");sl.innerHTML=`\n \n\n
\n
\n APIs access\n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n
\n \n
\n            
\n
\n
\n\n \n`;class al extends HTMLElement{constructor(){super(),this.listeners=[],this.attachShadow({mode:"open"}),this.shadowRoot?.appendChild(document.importNode(sl.content,!0)),this.apiStatusEl=this.shadowRoot.querySelector("#api-status"),this.apiResponseEl=this.shadowRoot.querySelector("#api-response"),this.apiUrlEl=this.shadowRoot.querySelector("#api-url-input"),this.apiHeadersEl=this.shadowRoot.querySelector("#api-headers-input")}connectedCallback(){const s=this.shadowRoot?.querySelector("#api-get-button"),a=()=>{const M=new CustomEvent("api",{bubbles:!0,composed:!0,detail:{url:this.apiUrlEl.value,headers:this.apiHeadersEl.value}});return this.dispatchEvent(M)};s?.addEventListener("click",a);const u=()=>this.saveSettings({privateApiUrl:this.apiUrlEl.value});this.apiUrlEl?.addEventListener("input",u);const m=()=>this.saveSettings({privateApiHeaders:this.apiHeadersEl.value});this.apiHeadersEl?.addEventListener("input",m),this.listeners.push(()=>s?.removeEventListener("click",a),()=>this.apiUrlEl?.removeEventListener("input",u),()=>this.apiHeadersEl?.removeEventListener("input",m));const{otherSettings:D}=window.appSettings.getCurrentUserSettings();this.apiUrlEl.value=D?.privateApiUrl,this.apiHeadersEl.value=D?.privateApiHeaders}disconnectedCallback(){this.listeners.forEach(s=>s())}setApiStatus(s,a){this.apiStatusEl.classList.remove(a?"success":"error"),this.apiStatusEl.classList.add(a?"error":"success"),this.apiResponseEl.innerHTML=ta(s)}saveSettings(s){const a=window.appSettings.getCurrentUserSettings();a.otherSettings={...a.otherSettings,...s},window.appSettings.addOrUpdateUserSettings(a)}}window.customElements.define("demo-app-playground",al);const Ru=document.createElement("template");Ru.innerHTML=`\n \n\n
\n
\n
Authenticated
\n \n
\n            
\n
\n\n
\n
User session
\n \n
\n            
\n
\n\n
\n
Access token
\n \n
\n                
\n            
\n
\n\n
\n
Id token
\n \n
\n                
\n            
\n
\n\n
\n
User profile
\n \n
\n            
\n
\n
\n`;class aw extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot?.appendChild(document.importNode(Ru.content,!0)),this.isAuthenticated=!1,this.userSession=void 0,this.accessToken=void 0,this.accessTokenDecoded=void 0,this.idToken=void 0,this.idTokenDecoded=void 0,this.userProfile=void 0}set isAuthenticated(s){null!==s&&this.update("#isAuthenticated",s)}set userSession(s){this.update("#userSession",ta(s,["expires_at"]))}set accessToken(s){this.update("#accessToken",s)}set accessTokenDecoded(s){const a="string"!=typeof s?ta(s,["exp","iat","auth_time"]):"(no decoded info as it is not a JWT token)";this.update("#accessTokenDecoded",a)}set idToken(s){this.update("#idToken",s)}set idTokenDecoded(s){this.update("#idTokenDecoded",ta(s,["exp","iat","auth_time"]))}set userProfile(s){this.update("#userProfile",ta(s))}update(s,a){const u=this.shadowRoot?.querySelector(s);u&&(null==a||""===a?u.closest(".info")?.classList.add("hidden"):(u.closest(".info")?.classList.remove("hidden"),u.innerHTML=String(a)))}}window.customElements.define("demo-app-debug",aw);const Nu=document.createElement("template");Nu.innerHTML=`\n \n\n
\n \n
\n \n
\n
\n\n \n\n
\n
\n DELETE\n
\n
\n \n \n
\n
\n
\n`;class cl extends HTMLElement{constructor(){super(),this.listeners=[],this.formIsDirty=!1,this.formIsNew=!1,this.attachShadow({mode:"open"}),this.shadowRoot?.appendChild(document.importNode(Nu.content,!0))}connectedCallback(){this.formEl=this.shadowRoot.querySelector("form"),this.formContentEl=this.shadowRoot.querySelector(".form-content"),this.selectEl=this.shadowRoot.querySelector("#settings-select"),this.settingsNameEl=this.shadowRoot.querySelector("#settingsName");const s=Se=>{!this.formIsDirty&&"settings-select"!==Se.target.id&&(this.formIsDirty=!0,this.classList.add("dirty"))};this.formEl.addEventListener("input",s),this.listeners.push(()=>this.formEl.removeEventListener("input",s)),this.refreshSelect();const a=()=>this.loadSettings(this.selectEl.value);this.selectEl?.addEventListener("change",a),this.listeners.push(()=>this.selectEl.removeEventListener("change",a));const u=this.shadowRoot?.querySelector("#add-settings-button"),m=()=>this.add();u?.addEventListener("click",m),this.listeners.push(()=>u?.removeEventListener("click",m));const D=this.shadowRoot?.querySelector("#delete-settings-button"),M=()=>this.delete();D?.addEventListener("click",M),this.listeners.push(()=>D?.removeEventListener("click",M));const N=this.shadowRoot?.querySelector("#save-settings-button"),B=()=>this.saveAndReload();N?.addEventListener("click",B),this.listeners.push(()=>N?.removeEventListener("click",B));const K=this.shadowRoot?.querySelector("#cancel-settings-button"),fe=()=>this.cancel();K?.addEventListener("click",fe),this.listeners.push(()=>K?.removeEventListener("click",fe)),this.refreshFormContent(window.appSettings.getCurrentUserSettings())}disconnectedCallback(){this.listeners.forEach(s=>s())}loadSettings(s){window.appSettings.setCurrentUserSettings(s),location.reload()}add(){const s="New settings",a=document.createElement("option");a.selected=!0,a.value=s,a.textContent=s,this.selectEl.appendChild(a),this.formIsNew=!0,this.formIsDirty=!0,this.classList.add("dirty"),this.refreshFormContent({name:s,librarySettings:{}})}delete(){window.appSettings.deleteCurrentUserSettings(),location.reload()}cancel(){this.formIsNew=!1,this.formIsDirty=!1,this.classList.remove("dirty"),this.refreshSelect(),this.refreshFormContent(window.appSettings.getCurrentUserSettings())}setPathValue(s,a,u){const m=a.split(".");m.reduce((D,M,N)=>(N===m.length-1?D[M]=u:Object.prototype.hasOwnProperty.call(D,M)||(D[M]={}),D[M]),s)}getPathValue(s,a){return a.split(".").reduce((u,m)=>u&&u[m],s)}refreshSelect(){this.selectEl.innerHTML="";const{userSettings:s,currentUserSettingsId:a}=window.appSettings.get();s.sort((u,m)=>u.name.localeCompare(m.name)).forEach(u=>{const m=document.createElement("option");m.selected=u.name===a,m.value=String(u.name),m.textContent=u.name,this.selectEl.appendChild(m)})}refreshFormContent(s){this.formContentEl.innerHTML="";const{librarySettingsDefinition:a}=window.appSettings.get(),{name:u,librarySettings:m}=s;this.settingsNameEl.value=u,a.sort((D,M)=>(M._sortIndex||0)-(D._sortIndex||0)).forEach(D=>{const M=document.createElement("div");this.formContentEl.prepend(M);const N=document.createElement("label");N.htmlFor=D.name.replace(".",""),N.textContent=`${D.label}${D.required?" *":""}`;const B=document.createElement("list"===D.type?"select":"input");switch(B.id=D.name.replace(".",""),B.name=D.name.replace(".",""),B.required=!0===D.required,D.type){case"boolean":B.checked=this.getPathValue(m,D.name),B.type="checkbox",M.appendChild(B),M.appendChild(N);break;case"list":D.values?.forEach(K=>{const fe=document.createElement("option");fe.value=String(K.value),fe.textContent=K.label,B.appendChild(fe)}),B.value=this.getPathValue(m,D.name),B.classList.add("flex"),M.classList.add("input","column"),M.appendChild(N),M.appendChild(B);break;default:{const K=this.getPathValue(m,D.name);B.value="json"===D.type?K?JSON.stringify(K):"":K??"",M.classList.add("input","column"),M.appendChild(N),M.appendChild(B);break}}})}saveAndReload(){if(this.formEl.reportValidity()){const{librarySettingsDefinition:s}=window.appSettings.get(),a=this.formIsNew?{name:"",librarySettings:{}}:window.appSettings.getCurrentUserSettings();a.name=this.settingsNameEl.value,s.forEach(u=>{const m=this.shadowRoot?.querySelector(`#${u.name.replace(".","")}`);let D;switch(u.type){case"boolean":D=m.checked;break;case"list":default:D=m.value;break;case"json":try{const M=m.value;M&&""!==M.trim()&&(D=JSON.parse(M))}catch(M){console.error(M)}}this.setPathValue(a.librarySettings,u.name,D)}),window.appSettings.addOrUpdateUserSettings(a),this.formIsNew&&window.appSettings.setCurrentUserSettings(a.name),location.reload()}}}window.customElements.define("demo-app-settings",cl);const jp=JSON.parse('{"UU":"@badisi/auth-js","TB":"https://github.com/Badisi/auth-js/tree/main/projects/auth-js"}'),Ou=JSON.parse('{"UU":"@badisi/ngx-auth","rE":"0.0.0-semantically-released","TB":"https://github.com/Badisi/auth-js/tree/main/projects/ngx-auth"}'),xu=[{name:"authorityUrl",label:"Authority url",type:"string",required:!0},{name:"clientId",label:"Client id",type:"string",required:!0},{name:"mobileScheme",label:"Custom mobile scheme name",type:"string"},{name:"scope",label:"Scope",type:"string"},{name:"internal.extraQueryParams",label:"Extra query params",type:"json"},{name:"desktopNavigationType",label:"Desktop navigation type",type:"list",values:[{label:"REDIRECT",value:Sr.REDIRECT},{label:"POPUP",value:Sr.POPUP}]},{name:"logLevel",label:"Log level",type:"list",values:[{label:"NONE",value:wt.NONE},{label:"ERROR",value:wt.ERROR},{label:"WARN",value:wt.WARN},{label:"INFO",value:wt.INFO},{label:"DEBUG",value:wt.DEBUG}]},{name:"loginRequired",label:"Login required",type:"boolean"},{name:"retrieveUserSession",label:"Retrieve user's session",type:"boolean"},{name:"loadUserInfo",label:"Load user's info",type:"boolean"},{name:"automaticSilentRenew",label:"Automatic silent renew",type:"boolean"},{name:"automaticLoginOn401",label:"Automatic login on 401",type:"boolean"},{name:"automaticInjectToken",label:"Automatic inject token",type:"boolean"}];xu.splice(3,0,{name:"authGuardRedirectUrl",label:"AuthGuard redirect url",type:"string"});const Bp=xu,ll=["demoAppPlayground"],Hp=["queryParamsInput"],uw=[{path:"",children:[{path:"",component:(()=>{class o{constructor(){this.router=(0,_.WQX)(zr.Ix),this.authService=(0,_.WQX)(lu),this.httpClient=(0,_.WQX)(Ve)}ngAfterViewInit(){setTimeout(()=>{const a=window.appSettings.getCurrentUserSettings().otherSettings;if(this.roles=a?.roles,this.queryParams=a?.queryParams,this.queryParams){let u="";Object.entries(this.queryParams).forEach(([m,D],M)=>{M>0&&(u+="&"),u+=`${m}=${D}`}),this.queryParamsInputEl.nativeElement.value=u}})}callPrivateApi(a){const{url:u,headers:m}=a.detail;if(u){let D=new Ue;m?.split(";").forEach(N=>{if(N){const B=N.split(":");D=D.append(B[0]?.trim(),B[1]?.trim()||"")}});const M=this.demoAppPlaygroundEl?.nativeElement;this.httpClient.get(u,m?{headers:D}:{}).subscribe({next:N=>M?.setApiStatus(N,!1),error:N=>M?.setApiStatus(N,!0)})}}saveSettings(){(this.demoAppPlaygroundEl?.nativeElement).saveSettings({roles:this.roles,queryParams:this.queryParams})}onQueryParamsInputChange(a){const u={};a?.split("&").forEach(m=>{const D=m.split("=");2===D.length&&(u[D[0]]=D[1])}),this.queryParams=u,this.saveSettings()}static#e=this.\u0275fac=function(u){return new(u||o)};static#t=this.\u0275cmp=_.VBU({type:o,selectors:[["app-demo"]],viewQuery:function(u,m){if(1&u&&(_.GBs(ll,5),_.GBs(Hp,5)),2&u){let D;_.mGM(D=_.lsd())&&(m.demoAppPlaygroundEl=D.first),_.mGM(D=_.lsd())&&(m.queryParamsInputEl=D.first)}},standalone:!0,features:[_.aNF],decls:48,vars:32,consts:[["demoAppPlayground",""],["queryParamsInput",""],[3,"login","logout","silentRenew","isRenewing","isAuthenticated"],["tabLabel","Playground",3,"api"],[1,"card","routes"],[1,"card-title"],[1,"card-actions","column"],[1,"route","query-params"],[1,"info"],["placeholder","param1=one¶m2=two",3,"input"],[1,"route"],["routerLink","/",3,"queryParams"],["routerLink","/public",3,"queryParams"],["routerLink","/private",3,"queryParams"],["routerLink","/protected",3,"queryParams"],["id","roles-input",3,"input","keydown.enter","ngModelChange","ngModel"],[1,"box"],["tabLabel","Debug",3,"isAuthenticated","userProfile","userSession","idToken","idTokenDecoded","accessToken","accessTokenDecoded"],["tabLabel","Settings"]],template:function(u,m){if(1&u){const D=_.RV6();_.j41(0,"demo-app-main",2),_.nI1(1,"async"),_.nI1(2,"async"),_.bIt("login",function(){return _.eBV(D),_.Njj(m.authService.login())})("logout",function(){return _.eBV(D),_.Njj(m.authService.logout({redirectUrl:"/"}))})("silentRenew",function(){return _.eBV(D),_.Njj(m.authService.renew())}),_.j41(3,"demo-app-playground",3,0),_.bIt("api",function(N){return _.eBV(D),_.Njj(m.callPrivateApi(N))}),_.j41(5,"div",4)(6,"div",5),_.EFF(7,"Routes access"),_.k0s(),_.j41(8,"div",6)(9,"div",7)(10,"div",8)(11,"label"),_.EFF(12,"Query params"),_.k0s(),_.j41(13,"input",9,1),_.bIt("input",function(){_.eBV(D);const N=_.sdS(14);return _.Njj(m.onQueryParamsInputChange(N.value))}),_.k0s()()(),_.j41(15,"div",10)(16,"button",11),_.EFF(17,"HOME"),_.k0s(),_.j41(18,"div",8),_.EFF(19,"Home page"),_.k0s()(),_.j41(20,"div",10)(21,"button",12),_.EFF(22,"PUBLIC"),_.k0s(),_.j41(23,"div",8),_.EFF(24,"Public content (no login required)"),_.k0s()(),_.j41(25,"div",10)(26,"button",13),_.EFF(27,"PRIVATE"),_.k0s(),_.j41(28,"div",8),_.EFF(29,"Private content (login required)"),_.k0s()(),_.j41(30,"div",10)(31,"button",14),_.EFF(32,"PROTECTED"),_.k0s(),_.j41(33,"div",8),_.EFF(34,"Protected content (login required + role(s): "),_.j41(35,"input",15),_.bIt("input",function(){return _.eBV(D),_.Njj(m.saveSettings())})("keydown.enter",function(){return _.eBV(D),_.Njj(m.router.navigateByUrl("/protected"))}),_.mxI("ngModelChange",function(N){return _.eBV(D),_.DH7(m.roles,N)||(m.roles=N),_.Njj(N)}),_.k0s(),_.EFF(36,") "),_.k0s()()(),_.j41(37,"div",16),_.nrm(38,"router-outlet"),_.k0s()()(),_.nrm(39,"demo-app-debug",17),_.nI1(40,"async"),_.nI1(41,"async"),_.nI1(42,"async"),_.nI1(43,"async"),_.nI1(44,"async"),_.nI1(45,"async"),_.nI1(46,"async"),_.nrm(47,"demo-app-settings",18),_.k0s()}2&u&&(_.Y8G("isRenewing",_.bMT(1,14,m.authService.isRenewing$))("isAuthenticated",_.bMT(2,16,m.authService.isAuthenticated$)),_.R7$(16),_.Y8G("queryParams",m.queryParams),_.R7$(5),_.Y8G("queryParams",m.queryParams),_.R7$(5),_.Y8G("queryParams",m.queryParams),_.R7$(5),_.Y8G("queryParams",m.queryParams),_.R7$(4),_.R50("ngModel",m.roles),_.R7$(4),_.Y8G("isAuthenticated",_.bMT(40,18,m.authService.isAuthenticated$))("userProfile",_.bMT(41,20,m.authService.userProfile$))("userSession",_.bMT(42,22,m.authService.userSession$))("idToken",_.bMT(43,24,m.authService.idToken$))("idTokenDecoded",_.bMT(44,26,m.authService.idTokenDecoded$))("accessToken",_.bMT(45,28,m.authService.accessToken$))("accessTokenDecoded",_.bMT(46,30,m.authService.accessTokenDecoded$)))},dependencies:[Ie.Jj,ov,uu,dp,Du,zr.n3,zr.Wk],styles:[":host .card.routes{margin-top:20px}:host .card.routes .route{display:flex;align-items:center}:host .card.routes .route.query-params{margin:0 0 10px 10px}:host .card.routes .route.query-params label{font-size:16px;color:#000;margin-right:12px}:host .card.routes .route.query-params input{width:500px}:host .card.routes .route button{padding:2px 10px;min-width:104px;margin:8px 12px 8px 8px}:host .card.routes .route input{margin:0 2px;padding:4px}:host .card.routes .route .info{padding-bottom:2px;font-size:14px;line-height:22px;text-align:left;color:#0000008a}:host .card.routes .box{height:100px}@media only screen and (max-width: 600px){:host .card.routes{margin-top:12px}:host .card.routes .route{margin-left:3px!important}:host .card.routes .route.query-params .info{display:flex;flex-direction:column;flex:1;gap:8px}:host .card.routes .route.query-params .info input{margin:0;width:inherit;align-self:normal}:host .card.routes .route #roles-input{width:90%}:host .card.routes .route button{margin-left:3px}}\n",".flex{flex:1}.hidden{display:none!important}.row{display:flex;flex-direction:row}.column{display:flex;flex-direction:column}.card{border:1px solid rgba(0,0,0,.12);border-radius:4px;background-color:#fff;margin:12px 6px}.card .card-status{display:block;width:10px;height:10px;border-radius:50%;margin-left:8px;background-color:#f2f2f2}.card .card-status.error{background-color:#ef5350}.card .card-status.success{background-color:#66bb6a}.card .card-title{padding:16px;font-size:20px;font-weight:500;color:#000000de;align-items:center}.card .box{height:200px;border-top:1px solid lightgray;word-break:break-all;overflow:auto;background-color:#f2f2f2;padding:12px}.card .box pre{margin:0}.card .card-actions{padding:0 14px 8px;min-height:50px}.card .card-actions .input{display:flex;align-items:center}.card .card-actions .input:not(:last-child){margin-bottom:8px}.card .card-actions .input label{width:125px;text-align:right;margin-right:14px}.card .card-actions .input input{padding:4px}.json-key{color:#7c4dff}.json-value{color:#437aed}.json-string{color:#53a053}.json-date{color:#c838c6}input{color:#5e35b1;padding:10px;border:1px solid rgba(0,0,0,.1215686275);border-radius:4px;font-size:14px}input:invalid{border-color:#f44336}input[type=checkbox]{margin-right:10px}select{color:#5e35b1;padding:8px 6px;border:1px solid rgba(0,0,0,.1215686275);border-radius:4px}@media only screen and (max-width: 600px){:host{padding:0 0 24px!important}:host .card{border-left:0;border-right:0;border-radius:0;margin:0 0 6px}}\n"],encapsulation:3})}return o})(),children:[{path:"public",loadComponent:()=>O.e(998).then(O.bind(O,1998)).then(o=>o.PageComponent),runGuardsAndResolvers:"always",data:{title:"PUBLIC CONTENT"}},{path:"private",loadComponent:()=>O.e(998).then(O.bind(O,1998)).then(o=>o.PageComponent),runGuardsAndResolvers:"always",canLoad:[Ka],canActivate:[Ka],canActivateChild:[Ka],data:{title:"PRIVATE CONTENT"}},{path:"forbidden",loadComponent:()=>O.e(998).then(O.bind(O,1998)).then(o=>o.PageComponent),runGuardsAndResolvers:"always",data:{title:"ACCESS FORBIDDEN"}},{path:"protected",loadComponent:()=>O.e(998).then(O.bind(O,1998)).then(o=>o.PageComponent),runGuardsAndResolvers:"always",canLoad:[Ka],canActivate:[Ka],canActivateChild:[Ka],data:{title:"PROTECTED CONTENT",authGuardValidator:(o,s)=>{const{otherSettings:a,librarySettings:u}=window.appSettings.getCurrentUserSettings(),m=a&&a.roles?.split(",")||[];let D;if(u.authorityUrl.includes("auth0"))D=s?.["http://ngx-auth.com/roles"];else if(u.authorityUrl.includes("zitadel")){const M=s?.["urn:zitadel:iam:org:project:roles"];D=Object.keys(M??{})}else D=s.resource_access?.account?.roles;return m.every(M=>(D??[]).includes(M))}}}]}]},{path:"**",pathMatch:"full",redirectTo:""}],rc={providers:[Ye(),(0,zr.lh)(uw,(0,zr.Ii)({onSameUrlNavigation:"reload"}))]},Gp=new class dv{constructor(s,a){this.storageKey=s,this.defaultAppSettings=a,this.implementations=[{label:"VanillaJS",demoUrl:"https://badisi.github.io/auth-js/demo-app/auth-js",version:`${jp.UU}@main`},{label:"Angular",demoUrl:"https://badisi.github.io/auth-js/demo-app/ngx-auth",version:`${Ou.UU}@main`}],this.defaultAppSettings.librarySettingsDefinition.forEach((u,m)=>u._sortIndex=m)}getImplementations(){return this.implementations}setShowTip(s){const a=this.get();a.showTip=s,this.saveAppSettings(a)}setCurrentTabIndex(s){const a=this.get();a.currentTabIndex=s,this.saveAppSettings(a)}addOrUpdateUserSettings(s){const a=this.get(),u=a.userSettings.findIndex(m=>m.name===s.name);-1!==u?a.userSettings[u]=s:a.userSettings.push(s),this.saveAppSettings(a)}deleteCurrentUserSettings(){const s=this.get(),{name:a}=this.getCurrentUserSettings(),u=s.userSettings.findIndex(m=>m.name===a);-1!==u&&(s.userSettings.splice(u,1),delete s.currentUserSettingsId,this.saveAppSettings(s))}setCurrentUserSettings(s){const a=this.get();-1!==a.userSettings.findIndex(m=>m.name===s)&&(a.currentUserSettingsId=s,this.saveAppSettings(a))}getCurrentUserSettings(){const s=this.get(),a=s.userSettings.findIndex(u=>u.name===s.currentUserSettingsId);return-1!==a?s.userSettings[a]:s.userSettings.sort((u,m)=>u.name.localeCompare(m.name))[0]}get(){const s=sessionStorage.getItem(this.storageKey);if(s){const a={...this.defaultAppSettings,...JSON.parse(s)};return this.defaultAppSettings.userSettings.forEach(u=>{a.userSettings.find(m=>m.name===u.name)||a.userSettings.push(u)}),a}return{...this.defaultAppSettings}}saveAppSettings(s){delete s.librarySettingsDefinition,sessionStorage.setItem(this.storageKey,JSON.stringify(s))}}(`ngx-auth:${Ou.rE}:demo-app:settings`,{showTip:!0,currentTabIndex:0,userSettings:((o=!1)=>{const s=((o=!1)=>{const s=[{name:"Auth0",otherSettings:{privateApiUrl:"https://dev-fijd1e9x.us.auth0.com/api/v2/users/auth0|631b171682c639d40cb84d5c",privateApiHeaders:""},librarySettings:{authorityUrl:"https://dev-fijd1e9x.us.auth0.com",clientId:"kRVVEnAWKMpxxpcodl0TqLXfIHgQvmmt",mobileScheme:"demo-app",scope:"openid profile email phone offline_access read:current_user",internal:{extraQueryParams:{audience:"https://dev-fijd1e9x.us.auth0.com/api/v2/"}},desktopNavigationType:Sr.REDIRECT,logLevel:wt.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}},{name:"Zitadel",otherSettings:{privateApiUrl:"",privateApiHeaders:""},librarySettings:{authorityUrl:"https://auth-js-0pdipf.zitadel.cloud",clientId:"178200751804317953@demo-app",mobileScheme:"demo-app",scope:"openid profile email phone offline_access",desktopNavigationType:Sr.REDIRECT,logLevel:wt.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}}];return o||s.push({name:"Keycloak (local)",otherSettings:{privateApiUrl:"/api/my-api",privateApiHeaders:""},librarySettings:{authorityUrl:"http://localhost:8080/auth/realms/demo",clientId:"demo-app",mobileScheme:"demo-app",scope:"openid profile email phone",desktopNavigationType:Sr.REDIRECT,logLevel:wt.NONE,loginRequired:!1,retrieveUserSession:!0,loadUserInfo:!0,automaticSilentRenew:!0}}),s})(o),a=[{name:"Auth0",otherSettings:{...s[0].otherSettings,roles:"view-profile"},librarySettings:{...s[0].librarySettings,authGuardRedirectUrl:"/forbidden",automaticLoginOn401:!0,automaticInjectToken:!0}},{name:"Zitadel",otherSettings:{...s[1].otherSettings,roles:"view-profile"},librarySettings:{...s[1].librarySettings,authGuardRedirectUrl:"/forbidden",automaticLoginOn401:!0,automaticInjectToken:!0}}];return o||a.push({name:"Keycloak (local)",otherSettings:{...s[s.length-1].otherSettings,roles:"view-profile"},librarySettings:{...s[s.length-1].librarySettings,authGuardRedirectUrl:"/forbidden",automaticLoginOn401:!0,automaticInjectToken:!0}}),a})(!(0,_.naY)()),librarySettingsDefinition:Bp});(()=>{window.appSettings=Gp;const o=document.createElement("div");o.innerHTML="Loading...",document.body.appendChild(o),ht(Gp.getCurrentUserSettings().librarySettings).then(s=>{o.replaceWith(document.createElement("app-root")),rc.providers.push((o=>(0,_.EmA)([o,Ka,Ye(Ot([ep]))]))(s)),(0,S.B8)(ip,rc).catch(a=>console.error(a))}).catch(s=>{const a=s instanceof Error?s.message:s;o.innerHTML=`${a}
`,document.body.querySelector("#loginButton")?.addEventListener("click",()=>location.reload(),{once:!0})})})()},7656:function($e,he,O){var S;$e.exports=(S=S||function(U){var _;if(typeof window<"u"&&window.crypto&&(_=window.crypto),typeof self<"u"&&self.crypto&&(_=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(_=globalThis.crypto),!_&&typeof window<"u"&&window.msCrypto&&(_=window.msCrypto),!_&&typeof global<"u"&&global.crypto&&(_=global.crypto),!_)try{_=O(477)}catch{}var W=function(){if(_){if("function"==typeof _.getRandomValues)try{return _.getRandomValues(new Uint32Array(1))[0]}catch{}if("function"==typeof _.randomBytes)try{return _.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},oe=Object.create||function(){function ie(){}return function(ve){var ze;return ie.prototype=ve,ze=new ie,ie.prototype=null,ze}}(),_e={},Me=_e.lib={},Ae=Me.Base=function(){return{extend:function(ie){var ve=oe(this);return ie&&ve.mixIn(ie),(!ve.hasOwnProperty("init")||this.init===ve.init)&&(ve.init=function(){ve.$super.init.apply(this,arguments)}),ve.init.prototype=ve,ve.$super=this,ve},create:function(){var ie=this.extend();return ie.init.apply(ie,arguments),ie},init:function(){},mixIn:function(ie){for(var ve in ie)ie.hasOwnProperty(ve)&&(this[ve]=ie[ve]);ie.hasOwnProperty("toString")&&(this.toString=ie.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),Y=Me.WordArray=Ae.extend({init:function(ie,ve){ie=this.words=ie||[],this.sigBytes=null!=ve?ve:4*ie.length},toString:function(ie){return(ie||ae).stringify(this)},concat:function(ie){var ve=this.words,ze=ie.words,ge=this.sigBytes,de=ie.sigBytes;if(this.clamp(),ge%4)for(var be=0;be>>2]|=(ze[be>>>2]>>>24-be%4*8&255)<<24-(ge+be)%4*8;else for(var Pe=0;Pe>>2]=ze[Pe>>>2];return this.sigBytes+=de,this},clamp:function(){var ie=this.words,ve=this.sigBytes;ie[ve>>>2]&=4294967295<<32-ve%4*8,ie.length=U.ceil(ve/4)},clone:function(){var ie=Ae.clone.call(this);return ie.words=this.words.slice(0),ie},random:function(ie){for(var ve=[],ze=0;ze>>2]>>>24-de%4*8&255;ge.push((be>>>4).toString(16)),ge.push((15&be).toString(16))}return ge.join("")},parse:function(ie){for(var ve=ie.length,ze=[],ge=0;ge>>3]|=parseInt(ie.substr(ge,2),16)<<24-ge%8*4;return new Y.init(ze,ve/2)}},Ie=J.Latin1={stringify:function(ie){for(var ve=ie.words,ze=ie.sigBytes,ge=[],de=0;de>>2]>>>24-de%4*8&255));return ge.join("")},parse:function(ie){for(var ve=ie.length,ze=[],ge=0;ge>>2]|=(255&ie.charCodeAt(ge))<<24-ge%4*8;return new Y.init(ze,ve)}},se=J.Utf8={stringify:function(ie){try{return decodeURIComponent(escape(Ie.stringify(ie)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(ie){return Ie.parse(unescape(encodeURIComponent(ie)))}},Oe=Me.BufferedBlockAlgorithm=Ae.extend({reset:function(){this._data=new Y.init,this._nDataBytes=0},_append:function(ie){"string"==typeof ie&&(ie=se.parse(ie)),this._data.concat(ie),this._nDataBytes+=ie.sigBytes},_process:function(ie){var ve,ze=this._data,ge=ze.words,de=ze.sigBytes,be=this.blockSize,Pe=de/(4*be),Te=(Pe=ie?U.ceil(Pe):U.max((0|Pe)-this._minBufferSize,0))*be,Le=U.min(4*Te,de);if(Te){for(var Ke=0;Ke>>2]>>>24-Ie%4*8&255)<<16|(Ae[Ie+1>>>2]>>>24-(Ie+1)%4*8&255)<<8|Ae[Ie+2>>>2]>>>24-(Ie+2)%4*8&255,ie=0;ie<4&&Ie+.75*ie>>6*(3-ie)&63));var ve=J.charAt(64);if(ve)for(;ae.length%4;)ae.push(ve);return ae.join("")},parse:function(Me){var Ae=Me.length,Y=this._map,J=this._reverseMap;if(!J){J=this._reverseMap=[];for(var ae=0;ae>>6-Ie%4*2;J[ae>>>2]|=(se|Oe)<<24-ae%4*8,ae++}return _.create(J,ae)}(Me,Ae,J)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},S.enc.Base64)},627:function($e,he,O){$e.exports=O(7656).enc.Utf8},5168:function($e,he,O){var S;$e.exports=(S=O(7656),function(U){var x=S,_=x.lib,W=_.WordArray,oe=_.Hasher,_e=x.algo,Me=[],Ae=[];!function(){function ae(Ue){for(var Je=U.sqrt(Ue),ie=2;ie<=Je;ie++)if(!(Ue%ie))return!1;return!0}function Ie(Ue){return 4294967296*(Ue-(0|Ue))|0}for(var se=2,Oe=0;Oe<64;)ae(se)&&(Oe<8&&(Me[Oe]=Ie(U.pow(se,.5))),Ae[Oe]=Ie(U.pow(se,1/3)),Oe++),se++}();var Y=[],J=_e.SHA256=oe.extend({_doReset:function(){this._hash=new W.init(Me.slice(0))},_doProcessBlock:function(ae,Ie){for(var se=this._hash.words,Oe=se[0],Ue=se[1],Je=se[2],ie=se[3],ve=se[4],ze=se[5],ge=se[6],de=se[7],be=0;be<64;be++){if(be<16)Y[be]=0|ae[Ie+be];else{var Ge=Y[be-15],Te=Y[be-2];Y[be]=((Ge<<25|Ge>>>7)^(Ge<<14|Ge>>>18)^Ge>>>3)+Y[be-7]+((Te<<15|Te>>>17)^(Te<<13|Te>>>19)^Te>>>10)+Y[be-16]}var Qe=Oe&Ue^Oe&Je^Ue&Je,an=de+((ve<<26|ve>>>6)^(ve<<21|ve>>>11)^(ve<<7|ve>>>25))+(ve&ze^~ve&ge)+Ae[be]+Y[be];de=ge,ge=ze,ze=ve,ve=ie+an|0,ie=Je,Je=Ue,Ue=Oe,Oe=an+(((Oe<<30|Oe>>>2)^(Oe<<19|Oe>>>13)^(Oe<<10|Oe>>>22))+Qe)|0}se[0]=se[0]+Oe|0,se[1]=se[1]+Ue|0,se[2]=se[2]+Je|0,se[3]=se[3]+ie|0,se[4]=se[4]+ve|0,se[5]=se[5]+ze|0,se[6]=se[6]+ge|0,se[7]=se[7]+de|0},_doFinalize:function(){var ae=this._data,Ie=ae.words,se=8*this._nDataBytes,Oe=8*ae.sigBytes;return Ie[Oe>>>5]|=128<<24-Oe%32,Ie[14+(Oe+64>>>9<<4)]=U.floor(se/4294967296),Ie[15+(Oe+64>>>9<<4)]=se,ae.sigBytes=4*Ie.length,this._process(),this._hash},clone:function(){var ae=oe.clone.call(this);return ae._hash=this._hash.clone(),ae}});x.SHA256=oe._createHelper(J),x.HmacSHA256=oe._createHmacHelper(J)}(Math),S.SHA256)},4412:($e,he,O)=>{"use strict";O.d(he,{t:()=>U});var S=O(1413);class U extends S.B{constructor(_){super(),this._value=_}get value(){return this.getValue()}_subscribe(_){const W=super._subscribe(_);return!W.closed&&_.next(this._value),W}getValue(){const{hasError:_,thrownError:W,_value:oe}=this;if(_)throw W;return this._throwIfClosed(),oe}next(_){super.next(this._value=_)}}},1985:($e,he,O)=>{"use strict";O.d(he,{c:()=>Me});var S=O(7707),U=O(8359),x=O(3494),_=O(1203),W=O(1026),oe=O(8071),_e=O(9786);let Me=(()=>{class ae{constructor(se){se&&(this._subscribe=se)}lift(se){const Oe=new ae;return Oe.source=this,Oe.operator=se,Oe}subscribe(se,Oe,Ue){const Je=function J(ae){return ae&&ae instanceof S.vU||function Y(ae){return ae&&(0,oe.T)(ae.next)&&(0,oe.T)(ae.error)&&(0,oe.T)(ae.complete)}(ae)&&(0,U.Uv)(ae)}(se)?se:new S.Ms(se,Oe,Ue);return(0,_e.Y)(()=>{const{operator:ie,source:ve}=this;Je.add(ie?ie.call(Je,ve):ve?this._subscribe(Je):this._trySubscribe(Je))}),Je}_trySubscribe(se){try{return this._subscribe(se)}catch(Oe){se.error(Oe)}}forEach(se,Oe){return new(Oe=Ae(Oe))((Ue,Je)=>{const ie=new S.Ms({next:ve=>{try{se(ve)}catch(ze){Je(ze),ie.unsubscribe()}},error:Je,complete:Ue});this.subscribe(ie)})}_subscribe(se){var Oe;return null===(Oe=this.source)||void 0===Oe?void 0:Oe.subscribe(se)}[x.s](){return this}pipe(...se){return(0,_.m)(se)(this)}toPromise(se){return new(se=Ae(se))((Oe,Ue)=>{let Je;this.subscribe(ie=>Je=ie,ie=>Ue(ie),()=>Oe(Je))})}}return ae.create=Ie=>new ae(Ie),ae})();function Ae(ae){var Ie;return null!==(Ie=ae??W.$.Promise)&&void 0!==Ie?Ie:Promise}},1413:($e,he,O)=>{"use strict";O.d(he,{B:()=>_e});var S=O(1985),U=O(8359);const _=(0,O(1853).L)(Ae=>function(){Ae(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var W=O(7908),oe=O(9786);let _e=(()=>{class Ae extends S.c{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(J){const ae=new Me(this,this);return ae.operator=J,ae}_throwIfClosed(){if(this.closed)throw new _}next(J){(0,oe.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const ae of this.currentObservers)ae.next(J)}})}error(J){(0,oe.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=J;const{observers:ae}=this;for(;ae.length;)ae.shift().error(J)}})}complete(){(0,oe.Y)(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:J}=this;for(;J.length;)J.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var J;return(null===(J=this.observers)||void 0===J?void 0:J.length)>0}_trySubscribe(J){return this._throwIfClosed(),super._trySubscribe(J)}_subscribe(J){return this._throwIfClosed(),this._checkFinalizedStatuses(J),this._innerSubscribe(J)}_innerSubscribe(J){const{hasError:ae,isStopped:Ie,observers:se}=this;return ae||Ie?U.Kn:(this.currentObservers=null,se.push(J),new U.yU(()=>{this.currentObservers=null,(0,W.o)(se,J)}))}_checkFinalizedStatuses(J){const{hasError:ae,thrownError:Ie,isStopped:se}=this;ae?J.error(Ie):se&&J.complete()}asObservable(){const J=new S.c;return J.source=this,J}}return Ae.create=(Y,J)=>new Me(Y,J),Ae})();class Me extends _e{constructor(Y,J){super(),this.destination=Y,this.source=J}next(Y){var J,ae;null===(ae=null===(J=this.destination)||void 0===J?void 0:J.next)||void 0===ae||ae.call(J,Y)}error(Y){var J,ae;null===(ae=null===(J=this.destination)||void 0===J?void 0:J.error)||void 0===ae||ae.call(J,Y)}complete(){var Y,J;null===(J=null===(Y=this.destination)||void 0===Y?void 0:Y.complete)||void 0===J||J.call(Y)}_subscribe(Y){var J,ae;return null!==(ae=null===(J=this.source)||void 0===J?void 0:J.subscribe(Y))&&void 0!==ae?ae:U.Kn}}},7707:($e,he,O)=>{"use strict";O.d(he,{Ms:()=>Ue,vU:()=>ae});var S=O(8071),U=O(8359),x=O(1026),_=O(5334),W=O(5343);const oe=Ae("C",void 0,void 0);function Ae(ge,de,be){return{kind:ge,value:de,error:be}}var Y=O(9270),J=O(9786);class ae extends U.yU{constructor(de){super(),this.isStopped=!1,de?(this.destination=de,(0,U.Uv)(de)&&de.add(this)):this.destination=ze}static create(de,be,Ge){return new Ue(de,be,Ge)}next(de){this.isStopped?ve(function Me(ge){return Ae("N",ge,void 0)}(de),this):this._next(de)}error(de){this.isStopped?ve(function _e(ge){return Ae("E",void 0,ge)}(de),this):(this.isStopped=!0,this._error(de))}complete(){this.isStopped?ve(oe,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(de){this.destination.next(de)}_error(de){try{this.destination.error(de)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Ie=Function.prototype.bind;function se(ge,de){return Ie.call(ge,de)}class Oe{constructor(de){this.partialObserver=de}next(de){const{partialObserver:be}=this;if(be.next)try{be.next(de)}catch(Ge){Je(Ge)}}error(de){const{partialObserver:be}=this;if(be.error)try{be.error(de)}catch(Ge){Je(Ge)}else Je(de)}complete(){const{partialObserver:de}=this;if(de.complete)try{de.complete()}catch(be){Je(be)}}}class Ue extends ae{constructor(de,be,Ge){let Pe;if(super(),(0,S.T)(de)||!de)Pe={next:de??void 0,error:be??void 0,complete:Ge??void 0};else{let Te;this&&x.$.useDeprecatedNextContext?(Te=Object.create(de),Te.unsubscribe=()=>this.unsubscribe(),Pe={next:de.next&&se(de.next,Te),error:de.error&&se(de.error,Te),complete:de.complete&&se(de.complete,Te)}):Pe=de}this.destination=new Oe(Pe)}}function Je(ge){x.$.useDeprecatedSynchronousErrorHandling?(0,J.l)(ge):(0,_.m)(ge)}function ve(ge,de){const{onStoppedNotification:be}=x.$;be&&Y.f.setTimeout(()=>be(ge,de))}const ze={closed:!0,next:W.l,error:function ie(ge){throw ge},complete:W.l}},8359:($e,he,O)=>{"use strict";O.d(he,{Kn:()=>oe,yU:()=>W,Uv:()=>_e});var S=O(8071);const x=(0,O(1853).L)(Ae=>function(J){Ae(this),this.message=J?`${J.length} errors occurred during unsubscription:\n${J.map((ae,Ie)=>`${Ie+1}) ${ae.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=J});var _=O(7908);class W{constructor(Y){this.initialTeardown=Y,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let Y;if(!this.closed){this.closed=!0;const{_parentage:J}=this;if(J)if(this._parentage=null,Array.isArray(J))for(const se of J)se.remove(this);else J.remove(this);const{initialTeardown:ae}=this;if((0,S.T)(ae))try{ae()}catch(se){Y=se instanceof x?se.errors:[se]}const{_finalizers:Ie}=this;if(Ie){this._finalizers=null;for(const se of Ie)try{Me(se)}catch(Oe){Y=Y??[],Oe instanceof x?Y=[...Y,...Oe.errors]:Y.push(Oe)}}if(Y)throw new x(Y)}}add(Y){var J;if(Y&&Y!==this)if(this.closed)Me(Y);else{if(Y instanceof W){if(Y.closed||Y._hasParent(this))return;Y._addParent(this)}(this._finalizers=null!==(J=this._finalizers)&&void 0!==J?J:[]).push(Y)}}_hasParent(Y){const{_parentage:J}=this;return J===Y||Array.isArray(J)&&J.includes(Y)}_addParent(Y){const{_parentage:J}=this;this._parentage=Array.isArray(J)?(J.push(Y),J):J?[J,Y]:Y}_removeParent(Y){const{_parentage:J}=this;J===Y?this._parentage=null:Array.isArray(J)&&(0,_.o)(J,Y)}remove(Y){const{_finalizers:J}=this;J&&(0,_.o)(J,Y),Y instanceof W&&Y._removeParent(this)}}W.EMPTY=(()=>{const Ae=new W;return Ae.closed=!0,Ae})();const oe=W.EMPTY;function _e(Ae){return Ae instanceof W||Ae&&"closed"in Ae&&(0,S.T)(Ae.remove)&&(0,S.T)(Ae.add)&&(0,S.T)(Ae.unsubscribe)}function Me(Ae){(0,S.T)(Ae)?Ae():Ae.unsubscribe()}},1026:($e,he,O)=>{"use strict";O.d(he,{$:()=>S});const S={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},983:($e,he,O)=>{"use strict";O.d(he,{w:()=>U});const U=new(O(1985).c)(W=>W.complete())},6648:($e,he,O)=>{"use strict";O.d(he,{H:()=>Ge});var S=O(8750),U=O(5225),x=O(9974),_=O(4360);function W(Pe,Te=0){return(0,x.N)((Le,Ke)=>{Le.subscribe((0,_._)(Ke,Qe=>(0,U.N)(Ke,Pe,()=>Ke.next(Qe),Te),()=>(0,U.N)(Ke,Pe,()=>Ke.complete(),Te),Qe=>(0,U.N)(Ke,Pe,()=>Ke.error(Qe),Te)))})}function oe(Pe,Te=0){return(0,x.N)((Le,Ke)=>{Ke.add(Pe.schedule(()=>Le.subscribe(Ke),Te))})}var Ae=O(1985),J=O(4761),ae=O(8071);function se(Pe,Te){if(!Pe)throw new Error("Iterable cannot be null");return new Ae.c(Le=>{(0,U.N)(Le,Te,()=>{const Ke=Pe[Symbol.asyncIterator]();(0,U.N)(Le,Te,()=>{Ke.next().then(Qe=>{Qe.done?Le.complete():Le.next(Qe.value)})},0,!0)})})}var Oe=O(5055),Ue=O(9858),Je=O(7441),ie=O(5397),ve=O(7953),ze=O(591),ge=O(5196);function Ge(Pe,Te){return Te?function be(Pe,Te){if(null!=Pe){if((0,Oe.l)(Pe))return function _e(Pe,Te){return(0,S.Tg)(Pe).pipe(oe(Te),W(Te))}(Pe,Te);if((0,Je.X)(Pe))return function Y(Pe,Te){return new Ae.c(Le=>{let Ke=0;return Te.schedule(function(){Ke===Pe.length?Le.complete():(Le.next(Pe[Ke++]),Le.closed||this.schedule())})})}(Pe,Te);if((0,Ue.y)(Pe))return function Me(Pe,Te){return(0,S.Tg)(Pe).pipe(oe(Te),W(Te))}(Pe,Te);if((0,ve.T)(Pe))return se(Pe,Te);if((0,ie.x)(Pe))return function Ie(Pe,Te){return new Ae.c(Le=>{let Ke;return(0,U.N)(Le,Te,()=>{Ke=Pe[J.l](),(0,U.N)(Le,Te,()=>{let Qe,mn;try{({value:Qe,done:mn}=Ke.next())}catch(qn){return void Le.error(qn)}mn?Le.complete():Le.next(Qe)},0,!0)}),()=>(0,ae.T)(Ke?.return)&&Ke.return()})}(Pe,Te);if((0,ge.U)(Pe))return function de(Pe,Te){return se((0,ge.C)(Pe),Te)}(Pe,Te)}throw(0,ze.L)(Pe)}(Pe,Te):(0,S.Tg)(Pe)}},8750:($e,he,O)=>{"use strict";O.d(he,{Tg:()=>Ie});var S=O(1635),U=O(7441),x=O(9858),_=O(1985),W=O(5055),oe=O(7953),_e=O(591),Me=O(5397),Ae=O(5196),Y=O(8071),J=O(5334),ae=O(3494);function Ie(ge){if(ge instanceof _.c)return ge;if(null!=ge){if((0,W.l)(ge))return function se(ge){return new _.c(de=>{const be=ge[ae.s]();if((0,Y.T)(be.subscribe))return be.subscribe(de);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(ge);if((0,U.X)(ge))return function Oe(ge){return new _.c(de=>{for(let be=0;be{ge.then(be=>{de.closed||(de.next(be),de.complete())},be=>de.error(be)).then(null,J.m)})}(ge);if((0,oe.T)(ge))return ie(ge);if((0,Me.x)(ge))return function Je(ge){return new _.c(de=>{for(const be of ge)if(de.next(be),de.closed)return;de.complete()})}(ge);if((0,Ae.U)(ge))return function ve(ge){return ie((0,Ae.C)(ge))}(ge)}throw(0,_e.L)(ge)}function ie(ge){return new _.c(de=>{(function ze(ge,de){var be,Ge,Pe,Te;return(0,S.sH)(this,void 0,void 0,function*(){try{for(be=(0,S.xN)(ge);!(Ge=yield be.next()).done;)if(de.next(Ge.value),de.closed)return}catch(Le){Pe={error:Le}}finally{try{Ge&&!Ge.done&&(Te=be.return)&&(yield Te.call(be))}finally{if(Pe)throw Pe.error}}de.complete()})})(ge,de).catch(be=>de.error(be))})}},7673:($e,he,O)=>{"use strict";O.d(he,{of:()=>x});var S=O(3794),U=O(6648);function x(..._){const W=(0,S.lI)(_);return(0,U.H)(_,W)}},8810:($e,he,O)=>{"use strict";O.d(he,{$:()=>x});var S=O(1985),U=O(8071);function x(_,W){const oe=(0,U.T)(_)?_:()=>_,_e=Me=>Me.error(oe());return new S.c(W?Me=>W.schedule(_e,0,Me):_e)}},4360:($e,he,O)=>{"use strict";O.d(he,{_:()=>U});var S=O(7707);function U(_,W,oe,_e,Me){return new x(_,W,oe,_e,Me)}class x extends S.vU{constructor(W,oe,_e,Me,Ae,Y){super(W),this.onFinalize=Ae,this.shouldUnsubscribe=Y,this._next=oe?function(J){try{oe(J)}catch(ae){W.error(ae)}}:super._next,this._error=Me?function(J){try{Me(J)}catch(ae){W.error(ae)}finally{this.unsubscribe()}}:super._error,this._complete=_e?function(){try{_e()}catch(J){W.error(J)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var W;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:oe}=this;super.unsubscribe(),!oe&&(null===(W=this.onFinalize)||void 0===W||W.call(this))}}}},9437:($e,he,O)=>{"use strict";O.d(he,{W:()=>_});var S=O(8750),U=O(4360),x=O(9974);function _(W){return(0,x.N)((oe,_e)=>{let Y,Me=null,Ae=!1;Me=oe.subscribe((0,U._)(_e,void 0,void 0,J=>{Y=(0,S.Tg)(W(J,_(W)(oe))),Me?(Me.unsubscribe(),Me=null,Y.subscribe(_e)):Ae=!0})),Ae&&(Me.unsubscribe(),Me=null,Y.subscribe(_e))})}},274:($e,he,O)=>{"use strict";O.d(he,{H:()=>x});var S=O(1397),U=O(8071);function x(_,W){return(0,U.T)(W)?(0,S.Z)(_,W,1):(0,S.Z)(_,1)}},5964:($e,he,O)=>{"use strict";O.d(he,{p:()=>x});var S=O(9974),U=O(4360);function x(_,W){return(0,S.N)((oe,_e)=>{let Me=0;oe.subscribe((0,U._)(_e,Ae=>_.call(W,Ae,Me++)&&_e.next(Ae)))})}},980:($e,he,O)=>{"use strict";O.d(he,{j:()=>U});var S=O(9974);function U(x){return(0,S.N)((_,W)=>{try{_.subscribe(W)}finally{W.add(x)}})}},6354:($e,he,O)=>{"use strict";O.d(he,{T:()=>x});var S=O(9974),U=O(4360);function x(_,W){return(0,S.N)((oe,_e)=>{let Me=0;oe.subscribe((0,U._)(_e,Ae=>{_e.next(_.call(W,Ae,Me++))}))})}},1397:($e,he,O)=>{"use strict";O.d(he,{Z:()=>Me});var S=O(6354),U=O(8750),x=O(9974),_=O(5225),W=O(4360),_e=O(8071);function Me(Ae,Y,J=1/0){return(0,_e.T)(Y)?Me((ae,Ie)=>(0,S.T)((se,Oe)=>Y(ae,se,Ie,Oe))((0,U.Tg)(Ae(ae,Ie))),J):("number"==typeof Y&&(J=Y),(0,x.N)((ae,Ie)=>function oe(Ae,Y,J,ae,Ie,se,Oe,Ue){const Je=[];let ie=0,ve=0,ze=!1;const ge=()=>{ze&&!Je.length&&!ie&&Y.complete()},de=Ge=>ie{se&&Y.next(Ge),ie++;let Pe=!1;(0,U.Tg)(J(Ge,ve++)).subscribe((0,W._)(Y,Te=>{Ie?.(Te),se?de(Te):Y.next(Te)},()=>{Pe=!0},void 0,()=>{if(Pe)try{for(ie--;Je.length&&iebe(Te)):be(Te)}ge()}catch(Te){Y.error(Te)}}))};return Ae.subscribe((0,W._)(Y,de,()=>{ze=!0,ge()})),()=>{Ue?.()}}(ae,Ie,Ae,J)))}},5558:($e,he,O)=>{"use strict";O.d(he,{n:()=>_});var S=O(8750),U=O(9974),x=O(4360);function _(W,oe){return(0,U.N)((_e,Me)=>{let Ae=null,Y=0,J=!1;const ae=()=>J&&!Ae&&Me.complete();_e.subscribe((0,x._)(Me,Ie=>{Ae?.unsubscribe();let se=0;const Oe=Y++;(0,S.Tg)(W(Ie,Oe)).subscribe(Ae=(0,x._)(Me,Ue=>Me.next(oe?oe(Ie,Ue,Oe,se++):Ue),()=>{Ae=null,ae()}))},()=>{J=!0,ae()}))})}},6697:($e,he,O)=>{"use strict";O.d(he,{s:()=>_});var S=O(983),U=O(9974),x=O(4360);function _(W){return W<=0?()=>S.w:(0,U.N)((oe,_e)=>{let Me=0;oe.subscribe((0,x._)(_e,Ae=>{++Me<=W&&(_e.next(Ae),W<=Me&&_e.complete())}))})}},9270:($e,he,O)=>{"use strict";O.d(he,{f:()=>S});const S={setTimeout(U,x,..._){const{delegate:W}=S;return W?.setTimeout?W.setTimeout(U,x,..._):setTimeout(U,x,..._)},clearTimeout(U){const{delegate:x}=S;return(x?.clearTimeout||clearTimeout)(U)},delegate:void 0}},4761:($e,he,O)=>{"use strict";O.d(he,{l:()=>U});const U=function S(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}()},3494:($e,he,O)=>{"use strict";O.d(he,{s:()=>S});const S="function"==typeof Symbol&&Symbol.observable||"@@observable"},3794:($e,he,O)=>{"use strict";O.d(he,{ms:()=>_,lI:()=>W});var S=O(8071);function x(_e){return _e[_e.length-1]}function _(_e){return(0,S.T)(x(_e))?_e.pop():void 0}function W(_e){return function U(_e){return _e&&(0,S.T)(_e.schedule)}(x(_e))?_e.pop():void 0}},3073:($e,he,O)=>{"use strict";O.d(he,{D:()=>W});const{isArray:S}=Array,{getPrototypeOf:U,prototype:x,keys:_}=Object;function W(_e){if(1===_e.length){const Me=_e[0];if(S(Me))return{args:Me,keys:null};if(function oe(_e){return _e&&"object"==typeof _e&&U(_e)===x}(Me)){const Ae=_(Me);return{args:Ae.map(Y=>Me[Y]),keys:Ae}}}return{args:_e,keys:null}}},7908:($e,he,O)=>{"use strict";function S(U,x){if(U){const _=U.indexOf(x);0<=_&&U.splice(_,1)}}O.d(he,{o:()=>S})},1853:($e,he,O)=>{"use strict";function S(U){const _=U(W=>{Error.call(W),W.stack=(new Error).stack});return _.prototype=Object.create(Error.prototype),_.prototype.constructor=_,_}O.d(he,{L:()=>S})},8496:($e,he,O)=>{"use strict";function S(U,x){return U.reduce((_,W,oe)=>(_[W]=x[oe],_),{})}O.d(he,{e:()=>S})},9786:($e,he,O)=>{"use strict";O.d(he,{Y:()=>x,l:()=>_});var S=O(1026);let U=null;function x(W){if(S.$.useDeprecatedSynchronousErrorHandling){const oe=!U;if(oe&&(U={errorThrown:!1,error:null}),W(),oe){const{errorThrown:_e,error:Me}=U;if(U=null,_e)throw Me}}else W()}function _(W){S.$.useDeprecatedSynchronousErrorHandling&&U&&(U.errorThrown=!0,U.error=W)}},5225:($e,he,O)=>{"use strict";function S(U,x,_,W=0,oe=!1){const _e=x.schedule(function(){_(),oe?U.add(this.schedule(null,W)):this.unsubscribe()},W);if(U.add(_e),!oe)return _e}O.d(he,{N:()=>S})},3669:($e,he,O)=>{"use strict";function S(U){return U}O.d(he,{D:()=>S})},7441:($e,he,O)=>{"use strict";O.d(he,{X:()=>S});const S=U=>U&&"number"==typeof U.length&&"function"!=typeof U},7953:($e,he,O)=>{"use strict";O.d(he,{T:()=>U});var S=O(8071);function U(x){return Symbol.asyncIterator&&(0,S.T)(x?.[Symbol.asyncIterator])}},8071:($e,he,O)=>{"use strict";function S(U){return"function"==typeof U}O.d(he,{T:()=>S})},5055:($e,he,O)=>{"use strict";O.d(he,{l:()=>x});var S=O(3494),U=O(8071);function x(_){return(0,U.T)(_[S.s])}},5397:($e,he,O)=>{"use strict";O.d(he,{x:()=>x});var S=O(4761),U=O(8071);function x(_){return(0,U.T)(_?.[S.l])}},4402:($e,he,O)=>{"use strict";O.d(he,{A:()=>x});var S=O(1985),U=O(8071);function x(_){return!!_&&(_ instanceof S.c||(0,U.T)(_.lift)&&(0,U.T)(_.subscribe))}},9858:($e,he,O)=>{"use strict";O.d(he,{y:()=>U});var S=O(8071);function U(x){return(0,S.T)(x?.then)}},5196:($e,he,O)=>{"use strict";O.d(he,{C:()=>x,U:()=>_});var S=O(1635),U=O(8071);function x(W){return(0,S.AQ)(this,arguments,function*(){const _e=W.getReader();try{for(;;){const{value:Me,done:Ae}=yield(0,S.N3)(_e.read());if(Ae)return yield(0,S.N3)(void 0);yield yield(0,S.N3)(Me)}}finally{_e.releaseLock()}})}function _(W){return(0,U.T)(W?.getReader)}},9974:($e,he,O)=>{"use strict";O.d(he,{N:()=>x,S:()=>U});var S=O(8071);function U(_){return(0,S.T)(_?.lift)}function x(_){return W=>{if(U(W))return W.lift(function(oe){try{return _(oe,this)}catch(_e){this.error(_e)}});throw new TypeError("Unable to lift unknown Observable type")}}},6450:($e,he,O)=>{"use strict";O.d(he,{I:()=>_});var S=O(6354);const{isArray:U}=Array;function _(W){return(0,S.T)(oe=>function x(W,oe){return U(oe)?W(...oe):W(oe)}(W,oe))}},5343:($e,he,O)=>{"use strict";function S(){}O.d(he,{l:()=>S})},1203:($e,he,O)=>{"use strict";O.d(he,{F:()=>U,m:()=>x});var S=O(3669);function U(..._){return x(_)}function x(_){return 0===_.length?S.D:1===_.length?_[0]:function(oe){return _.reduce((_e,Me)=>Me(_e),oe)}}},5334:($e,he,O)=>{"use strict";O.d(he,{m:()=>x});var S=O(1026),U=O(9270);function x(_){U.f.setTimeout(()=>{const{onUnhandledError:W}=S.$;if(!W)throw _;W(_)})}},591:($e,he,O)=>{"use strict";function S(U){return new TypeError(`You provided ${null!==U&&"object"==typeof U?"an invalid object":`'${U}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}O.d(he,{L:()=>S})},477:()=>{},177:($e,he,O)=>{"use strict";O.d(he,{AJ:()=>Zn,Jj:()=>gs,N0:()=>co,QT:()=>x,VF:()=>W,Vy:()=>xl,ZD:()=>_,_b:()=>ga,aZ:()=>ie,hb:()=>se,qQ:()=>_e});var S=O(3953);let U=null;function x(){return U}function _(g){U??=g}class W{}const _e=new S.nKC("");let Me=(()=>{class g{historyGo(w){throw new Error("")}static#e=this.\u0275fac=function(I){return new(I||g)};static#t=this.\u0275prov=S.jDH({token:g,factory:()=>(0,S.WQX)(Y),providedIn:"platform"})}return g})(),Y=(()=>{class g extends Me{constructor(){super(),this._doc=(0,S.WQX)(_e),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return x().getBaseHref(this._doc)}onPopState(w){const I=x().getGlobalEventTarget(this._doc,"window");return I.addEventListener("popstate",w,!1),()=>I.removeEventListener("popstate",w)}onHashChange(w){const I=x().getGlobalEventTarget(this._doc,"window");return I.addEventListener("hashchange",w,!1),()=>I.removeEventListener("hashchange",w)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(w){this._location.pathname=w}pushState(w,I,P){this._history.pushState(w,I,P)}replaceState(w,I,P){this._history.replaceState(w,I,P)}forward(){this._history.forward()}back(){this._history.back()}historyGo(w=0){this._history.go(w)}getState(){return this._history.state}static#e=this.\u0275fac=function(I){return new(I||g)};static#t=this.\u0275prov=S.jDH({token:g,factory:()=>new g,providedIn:"platform"})}return g})();function J(g,T){if(0==g.length)return T;if(0==T.length)return g;let w=0;return g.endsWith("/")&&w++,T.startsWith("/")&&w++,2==w?g+T.substring(1):1==w?g+T:g+"/"+T}function ae(g){const T=g.match(/#|\?|$/),w=T&&T.index||g.length;return g.slice(0,w-("/"===g[w-1]?1:0))+g.slice(w)}function Ie(g){return g&&"?"!==g[0]?"?"+g:g}let se=(()=>{class g{historyGo(w){throw new Error("")}static#e=this.\u0275fac=function(I){return new(I||g)};static#t=this.\u0275prov=S.jDH({token:g,factory:()=>(0,S.WQX)(Ue),providedIn:"root"})}return g})();const Oe=new S.nKC("");let Ue=(()=>{class g extends se{constructor(w,I){super(),this._platformLocation=w,this._removeListenerFns=[],this._baseHref=I??this._platformLocation.getBaseHrefFromDOM()??(0,S.WQX)(_e).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(w){this._removeListenerFns.push(this._platformLocation.onPopState(w),this._platformLocation.onHashChange(w))}getBaseHref(){return this._baseHref}prepareExternalUrl(w){return J(this._baseHref,w)}path(w=!1){const I=this._platformLocation.pathname+Ie(this._platformLocation.search),P=this._platformLocation.hash;return P&&w?`${I}${P}`:I}pushState(w,I,P,q){const ue=this.prepareExternalUrl(P+Ie(q));this._platformLocation.pushState(w,I,ue)}replaceState(w,I,P,q){const ue=this.prepareExternalUrl(P+Ie(q));this._platformLocation.replaceState(w,I,ue)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(w=0){this._platformLocation.historyGo?.(w)}static#e=this.\u0275fac=function(I){return new(I||g)(S.KVO(Me),S.KVO(Oe,8))};static#t=this.\u0275prov=S.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}return g})(),ie=(()=>{class g{constructor(w){this._subject=new S.bkB,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=w;const I=this._locationStrategy.getBaseHref();this._basePath=function de(g){if(new RegExp("^(https?:)?//").test(g)){const[,w]=g.split(/\/\/[^\/]+/);return w}return g}(ae(ge(I))),this._locationStrategy.onPopState(P=>{this._subject.emit({url:this.path(!0),pop:!0,state:P.state,type:P.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(w=!1){return this.normalize(this._locationStrategy.path(w))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(w,I=""){return this.path()==this.normalize(w+Ie(I))}normalize(w){return g.stripTrailingSlash(function ze(g,T){if(!g||!T.startsWith(g))return T;const w=T.substring(g.length);return""===w||["/",";","?","#"].includes(w[0])?w:T}(this._basePath,ge(w)))}prepareExternalUrl(w){return w&&"/"!==w[0]&&(w="/"+w),this._locationStrategy.prepareExternalUrl(w)}go(w,I="",P=null){this._locationStrategy.pushState(P,"",w,I),this._notifyUrlChangeListeners(this.prepareExternalUrl(w+Ie(I)),P)}replaceState(w,I="",P=null){this._locationStrategy.replaceState(P,"",w,I),this._notifyUrlChangeListeners(this.prepareExternalUrl(w+Ie(I)),P)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(w=0){this._locationStrategy.historyGo?.(w)}onUrlChange(w){return this._urlChangeListeners.push(w),this._urlChangeSubscription??=this.subscribe(I=>{this._notifyUrlChangeListeners(I.url,I.state)}),()=>{const I=this._urlChangeListeners.indexOf(w);this._urlChangeListeners.splice(I,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(w="",I){this._urlChangeListeners.forEach(P=>P(w,I))}subscribe(w,I,P){return this._subject.subscribe({next:w,error:I,complete:P})}static#e=this.normalizeQueryParams=Ie;static#t=this.joinWithSlash=J;static#n=this.stripTrailingSlash=ae;static#o=this.\u0275fac=function(I){return new(I||g)(S.KVO(se))};static#s=this.\u0275prov=S.jDH({token:g,factory:()=>function ve(){return new ie((0,S.KVO)(se))}(),providedIn:"root"})}return g})();function ge(g){return g.replace(/\/index.html$/,"")}function ga(g,T){T=encodeURIComponent(T);for(const w of g.split(";")){const I=w.indexOf("="),[P,q]=-1==I?[w,""]:[w.slice(0,I),w.slice(I+1)];if(P.trim()===T)return decodeURIComponent(q)}return null}class wa{createSubscription(T,w){return(0,S.O8t)(()=>T.subscribe({next:w,error:I=>{throw I}}))}dispose(T){(0,S.O8t)(()=>T.unsubscribe())}}class Ar{createSubscription(T,w){return T.then(w,I=>{throw I})}dispose(T){}}const io=new Ar,ps=new wa;let gs=(()=>{class g{constructor(w){this._latestValue=null,this.markForCheckOnValueUpdate=!0,this._subscription=null,this._obj=null,this._strategy=null,this._ref=w}ngOnDestroy(){this._subscription&&this._dispose(),this._ref=null}transform(w){if(!this._obj){if(w)try{this.markForCheckOnValueUpdate=!1,this._subscribe(w)}finally{this.markForCheckOnValueUpdate=!0}return this._latestValue}return w!==this._obj?(this._dispose(),this.transform(w)):this._latestValue}_subscribe(w){this._obj=w,this._strategy=this._selectStrategy(w),this._subscription=this._strategy.createSubscription(w,I=>this._updateLatestValue(w,I))}_selectStrategy(w){if((0,S.jNT)(w))return io;if((0,S.zjR)(w))return ps;throw function Mt(g,T){return new S.wOt(2100,!1)}()}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(w,I){w===this._obj&&(this._latestValue=I,this.markForCheckOnValueUpdate&&this._ref?.markForCheck())}static#e=this.\u0275fac=function(I){return new(I||g)(S.rXU(S.gRc,16))};static#t=this.\u0275pipe=S.EJ8({name:"async",type:g,pure:!1,standalone:!0})}return g})();const Zn="browser",ba="server";function xl(g){return g===ba}class co{}},3953:($e,he,O)=>{"use strict";function S(e,t){return Object.is(e,t)}O.d(he,{iLQ:()=>Fg,sZ2:()=>rs,o8S:()=>Io,BIS:()=>Up,gRc:()=>RS,Ql9:()=>ox,Ocv:()=>fx,Z63:()=>tr,aKT:()=>Js,uvJ:()=>ii,zcH:()=>Eo,bkB:()=>ai,$GK:()=>lt,nKC:()=>Xe,zZn:()=>Tn,_q3:()=>C_,MKu:()=>D_,xe9:()=>g_,Co$:()=>CC,Vns:()=>yl,SKi:()=>hn,Agw:()=>Df,PLl:()=>av,sFG:()=>zT,_9s:()=>ty,czy:()=>Kp,C4Q:()=>Lf,NYb:()=>ZO,giA:()=>pS,RxE:()=>sS,c1b:()=>hg,gXe:()=>Gi,L39:()=>hP,EWP:()=>gP,Ol2:()=>yy,w6W:()=>BM,Rfq:()=>Es,WQX:()=>me,naY:()=>Ex,QuC:()=>y,EmA:()=>Be,N4e:()=>Nh,vPA:()=>iC,O8t:()=>mP,H3F:()=>aS,zAP:()=>tI,H8p:()=>Tc,KH2:()=>ld,TgB:()=>Ya,wOt:()=>Ne,WHO:()=>fS,e01:()=>hS,H5H:()=>Gy,Zy3:()=>Jn,mq5:()=>ID,JZv:()=>Kt,TL3:()=>Wx,LfX:()=>Vl,plB:()=>ic,jNT:()=>d_,zjR:()=>gS,TL$:()=>sv,Tbb:()=>Xt,Vt3:()=>gy,GFd:()=>EC,OA$:()=>kd,Jv_:()=>Pb,aNF:()=>kb,R7$:()=>Gw,BMQ:()=>Ry,AVh:()=>Fy,wni:()=>sb,VBU:()=>Md,FsC:()=>Rd,jDH:()=>kt,G2t:()=>Jr,$C:()=>Jl,EJ8:()=>Nd,rXU:()=>Vu,nrm:()=>By,k0s:()=>Tg,j41:()=>Ig,RV6:()=>DD,xGo:()=>wu,KVO:()=>ot,kS0:()=>Yd,bIt:()=>qy,lsd:()=>lb,nI1:()=>$b,bMT:()=>Gb,Y8G:()=>Py,mGM:()=>cb,sdS:()=>ub,Njj:()=>ep,eBV:()=>lu,n$t:()=>ww,EFF:()=>wb,JRh:()=>Zy,DH7:()=>Rb,mxI:()=>e_,R50:()=>Yy,GBs:()=>ab});let U=null,x=!1,_=1;const W=Symbol("SIGNAL");function oe(e){const t=U;return U=e,t}const Y={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function J(e){if(x)throw new Error("");if(null===U)return;U.consumerOnSignalRead(e);const t=U.nextProducerIndex++;Ge(U),te.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function ve(e){Ge(e);for(let t=0;t0}function Ge(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function Pe(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function Te(e){return void 0!==e.producerNode}const Ke=Symbol("UNSET"),Qe=Symbol("COMPUTING"),mn=Symbol("ERRORED"),qn={...Y,value:Ke,dirty:!0,error:null,equal:S,producerMustRecompute:e=>e.value===Ke||e.value===Qe,producerRecomputeValue(e){if(e.value===Qe)throw new Error("Detected cycle in computations.");const t=e.value;e.value=Qe;const n=Je(e);let r;try{r=e.computation()}catch(i){r=mn,e.error=i}finally{ie(e,n)}t!==Ke&&t!==mn&&r!==mn&&e.equal(t,r)?e.value=t:(e.value=r,e.version++)}};let cn=function an(){throw new Error};function pt(){cn()}let z=null;function Ee(e,t){Oe()||pt(),e.equal(e.value,t)||(e.value=t,function un(e){e.version++,function ae(){_++}(),se(e),z?.()}(e))}const gt={...Y,equal:S,value:void 0};var It=O(4412),tn=O(1413),Cn=O(8359),Bt=O(6354);typeof navigator<"u"&&navigator,typeof navigator<"u"&&!/Opera/.test(navigator.userAgent)&&navigator,typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||navigator),typeof navigator<"u"&&!/Opera|WebKit/.test(navigator.userAgent)&&navigator,typeof navigator<"u"&&navigator;const Sa="https://g.co/ng/security#xss";class Ne extends Error{constructor(t,n){super(Jn(t,n)),this.code=t}}function Jn(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}function lr(e){return{toString:e}.toString()}const wr="__parameters__";function _i(e,t,n){return lr(()=>{const r=function Hi(e){return function(...n){if(e){const r=e(...n);for(const i in r)this[i]=r[i]}}}(t);function i(...c){if(this instanceof i)return r.apply(this,c),this;const l=new i(...c);return d.annotation=l,d;function d(p,E,b){const R=p.hasOwnProperty(wr)?p[wr]:Object.defineProperty(p,wr,{value:[]})[wr];for(;R.length<=b;)R.push(null);return(R[b]=R[b]||[]).push(l),p}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=e,i.annotationCls=i,i})}const Kt=globalThis;function Ct(e){for(let t in e)if(e[t]===Ct)return t;throw Error("Could not find renamed property on target object.")}function Fo(e,t){for(const n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n])}function Xt(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Xt).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function ws(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const Ta=Ct({__forward_ref__:Ct});function Es(e){return e.__forward_ref__=Es,e.toString=function(){return Xt(this())},e}function Ze(e){return Cs(e)?e():e}function Cs(e){return"function"==typeof e&&e.hasOwnProperty(Ta)&&e.__forward_ref__===Es}function kt(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Jr(e){return{providers:e.providers||[],imports:e.imports||[]}}function Ss(e){return Is(e,Ms)||Is(e,jo)}function Vl(e){return null!==Ss(e)}function Is(e,t){return e.hasOwnProperty(t)?e[t]:null}function Ts(e){return e&&(e.hasOwnProperty(As)||e.hasOwnProperty(Bo))?e[As]:null}const Ms=Ct({\u0275prov:Ct}),As=Ct({\u0275inj:Ct}),jo=Ct({ngInjectableDef:Ct}),Bo=Ct({ngInjectorDef:Ct});class Xe{constructor(t,n){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof n?this.__NG_ELEMENT_ID__=n:void 0!==n&&(this.\u0275prov=kt({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function Oa(e){return e&&!!e.\u0275providers}const uo=Ct({\u0275cmp:Ct}),Rs=Ct({\u0275dir:Ct}),Ns=Ct({\u0275pipe:Ct}),zo=Ct({\u0275mod:Ct}),Or=Ct({\u0275fac:Ct}),xr=Ct({__NG_ELEMENT_ID__:Ct}),xa=Ct({__NG_ENV_ID__:Ct});function nt(e){return"string"==typeof e?e:null==e?"":String(e)}function Os(e,t){throw new Ne(-201,!1)}var lt=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(lt||{});let ka;function xs(){return ka}function xn(e){const t=ka;return ka=e,t}function Ps(e,t,n){const r=Ss(e);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:n<.Optional?null:void 0!==t?t:void Os()}const Ei={},Wo="__NG_DI_FLAG__",g="ngTempTokenPath",w=/\n/gm,P="__source";let q;function ke(e){const t=q;return q=e,t}function Ut(e,t=lt.Default){if(void 0===q)throw new Ne(-203,!1);return null===q?Ps(e,void 0,t):q.get(e,t<.Optional?null:void 0,t)}function ot(e,t=lt.Default){return(xs()||Ut)(Ze(e),t)}function me(e,t=lt.Default){return ot(e,Vt(t))}function Vt(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function Dt(e){const t=[];for(let n=0;nArray.isArray(n)?ti(n,t):t(n))}function zl(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function Cr(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function jn(e,t,n){let r=po(e,t);return r>=0?e[1|r]=n:(r=~r,function Wl(e,t,n,r){let i=e.length;if(i==t)e.push(n,r);else if(1===i)e.push(r,e[0]),e[0]=n;else{for(i--,e.push(e[i-1],e[i]);i>t;)e[i]=e[i-2],i--;e[t]=n,e[t+1]=r}}(e,r,t,n)),r}function ql(e,t){const n=po(e,t);if(n>=0)return e[1|n]}function po(e,t){return function La(e,t,n){let r=0,i=e.length>>n;for(;i!==r;){const c=r+(i-r>>1),l=e[c<t?i=c:r=c+1}return~(i<t){l=c-1;break}}}for(;c-1){let c;for(;++ic?"":i[b+1].toLowerCase(),2&r&&E!==R){if(ri(r))return!1;l=!0}}}}else{if(!l&&!ri(r)&&!ri(p))return!1;if(l&&ri(p))continue;l=!1,r=p|1&r}}return ri(r)||l}function ri(e){return!(1&e)}function _h(e,t,n,r){if(null===t)return-1;let i=0;if(r||!n){let c=!1;for(;i-1)for(n++;n0?'="'+d+'"':"")+"]"}else 8&r?i+="."+l:4&r&&(i+=" "+l);else""!==i&&!ri(l)&&(t+=Td(c,i),i=""),r=l,c=c||!ri(r);n++}return""!==i&&(t+=Td(c,i)),t}function Md(e){return lr(()=>{const t=A(e),n={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===bc.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||Gi.Emulated,styles:e.styles||bt,_:null,schemas:e.schemas||null,tView:null,id:""};k(n);const r=e.dependencies;return n.directiveDefs=G(r,!1),n.pipeDefs=G(r,!0),n.id=function ye(e){let t=0;const n=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,e.consts,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery].join("|");for(const i of n)t=Math.imul(31,t)+i.charCodeAt(0)|0;return t+=2147483648,"c"+t}(n),n})}function Ih(e){return f(e)||v(e)}function Th(e){return null!==e}function Jl(e){return lr(()=>({type:e.type,bootstrap:e.bootstrap||bt,declarations:e.declarations||bt,imports:e.imports||bt,exports:e.exports||bt,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function Ad(e,t){if(null==e)return Dr;const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r];let c,l,d=ni.None;Array.isArray(i)?(d=i[0],c=i[1],l=i[2]??c):(c=i,l=i),t?(n[c]=d!==ni.None?[r,d]:r,t[c]=l):n[c]=r}return n}function Rd(e){return lr(()=>{const t=A(e);return k(t),t})}function Nd(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function f(e){return e[uo]||null}function v(e){return e[Rs]||null}function h(e){return e[Ns]||null}function y(e){const t=f(e)||v(e)||h(e);return null!==t&&t.standalone}function C(e,t){const n=e[zo]||null;if(!n&&!0===t)throw new Error(`Type ${Xt(e)} does not have '\u0275mod' property.`);return n}function A(e){const t={};return{type:e.type,providersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputTransforms:null,inputConfig:e.inputs||Dr,exportAs:e.exportAs||null,standalone:!0===e.standalone,signals:!0===e.signals,selectors:e.selectors||bt,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:Ad(e.inputs,t),outputs:Ad(e.outputs),debugInfo:null}}function k(e){e.features?.forEach(t=>t(e))}function G(e,t){if(!e)return null;const n=t?h:Ih;return()=>("function"==typeof e?e():e).map(r=>n(r)).filter(Th)}function Be(e){return{\u0275providers:e}}function et(...e){return{\u0275providers:$t(0,e),\u0275fromNgModule:!0}}function $t(e,...t){const n=[],r=new Set;let i;const c=l=>{n.push(l)};return ti(t,l=>{const d=l;rn(d,c,[],r)&&(i||=[],i.push(d))}),void 0!==i&&br(i,c),n}function br(e,t){for(let n=0;n{t(c,r)})}}function rn(e,t,n,r){if(!(e=Ze(e)))return!1;let i=null,c=Ts(e);const l=!c&&f(e);if(c||l){if(l&&!l.standalone)return!1;i=e}else{const p=e.ngModule;if(c=Ts(p),!c)return!1;i=p}const d=r.has(i);if(l){if(d)return!1;if(r.add(i),l.dependencies){const p="function"==typeof l.dependencies?l.dependencies():l.dependencies;for(const E of p)rn(E,t,n,r)}}else{if(!c)return!1;{if(null!=c.imports&&!d){let E;r.add(i);try{ti(c.imports,b=>{rn(b,t,n,r)&&(E||=[],E.push(b))})}finally{}void 0!==E&&br(E,t)}if(!d){const E=Fr(i)||(()=>new i);t({provide:i,useFactory:E,deps:bt},i),t({provide:Cc,useValue:i,multi:!0},i),t({provide:tr,useValue:()=>ot(i),multi:!0},i)}const p=c.providers;if(null!=p&&!d){const E=e;Bn(p,b=>{t(b,E)})}}}return i!==e&&void 0!==e.providers}function Bn(e,t){for(let n of e)Oa(n)&&(n=n.\u0275providers),Array.isArray(n)?Bn(n,t):t(n)}const Us=Ct({provide:String,useValue:Ct});function Ua(e){return null!==e&&"object"==typeof e&&Us in e}function Qo(e){return"function"==typeof e}const Tc=new Xe(""),Yl={},Xg={};let Od;function eu(){return void 0===Od&&(Od=new Dc),Od}class ii{}class Va extends ii{get destroyed(){return this._destroyed}constructor(t,n,r,i){super(),this.parent=n,this.source=r,this.scopes=i,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,Pd(t,l=>this.processProvider(l)),this.records.set(Lr,ja(void 0,this)),i.has("environment")&&this.records.set(ii,ja(void 0,this));const c=this.records.get(Tc);null!=c&&"string"==typeof c.value&&this.scopes.add(c.value),this.injectorDefTypes=new Set(this.get(Cc,bt,lt.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;const t=oe(null);try{for(const r of this._ngOnDestroyHooks)r.ngOnDestroy();const n=this._onDestroyHooks;this._onDestroyHooks=[];for(const r of n)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),oe(t)}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const n=ke(this),r=xn(void 0);try{return t()}finally{ke(n),xn(r)}}get(t,n=Ei,r=lt.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(xa))return t[xa](this);r=Vt(r);const c=ke(this),l=xn(void 0);try{if(!(r<.SkipSelf)){let p=this.records.get(t);if(void 0===p){const E=function Yg(e){return"function"==typeof e||"object"==typeof e&&e instanceof Xe}(t)&&Ss(t);p=E&&this.injectableDefInScope(E)?ja(xd(t),Yl):null,this.records.set(t,p)}if(null!=p)return this.hydrate(t,p)}return(r<.Self?eu():this.parent).get(t,n=r<.Optional&&n===Ei?null:n)}catch(d){if("NullInjectorError"===d.name){if((d[g]=d[g]||[]).unshift(Xt(t)),c)throw d;return function Vn(e,t,n,r){const i=e[g];throw t[P]&&i.unshift(t[P]),e.message=function ho(e,t,n,r=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let i=Xt(t);if(Array.isArray(t))i=t.map(Xt).join(" -> ");else if("object"==typeof t){let c=[];for(let l in t)if(t.hasOwnProperty(l)){let d=t[l];c.push(l+":"+("string"==typeof d?JSON.stringify(d):Xt(d)))}i=`{${c.join(", ")}}`}return`${n}${r?"("+r+")":""}[${i}]: ${e.replace(w,"\n ")}`}("\n"+e.message,i,n,r),e.ngTokenPath=i,e[g]=null,e}(d,t,"R3InjectorError",this.source)}throw d}finally{xn(l),ke(c)}}resolveInjectorInitializers(){const t=oe(null),n=ke(this),r=xn(void 0);try{const c=this.get(tr,bt,lt.Self);for(const l of c)l()}finally{ke(n),xn(r),oe(t)}}toString(){const t=[],n=this.records;for(const r of n.keys())t.push(Xt(r));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Ne(205,!1)}processProvider(t){let n=Qo(t=Ze(t))?t:Ze(t&&t.provide);const r=function Zg(e){return Ua(e)?ja(void 0,e.useValue):ja(Ah(e),Yl)}(t);if(!Qo(t)&&!0===t.multi){let i=this.records.get(n);i||(i=ja(void 0,Yl,!0),i.factory=()=>Dt(i.multi),this.records.set(n,i)),n=t,i.multi.push(t)}this.records.set(n,r)}hydrate(t,n){const r=oe(null);try{return n.value===Yl&&(n.value=Xg,n.value=n.factory()),"object"==typeof n.value&&n.value&&function Jg(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{oe(r)}}injectableDefInScope(t){if(!t.providedIn)return!1;const n=Ze(t.providedIn);return"string"==typeof n?"any"===n||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(t){const n=this._onDestroyHooks.indexOf(t);-1!==n&&this._onDestroyHooks.splice(n,1)}}function xd(e){const t=Ss(e),n=null!==t?t.factory:Fr(e);if(null!==n)return n;if(e instanceof Xe)throw new Ne(204,!1);if(e instanceof Function)return function Qg(e){if(e.length>0)throw new Ne(204,!1);const n=function Ra(e){return e&&(e[Ms]||e[jo])||null}(e);return null!==n?()=>n.factory(e):()=>new e}(e);throw new Ne(204,!1)}function Ah(e,t,n){let r;if(Qo(e)){const i=Ze(e);return Fr(i)||xd(i)}if(Ua(e))r=()=>Ze(e.useValue);else if(function Mh(e){return!(!e||!e.useFactory)}(e))r=()=>e.useFactory(...Dt(e.deps||[]));else if(function Xo(e){return!(!e||!e.useExisting)}(e))r=()=>ot(Ze(e.useExisting));else{const i=Ze(e&&(e.useClass||e.provide));if(!function Rh(e){return!!e.deps}(e))return Fr(i)||xd(i);r=()=>new i(...Dt(e.deps))}return r}function ja(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function Pd(e,t){for(const n of e)Array.isArray(n)?Pd(n,t):n&&Oa(n)?Pd(n.\u0275providers,t):t(n)}function Nh(e,t){e instanceof Va&&e.assertNotDestroyed();const r=ke(e),i=xn(void 0);try{return t()}finally{ke(r),xn(i)}}const on=0,De=1,qe=2,_n=3,Ci=4,Hn=5,ur=6,Ha=7,Zt=8,wn=9,zi=10,st=11,iu=12,Fh=13,$a=14,sn=15,Vs=16,Ga=17,mo=18,za=19,am=20,Zo=21,ou=22,oi=23,He=25,su=1,Wi=7,dr=9,wt=10;var rt=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(rt||{});function Sn(e){return Array.isArray(e)&&"object"==typeof e[su]}function Yt(e){return Array.isArray(e)&&!0===e[su]}function qi(e){return!!(4&e.flags)}function vo(e){return e.componentOffset>-1}function Rc(e){return!(1&~e.flags)}function dn(e){return!!e.template}function js(e){return!!(512&e[qe])}class um{constructor(t,n,r){this.previousValue=t,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}}function Gh(e,t,n,r){null!==t?t.applyValueToInputSignal(t,r):e[n]=r}function kd(){return zh}function zh(e){return e.type.prototype.ngOnChanges&&(e.setInput=fm),dm}function dm(){const e=xc(this),t=e?.current;if(t){const n=e.previous;if(n===Dr)e.previous=t;else for(let r in t)n[r]=t[r];e.current=null,this.ngOnChanges(t)}}function fm(e,t,n,r,i){const c=this.declaredInputs[r],l=xc(e)||function qh(e,t){return e[Wh]=t}(e,{previous:Dr,current:null}),d=l.current||(l.current={}),p=l.previous,E=p[c];d[c]=new um(E&&E.currentValue,n,p===Dr),Gh(e,t,i,n)}kd.ngInherit=!0;const Wh="__ngSimpleChanges__";function xc(e){return e[Wh]||null}const Di=function(e,t,n){};function Rt(e){for(;Array.isArray(e);)e=e[on];return e}function $s(e,t){return Rt(t[e])}function fr(e,t){return Rt(t[e.index])}function Pc(e,t){return e.data[t]}function Jo(e,t){return e[t]}function Vr(e,t){const n=t[e];return Sn(n)?n:n[on]}function Ld(e){return!(128&~e[qe])}function si(e,t){return null==t?null:e[t]}function Zh(e){e[Ga]=0}function mm(e){1024&e[qe]||(e[qe]|=1024,Ld(e)&&_o(e))}function kc(e){return!!(9216&e[qe]||e[oi]?.dirty)}function yo(e){e[zi].changeDetectionScheduler?.notify(7),64&e[qe]&&(e[qe]|=1024),kc(e)&&_o(e)}function _o(e){e[zi].changeDetectionScheduler?.notify(0);let t=fn(e);for(;null!==t&&!(8192&t[qe])&&(t[qe]|=8192,Ld(t));)t=fn(t)}function nr(e,t){if(!(256&~e[qe]))throw new Ne(911,!1);null===e[Zo]&&(e[Zo]=[]),e[Zo].push(t)}function fn(e){const t=e[_n];return Yt(t)?t[_n]:t}const at={lFrame:Hd(null),bindingsEnabled:!0,skipHydrationRootTNode:null};let Jh=!1;function Yh(){return at.bindingsEnabled}function te(){return at.lFrame.lView}function ht(){return at.lFrame.tView}function lu(e){return at.lFrame.contextLView=e,e[Zt]}function ep(e){return at.lFrame.contextLView=null,e}function zt(){let e=tp();for(;null!==e&&64===e.type;)e=e.parent;return e}function tp(){return at.lFrame.currentTNode}function bi(e,t){const n=at.lFrame;n.currentTNode=e,n.isParent=t}function Vd(){return at.lFrame.isParent}function Dm(){return Jh}function ip(e){Jh=e}function Ii(){return at.lFrame.bindingIndex++}function Sm(e,t){const n=at.lFrame;n.bindingIndex=n.bindingRootIndex=e,Xi(t)}function Xi(e){at.lFrame.currentDirectiveIndex=e}function Pn(){return at.lFrame.currentQueryIndex}function Ti(e){at.lFrame.currentQueryIndex=e}function Im(e){const t=e[De];return 2===t.type?t.declTNode:1===t.type?e[Hn]:null}function Tm(e,t,n){if(n<.SkipSelf){let i=t,c=e;for(;!(i=i.parent,null!==i||n<.Host||(i=Im(c),null===i||(c=c[$a],10&i.type))););if(null===i)return!1;t=i,e=c}const r=at.lFrame=Bd();return r.currentTNode=t,r.lView=e,!0}function fu(e){const t=Bd(),n=e[De];at.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function Bd(){const e=at.lFrame,t=null===e?null:e.child;return null===t?Hd(e):t}function Hd(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function $d(){const e=at.lFrame;return at.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const Gd=$d;function hu(){const e=$d();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function kn(){return at.lFrame.selectedIndex}function Qi(e){at.lFrame.selectedIndex=e}function Wt(){const e=at.lFrame;return Pc(e.tView,e.selectedIndex)}let Wd=!0;function zs(){return Wd}function Mi(e){Wd=e}function Uc(e,t){for(let n=t.directiveStart,r=t.directiveEnd;n=r)break}else t[p]<0&&(e[Ga]+=65536),(d>14>16&&(3&e[qe])===t&&(e[qe]+=16384,Kd(d,c)):Kd(d,c)}const Ws=-1;class In{constructor(t,n,r){this.factory=t,this.resolving=!1,this.canSeeViewProviders=n,this.injectImpl=r}}const Xa={};class qs{constructor(t,n){this.injector=t,this.parentInjector=n}get(t,n,r){r=Vt(r);const i=this.injector.get(t,Xa,r);return i!==Xa||n===Xa?i:this.parentInjector.get(t,n,r)}}function $c(e){return e!==Ws}function Gc(e){return 32767&e}function zc(e,t){let n=function j_(e){return e>>16}(e),r=t;for(;n>0;)r=r[$a],n--;return r}let hp=!0;function Xd(e){const t=hp;return hp=e,t}const Rm=255,Nm=5;let Om=0;const Ai={};function Qd(e,t){const n=Qa(e,t);if(-1!==n)return n;const r=t[De];r.firstCreatePass&&(e.injectorIndex=t.length,pp(r.data,e),pp(t,null),pp(r.blueprint,null));const i=Ks(e,t),c=e.injectorIndex;if($c(i)){const l=Gc(i),d=zc(i,t),p=d[De].data;for(let E=0;E<8;E++)t[c+E]=d[l+E]|p[l+E]}return t[c+8]=i,c}function pp(e,t){e.push(0,0,0,0,0,0,0,0,t)}function Qa(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Ks(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let n=0,r=null,i=t;for(;null!==i;){if(r=xm(i),null===r)return Ws;if(n++,i=i[$a],-1!==r.injectorIndex)return r.injectorIndex|n<<16}return Ws}function ts(e,t,n){!function H_(e,t,n){let r;"string"==typeof n?r=n.charCodeAt(0)||0:n.hasOwnProperty(xr)&&(r=n[xr]),null==r&&(r=n[xr]=Om++);const i=r&Rm;t.data[e+(i>>Nm)]|=1<=0?t&Rm:mp:t}(n);if("function"==typeof c){if(!Tm(t,e,r))return r<.Host?Xs(i,0,r):Zd(t,n,r,i);try{let l;if(l=c(r),null!=l||r<.Optional)return l;Os()}finally{Gd()}}else if("number"==typeof c){let l=null,d=Qa(e,t),p=Ws,E=r<.Host?t[sn][Hn]:null;for((-1===d||r<.SkipSelf)&&(p=-1===d?Ks(e,t):t[d+8],p!==Ws&&_u(r,!1)?(l=t[De],d=Gc(p),t=zc(p,t)):d=-1);-1!==d;){const b=t[De];if(gp(c,d,b.data)){const R=vu(d,t,n,l,r,E);if(R!==Ai)return R}p=t[d+8],p!==Ws&&_u(r,t[De].data[d+8]===E)&&gp(c,d,t)?(l=b,d=Gc(p),t=zc(p,t)):d=-1}}return i}function vu(e,t,n,r,i,c){const l=t[De],d=l.data[e+8],b=yu(d,l,n,null==r?vo(d)&&hp:r!=l&&!!(3&d.type),i<.Host&&c===d);return null!==b?Qs(t,l,b,d):Ai}function yu(e,t,n,r,i){const c=e.providerIndexes,l=t.data,d=1048575&c,p=e.directiveStart,b=c>>20,L=i?d+b:e.directiveEnd;for(let V=r?d:d+b;V=p&&$.type===n)return V}if(i){const V=l[p];if(V&&dn(V)&&V.type===n)return p}return null}function Qs(e,t,n,r){let i=e[n];const c=t.data;if(function es(e){return e instanceof In}(i)){const l=i;l.resolving&&function Hl(e,t){throw t&&t.join(" > "),new Ne(-200,e)}(function At(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():nt(e)}(c[n]));const d=Xd(l.canSeeViewProviders);l.resolving=!0;const E=l.injectImpl?xn(l.injectImpl):null;Tm(e,r,lt.Default);try{i=e[n]=l.factory(void 0,c,e,r),t.firstCreatePass&&n>=r.directiveStart&&function qd(e,t,n){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:c}=t.type.prototype;if(r){const l=zh(t);(n.preOrderHooks??=[]).push(e,l),(n.preOrderCheckHooks??=[]).push(e,l)}i&&(n.preOrderHooks??=[]).push(0-e,i),c&&((n.preOrderHooks??=[]).push(e,c),(n.preOrderCheckHooks??=[]).push(e,c))}(n,c[n],t)}finally{null!==E&&xn(E),Xd(d),l.resolving=!1,Gd()}}return i}function gp(e,t,n){return!!(n[t+(e>>Nm)]&1<{const t=e.prototype.constructor,n=t[Or]||qc(t),r=Object.prototype;let i=Object.getPrototypeOf(e.prototype).constructor;for(;i&&i!==r;){const c=i[Or]||qc(i);if(c&&c!==n)return c;i=Object.getPrototypeOf(i)}return c=>new c})}function qc(e){return Cs(e)?()=>{const t=qc(Ze(e));return t&&t()}:Fr(e)}function xm(e){const t=e[De],n=t.type;return 2===n?t.declTNode:1===n?e[Hn]:null}function Yd(e){return function Wc(e,t){if("class"===t)return e.classes;if("style"===t)return e.styles;const n=e.attrs;if(n){const r=n.length;let i=0;for(;iot(Lr)});static#o=this.__NG_ELEMENT_ID__=-1}new Xe("").__NG_ELEMENT_ID__=e=>{const t=zt();if(null===t)throw new Ne(204,!1);if(2&t.type)return t.value;if(e<.Optional)return null;throw new Ne(204,!1)};function Zc(e){return e.ngOriginalError}const wp=!0;let Ja=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=Bm;static#t=this.__NG_ENV_ID__=n=>n}return e})();class nf extends Ja{constructor(t){super(),this._lView=t}onDestroy(t){return nr(this._lView,t),()=>function hr(e,t){if(null===e[Zo])return;const n=e[Zo].indexOf(t);-1!==n&&e[Zo].splice(n,1)}(this._lView,t)}}function Bm(){return new nf(te())}let Ya=(()=>{class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new It.t(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const n=this.taskId++;return this.pendingTasks.add(n),n}remove(n){this.pendingTasks.delete(n),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static#e=this.\u0275prov=kt({token:e,providedIn:"root",factory:()=>new e})}return e})();const ai=class Jc extends tn.B{constructor(t=!1){super(),this.destroyRef=void 0,this.pendingTasks=void 0,this.__isAsync=t,function Oh(){return void 0!==xs()||null!=function ue(){return q}()}()&&(this.destroyRef=me(Ja,{optional:!0})??void 0,this.pendingTasks=me(Ya,{optional:!0})??void 0)}emit(t){const n=oe(null);try{super.next(t)}finally{oe(n)}}subscribe(t,n,r){let i=t,c=n||(()=>null),l=r;if(t&&"object"==typeof t){const p=t;i=p.next?.bind(p),c=p.error?.bind(p),l=p.complete?.bind(p)}this.__isAsync&&(c=this.wrapInTimeout(c),i&&(i=this.wrapInTimeout(i)),l&&(l=this.wrapInTimeout(l)));const d=super.subscribe({next:i,error:c,complete:l});return t instanceof Cn.yU&&t.add(d),d}wrapInTimeout(t){return n=>{const r=this.pendingTasks?.add();setTimeout(()=>{t(n),void 0!==r&&this.pendingTasks?.remove(r)})}}};function Yc(...e){}function rf(e){let t,n;function r(){e=Yc;try{void 0!==n&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(n),void 0!==t&&clearTimeout(t)}catch{}}return t=setTimeout(()=>{e(),r()}),"function"==typeof requestAnimationFrame&&(n=requestAnimationFrame(()=>{e(),r()})),()=>r()}function sf(e){return queueMicrotask(()=>e()),()=>{e=Yc}}const af="isAngularZone",el=af+"_ID";let z_=0;class hn{constructor(t){this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new ai(!1),this.onMicrotaskEmpty=new ai(!1),this.onStable=new ai(!1),this.onError=new ai(!1);const{enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1,scheduleInRootZone:c=wp}=t;if(typeof Zone>"u")throw new Ne(908,!1);Zone.assertZonePatched();const l=this;l._nesting=0,l._outer=l._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(l._inner=l._inner.fork(new Zone.TaskTrackingZoneSpec)),n&&Zone.longStackTraceZoneSpec&&(l._inner=l._inner.fork(Zone.longStackTraceZoneSpec)),l.shouldCoalesceEventChangeDetection=!i&&r,l.shouldCoalesceRunChangeDetection=i,l.callbackScheduled=!1,l.scheduleInRootZone=c,function Cp(e){const t=()=>{!function Hm(e){function t(){rf(()=>{e.callbackScheduled=!1,cf(e),e.isCheckStableRunning=!0,Ep(e),e.isCheckStableRunning=!1})}e.isCheckStableRunning||e.callbackScheduled||(e.callbackScheduled=!0,e.scheduleInRootZone?Zone.root.run(()=>{t()}):e._outer.run(()=>{t()}),cf(e))}(e)},n=z_++;e._inner=e._inner.fork({name:"angular",properties:{[af]:!0,[el]:n,[el+n]:!0},onInvokeTask:(r,i,c,l,d,p)=>{if(function $m(e){return bp(e,"__ignore_ng_zone__")}(p))return r.invokeTask(c,l,d,p);try{return lf(e),r.invokeTask(c,l,d,p)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===l.type||e.shouldCoalesceRunChangeDetection)&&t(),Du(e)}},onInvoke:(r,i,c,l,d,p,E)=>{try{return lf(e),r.invoke(c,l,d,p,E)}finally{e.shouldCoalesceRunChangeDetection&&!e.callbackScheduled&&!function Dp(e){return bp(e,"__scheduler_tick__")}(p)&&t(),Du(e)}},onHasTask:(r,i,c,l)=>{r.hasTask(c,l),i===c&&("microTask"==l.change?(e._hasPendingMicrotasks=l.microTask,cf(e),Ep(e)):"macroTask"==l.change&&(e.hasPendingMacrotasks=l.macroTask))},onHandleError:(r,i,c,l)=>(r.handleError(c,l),e.runOutsideAngular(()=>e.onError.emit(l)),!1)})}(l)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get(af)}static assertInAngularZone(){if(!hn.isInAngularZone())throw new Ne(909,!1)}static assertNotInAngularZone(){if(hn.isInAngularZone())throw new Ne(909,!1)}run(t,n,r){return this._inner.run(t,n,r)}runTask(t,n,r,i){const c=this._inner,l=c.scheduleEventTask("NgZoneEvent: "+i,t,W_,Yc,Yc);try{return c.runTask(l,n,r)}finally{c.cancelTask(l)}}runGuarded(t,n,r){return this._inner.runGuarded(t,n,r)}runOutsideAngular(t){return this._outer.run(t)}}const W_={};function Ep(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function cf(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&!0===e.callbackScheduled)}function lf(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function Du(e){e._nesting--,Ep(e)}class uf{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new ai,this.onMicrotaskEmpty=new ai,this.onStable=new ai,this.onError=new ai}run(t,n,r){return t.apply(n,r)}runGuarded(t,n,r){return t.apply(n,r)}runOutsideAngular(t){return t()}runTask(t,n,r,i){return t.apply(n,r)}}function bp(e,t){return!(!Array.isArray(e)||1!==e.length)&&!0===e[0]?.data?.[t]}class Eo{constructor(){this._console=console}handleError(t){const n=this._findOriginalError(t);this._console.error("ERROR",t),n&&this._console.error("ORIGINAL ERROR",n)}_findOriginalError(t){let n=t&&Zc(t);for(;n&&Zc(n);)n=Zc(n);return n||null}}const Sp=new Xe("",{providedIn:"root",factory:()=>{const e=me(hn),t=me(Eo);return n=>e.runOutsideAngular(()=>t.handleError(n))}});function df(){return ec(zt(),te())}function ec(e,t){return new Js(fr(e,t))}let Js=(()=>{class e{constructor(n){this.nativeElement=n}static#e=this.__NG_ELEMENT_ID__=df}return e})();function Tp(e){return e instanceof Js?e.nativeElement:e}function ff(){return this._results[Symbol.iterator]()}class bu{static#e=Symbol.iterator;get changes(){return this._changes??=new ai}constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._onDirty=void 0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;const n=bu.prototype;n[Symbol.iterator]||(n[Symbol.iterator]=ff)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,n){return this._results.reduce(t,n)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,n){this.dirty=!1;const r=function er(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function Gl(e,t,n){if(e.length!==t.length)return!1;for(let r=0;rLp}),Lp="ng",av=new Xe(""),Df=new Xe("",{providedIn:"platform",factory:()=>"unknown"}),Up=new Xe("",{providedIn:"root",factory:()=>function ea(){if(void 0!==Cf)return Cf;if(typeof document<"u")return document;throw new Ne(210,!1)}().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let Ou=()=>null;function xu(e,t,n=!1){return Ou(e,t,n)}const Se=new Xe("",{providedIn:"root",factory:()=>!1});let Fn;function Ri(e){return function Nt(){if(void 0===Fn&&(Fn=null,Kt.trustedTypes))try{Fn=Kt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Fn}()?.createScriptURL(e)||e}class Ni{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Sa})`}}function xi(e){return e instanceof Ni?e.changingThisBreaksApplicationSecurity:e}function ra(e,t){const n=function Mf(e){return e instanceof Ni&&e.getTypeName()||null}(e);if(null!=n&&n!==t){if("ResourceURL"===n&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${n} (see ${Sa})`)}return n===t}const EI=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;var Fu=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}(Fu||{});function yw(e){const t=Rf();return t?t.sanitize(Fu.URL,e)||"":ra(e,"URL")?xi(e):function pv(e){return(e=String(e)).match(EI)?e:"unsafe:"+e}(nt(e))}function _w(e){const t=Rf();if(t)return Ri(t.sanitize(Fu.RESOURCE_URL,e)||"");if(ra(e,"ResourceURL"))return Ri(xi(e));throw new Ne(904,!1)}function ww(e,t,n){return function FI(e,t){return"src"===t&&("embed"===e||"frame"===e||"iframe"===e||"media"===e||"script"===e)||"href"===t&&("base"===e||"link"===e)?_w:yw}(t,n)(e)}function Rf(){const e=te();return e&&e[zi].sanitizer}function Pi(e){return e instanceof Function?e():e}var Kp=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(Kp||{});let wv;function Ev(e,t){return wv(e,t)}function Uu(e,t,n,r,i){if(null!=r){let c,l=!1;Yt(r)?c=r:Sn(r)&&(l=!0,r=r[on]);const d=Rt(r);0===e&&null!==n?null==i?xw(t,n,d):fl(t,n,d,i||null,!0):1===e&&null!==n?fl(t,n,d,i||null,!0):2===e?function Of(e,t,n){e.removeChild(null,t,n)}(t,d,l):3===e&&t.destroyNode(d),null!=c&&function s0(e,t,n,r,i){const c=n[Wi];c!==Rt(n)&&Uu(t,e,r,c,i);for(let d=wt;d0&&(e[n-1][Ci]=r[Ci]);const c=Cr(e,wt+t);!function ZI(e,t){Rw(e,t),t[on]=null,t[Hn]=null}(r[De],r);const l=c[mo];null!==l&&l.detachView(c[De]),r[_n]=null,r[Ci]=null,r[qe]&=-129}return r}function Qp(e,t){if(!(256&t[qe])){const n=t[st];n.destroyNode&&Jp(e,t,n,3,null,null),function YI(e){let t=e[iu];if(!t)return Sv(e[De],e);for(;t;){let n=null;if(Sn(t))n=t[iu];else{const r=t[wt];r&&(n=r)}if(!n){for(;t&&!t[Ci]&&t!==e;)Sn(t)&&Sv(t[De],t),t=t[_n];null===t&&(t=e),Sn(t)&&Sv(t[De],t),n=t&&t[Ci]}t=n}}(t)}}function Sv(e,t){if(256&t[qe])return;const n=oe(null);try{t[qe]&=-129,t[qe]|=256,t[oi]&&ze(t[oi]),function n0(e,t){let n;if(null!=e&&null!=(n=e.destroyHooks))for(let r=0;r=0?r[l]():r[-l].unsubscribe(),c+=2}else n[c].call(r[n[c+1]]);null!==r&&(t[Ha]=null);const i=t[Zo];if(null!==i){t[Zo]=null;for(let c=0;c-1){const{encapsulation:c}=e.data[r.directiveStart+i];if(c===Gi.None||c===Gi.Emulated)return null}return fr(r,n)}}(e,t.parent,n)}function fl(e,t,n,r,i){e.insertBefore(t,n,r,i)}function xw(e,t,n){e.appendChild(t,n)}function Pw(e,t,n,r,i){null!==r?fl(e,t,n,r,i):xw(e,t,n)}function Tv(e,t){return e.parentNode(t)}let Mv,Lw=function Fw(e,t,n){return 40&e.type?fr(e,n):null};function Zp(e,t,n,r){const i=Iv(e,r,t),c=t[st],d=function kw(e,t,n){return Lw(e,t,n)}(r.parent||t[Hn],r,t);if(null!=i)if(Array.isArray(n))for(let p=0;pHe&&zw(e,t,He,!1),Di(l?2:0,i),n(r,i)}finally{Qi(c),Di(l?3:1,i)}}function Ov(e,t,n){if(qi(t)){const r=oe(null);try{const c=t.directiveEnd;for(let l=t.directiveStart;lnull;function Qw(e,t,n,r,i){for(let c in t){if(!t.hasOwnProperty(c))continue;const l=t[c];if(void 0===l)continue;r??={};let d,p=ni.None;Array.isArray(l)?(d=l[0],p=l[1]):d=l;let E=c;if(null!==i){if(!i.hasOwnProperty(c))continue;E=i[c]}0===e?Zw(r,n,E,d,p):Zw(r,n,E,d)}return r}function Zw(e,t,n,r,i){let c;e.hasOwnProperty(n)?(c=e[n]).push(t,r):c=e[n]=[t,r],void 0!==i&&c.push(i)}function di(e,t,n,r,i,c,l,d){const p=fr(t,n);let b,E=t.inputs;!d&&null!=E&&(b=E[r])?(jv(e,n,b,r,i),vo(t)&&function w0(e,t){const n=Vr(t,e);16&n[qe]||(n[qe]|=64)}(n,t.index)):3&t.type&&(r=function _0(e){return"class"===e?"className":"for"===e?"htmlFor":"formaction"===e?"formAction":"innerHtml"===e?"innerHTML":"readonly"===e?"readOnly":"tabindex"===e?"tabIndex":e}(r),i=null!=l?l(i,t.value||"",r):i,c.setProperty(p,r,i))}function Jw(e,t,n,r,i,c){for(let E=0;E0;){const n=e[--t];if("number"==typeof n&&n<0)return n}return 0})(l)!=d&&l.push(d),l.push(n,r,c)}}(e,t,r,xf(e,n,i.hostVars,ut),i)}function os(e,t,n,r,i,c){const l=fr(e,t);!function Uv(e,t,n,r,i,c,l){if(null==c)e.removeAttribute(t,i,n);else{const d=null==l?nt(c):l(c,r||"",i);e.setAttribute(t,i,d,n)}}(t[st],l,c,e.value,n,r,i)}function O0(e,t,n,r,i,c){const l=c[t];if(null!==l)for(let d=0;d{_o(e.lView)},consumerOnSignalRead(){this.lView[oi]=this}},H0={...Y,consumerIsAlwaysLive:!0,consumerMarkedDirty:e=>{let t=fn(e.lView);for(;t&&!cE(t[De]);)t=fn(t);t&&mm(t)},consumerOnSignalRead(){this.lView[oi]=this}};function cE(e){return 2!==e.type}const $0=100;function ng(e,t=!0,n=0){const r=e[zi],i=r.rendererFactory;i.begin?.();try{!function G0(e,t){const n=Dm();try{ip(!0),$v(e,t);let r=0;for(;kc(e);){if(r===$0)throw new Ne(103,!1);r++,$v(e,1)}}finally{ip(n)}}(e,n)}catch(l){throw t&&tg(e,l),l}finally{i.end?.(),r.inlineEffectRunner?.flush()}}function z0(e,t,n,r){const i=t[qe];if(!(256&~i))return;t[zi].inlineEffectRunner?.flush(),fu(t);let d=!0,p=null,E=null;cE(e)?(E=function L0(e){return e[oi]??function U0(e){const t=aE.pop()??Object.create(j0);return t.lView=e,t}(e)}(t),p=Je(E)):null===function _e(){return U}()?(d=!1,E=function B0(e){const t=e[oi]??Object.create(H0);return t.lView=e,t}(t),p=Je(E)):t[oi]&&(ze(t[oi]),t[oi]=null);try{Zh(t),function Si(e){return at.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==n&&qw(e,t,n,2,r);const b=!(3&~i);if(b){const V=e.preOrderCheckHooks;null!==V&&Vc(t,V,null)}else{const V=e.preOrderHooks;null!==V&&jc(t,V,0,null),Bc(t,0)}if(function W0(e){for(let t=ev(e);null!==t;t=Pp(t)){if(!(t[qe]&rt.HasTransplantedViews))continue;const n=t[dr];for(let r=0;r-1&&(Nf(t,r),Cr(n,r))}this._attachedToViewContainer=!1}Qp(this._lView[De],this._lView)}onDestroy(t){nr(this._lView,t)}markForCheck(){kf(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[qe]&=-129}reattach(){yo(this._lView),this._lView[qe]|=128}detectChanges(){this._lView[qe]|=1024,ng(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new Ne(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;const t=js(this._lView),n=this._lView[Vs];null!==n&&!t&&bv(n,this._lView),Rw(this._lView[De],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new Ne(902,!1);this._appRef=t;const n=js(this._lView),r=this._lView[Vs];null!==r&&!n&&Nw(r,this._lView),yo(this._lView)}}let Lf=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=Q0}return e})();const K0=Lf,X0=class extends K0{constructor(t,n,r){super(),this._declarationLView=t,this._declarationTContainer=n,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,n){return this.createEmbeddedViewImpl(t,n)}createEmbeddedViewImpl(t,n,r){const i=function ju(e,t,n,r){const i=oe(null);try{const c=t.tView,p=Yp(e,c,n,4096&e[qe]?4096:16,null,t,null,null,r?.injector??null,r?.embeddedViewInjector??null,r?.dehydratedView??null);p[Vs]=e[t.index];const b=e[mo];return null!==b&&(p[mo]=b.createEmbeddedView(c)),Bv(c,p,n),p}finally{oe(i)}}(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:n,dehydratedView:r});return new Ff(i)}};function Q0(){return rg(zt(),te())}function rg(e,t){return 4&e.type?new X0(t,e,ec(e,t)):null}class $u{}const zf=new Xe("",{providedIn:"root",factory:()=>!1}),PE=new Xe(""),ey=new Xe("");class HT{}class kE{}class GT{resolveComponentFactory(t){throw function $T(e){const t=Error(`No component factory found for ${Xt(e)}.`);return t.ngComponent=e,t}(t)}}class lg{static#e=this.NULL=new GT}class ty{}let zT=(()=>{class e{constructor(){this.destroyNode=null}static#e=this.__NG_ELEMENT_ID__=()=>function WT(){const e=te(),n=Vr(zt().index,e);return(Sn(n)?n:e)[st]}()}return e})(),qT=(()=>{class e{static#e=this.\u0275prov=kt({token:e,providedIn:"root",factory:()=>null})}return e})();const LE=new Set;function jr(e){LE.has(e)||(LE.add(e),performance?.mark?.("mark_feature_usage",{detail:{feature:e}}))}let ug=(()=>{class e{constructor(){this.handler=null,this.internalCallbacks=[]}execute(){this.executeInternalCallbacks(),this.handler?.execute()}executeInternalCallbacks(){const n=[...this.internalCallbacks];this.internalCallbacks.length=0;for(const r of n)r()}ngOnDestroy(){this.handler?.destroy(),this.handler=null,this.internalCallbacks.length=0}static#e=this.\u0275prov=kt({token:e,providedIn:"root",factory:()=>new e})}return e})();function ic(e){return!!C(e)}function fg(e,t,n){let r=n?e.styles:null,i=n?e.classes:null,c=0;if(null!==t)for(let l=0;l0&&Hw(e,n,c.join(" "))}}(V,Wn,ne,r),void 0!==n&&function cM(e,t,n){const r=e.projection=[];for(let i=0;i{class e{static#e=this.__NG_ELEMENT_ID__=uM}return e})();function uM(){return WE(zt(),te())}const dM=hg,GE=class extends dM{constructor(t,n,r){super(),this._lContainer=t,this._hostTNode=n,this._hostLView=r}get element(){return ec(this._hostTNode,this._hostLView)}get injector(){return new En(this._hostTNode,this._hostLView)}get parentInjector(){const t=Ks(this._hostTNode,this._hostLView);if($c(t)){const n=zc(t,this._hostLView),r=Gc(t);return new En(n[De].data[r+8],n)}return new En(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const n=zE(this._lContainer);return null!==n&&n[t]||null}get length(){return this._lContainer.length-wt}createEmbeddedView(t,n,r){let i,c;"number"==typeof r?i=r:null!=r&&(i=r.index,c=r.injector);const d=t.createEmbeddedViewImpl(n||{},c,null);return this.insertImpl(d,i,gl(this._hostTNode,null)),d}createComponent(t,n,r,i,c){const l=t&&!function Mc(e){return"function"==typeof e}(t);let d;if(l)d=n;else{const $=n||{};d=$.index,r=$.injector,i=$.projectableNodes,c=$.environmentInjector||$.ngModuleRef}const p=l?t:new Kf(f(t)),E=r||this.parentInjector;if(!c&&null==p.ngModule){const ne=(l?E:this.parentInjector).get(ii,null);ne&&(c=ne)}f(p.componentType??{});const V=p.create(E,i,null,c);return this.insertImpl(V.hostView,d,gl(this._hostTNode,null)),V}insert(t,n){return this.insertImpl(t,n,!0)}insertImpl(t,n,r){const i=t._lView;if(function gm(e){return Yt(e[_n])}(i)){const d=this.indexOf(t);if(-1!==d)this.detach(d);else{const p=i[_n],E=new GE(p,p[Hn],p[_n]);E.detach(E.indexOf(t))}}const c=this._adjustIndex(n),l=this._lContainer;return function Bu(e,t,n,r=!0){const i=t[De];if(function e0(e,t,n,r){const i=wt+r,c=n.length;r>0&&(n[i-1][Ci]=t),rt.trim())}(t):t}}class ly{constructor(t=[]){this.queries=t}elementStart(t,n){for(let r=0;r0)r.push(l[d/2]);else{const E=c[d+1],b=t[-p];for(let R=wt;R(J(t),t.value);return n[W]=t,n}(e),r=n[W];return t?.equal&&(r.equal=t.equal),n.set=i=>Ee(r,i),n.update=i=>function pe(e,t){Oe()||pt(),Ee(e,t(e.value))}(r,i),n.asReadonly=oC.bind(n),n}function oC(){const e=this[W];if(void 0===e.readonlyFn){const t=()=>this();t[W]=e,e.readonlyFn=t}return e.readonlyFn}function sC(e){return function rC(e){return"function"==typeof e&&void 0!==e[W]}(e)&&"function"==typeof e.set}function gy(e){let t=function vC(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),n=!0;const r=[e];for(;t;){let i;if(dn(e))i=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new Ne(903,!1);i=t.\u0275dir}if(i){if(n){r.push(i);const l=e;l.inputs=gg(e.inputs),l.inputTransforms=gg(e.inputTransforms),l.declaredInputs=gg(e.declaredInputs),l.outputs=gg(e.outputs);const d=i.hostBindings;d&&kM(e,d);const p=i.viewQuery,E=i.contentQueries;if(p&&xM(e,p),E&&PM(e,E),NM(e,i),Fo(e.outputs,i.outputs),dn(i)&&i.data.animation){const b=e.data;b.animation=(b.animation||[]).concat(i.data.animation)}}const c=i.features;if(c)for(let l=0;l=0;r--){const i=e[r];i.hostVars=t+=i.hostVars,i.hostAttrs=Ls(i.hostAttrs,n=Ls(n,i.hostAttrs))}}(r)}function NM(e,t){for(const n in t.inputs){if(!t.inputs.hasOwnProperty(n)||e.inputs.hasOwnProperty(n))continue;const r=t.inputs[n];if(void 0!==r&&(e.inputs[n]=r,e.declaredInputs[n]=t.declaredInputs[n],null!==t.inputTransforms)){const i=Array.isArray(r)?r[0]:r;if(!t.inputTransforms.hasOwnProperty(i))continue;e.inputTransforms??={},e.inputTransforms[i]=t.inputTransforms[i]}}}function gg(e){return e===Dr?{}:e===bt?[]:e}function xM(e,t){const n=e.viewQuery;e.viewQuery=n?(r,i)=>{t(r,i),n(r,i)}:t}function PM(e,t){const n=e.contentQueries;e.contentQueries=n?(r,i,c)=>{t(r,i,c),n(r,i,c)}:t}function kM(e,t){const n=e.hostBindings;e.hostBindings=n?(r,i)=>{t(r,i),n(r,i)}:t}function EC(e){const t=e.inputConfig,n={};for(const r in t)if(t.hasOwnProperty(r)){const i=t[r];Array.isArray(i)&&i[3]&&(n[r]=i[3])}e.inputTransforms=n}class yl{}class CC{}function BM(e,t){return new my(e,t??null,[])}class my extends yl{constructor(t,n,r,i=!0){super(),this.ngModuleType=t,this._parent=n,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new HE(this);const c=C(t);this._bootstrapComponents=Pi(c.bootstrap),this._r3Injector=tf(t,n,[{provide:yl,useValue:this},{provide:lg,useValue:this.componentFactoryResolver},...r],Xt(t),new Set(["environment"])),i&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(n=>n()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class vy extends CC{constructor(t){super(),this.moduleType=t}create(t){return new my(this.moduleType,t,[])}}class DC extends yl{constructor(t){super(),this.componentFactoryResolver=new HE(this),this.instance=null;const n=new Va([...t.providers,{provide:yl,useValue:this},{provide:lg,useValue:this.componentFactoryResolver}],t.parent||eu(),t.debugName,new Set(["environment"]));this.injector=n,t.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function yy(e,t,n=null){return new DC({providers:e,parent:t,debugName:n,runEnvironmentInitializers:!0}).injector}function mg(e){return!!_y(e)&&(Array.isArray(e)||!(e instanceof Map)&&Symbol.iterator in e)}function _y(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function Mn(e,t,n){return!Object.is(e[t],n)&&(e[t]=n,!0)}function Ry(e,t,n,r){const i=te();return Mn(i,Ii(),t)&&(ht(),os(Wt(),i,e,t,n,r)),Ry}function Dg(e,t){return e<<17|t<<2}function ac(e){return e>>17&32767}function Ny(e){return 2|e}function El(e){return(131068&e)>>2}function Oy(e,t){return-131069&e|t<<2}function xy(e){return 1|e}function rD(e,t,n,r){const i=e[n+1],c=null===t;let l=r?ac(i):El(i),d=!1;for(;0!==l&&(!1===d||c);){const E=e[l+1];OA(e[l],t)&&(d=!0,e[l+1]=r?xy(E):Ny(E)),l=r?ac(E):El(E)}d&&(e[n+1]=r?Ny(i):xy(i))}function OA(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&po(e,t)>=0}function Py(e,t,n){const r=te();return Mn(r,Ii(),t)&&di(ht(),Wt(),r,e,t,r[st],n,!1),Py}function ky(e,t,n,r,i){const l=i?"class":"style";jv(e,n,t.inputs[l],l,r)}function Fy(e,t){return function bo(e,t,n,r){const i=te(),c=ht(),l=function Ki(e){const t=at.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}(2);c.firstUpdatePass&&function fD(e,t,n,r){const i=e.data;if(null===i[n+1]){const c=i[kn()],l=function dD(e,t){return t>=e.expandoStartIndex}(e,n);(function mD(e,t){return!!(e.flags&(t?8:16))})(c,r)&&null===t&&!l&&(t=!1),t=function BA(e,t,n,r){const i=function du(e){const t=at.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}(e);let c=r?t.residualClasses:t.residualStyles;if(null===i)0===(r?t.classBindings:t.styleBindings)&&(n=th(n=Ly(null,e,t,n,r),t.attrs,r),c=null);else{const l=t.directiveStylingLast;if(-1===l||e[l]!==i)if(n=Ly(i,e,t,n,r),null===c){let p=function HA(e,t,n){const r=n?t.classBindings:t.styleBindings;if(0!==El(r))return e[ac(r)]}(e,t,r);void 0!==p&&Array.isArray(p)&&(p=Ly(null,e,t,p[1],r),p=th(p,t.attrs,r),function $A(e,t,n,r){e[ac(n?t.classBindings:t.styleBindings)]=r}(e,t,r,p))}else c=function GA(e,t,n){let r;const i=t.directiveEnd;for(let c=1+t.directiveStylingLast;c0)&&(E=!0)):b=n,i)if(0!==p){const L=ac(e[d+1]);e[r+1]=Dg(L,d),0!==L&&(e[L+1]=Oy(e[L+1],r)),e[d+1]=function MA(e,t){return 131071&e|t<<17}(e[d+1],r)}else e[r+1]=Dg(d,0),0!==d&&(e[d+1]=Oy(e[d+1],r)),d=r;else e[r+1]=Dg(p,0),0===d?d=r:e[p+1]=Oy(e[p+1],r),p=r;E&&(e[r+1]=Ny(e[r+1])),rD(e,b,r,!0),rD(e,b,r,!1),function NA(e,t,n,r,i){const c=i?e.residualClasses:e.residualStyles;null!=c&&"string"==typeof t&&po(c,t)>=0&&(n[r+1]=xy(n[r+1]))}(t,b,e,r,c),l=Dg(d,p),c?t.classBindings=l:t.styleBindings=l}(i,c,t,n,l,r)}}(c,e,l,r),t!==ut&&Mn(i,l,t)&&function pD(e,t,n,r,i,c,l,d){if(!(3&t.type))return;const p=e.data,E=p[d+1],b=function AA(e){return!(1&~e)}(E)?gD(p,t,n,i,El(E),l):void 0;bg(b)||(bg(c)||function TA(e){return!(2&~e)}(E)&&(c=gD(p,null,n,i,d,l)),function a0(e,t,n,r,i){if(t)i?e.addClass(n,r):e.removeClass(n,r);else{let c=-1===r.indexOf("-")?void 0:Kp.DashCase;null==i?e.removeStyle(n,r,c):("string"==typeof i&&i.endsWith("!important")&&(i=i.slice(0,-10),c|=Kp.Important),e.setStyle(n,r,i,c))}}(r,l,$s(kn(),n),i,c))}(c,c.data[kn()],i,i[st],e,i[l+1]=function KA(e,t){return null==e||""===e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Xt(xi(e)))),e}(t,n),r,l)}(e,t,null,!0),Fy}function Ly(e,t,n,r,i){let c=null;const l=n.directiveEnd;let d=n.directiveStylingLast;for(-1===d?d=n.directiveStart:d++;d0;){const p=e[i],E=Array.isArray(p),b=E?p[1]:p,R=null===b;let L=n[i+1];L===ut&&(L=R?bt:void 0);let V=R?ql(L,r):b===r?L:void 0;if(E&&!bg(V)&&(V=ql(p,r)),bg(V)&&(d=V,l))return d;const $=e[i+1];i=l?ac($):El($)}if(null!==t){let p=c?t.residualClasses:t.residualStyles;null!=p&&(d=ql(p,r))}return d}function bg(e){return void 0!==e}function Ig(e,t,n,r){const i=te(),c=ht(),l=He+e,d=i[st],p=c.firstCreatePass?function vR(e,t,n,r,i,c){const l=t.consts,p=pl(t,e,2,r,si(l,i));return function Fv(e,t,n,r){if(Yh()){const i=null===r?null:{"":-1},c=function I0(e,t){const n=e.directiveRegistry;let r=null,i=null;if(n)for(let c=0;c(Mi(!0),Xp(r,i,function zd(){return at.lFrame.currentNamespace}()));function DD(){return te()}const Cl=void 0;var bR=["en",[["a","p"],["AM","PM"],Cl],[["AM","PM"],Cl,Cl],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Cl,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Cl,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Cl,"{1} 'at' {0}",Cl],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function DR(e){const n=Math.floor(Math.abs(e)),r=e.toString().replace(/^[^.]*\.?/,"").length;return 1===n&&0===r?1:5}];let cd={};function Gy(e){const t=function SR(e){return e.toLowerCase().replace(/_/g,"-")}(e);let n=TD(t);if(n)return n;const r=t.split("-")[0];if(n=TD(r),n)return n;if("en"===r)return bR;throw new Ne(701,!1)}function ID(e){return Gy(e)[ld.PluralCase]}function TD(e){return e in cd||(cd[e]=Kt.ng&&Kt.ng.common&&Kt.ng.common.locales&&Kt.ng.common.locales[e]),cd[e]}var ld=function(e){return e[e.LocaleId=0]="LocaleId",e[e.DayPeriodsFormat=1]="DayPeriodsFormat",e[e.DayPeriodsStandalone=2]="DayPeriodsStandalone",e[e.DaysFormat=3]="DaysFormat",e[e.DaysStandalone=4]="DaysStandalone",e[e.MonthsFormat=5]="MonthsFormat",e[e.MonthsStandalone=6]="MonthsStandalone",e[e.Eras=7]="Eras",e[e.FirstDayOfWeek=8]="FirstDayOfWeek",e[e.WeekendRange=9]="WeekendRange",e[e.DateFormat=10]="DateFormat",e[e.TimeFormat=11]="TimeFormat",e[e.DateTimeFormat=12]="DateTimeFormat",e[e.NumberSymbols=13]="NumberSymbols",e[e.NumberFormats=14]="NumberFormats",e[e.CurrencyCode=15]="CurrencyCode",e[e.CurrencySymbol=16]="CurrencySymbol",e[e.CurrencyName=17]="CurrencyName",e[e.Currencies=18]="Currencies",e[e.Directionality=19]="Directionality",e[e.PluralCase=20]="PluralCase",e[e.ExtraData=21]="ExtraData",e}(ld||{});const Mg="en-US";let MD=Mg,WD=(e,t,n)=>{};function qy(e,t,n,r){const i=te(),c=ht(),l=zt();return Ky(c,i,i[st],l,e,t,r),qy}function Ky(e,t,n,r,i,c,l){const d=Rc(r),E=e.firstCreatePass&&rE(e),b=t[Zt],R=nE(t);let L=!0;if(3&r.type||l){const ne=fr(r,t),Ce=l?l(ne):ne,Re=R.length,le=l?Pt=>l(Rt(Pt[r.index])):r.index;let it=null;if(!l&&d&&(it=function hN(e,t,n,r){const i=e.cleanup;if(null!=i)for(let c=0;cp?d[p]:null}"string"==typeof l&&(c+=2)}return null}(e,t,i,r.index)),null!==it)(it.__ngLastListenerFn__||it).__ngNextListenerFn__=c,it.__ngLastListenerFn__=c,L=!1;else{c=QD(r,t,b,c),WD(ne,i,c);const Pt=n.listen(Ce,i,c);R.push(c,Pt),E&&E.push(i,le,Re,Re+1)}}else c=QD(r,t,b,c);const V=r.outputs;let $;if(L&&null!==V&&($=V[i])){const ne=$.length;if(ne)for(let Ce=0;Ce-1?Vr(e.index,t):t,5);let d=XD(t,n,r,c),p=i.__ngNextListenerFn__;for(;p;)d=XD(t,n,p,c)&&d,p=p.__ngNextListenerFn__;return d}}function sb(e,t,n,r){!function eC(e,t,n,r){const i=ht();if(i.firstCreatePass){const c=zt();tC(i,new QE(t,n,r),c.index),function EM(e,t){const n=e.contentQueries||(e.contentQueries=[]);t!==(n.length?n[n.length-1]:-1)&&n.push(e.queries.length-1,t)}(i,e),!(2&~n)&&(i.staticContentQueries=!0)}return JE(i,te(),n)}(e,t,n,r)}function ab(e,t,n){!function YE(e,t,n){const r=ht();return r.firstCreatePass&&(tC(r,new QE(e,t,n),-1),!(2&~t)&&(r.staticViewQueries=!0)),JE(r,te(),t)}(e,t,n)}function cb(e){const t=te(),n=ht(),r=Pn();Ti(r+1);const i=hy(n,r);if(e.dirty&&function pm(e){return!(4&~e[qe])}(t)===!(2&~i.metadata.flags)){if(null===i.matches)e.reset([]);else{const c=nC(t,r);e.reset(c,Tp),e.notifyOnChanges()}return!0}return!1}function lb(){return function fy(e,t){return e[mo].queries[t].queryList}(te(),Pn())}function ub(e){return Jo(function np(){return at.lFrame.contextLView}(),He+e)}function wb(e,t=""){const n=te(),r=ht(),i=e+He,c=r.firstCreatePass?pl(r,i,1,t,null):r.data[i],l=Eb(r,n,c,t,e);n[i]=l,zs()&&Zp(r,n,l,c),bi(c,!1)}let Eb=(e,t,n,r,i)=>(Mi(!0),function Cv(e,t){return e.createText(t)}(t[st],r));function Zy(e){return Jy("",e,""),Zy}function Jy(e,t,n){const r=te(),i=function Yu(e,t,n,r){return Mn(e,Ii(),n)?t+nt(n)+r:ut}(r,e,t,n);return i!==ut&&function ca(e,t,n){const r=$s(t,e);!function Aw(e,t,n){e.setValue(t,n)}(e[st],r,n)}(r,kn(),i),Jy}function Yy(e,t,n){sC(t)&&(t=t());const r=te();return Mn(r,Ii(),t)&&di(ht(),Wt(),r,e,t,r[st],n,!1),Yy}function Rb(e,t){const n=sC(e);return n&&e.set(t),n}function e_(e,t){const n=te(),r=ht(),i=zt();return Ky(r,n,n[st],i,e,t),e_}function t_(e,t,n,r,i){if(e=Ze(e),Array.isArray(e))for(let c=0;c>20;if(Qo(e)||!e.multi){const V=new In(E,i,Vu),$=r_(p,t,i?b:b+L,R);-1===$?(ts(Qd(d,l),c,p),n_(c,e,t.length),t.push(p),d.directiveStart++,d.directiveEnd++,i&&(d.providerIndexes+=1048576),n.push(V),l.push(V)):(n[$]=V,l[$]=V)}else{const V=r_(p,t,b+L,R),$=r_(p,t,b,b+L),Ce=$>=0&&n[$];if(i&&!Ce||!i&&!(V>=0&&n[V])){ts(Qd(d,l),c,p);const Re=function UN(e,t,n,r,i){const c=new In(e,n,Vu);return c.multi=[],c.index=t,c.componentProviders=0,xb(c,i,r&&!n),c}(i?LN:FN,n.length,i,r,E);!i&&Ce&&(n[$].providerFactory=Re),n_(c,e,t.length,0),t.push(p),d.directiveStart++,d.directiveEnd++,i&&(d.providerIndexes+=1048576),n.push(Re),l.push(Re)}else n_(c,e,V>-1?V:$,xb(n[i?$:V],E,!i&&r));!i&&r&&Ce&&n[$].componentProviders++}}}function n_(e,t,n,r){const i=Qo(t),c=function Kg(e){return!!e.useClass}(t);if(i||c){const p=(c?Ze(t.useClass):t).prototype.ngOnDestroy;if(p){const E=e.destroyHooks||(e.destroyHooks=[]);if(!i&&t.multi){const b=E.indexOf(n);-1===b?E.push(n,[r,p]):E[b+1].push(r,p)}else E.push(n,p)}}}function xb(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function r_(e,t,n,r){for(let i=n;i{n.providersResolver=(r,i)=>function kN(e,t,n){const r=ht();if(r.firstCreatePass){const i=dn(e);t_(n,r.data,r.blueprint,i,!0),t_(t,r.data,r.blueprint,i,!1)}}(r,i?i(e):e,t)}}let VN=(()=>{class e{constructor(n){this._injector=n,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n)){const r=$t(0,n.type),i=r.length>0?yy([r],this._injector,`Standalone[${n.type.name}]`):null;this.cachedInjectors.set(n,i)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(const n of this.cachedInjectors.values())null!==n&&n.destroy()}finally{this.cachedInjectors.clear()}}static#e=this.\u0275prov=kt({token:e,providedIn:"environment",factory:()=>new e(ot(ii))})}return e})();function kb(e){jr("NgStandalone"),e.getStandaloneInjector=t=>t.get(VN).getOrCreateStandaloneInjector(e)}function Ub(e,t,n,r,i,c){const l=t+n;return Mn(e,l,i)?function ss(e,t,n){return e[t]=n}(e,l+1,c?r.call(c,i):r(i)):function ah(e,t){const n=e[t];return n===ut?void 0:n}(e,l+1)}function $b(e,t){const n=ht();let r;const i=e+He;n.firstCreatePass?(r=function YN(e,t){if(t)for(let n=t.length-1;n>=0;n--){const r=t[n];if(e===r.name)return r}}(t,n.pipeRegistry),n.data[i]=r,r.onDestroy&&(n.destroyHooks??=[]).push(i,r.onDestroy)):r=n.data[i];const c=r.factory||(r.factory=Fr(r.type)),d=xn(Vu);try{const p=Xd(!1),E=c();return Xd(p),function Qy(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}(n,te(),i,E),E}finally{xn(d)}}function Gb(e,t,n){const r=e+He,i=te(),c=Jo(i,r);return function ch(e,t){return e[De].data[t].pure}(i,r)?Ub(i,function rr(){const e=at.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}(),t,c.transform,n,c):c.transform(n)}class sS{constructor(t){this.full=t;const n=t.split(".");this.major=n[0],this.minor=n[1],this.patch=n.slice(2).join(".")}}let aS=(()=>{class e{log(n){console.log(n)}warn(n){console.warn(n)}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=kt({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();const fS=new Xe(""),hS=new Xe("");let u_,ZO=(()=>{class e{constructor(n,r,i){this._ngZone=n,this.registry=r,this._isZoneStable=!0,this._callbacks=[],this.taskTrackingZone=null,u_||(function JO(e){u_=e}(i),i.addToWindow(r)),this._watchAngularEvents(),n.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{hn.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}isStable(){return this._isZoneStable&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;0!==this._callbacks.length;){let n=this._callbacks.pop();clearTimeout(n.timeoutId),n.doneCb()}});else{let n=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>!r.updateCb||!r.updateCb(n)||(clearTimeout(r.timeoutId),!1))}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(n=>({source:n.source,creationLocation:n.creationLocation,data:n.data})):[]}addCallback(n,r,i){let c=-1;r&&r>0&&(c=setTimeout(()=>{this._callbacks=this._callbacks.filter(l=>l.timeoutId!==c),n()},r)),this._callbacks.push({doneCb:n,timeoutId:c,updateCb:i})}whenStable(n,r,i){if(i&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(n,r,i),this._runCallbacksIfReady()}registerApplication(n){this.registry.registerApplication(n,this)}unregisterApplication(n){this.registry.unregisterApplication(n)}findProviders(n,r,i){return[]}static#e=this.\u0275fac=function(r){return new(r||e)(ot(hn),ot(pS),ot(hS))};static#t=this.\u0275prov=kt({token:e,factory:e.\u0275fac})}return e})(),pS=(()=>{class e{constructor(){this._applications=new Map}registerApplication(n,r){this._applications.set(n,r)}unregisterApplication(n){this._applications.delete(n)}unregisterAllApplications(){this._applications.clear()}getTestability(n){return this._applications.get(n)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(n,r=!0){return u_?.findTestabilityInTree(this,n,r)??null}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=kt({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();function d_(e){return!!e&&"function"==typeof e.then}function gS(e){return!!e&&"function"==typeof e.subscribe}const YO=new Xe("");let mS=(()=>{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((n,r)=>{this.resolve=n,this.reject=r}),this.appInits=me(YO,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const n=[];for(const i of this.appInits){const c=i();if(d_(c))n.push(c);else if(gS(c)){const l=new Promise((d,p)=>{c.subscribe({complete:d,error:p})});n.push(l)}}const r=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{r()}).catch(i=>{this.reject(i)}),0===n.length&&r(),this.initialized=!0}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=kt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Fg=new Xe("");let Io=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=me(Sp),this.afterRenderEffectManager=me(ug),this.zonelessEnabled=me(zf),this.externalTestViews=new Set,this.beforeRender=new tn.B,this.afterTick=new tn.B,this.componentTypes=[],this.components=[],this.isStable=me(Ya).hasPendingTasks.pipe((0,Bt.T)(n=>!n)),this._injector=me(ii)}get allViews(){return[...this.externalTestViews.keys(),...this._views]}get destroyed(){return this._destroyed}whenStable(){let n;return new Promise(r=>{n=this.isStable.subscribe({next:i=>{i&&r()}})}).finally(()=>{n.unsubscribe()})}get injector(){return this._injector}bootstrap(n,r){const i=n instanceof kE;if(!this._injector.get(mS).done)throw!i&&y(n),new Ne(405,!1);let l;l=i?n:this._injector.get(lg).resolveComponentFactory(n),this.componentTypes.push(l.componentType);const d=function ex(e){return e.isBoundToModule}(l)?void 0:this._injector.get(yl),E=l.create(Tn.NULL,[],r||l.selector,d),b=E.location.nativeElement,R=E.injector.get(fS,null);return R?.registerApplication(b),E.onDestroy(()=>{this.detachView(E.hostView),Lg(this.components,E),R?.unregisterApplication(b)}),this._loadComponent(E),E}tick(){this._tick(!0)}_tick(n){if(this._runningTick)throw new Ne(101,!1);const r=oe(null);try{this._runningTick=!0,this.detectChangesInAttachedViews(n)}catch(i){this.internalErrorHandler(i)}finally{this._runningTick=!1,oe(r),this.afterTick.next()}}detectChangesInAttachedViews(n){let r=null;this._injector.destroyed||(r=this._injector.get(ty,null,{optional:!0}));let i=0;const c=this.afterRenderEffectManager;for(;i<10;){const l=0===i;if(n||!l){this.beforeRender.next(l);for(let{_lView:d,notifyErrorHandler:p}of this._views)rx(d,p,l,this.zonelessEnabled)}else r?.begin?.(),r?.end?.();if(i++,c.executeInternalCallbacks(),!this.allViews.some(({_lView:d})=>kc(d))&&(c.execute(),!this.allViews.some(({_lView:d})=>kc(d))))break}}attachView(n){const r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){const r=n;Lg(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView),this.tick(),this.components.push(n);const r=this._injector.get(Fg,[]);[...this._bootstrapListeners,...r].forEach(i=>i(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>Lg(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new Ne(406,!1);const n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=kt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Lg(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}function rx(e,t,n,r){(n||kc(e))&&ng(e,t,n&&!r?0:1)}class ix{constructor(t,n){this.ngModuleFactory=t,this.componentFactories=n}}let ox=(()=>{class e{compileModuleSync(n){return new vy(n)}compileModuleAsync(n){return Promise.resolve(this.compileModuleSync(n))}compileModuleAndAllComponentsSync(n){const r=this.compileModuleSync(n),c=Pi(C(n).declarations).reduce((l,d)=>{const p=f(d);return p&&l.push(new Kf(p)),l},[]);return new ix(r,c)}compileModuleAndAllComponentsAsync(n){return Promise.resolve(this.compileModuleAndAllComponentsSync(n))}clearCache(){}clearCacheFor(n){}getModuleId(n){}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=kt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),cx=(()=>{class e{constructor(){this.zone=me(hn),this.changeDetectionScheduler=me($u),this.applicationRef=me(Io)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=kt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function f_({ngZoneFactory:e,ignoreChangesOutsideZone:t,scheduleInRootZone:n}){return e??=()=>new hn({...h_(),scheduleInRootZone:n}),[{provide:hn,useFactory:e},{provide:tr,multi:!0,useFactory:()=>{const r=me(cx,{optional:!0});return()=>r.initialize()}},{provide:tr,multi:!0,useFactory:()=>{const r=me(ux);return()=>{r.initialize()}}},!0===t?{provide:PE,useValue:!0}:[],{provide:ey,useValue:n??wp}]}function h_(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}let ux=(()=>{class e{constructor(){this.subscription=new Cn.yU,this.initialized=!1,this.zone=me(hn),this.pendingTasks=me(Ya)}initialize(){if(this.initialized)return;this.initialized=!0;let n=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(n=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{hn.assertNotInAngularZone(),queueMicrotask(()=>{null!==n&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(n),n=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{hn.assertInAngularZone(),n??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=kt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),dh=(()=>{class e{constructor(){this.appRef=me(Io),this.taskService=me(Ya),this.ngZone=me(hn),this.zonelessEnabled=me(zf),this.disableScheduling=me(PE,{optional:!0})??!1,this.zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run,this.schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}],this.subscriptions=new Cn.yU,this.angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(el):null,this.scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(me(ey,{optional:!0})??!1),this.cancelScheduledCallback=null,this.shouldRefreshViews=!1,this.useMicrotaskScheduler=!1,this.runningTick=!1,this.pendingRenderTaskId=null,this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{this.runningTick||this.cleanup()})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()})),this.disableScheduling||=!this.zonelessEnabled&&(this.ngZone instanceof uf||!this.zoneIsDefined)}notify(n){if(!this.zonelessEnabled&&5===n)return;switch(n){case 3:case 2:case 0:case 4:case 5:case 1:this.shouldRefreshViews=!0}if(!this.shouldScheduleTick())return;const r=this.useMicrotaskScheduler?sf:rf;this.pendingRenderTaskId=this.taskService.add(),this.cancelScheduledCallback=this.scheduleInRootZone?Zone.root.run(()=>r(()=>this.tick(this.shouldRefreshViews))):this.ngZone.runOutsideAngular(()=>r(()=>this.tick(this.shouldRefreshViews)))}shouldScheduleTick(){return!(this.disableScheduling||null!==this.pendingRenderTaskId||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(el+this.angularZoneId))}tick(n){if(this.runningTick||this.appRef.destroyed)return;const r=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick(n)},void 0,this.schedulerTickApplyArgs)}catch(i){throw this.taskService.remove(r),i}finally{this.cleanup()}this.useMicrotaskScheduler=!0,sf(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(r)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.shouldRefreshViews=!1,this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,null!==this.pendingRenderTaskId){const n=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(n)}}static#e=this.\u0275fac=function(r){return new(r||e)};static#t=this.\u0275prov=kt({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const g_=new Xe("",{providedIn:"root",factory:()=>me(g_,lt.Optional|lt.SkipSelf)||function dx(){return typeof $localize<"u"&&$localize.locale||Mg}()}),fx=new Xe("",{providedIn:"root",factory:()=>"USD"}),m_=new Xe("");function Vg(e){return!!e.platformInjector}let cc=null;function Ex(){return!1}let RS=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=Cx}return e})();function Cx(e){return function Dx(e,t,n){if(vo(e)&&!n){const r=Vr(e.index,t);return new Ff(r,r)}return 175&e.type?new Ff(t[sn],t):null}(zt(),te(),!(16&~e))}class PS{constructor(){}supports(t){return mg(t)}create(t){return new Mx(t)}}const Tx=(e,t)=>t;class Mx{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||Tx}forEachItem(t){let n;for(n=this._itHead;null!==n;n=n._next)t(n)}forEachOperation(t){let n=this._itHead,r=this._removalsHead,i=0,c=null;for(;n||r;){const l=!r||n&&n.currentIndex{l=this._trackByFn(i,d),null!==n&&Object.is(n.trackById,l)?(r&&(n=this._verifyReinsertion(n,d,l,i)),Object.is(n.item,d)||this._addIdentityChange(n,d)):(n=this._mismatch(n,d,l,i),r=!0),n=n._next,i++}),this.length=i;return this._truncate(n),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,n,r,i){let c;return null===t?c=this._itTail:(c=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._reinsertAfter(t,c,i)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(r,i))?(Object.is(t.item,n)||this._addIdentityChange(t,n),this._moveAfter(t,c,i)):t=this._addAfter(new Ax(n,r),c,i),t}_verifyReinsertion(t,n,r,i){let c=null===this._unlinkedRecords?null:this._unlinkedRecords.get(r,null);return null!==c?t=this._reinsertAfter(c,t._prev,i):t.currentIndex!=i&&(t.currentIndex=i,this._addToMoves(t,i)),t}_truncate(t){for(;null!==t;){const n=t._next;this._addToRemovals(this._unlink(t)),t=n}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,n,r){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const i=t._prevRemoved,c=t._nextRemoved;return null===i?this._removalsHead=c:i._nextRemoved=c,null===c?this._removalsTail=i:c._prevRemoved=i,this._insertAfter(t,n,r),this._addToMoves(t,r),t}_moveAfter(t,n,r){return this._unlink(t),this._insertAfter(t,n,r),this._addToMoves(t,r),t}_addAfter(t,n,r){return this._insertAfter(t,n,r),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,n,r){const i=null===n?this._itHead:n._next;return t._next=i,t._prev=n,null===i?this._itTail=t:i._prev=t,null===n?this._itHead=t:n._next=t,null===this._linkedRecords&&(this._linkedRecords=new kS),this._linkedRecords.put(t),t.currentIndex=r,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const n=t._prev,r=t._next;return null===n?this._itHead=r:n._next=r,null===r?this._itTail=n:r._prev=n,t}_addToMoves(t,n){return t.previousIndex===n||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new kS),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,n){return t.item=n,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class Ax{constructor(t,n){this.item=t,this.trackById=n,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Rx{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,n){let r;for(r=this._head;null!==r;r=r._nextDup)if((null===n||n<=r.currentIndex)&&Object.is(r.trackById,t))return r;return null}remove(t){const n=t._prevDup,r=t._nextDup;return null===n?this._head=r:n._nextDup=r,null===r?this._tail=n:r._prevDup=n,null===this._head}}class kS{constructor(){this.map=new Map}put(t){const n=t.trackById;let r=this.map.get(n);r||(r=new Rx,this.map.set(n,r)),r.add(t)}get(t,n){const i=this.map.get(t);return i?i.get(t,n):null}remove(t){const n=t.trackById;return this.map.get(n).remove(t)&&this.map.delete(n),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function FS(e,t,n){const r=e.previousIndex;if(null===r)return r;let i=0;return n&&r{if(n&&n.key===i)this._maybeAddToChanges(n,r),this._appendAfter=n,n=n._next;else{const c=this._getOrCreateRecordForKey(i,r);n=this._insertBeforeOrAppend(n,c)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(let r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,n){if(t){const r=t._prev;return n._next=t,n._prev=r,t._prev=n,r&&(r._next=n),t===this._mapHead&&(this._mapHead=n),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=n,n._prev=this._appendAfter):this._mapHead=n,this._appendAfter=n,null}_getOrCreateRecordForKey(t,n){if(this._records.has(t)){const i=this._records.get(t);this._maybeAddToChanges(i,n);const c=i._prev,l=i._next;return c&&(c._next=l),l&&(l._prev=c),i._next=null,i._prev=null,i}const r=new Ox(t);return this._records.set(t,r),r.currentValue=n,this._addToAdditions(r),r}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,n){Object.is(n,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=n,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,n){t instanceof Map?t.forEach(n):Object.keys(t).forEach(r=>n(t[r],r))}}class Ox{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function US(){return new C_([new PS])}let C_=(()=>{class e{static#e=this.\u0275prov=kt({token:e,providedIn:"root",factory:US});constructor(n){this.factories=n}static create(n,r){if(null!=r){const i=r.factories.slice();n=n.concat(i)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||US()),deps:[[e,new kr,new Er]]}}find(n){const r=this.factories.find(i=>i.supports(n));if(null!=r)return r;throw new Ne(901,!1)}}return e})();function VS(){return new D_([new LS])}let D_=(()=>{class e{static#e=this.\u0275prov=kt({token:e,providedIn:"root",factory:VS});constructor(n){this.factories=n}static create(n,r){if(r){const i=r.factories.slice();n=n.concat(i)}return new e(n)}static extend(n){return{provide:e,useFactory:r=>e.create(n,r||VS()),deps:[[e,new kr,new Er]]}}find(n){const r=this.factories.find(i=>i.supports(n));if(r)return r;throw new Ne(901,!1)}}return e})();function Wx(e){try{const{rootComponent:t,appProviders:n,platformProviders:r}=e,i=function wx(e=[]){if(cc)return cc;const t=function TS(e=[],t){return Tn.create({name:t,providers:[{provide:Tc,useValue:"platform"},{provide:m_,useValue:new Set([()=>cc=null])},...e]})}(e);return cc=t,function vS(){!function vn(e){cn=e}(()=>{throw new Ne(600,!1)})}(),function MS(e){e.get(av,null)?.forEach(n=>n())}(t),t}(r),c=[f_({}),{provide:$u,useExisting:dh},...n||[]];return function bS(e){const t=Vg(e)?e.r3Injector:e.moduleRef.injector,n=t.get(hn);return n.run(()=>{Vg(e)?e.r3Injector.resolveInjectorInitializers():e.moduleRef.resolveInjectorInitializers();const r=t.get(Eo,null);let i;if(n.runOutsideAngular(()=>{i=n.onError.subscribe({next:c=>{r.handleError(c)}})}),Vg(e)){const c=()=>t.destroy(),l=e.platformInjector.get(m_);l.add(c),t.onDestroy(()=>{i.unsubscribe(),l.delete(c)})}else e.moduleRef.onDestroy(()=>{Lg(e.allPlatformModules,e.moduleRef),i.unsubscribe()});return function nx(e,t,n){try{const r=n();return d_(r)?r.catch(i=>{throw t.runOutsideAngular(()=>e.handleError(i)),i}):r}catch(r){throw t.runOutsideAngular(()=>e.handleError(r)),r}}(r,n,()=>{const c=t.get(mS);return c.runInitializers(),c.donePromise.then(()=>{if(function AR(e){"string"==typeof e&&(MD=e.toLowerCase().replace(/_/g,"-"))}(t.get(g_,Mg)||Mg),Vg(e)){const d=t.get(Io);return void 0!==e.rootComponent&&d.bootstrap(e.rootComponent),d}return function vx(e,t){const n=e.injector.get(Io);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(r=>n.bootstrap(r));else{if(!e.instance.ngDoBootstrap)throw new Ne(-403,!1);e.instance.ngDoBootstrap(n)}t.push(e)}(e.moduleRef,e.allPlatformModules),e.moduleRef})})})}({r3Injector:new DC({providers:c,parent:i,debugName:"",runEnvironmentInitializers:!1}).injector,platformInjector:i,rootComponent:t})}catch(t){return Promise.reject(t)}}const tI=new Xe("");function hP(e){return"boolean"==typeof e?e:null!=e&&"false"!==e}function gP(e,t){jr("NgSignals");const n=function Le(e){const t=Object.create(qn);t.computation=e;const n=()=>{if(Ie(t),J(t),t.value===mn)throw t.error;return t.value};return n[W]=t,n}(e);return t?.equal&&(n[W].equal=t.equal),n}function mP(e){const t=oe(null);try{return e()}finally{oe(t)}}},345:($e,he,O)=>{"use strict";O.d(he,{B8:()=>re,hE:()=>or});var S=O(177),U=O(3953);class x extends S.VF{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class _ extends x{static makeCurrent(){(0,S.ZD)(new _)}onAndCancel(X,F,H){return X.addEventListener(F,H),()=>{X.removeEventListener(F,H)}}dispatchEvent(X,F){X.dispatchEvent(F)}remove(X){X.remove()}createElement(X,F){return(F=F||this.getDefaultDocument()).createElement(X)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(X){return X.nodeType===Node.ELEMENT_NODE}isShadowRoot(X){return X instanceof DocumentFragment}getGlobalEventTarget(X,F){return"window"===F?window:"document"===F?X:"body"===F?X.body:null}getBaseHref(X){const F=function oe(){return W=W||document.querySelector("base"),W?W.getAttribute("href"):null}();return null==F?null:function _e(Q){return new URL(Q,document.baseURI).pathname}(F)}resetBaseElement(){W=null}getUserAgent(){return window.navigator.userAgent}getCookie(X){return(0,S._b)(document.cookie,X)}}let W=null,Ae=(()=>{class Q{build(){return new XMLHttpRequest}static#e=this.\u0275fac=function(H){return new(H||Q)};static#t=this.\u0275prov=U.jDH({token:Q,factory:Q.\u0275fac})}return Q})();const Y=new U.nKC("");let J=(()=>{class Q{constructor(F,H){this._zone=H,this._eventNameToPlugin=new Map,F.forEach(ce=>{ce.manager=this}),this._plugins=F.slice().reverse()}addEventListener(F,H,ce){return this._findPluginFor(H).addEventListener(F,H,ce)}getZone(){return this._zone}_findPluginFor(F){let H=this._eventNameToPlugin.get(F);if(H)return H;if(H=this._plugins.find(xe=>xe.supports(F)),!H)throw new U.wOt(5101,!1);return this._eventNameToPlugin.set(F,H),H}static#e=this.\u0275fac=function(H){return new(H||Q)(U.KVO(Y),U.KVO(U.SKi))};static#t=this.\u0275prov=U.jDH({token:Q,factory:Q.\u0275fac})}return Q})();class ae{constructor(X){this._doc=X}}const Ie="ng-app-id";let se=(()=>{class Q{constructor(F,H,ce,xe={}){this.doc=F,this.appId=H,this.nonce=ce,this.platformId=xe,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=(0,S.Vy)(xe),this.resetHostNodes()}addStyles(F){for(const H of F)1===this.changeUsageCount(H,1)&&this.onStyleAdded(H)}removeStyles(F){for(const H of F)this.changeUsageCount(H,-1)<=0&&this.onStyleRemoved(H)}ngOnDestroy(){const F=this.styleNodesInDOM;F&&(F.forEach(H=>H.remove()),F.clear());for(const H of this.getAllStyles())this.onStyleRemoved(H);this.resetHostNodes()}addHost(F){this.hostNodes.add(F);for(const H of this.getAllStyles())this.addStyleToHost(F,H)}removeHost(F){this.hostNodes.delete(F)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(F){for(const H of this.hostNodes)this.addStyleToHost(H,F)}onStyleRemoved(F){const H=this.styleRef;H.get(F)?.elements?.forEach(ce=>ce.remove()),H.delete(F)}collectServerRenderedStyles(){const F=this.doc.head?.querySelectorAll(`style[${Ie}="${this.appId}"]`);if(F?.length){const H=new Map;return F.forEach(ce=>{null!=ce.textContent&&H.set(ce.textContent,ce)}),H}return null}changeUsageCount(F,H){const ce=this.styleRef;if(ce.has(F)){const xe=ce.get(F);return xe.usage+=H,xe.usage}return ce.set(F,{usage:H,elements:[]}),H}getStyleElement(F,H){const ce=this.styleNodesInDOM,xe=ce?.get(H);if(xe?.parentNode===F)return ce.delete(H),xe.removeAttribute(Ie),xe;{const Ye=this.doc.createElement("style");return this.nonce&&Ye.setAttribute("nonce",this.nonce),Ye.textContent=H,this.platformIsServer&&Ye.setAttribute(Ie,this.appId),F.appendChild(Ye),Ye}}addStyleToHost(F,H){const ce=this.getStyleElement(F,H),xe=this.styleRef,Ye=xe.get(H)?.elements;Ye?Ye.push(ce):xe.set(H,{elements:[ce],usage:1})}resetHostNodes(){const F=this.hostNodes;F.clear(),F.add(this.doc.head)}static#e=this.\u0275fac=function(H){return new(H||Q)(U.KVO(S.qQ),U.KVO(U.sZ2),U.KVO(U.BIS,8),U.KVO(U.Agw))};static#t=this.\u0275prov=U.jDH({token:Q,factory:Q.\u0275fac})}return Q})();const Oe={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},Ue=/%COMP%/g,ge=new U.nKC("",{providedIn:"root",factory:()=>!0});function Ge(Q,X){return X.map(F=>F.replace(Ue,Q))}let Pe=(()=>{class Q{constructor(F,H,ce,xe,Ye,Ot,Gt,yn=null){this.eventManager=F,this.sharedStylesHost=H,this.appId=ce,this.removeStylesOnCompDestroy=xe,this.doc=Ye,this.platformId=Ot,this.ngZone=Gt,this.nonce=yn,this.rendererByCompId=new Map,this.platformIsServer=(0,S.Vy)(Ot),this.defaultRenderer=new Te(F,Ye,Gt,this.platformIsServer)}createRenderer(F,H){if(!F||!H)return this.defaultRenderer;this.platformIsServer&&H.encapsulation===U.gXe.ShadowDom&&(H={...H,encapsulation:U.gXe.Emulated});const ce=this.getOrCreateRenderer(F,H);return ce instanceof an?ce.applyToHost(F):ce instanceof qn&&ce.applyStyles(),ce}getOrCreateRenderer(F,H){const ce=this.rendererByCompId;let xe=ce.get(H.id);if(!xe){const Ye=this.doc,Ot=this.ngZone,Gt=this.eventManager,yn=this.sharedStylesHost,Ln=this.removeStylesOnCompDestroy,Dn=this.platformIsServer;switch(H.encapsulation){case U.gXe.Emulated:xe=new an(Gt,yn,H,this.appId,Ln,Ye,Ot,Dn);break;case U.gXe.ShadowDom:return new mn(Gt,yn,F,H,Ye,Ot,this.nonce,Dn);default:xe=new qn(Gt,yn,H,Ln,Ye,Ot,Dn)}ce.set(H.id,xe)}return xe}ngOnDestroy(){this.rendererByCompId.clear()}static#e=this.\u0275fac=function(H){return new(H||Q)(U.KVO(J),U.KVO(se),U.KVO(U.sZ2),U.KVO(ge),U.KVO(S.qQ),U.KVO(U.Agw),U.KVO(U.SKi),U.KVO(U.BIS))};static#t=this.\u0275prov=U.jDH({token:Q,factory:Q.\u0275fac})}return Q})();class Te{constructor(X,F,H,ce){this.eventManager=X,this.doc=F,this.ngZone=H,this.platformIsServer=ce,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(X,F){return F?this.doc.createElementNS(Oe[F]||F,X):this.doc.createElement(X)}createComment(X){return this.doc.createComment(X)}createText(X){return this.doc.createTextNode(X)}appendChild(X,F){(Qe(X)?X.content:X).appendChild(F)}insertBefore(X,F,H){X&&(Qe(X)?X.content:X).insertBefore(F,H)}removeChild(X,F){F.remove()}selectRootElement(X,F){let H="string"==typeof X?this.doc.querySelector(X):X;if(!H)throw new U.wOt(-5104,!1);return F||(H.textContent=""),H}parentNode(X){return X.parentNode}nextSibling(X){return X.nextSibling}setAttribute(X,F,H,ce){if(ce){F=ce+":"+F;const xe=Oe[ce];xe?X.setAttributeNS(xe,F,H):X.setAttribute(F,H)}else X.setAttribute(F,H)}removeAttribute(X,F,H){if(H){const ce=Oe[H];ce?X.removeAttributeNS(ce,F):X.removeAttribute(`${H}:${F}`)}else X.removeAttribute(F)}addClass(X,F){X.classList.add(F)}removeClass(X,F){X.classList.remove(F)}setStyle(X,F,H,ce){ce&(U.czy.DashCase|U.czy.Important)?X.style.setProperty(F,H,ce&U.czy.Important?"important":""):X.style[F]=H}removeStyle(X,F,H){H&U.czy.DashCase?X.style.removeProperty(F):X.style[F]=""}setProperty(X,F,H){null!=X&&(X[F]=H)}setValue(X,F){X.nodeValue=F}listen(X,F,H){if("string"==typeof X&&!(X=(0,S.QT)().getGlobalEventTarget(this.doc,X)))throw new Error(`Unsupported event target ${X} for event ${F}`);return this.eventManager.addEventListener(X,F,this.decoratePreventDefault(H))}decoratePreventDefault(X){return F=>{if("__ngUnwrap__"===F)return X;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>X(F)):X(F))&&F.preventDefault()}}}function Qe(Q){return"TEMPLATE"===Q.tagName&&void 0!==Q.content}class mn extends Te{constructor(X,F,H,ce,xe,Ye,Ot,Gt){super(X,xe,Ye,Gt),this.sharedStylesHost=F,this.hostEl=H,this.shadowRoot=H.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const yn=Ge(ce.id,ce.styles);for(const Ln of yn){const Dn=document.createElement("style");Ot&&Dn.setAttribute("nonce",Ot),Dn.textContent=Ln,this.shadowRoot.appendChild(Dn)}}nodeOrShadowRoot(X){return X===this.hostEl?this.shadowRoot:X}appendChild(X,F){return super.appendChild(this.nodeOrShadowRoot(X),F)}insertBefore(X,F,H){return super.insertBefore(this.nodeOrShadowRoot(X),F,H)}removeChild(X,F){return super.removeChild(null,F)}parentNode(X){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(X)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class qn extends Te{constructor(X,F,H,ce,xe,Ye,Ot,Gt){super(X,xe,Ye,Ot),this.sharedStylesHost=F,this.removeStylesOnCompDestroy=ce,this.styles=Gt?Ge(Gt,H.styles):H.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class an extends qn{constructor(X,F,H,ce,xe,Ye,Ot,Gt){const yn=ce+"-"+H.id;super(X,F,H,xe,Ye,Ot,Gt,yn),this.contentAttr=function de(Q){return"_ngcontent-%COMP%".replace(Ue,Q)}(yn),this.hostAttr=function be(Q){return"_nghost-%COMP%".replace(Ue,Q)}(yn)}applyToHost(X){this.applyStyles(),this.setAttribute(X,this.hostAttr,"")}createElement(X,F){const H=super.createElement(X,F);return super.setAttribute(H,this.contentAttr,""),H}}let cn=(()=>{class Q extends ae{constructor(F){super(F)}supports(F){return!0}addEventListener(F,H,ce){return F.addEventListener(H,ce,!1),()=>this.removeEventListener(F,H,ce)}removeEventListener(F,H,ce){return F.removeEventListener(H,ce)}static#e=this.\u0275fac=function(H){return new(H||Q)(U.KVO(S.qQ))};static#t=this.\u0275prov=U.jDH({token:Q,factory:Q.\u0275fac})}return Q})(),pt=(()=>{class Q extends ae{constructor(F){super(F),this.delegate=(0,U.WQX)(U.zAP,{optional:!0})}supports(F){return!!this.delegate&&this.delegate.supports(F)}addEventListener(F,H,ce){return this.delegate.addEventListener(F,H,ce)}removeEventListener(F,H,ce){return this.delegate.removeEventListener(F,H,ce)}static#e=this.\u0275fac=function(H){return new(H||Q)(U.KVO(S.qQ))};static#t=this.\u0275prov=U.jDH({token:Q,factory:Q.\u0275fac})}return Q})();const vn=["alt","control","meta","shift"],z={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Z={alt:Q=>Q.altKey,control:Q=>Q.ctrlKey,meta:Q=>Q.metaKey,shift:Q=>Q.shiftKey};let ee=(()=>{class Q extends ae{constructor(F){super(F)}supports(F){return null!=Q.parseEventName(F)}addEventListener(F,H,ce){const xe=Q.parseEventName(H),Ye=Q.eventCallback(xe.fullKey,ce,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>(0,S.QT)().onAndCancel(F,xe.domEventName,Ye))}static parseEventName(F){const H=F.toLowerCase().split("."),ce=H.shift();if(0===H.length||"keydown"!==ce&&"keyup"!==ce)return null;const xe=Q._normalizeKey(H.pop());let Ye="",Ot=H.indexOf("code");if(Ot>-1&&(H.splice(Ot,1),Ye="code."),vn.forEach(yn=>{const Ln=H.indexOf(yn);Ln>-1&&(H.splice(Ln,1),Ye+=yn+".")}),Ye+=xe,0!=H.length||0===xe.length)return null;const Gt={};return Gt.domEventName=ce,Gt.fullKey=Ye,Gt}static matchEventFullKeyCode(F,H){let ce=z[F.key]||F.key,xe="";return H.indexOf("code.")>-1&&(ce=F.code,xe="code."),!(null==ce||!ce)&&(ce=ce.toLowerCase()," "===ce?ce="space":"."===ce&&(ce="dot"),vn.forEach(Ye=>{Ye!==ce&&(0,Z[Ye])(F)&&(xe+=Ye+".")}),xe+=ce,xe===H)}static eventCallback(F,H,ce){return xe=>{Q.matchEventFullKeyCode(xe,F)&&ce.runGuarded(()=>H(xe))}}static _normalizeKey(F){return"esc"===F?"escape":F}static#e=this.\u0275fac=function(H){return new(H||Q)(U.KVO(S.qQ))};static#t=this.\u0275prov=U.jDH({token:Q,factory:Q.\u0275fac})}return Q})();function re(Q,X){return(0,U.TL3)({rootComponent:Q,...pe(X)})}function pe(Q){return{appProviders:[...tn,...Q?.providers??[]],platformProviders:_t}}const _t=[{provide:U.Agw,useValue:S.AJ},{provide:U.PLl,useValue:function gt(){_.makeCurrent()},multi:!0},{provide:S.qQ,useFactory:function je(){return(0,U.TL$)(document),document},deps:[]}],tn=[{provide:U.H8p,useValue:"root"},{provide:U.zcH,useFactory:function un(){return new U.zcH},deps:[]},{provide:Y,useClass:cn,multi:!0,deps:[S.qQ,U.SKi,U.Agw]},{provide:Y,useClass:ee,multi:!0,deps:[S.qQ]},{provide:Y,useClass:pt,multi:!0},Pe,se,J,{provide:U._9s,useExisting:Pe},{provide:S.N0,useClass:Ae,deps:[]},[]];let or=(()=>{class Q{constructor(F){this._doc=F}getTitle(){return this._doc.title}setTitle(F){this._doc.title=F||""}static#e=this.\u0275fac=function(H){return new(H||Q)(U.KVO(S.qQ))};static#t=this.\u0275prov=U.jDH({token:Q,factory:Q.\u0275fac,providedIn:"root"})}return Q})()},8540:($e,he,O)=>{"use strict";O.d(he,{nX:()=>Jn,Ix:()=>Cr,Wk:()=>Ec,n3:()=>yi,lh:()=>bt,Ii:()=>Sd});var S=O(3953),U=O(4402),x=O(6648),_=O(7673),W=O(4412);const _e=(0,O(1853).L)(f=>function(){f(this),this.name="EmptyError",this.message="no elements in sequence"});var Me=O(1985),Ae=O(3073),Y=O(3669),J=O(6450),ae=O(3794),Ie=O(8496),se=O(4360),Oe=O(5225);function Ue(...f){const v=(0,ae.lI)(f),h=(0,ae.ms)(f),{args:y,keys:C}=(0,Ae.D)(f);if(0===y.length)return(0,x.H)([],v);const A=new Me.c(function Je(f,v,h=Y.D){return y=>{ie(v,()=>{const{length:C}=f,A=new Array(C);let k=C,G=C;for(let j=0;j{const ye=(0,x.H)(f[j],v);let Be=!1;ye.subscribe((0,se._)(y,et=>{A[j]=et,Be||(Be=!0,G--),G||y.next(h(A.slice()))},()=>{--k||y.complete()}))},y)},y)}}(y,v,C?k=>(0,Ie.e)(C,k):Y.D));return h?A.pipe((0,J.I)(h)):A}function ie(f,v,h){f?(0,Oe.N)(h,f,v):v()}var ve=O(1397);function de(...f){return function ge(){return function ze(f=1/0){return(0,ve.Z)(Y.D,f)}(1)}()((0,x.H)(f,(0,ae.lI)(f)))}var be=O(8750);function Ge(f){return new Me.c(v=>{(0,be.Tg)(f()).subscribe(v)})}var Pe=O(1203),Te=O(8810),Le=O(983),Ke=O(8359),Qe=O(9974);function mn(){return(0,Qe.N)((f,v)=>{let h=null;f._refCount++;const y=(0,se._)(v,void 0,void 0,void 0,()=>{if(!f||f._refCount<=0||0<--f._refCount)return void(h=null);const C=f._connection,A=h;h=null,C&&(!A||C===A)&&C.unsubscribe(),v.unsubscribe()});f.subscribe(y),y.closed||(h=f.connect())})}class qn extends Me.c{constructor(v,h){super(),this.source=v,this.subjectFactory=h,this._subject=null,this._refCount=0,this._connection=null,(0,Qe.S)(v)&&(this.lift=v.lift)}_subscribe(v){return this.getSubject().subscribe(v)}getSubject(){const v=this._subject;return(!v||v.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:v}=this;this._subject=this._connection=null,v?.unsubscribe()}connect(){let v=this._connection;if(!v){v=this._connection=new Ke.yU;const h=this.getSubject();v.add(this.source.subscribe((0,se._)(h,void 0,()=>{this._teardown(),h.complete()},y=>{this._teardown(),h.error(y)},()=>this._teardown()))),v.closed&&(this._connection=null,v=Ke.yU.EMPTY)}return v}refCount(){return mn()(this)}}var an=O(1413),cn=O(177),pt=O(6354),vn=O(5558),z=O(6697),ee=O(5964);function re(f){return(0,Qe.N)((v,h)=>{let y=!1;v.subscribe((0,se._)(h,C=>{y=!0,h.next(C)},()=>{y||h.next(f),h.complete()}))})}function Ee(f=pe){return(0,Qe.N)((v,h)=>{let y=!1;v.subscribe((0,se._)(h,C=>{y=!0,h.next(C)},()=>y?h.complete():h.error(f())))})}function pe(){return new _e}function Ve(f,v){const h=arguments.length>=2;return y=>y.pipe(f?(0,ee.p)((C,A)=>f(C,A,y)):Y.D,(0,z.s)(1),h?re(v):Ee(()=>new _e))}var gt=O(274),un=O(8071);function je(f,v,h){const y=(0,un.T)(f)||v||h?{next:f,error:v,complete:h}:f;return y?(0,Qe.N)((C,A)=>{var k;null===(k=y.subscribe)||void 0===k||k.call(y);let G=!0;C.subscribe((0,se._)(A,j=>{var ye;null===(ye=y.next)||void 0===ye||ye.call(y,j),A.next(j)},()=>{var j;G=!1,null===(j=y.complete)||void 0===j||j.call(y),A.complete()},j=>{var ye;G=!1,null===(ye=y.error)||void 0===ye||ye.call(y,j),A.error(j)},()=>{var j,ye;G&&(null===(j=y.unsubscribe)||void 0===j||j.call(y)),null===(ye=y.finalize)||void 0===ye||ye.call(y)}))}):Y.D}var _t=O(9437);function It(f){return f<=0?()=>Le.w:(0,Qe.N)((v,h)=>{let y=[];v.subscribe((0,se._)(h,C=>{y.push(C),f{for(const C of y)h.next(C);h.complete()},void 0,()=>{y=null}))})}var Bt=O(980),Kn=O(5343),Fi=O(345);const tt="primary",$r=Symbol("RouteTitle");class Tr{constructor(v){this.params=v||{}}has(v){return Object.prototype.hasOwnProperty.call(this.params,v)}get(v){if(this.has(v)){const h=this.params[v];return Array.isArray(h)?h[0]:h}return null}getAll(v){if(this.has(v)){const h=this.params[v];return Array.isArray(h)?h:[h]}return[]}get keys(){return Object.keys(this.params)}}function Li(f){return new Tr(f)}function sr(f,v,h){const y=h.path.split("/");if(y.length>f.length||"full"===h.pathMatch&&(v.hasChildren()||y.lengthy[A]===C)}return f===v}function ar(f){return f.length>0?f[f.length-1]:null}function cr(f){return(0,U.A)(f)?f:(0,S.jNT)(f)?(0,x.H)(Promise.resolve(f)):(0,_.of)(f)}const Xn={exact:function mt(f,v,h){if(!Q(f.segments,v.segments)||!vr(f.segments,v.segments,h)||f.numberOfChildren!==v.numberOfChildren)return!1;for(const y in v.children)if(!f.children[y]||!mt(f.children[y],v.children[y],h))return!1;return!0},subset:Yi},ls={exact:function lc(f,v){return we(f,v)},subset:function Ht(f,v){return Object.keys(v).length<=Object.keys(f).length&&Object.keys(v).every(h=>Ji(f[h],v[h]))},ignored:()=>!0};function qt(f,v,h){return Xn[h.paths](f.root,v.root,h.matrixParams)&&ls[h.queryParams](f.queryParams,v.queryParams)&&!("exact"===h.fragment&&f.fragment!==v.fragment)}function Yi(f,v,h){return To(f,v,v.segments,h)}function To(f,v,h,y){if(f.segments.length>h.length){const C=f.segments.slice(0,h.length);return!(!Q(C,h)||v.hasChildren()||!vr(C,h,y))}if(f.segments.length===h.length){if(!Q(f.segments,h)||!vr(f.segments,h,y))return!1;for(const C in v.children)if(!f.children[C]||!Yi(f.children[C],v.children[C],y))return!1;return!0}{const C=h.slice(0,f.segments.length),A=h.slice(f.segments.length);return!!(Q(f.segments,C)&&vr(f.segments,C,y)&&f.children[tt])&&To(f.children[tt],v,A,y)}}function vr(f,v,h){return v.every((y,C)=>ls[h](f[C].parameters,y.parameters))}class pi{constructor(v=new Et([],{}),h={},y=null){this.root=v,this.queryParams=h,this.fragment=y}get queryParamMap(){return this._queryParamMap??=Li(this.queryParams),this._queryParamMap}toString(){return ce.serialize(this)}}class Et{constructor(v,h){this.segments=v,this.children=h,this.parent=null,Object.values(h).forEach(y=>y.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return xe(this)}}class yr{constructor(v,h){this.path=v,this.parameters=h}get parameterMap(){return this._parameterMap??=Li(this.parameters),this._parameterMap}toString(){return uc(this)}}function Q(f,v){return f.length===v.length&&f.every((h,y)=>h.path===v[y].path)}let F=(()=>{class f{static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=S.jDH({token:f,factory:()=>new H,providedIn:"root"})}return f})();class H{parse(v){const h=new ha(v);return new pi(h.parseRootSegment(),h.parseQueryParams(),h.parseFragment())}serialize(v){const h=`/${Ye(v.root,!0)}`,y=function dc(f){const v=Object.entries(f).map(([h,y])=>Array.isArray(y)?y.map(C=>`${Gt(h)}=${Gt(C)}`).join("&"):`${Gt(h)}=${Gt(y)}`).filter(h=>h);return v.length?`?${v.join("&")}`:""}(v.queryParams);return`${h}${y}${"string"==typeof v.fragment?`#${function yn(f){return encodeURI(f)}(v.fragment)}`:""}`}}const ce=new H;function xe(f){return f.segments.map(v=>uc(v)).join("/")}function Ye(f,v){if(!f.hasChildren())return xe(f);if(v){const h=f.children[tt]?Ye(f.children[tt],!1):"",y=[];return Object.entries(f.children).forEach(([C,A])=>{C!==tt&&y.push(`${C}:${Ye(A,!1)}`)}),y.length>0?`${h}(${y.join("//")})`:h}{const h=function X(f,v){let h=[];return Object.entries(f.children).forEach(([y,C])=>{y===tt&&(h=h.concat(v(C,y)))}),Object.entries(f.children).forEach(([y,C])=>{y!==tt&&(h=h.concat(v(C,y)))}),h}(f,(y,C)=>C===tt?[Ye(f.children[tt],!1)]:[`${C}:${Ye(y,!1)}`]);return 1===Object.keys(f.children).length&&null!=f.children[tt]?`${xe(f)}/${h[0]}`:`${xe(f)}/(${h.join("//")})`}}function Ot(f){return encodeURIComponent(f).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Gt(f){return Ot(f).replace(/%3B/gi,";")}function Ln(f){return Ot(f).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Dn(f){return decodeURIComponent(f)}function bl(f){return Dn(f.replace(/\+/g,"%20"))}function uc(f){return`${Ln(f.path)}${function ua(f){return Object.entries(f).map(([v,h])=>`;${Ln(v)}=${Ln(h)}`).join("")}(f.parameters)}`}const hd=/^[^\/()?;#]+/;function Mo(f){const v=f.match(hd);return v?v[0]:""}const fc=/^[^\/()?;=#]+/,us=/^[^=?&#]+/,ds=/^[^&#]+/;class ha{constructor(v){this.url=v,this.remaining=v}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Et([],{}):new Et([],this.parseChildren())}parseQueryParams(){const v={};if(this.consumeOptional("?"))do{this.parseQueryParam(v)}while(this.consumeOptional("&"));return v}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const v=[];for(this.peekStartsWith("(")||v.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),v.push(this.parseSegment());let h={};this.peekStartsWith("/(")&&(this.capture("/"),h=this.parseParens(!0));let y={};return this.peekStartsWith("(")&&(y=this.parseParens(!1)),(v.length>0||Object.keys(h).length>0)&&(y[tt]=new Et(v,h)),y}parseSegment(){const v=Mo(this.remaining);if(""===v&&this.peekStartsWith(";"))throw new S.wOt(4009,!1);return this.capture(v),new yr(Dn(v),this.parseMatrixParams())}parseMatrixParams(){const v={};for(;this.consumeOptional(";");)this.parseParam(v);return v}parseParam(v){const h=function da(f){const v=f.match(fc);return v?v[0]:""}(this.remaining);if(!h)return;this.capture(h);let y="";if(this.consumeOptional("=")){const C=Mo(this.remaining);C&&(y=C,this.capture(y))}v[Dn(h)]=Dn(y)}parseQueryParam(v){const h=function eo(f){const v=f.match(us);return v?v[0]:""}(this.remaining);if(!h)return;this.capture(h);let y="";if(this.consumeOptional("=")){const k=function fa(f){const v=f.match(ds);return v?v[0]:""}(this.remaining);k&&(y=k,this.capture(y))}const C=bl(h),A=bl(y);if(v.hasOwnProperty(C)){let k=v[C];Array.isArray(k)||(k=[k],v[C]=k),k.push(A)}else v[C]=A}parseParens(v){const h={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const y=Mo(this.remaining),C=this.remaining[y.length];if("/"!==C&&")"!==C&&";"!==C)throw new S.wOt(4010,!1);let A;y.indexOf(":")>-1?(A=y.slice(0,y.indexOf(":")),this.capture(A),this.capture(":")):v&&(A=tt);const k=this.parseChildren();h[A]=1===Object.keys(k).length?k[tt]:new Et([],k),this.consumeOptional("//")}return h}peekStartsWith(v){return this.remaining.startsWith(v)}consumeOptional(v){return!!this.peekStartsWith(v)&&(this.remaining=this.remaining.substring(v.length),!0)}capture(v){if(!this.consumeOptional(v))throw new S.wOt(4011,!1)}}function gi(f){return f.segments.length>0?new Et([],{[tt]:f}):f}function Ao(f){const v={};for(const[y,C]of Object.entries(f.children)){const A=Ao(C);if(y===tt&&0===A.segments.length&&A.hasChildren())for(const[k,G]of Object.entries(A.children))v[k]=G;else(A.segments.length>0||A.hasChildren())&&(v[y]=A)}return function pa(f){if(1===f.numberOfChildren&&f.children[tt]){const v=f.children[tt];return new Et(f.segments.concat(v.segments),v.children)}return f}(new Et(f.segments,v))}function Ui(f){return f instanceof pi}function ga(f){let v;const C=gi(function h(A){const k={};for(const j of A.children){const ye=h(j);k[j.outlet]=ye}const G=new Et(A.url,k);return A===f&&(v=G),G}(f.root));return v??C}function Ro(f,v,h,y){let C=f;for(;C.parent;)C=C.parent;if(0===v.length)return no(C,C,C,h,y);const A=function va(f){if("string"==typeof f[0]&&1===f.length&&"/"===f[0])return new ma(!0,0,f);let v=0,h=!1;const y=f.reduce((C,A,k)=>{if("object"==typeof A&&null!=A){if(A.outlets){const G={};return Object.entries(A.outlets).forEach(([j,ye])=>{G[j]="string"==typeof ye?ye.split("/"):ye}),[...C,{outlets:G}]}if(A.segmentPath)return[...C,A.segmentPath]}return"string"!=typeof A?[...C,A]:0===k?(A.split("/").forEach((G,j)=>{0==j&&"."===G||(0==j&&""===G?h=!0:".."===G?v++:""!=G&&C.push(G))}),C):[...C,A]},[]);return new ma(h,v,y)}(v);if(A.toRoot())return no(C,C,new Et([],{}),h,y);const k=function hc(f,v,h){if(f.isAbsolute)return new Mr(v,!0,0);if(!h)return new Mr(v,!1,NaN);if(null===h.parent)return new Mr(h,!0,0);const y=Qn(f.commands[0])?0:1;return function zr(f,v,h){let y=f,C=v,A=h;for(;A>C;){if(A-=C,y=y.parent,!y)throw new S.wOt(4005,!1);C=y.segments.length}return new Mr(y,!1,C-A)}(h,h.segments.length-1+y,f.numberOfDoubleDots)}(A,C,f),G=k.processChildren?Wr(k.segmentGroup,k.index,A.commands):mi(k.segmentGroup,k.index,A.commands);return no(C,k.segmentGroup,G,h,y)}function Qn(f){return"object"==typeof f&&null!=f&&!f.outlets&&!f.segmentPath}function to(f){return"object"==typeof f&&null!=f&&f.outlets}function no(f,v,h,y,C){let k,A={};y&&Object.entries(y).forEach(([j,ye])=>{A[j]=Array.isArray(ye)?ye.map(Be=>`${Be}`):`${ye}`}),k=f===v?h:No(f,v,h);const G=gi(Ao(k));return new pi(G,A,C)}function No(f,v,h){const y={};return Object.entries(f.children).forEach(([C,A])=>{y[C]=A===v?h:No(A,v,h)}),new Et(f.segments,y)}class ma{constructor(v,h,y){if(this.isAbsolute=v,this.numberOfDoubleDots=h,this.commands=y,v&&y.length>0&&Qn(y[0]))throw new S.wOt(4003,!1);const C=y.find(to);if(C&&C!==ar(y))throw new S.wOt(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Mr{constructor(v,h,y){this.segmentGroup=v,this.processChildren=h,this.index=y}}function mi(f,v,h){if(f??=new Et([],{}),0===f.segments.length&&f.hasChildren())return Wr(f,v,h);const y=function qr(f,v,h){let y=0,C=v;const A={match:!1,pathIndex:0,commandIndex:0};for(;C=h.length)return A;const k=f.segments[C],G=h[y];if(to(G))break;const j=`${G}`,ye=y0&&void 0===j)break;if(j&&ye&&"object"==typeof ye&&void 0===ye.outlets){if(!_a(j,ye,k))return A;y+=2}else{if(!_a(j,{},k))return A;y++}C++}return{match:!0,pathIndex:C,commandIndex:y}}(f,v,h),C=h.slice(y.commandIndex);if(y.match&&y.pathIndexA!==tt)&&f.children[tt]&&1===f.numberOfChildren&&0===f.children[tt].segments.length){const A=Wr(f.children[tt],v,h);return new Et(f.segments,A.children)}return Object.entries(y).forEach(([A,k])=>{"string"==typeof k&&(k=[k]),null!==k&&(C[A]=mi(f.children[A],v,k))}),Object.entries(f.children).forEach(([A,k])=>{void 0===y[A]&&(C[A]=k)}),new Et(f.segments,C)}}function ya(f,v,h){const y=f.segments.slice(0,v);let C=0;for(;C{"string"==typeof y&&(y=[y]),null!==y&&(v[h]=ya(new Et([],{}),0,y))}),v}function nn(f){const v={};return Object.entries(f).forEach(([h,y])=>v[h]=`${y}`),v}function _a(f,v,h){return f==h.path&&we(v,h.parameters)}const Vi="imperative";var dt=function(f){return f[f.NavigationStart=0]="NavigationStart",f[f.NavigationEnd=1]="NavigationEnd",f[f.NavigationCancel=2]="NavigationCancel",f[f.NavigationError=3]="NavigationError",f[f.RoutesRecognized=4]="RoutesRecognized",f[f.ResolveStart=5]="ResolveStart",f[f.ResolveEnd=6]="ResolveEnd",f[f.GuardsCheckStart=7]="GuardsCheckStart",f[f.GuardsCheckEnd=8]="GuardsCheckEnd",f[f.RouteConfigLoadStart=9]="RouteConfigLoadStart",f[f.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",f[f.ChildActivationStart=11]="ChildActivationStart",f[f.ChildActivationEnd=12]="ChildActivationEnd",f[f.ActivationStart=13]="ActivationStart",f[f.ActivationEnd=14]="ActivationEnd",f[f.Scroll=15]="Scroll",f[f.NavigationSkipped=16]="NavigationSkipped",f}(dt||{});class _r{constructor(v,h){this.id=v,this.url=h}}class hs extends _r{constructor(v,h,y="imperative",C=null){super(v,h),this.type=dt.NavigationStart,this.navigationTrigger=y,this.restoredState=C}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class vi extends _r{constructor(v,h,y){super(v,h),this.urlAfterRedirects=y,this.type=dt.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var Mt=function(f){return f[f.Redirect=0]="Redirect",f[f.SupersededByNewNavigation=1]="SupersededByNewNavigation",f[f.NoDataFromResolver=2]="NoDataFromResolver",f[f.GuardRejected=3]="GuardRejected",f}(Mt||{}),wa=function(f){return f[f.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",f[f.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",f}(wa||{});class Ar extends _r{constructor(v,h,y,C){super(v,h),this.reason=y,this.code=C,this.type=dt.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class io extends _r{constructor(v,h,y,C){super(v,h),this.reason=y,this.code=C,this.type=dt.NavigationSkipped}}class ps extends _r{constructor(v,h,y,C){super(v,h),this.error=y,this.target=C,this.type=dt.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class gs extends _r{constructor(v,h,y,C){super(v,h),this.urlAfterRedirects=y,this.state=C,this.type=dt.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Oo extends _r{constructor(v,h,y,C){super(v,h),this.urlAfterRedirects=y,this.state=C,this.type=dt.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class ms extends _r{constructor(v,h,y,C,A){super(v,h),this.urlAfterRedirects=y,this.state=C,this.shouldActivate=A,this.type=dt.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class xo extends _r{constructor(v,h,y,C){super(v,h),this.urlAfterRedirects=y,this.state=C,this.type=dt.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Il extends _r{constructor(v,h,y,C){super(v,h),this.urlAfterRedirects=y,this.state=C,this.type=dt.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class pc{constructor(v){this.route=v,this.type=dt.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Tl{constructor(v){this.route=v,this.type=dt.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Ea{constructor(v){this.snapshot=v,this.type=dt.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class gc{constructor(v){this.snapshot=v,this.type=dt.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Ml{constructor(v){this.snapshot=v,this.type=dt.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class mc{constructor(v){this.snapshot=v,this.type=dt.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class vs{}class ys{constructor(v,h){this.url=v,this.navigationBehaviorOptions=h}}function Zn(f){return f.outlet||tt}function ao(f){if(!f)return null;if(f.routeConfig?._injector)return f.routeConfig._injector;for(let v=f.parent;v;v=v.parent){const h=v.routeConfig;if(h?._loadedInjector)return h._loadedInjector;if(h?._injector)return h._injector}return null}class xl{get injector(){return ao(this.route?.snapshot)??this.rootInjector}set injector(v){}constructor(v){this.rootInjector=v,this.outlet=null,this.route=null,this.children=new Kr(this.rootInjector),this.attachRef=null}}let Kr=(()=>{class f{constructor(h){this.rootInjector=h,this.contexts=new Map}onChildOutletCreated(h,y){const C=this.getOrCreateContext(h);C.outlet=y,this.contexts.set(h,C)}onChildOutletDestroyed(h){const y=this.getContext(h);y&&(y.outlet=null,y.attachRef=null)}onOutletDeactivated(){const h=this.contexts;return this.contexts=new Map,h}onOutletReAttached(h){this.contexts=h}getOrCreateContext(h){let y=this.getContext(h);return y||(y=new xl(this.rootInjector),this.contexts.set(h,y)),y}getContext(h){return this.contexts.get(h)||null}static#e=this.\u0275fac=function(y){return new(y||f)(S.KVO(S.uvJ))};static#t=this.\u0275prov=S.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();class Pl{constructor(v){this._root=v}get root(){return this._root.value}parent(v){const h=this.pathFromRoot(v);return h.length>1?h[h.length-2]:null}children(v){const h=Po(v,this._root);return h?h.children.map(y=>y.value):[]}firstChild(v){const h=Po(v,this._root);return h&&h.children.length>0?h.children[0].value:null}siblings(v){const h=_s(v,this._root);return h.length<2?[]:h[h.length-2].children.map(C=>C.value).filter(C=>C!==v)}pathFromRoot(v){return _s(v,this._root).map(h=>h.value)}}function Po(f,v){if(f===v.value)return v;for(const h of v.children){const y=Po(f,h);if(y)return y}return null}function _s(f,v){if(f===v.value)return[v];for(const h of v.children){const y=_s(f,h);if(y.length)return y.unshift(v),y}return[]}class Rr{constructor(v,h){this.value=v,this.children=h}toString(){return`TreeNode(${this.value})`}}function co(f){const v={};return f&&f.children.forEach(h=>v[h.value.outlet]=h),v}class Xr extends Pl{constructor(v,h){super(v),this.snapshot=h,Bi(this,v)}toString(){return this.snapshot.toString()}}function Sa(f){const v=function Ne(f){const A=new lo([],{},{},"",{},tt,f,null,{});return new yc("",new Rr(A,[]))}(f),h=new W.t([new yr("",{})]),y=new W.t({}),C=new W.t({}),A=new W.t({}),k=new W.t(""),G=new Jn(h,y,A,k,C,tt,f,v.root);return G.snapshot=v.root,new Xr(new Rr(G,[]),v)}class Jn{constructor(v,h,y,C,A,k,G,j){this.urlSubject=v,this.paramsSubject=h,this.queryParamsSubject=y,this.fragmentSubject=C,this.dataSubject=A,this.outlet=k,this.component=G,this._futureSnapshot=j,this.title=this.dataSubject?.pipe((0,pt.T)(ye=>ye[$r]))??(0,_.of)(void 0),this.url=v,this.params=h,this.queryParams=y,this.fragment=C,this.data=A}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe((0,pt.T)(v=>Li(v))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe((0,pt.T)(v=>Li(v))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Qr(f,v,h="emptyOnly"){let y;const{routeConfig:C}=f;return y=null===v||"always"!==h&&""!==C?.path&&(v.component||v.routeConfig?.loadComponent)?{params:{...f.params},data:{...f.data},resolve:{...f.data,...f._resolvedData??{}}}:{params:{...v.params,...f.params},data:{...v.data,...f.data},resolve:{...f.data,...v.data,...C?.data,...f._resolvedData}},C&&wr(C)&&(y.resolve[$r]=C.title),y}class lo{get title(){return this.data?.[$r]}constructor(v,h,y,C,A,k,G,j,ye){this.url=v,this.params=h,this.queryParams=y,this.fragment=C,this.data=A,this.outlet=k,this.component=G,this.routeConfig=j,this._resolve=ye}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=Li(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Li(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(y=>y.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class yc extends Pl{constructor(v,h){super(h),this.url=v,Bi(this,h)}toString(){return ko(this._root)}}function Bi(f,v){v.value._routerState=f,v.children.forEach(h=>Bi(f,h))}function ko(f){const v=f.children.length>0?` { ${f.children.map(ko).join(", ")} } `:"";return`${f.value}${v}`}function lr(f){if(f.snapshot){const v=f.snapshot,h=f._futureSnapshot;f.snapshot=h,we(v.queryParams,h.queryParams)||f.queryParamsSubject.next(h.queryParams),v.fragment!==h.fragment&&f.fragmentSubject.next(h.fragment),we(v.params,h.params)||f.paramsSubject.next(h.params),function Tt(f,v){if(f.length!==v.length)return!1;for(let h=0;hwe(h.parameters,v[y].parameters))}(f.url,v.url);return h&&!(!f.parent!=!v.parent)&&(!f.parent||Zr(f.parent,v.parent))}function wr(f){return"string"==typeof f.title||null===f.title}let yi=(()=>{class f{constructor(){this.activated=null,this._activatedRoute=null,this.name=tt,this.activateEvents=new S.bkB,this.deactivateEvents=new S.bkB,this.attachEvents=new S.bkB,this.detachEvents=new S.bkB,this.parentContexts=(0,S.WQX)(Kr),this.location=(0,S.WQX)(S.c1b),this.changeDetector=(0,S.WQX)(S.gRc),this.inputBinder=(0,S.WQX)(Hi,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(h){if(h.name){const{firstChange:y,previousValue:C}=h.name;if(y)return;this.isTrackedInParentContexts(C)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(C)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(h){return this.parentContexts.getContext(h)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const h=this.parentContexts.getContext(this.name);h?.route&&(h.attachRef?this.attach(h.attachRef,h.route):this.activateWith(h.route,h.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new S.wOt(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new S.wOt(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new S.wOt(4012,!1);this.location.detach();const h=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(h.instance),h}attach(h,y){this.activated=h,this._activatedRoute=y,this.location.insert(h.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(h.instance)}deactivate(){if(this.activated){const h=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(h)}}activateWith(h,y){if(this.isActivated)throw new S.wOt(4013,!1);this._activatedRoute=h;const C=this.location,k=h.snapshot.component,G=this.parentContexts.getOrCreateContext(this.name).children,j=new Nr(h,G,C.injector);this.activated=C.createComponent(k,{index:C.length,injector:j,environmentInjector:y}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275dir=S.FsC({type:f,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[S.OA$]})}return f})();class Nr{__ngOutletInjector(v){return new Nr(this.route,this.childContexts,v)}constructor(v,h,y){this.route=v,this.childContexts=h,this.parent=y}get(v,h){return v===Jn?this.route:v===Kr?this.childContexts:this.parent.get(v,h)}}const Hi=new S.nKC("");function Kt(f,v,h){if(h&&f.shouldReuseRoute(v.value,h.value.snapshot)){const y=h.value;y._futureSnapshot=v.value;const C=function gd(f,v,h){return v.children.map(y=>{for(const C of h.children)if(f.shouldReuseRoute(y.value,C.value.snapshot))return Kt(f,y,C);return Kt(f,y)})}(f,v,h);return new Rr(y,C)}{if(f.shouldAttach(v.value)){const A=f.retrieve(v.value);if(null!==A){const k=A.route;return k.value._futureSnapshot=v.value,k.children=v.children.map(G=>Kt(f,G)),k}}const y=function Ia(f){return new Jn(new W.t(f.url),new W.t(f.params),new W.t(f.queryParams),new W.t(f.fragment),new W.t(f.data),f.outlet,f.component,f)}(v.value),C=v.children.map(A=>Kt(f,A));return new Rr(y,C)}}class Ct{constructor(v,h){this.redirectTo=v,this.navigationBehaviorOptions=h}}const Fo="ngNavigationCancelingError";function Xt(f,v){const{redirectTo:h,navigationBehaviorOptions:y}=Ui(v)?{redirectTo:v,navigationBehaviorOptions:void 0}:v,C=ws(!1,Mt.Redirect);return C.url=h,C.navigationBehaviorOptions=y,C}function ws(f,v){const h=new Error(`NavigationCancelingError: ${f||""}`);return h[Fo]=!0,h.cancellationCode=v,h}function Ta(f){return!!f&&f[Fo]}class Cs{constructor(v,h,y,C,A){this.routeReuseStrategy=v,this.futureState=h,this.currState=y,this.forwardEvent=C,this.inputBindingEnabled=A}activate(v){const h=this.futureState._root,y=this.currState?this.currState._root:null;this.deactivateChildRoutes(h,y,v),lr(this.futureState.root),this.activateChildRoutes(h,y,v)}deactivateChildRoutes(v,h,y){const C=co(h);v.children.forEach(A=>{const k=A.value.outlet;this.deactivateRoutes(A,C[k],y),delete C[k]}),Object.values(C).forEach(A=>{this.deactivateRouteAndItsChildren(A,y)})}deactivateRoutes(v,h,y){const C=v.value,A=h?h.value:null;if(C===A)if(C.component){const k=y.getContext(C.outlet);k&&this.deactivateChildRoutes(v,h,k.children)}else this.deactivateChildRoutes(v,h,y);else A&&this.deactivateRouteAndItsChildren(h,y)}deactivateRouteAndItsChildren(v,h){v.value.component&&this.routeReuseStrategy.shouldDetach(v.value.snapshot)?this.detachAndStoreRouteSubtree(v,h):this.deactivateRouteAndOutlet(v,h)}detachAndStoreRouteSubtree(v,h){const y=h.getContext(v.value.outlet),C=y&&v.value.component?y.children:h,A=co(v);for(const k of Object.values(A))this.deactivateRouteAndItsChildren(k,C);if(y&&y.outlet){const k=y.outlet.detach(),G=y.children.onOutletDeactivated();this.routeReuseStrategy.store(v.value.snapshot,{componentRef:k,route:v,contexts:G})}}deactivateRouteAndOutlet(v,h){const y=h.getContext(v.value.outlet),C=y&&v.value.component?y.children:h,A=co(v);for(const k of Object.values(A))this.deactivateRouteAndItsChildren(k,C);y&&(y.outlet&&(y.outlet.deactivate(),y.children.onOutletDeactivated()),y.attachRef=null,y.route=null)}activateChildRoutes(v,h,y){const C=co(h);v.children.forEach(A=>{this.activateRoutes(A,C[A.value.outlet],y),this.forwardEvent(new mc(A.value.snapshot))}),v.children.length&&this.forwardEvent(new gc(v.value.snapshot))}activateRoutes(v,h,y){const C=v.value,A=h?h.value:null;if(lr(C),C===A)if(C.component){const k=y.getOrCreateContext(C.outlet);this.activateChildRoutes(v,h,k.children)}else this.activateChildRoutes(v,h,y);else if(C.component){const k=y.getOrCreateContext(C.outlet);if(this.routeReuseStrategy.shouldAttach(C.snapshot)){const G=this.routeReuseStrategy.retrieve(C.snapshot);this.routeReuseStrategy.store(C.snapshot,null),k.children.onOutletReAttached(G.contexts),k.attachRef=G.componentRef,k.route=G.route.value,k.outlet&&k.outlet.attach(G.componentRef,G.route.value),lr(G.route.value),this.activateChildRoutes(v,null,k.children)}else k.attachRef=null,k.route=C,k.outlet&&k.outlet.activateWith(C,k.injector),this.activateChildRoutes(v,null,k.children)}else this.activateChildRoutes(v,null,y)}}class Nn{constructor(v){this.path=v,this.route=this.path[this.path.length-1]}}class Ds{constructor(v,h){this.component=v,this.route=h}}function _c(f,v,h){const y=f._root;return Lo(y,v?v._root:null,h,[y.value])}function On(f,v){const h=Symbol(),y=v.get(f,h);return y===h?"function"!=typeof f||(0,S.LfX)(f)?v.get(f):f:y}function Lo(f,v,h,y,C={canDeactivateChecks:[],canActivateChecks:[]}){const A=co(v);return f.children.forEach(k=>{(function Lt(f,v,h,y,C={canDeactivateChecks:[],canActivateChecks:[]}){const A=f.value,k=v?v.value:null,G=h?h.getContext(f.value.outlet):null;if(k&&A.routeConfig===k.routeConfig){const j=function vd(f,v,h){if("function"==typeof h)return h(f,v);switch(h){case"pathParamsChange":return!Q(f.url,v.url);case"pathParamsOrQueryParamsChange":return!Q(f.url,v.url)||!we(f.queryParams,v.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Zr(f,v)||!we(f.queryParams,v.queryParams);default:return!Zr(f,v)}}(k,A,A.routeConfig.runGuardsAndResolvers);j?C.canActivateChecks.push(new Nn(y)):(A.data=k.data,A._resolvedData=k._resolvedData),Lo(f,v,A.component?G?G.children:null:h,y,C),j&&G&&G.outlet&&G.outlet.isActivated&&C.canDeactivateChecks.push(new Ds(G.outlet.component,k))}else k&&bs(v,G,C),C.canActivateChecks.push(new Nn(y)),Lo(f,null,A.component?G?G.children:null:h,y,C)})(k,A[k.value.outlet],h,y.concat([k.value]),C),delete A[k.value.outlet]}),Object.entries(A).forEach(([k,G])=>bs(G,h.getContext(k),C)),C}function bs(f,v,h){const y=co(f),C=f.value;Object.entries(y).forEach(([A,k])=>{bs(k,C.component?v?v.children.getContext(A):null:v,h)}),h.canDeactivateChecks.push(new Ds(C.component&&v&&v.outlet&&v.outlet.isActivated?v.outlet.component:null,C))}function Uo(f){return"function"==typeof f}function Vo(f){return f instanceof _e||"EmptyError"===f?.name}const Ma=Symbol("INITIAL_VALUE");function $i(){return(0,vn.n)(f=>Ue(f.map(v=>v.pipe((0,z.s)(1),function Z(...f){const v=(0,ae.lI)(f);return(0,Qe.N)((h,y)=>{(v?de(f,h,v):de(f,h)).subscribe(y)})}(Ma)))).pipe((0,pt.T)(v=>{for(const h of v)if(!0!==h){if(h===Ma)return Ma;if(!1===h||Ul(h))return h}return!0}),(0,ee.p)(v=>v!==Ma),(0,z.s)(1)))}function Ul(f){return Ui(f)||f instanceof Ct}function As(f){return(0,Pe.F)(je(v=>{if("boolean"!=typeof v)throw Xt(0,v)}),(0,pt.T)(v=>!0===v))}class Bo{constructor(v){this.segmentGroup=v||null}}class Xe extends Error{constructor(v){super(),this.urlTree=v}}function Un(f){return(0,Te.$)(new Bo(f))}class jl{constructor(v,h){this.urlSerializer=v,this.urlTree=h}lineralizeSegments(v,h){let y=[],C=h.root;for(;;){if(y=y.concat(C.segments),0===C.numberOfChildren)return(0,_.of)(y);if(C.numberOfChildren>1||!C.children[tt])return(0,Te.$)(new S.wOt(4e3,!1));C=C.children[tt]}}applyRedirectCommands(v,h,y,C,A){if("string"!=typeof h){const G=h,{queryParams:j,fragment:ye,routeConfig:Be,url:et,outlet:$t,params:br,data:rn,title:go}=C,Bn=(0,S.N4e)(A,()=>G({params:br,data:rn,queryParams:j,fragment:ye,routeConfig:Be,url:et,outlet:$t,title:go}));if(Bn instanceof pi)throw new Xe(Bn);h=Bn}const k=this.applyRedirectCreateUrlTree(h,this.urlSerializer.parse(h),v,y);if("/"===h[0])throw new Xe(k);return k}applyRedirectCreateUrlTree(v,h,y,C){const A=this.createSegmentGroup(v,h.root,y,C);return new pi(A,this.createQueryParams(h.queryParams,this.urlTree.queryParams),h.fragment)}createQueryParams(v,h){const y={};return Object.entries(v).forEach(([C,A])=>{if("string"==typeof A&&":"===A[0]){const G=A.substring(1);y[C]=h[G]}else y[C]=A}),y}createSegmentGroup(v,h,y,C){const A=this.createSegments(v,h.segments,y,C);let k={};return Object.entries(h.children).forEach(([G,j])=>{k[G]=this.createSegmentGroup(v,j,y,C)}),new Et(A,k)}createSegments(v,h,y,C){return h.map(A=>":"===A.path[0]?this.findPosParam(v,A,C):this.findOrReturn(A,y))}findPosParam(v,h,y){const C=y[h.path.substring(1)];if(!C)throw new S.wOt(4001,!1);return C}findOrReturn(v,h){let y=0;for(const C of h){if(C.path===v.path)return h.splice(y),C;y++}return v}}const $o={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function wd(f,v,h,y,C){const A=Go(f,v,h);return A.matched?(y=function so(f,v){return f.providers&&!f._injector&&(f._injector=(0,S.Ol2)(f.providers,v,`Route: ${f.path}`)),f._injector??v}(v,y),function jo(f,v,h,y){const C=v.canMatch;if(!C||0===C.length)return(0,_.of)(!0);const A=C.map(k=>{const G=On(k,f);return cr(function _d(f){return f&&Uo(f.canMatch)}(G)?G.canMatch(v,h):(0,S.N4e)(f,()=>G(v,h)))});return(0,_.of)(A).pipe($i(),As())}(y,v,h).pipe((0,pt.T)(k=>!0===k?A:{...$o}))):(0,_.of)(A)}function Go(f,v,h){if("**"===v.path)return function Ed(f){return{matched:!0,parameters:f.length>0?ar(f).parameters:{},consumedSegments:f,remainingSegments:[],positionalParamSegments:{}}}(h);if(""===v.path)return"full"===v.pathMatch&&(f.hasChildren()||h.length>0)?{...$o}:{matched:!0,consumedSegments:[],remainingSegments:h,parameters:{},positionalParamSegments:{}};const C=(v.matcher||sr)(h,f,v);if(!C)return{...$o};const A={};Object.entries(C.posParams??{}).forEach(([G,j])=>{A[G]=j.path});const k=C.consumed.length>0?{...A,...C.consumed[C.consumed.length-1].parameters}:A;return{matched:!0,consumedSegments:C.consumed,remainingSegments:h.slice(C.consumed.length),parameters:k,positionalParamSegments:C.posParams??{}}}function Bl(f,v,h,y){return h.length>0&&function Rs(f,v,h){return h.some(y=>zo(f,v,y)&&Zn(y)!==tt)}(f,h,y)?{segmentGroup:new Et(v,uo(y,new Et(h,f.children))),slicedSegments:[]}:0===h.length&&function Ns(f,v,h){return h.some(y=>zo(f,v,y))}(f,h,y)?{segmentGroup:new Et(f.segments,Oa(f,h,y,f.children)),slicedSegments:h}:{segmentGroup:new Et(f.segments,f.children),slicedSegments:h}}function Oa(f,v,h,y){const C={};for(const A of h)if(zo(f,v,A)&&!y[Zn(A)]){const k=new Et([],{});C[Zn(A)]=k}return{...y,...C}}function uo(f,v){const h={};h[tt]=v;for(const y of f)if(""===y.path&&Zn(y)!==tt){const C=new Et([],{});h[Zn(y)]=C}return h}function zo(f,v,h){return(!(f.hasChildren()||v.length>0)||"full"!==h.pathMatch)&&""===h.path}class xa{}class Cd{constructor(v,h,y,C,A,k,G){this.injector=v,this.configLoader=h,this.rootComponentType=y,this.config=C,this.urlTree=A,this.paramsInheritanceStrategy=k,this.urlSerializer=G,this.applyRedirects=new jl(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(v){return new S.wOt(4002,`'${v.segmentGroup}'`)}recognize(){const v=Bl(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(v).pipe((0,pt.T)(({children:h,rootSnapshot:y})=>{const C=new Rr(y,h),A=new yc("",C),k=function Sl(f,v,h=null,y=null){return Ro(ga(f),v,h,y)}(y,[],this.urlTree.queryParams,this.urlTree.fragment);return k.queryParams=this.urlTree.queryParams,A.url=this.urlSerializer.serialize(k),{state:A,tree:k}}))}match(v){const h=new lo([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Object.freeze({}),tt,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,v,tt,h).pipe((0,pt.T)(y=>({children:y,rootSnapshot:h})),(0,_t.W)(y=>{if(y instanceof Xe)return this.urlTree=y.urlTree,this.match(y.urlTree.root);throw y instanceof Bo?this.noMatchError(y):y}))}processSegmentGroup(v,h,y,C,A){return 0===y.segments.length&&y.hasChildren()?this.processChildren(v,h,y,A):this.processSegment(v,h,y,y.segments,C,!0,A).pipe((0,pt.T)(k=>k instanceof Rr?[k]:[]))}processChildren(v,h,y,C){const A=[];for(const k of Object.keys(y.children))"primary"===k?A.unshift(k):A.push(k);return(0,x.H)(A).pipe((0,gt.H)(k=>{const G=y.children[k],j=function ba(f,v){const h=f.filter(y=>Zn(y)===v);return h.push(...f.filter(y=>Zn(y)!==v)),h}(h,k);return this.processSegmentGroup(v,j,G,k,C)}),function mr(f,v){return(0,Qe.N)(function ln(f,v,h,y,C){return(A,k)=>{let G=h,j=v,ye=0;A.subscribe((0,se._)(k,Be=>{const et=ye++;j=G?f(j,Be,et):(G=!0,Be),y&&k.next(j)},C&&(()=>{G&&k.next(j),k.complete()})))}}(f,v,arguments.length>=2,!0))}((k,G)=>(k.push(...G),k)),re(null),function tn(f,v){const h=arguments.length>=2;return y=>y.pipe(f?(0,ee.p)((C,A)=>f(C,A,y)):Y.D,It(1),h?re(v):Ee(()=>new _e))}(),(0,ve.Z)(k=>{if(null===k)return Un(y);const G=$l(k);return function fo(f){f.sort((v,h)=>v.value.outlet===tt?-1:h.value.outlet===tt?1:v.value.outlet.localeCompare(h.value.outlet))}(G),(0,_.of)(G)}))}processSegment(v,h,y,C,A,k,G){return(0,x.H)(h).pipe((0,gt.H)(j=>this.processSegmentAgainstRoute(j._injector??v,h,j,y,C,A,k,G).pipe((0,_t.W)(ye=>{if(ye instanceof Bo)return(0,_.of)(null);throw ye}))),Ve(j=>!!j),(0,_t.W)(j=>{if(Vo(j))return function xr(f,v,h){return 0===v.length&&!f.children[h]}(y,C,A)?(0,_.of)(new xa):Un(y);throw j}))}processSegmentAgainstRoute(v,h,y,C,A,k,G,j){return function Or(f,v,h,y){return!!(Zn(f)===y||y!==tt&&zo(v,h,f))&&Go(v,f,h).matched}(y,C,A,k)?void 0===y.redirectTo?this.matchSegmentAgainstRoute(v,C,y,A,k,j):this.allowRedirects&&G?this.expandSegmentAgainstRouteUsingRedirect(v,C,h,y,A,k,j):Un(C):Un(C)}expandSegmentAgainstRouteUsingRedirect(v,h,y,C,A,k,G){const{matched:j,parameters:ye,consumedSegments:Be,positionalParamSegments:et,remainingSegments:$t}=Go(h,C,A);if(!j)return Un(h);"string"==typeof C.redirectTo&&"/"===C.redirectTo[0]&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const br=new lo(A,ye,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Os(C),Zn(C),C.component??C._loadedComponent??null,C,lt(C)),rn=Qr(br,G,this.paramsInheritanceStrategy);br.params=Object.freeze(rn.params),br.data=Object.freeze(rn.data);const go=this.applyRedirects.applyRedirectCommands(Be,C.redirectTo,et,br,v);return this.applyRedirects.lineralizeSegments(C,go).pipe((0,ve.Z)(Bn=>this.processSegment(v,y,h,Bn.concat($t),k,!1,G)))}matchSegmentAgainstRoute(v,h,y,C,A,k){const G=wd(h,y,C,v);return"**"===y.path&&(h.children={}),G.pipe((0,vn.n)(j=>j.matched?this.getChildConfig(v=y._injector??v,y,C).pipe((0,vn.n)(({routes:ye})=>{const Be=y._loadedInjector??v,{parameters:et,consumedSegments:$t,remainingSegments:br}=j,rn=new lo($t,et,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Os(y),Zn(y),y.component??y._loadedComponent??null,y,lt(y)),go=Qr(rn,k,this.paramsInheritanceStrategy);rn.params=Object.freeze(go.params),rn.data=Object.freeze(go.data);const{segmentGroup:Bn,slicedSegments:Us}=Bl(h,$t,br,ye);if(0===Us.length&&Bn.hasChildren())return this.processChildren(Be,ye,Bn,rn).pipe((0,pt.T)(Xo=>new Rr(rn,Xo)));if(0===ye.length&&0===Us.length)return(0,_.of)(new Rr(rn,[]));const Ua=Zn(y)===A;return this.processSegment(Be,ye,Bn,Us,Ua?tt:A,!0,rn).pipe((0,pt.T)(Xo=>new Rr(rn,Xo instanceof Rr?[Xo]:[])))})):Un(h)))}getChildConfig(v,h,y){return h.children?(0,_.of)({routes:h.children,injector:v}):h.loadChildren?void 0!==h._loadedRoutes?(0,_.of)({routes:h._loadedRoutes,injector:h._loadedInjector}):function Ms(f,v,h,y){const C=v.canLoad;if(void 0===C||0===C.length)return(0,_.of)(!0);const A=C.map(k=>{const G=On(k,f);return cr(function Ll(f){return f&&Uo(f.canLoad)}(G)?G.canLoad(v,h):(0,S.N4e)(f,()=>G(v,h)))});return(0,_.of)(A).pipe($i(),As())}(v,h,y).pipe((0,ve.Z)(C=>C?this.configLoader.loadChildren(v,h).pipe(je(A=>{h._loadedRoutes=A.routes,h._loadedInjector=A.injector})):function Na(){return(0,Te.$)(ws(!1,Mt.GuardRejected))}())):(0,_.of)({routes:[],injector:v})}}function Hl(f){const v=f.value.routeConfig;return v&&""===v.path}function $l(f){const v=[],h=new Set;for(const y of f){if(!Hl(y)){v.push(y);continue}const C=v.find(A=>y.value.routeConfig===A.value.routeConfig);void 0!==C?(C.children.push(...y.children),h.add(C)):v.push(y)}for(const y of h){const C=$l(y.children);v.push(new Rr(y.value,C))}return v.filter(y=>!h.has(y))}function Os(f){return f.data||{}}function lt(f){return f.resolve||{}}function xn(f){const v=f.children.map(h=>xn(h)).flat();return[f,...v]}function Ei(f){return(0,vn.n)(v=>{const h=f(v);return h?(0,x.H)(h).pipe((0,pt.T)(()=>v)):(0,_.of)(v)})}let Wo=(()=>{class f{buildTitle(h){let y,C=h.root;for(;void 0!==C;)y=this.getResolvedTitleForRoute(C)??y,C=C.children.find(A=>A.outlet===tt);return y}getResolvedTitleForRoute(h){return h.data[$r]}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=S.jDH({token:f,factory:()=>(0,S.WQX)(g),providedIn:"root"})}return f})(),g=(()=>{class f extends Wo{constructor(h){super(),this.title=h}updateTitle(h){const y=this.buildTitle(h);void 0!==y&&this.title.setTitle(y)}static#e=this.\u0275fac=function(y){return new(y||f)(S.KVO(Fi.hE))};static#t=this.\u0275prov=S.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();const T=new S.nKC("",{providedIn:"root",factory:()=>({})});let w=(()=>{class f{static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275cmp=S.VBU({type:f,selectors:[["ng-component"]],standalone:!0,features:[S.aNF],decls:1,vars:0,template:function(y,C){1&y&&S.nrm(0,"router-outlet")},dependencies:[yi],encapsulation:2})}return f})();function I(f){const v=f.children&&f.children.map(I),h=v?{...f,children:v}:{...f};return!h.component&&!h.loadComponent&&(v||h.loadChildren)&&h.outlet&&h.outlet!==tt&&(h.component=w),h}const P=new S.nKC("");let q=(()=>{class f{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=(0,S.WQX)(S.Ql9)}loadComponent(h){if(this.componentLoaders.get(h))return this.componentLoaders.get(h);if(h._loadedComponent)return(0,_.of)(h._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(h);const y=cr(h.loadComponent()).pipe((0,pt.T)(Ut),je(A=>{this.onLoadEndListener&&this.onLoadEndListener(h),h._loadedComponent=A}),(0,Bt.j)(()=>{this.componentLoaders.delete(h)})),C=new qn(y,()=>new an.B).pipe(mn());return this.componentLoaders.set(h,C),C}loadChildren(h,y){if(this.childrenLoaders.get(y))return this.childrenLoaders.get(y);if(y._loadedRoutes)return(0,_.of)({routes:y._loadedRoutes,injector:y._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(y);const A=function ue(f,v,h,y){return cr(f.loadChildren()).pipe((0,pt.T)(Ut),(0,ve.Z)(C=>C instanceof S.Co$||Array.isArray(C)?(0,_.of)(C):(0,x.H)(v.compileModuleAsync(C))),(0,pt.T)(C=>{y&&y(f);let A,k,G=!1;return Array.isArray(C)?(k=C,!0):(A=C.create(h).injector,k=A.get(P,[],{optional:!0,self:!0}).flat()),{routes:k.map(I),injector:A}}))}(y,this.compiler,h,this.onLoadEndListener).pipe((0,Bt.j)(()=>{this.childrenLoaders.delete(y)})),k=new qn(A,()=>new an.B).pipe(mn());return this.childrenLoaders.set(y,k),k}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=S.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();function Ut(f){return function ke(f){return f&&"object"==typeof f&&"default"in f}(f)?f.default:f}let ot=(()=>{class f{static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=S.jDH({token:f,factory:()=>(0,S.WQX)(xt),providedIn:"root"})}return f})(),xt=(()=>{class f{shouldProcessUrl(h){return!0}extract(h){return h}merge(h,y){return h}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=S.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();const me=new S.nKC(""),Pr=new S.nKC("");let Vn=(()=>{class f{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new an.B,this.transitionAbortSubject=new an.B,this.configLoader=(0,S.WQX)(q),this.environmentInjector=(0,S.WQX)(S.uvJ),this.urlSerializer=(0,S.WQX)(F),this.rootContexts=(0,S.WQX)(Kr),this.location=(0,S.WQX)(cn.aZ),this.inputBindingEnabled=null!==(0,S.WQX)(Hi,{optional:!0}),this.titleStrategy=(0,S.WQX)(Wo),this.options=(0,S.WQX)(T,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=(0,S.WQX)(ot),this.createViewTransition=(0,S.WQX)(me,{optional:!0}),this.navigationErrorHandler=(0,S.WQX)(Pr,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>(0,_.of)(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=C=>this.events.next(new Tl(C)),this.configLoader.onLoadStartListener=C=>this.events.next(new pc(C))}complete(){this.transitions?.complete()}handleNavigationRequest(h){const y=++this.navigationId;this.transitions?.next({...this.transitions.value,...h,id:y})}setupNavigations(h,y,C){return this.transitions=new W.t({id:0,currentUrlTree:y,currentRawUrl:y,extractedUrl:this.urlHandlingStrategy.extract(y),urlAfterRedirects:this.urlHandlingStrategy.extract(y),rawUrl:y,extras:{},resolve:()=>{},reject:()=>{},promise:Promise.resolve(!0),source:Vi,restoredState:null,currentSnapshot:C.snapshot,targetSnapshot:null,currentRouterState:C,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe((0,ee.p)(A=>0!==A.id),(0,pt.T)(A=>({...A,extractedUrl:this.urlHandlingStrategy.extract(A.rawUrl)})),(0,vn.n)(A=>{let k=!1,G=!1;return(0,_.of)(A).pipe((0,vn.n)(j=>{if(this.navigationId>A.id)return this.cancelNavigationTransition(A,"",Mt.SupersededByNewNavigation),Le.w;this.currentTransition=A,this.currentNavigation={id:j.id,initialUrl:j.rawUrl,extractedUrl:j.extractedUrl,targetBrowserUrl:"string"==typeof j.extras.browserUrl?this.urlSerializer.parse(j.extras.browserUrl):j.extras.browserUrl,trigger:j.source,extras:j.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null};const ye=!h.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!ye&&"reload"!==(j.extras.onSameUrlNavigation??h.onSameUrlNavigation)){const et="";return this.events.next(new io(j.id,this.urlSerializer.serialize(j.rawUrl),et,wa.IgnoredSameUrlNavigation)),j.resolve(!1),Le.w}if(this.urlHandlingStrategy.shouldProcessUrl(j.rawUrl))return(0,_.of)(j).pipe((0,vn.n)(et=>{const $t=this.transitions?.getValue();return this.events.next(new hs(et.id,this.urlSerializer.serialize(et.extractedUrl),et.source,et.restoredState)),$t!==this.transitions?.getValue()?Le.w:Promise.resolve(et)}),function ka(f,v,h,y,C,A){return(0,ve.Z)(k=>function nt(f,v,h,y,C,A,k="emptyOnly"){return new Cd(f,v,h,y,C,k,A).recognize()}(f,v,h,y,k.extractedUrl,C,A).pipe((0,pt.T)(({state:G,tree:j})=>({...k,targetSnapshot:G,urlAfterRedirects:j}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,h.config,this.urlSerializer,this.paramsInheritanceStrategy),je(et=>{A.targetSnapshot=et.targetSnapshot,A.urlAfterRedirects=et.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:et.urlAfterRedirects};const $t=new gs(et.id,this.urlSerializer.serialize(et.extractedUrl),this.urlSerializer.serialize(et.urlAfterRedirects),et.targetSnapshot);this.events.next($t)}));if(ye&&this.urlHandlingStrategy.shouldProcessUrl(j.currentRawUrl)){const{id:et,extractedUrl:$t,source:br,restoredState:rn,extras:go}=j,Bn=new hs(et,this.urlSerializer.serialize($t),br,rn);this.events.next(Bn);const Us=Sa(this.rootComponentType).snapshot;return this.currentTransition=A={...j,targetSnapshot:Us,urlAfterRedirects:$t,extras:{...go,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=$t,(0,_.of)(A)}{const et="";return this.events.next(new io(j.id,this.urlSerializer.serialize(j.extractedUrl),et,wa.IgnoredByUrlHandlingStrategy)),j.resolve(!1),Le.w}}),je(j=>{const ye=new Oo(j.id,this.urlSerializer.serialize(j.extractedUrl),this.urlSerializer.serialize(j.urlAfterRedirects),j.targetSnapshot);this.events.next(ye)}),(0,pt.T)(j=>(this.currentTransition=A={...j,guards:_c(j.targetSnapshot,j.currentSnapshot,this.rootContexts)},A)),function kt(f,v){return(0,ve.Z)(h=>{const{targetSnapshot:y,currentSnapshot:C,guards:{canActivateChecks:A,canDeactivateChecks:k}}=h;return 0===k.length&&0===A.length?(0,_.of)({...h,guardsResult:!0}):function Aa(f,v,h,y){return(0,x.H)(f).pipe((0,ve.Z)(C=>function Ts(f,v,h,y,C){const A=v&&v.routeConfig?v.routeConfig.canDeactivate:null;if(!A||0===A.length)return(0,_.of)(!0);const k=A.map(G=>{const j=ao(v)??C,ye=On(G,j);return cr(function We(f){return f&&Uo(f.canDeactivate)}(ye)?ye.canDeactivate(f,v,h,y):(0,S.N4e)(j,()=>ye(f,v,h,y))).pipe(Ve())});return(0,_.of)(k).pipe($i())}(C.component,C.route,h,v,y)),Ve(C=>!0!==C,!0))}(k,y,C,f).pipe((0,ve.Z)(G=>G&&function yd(f){return"boolean"==typeof f}(G)?function Jr(f,v,h,y){return(0,x.H)(v).pipe((0,gt.H)(C=>de(function Vl(f,v){return null!==f&&v&&v(new Ea(f)),(0,_.of)(!0)}(C.route.parent,y),function Ss(f,v){return null!==f&&v&&v(new Ml(f)),(0,_.of)(!0)}(C.route,y),function Ra(f,v,h){const y=v[v.length-1],A=v.slice(0,v.length-1).reverse().map(k=>function md(f){const v=f.routeConfig?f.routeConfig.canActivateChild:null;return v&&0!==v.length?{node:f,guards:v}:null}(k)).filter(k=>null!==k).map(k=>Ge(()=>{const G=k.guards.map(j=>{const ye=ao(k.node)??h,Be=On(j,ye);return cr(function Yn(f){return f&&Uo(f.canActivateChild)}(Be)?Be.canActivateChild(y,f):(0,S.N4e)(ye,()=>Be(y,f))).pipe(Ve())});return(0,_.of)(G).pipe($i())}));return(0,_.of)(A).pipe($i())}(f,C.path,h),function Is(f,v,h){const y=v.routeConfig?v.routeConfig.canActivate:null;if(!y||0===y.length)return(0,_.of)(!0);const C=y.map(A=>Ge(()=>{const k=ao(v)??h,G=On(A,k);return cr(function wc(f){return f&&Uo(f.canActivate)}(G)?G.canActivate(v,f):(0,S.N4e)(k,()=>G(v,f))).pipe(Ve())}));return(0,_.of)(C).pipe($i())}(f,C.route,h))),Ve(C=>!0!==C,!0))}(y,A,f,v):(0,_.of)(G)),(0,pt.T)(G=>({...h,guardsResult:G})))})}(this.environmentInjector,j=>this.events.next(j)),je(j=>{if(A.guardsResult=j.guardsResult,j.guardsResult&&"boolean"!=typeof j.guardsResult)throw Xt(0,j.guardsResult);const ye=new ms(j.id,this.urlSerializer.serialize(j.extractedUrl),this.urlSerializer.serialize(j.urlAfterRedirects),j.targetSnapshot,!!j.guardsResult);this.events.next(ye)}),(0,ee.p)(j=>!!j.guardsResult||(this.cancelNavigationTransition(j,"",Mt.GuardRejected),!1)),Ei(j=>{if(j.guards.canActivateChecks.length)return(0,_.of)(j).pipe(je(ye=>{const Be=new xo(ye.id,this.urlSerializer.serialize(ye.extractedUrl),this.urlSerializer.serialize(ye.urlAfterRedirects),ye.targetSnapshot);this.events.next(Be)}),(0,vn.n)(ye=>{let Be=!1;return(0,_.of)(ye).pipe(function xs(f,v){return(0,ve.Z)(h=>{const{targetSnapshot:y,guards:{canActivateChecks:C}}=h;if(!C.length)return(0,_.of)(h);const A=new Set(C.map(j=>j.route)),k=new Set;for(const j of A)if(!k.has(j))for(const ye of xn(j))k.add(ye);let G=0;return(0,x.H)(k).pipe((0,gt.H)(j=>A.has(j)?function Ps(f,v,h,y){const C=f.routeConfig,A=f._resolve;return void 0!==C?.title&&!wr(C)&&(A[$r]=C.title),function Dd(f,v,h,y){const C=la(f);if(0===C.length)return(0,_.of)({});const A={};return(0,x.H)(C).pipe((0,ve.Z)(k=>function ks(f,v,h,y){const C=ao(v)??y,A=On(f,C);return cr(A.resolve?A.resolve(v,h):(0,S.N4e)(C,()=>A(v,h)))}(f[k],v,h,y).pipe(Ve(),je(G=>{if(G instanceof Ct)throw Xt(new H,G);A[k]=G}))),It(1),function Cn(f){return(0,pt.T)(()=>f)}(A),(0,_t.W)(k=>Vo(k)?Le.w:(0,Te.$)(k)))}(A,f,v,y).pipe((0,pt.T)(k=>(f._resolvedData=k,f.data=Qr(f,f.parent,h).resolve,null)))}(j,y,f,v):(j.data=Qr(j,j.parent,f).resolve,(0,_.of)(void 0))),je(()=>G++),It(1),(0,ve.Z)(j=>G===k.size?(0,_.of)(h):Le.w))})}(this.paramsInheritanceStrategy,this.environmentInjector),je({next:()=>Be=!0,complete:()=>{Be||this.cancelNavigationTransition(ye,"",Mt.NoDataFromResolver)}}))}),je(ye=>{const Be=new Il(ye.id,this.urlSerializer.serialize(ye.extractedUrl),this.urlSerializer.serialize(ye.urlAfterRedirects),ye.targetSnapshot);this.events.next(Be)}))}),Ei(j=>{const ye=Be=>{const et=[];Be.routeConfig?.loadComponent&&!Be.routeConfig._loadedComponent&&et.push(this.configLoader.loadComponent(Be.routeConfig).pipe(je($t=>{Be.component=$t}),(0,pt.T)(()=>{})));for(const $t of Be.children)et.push(...ye($t));return et};return Ue(ye(j.targetSnapshot.root)).pipe(re(null),(0,z.s)(1))}),Ei(()=>this.afterPreactivation()),(0,vn.n)(()=>{const{currentSnapshot:j,targetSnapshot:ye}=A,Be=this.createViewTransition?.(this.environmentInjector,j.root,ye.root);return Be?(0,x.H)(Be).pipe((0,pt.T)(()=>A)):(0,_.of)(A)}),(0,pt.T)(j=>{const ye=function kl(f,v,h){const y=Kt(f,v._root,h?h._root:void 0);return new Xr(y,v)}(h.routeReuseStrategy,j.targetSnapshot,j.currentRouterState);return this.currentTransition=A={...j,targetRouterState:ye},this.currentNavigation.targetRouterState=ye,A}),je(()=>{this.events.next(new vs)}),((f,v,h,y)=>(0,pt.T)(C=>(new Cs(v,C.targetRouterState,C.currentRouterState,h,y).activate(f),C)))(this.rootContexts,h.routeReuseStrategy,j=>this.events.next(j),this.inputBindingEnabled),(0,z.s)(1),je({next:j=>{k=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new vi(j.id,this.urlSerializer.serialize(j.extractedUrl),this.urlSerializer.serialize(j.urlAfterRedirects))),this.titleStrategy?.updateTitle(j.targetRouterState.snapshot),j.resolve(!0)},complete:()=>{k=!0}}),function or(f){return(0,Qe.N)((v,h)=>{(0,be.Tg)(f).subscribe((0,se._)(h,()=>h.complete(),Kn.l)),!h.closed&&v.subscribe(h)})}(this.transitionAbortSubject.pipe(je(j=>{throw j}))),(0,Bt.j)(()=>{!k&&!G&&this.cancelNavigationTransition(A,"",Mt.SupersededByNewNavigation),this.currentTransition?.id===A.id&&(this.currentNavigation=null,this.currentTransition=null)}),(0,_t.W)(j=>{if(G=!0,Ta(j))this.events.next(new Ar(A.id,this.urlSerializer.serialize(A.extractedUrl),j.message,j.cancellationCode)),function Fl(f){return Ta(f)&&Ui(f.url)}(j)?this.events.next(new ys(j.url,j.navigationBehaviorOptions)):A.resolve(!1);else{const ye=new ps(A.id,this.urlSerializer.serialize(A.extractedUrl),j,A.targetSnapshot??void 0);try{const Be=(0,S.N4e)(this.environmentInjector,()=>this.navigationErrorHandler?.(ye));if(Be instanceof Ct){const{message:et,cancellationCode:$t}=Xt(0,Be);this.events.next(new Ar(A.id,this.urlSerializer.serialize(A.extractedUrl),et,$t)),this.events.next(new ys(Be.redirectTo,Be.navigationBehaviorOptions))}else{this.events.next(ye);const et=h.errorHandler(j);A.resolve(!!et)}}catch(Be){this.options.resolveNavigationPromiseOnError?A.resolve(!1):A.reject(Be)}}return Le.w}))}))}cancelNavigationTransition(h,y,C){const A=new Ar(h.id,this.urlSerializer.serialize(h.extractedUrl),y,C);this.events.next(A),h.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){const h=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),y=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return h.toString()!==y?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=S.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();function ho(f){return f!==Vi}let Yr=(()=>{class f{static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=S.jDH({token:f,factory:()=>(0,S.WQX)(ei),providedIn:"root"})}return f})();class Er{shouldDetach(v){return!1}store(v,h){}shouldAttach(v){return!1}retrieve(v){return null}shouldReuseRoute(v,h){return v.routeConfig===h.routeConfig}}let ei=(()=>{class f extends Er{static#e=this.\u0275fac=(()=>{let h;return function(C){return(h||(h=S.xGo(f)))(C||f)}})();static#t=this.\u0275prov=S.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})(),kr=(()=>{class f{static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=S.jDH({token:f,factory:()=>(0,S.WQX)(qo),providedIn:"root"})}return f})(),qo=(()=>{class f extends kr{constructor(){super(...arguments),this.location=(0,S.WQX)(cn.aZ),this.urlSerializer=(0,S.WQX)(F),this.options=(0,S.WQX)(T,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=(0,S.WQX)(ot),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new pi,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=Sa(null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(h){return this.location.subscribe(y=>{"popstate"===y.type&&h(y.url,y.state)})}handleRouterEvent(h,y){if(h instanceof hs)this.stateMemento=this.createStateMemento();else if(h instanceof io)this.rawUrlTree=y.initialUrl;else if(h instanceof gs){if("eager"===this.urlUpdateStrategy&&!y.extras.skipLocationChange){const C=this.urlHandlingStrategy.merge(y.finalUrl,y.initialUrl);this.setBrowserUrl(y.targetBrowserUrl??C,y)}}else h instanceof vs?(this.currentUrlTree=y.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(y.finalUrl,y.initialUrl),this.routerState=y.targetRouterState,"deferred"===this.urlUpdateStrategy&&!y.extras.skipLocationChange&&this.setBrowserUrl(y.targetBrowserUrl??this.rawUrlTree,y)):h instanceof Ar&&(h.code===Mt.GuardRejected||h.code===Mt.NoDataFromResolver)?this.restoreHistory(y):h instanceof ps?this.restoreHistory(y,!0):h instanceof vi&&(this.lastSuccessfulId=h.id,this.currentPageId=this.browserPageId)}setBrowserUrl(h,y){const C=h instanceof pi?this.urlSerializer.serialize(h):h;if(this.location.isCurrentPathEqualTo(C)||y.extras.replaceUrl){const k={...y.extras.state,...this.generateNgRouterState(y.id,this.browserPageId)};this.location.replaceState(C,"",k)}else{const A={...y.extras.state,...this.generateNgRouterState(y.id,this.browserPageId+1)};this.location.go(C,"",A)}}restoreHistory(h,y=!1){if("computed"===this.canceledNavigationResolution){const A=this.currentPageId-this.browserPageId;0!==A?this.location.historyGo(A):this.currentUrlTree===h.finalUrl&&0===A&&(this.resetState(h),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(y&&this.resetState(h),this.resetUrlToCurrentUrlTree())}resetState(h){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,h.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(h,y){return"computed"===this.canceledNavigationResolution?{navigationId:h,\u0275routerPageId:y}:{navigationId:h}}static#e=this.\u0275fac=(()=>{let h;return function(C){return(h||(h=S.xGo(f)))(C||f)}})();static#t=this.\u0275prov=S.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})();var Fr=function(f){return f[f.COMPLETE=0]="COMPLETE",f[f.FAILED=1]="FAILED",f[f.REDIRECTING=2]="REDIRECTING",f}(Fr||{});function er(f){throw f}const ti={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},zl={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let Cr=(()=>{class f{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.console=(0,S.WQX)(S.H3F),this.stateManager=(0,S.WQX)(kr),this.options=(0,S.WQX)(T,{optional:!0})||{},this.pendingTasks=(0,S.WQX)(S.TgB),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=(0,S.WQX)(Vn),this.urlSerializer=(0,S.WQX)(F),this.location=(0,S.WQX)(cn.aZ),this.urlHandlingStrategy=(0,S.WQX)(ot),this._events=new an.B,this.errorHandler=this.options.errorHandler||er,this.navigated=!1,this.routeReuseStrategy=(0,S.WQX)(Yr),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=(0,S.WQX)(P,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!(0,S.WQX)(Hi,{optional:!0}),this.eventsSubscription=new Ke.yU,this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:h=>{this.console.warn(h)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const h=this.navigationTransitions.events.subscribe(y=>{try{const C=this.navigationTransitions.currentTransition,A=this.navigationTransitions.currentNavigation;if(null!==C&&null!==A)if(this.stateManager.handleRouterEvent(y,A),y instanceof Ar&&y.code!==Mt.Redirect&&y.code!==Mt.SupersededByNewNavigation)this.navigated=!0;else if(y instanceof vi)this.navigated=!0;else if(y instanceof ys){const k=y.navigationBehaviorOptions,G=this.urlHandlingStrategy.merge(y.url,C.currentRawUrl),j={browserUrl:C.extras.browserUrl,info:C.extras.info,skipLocationChange:C.extras.skipLocationChange,replaceUrl:C.extras.replaceUrl||"eager"===this.urlUpdateStrategy||ho(C.source),...k};this.scheduleNavigation(G,Vi,null,j,{resolve:C.resolve,reject:C.reject,promise:C.promise})}(function Fa(f){return!(f instanceof vs||f instanceof ys)})(y)&&this._events.next(y)}catch(C){this.navigationTransitions.transitionAbortSubject.next(C)}});this.eventsSubscription.add(h)}resetRootComponentType(h){this.routerState.root.component=h,this.navigationTransitions.rootComponentType=h}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),Vi,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((h,y)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(h,"popstate",y)},0)})}navigateToSyncWithBrowser(h,y,C){const A={replaceUrl:!0},k=C?.navigationId?C:null;if(C){const j={...C};delete j.navigationId,delete j.\u0275routerPageId,0!==Object.keys(j).length&&(A.state=j)}const G=this.parseUrl(h);this.scheduleNavigation(G,y,k,A)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(h){this.config=h.map(I),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(h,y={}){const{relativeTo:C,queryParams:A,fragment:k,queryParamsHandling:G,preserveFragment:j}=y,ye=j?this.currentUrlTree.fragment:k;let et,Be=null;switch(G??this.options.defaultQueryParamsHandling){case"merge":Be={...this.currentUrlTree.queryParams,...A};break;case"preserve":Be=this.currentUrlTree.queryParams;break;default:Be=A||null}null!==Be&&(Be=this.removeEmptyProps(Be));try{et=ga(C?C.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof h[0]||"/"!==h[0][0])&&(h=[]),et=this.currentUrlTree.root}return Ro(et,h,Be,ye??null)}navigateByUrl(h,y={skipLocationChange:!1}){const C=Ui(h)?h:this.parseUrl(h),A=this.urlHandlingStrategy.merge(C,this.rawUrlTree);return this.scheduleNavigation(A,Vi,null,y)}navigate(h,y={skipLocationChange:!1}){return function Fs(f){for(let v=0;v(null!=A&&(y[C]=A),y),{})}scheduleNavigation(h,y,C,A,k){if(this.disposed)return Promise.resolve(!1);let G,j,ye;k?(G=k.resolve,j=k.reject,ye=k.promise):ye=new Promise((et,$t)=>{G=et,j=$t});const Be=this.pendingTasks.add();return function Gl(f,v){f.events.pipe((0,ee.p)(h=>h instanceof vi||h instanceof Ar||h instanceof ps||h instanceof io),(0,pt.T)(h=>h instanceof vi||h instanceof io?Fr.COMPLETE:h instanceof Ar&&(h.code===Mt.Redirect||h.code===Mt.SupersededByNewNavigation)?Fr.REDIRECTING:Fr.FAILED),(0,ee.p)(h=>h!==Fr.REDIRECTING),(0,z.s)(1)).subscribe(()=>{v()})}(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(Be))}),this.navigationTransitions.handleNavigationRequest({source:y,restoredState:C,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:h,extras:A,resolve:G,reject:j,promise:ye,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),ye.catch(et=>Promise.reject(et))}static#e=this.\u0275fac=function(y){return new(y||f)};static#t=this.\u0275prov=S.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})(),Ec=(()=>{class f{constructor(h,y,C,A,k,G){this.router=h,this.route=y,this.tabIndexAttribute=C,this.renderer=A,this.el=k,this.locationStrategy=G,this.href=null,this.onChanges=new an.B,this.preserveFragment=!1,this.skipLocationChange=!1,this.replaceUrl=!1,this.routerLinkInput=null;const j=k.nativeElement.tagName?.toLowerCase();this.isAnchorElement="a"===j||"area"===j,this.isAnchorElement?this.subscription=h.events.subscribe(ye=>{ye instanceof vi&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}setTabIndexIfNotOnNativeEl(h){null!=this.tabIndexAttribute||this.isAnchorElement||this.applyAttributeValue("tabindex",h)}ngOnChanges(h){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}set routerLink(h){null==h?(this.routerLinkInput=null,this.setTabIndexIfNotOnNativeEl(null)):(this.routerLinkInput=Ui(h)||Array.isArray(h)?h:[h],this.setTabIndexIfNotOnNativeEl("0"))}onClick(h,y,C,A,k){const G=this.urlTree;return!!(null===G||this.isAnchorElement&&(0!==h||y||C||A||k||"string"==typeof this.target&&"_self"!=this.target))||(this.router.navigateByUrl(G,{skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info}),!this.isAnchorElement)}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){const h=this.urlTree;this.href=null!==h&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(h)):null;const y=null===this.href?null:(0,S.n$t)(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",y)}applyAttributeValue(h,y){const C=this.renderer,A=this.el.nativeElement;null!==y?C.setAttribute(A,h,y):C.removeAttribute(A,h)}get urlTree(){return null===this.routerLinkInput?null:Ui(this.routerLinkInput)?this.routerLinkInput:this.router.createUrlTree(this.routerLinkInput,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static#e=this.\u0275fac=function(y){return new(y||f)(S.rXU(Cr),S.rXU(Jn),S.kS0("tabindex"),S.rXU(S.sFG),S.rXU(S.aKT),S.rXU(cn.hb))};static#t=this.\u0275dir=S.FsC({type:f,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(y,C){1&y&&S.bIt("click",function(k){return C.onClick(k.button,k.ctrlKey,k.shiftKey,k.altKey,k.metaKey)}),2&y&&S.BMQ("target",C.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[2,"preserveFragment","preserveFragment",S.L39],skipLocationChange:[2,"skipLocationChange","skipLocationChange",S.L39],replaceUrl:[2,"replaceUrl","replaceUrl",S.L39],routerLink:"routerLink"},standalone:!0,features:[S.GFd,S.OA$]})}return f})();const La=new S.nKC("");function bt(f,...v){return(0,S.EmA)([{provide:P,multi:!0,useValue:f},[],{provide:Jn,useFactory:tr,deps:[Cr]},{provide:S.iLQ,multi:!0,useFactory:ni},v.map(h=>h.\u0275providers)])}function tr(f){return f.routerState.root}function ni(){const f=(0,S.WQX)(S.zZn);return v=>{const h=f.get(S.o8S);if(v!==h.components[0])return;const y=f.get(Cr),C=f.get(Kl);1===f.get(Ko)&&y.initialNavigation(),f.get(Sc,null,S.$GK.Optional)?.setUpPreloading(),f.get(La,null,S.$GK.Optional)?.init(),y.resetRootComponentType(h.componentTypes[0]),C.closed||(C.next(),C.complete(),C.unsubscribe())}}const Kl=new S.nKC("",{factory:()=>new an.B}),Ko=new S.nKC("",{providedIn:"root",factory:()=>1}),Sc=new S.nKC("");function Sd(f){return function Lr(f,v){return{\u0275kind:f,\u0275providers:v}}(5,[{provide:T,useValue:f}])}},1635:($e,he,O)=>{"use strict";function ae(z,Z,ee,re){return new(ee||(ee=Promise))(function(pe,Ve){function gt(_t){try{je(re.next(_t))}catch(ln){Ve(ln)}}function un(_t){try{je(re.throw(_t))}catch(ln){Ve(ln)}}function je(_t){_t.done?pe(_t.value):function Ee(pe){return pe instanceof ee?pe:new ee(function(Ve){Ve(pe)})}(_t.value).then(gt,un)}je((re=re.apply(z,Z||[])).next())})}function ge(z){return this instanceof ge?(this.v=z,this):new ge(z)}function de(z,Z,ee){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Ee,re=ee.apply(z,Z||[]),pe=[];return Ee=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),gt("next"),gt("throw"),gt("return",function Ve(It){return function(tn){return Promise.resolve(tn).then(It,ln)}}),Ee[Symbol.asyncIterator]=function(){return this},Ee;function gt(It,tn){re[It]&&(Ee[It]=function(Cn){return new Promise(function(Bt,Kn){pe.push([It,Cn,Bt,Kn])>1||un(It,Cn)})},tn&&(Ee[It]=tn(Ee[It])))}function un(It,tn){try{!function je(It){It.value instanceof ge?Promise.resolve(It.value.v).then(_t,ln):mr(pe[0][2],It)}(re[It](tn))}catch(Cn){mr(pe[0][3],Cn)}}function _t(It){un("next",It)}function ln(It){un("throw",It)}function mr(It,tn){It(tn),pe.shift(),pe.length&&un(pe[0][0],pe[0][1])}}function Ge(z){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var ee,Z=z[Symbol.asyncIterator];return Z?Z.call(z):(z=function Ue(z){var Z="function"==typeof Symbol&&Symbol.iterator,ee=Z&&z[Z],re=0;if(ee)return ee.call(z);if(z&&"number"==typeof z.length)return{next:function(){return z&&re>=z.length&&(z=void 0),{value:z&&z[re++],done:!z}}};throw new TypeError(Z?"Object is not iterable.":"Symbol.iterator is not defined.")}(z),ee={},re("next"),re("throw"),re("return"),ee[Symbol.asyncIterator]=function(){return this},ee);function re(pe){ee[pe]=z[pe]&&function(Ve){return new Promise(function(gt,un){!function Ee(pe,Ve,gt,un){Promise.resolve(un).then(function(je){pe({value:je,done:gt})},Ve)}(gt,un,(Ve=z[pe](Ve)).done,Ve.value)})}}}O.d(he,{AQ:()=>de,N3:()=>ge,sH:()=>ae,xN:()=>Ge}),"function"==typeof SuppressedError&&SuppressedError}},$e=>{$e($e.s=111)}]); \ No newline at end of file diff --git a/demo-app/ngx-auth/polyfills.282413b354d3be9f.js b/demo-app/ngx-auth/polyfills.282413b354d3be9f.js new file mode 100644 index 0000000..66412f4 --- /dev/null +++ b/demo-app/ngx-auth/polyfills.282413b354d3be9f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdemo_app_ngx_auth=self.webpackChunkdemo_app_ngx_auth||[]).push([[461],{6935:()=>{const te=globalThis;function ee(e){return(te.__Zone_symbol_prefix||"__zone_symbol__")+e}const ke=Object.getOwnPropertyDescriptor,Ne=Object.defineProperty,Le=Object.getPrototypeOf,_t=Object.create,Et=Array.prototype.slice,Ie="addEventListener",Me="removeEventListener",Ze=ee(Ie),Ae=ee(Me),ae="true",le="false",ve=ee("");function je(e,r){return Zone.current.wrap(e,r)}function He(e,r,c,t,i){return Zone.current.scheduleMacroTask(e,r,c,t,i)}const j=ee,we=typeof window<"u",Te=we?window:void 0,$=we&&Te||globalThis,Tt="removeAttribute";function xe(e,r){for(let c=e.length-1;c>=0;c--)"function"==typeof e[c]&&(e[c]=je(e[c],r+"_"+c));return e}function We(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&typeof e.set>"u")}const qe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Re=!("nw"in $)&&typeof $.process<"u"&&"[object process]"===$.process.toString(),Ve=!Re&&!qe&&!(!we||!Te.HTMLElement),Xe=typeof $.process<"u"&&"[object process]"===$.process.toString()&&!qe&&!(!we||!Te.HTMLElement),Ce={},mt=j("enable_beforeunload"),Ye=function(e){if(!(e=e||$.event))return;let r=Ce[e.type];r||(r=Ce[e.type]=j("ON_PROPERTY"+e.type));const c=this||e.target||$,t=c[r];let i;return Ve&&c===Te&&"error"===e.type?(i=t&&t.call(this,e.message,e.filename,e.lineno,e.colno,e.error),!0===i&&e.preventDefault()):(i=t&&t.apply(this,arguments),"beforeunload"===e.type&&$[mt]&&"string"==typeof i?e.returnValue=i:null!=i&&!i&&e.preventDefault()),i};function $e(e,r,c){let t=ke(e,r);if(!t&&c&&ke(c,r)&&(t={enumerable:!0,configurable:!0}),!t||!t.configurable)return;const i=j("on"+r+"patched");if(e.hasOwnProperty(i)&&e[i])return;delete t.writable,delete t.value;const u=t.get,E=t.set,T=r.slice(2);let y=Ce[T];y||(y=Ce[T]=j("ON_PROPERTY"+T)),t.set=function(D){let d=this;!d&&e===$&&(d=$),d&&("function"==typeof d[y]&&d.removeEventListener(T,Ye),E&&E.call(d,null),d[y]=D,"function"==typeof D&&d.addEventListener(T,Ye,!1))},t.get=function(){let D=this;if(!D&&e===$&&(D=$),!D)return null;const d=D[y];if(d)return d;if(u){let w=u.call(this);if(w)return t.set.call(this,w),"function"==typeof D[Tt]&&D.removeAttribute(r),w}return null},Ne(e,r,t),e[i]=!0}function Je(e,r,c){if(r)for(let t=0;tfunction(E,T){const y=c(E,T);return y.cbIdx>=0&&"function"==typeof T[y.cbIdx]?He(y.name,T[y.cbIdx],y,i):u.apply(E,T)})}function fe(e,r){e[j("OriginalDelegate")]=r}let Ke=!1,Ge=!1;function kt(){if(Ke)return Ge;Ke=!0;try{const e=Te.navigator.userAgent;(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/")||-1!==e.indexOf("Edge/"))&&(Ge=!0)}catch{}return Ge}function Qe(e){return"function"==typeof e}function et(e){return"number"==typeof e}let ge=!1;if(typeof window<"u")try{const e=Object.defineProperty({},"passive",{get:function(){ge=!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch{ge=!1}const vt={useG:!0},ne={},tt={},nt=new RegExp("^"+ve+"(\\w+)(true|false)$"),rt=j("propagationStopped");function ot(e,r){const c=(r?r(e):e)+le,t=(r?r(e):e)+ae,i=ve+c,u=ve+t;ne[e]={},ne[e][le]=i,ne[e][ae]=u}function bt(e,r,c,t){const i=t&&t.add||Ie,u=t&&t.rm||Me,E=t&&t.listeners||"eventListeners",T=t&&t.rmAll||"removeAllListeners",y=j(i),D="."+i+":",d="prependListener",w="."+d+":",Z=function(k,h,H){if(k.isRemoved)return;const V=k.callback;let Y;"object"==typeof V&&V.handleEvent&&(k.callback=g=>V.handleEvent(g),k.originalDelegate=V);try{k.invoke(k,h,[H])}catch(g){Y=g}const G=k.options;return G&&"object"==typeof G&&G.once&&h[u].call(h,H.type,k.originalDelegate?k.originalDelegate:k.callback,G),Y};function x(k,h,H){if(!(h=h||e.event))return;const V=k||h.target||e,Y=V[ne[h.type][H?ae:le]];if(Y){const G=[];if(1===Y.length){const g=Z(Y[0],V,h);g&&G.push(g)}else{const g=Y.slice();for(let z=0;z{throw z})}}}const U=function(k){return x(this,k,!1)},J=function(k){return x(this,k,!0)};function K(k,h){if(!k)return!1;let H=!0;h&&void 0!==h.useG&&(H=h.useG);const V=h&&h.vh;let Y=!0;h&&void 0!==h.chkDup&&(Y=h.chkDup);let G=!1;h&&void 0!==h.rt&&(G=h.rt);let g=k;for(;g&&!g.hasOwnProperty(i);)g=Le(g);if(!g&&k[i]&&(g=k),!g||g[y])return!1;const z=h&&h.eventNameToString,O={},R=g[y]=g[i],b=g[j(u)]=g[u],S=g[j(E)]=g[E],Q=g[j(T)]=g[T];let W;h&&h.prepend&&(W=g[j(h.prepend)]=g[h.prepend]);const q=H?function(s){if(!O.isExisting)return R.call(O.target,O.eventName,O.capture?J:U,O.options)}:function(s){return R.call(O.target,O.eventName,s.invoke,O.options)},A=H?function(s){if(!s.isRemoved){const l=ne[s.eventName];let v;l&&(v=l[s.capture?ae:le]);const C=v&&s.target[v];if(C)for(let m=0;mse.zone.cancelTask(se);s.call(ye,"abort",ce,{once:!0}),se.removeAbortListener=()=>ye.removeEventListener("abort",ce)}return O.target=null,Pe&&(Pe.taskData=null),lt&&(O.options.once=!0),!ge&&"boolean"==typeof se.options||(se.options=ie),se.target=I,se.capture=Be,se.eventName=M,B&&(se.originalDelegate=F),L?pe.unshift(se):pe.push(se),m?I:void 0}};return g[i]=a(R,D,q,A,G),W&&(g[d]=a(W,w,function(s){return W.call(O.target,O.eventName,s.invoke,O.options)},A,G,!0)),g[u]=function(){const s=this||e;let l=arguments[0];h&&h.transferEventName&&(l=h.transferEventName(l));const v=arguments[2],C=!!v&&("boolean"==typeof v||v.capture),m=arguments[1];if(!m)return b.apply(this,arguments);if(V&&!V(b,m,s,arguments))return;const L=ne[l];let I;L&&(I=L[C?ae:le]);const M=I&&s[I];if(M)for(let F=0;Ffunction(i,u){i[rt]=!0,t&&t.apply(i,u)})}const De=j("zoneTask");function me(e,r,c,t){let i=null,u=null;c+=t;const E={};function T(D){const d=D.data;d.args[0]=function(){return D.invoke.apply(this,arguments)};const w=i.apply(e,d.args);return et(w)?d.handleId=w:(d.handle=w,d.isRefreshable=Qe(w.refresh)),D}function y(D){const{handle:d,handleId:w}=D.data;return u.call(e,d??w)}i=ue(e,r+=t,D=>function(d,w){if(Qe(w[0])){const Z={isRefreshable:!1,isPeriodic:"Interval"===t,delay:"Timeout"===t||"Interval"===t?w[1]||0:void 0,args:w},x=w[0];w[0]=function(){try{return x.apply(this,arguments)}finally{const{handle:H,handleId:V,isPeriodic:Y,isRefreshable:G}=Z;!Y&&!G&&(V?delete E[V]:H&&(H[De]=null))}};const U=He(r,w[0],Z,T,y);if(!U)return U;const{handleId:J,handle:K,isRefreshable:X,isPeriodic:k}=U.data;if(J)E[J]=U;else if(K&&(K[De]=U,X&&!k)){const h=K.refresh;K.refresh=function(){const{zone:H,state:V}=U;return"notScheduled"===V?(U._state="scheduled",H._updateTaskCount(U,1)):"running"===V&&(U._state="scheduling"),h.call(this)}}return K??J??U}return D.apply(e,w)}),u=ue(e,c,D=>function(d,w){const Z=w[0];let x;et(Z)?(x=E[Z],delete E[Z]):(x=Z?.[De],x?Z[De]=null:x=Z),x?.type?x.cancelFn&&x.zone.cancelTask(x):D.apply(e,w)})}function it(e,r,c){if(!c||0===c.length)return r;const t=c.filter(u=>u.target===e);if(!t||0===t.length)return r;const i=t[0].ignoreProperties;return r.filter(u=>-1===i.indexOf(u))}function ct(e,r,c,t){e&&Je(e,it(e,r,c),t)}function Fe(e){return Object.getOwnPropertyNames(e).filter(r=>r.startsWith("on")&&r.length>2).map(r=>r.substring(2))}function It(e,r,c,t,i){const u=Zone.__symbol__(t);if(r[u])return;const E=r[u]=r[t];r[t]=function(T,y,D){return y&&y.prototype&&i.forEach(function(d){const w=`${c}.${t}::`+d,Z=y.prototype;try{if(Z.hasOwnProperty(d)){const x=e.ObjectGetOwnPropertyDescriptor(Z,d);x&&x.value?(x.value=e.wrapWithCurrentZone(x.value,w),e._redefineProperty(y.prototype,d,x)):Z[d]&&(Z[d]=e.wrapWithCurrentZone(Z[d],w))}else Z[d]&&(Z[d]=e.wrapWithCurrentZone(Z[d],w))}catch{}}),E.call(r,T,y,D)},e.attachOriginToPatched(r[t],E)}const at=function Oe(){const e=globalThis,r=!0===e[ee("forceDuplicateZoneCheck")];if(e.Zone&&(r||"function"!=typeof e.Zone.__symbol__))throw new Error("Zone already loaded.");return e.Zone??=function ze(){const e=te.performance;function r(N){e&&e.mark&&e.mark(N)}function c(N,_){e&&e.measure&&e.measure(N,_)}r("Zone");let t=(()=>{class N{static#e=this.__symbol__=ee;static assertZonePatched(){if(te.Promise!==O.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let n=N.current;for(;n.parent;)n=n.parent;return n}static get current(){return b.zone}static get currentTask(){return S}static __load_patch(n,o,p=!1){if(O.hasOwnProperty(n)){const P=!0===te[ee("forceDuplicateZoneCheck")];if(!p&&P)throw Error("Already loaded patch: "+n)}else if(!te["__Zone_disable_"+n]){const P="Zone:"+n;r(P),O[n]=o(te,N,R),c(P,P)}}get parent(){return this._parent}get name(){return this._name}constructor(n,o){this._parent=n,this._name=o?o.name||"unnamed":"",this._properties=o&&o.properties||{},this._zoneDelegate=new u(this,this._parent&&this._parent._zoneDelegate,o)}get(n){const o=this.getZoneWith(n);if(o)return o._properties[n]}getZoneWith(n){let o=this;for(;o;){if(o._properties.hasOwnProperty(n))return o;o=o._parent}return null}fork(n){if(!n)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,n)}wrap(n,o){if("function"!=typeof n)throw new Error("Expecting function got: "+n);const p=this._zoneDelegate.intercept(this,n,o),P=this;return function(){return P.runGuarded(p,this,arguments,o)}}run(n,o,p,P){b={parent:b,zone:this};try{return this._zoneDelegate.invoke(this,n,o,p,P)}finally{b=b.parent}}runGuarded(n,o=null,p,P){b={parent:b,zone:this};try{try{return this._zoneDelegate.invoke(this,n,o,p,P)}catch(q){if(this._zoneDelegate.handleError(this,q))throw q}}finally{b=b.parent}}runTask(n,o,p){if(n.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(n.zone||K).name+"; Execution: "+this.name+")");const P=n,{type:q,data:{isPeriodic:A=!1,isRefreshable:_e=!1}={}}=n;if(n.state===X&&(q===z||q===g))return;const he=n.state!=H;he&&P._transitionTo(H,h);const de=S;S=P,b={parent:b,zone:this};try{q==g&&n.data&&!A&&!_e&&(n.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,P,o,p)}catch(oe){if(this._zoneDelegate.handleError(this,oe))throw oe}}finally{const oe=n.state;if(oe!==X&&oe!==Y)if(q==z||A||_e&&oe===k)he&&P._transitionTo(h,H,k);else{const f=P._zoneDelegates;this._updateTaskCount(P,-1),he&&P._transitionTo(X,H,X),_e&&(P._zoneDelegates=f)}b=b.parent,S=de}}scheduleTask(n){if(n.zone&&n.zone!==this){let p=this;for(;p;){if(p===n.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${n.zone.name}`);p=p.parent}}n._transitionTo(k,X);const o=[];n._zoneDelegates=o,n._zone=this;try{n=this._zoneDelegate.scheduleTask(this,n)}catch(p){throw n._transitionTo(Y,k,X),this._zoneDelegate.handleError(this,p),p}return n._zoneDelegates===o&&this._updateTaskCount(n,1),n.state==k&&n._transitionTo(h,k),n}scheduleMicroTask(n,o,p,P){return this.scheduleTask(new E(G,n,o,p,P,void 0))}scheduleMacroTask(n,o,p,P,q){return this.scheduleTask(new E(g,n,o,p,P,q))}scheduleEventTask(n,o,p,P,q){return this.scheduleTask(new E(z,n,o,p,P,q))}cancelTask(n){if(n.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(n.zone||K).name+"; Execution: "+this.name+")");if(n.state===h||n.state===H){n._transitionTo(V,h,H);try{this._zoneDelegate.cancelTask(this,n)}catch(o){throw n._transitionTo(Y,V),this._zoneDelegate.handleError(this,o),o}return this._updateTaskCount(n,-1),n._transitionTo(X,V),n.runCount=-1,n}}_updateTaskCount(n,o){const p=n._zoneDelegates;-1==o&&(n._zoneDelegates=null);for(let P=0;PN.hasTask(n,o),onScheduleTask:(N,_,n,o)=>N.scheduleTask(n,o),onInvokeTask:(N,_,n,o,p,P)=>N.invokeTask(n,o,p,P),onCancelTask:(N,_,n,o)=>N.cancelTask(n,o)};class u{get zone(){return this._zone}constructor(_,n,o){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this._zone=_,this._parentDelegate=n,this._forkZS=o&&(o&&o.onFork?o:n._forkZS),this._forkDlgt=o&&(o.onFork?n:n._forkDlgt),this._forkCurrZone=o&&(o.onFork?this._zone:n._forkCurrZone),this._interceptZS=o&&(o.onIntercept?o:n._interceptZS),this._interceptDlgt=o&&(o.onIntercept?n:n._interceptDlgt),this._interceptCurrZone=o&&(o.onIntercept?this._zone:n._interceptCurrZone),this._invokeZS=o&&(o.onInvoke?o:n._invokeZS),this._invokeDlgt=o&&(o.onInvoke?n:n._invokeDlgt),this._invokeCurrZone=o&&(o.onInvoke?this._zone:n._invokeCurrZone),this._handleErrorZS=o&&(o.onHandleError?o:n._handleErrorZS),this._handleErrorDlgt=o&&(o.onHandleError?n:n._handleErrorDlgt),this._handleErrorCurrZone=o&&(o.onHandleError?this._zone:n._handleErrorCurrZone),this._scheduleTaskZS=o&&(o.onScheduleTask?o:n._scheduleTaskZS),this._scheduleTaskDlgt=o&&(o.onScheduleTask?n:n._scheduleTaskDlgt),this._scheduleTaskCurrZone=o&&(o.onScheduleTask?this._zone:n._scheduleTaskCurrZone),this._invokeTaskZS=o&&(o.onInvokeTask?o:n._invokeTaskZS),this._invokeTaskDlgt=o&&(o.onInvokeTask?n:n._invokeTaskDlgt),this._invokeTaskCurrZone=o&&(o.onInvokeTask?this._zone:n._invokeTaskCurrZone),this._cancelTaskZS=o&&(o.onCancelTask?o:n._cancelTaskZS),this._cancelTaskDlgt=o&&(o.onCancelTask?n:n._cancelTaskDlgt),this._cancelTaskCurrZone=o&&(o.onCancelTask?this._zone:n._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const p=o&&o.onHasTask;(p||n&&n._hasTaskZS)&&(this._hasTaskZS=p?o:i,this._hasTaskDlgt=n,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,o.onScheduleTask||(this._scheduleTaskZS=i,this._scheduleTaskDlgt=n,this._scheduleTaskCurrZone=this._zone),o.onInvokeTask||(this._invokeTaskZS=i,this._invokeTaskDlgt=n,this._invokeTaskCurrZone=this._zone),o.onCancelTask||(this._cancelTaskZS=i,this._cancelTaskDlgt=n,this._cancelTaskCurrZone=this._zone))}fork(_,n){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,_,n):new t(_,n)}intercept(_,n,o){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,_,n,o):n}invoke(_,n,o,p,P){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,_,n,o,p,P):n.apply(o,p)}handleError(_,n){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,_,n)}scheduleTask(_,n){let o=n;if(this._scheduleTaskZS)this._hasTaskZS&&o._zoneDelegates.push(this._hasTaskDlgtOwner),o=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,_,n),o||(o=n);else if(n.scheduleFn)n.scheduleFn(n);else{if(n.type!=G)throw new Error("Task is missing scheduleFn.");U(n)}return o}invokeTask(_,n,o,p){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,_,n,o,p):n.callback.apply(o,p)}cancelTask(_,n){let o;if(this._cancelTaskZS)o=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,_,n);else{if(!n.cancelFn)throw Error("Task is not cancelable");o=n.cancelFn(n)}return o}hasTask(_,n){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,_,n)}catch(o){this.handleError(_,o)}}_updateTaskCount(_,n){const o=this._taskCounts,p=o[_],P=o[_]=p+n;if(P<0)throw new Error("More tasks executed then were scheduled.");0!=p&&0!=P||this.hasTask(this._zone,{microTask:o.microTask>0,macroTask:o.macroTask>0,eventTask:o.eventTask>0,change:_})}}class E{constructor(_,n,o,p,P,q){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=_,this.source=n,this.data=p,this.scheduleFn=P,this.cancelFn=q,!o)throw new Error("callback is not defined");this.callback=o;const A=this;this.invoke=_===z&&p&&p.useG?E.invokeTask:function(){return E.invokeTask.call(te,A,this,arguments)}}static invokeTask(_,n,o){_||(_=this),Q++;try{return _.runCount++,_.zone.runTask(_,n,o)}finally{1==Q&&J(),Q--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(X,k)}_transitionTo(_,n,o){if(this._state!==n&&this._state!==o)throw new Error(`${this.type} '${this.source}': can not transition to '${_}', expecting state '${n}'${o?" or '"+o+"'":""}, was '${this._state}'.`);this._state=_,_==X&&(this._zoneDelegates=null)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const T=ee("setTimeout"),y=ee("Promise"),D=ee("then");let Z,d=[],w=!1;function x(N){if(Z||te[y]&&(Z=te[y].resolve(0)),Z){let _=Z[D];_||(_=Z.then),_.call(Z,N)}else te[T](N,0)}function U(N){0===Q&&0===d.length&&x(J),N&&d.push(N)}function J(){if(!w){for(w=!0;d.length;){const N=d;d=[];for(let _=0;_b,onUnhandledError:W,microtaskDrainDone:W,scheduleMicroTask:U,showUncaughtError:()=>!t[ee("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:W,patchMethod:()=>W,bindArguments:()=>[],patchThen:()=>W,patchMacroTask:()=>W,patchEventPrototype:()=>W,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>W,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>W,wrapWithCurrentZone:()=>W,filterProperties:()=>[],attachOriginToPatched:()=>W,_redefineProperty:()=>W,patchCallbacks:()=>W,nativeScheduleMicroTask:x};let b={parent:null,zone:new t(null,null)},S=null,Q=0;function W(){}return c("Zone","Zone"),t}(),e.Zone}();(function Zt(e){(function Nt(e){e.__load_patch("ZoneAwarePromise",(r,c,t)=>{const i=Object.getOwnPropertyDescriptor,u=Object.defineProperty,T=t.symbol,y=[],D=!1!==r[T("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],d=T("Promise"),w=T("then"),Z="__creationTrace__";t.onUnhandledError=f=>{if(t.showUncaughtError()){const a=f&&f.rejection;a?console.error("Unhandled Promise rejection:",a instanceof Error?a.message:a,"; Zone:",f.zone.name,"; Task:",f.task&&f.task.source,"; Value:",a,a instanceof Error?a.stack:void 0):console.error(f)}},t.microtaskDrainDone=()=>{for(;y.length;){const f=y.shift();try{f.zone.runGuarded(()=>{throw f.throwOriginal?f.rejection:f})}catch(a){U(a)}}};const x=T("unhandledPromiseRejectionHandler");function U(f){t.onUnhandledError(f);try{const a=c[x];"function"==typeof a&&a.call(this,f)}catch{}}function J(f){return f&&f.then}function K(f){return f}function X(f){return A.reject(f)}const k=T("state"),h=T("value"),H=T("finally"),V=T("parentPromiseValue"),Y=T("parentPromiseState"),G="Promise.then",g=null,z=!0,O=!1,R=0;function b(f,a){return s=>{try{N(f,a,s)}catch(l){N(f,!1,l)}}}const S=function(){let f=!1;return function(s){return function(){f||(f=!0,s.apply(null,arguments))}}},Q="Promise resolved with itself",W=T("currentTaskTrace");function N(f,a,s){const l=S();if(f===s)throw new TypeError(Q);if(f[k]===g){let v=null;try{("object"==typeof s||"function"==typeof s)&&(v=s&&s.then)}catch(C){return l(()=>{N(f,!1,C)})(),f}if(a!==O&&s instanceof A&&s.hasOwnProperty(k)&&s.hasOwnProperty(h)&&s[k]!==g)n(s),N(f,s[k],s[h]);else if(a!==O&&"function"==typeof v)try{v.call(s,l(b(f,a)),l(b(f,!1)))}catch(C){l(()=>{N(f,!1,C)})()}else{f[k]=a;const C=f[h];if(f[h]=s,f[H]===H&&a===z&&(f[k]=f[Y],f[h]=f[V]),a===O&&s instanceof Error){const m=c.currentTask&&c.currentTask.data&&c.currentTask.data[Z];m&&u(s,W,{configurable:!0,enumerable:!1,writable:!0,value:m})}for(let m=0;m{try{const L=f[h],I=!!s&&H===s[H];I&&(s[V]=L,s[Y]=C);const M=a.run(m,void 0,I&&m!==X&&m!==K?[]:[L]);N(s,!0,M)}catch(L){N(s,!1,L)}},s)}const P=function(){},q=r.AggregateError;class A{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(a){return a instanceof A?a:N(new this(null),z,a)}static reject(a){return N(new this(null),O,a)}static withResolvers(){const a={};return a.promise=new A((s,l)=>{a.resolve=s,a.reject=l}),a}static any(a){if(!a||"function"!=typeof a[Symbol.iterator])return Promise.reject(new q([],"All promises were rejected"));const s=[];let l=0;try{for(let m of a)l++,s.push(A.resolve(m))}catch{return Promise.reject(new q([],"All promises were rejected"))}if(0===l)return Promise.reject(new q([],"All promises were rejected"));let v=!1;const C=[];return new A((m,L)=>{for(let I=0;I{v||(v=!0,m(M))},M=>{C.push(M),l--,0===l&&(v=!0,L(new q(C,"All promises were rejected")))})})}static race(a){let s,l,v=new this((L,I)=>{s=L,l=I});function C(L){s(L)}function m(L){l(L)}for(let L of a)J(L)||(L=this.resolve(L)),L.then(C,m);return v}static all(a){return A.allWithCallback(a)}static allSettled(a){return(this&&this.prototype instanceof A?this:A).allWithCallback(a,{thenCallback:l=>({status:"fulfilled",value:l}),errorCallback:l=>({status:"rejected",reason:l})})}static allWithCallback(a,s){let l,v,C=new this((M,F)=>{l=M,v=F}),m=2,L=0;const I=[];for(let M of a){J(M)||(M=this.resolve(M));const F=L;try{M.then(B=>{I[F]=s?s.thenCallback(B):B,m--,0===m&&l(I)},B=>{s?(I[F]=s.errorCallback(B),m--,0===m&&l(I)):v(B)})}catch(B){v(B)}m++,L++}return m-=2,0===m&&l(I),C}constructor(a){const s=this;if(!(s instanceof A))throw new Error("Must be an instanceof Promise.");s[k]=g,s[h]=[];try{const l=S();a&&a(l(b(s,z)),l(b(s,O)))}catch(l){N(s,!1,l)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return A}then(a,s){let l=this.constructor?.[Symbol.species];(!l||"function"!=typeof l)&&(l=this.constructor||A);const v=new l(P),C=c.current;return this[k]==g?this[h].push(C,v,a,s):o(this,C,v,a,s),v}catch(a){return this.then(null,a)}finally(a){let s=this.constructor?.[Symbol.species];(!s||"function"!=typeof s)&&(s=A);const l=new s(P);l[H]=H;const v=c.current;return this[k]==g?this[h].push(v,l,a,a):o(this,v,l,a,a),l}}A.resolve=A.resolve,A.reject=A.reject,A.race=A.race,A.all=A.all;const _e=r[d]=r.Promise;r.Promise=A;const he=T("thenPatched");function de(f){const a=f.prototype,s=i(a,"then");if(s&&(!1===s.writable||!s.configurable))return;const l=a.then;a[w]=l,f.prototype.then=function(v,C){return new A((L,I)=>{l.call(this,L,I)}).then(v,C)},f[he]=!0}return t.patchThen=de,_e&&(de(_e),ue(r,"fetch",f=>function oe(f){return function(a,s){let l=f.apply(a,s);if(l instanceof A)return l;let v=l.constructor;return v[he]||de(v),l}}(f))),Promise[c.__symbol__("uncaughtPromiseErrors")]=y,A})})(e),function Lt(e){e.__load_patch("toString",r=>{const c=Function.prototype.toString,t=j("OriginalDelegate"),i=j("Promise"),u=j("Error"),E=function(){if("function"==typeof this){const d=this[t];if(d)return"function"==typeof d?c.call(d):Object.prototype.toString.call(d);if(this===Promise){const w=r[i];if(w)return c.call(w)}if(this===Error){const w=r[u];if(w)return c.call(w)}}return c.call(this)};E[t]=c,Function.prototype.toString=E;const T=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":T.call(this)}})}(e),function Mt(e){e.__load_patch("util",(r,c,t)=>{const i=Fe(r);t.patchOnProperties=Je,t.patchMethod=ue,t.bindArguments=xe,t.patchMacroTask=yt;const u=c.__symbol__("BLACK_LISTED_EVENTS"),E=c.__symbol__("UNPATCHED_EVENTS");r[E]&&(r[u]=r[E]),r[u]&&(c[u]=c[E]=r[u]),t.patchEventPrototype=Pt,t.patchEventTarget=bt,t.isIEOrEdge=kt,t.ObjectDefineProperty=Ne,t.ObjectGetOwnPropertyDescriptor=ke,t.ObjectCreate=_t,t.ArraySlice=Et,t.patchClass=be,t.wrapWithCurrentZone=je,t.filterProperties=it,t.attachOriginToPatched=fe,t._redefineProperty=Object.defineProperty,t.patchCallbacks=It,t.getGlobalObjects=()=>({globalSources:tt,zoneSymbolEventNames:ne,eventNames:i,isBrowser:Ve,isMix:Xe,isNode:Re,TRUE_STR:ae,FALSE_STR:le,ZONE_SYMBOL_PREFIX:ve,ADD_EVENT_LISTENER_STR:Ie,REMOVE_EVENT_LISTENER_STR:Me})})}(e)})(at),function Ot(e){e.__load_patch("legacy",r=>{const c=r[e.__symbol__("legacyPatch")];c&&c()}),e.__load_patch("timers",r=>{const c="set",t="clear";me(r,c,t,"Timeout"),me(r,c,t,"Interval"),me(r,c,t,"Immediate")}),e.__load_patch("requestAnimationFrame",r=>{me(r,"request","cancel","AnimationFrame"),me(r,"mozRequest","mozCancel","AnimationFrame"),me(r,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(r,c)=>{const t=["alert","prompt","confirm"];for(let i=0;ifunction(D,d){return c.current.run(E,r,d,y)})}),e.__load_patch("EventTarget",(r,c,t)=>{(function Dt(e,r){r.patchEventPrototype(e,r)})(r,t),function Ct(e,r){if(Zone[r.symbol("patchEventTarget")])return;const{eventNames:c,zoneSymbolEventNames:t,TRUE_STR:i,FALSE_STR:u,ZONE_SYMBOL_PREFIX:E}=r.getGlobalObjects();for(let y=0;y{be("MutationObserver"),be("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(r,c,t)=>{be("IntersectionObserver")}),e.__load_patch("FileReader",(r,c,t)=>{be("FileReader")}),e.__load_patch("on_property",(r,c,t)=>{!function St(e,r){if(Re&&!Xe||Zone[e.symbol("patchEvents")])return;const c=r.__Zone_ignore_on_properties;let t=[];if(Ve){const i=window;t=t.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const u=function pt(){try{const e=Te.navigator.userAgent;if(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/"))return!0}catch{}return!1}()?[{target:i,ignoreProperties:["error"]}]:[];ct(i,Fe(i),c&&c.concat(u),Le(i))}t=t.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let i=0;i{!function Rt(e,r){const{isBrowser:c,isMix:t}=r.getGlobalObjects();(c||t)&&e.customElements&&"customElements"in e&&r.patchCallbacks(r,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(r,t)}),e.__load_patch("XHR",(r,c)=>{!function D(d){const w=d.XMLHttpRequest;if(!w)return;const Z=w.prototype;let U=Z[Ze],J=Z[Ae];if(!U){const R=d.XMLHttpRequestEventTarget;if(R){const b=R.prototype;U=b[Ze],J=b[Ae]}}const K="readystatechange",X="scheduled";function k(R){const b=R.data,S=b.target;S[E]=!1,S[y]=!1;const Q=S[u];U||(U=S[Ze],J=S[Ae]),Q&&J.call(S,K,Q);const W=S[u]=()=>{if(S.readyState===S.DONE)if(!b.aborted&&S[E]&&R.state===X){const _=S[c.__symbol__("loadfalse")];if(0!==S.status&&_&&_.length>0){const n=R.invoke;R.invoke=function(){const o=S[c.__symbol__("loadfalse")];for(let p=0;pfunction(R,b){return R[i]=0==b[2],R[T]=b[1],V.apply(R,b)}),G=j("fetchTaskAborting"),g=j("fetchTaskScheduling"),z=ue(Z,"send",()=>function(R,b){if(!0===c.current[g]||R[i])return z.apply(R,b);{const S={target:R,url:R[T],isPeriodic:!1,args:b,aborted:!1},Q=He("XMLHttpRequest.send",h,S,k,H);R&&!0===R[y]&&!S.aborted&&Q.state===X&&Q.invoke()}}),O=ue(Z,"abort",()=>function(R,b){const S=function x(R){return R[t]}(R);if(S&&"string"==typeof S.type){if(null==S.cancelFn||S.data&&S.data.aborted)return;S.zone.cancelTask(S)}else if(!0===c.current[G])return O.apply(R,b)})}(r);const t=j("xhrTask"),i=j("xhrSync"),u=j("xhrListener"),E=j("xhrScheduled"),T=j("xhrURL"),y=j("xhrErrorBeforeScheduled")}),e.__load_patch("geolocation",r=>{r.navigator&&r.navigator.geolocation&&function gt(e,r){const c=e.constructor.name;for(let t=0;t{const y=function(){return T.apply(this,xe(arguments,c+"."+i))};return fe(y,T),y})(u)}}}(r.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(r,c)=>{function t(i){return function(u){st(r,i).forEach(T=>{const y=r.PromiseRejectionEvent;if(y){const D=new y(i,{promise:u.promise,reason:u.rejection});T.invoke(D)}})}}r.PromiseRejectionEvent&&(c[j("unhandledPromiseRejectionHandler")]=t("unhandledrejection"),c[j("rejectionHandledHandler")]=t("rejectionhandled"))}),e.__load_patch("queueMicrotask",(r,c,t)=>{!function wt(e,r){r.patchMethod(e,"queueMicrotask",c=>function(t,i){Zone.current.scheduleMicroTask("queueMicrotask",i[0])})}(r,t)})}(at)}},te=>{te(te.s=6935)}]); \ No newline at end of file diff --git a/demo-app/ngx-auth/polyfills.454dad1637b0f426.js b/demo-app/ngx-auth/polyfills.454dad1637b0f426.js deleted file mode 100644 index 3fc55c9..0000000 --- a/demo-app/ngx-auth/polyfills.454dad1637b0f426.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdemo_app_ngx_auth=self.webpackChunkdemo_app_ngx_auth||[]).push([[461],{6935:()=>{!function(t){const n=t.performance;function i(L){n&&n.mark&&n.mark(L)}function o(L,T){n&&n.measure&&n.measure(L,T)}i("Zone");const c=t.__Zone_symbol_prefix||"__zone_symbol__";function a(L){return c+L}const y=!0===t[a("forceDuplicateZoneCheck")];if(t.Zone){if(y||"function"!=typeof t.Zone.__symbol__)throw new Error("Zone already loaded.");return t.Zone}let d=(()=>{class L{static#e=this.__symbol__=a;static assertZonePatched(){if(t.Promise!==se.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=L.current;for(;e.parent;)e=e.parent;return e}static get current(){return U.zone}static get currentTask(){return oe}static __load_patch(e,r,k=!1){if(se.hasOwnProperty(e)){if(!k&&y)throw Error("Already loaded patch: "+e)}else if(!t["__Zone_disable_"+e]){const C="Zone:"+e;i(C),se[e]=r(t,L,z),o(C,C)}}get parent(){return this._parent}get name(){return this._name}constructor(e,r){this._parent=e,this._name=r?r.name||"unnamed":"",this._properties=r&&r.properties||{},this._zoneDelegate=new v(this,this._parent&&this._parent._zoneDelegate,r)}get(e){const r=this.getZoneWith(e);if(r)return r._properties[e]}getZoneWith(e){let r=this;for(;r;){if(r._properties.hasOwnProperty(e))return r;r=r._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,r){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const k=this._zoneDelegate.intercept(this,e,r),C=this;return function(){return C.runGuarded(k,this,arguments,r)}}run(e,r,k,C){U={parent:U,zone:this};try{return this._zoneDelegate.invoke(this,e,r,k,C)}finally{U=U.parent}}runGuarded(e,r=null,k,C){U={parent:U,zone:this};try{try{return this._zoneDelegate.invoke(this,e,r,k,C)}catch($){if(this._zoneDelegate.handleError(this,$))throw $}}finally{U=U.parent}}runTask(e,r,k){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||J).name+"; Execution: "+this.name+")");if(e.state===x&&(e.type===Q||e.type===P))return;const C=e.state!=E;C&&e._transitionTo(E,j),e.runCount++;const $=oe;oe=e,U={parent:U,zone:this};try{e.type==P&&e.data&&!e.data.isPeriodic&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,r,k)}catch(u){if(this._zoneDelegate.handleError(this,u))throw u}}finally{e.state!==x&&e.state!==h&&(e.type==Q||e.data&&e.data.isPeriodic?C&&e._transitionTo(j,E):(e.runCount=0,this._updateTaskCount(e,-1),C&&e._transitionTo(x,E,x))),U=U.parent,oe=$}}scheduleTask(e){if(e.zone&&e.zone!==this){let k=this;for(;k;){if(k===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);k=k.parent}}e._transitionTo(X,x);const r=[];e._zoneDelegates=r,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(k){throw e._transitionTo(h,X,x),this._zoneDelegate.handleError(this,k),k}return e._zoneDelegates===r&&this._updateTaskCount(e,1),e.state==X&&e._transitionTo(j,X),e}scheduleMicroTask(e,r,k,C){return this.scheduleTask(new p(I,e,r,k,C,void 0))}scheduleMacroTask(e,r,k,C,$){return this.scheduleTask(new p(P,e,r,k,C,$))}scheduleEventTask(e,r,k,C,$){return this.scheduleTask(new p(Q,e,r,k,C,$))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||J).name+"; Execution: "+this.name+")");if(e.state===j||e.state===E){e._transitionTo(G,j,E);try{this._zoneDelegate.cancelTask(this,e)}catch(r){throw e._transitionTo(h,G),this._zoneDelegate.handleError(this,r),r}return this._updateTaskCount(e,-1),e._transitionTo(x,G),e.runCount=0,e}}_updateTaskCount(e,r){const k=e._zoneDelegates;-1==r&&(e._zoneDelegates=null);for(let C=0;CL.hasTask(e,r),onScheduleTask:(L,T,e,r)=>L.scheduleTask(e,r),onInvokeTask:(L,T,e,r,k,C)=>L.invokeTask(e,r,k,C),onCancelTask:(L,T,e,r)=>L.cancelTask(e,r)};class v{constructor(T,e,r){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=T,this._parentDelegate=e,this._forkZS=r&&(r&&r.onFork?r:e._forkZS),this._forkDlgt=r&&(r.onFork?e:e._forkDlgt),this._forkCurrZone=r&&(r.onFork?this.zone:e._forkCurrZone),this._interceptZS=r&&(r.onIntercept?r:e._interceptZS),this._interceptDlgt=r&&(r.onIntercept?e:e._interceptDlgt),this._interceptCurrZone=r&&(r.onIntercept?this.zone:e._interceptCurrZone),this._invokeZS=r&&(r.onInvoke?r:e._invokeZS),this._invokeDlgt=r&&(r.onInvoke?e:e._invokeDlgt),this._invokeCurrZone=r&&(r.onInvoke?this.zone:e._invokeCurrZone),this._handleErrorZS=r&&(r.onHandleError?r:e._handleErrorZS),this._handleErrorDlgt=r&&(r.onHandleError?e:e._handleErrorDlgt),this._handleErrorCurrZone=r&&(r.onHandleError?this.zone:e._handleErrorCurrZone),this._scheduleTaskZS=r&&(r.onScheduleTask?r:e._scheduleTaskZS),this._scheduleTaskDlgt=r&&(r.onScheduleTask?e:e._scheduleTaskDlgt),this._scheduleTaskCurrZone=r&&(r.onScheduleTask?this.zone:e._scheduleTaskCurrZone),this._invokeTaskZS=r&&(r.onInvokeTask?r:e._invokeTaskZS),this._invokeTaskDlgt=r&&(r.onInvokeTask?e:e._invokeTaskDlgt),this._invokeTaskCurrZone=r&&(r.onInvokeTask?this.zone:e._invokeTaskCurrZone),this._cancelTaskZS=r&&(r.onCancelTask?r:e._cancelTaskZS),this._cancelTaskDlgt=r&&(r.onCancelTask?e:e._cancelTaskDlgt),this._cancelTaskCurrZone=r&&(r.onCancelTask?this.zone:e._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const k=r&&r.onHasTask;(k||e&&e._hasTaskZS)&&(this._hasTaskZS=k?r:b,this._hasTaskDlgt=e,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=T,r.onScheduleTask||(this._scheduleTaskZS=b,this._scheduleTaskDlgt=e,this._scheduleTaskCurrZone=this.zone),r.onInvokeTask||(this._invokeTaskZS=b,this._invokeTaskDlgt=e,this._invokeTaskCurrZone=this.zone),r.onCancelTask||(this._cancelTaskZS=b,this._cancelTaskDlgt=e,this._cancelTaskCurrZone=this.zone))}fork(T,e){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,T,e):new d(T,e)}intercept(T,e,r){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,T,e,r):e}invoke(T,e,r,k,C){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,T,e,r,k,C):e.apply(r,k)}handleError(T,e){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,T,e)}scheduleTask(T,e){let r=e;if(this._scheduleTaskZS)this._hasTaskZS&&r._zoneDelegates.push(this._hasTaskDlgtOwner),r=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,T,e),r||(r=e);else if(e.scheduleFn)e.scheduleFn(e);else{if(e.type!=I)throw new Error("Task is missing scheduleFn.");R(e)}return r}invokeTask(T,e,r,k){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,T,e,r,k):e.callback.apply(r,k)}cancelTask(T,e){let r;if(this._cancelTaskZS)r=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,T,e);else{if(!e.cancelFn)throw Error("Task is not cancelable");r=e.cancelFn(e)}return r}hasTask(T,e){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,T,e)}catch(r){this.handleError(T,r)}}_updateTaskCount(T,e){const r=this._taskCounts,k=r[T],C=r[T]=k+e;if(C<0)throw new Error("More tasks executed then were scheduled.");0!=k&&0!=C||this.hasTask(this.zone,{microTask:r.microTask>0,macroTask:r.macroTask>0,eventTask:r.eventTask>0,change:T})}}class p{constructor(T,e,r,k,C,$){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=T,this.source=e,this.data=k,this.scheduleFn=C,this.cancelFn=$,!r)throw new Error("callback is not defined");this.callback=r;const u=this;this.invoke=T===Q&&k&&k.useG?p.invokeTask:function(){return p.invokeTask.call(t,u,this,arguments)}}static invokeTask(T,e,r){T||(T=this),te++;try{return T.runCount++,T.zone.runTask(T,e,r)}finally{1==te&&_(),te--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(x,X)}_transitionTo(T,e,r){if(this._state!==e&&this._state!==r)throw new Error(`${this.type} '${this.source}': can not transition to '${T}', expecting state '${e}'${r?" or '"+r+"'":""}, was '${this._state}'.`);this._state=T,T==x&&(this._zoneDelegates=null)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const M=a("setTimeout"),O=a("Promise"),N=a("then");let K,B=[],H=!1;function q(L){if(K||t[O]&&(K=t[O].resolve(0)),K){let T=K[N];T||(T=K.then),T.call(K,L)}else t[M](L,0)}function R(L){0===te&&0===B.length&&q(_),L&&B.push(L)}function _(){if(!H){for(H=!0;B.length;){const L=B;B=[];for(let T=0;TU,onUnhandledError:W,microtaskDrainDone:W,scheduleMicroTask:R,showUncaughtError:()=>!d[a("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:W,patchMethod:()=>W,bindArguments:()=>[],patchThen:()=>W,patchMacroTask:()=>W,patchEventPrototype:()=>W,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>W,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>W,wrapWithCurrentZone:()=>W,filterProperties:()=>[],attachOriginToPatched:()=>W,_redefineProperty:()=>W,patchCallbacks:()=>W,nativeScheduleMicroTask:q};let U={parent:null,zone:new d(null,null)},oe=null,te=0;function W(){}o("Zone","Zone"),t.Zone=d}(globalThis);const fe=Object.getOwnPropertyDescriptor,pe=Object.defineProperty,be=Object.getPrototypeOf,De=Object.create,ct=Array.prototype.slice,Ze="addEventListener",Oe="removeEventListener",Ne=Zone.__symbol__(Ze),Ie=Zone.__symbol__(Oe),ce="true",ae="false",me=Zone.__symbol__("");function Me(t,n){return Zone.current.wrap(t,n)}function Le(t,n,i,o,c){return Zone.current.scheduleMacroTask(t,n,i,o,c)}const A=Zone.__symbol__,Pe=typeof window<"u",_e=Pe?window:void 0,Y=Pe&&_e||globalThis,at="removeAttribute";function je(t,n){for(let i=t.length-1;i>=0;i--)"function"==typeof t[i]&&(t[i]=Me(t[i],n+"_"+i));return t}function Fe(t){return!t||!1!==t.writable&&!("function"==typeof t.get&&typeof t.set>"u")}const Be=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,we=!("nw"in Y)&&typeof Y.process<"u"&&"[object process]"==={}.toString.call(Y.process),Ae=!we&&!Be&&!(!Pe||!_e.HTMLElement),Ue=typeof Y.process<"u"&&"[object process]"==={}.toString.call(Y.process)&&!Be&&!(!Pe||!_e.HTMLElement),Re={},We=function(t){if(!(t=t||Y.event))return;let n=Re[t.type];n||(n=Re[t.type]=A("ON_PROPERTY"+t.type));const i=this||t.target||Y,o=i[n];let c;return Ae&&i===_e&&"error"===t.type?(c=o&&o.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===c&&t.preventDefault()):(c=o&&o.apply(this,arguments),null!=c&&!c&&t.preventDefault()),c};function qe(t,n,i){let o=fe(t,n);if(!o&&i&&fe(i,n)&&(o={enumerable:!0,configurable:!0}),!o||!o.configurable)return;const c=A("on"+n+"patched");if(t.hasOwnProperty(c)&&t[c])return;delete o.writable,delete o.value;const a=o.get,y=o.set,d=n.slice(2);let b=Re[d];b||(b=Re[d]=A("ON_PROPERTY"+d)),o.set=function(v){let p=this;!p&&t===Y&&(p=Y),p&&("function"==typeof p[b]&&p.removeEventListener(d,We),y&&y.call(p,null),p[b]=v,"function"==typeof v&&p.addEventListener(d,We,!1))},o.get=function(){let v=this;if(!v&&t===Y&&(v=Y),!v)return null;const p=v[b];if(p)return p;if(a){let M=a.call(this);if(M)return o.set.call(this,M),"function"==typeof v[at]&&v.removeAttribute(n),M}return null},pe(t,n,o),t[c]=!0}function Xe(t,n,i){if(n)for(let o=0;ofunction(y,d){const b=i(y,d);return b.cbIdx>=0&&"function"==typeof d[b.cbIdx]?Le(b.name,d[b.cbIdx],b,c):a.apply(y,d)})}function ue(t,n){t[A("OriginalDelegate")]=n}let ze=!1,He=!1;function ht(){if(ze)return He;ze=!0;try{const t=_e.navigator.userAgent;(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/")||-1!==t.indexOf("Edge/"))&&(He=!0)}catch{}return He}Zone.__load_patch("ZoneAwarePromise",(t,n,i)=>{const o=Object.getOwnPropertyDescriptor,c=Object.defineProperty,y=i.symbol,d=[],b=!1!==t[y("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],v=y("Promise"),p=y("then"),M="__creationTrace__";i.onUnhandledError=u=>{if(i.showUncaughtError()){const l=u&&u.rejection;l?console.error("Unhandled Promise rejection:",l instanceof Error?l.message:l,"; Zone:",u.zone.name,"; Task:",u.task&&u.task.source,"; Value:",l,l instanceof Error?l.stack:void 0):console.error(u)}},i.microtaskDrainDone=()=>{for(;d.length;){const u=d.shift();try{u.zone.runGuarded(()=>{throw u.throwOriginal?u.rejection:u})}catch(l){N(l)}}};const O=y("unhandledPromiseRejectionHandler");function N(u){i.onUnhandledError(u);try{const l=n[O];"function"==typeof l&&l.call(this,u)}catch{}}function B(u){return u&&u.then}function H(u){return u}function K(u){return e.reject(u)}const q=y("state"),R=y("value"),_=y("finally"),J=y("parentPromiseValue"),x=y("parentPromiseState"),X="Promise.then",j=null,E=!0,G=!1,h=0;function I(u,l){return s=>{try{z(u,l,s)}catch(f){z(u,!1,f)}}}const P=function(){let u=!1;return function(s){return function(){u||(u=!0,s.apply(null,arguments))}}},Q="Promise resolved with itself",se=y("currentTaskTrace");function z(u,l,s){const f=P();if(u===s)throw new TypeError(Q);if(u[q]===j){let g=null;try{("object"==typeof s||"function"==typeof s)&&(g=s&&s.then)}catch(w){return f(()=>{z(u,!1,w)})(),u}if(l!==G&&s instanceof e&&s.hasOwnProperty(q)&&s.hasOwnProperty(R)&&s[q]!==j)oe(s),z(u,s[q],s[R]);else if(l!==G&&"function"==typeof g)try{g.call(s,f(I(u,l)),f(I(u,!1)))}catch(w){f(()=>{z(u,!1,w)})()}else{u[q]=l;const w=u[R];if(u[R]=s,u[_]===_&&l===E&&(u[q]=u[x],u[R]=u[J]),l===G&&s instanceof Error){const m=n.currentTask&&n.currentTask.data&&n.currentTask.data[M];m&&c(s,se,{configurable:!0,enumerable:!1,writable:!0,value:m})}for(let m=0;m{try{const S=u[R],D=!!s&&_===s[_];D&&(s[J]=S,s[x]=w);const Z=l.run(m,void 0,D&&m!==K&&m!==H?[]:[S]);z(s,!0,Z)}catch(S){z(s,!1,S)}},s)}const L=function(){},T=t.AggregateError;class e{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(l){return l instanceof e?l:z(new this(null),E,l)}static reject(l){return z(new this(null),G,l)}static withResolvers(){const l={};return l.promise=new e((s,f)=>{l.resolve=s,l.reject=f}),l}static any(l){if(!l||"function"!=typeof l[Symbol.iterator])return Promise.reject(new T([],"All promises were rejected"));const s=[];let f=0;try{for(let m of l)f++,s.push(e.resolve(m))}catch{return Promise.reject(new T([],"All promises were rejected"))}if(0===f)return Promise.reject(new T([],"All promises were rejected"));let g=!1;const w=[];return new e((m,S)=>{for(let D=0;D{g||(g=!0,m(Z))},Z=>{w.push(Z),f--,0===f&&(g=!0,S(new T(w,"All promises were rejected")))})})}static race(l){let s,f,g=new this((S,D)=>{s=S,f=D});function w(S){s(S)}function m(S){f(S)}for(let S of l)B(S)||(S=this.resolve(S)),S.then(w,m);return g}static all(l){return e.allWithCallback(l)}static allSettled(l){return(this&&this.prototype instanceof e?this:e).allWithCallback(l,{thenCallback:f=>({status:"fulfilled",value:f}),errorCallback:f=>({status:"rejected",reason:f})})}static allWithCallback(l,s){let f,g,w=new this((Z,V)=>{f=Z,g=V}),m=2,S=0;const D=[];for(let Z of l){B(Z)||(Z=this.resolve(Z));const V=S;try{Z.then(F=>{D[V]=s?s.thenCallback(F):F,m--,0===m&&f(D)},F=>{s?(D[V]=s.errorCallback(F),m--,0===m&&f(D)):g(F)})}catch(F){g(F)}m++,S++}return m-=2,0===m&&f(D),w}constructor(l){const s=this;if(!(s instanceof e))throw new Error("Must be an instanceof Promise.");s[q]=j,s[R]=[];try{const f=P();l&&l(f(I(s,E)),f(I(s,G)))}catch(f){z(s,!1,f)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return e}then(l,s){let f=this.constructor?.[Symbol.species];(!f||"function"!=typeof f)&&(f=this.constructor||e);const g=new f(L),w=n.current;return this[q]==j?this[R].push(w,g,l,s):te(this,w,g,l,s),g}catch(l){return this.then(null,l)}finally(l){let s=this.constructor?.[Symbol.species];(!s||"function"!=typeof s)&&(s=e);const f=new s(L);f[_]=_;const g=n.current;return this[q]==j?this[R].push(g,f,l,l):te(this,g,f,l,l),f}}e.resolve=e.resolve,e.reject=e.reject,e.race=e.race,e.all=e.all;const r=t[v]=t.Promise;t.Promise=e;const k=y("thenPatched");function C(u){const l=u.prototype,s=o(l,"then");if(s&&(!1===s.writable||!s.configurable))return;const f=l.then;l[p]=f,u.prototype.then=function(g,w){return new e((S,D)=>{f.call(this,S,D)}).then(g,w)},u[k]=!0}return i.patchThen=C,r&&(C(r),le(t,"fetch",u=>function $(u){return function(l,s){let f=u.apply(l,s);if(f instanceof e)return f;let g=f.constructor;return g[k]||C(g),f}}(u))),Promise[n.__symbol__("uncaughtPromiseErrors")]=d,e}),Zone.__load_patch("toString",t=>{const n=Function.prototype.toString,i=A("OriginalDelegate"),o=A("Promise"),c=A("Error"),a=function(){if("function"==typeof this){const v=this[i];if(v)return"function"==typeof v?n.call(v):Object.prototype.toString.call(v);if(this===Promise){const p=t[o];if(p)return n.call(p)}if(this===Error){const p=t[c];if(p)return n.call(p)}}return n.call(this)};a[i]=n,Function.prototype.toString=a;const y=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":y.call(this)}});let Ee=!1;if(typeof window<"u")try{const t=Object.defineProperty({},"passive",{get:function(){Ee=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{Ee=!1}const dt={useG:!0},ne={},Ye={},$e=new RegExp("^"+me+"(\\w+)(true|false)$"),Je=A("propagationStopped");function Ke(t,n){const i=(n?n(t):t)+ae,o=(n?n(t):t)+ce,c=me+i,a=me+o;ne[t]={},ne[t][ae]=c,ne[t][ce]=a}function _t(t,n,i,o){const c=o&&o.add||Ze,a=o&&o.rm||Oe,y=o&&o.listeners||"eventListeners",d=o&&o.rmAll||"removeAllListeners",b=A(c),v="."+c+":",p="prependListener",M="."+p+":",O=function(R,_,J){if(R.isRemoved)return;const x=R.callback;let X;"object"==typeof x&&x.handleEvent&&(R.callback=E=>x.handleEvent(E),R.originalDelegate=x);try{R.invoke(R,_,[J])}catch(E){X=E}const j=R.options;return j&&"object"==typeof j&&j.once&&_[a].call(_,J.type,R.originalDelegate?R.originalDelegate:R.callback,j),X};function N(R,_,J){if(!(_=_||t.event))return;const x=R||_.target||t,X=x[ne[_.type][J?ce:ae]];if(X){const j=[];if(1===X.length){const E=O(X[0],x,_);E&&j.push(E)}else{const E=X.slice();for(let G=0;G{throw G})}}}const B=function(R){return N(this,R,!1)},H=function(R){return N(this,R,!0)};function K(R,_){if(!R)return!1;let J=!0;_&&void 0!==_.useG&&(J=_.useG);const x=_&&_.vh;let X=!0;_&&void 0!==_.chkDup&&(X=_.chkDup);let j=!1;_&&void 0!==_.rt&&(j=_.rt);let E=R;for(;E&&!E.hasOwnProperty(c);)E=be(E);if(!E&&R[c]&&(E=R),!E||E[b])return!1;const G=_&&_.eventNameToString,h={},I=E[b]=E[c],P=E[A(a)]=E[a],Q=E[A(y)]=E[y],se=E[A(d)]=E[d];let z;_&&_.prepend&&(z=E[A(_.prepend)]=E[_.prepend]);const e=J?function(s){if(!h.isExisting)return I.call(h.target,h.eventName,h.capture?H:B,h.options)}:function(s){return I.call(h.target,h.eventName,s.invoke,h.options)},r=J?function(s){if(!s.isRemoved){const f=ne[s.eventName];let g;f&&(g=f[s.capture?ce:ae]);const w=g&&s.target[g];if(w)for(let m=0;m{ie.zone.cancelTask(ie)},{once:!0})),h.target=null,ve&&(ve.taskData=null),nt&&(ee.once=!0),!Ee&&"boolean"==typeof ie.options||(ie.options=ee),ie.target=D,ie.capture=Ge,ie.eventName=Z,F&&(ie.originalDelegate=V),S?ye.unshift(ie):ye.push(ie),m?D:void 0}};return E[c]=l(I,v,e,r,j),z&&(E[p]=l(z,M,function(s){return z.call(h.target,h.eventName,s.invoke,h.options)},r,j,!0)),E[a]=function(){const s=this||t;let f=arguments[0];_&&_.transferEventName&&(f=_.transferEventName(f));const g=arguments[2],w=!!g&&("boolean"==typeof g||g.capture),m=arguments[1];if(!m)return P.apply(this,arguments);if(x&&!x(P,m,s,arguments))return;const S=ne[f];let D;S&&(D=S[w?ce:ae]);const Z=D&&s[D];if(Z)for(let V=0;Vfunction(c,a){c[Je]=!0,o&&o.apply(c,a)})}function Tt(t,n,i,o,c){const a=Zone.__symbol__(o);if(n[a])return;const y=n[a]=n[o];n[o]=function(d,b,v){return b&&b.prototype&&c.forEach(function(p){const M=`${i}.${o}::`+p,O=b.prototype;try{if(O.hasOwnProperty(p)){const N=t.ObjectGetOwnPropertyDescriptor(O,p);N&&N.value?(N.value=t.wrapWithCurrentZone(N.value,M),t._redefineProperty(b.prototype,p,N)):O[p]&&(O[p]=t.wrapWithCurrentZone(O[p],M))}else O[p]&&(O[p]=t.wrapWithCurrentZone(O[p],M))}catch{}}),y.call(n,d,b,v)},t.attachOriginToPatched(n[o],y)}function et(t,n,i){if(!i||0===i.length)return n;const o=i.filter(a=>a.target===t);if(!o||0===o.length)return n;const c=o[0].ignoreProperties;return n.filter(a=>-1===c.indexOf(a))}function tt(t,n,i,o){t&&Xe(t,et(t,n,i),o)}function xe(t){return Object.getOwnPropertyNames(t).filter(n=>n.startsWith("on")&&n.length>2).map(n=>n.substring(2))}Zone.__load_patch("util",(t,n,i)=>{const o=xe(t);i.patchOnProperties=Xe,i.patchMethod=le,i.bindArguments=je,i.patchMacroTask=ut;const c=n.__symbol__("BLACK_LISTED_EVENTS"),a=n.__symbol__("UNPATCHED_EVENTS");t[a]&&(t[c]=t[a]),t[c]&&(n[c]=n[a]=t[c]),i.patchEventPrototype=Et,i.patchEventTarget=_t,i.isIEOrEdge=ht,i.ObjectDefineProperty=pe,i.ObjectGetOwnPropertyDescriptor=fe,i.ObjectCreate=De,i.ArraySlice=ct,i.patchClass=ge,i.wrapWithCurrentZone=Me,i.filterProperties=et,i.attachOriginToPatched=ue,i._redefineProperty=Object.defineProperty,i.patchCallbacks=Tt,i.getGlobalObjects=()=>({globalSources:Ye,zoneSymbolEventNames:ne,eventNames:o,isBrowser:Ae,isMix:Ue,isNode:we,TRUE_STR:ce,FALSE_STR:ae,ZONE_SYMBOL_PREFIX:me,ADD_EVENT_LISTENER_STR:Ze,REMOVE_EVENT_LISTENER_STR:Oe})});const Ce=A("zoneTask");function Te(t,n,i,o){let c=null,a=null;i+=o;const y={};function d(v){const p=v.data;return p.args[0]=function(){return v.invoke.apply(this,arguments)},p.handleId=c.apply(t,p.args),v}function b(v){return a.call(t,v.data.handleId)}c=le(t,n+=o,v=>function(p,M){if("function"==typeof M[0]){const O={isPeriodic:"Interval"===o,delay:"Timeout"===o||"Interval"===o?M[1]||0:void 0,args:M},N=M[0];M[0]=function(){try{return N.apply(this,arguments)}finally{O.isPeriodic||("number"==typeof O.handleId?delete y[O.handleId]:O.handleId&&(O.handleId[Ce]=null))}};const B=Le(n,M[0],O,d,b);if(!B)return B;const H=B.data.handleId;return"number"==typeof H?y[H]=B:H&&(H[Ce]=B),H&&H.ref&&H.unref&&"function"==typeof H.ref&&"function"==typeof H.unref&&(B.ref=H.ref.bind(H),B.unref=H.unref.bind(H)),"number"==typeof H||H?H:B}return v.apply(t,M)}),a=le(t,i,v=>function(p,M){const O=M[0];let N;"number"==typeof O?N=y[O]:(N=O&&O[Ce],N||(N=O)),N&&"string"==typeof N.type?"notScheduled"!==N.state&&(N.cancelFn&&N.data.isPeriodic||0===N.runCount)&&("number"==typeof O?delete y[O]:O&&(O[Ce]=null),N.zone.cancelTask(N)):v.apply(t,M)})}Zone.__load_patch("legacy",t=>{const n=t[Zone.__symbol__("legacyPatch")];n&&n()}),Zone.__load_patch("timers",t=>{const n="set",i="clear";Te(t,n,i,"Timeout"),Te(t,n,i,"Interval"),Te(t,n,i,"Immediate")}),Zone.__load_patch("requestAnimationFrame",t=>{Te(t,"request","cancel","AnimationFrame"),Te(t,"mozRequest","mozCancel","AnimationFrame"),Te(t,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",(t,n)=>{const i=["alert","prompt","confirm"];for(let o=0;ofunction(b,v){return n.current.run(a,t,v,d)})}),Zone.__load_patch("EventTarget",(t,n,i)=>{(function kt(t,n){n.patchEventPrototype(t,n)})(t,i),function gt(t,n){if(Zone[n.symbol("patchEventTarget")])return;const{eventNames:i,zoneSymbolEventNames:o,TRUE_STR:c,FALSE_STR:a,ZONE_SYMBOL_PREFIX:y}=n.getGlobalObjects();for(let b=0;b{ge("MutationObserver"),ge("WebKitMutationObserver")}),Zone.__load_patch("IntersectionObserver",(t,n,i)=>{ge("IntersectionObserver")}),Zone.__load_patch("FileReader",(t,n,i)=>{ge("FileReader")}),Zone.__load_patch("on_property",(t,n,i)=>{!function yt(t,n){if(we&&!Ue||Zone[t.symbol("patchEvents")])return;const i=n.__Zone_ignore_on_properties;let o=[];if(Ae){const c=window;o=o.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const a=function ft(){try{const t=_e.navigator.userAgent;if(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/"))return!0}catch{}return!1}()?[{target:c,ignoreProperties:["error"]}]:[];tt(c,xe(c),i&&i.concat(a),be(c))}o=o.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let c=0;c{!function mt(t,n){const{isBrowser:i,isMix:o}=n.getGlobalObjects();(i||o)&&t.customElements&&"customElements"in t&&n.patchCallbacks(n,t.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(t,i)}),Zone.__load_patch("XHR",(t,n)=>{!function b(v){const p=v.XMLHttpRequest;if(!p)return;const M=p.prototype;let N=M[Ne],B=M[Ie];if(!N){const h=v.XMLHttpRequestEventTarget;if(h){const I=h.prototype;N=I[Ne],B=I[Ie]}}const H="readystatechange",K="scheduled";function q(h){const I=h.data,P=I.target;P[a]=!1,P[d]=!1;const Q=P[c];N||(N=P[Ne],B=P[Ie]),Q&&B.call(P,H,Q);const se=P[c]=()=>{if(P.readyState===P.DONE)if(!I.aborted&&P[a]&&h.state===K){const U=P[n.__symbol__("loadfalse")];if(0!==P.status&&U&&U.length>0){const oe=h.invoke;h.invoke=function(){const te=P[n.__symbol__("loadfalse")];for(let W=0;Wfunction(h,I){return h[o]=0==I[2],h[y]=I[1],J.apply(h,I)}),X=A("fetchTaskAborting"),j=A("fetchTaskScheduling"),E=le(M,"send",()=>function(h,I){if(!0===n.current[j]||h[o])return E.apply(h,I);{const P={target:h,url:h[y],isPeriodic:!1,args:I,aborted:!1},Q=Le("XMLHttpRequest.send",R,P,q,_);h&&!0===h[d]&&!P.aborted&&Q.state===K&&Q.invoke()}}),G=le(M,"abort",()=>function(h,I){const P=function O(h){return h[i]}(h);if(P&&"string"==typeof P.type){if(null==P.cancelFn||P.data&&P.data.aborted)return;P.zone.cancelTask(P)}else if(!0===n.current[X])return G.apply(h,I)})}(t);const i=A("xhrTask"),o=A("xhrSync"),c=A("xhrListener"),a=A("xhrScheduled"),y=A("xhrURL"),d=A("xhrErrorBeforeScheduled")}),Zone.__load_patch("geolocation",t=>{t.navigator&&t.navigator.geolocation&&function lt(t,n){const i=t.constructor.name;for(let o=0;o{const b=function(){return d.apply(this,je(arguments,i+"."+c))};return ue(b,d),b})(a)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",(t,n)=>{function i(o){return function(c){Qe(t,o).forEach(y=>{const d=t.PromiseRejectionEvent;if(d){const b=new d(o,{promise:c.promise,reason:c.rejection});y.invoke(b)}})}}t.PromiseRejectionEvent&&(n[A("unhandledPromiseRejectionHandler")]=i("unhandledrejection"),n[A("rejectionHandledHandler")]=i("rejectionhandled"))}),Zone.__load_patch("queueMicrotask",(t,n,i)=>{!function pt(t,n){n.patchMethod(t,"queueMicrotask",i=>function(o,c){Zone.current.scheduleMicroTask("queueMicrotask",c[0])})}(t,i)})}},fe=>{fe(fe.s=6935)}]); \ No newline at end of file diff --git a/demo-app/ngx-auth/runtime.edcb705153caef3a.js b/demo-app/ngx-auth/runtime.5f73b1b9becf6eb6.js similarity index 58% rename from demo-app/ngx-auth/runtime.edcb705153caef3a.js rename to demo-app/ngx-auth/runtime.5f73b1b9becf6eb6.js index c9a2512..c57b9e6 100644 --- a/demo-app/ngx-auth/runtime.edcb705153caef3a.js +++ b/demo-app/ngx-auth/runtime.5f73b1b9becf6eb6.js @@ -1 +1 @@ -(()=>{"use strict";var e,m={},v={};function t(e){var u=v[e];if(void 0!==u)return u.exports;var r=v[e]={exports:{}};return m[e].call(r.exports,r,r.exports,t),r.exports}t.m=m,e=[],t.O=(u,r,o,i)=>{if(!r){var a=1/0;for(n=0;n=i)&&Object.keys(t.O).every(b=>t.O[b](r[f]))?r.splice(f--,1):(s=!1,i0&&e[n-1][2]>i;n--)e[n]=e[n-1];e[n]=[r,o,i]},t.d=(e,u)=>{for(var r in u)t.o(u,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:u[r]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((u,r)=>(t.f[r](e,u),u),[])),t.u=e=>e+".e0dbcb6f14904117.js",t.miniCssF=e=>{},t.o=(e,u)=>Object.prototype.hasOwnProperty.call(e,u),(()=>{var e={},u="demo-app-ngx-auth:";t.l=(r,o,i,n)=>{if(e[r])e[r].push(o);else{var a,s;if(void 0!==i)for(var f=document.getElementsByTagName("script"),d=0;d{a.onerror=a.onload=null,clearTimeout(c);var h=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(_=>_(b)),g)return g(b)},c=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),t.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;t.tt=()=>(void 0===e&&(e={createScriptURL:u=>u},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),t.tu=e=>t.tt().createScriptURL(e),t.p="/auth-js/demo-app/ngx-auth/",(()=>{var e={121:0};t.f.j=(o,i)=>{var n=t.o(e,o)?e[o]:void 0;if(0!==n)if(n)i.push(n[2]);else if(121!=o){var a=new Promise((l,p)=>n=e[o]=[l,p]);i.push(n[2]=a);var s=t.p+t.u(o),f=new Error;t.l(s,l=>{if(t.o(e,o)&&(0!==(n=e[o])&&(e[o]=void 0),n)){var p=l&&("load"===l.type?"missing":l.type),c=l&&l.target&&l.target.src;f.message="Loading chunk "+o+" failed.\n("+p+": "+c+")",f.name="ChunkLoadError",f.type=p,f.request=c,n[1](f)}},"chunk-"+o,o)}else e[o]=0},t.O.j=o=>0===e[o];var u=(o,i)=>{var f,d,[n,a,s]=i,l=0;if(n.some(c=>0!==e[c])){for(f in a)t.o(a,f)&&(t.m[f]=a[f]);if(s)var p=s(t)}for(o&&o(i);l{"use strict";var e,m={},v={};function t(e){var u=v[e];if(void 0!==u)return u.exports;var r=v[e]={exports:{}};return m[e].call(r.exports,r,r.exports,t),r.exports}t.m=m,e=[],t.O=(u,r,o,i)=>{if(!r){var a=1/0;for(n=0;n=i)&&Object.keys(t.O).every(b=>t.O[b](r[f]))?r.splice(f--,1):(s=!1,i0&&e[n-1][2]>i;n--)e[n]=e[n-1];e[n]=[r,o,i]},t.d=(e,u)=>{for(var r in u)t.o(u,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:u[r]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((u,r)=>(t.f[r](e,u),u),[])),t.u=e=>e+".7d2c96e76000cb11.js",t.miniCssF=e=>{},t.o=(e,u)=>Object.prototype.hasOwnProperty.call(e,u),(()=>{var e={},u="demo-app-ngx-auth:";t.l=(r,o,i,n)=>{if(e[r])e[r].push(o);else{var a,s;if(void 0!==i)for(var f=document.getElementsByTagName("script"),l=0;l{a.onerror=a.onload=null,clearTimeout(p);var h=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(_=>_(b)),g)return g(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),t.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;t.tt=()=>(void 0===e&&(e={createScriptURL:u=>u},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),t.tu=e=>t.tt().createScriptURL(e),t.p="/auth-js/demo-app/ngx-auth/",(()=>{var e={121:0};t.f.j=(o,i)=>{var n=t.o(e,o)?e[o]:void 0;if(0!==n)if(n)i.push(n[2]);else if(121!=o){var a=new Promise((d,c)=>n=e[o]=[d,c]);i.push(n[2]=a);var s=t.p+t.u(o),f=new Error;t.l(s,d=>{if(t.o(e,o)&&(0!==(n=e[o])&&(e[o]=void 0),n)){var c=d&&("load"===d.type?"missing":d.type),p=d&&d.target&&d.target.src;f.message="Loading chunk "+o+" failed.\n("+c+": "+p+")",f.name="ChunkLoadError",f.type=c,f.request=p,n[1](f)}},"chunk-"+o,o)}else e[o]=0},t.O.j=o=>0===e[o];var u=(o,i)=>{var f,l,[n,a,s]=i,d=0;if(n.some(p=>0!==e[p])){for(f in a)t.o(a,f)&&(t.m[f]=a[f]);if(s)var c=s(t)}for(o&&o(i);d