diff --git a/app/src/__tests__/router-app-view.test.ts b/app/src/__tests__/router-app-view.test.ts index c00ce519..aeaf7788 100644 --- a/app/src/__tests__/router-app-view.test.ts +++ b/app/src/__tests__/router-app-view.test.ts @@ -26,4 +26,41 @@ describe('routerAppView', () => { expect(routerAppView(page, 'cart').loops).toEqual([loop]); expect(routerAppView(page, 'app-root').loops).toBeUndefined(); }); + + it("shows a secondary app's own outlets, links and preloads, and the page's guard recording", () => { + const outlet = { outlet: 'primary', activated: true, component: 'Cart' }; + const link = { text: 'Basket', element: 'a', devtoolsId: 'd1', href: '/basket' }; + const preload = { path: 'checkout', startedAt: 1, ms: 4 }; + const page = { + pageId: 'p', + reportedAt: 1, + changedAt: 1, + snapshot: null, + navigations: [], + outlets: [{ outlet: 'primary', activated: true, component: 'Shell' }], + links: [{ text: 'Home', element: 'a', devtoolsId: 'd0', href: '/' }], + preloads: [], + instrumented: true, + apps: [ + { id: 'app-root', name: 'Shell', selector: 'app-root', primary: true }, + { + id: 'cart', + name: 'Cart', + selector: 'cart-widget', + navigations: [], + outlets: [outlet], + links: [link], + linksTruncated: 2, + preloads: [preload], + }, + ], + } as unknown as RouterPage; + const cart = routerAppView(page, 'cart'); + expect(cart.outlets).toEqual([outlet]); + expect(cart.links).toEqual([link]); + expect(cart.linksTruncated).toBe(2); + expect(cart.preloads).toEqual([preload]); + expect(cart.instrumented).toBe(true); + expect(routerAppView(page, 'app-root').links?.[0].text).toBe('Home'); + }); }); diff --git a/app/src/pages/router-types.ts b/app/src/pages/router-types.ts index ea96ddf6..36117875 100644 --- a/app/src/pages/router-types.ts +++ b/app/src/pages/router-types.ts @@ -64,8 +64,9 @@ export function routerAppsOf(page: RouterPage | null | undefined): RouterApp[] { /** * The page as one of its apps sees it, as the server builds it for the agent - * tools: that app's route, navigations, config and setup in place of the first - * app's. Outlets, links, preloads and guard recording belong to the first app. + * tools: that app's route, navigations, config, setup, outlets, links and + * preloads in place of the first app's. Guard recording is one switch for the + * whole page. */ export function routerAppView(page: RouterPage, appId: string | null): RouterPage { const app = routerAppsOf(page).find((a) => a.id === appId); @@ -83,6 +84,12 @@ export function routerAppView(page: RouterPage, appId: string | null): RouterPag configTruncated: app.configTruncated, activeIds: app.activeIds, setup: app.setup, + outlets: app.outlets, + links: app.links, + linksTruncated: app.linksTruncated, + linksUnchecked: app.linksUnchecked, + preloads: app.preloads, + instrumented: page.instrumented, loops: app.loops, apps: page.apps, appId: app.id, diff --git a/apps/docs/src/content/agents/tools.md b/apps/docs/src/content/agents/tools.md index 12eb6383..822b4986 100644 --- a/apps/docs/src/content/agents/tools.md +++ b/apps/docs/src/content/agents/tools.md @@ -665,7 +665,7 @@ Stores that report through the Redux DevTools extension API, such as NGXS, Elf a All router tools read the page, except `scan-render-mode`, which also reads your `*.routes.server.ts` files. -On a page that runs more than one Angular app with a Router, `inspect-route`, `explain-navigation`, `diff-navigations`, `preview-navigation`, `list-routes`, `lint-routes` and `router-config` take an optional `app`: the app's id (the tag of its root, such as `app-root`) or its root component name. Without `app` they answer for the first app, and the answer ends with a line that names the other apps. An unknown `app` is refused with the list of apps. See [Several apps on one page](../inspectors/router.md#several-apps-on-one-page). +On a page that runs more than one Angular app with a Router, `inspect-route`, `explain-navigation`, `diff-navigations`, `follow-navigations`, `preview-navigation`, `list-routes`, `lint-routes` and `router-config` take an optional `app`: the app's id (the tag of its root, such as `app-root`) or its root component name. Without `app` they answer for the first app, and the answer ends with a line that names the other apps. An unknown `app` is refused with the list of apps. See [Several apps on one page](../inspectors/router.md#several-apps-on-one-page). ### Read the current route @@ -683,13 +683,14 @@ Use `diff-navigations` for "why did this work last time". Without `b`, it takes `follow-navigations` returns the navigations that are new or changed since a cursor, oldest first, across every page. Use it to follow a login and redirect flow step by step without calling `explain-navigation` in a loop. Reads: page. -| Argument | Value | -| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `since` | The cursor a previous call returned. Without it, the tool lists the last 5 navigations and the current cursor. | -| `waitMs` | With `since`: how long to wait, at most 30000 ms, when no navigation came after the cursor yet. The tool answers as soon as one comes. Default 0. | -| `page` | Only the navigations of this page. | +| Argument | Value | +| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `since` | The cursor a previous call returned. Without it, the tool lists the last 5 navigations and the current cursor. | +| `waitMs` | With `since`: how long to wait, at most 30000 ms, when no navigation came after the cursor yet. The tool answers as soon as one comes. Default 0. | +| `page` | Only the navigations of this page. | +| `app` | On a page that runs several Angular apps with a Router, the app to follow: its id or root component name. Without it, the tool follows the first app of each page. | -Each line has the sequence number, the page, the navigation id, the URL, the outcome, the time, a redirect target and the reason it failed. The answer ends with **Next cursor**: pass it as `since` on the next call. A navigation that was still pending comes again with `(updated)` once it ends, is redirected or changes target. Probes are left out. The server keeps the last 500 changes, and says how many a cursor missed. A cursor from before the server started lists everything it kept. +Each line has the sequence number, the page, the app (for an app other than the first), the navigation id, the URL, the outcome, the time, a redirect target and the reason it failed. The answer ends with **Next cursor**: pass it as `since` on the next call. A navigation that was still pending comes again with `(updated)` once it ends, is redirected or changes target. Probes are left out. The server keeps the last 500 changes, and says how many a cursor missed. A cursor from before the server started lists everything it kept. ### Read the route config diff --git a/apps/docs/src/content/inspectors/router.md b/apps/docs/src/content/inspectors/router.md index 527bbd73..273add74 100644 --- a/apps/docs/src/content/inspectors/router.md +++ b/apps/docs/src/content/inspectors/router.md @@ -179,18 +179,20 @@ The overlay reads the helper `provideRouter()` publishes (`ng.ɵgetRouterInstanc A page can bootstrap more than one Angular app, with several `bootstrapApplication()` calls or micro-frontends. Each app root (an element with `ng-version`) that has its own Router counts as an app. Roots that share one Router count once. -When a page has more than one, the **Live router** heading shows an **App** picker. Each app is listed by its root component and tag, such as `ShellApp `. The first app is the router that has routes or has navigated, else the first root. Pick another app to see its route, navigations, config, setup and lint. The buttons that act on the router (**Go**, **Read lazy**, **Abort**, **Probe in app** and **Replay**) run on the app you picked. A page with one app shows no picker. +When a page has more than one, the **Live router** heading shows an **App** picker. Each app is listed by its root component and tag, such as `ShellApp `. The first app is the router that has routes or has navigated, else the first root. Pick another app to see its route, navigations, config, setup, outlets, links, preloads and lint. The buttons that act on the router (**Go**, **Read lazy**, **Abort**, **Probe in app** and **Replay**) run on the app you picked. A page with one app shows no picker. Each app has an id: the tag of its root, with `-2`, `-3` and so on for a second root with the same tag. The id stays the same while the root is on the page, and a root that replaces a removed one with the same tag gets the same id back. The router agent tools take that id, or the root component name, as `app`. -Some parts stay with the first app: +The overlay watches each app's Router on its own, so nothing one app does shows under another: -| What | Why | -| ------------------ | --------------------------------------------------------------------------------------------------- | -| Outlets and links | The overlay reads them from the whole page. They show on the first app only. | -| Preloads | The overlay watches the first app's preloader. | -| Guard recording | It wraps the first app's guards. On another app, **Record each guard and resolver** shows an error. | -| Follow navigations | `follow-navigations` streams the first app's navigations. | +| What | Which app it belongs to | +| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Navigations and callers | The app whose Router navigated. A `RouterLink` click counts for the app whose Router the link uses. | +| Outlets | The app whose Router fills them. | +| Links | The app whose Router the `RouterLink` or `RouterLinkActive` directive uses. A link that names no Router goes to the first app. Each app lists at most 100 links, and the 2000-element check covers the whole page. | +| Preloads | The app whose preloader ran them. | +| Guard and resolver runs | The app that ran them. A guard two apps share (one class, or one routes array) is wrapped once, and each run goes to the app with a navigation in progress. **Record each guard and resolver** covers every app. | +| History changes made outside the router | The first app. They come from the browser's Navigation API, which the whole page shares. | ### Development builds @@ -260,7 +262,7 @@ Without that recording, the guards listed for a navigation are candidates: the ` | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `pangular:explain-navigation` | Why a navigation failed or redirected, with any loop and the cause of each hop. Pass `url` or `id` to narrow it, `limit` for more than the last 5 (up to `limits.navigations`), `perf` for the slowest ones, or `format: "repro"` for a markdown repro of one navigation. | | `pangular:diff-navigations` | What changed between two navigations: params, data, guards, resolvers, outlets, components and timing. Pass `a` and `b`, or leave them out to compare the newest navigation with the last one to the same path. | -| `pangular:follow-navigations` | New and changed navigations since a cursor, across pages. Pass the cursor back as `since`, with `waitMs` to wait for the next navigation. | +| `pangular:follow-navigations` | New and changed navigations since a cursor, across pages. Pass the cursor back as `since`, with `waitMs` to wait for the next navigation, and `app` to follow another app. | | `pangular:preview-navigation` | What going to a URL would do, from the live config and without navigating: redirects, the route chain, guards, lazy chunks, resolvers and components in order, source files and render mode. | | `pangular:inspect-route` | The route the page is on. Pass `component` (a component class, tag or link text) for the route a component was rendered for, or a link state. | | `pangular:list-routes` | The live config with source files and example URLs. `match` predicts a URL, `audit` lists the guards of each page, `resolveLazy` loads the routes of a lazy route first. | @@ -273,7 +275,7 @@ Without that recording, the guards listed for a navigation are candidates: the ` | `pangular:record-guards` | Turns per-guard and per-resolver recording on or off. | | `pangular:router` (resource) | The active route tree and recent navigations of each page. | -On a page that runs several apps, `inspect-route`, `explain-navigation`, `diff-navigations`, `preview-navigation`, `list-routes`, `lint-routes` and `router-config` take an optional `app`: the app's id or root component name. Without it they answer for the first app and name the others. +On a page that runs several apps, `inspect-route`, `explain-navigation`, `diff-navigations`, `follow-navigations`, `preview-navigation`, `list-routes`, `lint-routes` and `router-config` take an optional `app`: the app's id or root component name. Without it they answer for the first app and name the others. `navigate` and `probe-route` only accept same-origin relative URLs that start with `/`. With [`actions.router`](../getting-started/configuration.md#actions) set to `false`, the server drops `navigate` and `probe-route`, and keeps `record-guards` and `list-routes` with `resolveLazy`. See [Tools](../agents/tools.md). diff --git a/extension/ui/assets/browser-agent-rpc-KH4HHvHf-DqNFcBHr.js b/extension/ui/assets/browser-agent-rpc-KH4HHvHf-G6FmeCEh.js similarity index 95% rename from extension/ui/assets/browser-agent-rpc-KH4HHvHf-DqNFcBHr.js rename to extension/ui/assets/browser-agent-rpc-KH4HHvHf-G6FmeCEh.js index 718def3d..41cc82d8 100644 --- a/extension/ui/assets/browser-agent-rpc-KH4HHvHf-DqNFcBHr.js +++ b/extension/ui/assets/browser-agent-rpc-KH4HHvHf-G6FmeCEh.js @@ -1 +1 @@ -import{t as e}from"./index-Dw3jx7J8.js";var t=Symbol.for(`devframe:browser-agent-registry`),{tools:n,listeners:r}=globalThis[t]??={tools:new Map,listeners:new Set};function i(){return[...n.values()]}function a(e){return r.add(e),()=>r.delete(e)}var o=`devframe:client-id`,s;function c(t=globalThis.window){try{let n=t?.sessionStorage;if(n){let t=n.getItem(o);return t||(t=e(),n.setItem(o,t)),t}}catch{}return s??=e(),s}function l(){let e=typeof document>`u`?void 0:document;return{url:e?.location?.href??``,title:e?.title??``,visible:!e||e.visibilityState===`visible`,focused:e?.hasFocus()??!0}}function u(e){e.client.register({name:`devframe:agent:invoke-client-tool`,type:`action`,jsonSerializable:!0,handler:async(e,t)=>{let n=i().find(t=>t.id===e);if(!n)throw Error(`[devframe/agent] browser tool "${e}" not found`);return await n.invoke(t)}});let t=!1,n=!1,r=0,o=()=>{t||n||(t=!0,queueMicrotask(async()=>{if(t=!1,n)return;let a=i().map(({invoke:e,...t})=>t);(a.length!==0||r!==0)&&(r=a.length,await e.callOptional(`devframe:agent:sync-client-tools`,c(),a,l()).catch(()=>{}))}))},s=a(o),u=e.events.on(`connection:status`,e=>{e===`connected`&&o()}),d=typeof window>`u`?void 0:window;return d?.addEventListener(`focus`,o),d?.addEventListener(`blur`,o),d?.document.addEventListener(`visibilitychange`,o),o(),()=>{n=!0,s(),u(),d?.removeEventListener(`focus`,o),d?.removeEventListener(`blur`,o),d?.document.removeEventListener(`visibilitychange`,o)}}export{u as setupBrowserAgentRpcBridge}; \ No newline at end of file +import{t as e}from"./index-B6W3bI5a.js";var t=Symbol.for(`devframe:browser-agent-registry`),{tools:n,listeners:r}=globalThis[t]??={tools:new Map,listeners:new Set};function i(){return[...n.values()]}function a(e){return r.add(e),()=>r.delete(e)}var o=`devframe:client-id`,s;function c(t=globalThis.window){try{let n=t?.sessionStorage;if(n){let t=n.getItem(o);return t||(t=e(),n.setItem(o,t)),t}}catch{}return s??=e(),s}function l(){let e=typeof document>`u`?void 0:document;return{url:e?.location?.href??``,title:e?.title??``,visible:!e||e.visibilityState===`visible`,focused:e?.hasFocus()??!0}}function u(e){e.client.register({name:`devframe:agent:invoke-client-tool`,type:`action`,jsonSerializable:!0,handler:async(e,t)=>{let n=i().find(t=>t.id===e);if(!n)throw Error(`[devframe/agent] browser tool "${e}" not found`);return await n.invoke(t)}});let t=!1,n=!1,r=0,o=()=>{t||n||(t=!0,queueMicrotask(async()=>{if(t=!1,n)return;let a=i().map(({invoke:e,...t})=>t);(a.length!==0||r!==0)&&(r=a.length,await e.callOptional(`devframe:agent:sync-client-tools`,c(),a,l()).catch(()=>{}))}))},s=a(o),u=e.events.on(`connection:status`,e=>{e===`connected`&&o()}),d=typeof window>`u`?void 0:window;return d?.addEventListener(`focus`,o),d?.addEventListener(`blur`,o),d?.document.addEventListener(`visibilitychange`,o),o(),()=>{n=!0,s(),u(),d?.removeEventListener(`focus`,o),d?.removeEventListener(`blur`,o),d?.document.removeEventListener(`visibilitychange`,o)}}export{u as setupBrowserAgentRpcBridge}; \ No newline at end of file diff --git a/extension/ui/assets/index-Dw3jx7J8.js b/extension/ui/assets/index-B6W3bI5a.js similarity index 99% rename from extension/ui/assets/index-Dw3jx7J8.js rename to extension/ui/assets/index-B6W3bI5a.js index adc401a8..e5c58aa8 100644 --- a/extension/ui/assets/index-Dw3jx7J8.js +++ b/extension/ui/assets/index-B6W3bI5a.js @@ -5,7 +5,7 @@ `):``,this.name=`UnsubscriptionError`,this.errors=t}});function sr(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var cr=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=Qn(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(ir(c))try{c()}catch(e){i=e instanceof or?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Qn(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{dr(f)}catch(e){i??=[],e instanceof or?i=er(er([],$n(i)),$n(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new or(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)dr(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&sr(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&sr(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),lr=cr.EMPTY;function ur(e){return e instanceof cr||e&&`closed`in e&&ir(e.remove)&&ir(e.add)&&ir(e.unsubscribe)}function dr(e){ir(e)?e():e.unsubscribe()}var fr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},pr={setTimeout:function(e,t){var n=[...arguments].slice(2),r=pr.delegate;return r?.setTimeout?r.setTimeout.apply(r,er([e,t],$n(n))):setTimeout.apply(void 0,er([e,t],$n(n)))},clearTimeout:function(e){return(pr.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function mr(e){pr.setTimeout(function(){var t=fr.onUnhandledError;if(t)t(e);else throw e})}function hr(){}var gr=(function(){return yr(`C`,void 0,void 0)})();function _r(e){return yr(`E`,void 0,e)}function vr(e){return yr(`N`,e,void 0)}function yr(e,t,n){return{kind:e,value:t,error:n}}var br=null;function xr(e){if(fr.useDeprecatedSynchronousErrorHandling){var t=!br;if(t&&(br={errorThrown:!1,error:null}),e(),t){var n=br,r=n.errorThrown,i=n.error;if(br=null,r)throw i}}else e()}function Sr(e){fr.useDeprecatedSynchronousErrorHandling&&br&&(br.errorThrown=!0,br.error=e)}var Cr=function(e){Yn(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,ur(t)&&t.add(n)):n.destination=jr,n}return t.create=function(e,t,n){return new Dr(e,t,n)},t.prototype.next=function(e){this.isStopped?Ar(vr(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Ar(_r(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Ar(gr,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(cr),wr=Function.prototype.bind;function Tr(e,t){return wr.call(e,t)}var Er=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Or(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Or(e)}else Or(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Or(e)}},e}(),Dr=function(e){Yn(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(ir(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&fr.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&Tr(t.next,o),error:t.error&&Tr(t.error,o),complete:t.complete&&Tr(t.complete,o)}):a=t}return i.destination=new Er(a),i}return t}(Cr);function Or(e){fr.useDeprecatedSynchronousErrorHandling?Sr(e):mr(e)}function kr(e){throw e}function Ar(e,t){var n=fr.onStoppedNotification;n&&pr.setTimeout(function(){return n(e,t)})}var jr={closed:!0,next:hr,error:kr,complete:hr},Mr=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function Nr(e){return e}function Pr(e){return e.length===0?Nr:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var Fr=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Rr(e)?e:new Dr(e,t,n);return xr(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=Ir(t),new t(function(t,r){var i=new Dr({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[Mr]=function(){return this},e.prototype.pipe=function(){return Pr([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=Ir(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Ir(e){return e??fr.Promise??Promise}function Lr(e){return e&&ir(e.next)&&ir(e.error)&&ir(e.complete)}function Rr(e){return e&&e instanceof Cr||Lr(e)&&ur(e)}function zr(e){return ir(e?.lift)}function Br(e){return function(t){if(zr(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function Vr(e,t,n,r,i){return new Hr(e,t,n,r,i)}var Hr=function(e){Yn(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(Cr),Ur=ar(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),Wr=function(e){Yn(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Gr(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ur},t.prototype.next=function(e){var t=this;xr(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=Qn(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;xr(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;xr(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?lr:(this.currentObservers=null,a.push(e),new cr(function(){t.currentObservers=null,sr(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new Fr;return e.source=this,e},t.create=function(e,t){return new Gr(e,t)},t}(Fr),Gr=function(e){Yn(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??lr},t}(Wr),Kr=function(e){Yn(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Wr);function qr(e){return e[e.length-1]}function Jr(e){return ir(qr(e))?e.pop():void 0}var Yr=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function Xr(e){return ir(e?.then)}function Zr(e){return ir(e[Mr])}function Qr(e){return Symbol.asyncIterator&&ir(e?.[Symbol.asyncIterator])}function $r(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function ei(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var ti=ei();function ni(e){return ir(e?.[ti])}function ri(e){return nr(this,arguments,function(){var t,n,r,i;return Zn(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,tr(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,tr(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,tr(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function ii(e){return ir(e?.getReader)}function ai(e){if(e instanceof Fr)return e;if(e!=null){if(Zr(e))return gee(e);if(Yr(e))return _ee(e);if(Xr(e))return vee(e);if(Qr(e))return oi(e);if(ni(e))return yee(e);if(ii(e))return bee(e)}throw $r(e)}function gee(e){return new Fr(function(t){var n=e[Mr]();if(ir(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function _ee(e){return new Fr(function(t){for(var n=0;n=0?n.slice(0,r):n}function _i(e,t){return e?t?`${e} ${t}`:e:t||``}var Hee=hi({__forward_ref__:hi});function vi(e){return e.__forward_ref__=vi,e}function yi(e){return bi(e)?e():e}function bi(e){return typeof e==`function`&&Object.hasOwn(e,Hee)&&e.__forward_ref__===vi}function xi(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Si(e){return Ci(e,Ei)}function Ci(e,t){return Object.hasOwn(e,t)&&e[t]||null}function wi(e){return(e?.[Ei]??null)||null}function Ti(e){return e&&Object.hasOwn(e,Di)?e[Di]:null}var Ei=hi({ɵprov:hi}),Di=hi({ɵinj:hi}),Oi=class{_desc;ngMetadataName=`InjectionToken`;ɵprov;constructor(e,t){this._desc=e,this.ɵprov=void 0,typeof t==`number`?this.__NG_ELEMENT_ID__=t:t!==void 0&&(this.ɵprov=xi({token:this,providedIn:t.providedIn||`root`,factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function ki(e){return e&&!!e.ɵproviders}var Ai=hi({ɵcmp:hi}),ji=hi({ɵdir:hi}),Mi=hi({ɵpipe:hi}),Ni=hi({ɵfac:hi}),Pi=hi({__NG_ELEMENT_ID__:hi}),Fi=hi({__NG_ENV_ID__:hi});function Ii(e){return zi(e,`@Component`),e[Ai]||null}function Li(e){return zi(e,`@Directive`),e[ji]||null}function Ri(e){return zi(e,`@Pipe`),e[Mi]||null}function zi(e,t){if(e==null)throw new pi(-919,!1)}function Bi(e){return typeof e==`string`?e:e==null?``:String(e)}var Vi=hi({ngErrorCode:hi}),Hi=hi({ngErrorMessage:hi}),Ui=hi({ngTokenPath:hi});function Wi(e,t){return Ki(``,-200,t)}function Gi(e,t){throw new pi(-201,!1)}function Ki(e,t,n){let r=new pi(t,e);return r[Vi]=t,r[Hi]=e,n&&(r[Ui]=n),r}function qi(e){return e[Vi]}var Ji;function Yi(){return Ji}function Xi(e){let t=Ji;return Ji=e,t}function Zi(e,t,n){let r=Si(e);if(r&&r.providedIn==`root`)return r.value===void 0?r.value=r.factory():r.value;if(n&8)return null;if(t!==void 0)return t;Gi(e,``)}var Qi=globalThis,$i={},ea=`__NG_DI_FLAG__`,ta=class{injector;constructor(e){this.injector=e}retrieve(e,t){let n=ia(t)||0;try{return this.injector.get(e,n&8?null:$i,n)}catch(e){if(Hn(e))return e;throw e}}};function na(e,t=0){let n=zn();if(n===void 0)throw new pi(-203,!1);if(n===null)return Zi(e,void 0,t);{let r=aa(t),i=n.retrieve(e,r);if(Hn(i)){if(r.optional)return null;throw i}return i}}function ra(e,t=0){return(Yi()||na)(yi(e),t)}function x(e,t){return ra(e,ia(t))}function ia(e){return e===void 0||typeof e==`number`?e:0|(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function aa(e){return{optional:!!(e&8),host:!!(e&1),self:!!(e&2),skipSelf:!!(e&4)}}function oa(e){let t=[];for(let n=0;nArray.isArray(e)?da(e,t):t(e))}function fa(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function pa(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function ma(e,t){let n=[];for(let r=0;rt;){let t=i-2;e[i]=e[t],i--}e[t]=n,e[t+1]=r}}function ga(e,t,n){let r=va(e,t);return r>=0?e[r|1]=n:(r=~r,ha(e,r,t,n)),r}function _a(e,t){let n=va(e,t);if(n>=0)return e[n|1]}function va(e,t){return ya(e,t,1)}function ya(e,t,n){let r=0,i=e.length>>n;for(;i!==r;){let a=r+(i-r>>1),o=e[a<t?i=a:r=a+1}return~(i<{n.push(e)};return da(t,e=>{let t=e;ka(t,a,[],r)&&(i||=[],i.push(t))}),i!==void 0&&Oa(i,a),n}function Oa(e,t){for(let n=0;n{t(e,r)})}}function ka(e,t,n,r){if(e=yi(e),!e)return!1;let i=null,a=Ti(e),o=!a&&Ii(e);if(!a&&!o){let t=e.ngModule;if(a=Ti(t),a)i=t;else return!1}else if(o&&!o.standalone)return!1;else i=e;let s=r.has(i);if(o){if(s)return!1;if(r.add(i),o.dependencies){let e=typeof o.dependencies==`function`?o.dependencies():o.dependencies;for(let i of e)ka(i,t,n,r)}}else if(a){if(a.imports!=null&&!s){r.add(i);let e;try{da(a.imports,i=>{ka(i,t,n,r)&&(e||=[],e.push(i))})}finally{}e!==void 0&&Oa(e,t)}if(!s){let e=ca(i)||(()=>new i);t({provide:i,useFactory:e,deps:xa},i),t({provide:wa,useValue:i,multi:!0},i),t({provide:Sa,useValue:()=>ra(i),multi:!0},i)}let o=a.providers;if(o!=null&&!s){let n=e;Aa(o,e=>{t(e,n)})}}else return!1;return i!==e&&e.providers!==void 0}function Aa(e,t){for(let n of e)ki(n)&&(n=n.ɵproviders),Array.isArray(n)?Aa(n,t):t(n)}var ja=hi({provide:String,useValue:hi});function Ma(e){return typeof e==`object`&&!!e&&ja in e}function Na(e){return!!(e&&e.useExisting)}function Pa(e){return!!(e&&e.useFactory)}function Fa(e){return typeof e==`function`}function Ia(e){return!!e.useClass}var La=new Oi(``),Ra={},za={},Ba=void 0;function Va(){return Ba===void 0&&(Ba=new Ta),Ba}var Ha=class{},Ua=class extends Ha{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,t,n,r){super(),this.parent=t,this.source=n,this.scopes=r,$a(e,e=>this.processProvider(e)),this.records.set(Ca,Ya(void 0,this)),r.has(`environment`)&&this.records.set(Ha,Ya(void 0,this));let i=this.records.get(La);i!=null&&typeof i.value==`string`&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(wa,xa,{self:!0}))}retrieve(e,t){let n=ia(t)||0;try{return this.get(e,$i,n)}catch(e){if(Hn(e))return e;throw e}}destroy(){Ja(this),this._destroyed=!0;let e=an(null);try{for(let e of this._ngOnDestroyHooks)e.ngOnDestroy();let e=this._onDestroyHooks;this._onDestroyHooks=[];for(let t of e)t()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),an(e)}}onDestroy(e){return Ja(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Ja(this);let t=Bn(this),n=Xi(void 0);try{return e()}finally{Bn(t),Xi(n)}}get(e,t=$i,n){if(Ja(this),Object.hasOwn(e,Fi))return e[Fi](this);let r=ia(n),i=Bn(this),a=Xi(void 0);try{if(!(r&4)){let t=this.records.get(e);if(t===void 0){let n=Qa(e)&&Si(e);t=n&&this.injectableDefInScope(n)?Ya(Wa(e),Ra):null,this.records.set(e,t)}if(t!=null)return this.hydrate(e,t,r)}let n=r&2?Va():this.parent;return t=r&8&&t===$i?null:t,n.get(e,t)}catch(e){let t=qi(e);throw t===-200||t===-201?new pi(t,null):e}finally{Xi(a),Bn(i)}}resolveInjectorInitializers(){let e=an(null),t=Bn(this),n=Xi(void 0);try{let e=this.get(Sa,xa,{self:!0});for(let t of e)t()}finally{Bn(t),Xi(n),an(e)}}toString(){return`R3Injector[...]`}processProvider(e){e=yi(e);let t=Fa(e)?e:yi(e&&e.provide),n=Ka(e);if(!Fa(e)&&e.multi===!0){let n=this.records.get(t);n||(n=Ya(void 0,Ra,!0),n.factory=()=>oa(n.multi),this.records.set(t,n)),t=e,n.multi.push(e)}this.records.set(t,n)}hydrate(e,t,n){let r=an(null);try{if(t.value===za)throw Wi(``);return t.value===Ra&&(t.value=za,t.value=t.factory(void 0,n)),typeof t.value==`object`&&t.value&&Za(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{an(r)}}injectableDefInScope(e){if(!e.providedIn)return!1;let t=yi(e.providedIn);return typeof t==`string`?t===`any`||this.scopes.has(t):this.injectorDefTypes.has(t)}removeOnDestroy(e){let t=this._onDestroyHooks.indexOf(e);t!==-1&&this._onDestroyHooks.splice(t,1)}};function Wa(e){let t=Si(e),n=t===null?ca(e):t.factory;if(n!==null)return n;if(e instanceof Oi)throw new pi(-204,!1);if(e instanceof Function)return Ga(e);throw new pi(-204,!1)}function Ga(e){if(e.length>0)throw new pi(-204,!1);let t=wi(e);return t===null?()=>new e:()=>t.factory(e)}function Ka(e){return Ma(e)?Ya(void 0,e.useValue):Ya(qa(e),Ra)}function qa(e,t,n){let r;if(Fa(e)){let t=yi(e);return ca(t)||Wa(t)}if(Ma(e))r=()=>yi(e.useValue);else if(Pa(e))r=()=>e.useFactory(...oa(e.deps||[]));else if(Na(e))r=(t,n)=>ra(yi(e.useExisting),n!==void 0&&n&8?8:void 0);else{let t=yi(e&&(e.useClass||e.provide));if(Xa(e))r=()=>new t(...oa(e.deps));else return ca(t)||Wa(t)}return r}function Ja(e){if(e.destroyed)throw new pi(-205,!1)}function Ya(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function Xa(e){return!!e.deps}function Za(e){return typeof e==`object`&&!!e&&typeof e.ngOnDestroy==`function`}function Qa(e){return typeof e==`function`||typeof e==`object`&&e.ngMetadataName===`InjectionToken`}function $a(e,t){for(let n of e)Array.isArray(n)?$a(n,t):n&&ki(n)?$a(n.ɵproviders,t):t(n)}function eo(e,t){let n;e instanceof Ua?(Ja(e),n=e):n=new ta(e);let r=Bn(n),i=Xi(void 0);try{return t()}finally{Bn(r),Xi(i)}}function to(){return Yi()!==void 0||zn()!=null}var no=1;function ro(e){return Array.isArray(e)&&typeof e[no]==`object`}function io(e){return Array.isArray(e)&&e[no]===!0}function ao(e){return!!(e.flags&4)}function oo(e){return e.componentOffset>-1}function so(e){return(e.flags&1)==1}function co(e){return!!e.template}function lo(e){return!!(e[2]&512)}function uo(e){return(e[2]&256)==256}var fo=(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[e.ATTRIBUTE_NO_BINDING=6]=`ATTRIBUTE_NO_BINDING`,e})(fo||{}),po=`math`;function mo(e){for(;Array.isArray(e);)e=e[0];return e}function ho(e,t){return mo(t[e])}function go(e,t){return mo(t[e.index])}function _o(e,t){return e.data[t]}function vo(e,t){return e[t]}function yo(e,t,n,r){n>=e.data.length&&(e.data[n]=null,e.blueprint[n]=null),t[n]=r}function bo(e,t){let n=t[e];return ro(n)?n:n[0]}function xo(e){return(e[2]&128)==128}function So(e){return io(e[3])}function Co(e,t){return t==null?null:e[t]}function wo(e){e[17]=0}function To(e){e[2]&1024||(e[2]|=1024,xo(e)&&Oo(e))}function Uee(e,t){for(;e>0;)t=t[14],e--;return t}function Eo(e){return!!(e[2]&9216||e[24]?.dirty)}function Do(e){e[10].changeDetectionScheduler?.notify(8),e[2]&64&&(e[2]|=1024),Eo(e)&&Oo(e)}function Oo(e){e[10].changeDetectionScheduler?.notify(0);let t=Ao(e);for(;t!==null&&!(t[2]&8192||(t[2]|=8192,!xo(t)));)t=Ao(t)}function ko(e,t){if(uo(e))throw new pi(911,!1);e[21]===null&&(e[21]=[]),e[21].push(t)}function Wee(e,t){if(e[21]===null)return;let n=e[21].indexOf(t);n!==-1&&e[21].splice(n,1)}function Ao(e){let t=e[3];return io(t)?t[3]:t}function jo(e){return e[7]??=[]}function Mo(e){return e.cleanup??=[]}function Gee(e,t,n,r){let i=jo(t);i.push(n),e.firstCreatePass&&Mo(e).push(r,i.length-1)}var No={lFrame:as(null),bindingsEnabled:!0,skipHydrationRootTNode:null},Po=!1;function Kee(){return No.lFrame.elementDepthCount}function qee(){No.lFrame.elementDepthCount++}function Fo(){No.lFrame.elementDepthCount--}function Io(){return No.bindingsEnabled}function Lo(){return No.skipHydrationRootTNode!==null}function Ro(e){return No.skipHydrationRootTNode===e}function zo(){No.skipHydrationRootTNode=null}function Bo(){return No.lFrame.lView}function Vo(){return No.lFrame.tView}function S(e){return No.lFrame.contextLView=e,e[8]}function C(e){return No.lFrame.contextLView=null,e}function Ho(){let e=Uo();for(;e!==null&&e.type===64;)e=e.parent;return e}function Uo(){return No.lFrame.currentTNode}function Jee(){let e=No.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}function Wo(e,t){let n=No.lFrame;n.currentTNode=e,n.isParent=t}function Go(){return No.lFrame.isParent}function Ko(){No.lFrame.isParent=!1}function qo(){return No.lFrame.contextLView}function Jo(){return Po}function Yo(e){let t=Po;return Po=e,t}function Xo(){let e=No.lFrame,t=e.bindingRootIndex;return t===-1&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function Zo(){return No.lFrame.bindingIndex}function Yee(e){return No.lFrame.bindingIndex=e}function Qo(){return No.lFrame.bindingIndex++}function $o(e){let t=No.lFrame,n=t.bindingIndex;return t.bindingIndex+=e,n}function Xee(){return No.lFrame.inI18n}function Zee(e,t){let n=No.lFrame;n.bindingIndex=n.bindingRootIndex=e,es(t)}function Qee(){return No.lFrame.currentDirectiveIndex}function es(e){No.lFrame.currentDirectiveIndex=e}function $ee(e){let t=No.lFrame.currentDirectiveIndex;return t===-1?null:e[t]}function ete(){return No.lFrame.currentQueryIndex}function ts(e){No.lFrame.currentQueryIndex=e}function tte(e){let t=e[1];return t.type===2?t.declTNode:t.type===1?e[5]:null}function ns(e,t,n){if(n&4){let r=t,i=e;for(;r=r.parent,r===null&&!(n&1)&&(r=tte(i),!(r===null||(i=i[14],r.type&10))););if(r===null)return!1;t=r,e=i}let r=No.lFrame=is();return r.currentTNode=t,r.lView=e,!0}function rs(e){let t=is(),n=e[1];No.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function is(){let e=No.lFrame,t=e===null?null:e.child;return t===null?as(e):t}function as(e){let 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 e!==null&&(e.child=t),t}function os(){let e=No.lFrame;return No.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}var ss=os;function cs(){let e=os();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 nte(e){return(No.lFrame.contextLView=Uee(e,No.lFrame.contextLView))[8]}function ls(){return No.lFrame.selectedIndex}function us(e){No.lFrame.selectedIndex=e}function ds(){let e=No.lFrame;return _o(e.tView,e.selectedIndex)}function w(){No.lFrame.currentNamespace=`svg`}function fs(){ps()}function ps(){No.lFrame.currentNamespace=null}function ms(){return No.lFrame.currentNamespace}var hs=!0;function gs(){return hs}function _s(e){hs=e}function vs(e,t=null,n=null,r){let i=ys(e,t,n,r);return i.resolveInjectorInitializers(),i}function ys(e,t=null,n=null,r,i=new Set){return new Ua([n||xa,Ea(e)],t||Va(),null,i)}var bs=class e{static THROW_IF_NOT_FOUND=$i;static NULL=new Ta;static create(e,t){if(Array.isArray(e))return vs({name:``},t,e,``);{let t=e.name??``;return vs({name:t},e.parent,e.providers,t)}}static ɵprov=xi({token:e,providedIn:`any`,factory:()=>ra(Ca)});static __NG_ELEMENT_ID__=-1},xs=new Oi(``),Ss=class{static __NG_ELEMENT_ID__=ws;static __NG_ENV_ID__=e=>e},Cs=class extends Ss{_lView;constructor(e){super(),this._lView=e}get destroyed(){return uo(this._lView)}onDestroy(e){let t=this._lView;return ko(t,e),()=>Wee(t,e)}};function ws(){return new Cs(Bo())}var Ts=new Oi(``),Es=(()=>{class e{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new Kr(!1);debugTaskTracker=x(Ts,{optional:!0});get hasPendingTasks(){return!this.destroyed&&this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new Fr(e=>{e.next(!1),e.complete()}):this.pendingTask}add(){!this.hasPendingTasks&&!this.destroyed&&this.pendingTask.next(!0);let e=this.taskId++;return this.pendingTasks.add(e),this.debugTaskTracker?.add(e),e}has(e){return this.pendingTasks.has(e)}remove(e){this.pendingTasks.delete(e),this.debugTaskTracker?.remove(e),this.pendingTasks.size===0&&this.hasPendingTasks&&this.pendingTask.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks&&this.pendingTask.next(!1),this.destroyed=!0,this.pendingTask.unsubscribe()}static ɵprov=xi({token:e,providedIn:`root`,factory:()=>new e})}return e})(),Ds=class extends Wr{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,to()&&(this.destroyRef=x(Ss,{optional:!0})??void 0,this.pendingTasks=x(Es,{optional:!0})??void 0)}emit(e){let t=an(null);try{super.next(e)}finally{an(t)}}subscribe(e,t,n){let r=e,i=t||(()=>null),a=n;if(e&&typeof e==`object`){let t=e;r=t.next?.bind(t),i=t.error?.bind(t),a=t.complete?.bind(t)}this.__isAsync&&(i=this.wrapInTimeout(i),r&&=this.wrapInTimeout(r),a&&=this.wrapInTimeout(a));let o=super.subscribe({next:r,error:i,complete:a});return e instanceof cr&&e.add(o),o}wrapInTimeout(e){return t=>{let n=this.pendingTasks?.add();setTimeout(()=>{try{e(t)}finally{n!==void 0&&this.pendingTasks?.remove(n)}})}}};function Os(...e){}function ks(e){let t,n;function r(){e=Os;try{n!==void 0&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(n),t!==void 0&&clearTimeout(t)}catch{}}return t=setTimeout(()=>{e(),r()}),typeof requestAnimationFrame==`function`&&(n=requestAnimationFrame(()=>{e(),r()})),()=>r()}function As(e){return queueMicrotask(()=>e()),()=>{e=Os}}var js=`isAngularZone`,Ms=`isAngularZone_ID`,Ns=0,Ps=class e{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Ds(!1);onMicrotaskEmpty=new Ds(!1);onStable=new Ds(!1);onError=new Ds(!1);constructor(e){let{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:r=!1,scheduleInRootZone:i=!1}=e;if(typeof Zone>`u`)throw new pi(908,!1);Zone.assertZonePatched();let a=this;a._nesting=0,a._outer=a._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(a._inner=a._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(a._inner=a._inner.fork(Zone.longStackTraceZoneSpec)),a.shouldCoalesceEventChangeDetection=!r&&n,a.shouldCoalesceRunChangeDetection=r,a.callbackScheduled=!1,a.scheduleInRootZone=i,Rs(a)}static isInAngularZone(){return typeof Zone<`u`&&Zone.current.get(js)===!0}static assertInAngularZone(){if(!e.isInAngularZone())throw new pi(909,!1)}static assertNotInAngularZone(){if(e.isInAngularZone())throw new pi(909,!1)}run(e,t,n){return this._inner.run(e,t,n)}runTask(e,t,n,r){let i=this._inner,a=i.scheduleEventTask(`NgZoneEvent: `+r,e,Fs,Os,Os);try{return i.runTask(a,t,n)}finally{i.cancelTask(a)}}runGuarded(e,t,n){return this._inner.runGuarded(e,t,n)}runOutsideAngular(e){return this._outer.run(e)}},Fs={};function Is(e){if(e._nesting==0&&!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 Ls(e){if(e.isCheckStableRunning||e.callbackScheduled)return;e.callbackScheduled=!0;function t(){ks(()=>{e.callbackScheduled=!1,zs(e),e.isCheckStableRunning=!0,Is(e),e.isCheckStableRunning=!1})}e.scheduleInRootZone?Zone.root.run(()=>{t()}):e._outer.run(()=>{t()}),zs(e)}function Rs(e){let t=()=>{Ls(e)},n=Ns++;e._inner=e._inner.fork({name:`angular`,properties:{[js]:!0,[Ms]:n,[Ms+n]:!0},onInvokeTask:(n,r,i,a,o,s)=>{if(Us(s))return n.invokeTask(i,a,o,s);try{return Bs(e),n.invokeTask(i,a,o,s)}finally{(e.shouldCoalesceEventChangeDetection&&a.type===`eventTask`||e.shouldCoalesceRunChangeDetection)&&t(),Vs(e)}},onInvoke:(n,r,i,a,o,s,c)=>{try{return Bs(e),n.invoke(i,a,o,s,c)}finally{e.shouldCoalesceRunChangeDetection&&!e.callbackScheduled&&!Ws(s)&&t(),Vs(e)}},onHasTask:(t,n,r,i)=>{t.hasTask(r,i),n===r&&(i.change==`microTask`?(e._hasPendingMicrotasks=i.microTask,zs(e),Is(e)):i.change==`macroTask`&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:(t,n,r,i)=>(t.handleError(r,i),e.runOutsideAngular(()=>e.onError.emit(i)),!1)})}function zs(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&e.callbackScheduled===!0)}function Bs(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function Vs(e){e._nesting--,Is(e)}var Hs=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Ds;onMicrotaskEmpty=new Ds;onStable=new Ds;onError=new Ds;run(e,t,n){return e.apply(t,n)}runGuarded(e,t,n){return e.apply(t,n)}runOutsideAngular(e){return e()}runTask(e,t,n,r){return e.apply(t,n)}};function Us(e){return Gs(e,`__ignore_ng_zone__`)}function Ws(e){return Gs(e,`__scheduler_tick__`)}function Gs(e,t){return!Array.isArray(e)||e.length!==1?!1:e[0]?.data?.[t]===!0}var Ks=class{_console=console;handleError(e){this._console.error(`ERROR`,e)}},qs=new Oi(``,{factory:()=>{let e=x(Ps),t=x(Ha),n;return r=>{e.runOutsideAngular(()=>{t.destroyed&&!n?setTimeout(()=>{throw r}):(n??=t.get(Ks),n.handleError(r))})}}}),Js={provide:Sa,useValue:()=>{x(Ks,{optional:!0})},multi:!0};function T(e,t){let[n,r,i]=mee(e,t?.equal),a=n;return a[rn],a.set=r,a.update=i,a.asReadonly=Ys.bind(a),a}function Ys(){let e=this[rn];if(e.readonlyFn===void 0){let t=()=>this();t[rn]=e,e.readonlyFn=t}return e.readonlyFn}var Xs=new Oi(``,{factory:()=>Zs}),Zs=`ng`,Qs=new Oi(``),$s=new Oi(``,{providedIn:`platform`,factory:()=>`unknown`}),ec=new Oi(``,{factory:()=>x(xs).body?.querySelector(`[ngCspNonce]`)?.getAttribute(`ngCspNonce`)||null}),tc=(()=>{class e{view;node;constructor(e,t){this.view=e,this.node=t}static __NG_ELEMENT_ID__=nc}return e})();function nc(){return new tc(Bo(),Ho())}var rc=class{},ic=new Oi(``,{factory:()=>!0}),ac=new Oi(``),oc=(()=>{class e{static ɵprov=xi({token:e,providedIn:`root`,factory:()=>new sc})}return e})(),sc=class{dirtyEffectCount=0;queues=new Map;add(e){this.enqueue(e),this.schedule(e)}schedule(e){e.dirty&&this.dirtyEffectCount++}remove(e){let t=e.zone,n=this.queues.get(t);n.has(e)&&(n.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);let n=this.queues.get(t);n.has(e)||n.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[t,n]of this.queues)e||=t===null?this.flushQueue(n):t.run(()=>this.flushQueue(n));e||(this.dirtyEffectCount=0)}}flushQueue(e){let t=!1;for(let n of e)n.dirty&&(this.dirtyEffectCount--,t=!0,n.run());return t}},cc=class{[rn];constructor(e){this[rn]=e}destroy(){this[rn].destroy()}};function E(e,t){let n=t?.injector??x(bs),r=t?.manualCleanup===!0?null:n.get(Ss),i,a=n.get(tc,null,{optional:!0}),o=n.get(rc);return a===null?i=pc(e,n.get(oc),o):(i=fc(a.view,o,e),r instanceof Cs&&r._lView===a.view&&(r=null)),i.injector=n,r!==null&&(i.onDestroyFns=[r.onDestroy(()=>i.destroy())]),new cc(i)}var lc={...In,cleanupFns:void 0,zone:null,onDestroyFns:null,run(){let e=Yo(!1);try{Ln(this)}finally{Yo(e)}},cleanup(){if(!this.cleanupFns?.length)return;let e=an(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],an(e)}}},uc={...lc,consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){if(bn(this),this.onDestroyFns!==null)for(let e of this.onDestroyFns)e();this.cleanup(),this.scheduler.remove(this)}},dc={...lc,consumerMarkedDirty(){this.view[2]|=8192,Oo(this.view),this.notifier.notify(13)},destroy(){if(bn(this),this.onDestroyFns!==null)for(let e of this.onDestroyFns)e();this.cleanup(),this.view[23]?.delete(this)}};function fc(e,t,n){let r=Object.create(dc);return r.view=e,r.zone=typeof Zone<`u`?Zone.current:null,r.notifier=t,r.fn=mc(r,n),e[23]??=new Set,e[23].add(r),r.consumerMarkedDirty(r),r}function pc(e,t,n){let r=Object.create(uc);return r.fn=mc(r,e),r.scheduler=t,r.notifier=n,r.zone=typeof Zone<`u`?Zone.current:null,r.scheduler.add(r),r.notifier.notify(12),r}function mc(e,t){return()=>{t(t=>(e.cleanupFns??=[]).push(t))}}function hc(e){return typeof e==`function`&&e[rn]!==void 0}function gc(e){return hc(e)&&typeof e.set==`function`}var _c=Symbol(`InputSignalNode#UNSET`),vc={...Pn,transformFn:void 0,applyValueToInputSignal(e,t){Mn(e,t)}};function yc(e){return{toString:e}.toString()}var bc=(function(e){return e[e.TemplateCreateStart=0]=`TemplateCreateStart`,e[e.TemplateCreateEnd=1]=`TemplateCreateEnd`,e[e.TemplateUpdateStart=2]=`TemplateUpdateStart`,e[e.TemplateUpdateEnd=3]=`TemplateUpdateEnd`,e[e.LifecycleHookStart=4]=`LifecycleHookStart`,e[e.LifecycleHookEnd=5]=`LifecycleHookEnd`,e[e.OutputStart=6]=`OutputStart`,e[e.OutputEnd=7]=`OutputEnd`,e[e.BootstrapApplicationStart=8]=`BootstrapApplicationStart`,e[e.BootstrapApplicationEnd=9]=`BootstrapApplicationEnd`,e[e.BootstrapComponentStart=10]=`BootstrapComponentStart`,e[e.BootstrapComponentEnd=11]=`BootstrapComponentEnd`,e[e.ChangeDetectionStart=12]=`ChangeDetectionStart`,e[e.ChangeDetectionEnd=13]=`ChangeDetectionEnd`,e[e.ChangeDetectionSyncStart=14]=`ChangeDetectionSyncStart`,e[e.ChangeDetectionSyncEnd=15]=`ChangeDetectionSyncEnd`,e[e.AfterRenderHooksStart=16]=`AfterRenderHooksStart`,e[e.AfterRenderHooksEnd=17]=`AfterRenderHooksEnd`,e[e.ComponentStart=18]=`ComponentStart`,e[e.ComponentEnd=19]=`ComponentEnd`,e[e.DeferBlockStateStart=20]=`DeferBlockStateStart`,e[e.DeferBlockStateEnd=21]=`DeferBlockStateEnd`,e[e.DynamicComponentStart=22]=`DynamicComponentStart`,e[e.DynamicComponentEnd=23]=`DynamicComponentEnd`,e[e.HostBindingsUpdateStart=24]=`HostBindingsUpdateStart`,e[e.HostBindingsUpdateEnd=25]=`HostBindingsUpdateEnd`,e})(bc||{}),xc=class{previousValue;currentValue;firstChange;constructor(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}isFirstChange(){return this.firstChange}};function Sc(e,t,n,r){t===null?e[n]=r:t.applyValueToInputSignal(t,r)}var Cc=null,wc=(()=>{Cc=Ec;let e=()=>Ec;return e.ngInherit=!0,e})();function Tc(){return Cc}function Ec(e){return e.type.prototype.ngOnChanges&&(e.setInput=Oc),Dc}function Dc(){let e=Ac(this),t=e?.current;if(t){let n=e.previous;if(n===ba)e.previous=t;else for(let e in t)n[e]=t[e];e.current=null,this.ngOnChanges(t)}}function Oc(e,t,n,r,i){let a=this.declaredInputs[r],o=Ac(e)||jc(e,{previous:ba,current:null}),s=o.current||={},c=o.previous,l=c[a];s[a]=new xc(l&&l.currentValue,n,c===ba),Sc(e,t,i,n)}var kc=`__ngSimpleChanges__`;function Ac(e){return Object.hasOwn(e,kc)&&e[kc]||null}function jc(e,t){return e[kc]=t}var Mc=[],Nc=function(e,t=null,n){for(let r=0;r=r)break}else t[c]<0&&(e[17]+=65536),(s>14>16&&(e[2]&3)===t&&(e[2]+=16384,Bc(o,a)):Bc(o,a)}var Hc=-1,Uc=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,t,n,r){this.factory=e,this.name=r,this.canSeeViewProviders=t,this.injectImpl=n}};function Wc(e){return!!(e.flags&8)}function Gc(e){return!!(e.flags&16)}function Kc(e,t,n){let r=0;for(;rt){o=a-1;break}}}for(;a>16}function el(e,t){let n=$c(e),r=t;for(;n>0;)r=r[14],n--;return r}var tl=!0;function nl(e){let t=tl;return tl=e,t}var rl=255,il=5,al=0,ol={};function sl(e,t,n){let r;typeof n==`string`?r=n.charCodeAt(0)||0:Object.hasOwn(n,Pi)&&(r=n[Pi]),r??=n[Pi]=al++;let i=r&rl,a=1<>il)]|=a}function cl(e,t){let n=ul(e,t);if(n!==-1)return n;let r=t[1];r.firstCreatePass&&(e.injectorIndex=t.length,ll(r.data,e),ll(t,null),ll(r.blueprint,null));let i=dl(e,t),a=e.injectorIndex;if(Zc(i)){let e=Qc(i),n=el(i,t),r=n[1].data;for(let i=0;i<8;i++)t[a+i]=n[e+i]|r[e+i]}return t[a+8]=i,a}function ll(e,t){e.push(0,0,0,0,0,0,0,0,t)}function ul(e,t){return e.injectorIndex===-1||e.parent&&e.parent.injectorIndex===e.injectorIndex||t[e.injectorIndex+8]===null?-1:e.injectorIndex}function dl(e,t){if(e.parent&&e.parent.injectorIndex!==-1)return e.parent.injectorIndex;let n=0,r=null,i=t;for(;i!==null;){if(r=Ol(i),r===null)return Hc;if(n++,i=i[14],r.injectorIndex!==-1)return r.injectorIndex|n<<16}return Hc}function fl(e,t,n){sl(e,t,n)}function pl(e,t,n){if(n&8||e!==void 0)return e;Gi(t,`NodeInjector`)}function ml(e,t,n,r){if(n&8&&r===void 0&&(r=null),!(n&3)){let i=e[9],a=Xi(void 0);try{return i?i.get(t,r,n&8):Zi(t,r,n&8)}finally{Xi(a)}}return pl(r,t,n)}function hl(e,t,n,r=0,i){if(e!==null){if(t[2]&2048&&!(r&2)){let i=Dl(e,t,n,r,ol);if(i!==ol)return i}let i=gl(e,t,n,r,ol);if(i!==ol)return i}return ml(t,n,r,i)}function gl(e,t,n,r,i){let a=bl(n);if(typeof a==`function`){if(!ns(t,e,r))return r&1?pl(i,n,r):ml(t,n,r,i);try{let e;if(e=a(r),e==null&&!(r&8))Gi(n);else return e}finally{ss()}}else if(typeof a==`number`){let i=null,o=ul(e,t),s=Hc,c=r&1?t[15][5]:null;for((o===-1||r&4)&&(s=o===-1?dl(e,t):t[o+8],s===Hc||!Sl(r,!1)?o=-1:(i=t[1],o=Qc(s),t=el(s,t)));o!==-1;){let e=t[1];if(xl(a,o,e.data)){let e=_l(o,t,n,i,r,c);if(e!==ol)return e}s=t[o+8],s!==Hc&&Sl(r,t[1].data[o+8]===c)&&xl(a,o,t)?(i=e,o=Qc(s),t=el(s,t)):o=-1}}return i}function _l(e,t,n,r,i,a){let o=t[1],s=o.data[e+8],c=vl(s,o,n,r==null?oo(s)&&tl:r!=o&&!!(s.type&3),i&1&&a===s);return c===null?ol:yl(t,o,c,s,i)}function vl(e,t,n,r,i){let a=e.providerIndexes,o=t.data,s=a&1048575,c=e.directiveStart,l=e.directiveEnd,u=a>>20,d=r?s:s+u,f=i?s+u:l;for(let e=d;e=c&&t.type===n)return e}if(i){let e=o[c];if(e&&co(e)&&e.type===n)return c}return null}function yl(e,t,n,r,i){let a=e[n],o=t.data;if(a instanceof Uc){let s=a;if(s.resolving)throw Wi(``);let c=nl(s.canSeeViewProviders);s.resolving=!0,o[n].type||o[n];let l=s.injectImpl?Xi(s.injectImpl):null;ns(e,r,0);try{a=e[n]=s.factory(void 0,i,o,e,r),t.firstCreatePass&&n>=r.directiveStart&&Pc(n,o[n],t)}finally{l!==null&&Xi(l),nl(c),s.resolving=!1,ss()}}return a}function bl(e){if(typeof e==`string`)return e.charCodeAt(0)||0;let t=Object.hasOwn(e,Pi)?e[Pi]:void 0;return typeof t==`number`?t>=0?t&rl:wl:t}function xl(e,t,n){let r=1<>il)]&r)}function Sl(e,t){return!(e&2)&&!(e&1&&t)}var Cl=class{_tNode;_lView;constructor(e,t){this._tNode=e,this._lView=t}get(e,t,n){return hl(this._tNode,this._lView,e,ia(n),t)}};function wl(){return new Cl(Ho(),Bo())}function Tl(e){return yc(()=>{let t=e.prototype.constructor,n=t[Ni]||El(t),r=Object.prototype,i=Object.getPrototypeOf(e.prototype).constructor;for(;i&&i!==r;){let e=i[Ni]||El(i);if(e&&e!==n)return e;i=Object.getPrototypeOf(i)}return e=>new e})}function El(e){return bi(e)?()=>{let t=El(yi(e));return t&&t()}:ca(e)}function Dl(e,t,n,r,i){let a=e,o=t;for(;a!==null&&o!==null&&o[2]&2048&&!lo(o);){let e=gl(a,o,n,r|2,ol);if(e!==ol)return e;r&=-5;let t=a.parent;if(!t){let e=o[20];if(e){let t=e.get(n,ol,r);if(t!==ol)return t}t=Ol(o),o=o[14]}a=t}return i}function Ol(e){let t=e[1],n=t.type;return n===2?t.declTNode:n===1?e[5]:null}function kl(e){return{token:e.token,providedIn:e.autoProvided===!1?null:`root`,factory:e.factory,value:void 0}}function Al(){return jl(Ho(),Bo())}function jl(e,t){return new Ml(go(e,t))}var Ml=(()=>{class e{nativeElement;constructor(e){this.nativeElement=e}static __NG_ELEMENT_ID__=Al}return e})();function Nl(e){return e instanceof Ml?e.nativeElement:e}function Pl(){return this._results[Symbol.iterator]()}var Fl=class{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new Wr}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){this.dirty=!1;let n=ua(e);(this._changesDetected=!la(this._results,n,t))&&(this._results=n,this.length=n.length,this.last=n[this.length-1],this.first=n[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(e){this._onDirty=e}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=Pl};function Il(e){return(e.flags&128)==128}var Ll=(function(e){return e[e.OnPush=0]=`OnPush`,e[e.Eager=1]=`Eager`,e[e.Default=1]=`Default`,e})(Ll||{}),Rl=new Map,zl=0;function Bl(){return zl++}function Vl(e){Rl.set(e[19],e)}function Hl(e){Rl.delete(e[19])}var Ul=`__ngContext__`;function Wl(e,t){ro(t)?(e[Ul]=t[19],Vl(t)):e[Ul]=t}function Gl(e){return ql(e[12])}function Kl(e){return ql(e[4])}function ql(e){for(;e!==null&&!io(e);)e=e[4];return e}var Jl=void 0;function Yl(e){Jl=e}function Xl(){if(Jl!==void 0)return Jl;if(typeof document<`u`)return document;throw new pi(210,!1)}var Zl=!1,Ql=new Oi(``,{factory:()=>Zl}),$l=new WeakMap;function eu(e,t){if(typeof e!=`object`||!e)return;let n=$l.get(e);n||(n=new WeakSet,$l.set(e,n)),n.add(t)}function tu(e){return(e.flags&32)==32}var nu=()=>null;function ru(e,t,n=!1){return nu(e,t,n)}function iu(e,t){let n=e.contentQueries;if(n!==null){let r=an(null);try{for(let r=0;r|^->||--!>|)/g,gu=`​$1​`;function _u(e){return e.replace(mu,e=>e.replace(hu,gu))}function vu(e,t){return e.createText(t)}function yu(e,t,n){e.setValue(t,n)}function bu(e,t){return e.createComment(_u(t))}function xu(e,t,n){return e.createElement(t,n)}function Su(e,t,n,r,i){e.insertBefore(t,n,r,i)}function Cu(e,t,n){e.appendChild(t,n)}function wu(e,t,n,r,i){r===null?Cu(e,t,n):Su(e,t,n,r,i)}function Tu(e,t,n,r){e.removeChild(null,t,n,r)}function rte(e,t,n){e.setAttribute(t,`style`,n)}function ite(e,t,n){n===``?e.removeAttribute(t,`class`):e.setAttribute(t,`class`,n)}function Eu(e,t,n){let{mergedAttrs:r,classes:i,styles:a}=n;r!==null&&Kc(e,t,r),i!==null&&ite(e,t,i),a!==null&&rte(e,t,a)}function Du(e){let t=ate();return t?t.sanitize(fo.URL,e)||``:uu(e,`URL`)?lu(e):pu(Bi(e))}function ate(){let e=Bo();return e&&e[10].sanitizer}function Ou(e){return e.ownerDocument.defaultView}function ku(e){return e.ownerDocument}function ote(e,t,n){let r=e.length;for(;;){let i=e.indexOf(t,n);if(i===-1)return i;if(i===0||e.charCodeAt(i-1)<=32){let n=t.length;if(i+n===r||e.charCodeAt(i+n)<=32)return i}n=i+1}}var Au=`ng-template`;function ste(e,t,n,r){let i=0;if(r){for(;i-1){let e;for(;++ia?``:i[u+1].toLowerCase(),r&2&&l!==e){if(Mu(r))return!1;o=!0}}}}}return Mu(r)||o}function Mu(e){return!(e&1)}function ute(e,t,n,r){if(t===null)return-1;let i=0;if(r||!n){let n=!1;for(;i-1)for(n++;n0?`="`+t+`"`:``)+`]`}else r&8?i+=`.`+o:r&4&&(i+=` `+o)}else i!==``&&!Mu(o)&&(t+=Pu(a,i),i=``),r=o,a||=!Mu(r);n++}return i!==``&&(t+=Pu(a,i)),t}function gte(e){return e.map(hte).join(`,`)}function _te(e){let t=[],n=[],r=1,i=2;for(;r!1});function Ru(e){if(!e)return 0;let t=e.toLowerCase().indexOf(`ms`)>-1?1:1e3;return parseFloat(e)*t}function zu(e,t){return e.getPropertyValue(t).split(`,`).map(e=>e.trim())}function bte(e){let t=zu(e,`transition-property`),n=zu(e,`transition-duration`),r=zu(e,`transition-delay`),i={propertyName:``,duration:0,animationName:void 0};for(let e=0;ei.duration&&(i.propertyName=t[e],i.duration=a)}return i}function xte(e){let t=zu(e,`animation-name`),n=zu(e,`animation-delay`),r=zu(e,`animation-duration`),i=zu(e,`animation-iteration-count`),a={animationName:``,propertyName:void 0,duration:0};for(let e=0;ea.duration&&s!==`infinite`&&(a.animationName=t[e],a.duration=o)}return a}function Bu(e,t){return e!==void 0&&e.duration>t.duration}function Vu(e){return(e.animationName!=null||e.propertyName!=null)&&e.duration>0}function Hu(e){let t=e.effect?.getTiming();if(t===void 0)return;let n=typeof t.duration==`number`?t.duration:0,r=(t.delay??0)+n,i=e.playbackRate;return i!==void 0&&i!==0&&i!==1&&(r/=Math.abs(i)),r}function Ste(e,t){let n=getComputedStyle(e),r=xte(n),i=bte(n),a=r.duration>i.duration?r:i;Bu(t.get(e),a)||Vu(a)&&t.set(e,a)}function Cte(e,t,n){if(!n)return;let r=e.getAnimations();return r.length===0?Ste(e,t):wte(e,t,r)}function wte(e,t,n){let r={animationName:void 0,propertyName:void 0,duration:0};for(let e of n){if(e.effect?.getTiming()?.iterations===1/0)continue;let t=Hu(e)??0,n,i;e.animationName?i=e.animationName:n=e.transitionProperty,t>=r.duration&&(r={animationName:i,propertyName:n,duration:t})}Bu(t.get(e),r)||Vu(r)&&t.set(e,r)}var Uu=new Set,Tte=!1,Ete=1,Wu=typeof document<`u`&&typeof document?.documentElement?.getAnimations==`function`;function Dte(e){return e[9].get(yte,Tte)}function Ote(e,t,n){let r=Ku.get(e);if(r){for(let e of t)r.classList.push(e);for(let e of n)r.cleanupFns.push(e)}else Ku.set(e,{classList:t,cleanupFns:n})}function Gu(e){let t=Ku.get(e);if(t){for(let e of t.cleanupFns)e();Ku.delete(e)}qu.delete(e)}var Ku=new WeakMap,qu=new WeakMap,Ju=new WeakMap;function Yu(e){return e?e[14]??e:null}var Xu=new WeakSet;function kte(e,t,n){let r=Ju.get(e);if(!r||r.length===0)return;let i=t.parentNode,a=t.previousSibling,o=Yu(n);for(let e=r.length-1;e>=0;e--){let{el:n,declarationView:s}=r[e],c=n.parentNode;n===t?(r.splice(e,1),Xu.add(n),n.dispatchEvent(new CustomEvent(`animationend`,{detail:{cancel:!0}}))):(a&&n===a||c&&i&&c!==i&&(o===null||s===null||o===s))&&(r.splice(e,1),n.dispatchEvent(new CustomEvent(`animationend`,{detail:{cancel:!0}})),n.parentNode?.removeChild(n))}}function Ate(e,t,n){let r=Yu(n),i=Ju.get(e);i?i.some(e=>e.el===t)||i.push({el:t,declarationView:r}):Ju.set(e,[{el:t,declarationView:r}])}function Zu(e){let t=e[26]??={};return t.enter??=new Map}function jte(e){let t=typeof e==`function`?e():e,n=Array.isArray(t)?t:null;return typeof t==`string`&&(n=t.trim().split(/\s+/).filter(e=>e)),n}function Qu(e){return e.composedPath?e.composedPath()[0]:e.target}function $u(e,t){let n=qu.get(t);if(n===void 0)return!0;if(t!==Qu(e))return!1;let r=e.animation;if(r){let e=Hu(r);if(e!==void 0&&e+Ete{class e{impl=null;execute(){this.impl?.execute()}static ɵprov=xi({token:e,providedIn:`root`,factory:()=>new e})}return e})(),ad=[0,1,2,3],od=(()=>{class e{ngZone=x(Ps);scheduler=x(rc);errorHandler=x(Ks,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){x(td,{optional:!0})}execute(){let e=this.sequences.size>0;e&&Nc(bc.AfterRenderHooksStart),this.executing=!0;for(let e of ad)for(let t of this.sequences)if(!t.erroredOrDestroyed&&t.hooks[e])try{t.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let n=t.hooks[e];return n(t.pipelinedValue)},t.snapshot))}catch(e){t.erroredOrDestroyed=!0,this.errorHandler?.handleError(e)}this.executing=!1;for(let e of this.sequences)e.afterRun(),e.once&&(this.sequences.delete(e),e.destroy());for(let e of this.deferredRegistrations)this.sequences.add(e);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),e&&Nc(bc.AfterRenderHooksEnd)}register(e){let{view:t}=e;t===void 0?this.executing?this.deferredRegistrations.add(e):this.addSequence(e):((t[25]??=[]).push(e),Oo(t),t[2]|=8192)}addSequence(e){this.sequences.add(e),this.scheduler.notify(7)}unregister(e){this.executing&&this.sequences.has(e)?(e.erroredOrDestroyed=!0,e.pipelinedValue=void 0,e.once=!0):(this.sequences.delete(e),this.deferredRegistrations.delete(e))}maybeTrace(e,t){return t?t.run(ed.AFTER_NEXT_RENDER,e):e()}static ɵprov=xi({token:e,providedIn:`root`,factory:()=>new e})}return e})(),sd=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,t,n,r,i,a=null){this.impl=e,this.hooks=t,this.view=n,this.once=r,this.snapshot=a,this.unregisterOnDestroy=i?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let e=this.view?.[25];e&&(this.view[25]=e.filter(e=>e!==this))}};function cd(e,t){let n=t?.injector??x(bs);return rd(`NgAfterNextRender`),Pte(e,n,t,!0)}function Nte(e){return e instanceof Function?[void 0,void 0,e,void 0]:[e.earlyRead,e.write,e.mixedReadWrite,e.read]}function Pte(e,t,n,r){let i=t.get(id);i.impl??=t.get(od);let a=t.get(td,null,{optional:!0}),o=n?.manualCleanup===!0?null:t.get(Ss),s=t.get(tc,null,{optional:!0}),c=new sd(i.impl,Nte(e),s?.view,r,o,a?.snapshot(null));return i.impl.register(c),c}var ld=new Oi(``,{factory:()=>{let e=x(Ha),t=new Set;return e.onDestroy(()=>t.clear()),{queue:t,isScheduled:!1,scheduler:null,injector:e}}});function ud(e,t,n){let r=e.get(ld);if(Array.isArray(t))for(let e of t)r.queue.add(e),n?.detachedLeaveAnimationFns?.push(e);else r.queue.add(t),n?.detachedLeaveAnimationFns?.push(t);r.scheduler&&r.scheduler(e)}function Fte(e,t){let n=e.get(ld);if(Array.isArray(t))for(let e of t)n.queue.delete(e);else n.queue.delete(t)}function Ite(e,t){let n=e.get(ld);if(t.detachedLeaveAnimationFns){for(let e of t.detachedLeaveAnimationFns)n.queue.delete(e);t.detachedLeaveAnimationFns=void 0}}function Lte(e){let t=e.get(ld);t.isScheduled||=(cd(()=>{t.isScheduled=!1;for(let e of t.queue)e();t.queue.clear()},{injector:t.injector}),!0)}function Rte(e){let t=e.get(ld);t.scheduler=Lte,t.scheduler(e)}function dd(e,t){for(let[n,r]of t)ud(e,r.animateFns)}function fd(e,t,n,r){let i=e?.[26]?.enter;t!==null&&i&&i.has(n.index)&&dd(r,i)}function pd(e,t,n,r){try{n.get(Ca)}catch{return r(!1)}let i=e?.[26];i?.enter?.has(t.index)&&Fte(n,i.enter.get(t.index).animateFns);let a=zte(e,t,i);if(a.size===0){let n=!1;if(e){let r=[];md(e,t,r),n=r.length>0}if(!n)return r(!1)}e&&Uu.add(e[19]),ud(n,()=>Bte(e,t,i||void 0,a,r),i||void 0)}function zte(e,t,n){let r=new Map,i=n?.leave;if(i&&i.has(t.index)&&r.set(t.index,i.get(t.index)),e&&i)for(let[n,a]of i){if(r.has(n))continue;let i=e[1].data[n].parent;for(;i;){if(i===t){r.set(n,a);break}i=i.parent}}return r}function Bte(e,t,n,r,i){let a=[];if(n&&n.leave)for(let[e]of r){if(!n.leave.has(e))continue;let t=n.leave.get(e);for(let e of t.animateFns){let{promise:t}=e();a.push(t)}n.detachedLeaveAnimationFns=void 0}if(e&&md(e,t,a),a.length>0){let t=n||e?.[26];if(t){let n=t.running;n&&a.push(n),t.running=Promise.allSettled(a),Hte(e,t.running,i)}else Promise.allSettled(a).then(()=>{e&&Uu.delete(e[19]),i(!0)})}else e&&Uu.delete(e[19]),i(!1)}function md(e,t,n){if(t.type&12){let r=e[t.index];if(io(r))for(let e=10;e{e[26]?.running===t&&(e[26].running=void 0,Uu.delete(e[19])),n(!0)})}function hd(e,t,n,r,i,a,o,s){if(i!=null){let c,l=!1;io(i)?c=i:ro(i)&&(l=!0,i=i[0]);let u=mo(i);e===0&&r!==null?(fd(s,r,a,n),o==null?Cu(t,r,u):Su(t,r,u,o||null,!0)):e===1&&r!==null?(fd(s,r,a,n),Su(t,r,u,o||null,!0),kte(a,u,s)):e===2?(s?.[26]?.leave?.has(a.index)&&Ate(a,u,s),Xu.delete(u),pd(s,a,n,e=>{if(Xu.has(u)){Xu.delete(u);return}Tu(t,u,l,e)})):e===3&&(Xu.delete(u),pd(s,a,n,()=>{t.destroyNode(u)})),c!=null&&kd(t,e,n,c,a,r,o)}}function Ute(e,t){gd(e,t),t[0]=null,t[5]=null}function Wte(e,t,n,r,i,a){r[0]=i,r[5]=t,Dd(e,r,n,1,i,a)}function gd(e,t){t[10].changeDetectionScheduler?.notify(9),Dd(e,t,t[11],2,null,null)}function Gte(e){let t=e[12];if(!t)return yd(e[1],e);for(;t;){let n=null;if(ro(t))n=t[12];else{let e=t[10];e&&(n=e)}if(!n){for(;t&&!t[4]&&t!==e;)ro(t)&&yd(t[1],t),t=t[3];t===null&&(t=e),ro(t)&&yd(t[1],t),n=t&&t[4]}t=n}}function _d(e,t){let n=e[9],r=n.indexOf(t);n.splice(r,1)}function vd(e,t){if(uo(t))return;let n=t[11];n.destroyNode&&Dd(e,t,n,3,null,null),Gte(t)}function yd(e,t){if(uo(t))return;let n=an(null);try{t[2]&=-129,t[2]|=256,t[24]&&bn(t[24]),qte(e,t),Kte(e,t),t[1].type===1&&t[11].destroy();let n=t[16];if(n!==null&&io(t[3])){n!==t[3]&&_d(n,t);let r=t[18];r!==null&&r.detachView(e)}Hl(t)}finally{an(n)}}function Kte(e,t){let n=e.cleanup,r=t[7];if(n!==null)for(let e=0;e=0?r[t]():r[-t].unsubscribe(),e+=2}else{let t=r[n[e+1]];n[e].call(t)}r!==null&&(t[7]=null);let i=t[21];if(i!==null){t[21]=null;for(let e=0;e27&&zd(e,t,27,!1),Nc(o?bc.TemplateUpdateStart:bc.TemplateCreateStart,i,n),n(r,i)}finally{us(a),Nc(o?bc.TemplateUpdateEnd:bc.TemplateCreateEnd,i,n)}}function Ud(e,t,n){Xd(e,t,n),(n.flags&64)==64&&Zd(e,t,n)}function Wd(e,t,n=go){let r=t.localNames;if(r!==null){let i=t.index+1;for(let a=0;a=s&&i<=c){let o=t.data[i],s=r[e+1];Vd(o,n[i],s,a),l=!0}else if(i>c)break}}return o!==null&&Object.hasOwn(r.inputs,i)&&(Vd(r,n[o],i,a),l=!0),l}function lf(e,t){let n=bo(t,e),r=n[1];uf(r,n);let i=n[0];i!==null&&n[6]===null&&(n[6]=ru(i,n[9])),Nc(bc.ComponentStart);try{df(r,n,n[8])}finally{Nc(bc.ComponentEnd,n[8])}}function uf(e,t){for(let n=t.length;n{Oo(e.lView)},consumerOnSignalRead(){this.lView[24]=this}};function Cf(e){let t=e[24]??Object.create(wf);return t.lView=e,t}var wf={...sn,consumerIsAlwaysLive:!0,kind:`template`,consumerMarkedDirty:e=>{let t=Ao(e.lView);for(;t&&!Tf(t[1]);)t=Ao(t);t&&To(t)},consumerOnSignalRead(){this.lView[24]=this}};function Tf(e){return e.type!==2}function Ef(e){if(e[23]===null)return;let t=!0;for(;t;){let n=!1;for(let t of e[23])if(t.dirty&&(n=!0,t.zone===null||Zone.current===t.zone?t.run():t.zone.run(()=>t.run()),e[23]===null))return;t=n&&!!(e[2]&8192)}}var Df=100;function Of(e,t=0){let n=e[10].rendererFactory;n.begin?.();try{kf(e,t)}finally{n.end?.()}}function kf(e,t){let n=Jo();try{Yo(!0),Ff(e,t);let n=0;for(;Eo(e);){if(n===Df)throw new pi(103,!1);n++,Ff(e,1)}}finally{Yo(n)}}function Af(e,t,n,r){if(uo(t))return;let i=t[2];rs(t);let a=!0,o=null,s=null;Tf(e)?(s=yf(t),o=hn(s)):on()===null?(a=!1,s=Cf(t),o=hn(s)):t[24]&&=(bn(t[24]),null);try{wo(t),Yee(e.bindingStartIndex),n!==null&&Hd(e,t,n,2,r);let a=(i&3)==3;if(a){let n=e.preOrderCheckHooks;n!==null&&Ic(t,n,null)}else{let n=e.preOrderHooks;n!==null&&Lc(t,n,0,null),Rc(t,0)}if(Mf(t),Ef(t),jf(t,0),e.contentQueries!==null&&iu(e,t),a){let n=e.contentCheckHooks;n!==null&&Ic(t,n)}else{let n=e.contentHooks;n!==null&&Lc(t,n,1),Rc(t,1)}Lf(e,t);let o=e.components;o!==null&&If(t,o,0);let s=e.viewQuery;if(s!==null&&au(2,s,r),a){let n=e.viewCheckHooks;n!==null&&Ic(t,n)}else{let n=e.viewHooks;n!==null&&Lc(t,n,2),Rc(t,2)}if(e.firstUpdatePass===!0&&(e.firstUpdatePass=!1),t[22]){for(let e of t[22])e();t[22]=null}_f(t),t[2]&=-73}catch(e){throw Oo(t),e}finally{s!==null&&(_n(s,o),a&&xf(s)),cs()}}function jf(e,t){for(let n=Gl(e);n!==null;n=Kl(n))for(let e=10;e0&&(e[n-1][4]=r[4]);let a=pa(e,10+t);Ute(r[1],r);let o=a[18];o!==null&&o.detachView(a[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function Wf(e,t,n,r){let i=10+r,a=n.length;r>0&&(n[i-1][4]=t),r-1&&(Uf(e,n),pa(t,n))}this._attachedToViewContainer=!1}vd(this._lView[1],this._lView)}onDestroy(e){ko(this._lView,e)}markForCheck(){Rf(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[2]&=-129}reattach(){Do(this._lView),this._lView[2]|=128}detectChanges(){this._lView[2]|=1024,Of(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new pi(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=lo(this._lView),t=this._lView[16];t!==null&&!e&&_d(t,this._lView),gd(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new pi(902,!1);this._appRef=e;let t=lo(this._lView),n=this._lView[16];n!==null&&!t&&Gf(n,this._lView),Do(this._lView)}},qf=(()=>{class e{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=Jf;constructor(e,t,n){this._declarationLView=e,this._declarationTContainer=t,this.elementRef=n}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(e,t){return this.createEmbeddedViewImpl(e,t)}createEmbeddedViewImpl(e,t,n){return new Kf(pf(this._declarationLView,this._declarationTContainer,e,{embeddedViewInjector:t,dehydratedView:n}))}}return e})();function Jf(){return Yf(Ho(),Bo())}function Yf(e,t){return e.type&4?new qf(t,e,jl(e,t)):null}function Xf(e,t,n,r,i){let a=e.data[t];if(a===null)a=Zf(e,t,n,r,i),Xee()&&(a.flags|=32);else if(a.type&64){a.type=n,a.value=r,a.attrs=i;let e=Jee();a.injectorIndex=e===null?-1:e.injectorIndex}return Wo(a,!0),a}function Zf(e,t,n,r,i){let a=Uo(),o=Go(),s=o?a:a&&a.parent,c=e.data[t]=$f(e,s,n,t,r,i);return Qf(e,c,a,o),c}function Qf(e,t,n,r){e.firstChild===null&&(e.firstChild=t),n!==null&&(r?n.child==null&&t.parent!==null&&(n.child=t):n.next===null&&(n.next=t,t.prev=n))}function $f(e,t,n,r,i,a){let o=t?t.injectorIndex:-1,s=0;return Lo()&&(s|=128),{type:n,index:r,insertBeforeIndex:null,injectorIndex:o,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,controlDirectiveIndex:-1,customControlIndex:-1,propertyBindings:null,flags:s,providerIndexes:0,value:i,namespace:ms(),attrs:a,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}function ep(e){let t=e[6]??[],n=e[3][11],r=[];for(let e of t)e.data.di===void 0?tp(e,n):r.push(e);e[6]=r}function tp(e,t){let n=0,r=e.firstChild;if(r){let i=e.data.r;for(;nnull,rp=()=>null;function ip(e,t){return np(e,t)}function ap(e,t,n){return rp(e,t,n)}var op=class{},sp=class{},cp=class{destroyNode=null;static __NG_ELEMENT_ID__=()=>lp()};function lp(){let e=Bo(),t=bo(Ho().index,e);return(ro(t)?t:e)[11]}var up=(()=>{class e{static ɵprov=xi({token:e,providedIn:`root`,factory:()=>null})}return e})();function dp(e){return e.debugInfo?.className||e.type.name||null}var fp={},pp=class{injector;parentInjector;constructor(e,t){this.injector=e,this.parentInjector=t}get(e,t,n){let r=this.injector.get(e,fp,n);return r!==fp||t===fp?r:this.parentInjector.get(e,t,n)}};function mp(e,t,n){return e[t]=n}function hp(e,t){return e[t]}function gp(e,t,n){if(n===Fu)return!1;let r=e[t];return!Object.is(r,n)&&(e[t]=n,!0)}function _p(e,t,n,r){let i=gp(e,t,n);return gp(e,t+1,r)||i}function vp(e,t,n,r,i){let a=_p(e,t,n,r);return gp(e,t+2,i)||a}function yp(e,t,n,r,i,a){let o=_p(e,t,n,r);return _p(e,t+2,i,a)||o}function bp(e,t,n){return function r(i){let a=r.__ngNativeEl__;a!==void 0&&eu(i,a),Rf(oo(e)?bo(e.index,t):t,5);let o=t[8],s=xp(t,o,n,i),c=r.__ngNextListenerFn__;for(;c;)s=xp(t,o,c,i)&&s,c=c.__ngNextListenerFn__;return s}}function xp(e,t,n,r){let i=an(null);try{return Nc(bc.OutputStart,t,n),n(r)!==!1}catch(t){return of(e,t),!1}finally{Nc(bc.OutputEnd,t,n),an(i)}}function Sp(e,t,n,r,i,a,o,s){let c=so(e),l=!1,u=null;if(!r&&c&&(u=wp(t,n,a,e.index)),u!==null){let e=u.__ngLastListenerFn__||u;e.__ngNextListenerFn__=o,u.__ngLastListenerFn__=o,l=!0}else{let o=go(e,n),c=r?r(o):o;r||(s.__ngNativeEl__=o);let l=i.listen(c,a,s);Cp(a)||Tp(r?t=>r(mo(t[e.index])):e.index,t,n,a,s,l,!1)}return l}function Cp(e){return e.startsWith(`animation`)||e.startsWith(`transition`)}function wp(e,t,n,r){let i=e.cleanup;if(i!=null)for(let e=0;er?n[r]:null}typeof a==`string`&&(e+=2)}return null}function Tp(e,t,n,r,i,a,o){let s=t.firstCreatePass?Mo(t):null,c=jo(n),l=c.length;c.push(i,a),s&&s.push(r,e,l,(l+1)*(o?-1:1))}function Ep(e,t,n,r,i){let a=null,o=null,s=null,c=!1,l=e.directiveToIndex.get(n.type);if(typeof l==`number`?a=l:[a,o,s]=l,o!==null&&s!==null&&e.hostDirectiveOutputs&&Object.hasOwn(e.hostDirectiveOutputs,r)){let n=e.hostDirectiveOutputs[r];for(let a=0;a=o&&l<=s)c=!0,Dp(e,t,l,n[a+1],r,i);else if(l>s)break}}return Object.hasOwn(n.outputs,r)&&(c=!0,Dp(e,t,a,r,r,i)),c}function Dp(e,t,n,r,i,a){let o=t[n],s=t[1],c=o[s.data[n].outputs[r]].subscribe(a);Tp(e.index,s,t,i,a,c,!0)}function Op(){kp()}function kp(){let e=Bo(),t=Vo(),n=Ho();if(t.firstCreatePass&&Fp(t,n),n.controlDirectiveIndex===-1)return;rd(`NgSignalForms`);let r=e[n.controlDirectiveIndex];t.data[n.controlDirectiveIndex].controlDef.create(r,new Mp(e,t,n))}function Ap(){jp()}function jp(){let e=Bo(),t=Vo(),n=ds();if(n.controlDirectiveIndex===-1)return;let r=t.data[n.controlDirectiveIndex].controlDef,i=e[n.controlDirectiveIndex];r.update(i,new Mp(e,t,n))}var Mp=class{lView;tView;tNode;hasPassThrough;constructor(e,t,n){this.lView=e,this.tView=t,this.tNode=n,this.hasPassThrough=!!(n.flags&4096)}get customControl(){return this.tNode.customControlIndex===-1?void 0:this.lView[this.tNode.customControlIndex]}get nativeElement(){return go(this.tNode,this.lView)}get descriptor(){return`<${this.tNode.value}>`}listenToCustomControlOutput(e,t){let n=this.tView.data[this.tNode.customControlIndex];Ep(this.tNode,this.lView,n,e,bp(this.tNode,this.lView,t))}listenToCustomControlModel(e){let t=this.tNode.flags&1024?`valueChange`:`checkedChange`,n=this.tView.data[this.tNode.customControlIndex];Ep(this.tNode,this.lView,n,t,bp(this.tNode,this.lView,e))}listenToDom(e,t){Sp(this.tNode,this.tView,this.lView,void 0,this.lView[11],e,t,bp(this.tNode,this.lView,t))}setInputOnDirectives(e,t,n){let r=this.tNode.inputs?.[e],i=this.tNode.hostDirectiveInputs?.[e];if(!r&&!i)return!1;let a=!1;if(r)for(let i of r){if(i===this.tNode.controlDirectiveIndex)continue;let r=this.lView[i],o=this.tView.data[i];(!n||n(Pp(r,o,e)))&&(Vd(o,r,e,t),a=!0)}if(i)for(let r=0;r0;){let e=n.shift();if(typeof e!=`function`){for(let n in e.inputs)t[e.inputs[n]]=!0;let r=Np(e.directive);r!==null&&n.push(...r);continue}for(let r of e()){if(typeof r==`function`)continue;if(r.inputs)for(let e=0;e1){t.flags|=4096;return}Ip(e,t)}function Ip(e,t){for(let n=t.directiveStart;n{let r=t.hostDirectiveInputs[e],i=t.hostDirectiveOutputs[e+`Change`];if(!r||!i)return!1;for(let e=0;e=i&&a<=o)return t.flags|=n,t.customControlIndex=r,!0}}return!1};if(e(`value`,1024)||e(`checked`,2048))return}}function Lp(e,t){return Rp(e,t)&&zp(e,t+`Change`)}function Rp(e,t){return t in e.inputs}function zp(e,t){return t in e.outputs}var Bp=Symbol(`BINDING`),Vp=new Oi(``);function Hp(e,t,n){let r=n?e.styles:null,i=n?e.classes:null,a=0;if(t!==null)for(let e=0;e0&&(n.directiveToIndex=new Map);for(let c=0;c0;){let n=e[--t];if(typeof n==`number`&&n<0)return n}return 0}function nm(e,t,n){if(n){if(t.exportAs)for(let r=0;r{let[n,r,i]=e[t],a={propName:n,templateName:t,isSignal:(r&Bd.SignalBased)!==0};return i&&(a.transform=i),a})}function um(e){return Object.keys(e).map(t=>({propName:e[t],templateName:t}))}function dm(e,t,n){let r=t instanceof Ha?t:t?.injector;return r&&e.getStandaloneInjector!==null&&(r=e.getStandaloneInjector(r)||r),r?new pp(n,r):n}function fm(e){let t=e.get(sp,null);if(t===null)throw new pi(407,!1);return{rendererFactory:t,sanitizer:e.get(up,null),changeDetectionScheduler:e.get(rc,null),ngReflect:!1,tracingService:e.get(td,null,{optional:!0})}}function pm(e,t,n){let r=hm(e);return xu(t,r,r===`svg`?`svg`:r===`math`?po:n)}function mm(e){if((e&&`localName`in e&&typeof e.localName==`string`?e.localName:e?.tagName)?.toLowerCase()===`script`)throw new pi(905,!1)}function hm(e){return(e.selectors[0][0]||`div`).toLowerCase()}var gm=class{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=lm(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=um(this.componentDef.outputs),this.cachedOutputs}constructor(e,t){this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=gte(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!t}create(e,t,n,r,i,a,o){Nc(bc.DynamicComponentStart);let s=an(null);try{let s=this.componentDef,c=dm(s,r||this.ngModule,e),l=fm(c),u=l.tracingService;return u&&u.componentCreate?u.componentCreate(dp(s),()=>this.createComponentRef(l,c,t,n,i,a,o)):this.createComponentRef(l,c,t,n,i,a,o)}finally{an(s)}}createComponentRef(e,t,n,r,i,a,o){let s=this.componentDef,c=_m(r,s,a,i),l=e.rendererFactory.createRenderer(null,s),u=r?Gd(l,r,s.encapsulation,t):pm(s,l,o??null);mm(u);let d=t.get(Vp,null),f=vm(u,()=>t.get(xs,null)??Xl());d&&d.addHost(f);let p=a?.some(bm)||i?.some(e=>typeof e!=`function`&&e.bindings.some(bm)),m=Pd(null,c,null,512|Id(s),null,null,e,l,t,null,ru(u,t,!0));d&&sm&&f instanceof ShadowRoot&&ko(m,()=>{d.removeHost(f)}),m[27]=u,rs(m);let ee=null;try{let e=im(27,m,2,`#host`,()=>c.directiveRegistry,!0,0);Eu(l,u,e),Wl(u,m),Ud(c,m,e),ou(c,e,m),am(c,e),n!==void 0&&Sm(e,this.ngContentSelectors,n),ee=bo(e.index,m),m[8]=ee[8],df(c,m,null)}catch(e){throw ee!==null&&Hl(ee),Hl(m),e}finally{Nc(bc.DynamicComponentEnd),cs()}return new xm(this.componentType,m,!!p)}};function _m(e,t,n,r){let i=e?[`ng-version`,`22.1.7`]:_te(t.selectors[0]),a=null,o=null,s=0;if(n)for(let e of n)s+=e[Bp].requiredVars,e.create&&(e.targetIdx=0,(a??=[]).push(e)),e.update&&(e.targetIdx=0,(o??=[]).push(e));if(r)for(let e=0;e{if(n&1&&e)for(let t of e)t.create();if(n&2&&t)for(let e of t)e.update()}}function bm(e){let t=e[Bp].kind;return t===`input`||t===`twoWay`}var xm=class extends op{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,t,n){super(),this._rootLView=t,this._hasInputBindings=n,this._tNode=_o(t[1],27),this.location=jl(this._tNode,t),this.instance=bo(this._tNode.index,t)[8],this.hostView=this.changeDetectorRef=new Kf(t,void 0),this.componentType=e}setInput(e,t){this._hasInputBindings;let n=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),t))return;let r=this._rootLView;sf(n,r[1],r,e,t),this.previousInputValues.set(e,t),Rf(bo(n.index,r),1)}get injector(){return new Cl(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function Sm(e,t,n){let r=e.projection=[];for(let e=0;e{class e{static __NG_ELEMENT_ID__=wm}return e})();function wm(){return Om(Ho(),Bo())}var Tm=class e extends Cm{_lContainer;_hostTNode;_hostLView;constructor(e,t,n){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=n}get element(){return jl(this._hostTNode,this._hostLView)}get injector(){return new Cl(this._hostTNode,this._hostLView)}get parentInjector(){let e=dl(this._hostTNode,this._hostLView);if(Zc(e)){let t=el(e,this._hostLView),n=Qc(e),r=t[1].data[n+8];return new Cl(r,t)}return new Cl(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let t=Em(this._lContainer);return t!==null&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,n){let r,i;typeof n==`number`?r=n:n!=null&&(r=n.index,i=n.injector);let a=ip(this._lContainer,e.ssrId),o=e.createEmbeddedViewImpl(t||{},i,a);return this.insertImpl(o,r,mf(this._hostTNode,a)),o}createComponent(e,t,n,r,i,a,o){let s,c=t||{};s=c.index,n=c.injector,r=c.projectableNodes,i=c.environmentInjector||c.ngModuleRef,a=c.directives,o=c.bindings;let l=new gm(Ii(e)),u=n||this.parentInjector;if(!i&&l.ngModule==null){let e=this.parentInjector.get(Ha,null);e&&(i=e)}let d=Ii(l.componentType??{}),f=ip(this._lContainer,d?.id??null),p=f?.firstChild??null,m=l.create(u,r,p,i,a,o,this._getHostElementNamespace());return this.insertImpl(m.hostView,s,mf(this._hostTNode,f)),m}_getHostElementNamespace(){if(this._hostTNode.type&2){let e=this._hostTNode.parent??this._hostLView[5];return e!==null&&e.type&2&&typeof e.value==`string`&&e.value.toLowerCase()===`foreignobject`?null:e?.namespace??null}return this._hostTNode.namespace}insert(e,t){return this.insertImpl(e,t,!0)}insertImpl(t,n,r){let i=t._lView;if(So(i)){let n=this.indexOf(t);if(n!==-1)this.detach(n);else{let n=i[3],r=new e(n,n[5],n[3]);r.detach(r.indexOf(t))}}let a=this._adjustIndex(n),o=this._lContainer;return Vf(o,i,a,r),t.attachToViewContainerRef(),fa(Dm(o),a,t),t}move(e,t){return this.insert(e,t)}indexOf(e){let t=Em(this._lContainer);return t===null?-1:t.indexOf(e)}remove(e){let t=this._adjustIndex(e,-1),n=Uf(this._lContainer,t);n&&(pa(Dm(this._lContainer),t),vd(n[1],n))}detach(e){let t=this._adjustIndex(e,-1),n=Uf(this._lContainer,t);return n&&pa(Dm(this._lContainer),t)!=null?new Kf(n):null}_adjustIndex(e,t=0){return e??this.length+t}};function Em(e){return e[8]}function Dm(e){return e[8]||=[]}function Om(e,t){let n,r=t[e.index];return io(r)?n=r:(n=zf(r,t,null,e),t[e.index]=n,Rd(t,n)),Am(n,t,e,r),new Tm(n,e,t)}function km(e,t){let n=e[11],r=n.createComment(``),i=go(t,e);return Su(n,n.parentNode(i),r,n.nextSibling(i),!1),r}var Am=Nm,jm=()=>!1;function Mm(e,t,n){return jm(e,t,n)}function Nm(e,t,n,r){if(e[7])return;let i;i=n.type&8?mo(r):km(t,n),e[7]=i}var Pm=class e{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new e(this.queryList)}setDirty(){this.queryList.setDirty()}},Fm=class e{queries;constructor(e=[]){this.queries=e}createEmbeddedView(t){let n=t.queries;if(n!==null){let r=t.contentQueries===null?n.length:t.contentQueries[0],i=[];for(let e=0;e0)r.push(o[e/2]);else{let i=a[e+1],o=t[-n];for(let e=10;ee.trim())}function Ym(e,t,n){e.queries===null&&(e.queries=new Lm),e.queries.track(new Rm(t,n))}function Xm(e,t){return e.queries.getByIndex(t)}function Zm(e,t){let n=e[1],r=Xm(n,t);return r.crossesNgTemplate?Wm(n,e,t,[]):Um(n,e,r,t)}function Qm(e,t,n){let r,i=En(()=>{r._dirtyCounter();let n=nh(r,e);if(t&&n===void 0)throw new pi(-951,!1);return n});return r=i[rn],r._dirtyCounter=T(0),r._flatValue=void 0,i}function $m(e){return Qm(!0,!1,e)}function eh(e){return Qm(!0,!0,e)}function th(e,t){let n=e[rn];n._lView=Bo(),n._queryIndex=t,n._queryList=Gm(n._lView,t),n._queryList.onDirty(()=>n._dirtyCounter.update(e=>e+1))}function nh(e,t){let n=e._lView,r=e._queryIndex;if(n===void 0||r===void 0||n[2]&4)return t?void 0:xa;let i=Gm(n,r),a=Zm(n,r);return i.reset(a,Nl),t?i.first:i._changesDetected||e._flatValue===void 0?e._flatValue=i.toArray():e._flatValue}function rh(e){return!!e&&typeof e.then==`function`}function ih(e){return!!e&&typeof e.subscribe==`function`}var ah=class{},oh=class extends ah{injector;instance=null;constructor(e){super();let t=new Ua([...e.providers,{provide:ah,useValue:this}],e.parent||Va(),e.debugName,new Set([`environment`]));this.injector=t,e.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function sh(e,t,n=null){return new oh({providers:e,parent:t,debugName:n,runEnvironmentInitializers:!0}).injector}var ch=(()=>{class e{_injector;cachedInjectors=new Map;constructor(e){this._injector=e}getOrCreateStandaloneInjector(e){if(!e.standalone)return null;if(!this.cachedInjectors.has(e)){let t=Da(!1,e.type),n=t.length>0?sh([t],this._injector,``):null;this.cachedInjectors.set(e,n)}return this.cachedInjectors.get(e)}ngOnDestroy(){try{for(let e of this.cachedInjectors.values())e!==null&&e.destroy()}finally{this.cachedInjectors.clear()}}static ɵprov=xi({token:e,providedIn:`environment`,factory:()=>new e(ra(Ha))})}return e})();function O(e){return yc(()=>{let t=mh(e),n={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection!==Ll.Eager,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:t.standalone?e=>e.get(ch).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||su.Emulated,styles:e.styles||xa,_:null,schemas:e.schemas||null,tView:null,id:``};t.standalone&&rd(`NgStandalone`),hh(n);let r=e.dependencies;return n.directiveDefs=gh(r,lh),n.pipeDefs=gh(r,Ri),n.id=_h(n),n})}function lh(e){return Ii(e)||Li(e)}function uh(e,t){if(e==null)return ba;let n={};for(let r in e)if(Object.hasOwn(e,r)){let i=e[r],a,o,s,c;Array.isArray(i)?(s=i[0],a=i[1],o=i[2]??a,c=i[3]||null):(a=i,o=i,s=Bd.None,c=null),n[a]=[r,s,c],t[a]=o}return n}function dh(e){if(e==null)return ba;let t={};for(let n in e)Object.hasOwn(e,n)&&(t[e[n]]=n);return t}function fh(e){return yc(()=>{let t=mh(e);return hh(t),t})}function ph(e){return{type:e.type,name:e.name,factory:null,pure:e.pure!==!1,standalone:e.standalone??!0,onDestroy:e.type.prototype.ngOnDestroy||null}}function mh(e){let t={};return{type:e.type,providersResolver:null,viewProvidersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputConfig:e.inputs||ba,exportAs:e.exportAs||null,standalone:e.standalone??!0,signals:e.signals===!0,selectors:e.selectors||xa,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,controlDef:null,signalFormsInputPresence:null,inputs:uh(e.inputs,t),outputs:dh(e.outputs),debugInfo:null}}function hh(e){e.features?.forEach(t=>t(e))}function gh(e,t){return e?()=>{let n=typeof e==`function`?e():e,r=[];for(let e of n){let n=t(e);n!==null&&r.push(n)}return r}:null}function _h(e){let t=0,n=typeof e.consts==`function`?``:e.consts,r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,n,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];for(let e of r.join(`|`))t=Math.imul(31,t)+e.charCodeAt(0)<<0;return t+=2147483648,`c`+t}var vh=new Oi(``),yh=(()=>{class e{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((e,t)=>{this.resolve=e,this.reject=t});appInits=x(vh,{optional:!0})??[];injector=x(bs);constructor(){}runInitializers(){if(this.initialized)return;let e=[];for(let t of this.appInits){let n=eo(this.injector,t);if(rh(n))e.push(n);else if(ih(n)){let t=new Promise((e,t)=>{n.subscribe({complete:e,error:t})});e.push(t)}}let t=()=>{this.done=!0,this.resolve()};Promise.all(e).then(()=>{t()}).catch(e=>{this.reject(e)}),e.length===0&&t(),this.initialized=!0}static ɵfac=function(t){return new(t||e)};static ɵprov=kl({token:e,factory:e.ɵfac})}return e})();function bh(e){return t=>{t.controlDef={create:(e,t)=>{e?.ɵngControlCreate(t)},update:(e,t)=>{e?.ɵngControlUpdate?.(t)},passThroughInput:e}}}function xh(e){return Object.getPrototypeOf(e.prototype).constructor}function Sh(e){let t=xh(e.type),n=!0,r=[e];for(;t&&t!==Function.prototype&&t!==Object.prototype;){let i,a=Object.hasOwn(t,Ai)?t[Ai]:void 0,o=Object.hasOwn(t,ji)?t[ji]:void 0;if(co(e))i=a??o;else{if(a)throw new pi(903,!1);i=o}if(i){if(n){r.push(i);let t=e;t.inputs=Th(e.inputs),t.declaredInputs=Th(e.declaredInputs),t.outputs=Th(e.outputs);let n=i.hostBindings;n&&Oh(e,n);let a=i.viewQuery,o=i.contentQueries;if(a&&Eh(e,a),o&&Dh(e,o),Ch(e,i),Vee(e.outputs,i.outputs),co(i)&&i.data.animation){let t=e.data;t.animation=(t.animation||[]).concat(i.data.animation)}}let t=i.features;if(t)for(let r=0;r=0;r--){let i=e[r];i.hostVars=t+=i.hostVars,i.hostAttrs=Yc(i.hostAttrs,n=Yc(n,i.hostAttrs))}}function Th(e){return e===ba?{}:e===xa?[]:e}function Eh(e,t){let n=e.viewQuery;e.viewQuery=n?(e,r)=>{t(e,r),n(e,r)}:t}function Dh(e,t){let n=e.contentQueries;e.contentQueries=n?(e,r,i)=>{t(e,r,i),n(e,r,i)}:t}function Oh(e,t){let n=e.hostBindings;e.hostBindings=n?(e,r)=>{t(e,r),n(e,r)}:t}function kh(e,t,n,r,i,a,o,s){if(n.firstCreatePass){e.mergedAttrs=Yc(e.mergedAttrs,e.attrs);let t=e.tView=jd(2,e,i,a,o,n.directiveRegistry,n.pipeRegistry,null,n.schemas,n.consts,null);n.queries!==null&&(n.queries.template(n,e),t.queries=n.queries.embeddedTView(e))}s&&(e.flags|=s),Wo(e,!1);let c=Nh(n,t,e,r);gs()&&Sd(n,t,c,e),Wl(c,t);let l=zf(c,t,c,e);t[r+27]=l,Rd(t,l),Mm(l,e,t)}function Ah(e,t,n,r,i,a,o,s,c,l,u){let d=n+27,f;return t.firstCreatePass?(f=Xf(t,d,4,o||null,s||null),Io()&&Wp(t,e,f,Co(t.consts,l),$d),Fc(t,f)):f=t.data[d],kh(f,e,t,n,r,i,a,c),so(f)&&Ud(t,e,f),l!=null&&Wd(e,f,u),f}function jh(e,t,n,r,i,a,o,s,c,l,u){let d=n+27,f;if(t.firstCreatePass){if(f=Xf(t,d,4,o||null,s||null),l!=null){let e=Co(t.consts,l);f.localNames=[];for(let t=0;t{throw new pi(600,``)})}var Rh=10,zh=(()=>{class e{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=x(qs);afterRenderManager=x(id);zonelessEnabled=x(ic);rootEffectScheduler=x(oc);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Wr;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=x(Es);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(di(e=>!e))}constructor(){x(td,{optional:!0})}whenStable(){let e;return new Promise(t=>{e=this.isStable.subscribe({next:e=>{e&&t()}})}).finally(()=>{e.unsubscribe()})}_injector=x(Ha);_rendererFactory=null;get injector(){return this._injector}bootstrap(e,t){return this.bootstrapImpl(e,t)}bootstrapImpl(e,t,n=bs.NULL){return this._injector.get(Ps).run(()=>{if(Nc(bc.BootstrapComponentStart),!this._injector.get(yh).done)throw new pi(405,``);let r=Ii(e),i=this._injector.get(ah),a=new gm(r,i);this.componentTypes.push(e);let{hostElement:o,directives:s,bindings:c}=Bh(t),l=o||a.selector,u=a.create(n,[],l,i.injector,s,c),d=u.location.nativeElement,f=u.injector.get(Fh,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),Vh(this.components,u),f?.unregisterApplication(d)}),this._loadComponent(u),Nc(bc.BootstrapComponentEnd,u),u})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){Nc(bc.ChangeDetectionStart),this.tracingSnapshot===null?this.tickImpl():this.tracingSnapshot.run(ed.CHANGE_DETECTION,this.tickImpl)}tickImpl=()=>{if(this._runningTick)throw Nc(bc.ChangeDetectionEnd),new pi(101,!1);let e=an(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,an(e),this.afterTick.next(),Nc(bc.ChangeDetectionEnd)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(sp,null,{optional:!0}));let e=0;for(;this.dirtyFlags!==0&&e++Eo(e))){this.dirtyFlags|=2;return}this.dirtyFlags&=-8}attachView(e){let t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){let t=e;Vh(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView);try{this.tick()}catch(e){this.internalErrorHandler(e)}this.components.push(e),this._injector.get(Ih,[]).forEach(t=>t(e))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(e=>e()),this._views.slice().forEach(e=>e.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(e){return this._destroyListeners.push(e),()=>Vh(this._destroyListeners,e)}destroy(){if(this._destroyed)throw new pi(406,!1);let e=this._injector;e.destroy&&!e.destroyed&&e.destroy()}get viewCount(){return this._views.length}static ɵfac=function(t){return new(t||e)};static ɵprov=kl({token:e,factory:e.ɵfac})}return e})();function Bh(e){return e===void 0||typeof e==`string`||e instanceof Element?{hostElement:e}:e}function Vh(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function k(e,t,n,r){let i=Bo();return gp(i,Qo(),t)&&(Vo(),ef(ds(),i,e,t,n,r)),k}function Hh(e){if(rd(`NgAnimateEnter`),!Wu)return Hh;let t=Bo();if(Dte(t))return Hh;let n=Ho(),r=t[9].get(Ps);return Mte(Zu(t),n,()=>Uh(t,n,e,r)),Rte(t[9]),dd(t[9],Zu(t)),Hh}function Uh(e,t,n,r){let i=go(t,e),a=e[11],o=jte(n),s=[],c=!1,l=e=>{if(Qu(e)!==i)return;let t=e instanceof AnimationEvent?`animationend`:`transitionend`;r.runOutsideAngular(()=>{a.listen(i,t,u)})},u=e=>{Qu(e)===i&&($u(e,i)&&(c=!0),Wh(e,i,a))};if(o&&o.length>0){r.runOutsideAngular(()=>{s.push(a.listen(i,`animationstart`,l)),s.push(a.listen(i,`transitionstart`,l))}),Ote(i,o,s);for(let e of o)a.addClass(i,e);r.runOutsideAngular(()=>{requestAnimationFrame(()=>{if(!c&&(Cte(i,qu,Wu),!qu.has(i))){for(let e of o)a.removeClass(i,e);Gu(i)}})})}}function Wh(e,t,n){let r=Ku.get(t);if(Qu(e)===t&&r&&$u(e,t)){e.stopPropagation();for(let e of r.classList)n.removeClass(t,e);Gu(t)}}var Gh=class{destroy(e){}updateValue(e,t){}swap(e,t){let n=Math.min(e,t),r=Math.max(e,t),i=this.detach(r);if(r-n>1){let e=this.detach(n);this.attach(n,i),this.attach(r,e)}else this.attach(n,i)}move(e,t){this.attach(t,this.detach(e))}};function Kh(e,t,n,r,i){return e===n&&Object.is(t,r)?1:Object.is(i(e,t),i(n,r))?-1:0}function qh(e,t,n,r){let i,a,o=0,s=e.length-1;if(Array.isArray(t)){an(r);let c=t.length-1;for(an(null);o<=s&&o<=c;){let r=e.at(o),l=t[o],u=Kh(o,r,o,l,n);if(u!==0){u<0&&e.updateValue(o,l),o++;continue}let d=e.at(s),f=t[c],p=Kh(s,d,c,f,n);if(p!==0){p<0&&e.updateValue(s,f),s--,c--;continue}let m=n(o,r),ee=n(s,d),h=n(o,l);if(Object.is(h,ee)){let t=n(c,f);Object.is(t,m)?(e.swap(o,s),e.updateValue(s,f),c--,s--):e.move(s,o),e.updateValue(o,l),o++;continue}if(i??=new Zh,a??=Xh(e,o,s,n),Jh(e,i,o,h))e.updateValue(o,l),o++,s++;else if(a.has(h))i.set(m,e.detach(o)),s--;else{let n=e.create(o,t[o]);e.attach(o,n),o++,s++}}for(;o<=c;)Yh(e,i,n,o,t[o]),o++}else if(t!=null){an(r);let c=t[Symbol.iterator]();an(null);let l=c.next();for(;!l.done&&o<=s;){let t=e.at(o),r=l.value,u=Kh(o,t,o,r,n);if(u!==0)u<0&&e.updateValue(o,r),o++,l=c.next();else{i??=new Zh,a??=Xh(e,o,s,n);let u=n(o,r);if(Jh(e,i,o,u))e.updateValue(o,r),o++,s++,l=c.next();else if(!a.has(u))e.attach(o,e.create(o,r)),o++,s++,l=c.next();else{let r=n(o,t);i.set(r,e.detach(o)),s--}}}for(;!l.done;)Yh(e,i,n,e.length,l.value),l=c.next()}for(;o<=s;)e.destroy(e.detach(s--));i?.forEach(t=>{e.destroy(t)})}function Jh(e,t,n,r){return t!==void 0&&t.has(r)?(e.attach(n,t.get(r)),t.delete(r),!0):!1}function Yh(e,t,n,r,i){if(Jh(e,t,r,n(r,i)))e.updateValue(r,i);else{let t=e.create(r,i);e.attach(r,t)}}function Xh(e,t,n,r){let i=new Set;for(let a=t;a<=n;a++)i.add(r(a,e.at(a)));return i}var Zh=class{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let t=this.kvMap.get(e);return this._vMap!==void 0&&this._vMap.has(t)?(this.kvMap.set(e,this._vMap.get(t)),this._vMap.delete(t)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,t){if(this.kvMap.has(e)){let n=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let r=this._vMap;for(;r.has(n);)n=r.get(n);r.set(n,t)}else this.kvMap.set(e,t)}forEach(e){for(let[t,n]of this.kvMap)if(e(n,t),this._vMap!==void 0){let r=this._vMap;for(;r.has(n);)n=r.get(n),e(n,t)}}};function A(e,t,n,r,i,a,o,s){rd(`NgControlFlow`);let c=Bo(),l=Vo();return jh(c,l,e,t,n,r,i,Co(l.consts,a),256,o,s),Qh}function Qh(e,t,n,r,i,a,o,s){rd(`NgControlFlow`);let c=Bo(),l=Vo();return jh(c,l,e,t,n,r,i,Co(l.consts,a),512,o,s),Qh}function j(e,t){rd(`NgControlFlow`);let n=Bo(),r=Qo(),i=n[r]===Fu?-1:n[r],a=i===-1?void 0:ig(n,27+i);if(gp(n,r,e)){let r=an(null);try{if(a!==void 0&&Hf(a,0),e!==-1){let r=27+e,i=ig(n,r),a=lg(n[1],r),o=ap(i,a,n);Vf(i,pf(n,a,t,{dehydratedView:o}),0,mf(a,o))}}finally{an(r)}}else if(a!==void 0){let e=Bf(a,0);e!==void 0&&(e[8]=t)}}var $h=class{lContainer;$implicit;$index;constructor(e,t,n){this.lContainer=e,this.$implicit=t,this.$index=n}get $count(){return this.lContainer.length-10}};function eg(e){return e}function tg(e,t){return t}var ng=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,t,n){this.hasEmptyBlock=e,this.trackByFn=t,this.liveCollection=n}};function M(e,t,n,r,i,a,o,s,c,l,u,d,f){rd(`NgControlFlow`);let p=Bo(),m=Vo(),ee=c!==void 0,h=Bo(),g=new ng(ee,s?o.bind(h[15][8]):o);h[27+e]=g,jh(p,m,e+1,t,n,r,i,Co(m.consts,a),256),ee&&jh(p,m,e+2,c,l,u,d,Co(m.consts,f),512)}var rg=class extends Gh{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,t,n){super(),this.lContainer=e,this.hostLView=t,this.templateTNode=n}get length(){return this.lContainer.length-10}at(e){return this.getLView(e)[8].$implicit}attach(e,t){let n=t[6];this.needsIndexUpdate||=e!==this.length,Vf(this.lContainer,t,e,mf(this.templateTNode,n)),ag(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,og(this.lContainer,e),sg(this.lContainer,e)}create(e,t){let n=ip(this.lContainer,this.templateTNode.tView.ssrId);return pf(this.hostLView,this.templateTNode,new $h(this.lContainer,t,e),{dehydratedView:n})}destroy(e){vd(e[1],e)}updateValue(e,t){this.getLView(e)[8].$implicit=t}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e0){let e=n[9];Ite(e,r),Uu.delete(n[19]),r.detachedLeaveAnimationFns=void 0}}function og(e,t){if(e.length<=10)return;let n=e[10+t],r=n?n[26]:void 0;r&&r.leave&&r.leave.size>0&&(r.detachedLeaveAnimationFns=[])}function sg(e,t){return Uf(e,t)}function cg(e,t){return Bf(e,t)}function lg(e,t){return _o(e,t)}function P(e,t,n){let r=Bo();return gp(r,Qo(),t)&&(Vo(),qd(ds(),r,e,t,r[11],n)),P}function ug(e,t,n,r,i){sf(t,e,n,i?`class`:`style`,r)}function F(e,t,n,r){let i=Bo(),a=i[1],o=e+27,s=a.firstCreatePass?im(o,i,2,t,$d,Io(),n,r):a.data[o];if(oo(s)){let n=i[10].tracingService;if(n&&n.componentCreate){let o=a.data[s.directiveStart+s.componentOffset];return n.componentCreate(dp(o),()=>(dg(e,t,i,s,r),F))}}return dg(e,t,i,s,r),F}function dg(e,t,n,r,i){if(rf(r,n,e,t,pg),so(r)){let e=n[1];Ud(e,n,r),ou(e,r,n)}i!=null&&Wd(n,r)}function I(){let e=Vo(),t=af(Ho());return e.firstCreatePass&&am(e,t),Ro(t)&&zo(),Fo(),t.classesWithoutHost!=null&&Wc(t)&&ug(e,t,Bo(),t.classesWithoutHost,!0),t.stylesWithoutHost!=null&&Gc(t)&&ug(e,t,Bo(),t.stylesWithoutHost,!1),I}function L(e,t,n,r){return F(e,t,n,r),I(),L}function R(e,t,n,r){let i=Bo(),a=i[1],o=e+27,s=a.firstCreatePass?om(o,a,2,t,n,r):a.data[o];return rf(s,i,e,t,pg),r!=null&&Wd(i,s),R}function z(){return Ro(af(Ho()))&&zo(),Fo(),z}function fg(e,t,n,r){return R(e,t,n,r),z(),fg}var pg=(e,t,n,r,i)=>(_s(!0),xu(t[11],r,ms()));function mg(e,t,n){let r=Bo(),i=r[1],a=e+27,o=i.firstCreatePass?im(a,r,8,`ng-container`,$d,Io(),t,n):i.data[a];if(rf(o,r,e,`ng-container`,_g),so(o)){let e=r[1];Ud(e,r,o),ou(e,o,r)}return n!=null&&Wd(r,o),mg}function hg(){let e=Vo(),t=af(Ho());return e.firstCreatePass&&am(e,t),hg}function gg(e,t,n){return mg(e,t,n),hg(),gg}var _g=(e,t,n,r,i)=>(_s(!0),bu(t[11],``));function B(){return Bo()}function V(e,t,n){let r=Bo();return gp(r,Qo(),t)&&(Vo(),Jd(ds(),r,e,t,r[11],n)),V}var vg=void 0;function yg(e){let t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,``).length;return t===1&&n===0?1:5}var bg=[`en`,[[`a`,`p`],[`AM`,`PM`]],[[`AM`,`PM`]],[[`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`]],vg,[[`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`]],vg,[[`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}`,vg,vg,vg],[`.`,`,`,`;`,`%`,`+`,`-`,`E`,`×`,`‰`,`∞`,`NaN`,`:`],[`#,##0.###`,`#,##0%`,`¤#,##0.00`,`#E0`],`USD`,`$`,`US Dollar`,{},`ltr`,yg],xg=Object.create(null);function Sg(e){let t=Tg(e),n=Cg(t);if(n)return n;let r=t.split(`-`)[0];if(n=Cg(r),n)return n;if(r===`en`)return bg;throw new pi(701,!1)}function Cg(e){if(!(e in xg)){let t=Qi.ng&&Qi.ng.common&&Qi.ng.common.locales&&Qi.ng.common.locales[e];return t!==void 0&&(xg[e]=t),t}return xg[e]}var wg={LocaleId:0,DayPeriodsFormat:1,DayPeriodsStandalone:2,DaysFormat:3,DaysStandalone:4,MonthsFormat:5,MonthsStandalone:6,Eras:7,FirstDayOfWeek:8,WeekendRange:9,DateFormat:10,TimeFormat:11,DateTimeFormat:12,NumberSymbols:13,NumberFormats:14,CurrencyCode:15,CurrencySymbol:16,CurrencyName:17,Currencies:18,Directionality:19,PluralCase:20,ExtraData:21};function Tg(e){return e.toLowerCase().replace(/_/g,`-`)}var Eg=`en-US`;function Dg(e){typeof e==`string`&&e.toLowerCase().replace(/_/g,`-`)}function H(e,t,n){let r=Bo(),i=Vo(),a=Ho();return Og(i,r,r[11],a,e,t,n),H}function U(e,t,n){let r=Bo(),i=Vo(),a=Ho();return(a.type&3||n)&&Sp(a,i,r,n,r[11],e,t,bp(a,r,t)),U}function Og(e,t,n,r,i,a,o){let s=!0,c=null;if((r.type&3||o)&&(c??=bp(r,t,a),Sp(r,e,t,o,n,i,a,c)&&(s=!1)),s){let e=r.outputs?.[i],n=r.hostDirectiveOutputs?.[i];if(n&&n.length)for(let e=0;e>17&32767}function Rg(e){return(e&2)==2}function zg(e,t){return e&131071|t<<17}function Bg(e){return e|2}function Vg(e){return(e&131068)>>2}function Hg(e,t){return e&-131069|t<<2}function Ug(e){return(e&1)==1}function Wg(e){return e|1}function Gg(e,t,n,r,i,a){let o=a?t.classBindings:t.styleBindings,s=Lg(o),c=Vg(o);e[r]=n;let l=!1,u;if(Array.isArray(n)){let e=n;u=e[1],(u===null||va(e,u)>0)&&(l=!0)}else u=n;if(i){if(c!==0){let t=Lg(e[s+1]);e[r+1]=Ig(t,s),t!==0&&(e[t+1]=Hg(e[t+1],r)),e[s+1]=zg(e[s+1],r)}else e[r+1]=Ig(s,0),s!==0&&(e[s+1]=Hg(e[s+1],r)),s=r}else e[r+1]=Ig(c,0),s===0?s=r:e[c+1]=Hg(e[c+1],r),c=r;l&&(e[r+1]=Bg(e[r+1])),qg(e,u,r,!0),qg(e,u,r,!1),Kg(t,u,e,r,a),o=Ig(s,c),a?t.classBindings=o:t.styleBindings=o}function Kg(e,t,n,r,i){let a=i?e.residualClasses:e.residualStyles;a!=null&&typeof t==`string`&&va(a,t)>=0&&(n[r+1]=Wg(n[r+1]))}function qg(e,t,n,r){let i=e[n+1],a=t===null,o=r?Lg(i):Vg(i),s=!1;for(;o!==0&&(s===!1||a);){let n=e[o],i=e[o+1];Jg(n,t)&&(s=!0,e[o+1]=r?Wg(i):Bg(i)),o=r?Lg(i):Vg(i)}s&&(e[n+1]=r?Bg(i):Wg(i))}function Jg(e,t){return e===null||t==null||(Array.isArray(e)?e[1]:e)===t?!0:Array.isArray(e)&&typeof t==`string`?va(e,t)>=0:!1}var Yg={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function Xg(e){return e.substring(Yg.key,Yg.keyEnd)}function Zg(e){return $g(e),Qg(e,e_(e,0,Yg.textEnd))}function Qg(e,t){let n=Yg.textEnd;return n===t?-1:(t=Yg.keyEnd=t_(e,Yg.key=t,n),e_(e,t,n))}function $g(e){Yg.key=0,Yg.keyEnd=0,Yg.value=0,Yg.valueEnd=0,Yg.textEnd=e.length}function e_(e,t,n){for(;t32;)t++;return t}function n_(e,t,n){return a_(e,t,n,!1),n_}function G(e,t){return a_(e,t,null,!0),G}function r_(e){o_(g_,i_,e,!0)}function i_(e,t){for(let n=Zg(t);n>=0;n=Qg(t,n))ga(e,Xg(t),!0)}function a_(e,t,n,r){let i=Bo(),a=Vo(),o=$o(2);if(a.firstUpdatePass&&c_(a,e,o,r),t!==Fu&&gp(i,o,t)){let s=a.data[ls()];v_(a,s,i,i[11],e,i[o+1]=x_(t,n),r,o)}}function o_(e,t,n,r){let i=Vo(),a=$o(2);i.firstUpdatePass&&c_(i,null,a,r);let o=Bo();if(n!==Fu&&gp(o,a,n)){let s=i.data[ls()];if(S_(s,r)&&!s_(i,a)){let e=r?s.classesWithoutHost:s.stylesWithoutHost;e!==null&&(n=_i(e,n||``)),ug(i,s,o,n,r)}else __(i,s,o,o[11],o[a+1],o[a+1]=h_(e,t,n),r,a)}}function s_(e,t){return t>=e.expandoStartIndex}function c_(e,t,n,r){let i=e.data;if(i[n+1]===null){let a=i[ls()],o=s_(e,n);S_(a,r)&&t===null&&!o&&(t=!1),t=l_(i,a,t,r),Gg(i,a,t,n,o,r)}}function l_(e,t,n,r){let i=$ee(e),a=r?t.residualClasses:t.residualStyles;if(i===null)(r?t.classBindings:t.styleBindings)===0&&(n=p_(null,e,t,n,r),n=m_(n,t.attrs,r),a=null);else{let o=t.directiveStylingLast;if(o===-1||e[o]!==i){if(n=p_(i,e,t,n,r),a===null){let n=u_(e,t,r);n!==void 0&&Array.isArray(n)&&(n=p_(null,e,t,n[1],r),n=m_(n,t.attrs,r),d_(e,t,r,n))}else a=f_(e,t,r)}}return a!==void 0&&(r?t.residualClasses=a:t.residualStyles=a),n}function u_(e,t,n){let r=n?t.classBindings:t.styleBindings;if(Vg(r)!==0)return e[Lg(r)]}function d_(e,t,n,r){let i=n?t.classBindings:t.styleBindings;e[Lg(i)]=r}function f_(e,t,n){let r,i=t.directiveEnd;for(let a=1+t.directiveStylingLast;a0;){let t=e[i],a=Array.isArray(t),c=a?t[1]:t,l=c===null,u=n[i+1];u===Fu&&(u=l?xa:void 0);let d=l?_a(u,r):c===r?u:void 0;if(a&&!b_(d)&&(d=_a(t,r)),b_(d)&&(s=d,o))return s;let f=e[i+1];i=o?Lg(f):Vg(f)}if(t!==null){let e=a?t.residualClasses:t.residualStyles;e!=null&&(s=_a(e,r))}return s}function b_(e){return e!==void 0}function x_(e,t){return e==null||e===``||(typeof t==`string`?e=lu(e)+t:typeof e==`object`&&(e=gi(lu(e)))),e}function S_(e,t){return!!(e.flags&(t?8:16))}function K(e,t=``){let n=Bo(),r=Vo(),i=e+27,a=r.firstCreatePass?Xf(r,i,1,t,null):r.data[i],o=C_(r,n,a,t);n[i]=o,gs()&&Sd(r,n,o,a),Wo(a,!1)}var C_=(e,t,n,r)=>(_s(!0),vu(t[11],r));function w_(e,t,n,r=``){return gp(e,Qo(),n)?t+Bi(n)+r:Fu}function T_(e,t,n,r,i,a=``){let o=_p(e,Zo(),n,i);return $o(2),o?t+Bi(n)+r+Bi(i)+a:Fu}function E_(e,t,n,r,i,a,o,s=``){let c=vp(e,Zo(),n,i,o);return $o(3),c?t+Bi(n)+r+Bi(i)+a+Bi(o)+s:Fu}function D_(e,t,n,r,i,a,o,s,c,l=``){let u=yp(e,Zo(),n,i,o,c);return $o(4),u?t+Bi(n)+r+Bi(i)+a+Bi(o)+s+Bi(c)+l:Fu}function q(e){return J(``,e),q}function J(e,t,n){let r=Bo(),i=w_(r,e,t,n);return i!==Fu&&A_(r,ls(),i),J}function Y(e,t,n,r,i){let a=Bo(),o=T_(a,e,t,n,r,i);return o!==Fu&&A_(a,ls(),o),Y}function O_(e,t,n,r,i,a,o){let s=Bo(),c=E_(s,e,t,n,r,i,a,o);return c!==Fu&&A_(s,ls(),c),O_}function k_(e,t,n,r,i,a,o,s,c){let l=Bo(),u=D_(l,e,t,n,r,i,a,o,s,c);return u!==Fu&&A_(l,ls(),u),k_}function A_(e,t,n){let r=ho(t,e);yu(e[11],r,n)}function j_(e,t,n){gc(t)&&(t=t());let r=Bo();return gp(r,Qo(),t)&&(Vo(),qd(ds(),r,e,t,r[11],n)),j_}function M_(e,t){let n=gc(e);return n&&e.set(t),n}function N_(e,t){let n=Bo(),r=Vo(),i=Ho();return Og(r,n,n[11],i,e,t),N_}var P_={};function F_(e){rd(`NgLet`);let t=Vo(),n=Bo(),r=e+27;return Wo(Xf(t,r,128,null,null),!1),yo(t,n,r,P_),F_}function I_(e){return yo(Vo(),Bo(),ls(),e),e}function L_(e){let t=vo(qo(),27+e);if(t===P_)throw new pi(314,!1);return t}function R_(e,t,n=``){return w_(Bo(),e,t,n)}function z_(e,t,n){let r=Vo();r.firstCreatePass&&B_(t,r.data,r.blueprint,co(e),n)}function B_(e,t,n,r,i){if(e=yi(e),Array.isArray(e))for(let a=0;a>20;if(Fa(e)||!e.multi){let r=new Uc(l,i,Up,null),p=U_(c,t,i?u:u+f,d);p===-1?(fl(cl(s,o),a,c),V_(a,e,t.length),t.push(c),s.directiveStart++,s.directiveEnd++,i&&(s.providerIndexes+=1048576),n.push(r),o.push(r)):(n[p]=r,o[p]=r)}else{let p=U_(c,t,u+f,d),m=U_(c,t,u,u+f),ee=p>=0&&n[p],h=m>=0&&n[m];if(i&&!h||!i&&!ee){fl(cl(s,o),a,c);let u=tne(i?ene:$te,n.length,i,r,l,e);!i&&h&&(n[m].providerFactory=u),V_(a,e,t.length,0),t.push(c),s.directiveStart++,s.directiveEnd++,i&&(s.providerIndexes+=1048576),n.push(u),o.push(u)}else{let t=H_(n[i?m:p],l,!i&&r);V_(a,e,p>-1?p:m,t)}!i&&r&&h&&n[m].componentProviders++}}}function V_(e,t,n,r){let i=Fa(t),a=Ia(t);if(i||a){let o=(a?yi(t.useClass):t).prototype.ngOnDestroy;if(o){let a=e.destroyHooks||=[];if(!i&&t.multi){let e=a.indexOf(n);e===-1?a.push(n,[r,o]):a[e+1].push(r,o)}else a.push(n,o)}}}function H_(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function U_(e,t,n,r){for(let i=n;i{n.providersResolver=(t,n)=>z_(t,n?n(e):e,!1),t&&(n.viewProvidersResolver=(e,n)=>z_(e,n?n(t):t,!0))}}function K_(e,t){let n=Xo()+e,r=Bo();return r[n]===Fu?mp(r,n,t()):hp(r,n)}function q_(e,t,n){return X_(Bo(),Xo(),e,t,n)}function J_(e,t,n,r){return Z_(Bo(),Xo(),e,t,n,r)}function nne(e,t,n,r,i,a,o){return rne(Bo(),Xo(),e,t,n,r,i,a)}function Y_(e,t){let n=e[t];return n===Fu?void 0:n}function X_(e,t,n,r,i,a){let o=t+n;return gp(e,o,i)?mp(e,o+1,a?r.call(a,i):r(i)):Y_(e,o+1)}function Z_(e,t,n,r,i,a,o){let s=t+n;return _p(e,s,i,a)?mp(e,s+2,o?r.call(o,i,a):r(i,a)):Y_(e,s+2)}function rne(e,t,n,r,i,a,o,s,c){let l=t+n;return yp(e,l,i,a,o,s)?mp(e,l+4,c?r.call(c,i,a,o,s):r(i,a,o,s)):Y_(e,l+4)}function Q_(e,t){let n=Vo(),r,i=e+27;n.firstCreatePass?(r=ine(t,n.pipeRegistry),n.data[i]=r,r.onDestroy&&(n.destroyHooks??=[]).push(i,r.onDestroy)):r=n.data[i];let a=r.factory||(r.factory=ca(r.type,!0)),o=Xi(Up);try{let e=nl(!1),t=a();return nl(e),yo(n,Bo(),i,t),t}finally{Xi(o)}}function ine(e,t){if(t)for(let n=t.length-1;n>=0;n--){let r=t[n];if(e===r.name)return r}}function $_(e,t,n){let r=e+27,i=Bo(),a=vo(i,r);return tv(i,r)?X_(i,Xo(),t,a.transform,n,a):a.transform(n)}function ev(e,t,n,r){let i=e+27,a=Bo(),o=vo(a,i);return tv(a,i)?Z_(a,Xo(),t,o.transform,n,r,o):o.transform(n,r)}function tv(e,t){return e[1].data[t].pure}function nv(e,t){return Yf(e,t)}var ane=(()=>{class e{applicationErrorHandler=x(qs);appRef=x(zh);taskService=x(Es);ngZone=x(Ps);zonelessEnabled=x(ic);tracing=x(td,{optional:!0});zoneIsDefined=typeof Zone<`u`&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new cr;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Ms):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(x(ac,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{let e=this.taskService.add();if(!this.runningTick&&(this.cleanup(),!this.zonelessEnabled||this.appRef.includeAllTestViews)){this.taskService.remove(e);return}this.switchToMicrotaskScheduler(),this.taskService.remove(e)})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()}))}switchToMicrotaskScheduler(){this.ngZone.runOutsideAngular(()=>{let e=this.taskService.add();this.useMicrotaskScheduler=!0,queueMicrotask(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(e)})})}notify(e){if(!this.zonelessEnabled&&e===5)return;switch(e){case 0:case 2:this.appRef.dirtyFlags|=2;break;case 3:case 4:case 5:case 1:this.appRef.dirtyFlags|=4;break;case 6:this.appRef.dirtyFlags|=2;break;case 12:this.appRef.dirtyFlags|=16;break;case 13:this.appRef.dirtyFlags|=2;break;case 11:break;default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick())return;let t=this.useMicrotaskScheduler?As:ks;this.pendingRenderTaskId=this.taskService.add(),this.cancelScheduledCallback=this.scheduleInRootZone?Zone.root.run(()=>t(()=>this.tick())):this.ngZone.runOutsideAngular(()=>t(()=>this.tick()))}shouldScheduleTick(){return!(this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(`isAngularZone_ID`+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let e=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(e){this.applicationErrorHandler(e)}finally{this.taskService.remove(e),this.cleanup()}}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let e=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(e)}}static ɵfac=function(t){return new(t||e)};static ɵprov=kl({token:e,factory:e.ɵfac})}return e})();function one(){return[{provide:rc,useExisting:ane},{provide:Ps,useClass:Hs},{provide:ic,useValue:!0}]}function sne(){return typeof $localize<`u`&&$localize.locale||`en-US`}var rv=new Oi(``,{factory:()=>x(rv,{optional:!0,skipSelf:!0})||sne()}),iv=class{destroyed=!1;listeners=null;errorHandler=x(Ks,{optional:!0});isEmitting=!1;hasNullListeners=!1;destroyRef=x(Ss);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new pi(953,!1);return(this.listeners??=[]).push(e),{unsubscribe:()=>{let t=this.listeners?this.listeners.indexOf(e):-1;t>-1&&(this.isEmitting?(this.hasNullListeners=!0,this.listeners[t]=null):this.listeners.splice(t,1))}}}emit(e){if(this.destroyed){console.warn(mi(953,!1));return}if(this.listeners===null)return;this.isEmitting=!0;let t=an(null);try{for(let t of this.listeners)try{t!==null&&t(e)}catch(e){this.errorHandler?.handleError(e)}}finally{this.hasNullListeners&&(this.hasNullListeners=!1,this.listeners&&cne(this.listeners)),an(t),this.isEmitting=!1}}};function cne(e){let t=e.length-1;for(;t>-1;)e[t]===null&&e.splice(t,1),t--}function X(e,t){return En(e,t?.equal)}function Z(e){return qn(e)}(class e extends Error{_brand;constructor(e){super(e)}static IDLE=new e(`IDLE`);static LOADING=new e(`LOADING`)});var lne=e=>e;function Q(e,t){return typeof e==`function`?av(Un(e,lne,t?.equal),t?.debugName,t?.set):av(Un(e.source,e.computation,e.equal),e.debugName,e.set)}function av(e,t,n){let r=e[rn],i=e;if(n!==void 0){let t=e=>Wn(r,e);i.set=e=>n(e,t),i.update=r=>n(r(Z(e)),t)}else i.set=e=>Wn(r,e),i.update=e=>Gn(r,e);return i.asReadonly=Ys.bind(e),i}var ov=!1;function une(){return ov}function sv(e){ov=e}function cv(e,t){let n=Object.create(vc);n.value=e,n.transformFn=t?.transform;function r(){if(cn(n),n.value===_c)throw new pi(-950,null);return n.value}return r[rn]=n,r}function lv(e){return new iv}function uv(e,t){return cv(e,t)}function dne(e){return cv(_c,e)}var $=(uv.required=dne,uv);function dv(e,t){let n=Object.create(vc),r=new iv;n.value=e;function i(){return cn(n),fv(n.value),n.value}return i[rn]=n,i.asReadonly=Ys.bind(i),i.set=e=>{n.equal(n.value,e)||(Mn(n,e),r.emit(e))},i.update=e=>{fv(n.value),i.set(e(n.value))},i.subscribe=r.subscribe.bind(r),i.destroyRef=r.destroyRef,i}function fv(e){if(e===_c)throw new pi(952,!1)}function pv(e,t){return dv(e,t)}function fne(e){return dv(_c,e)}var mv=(pv.required=fne,pv);function hv(e,t){return $m(t)}function pne(e,t){return eh(t)}var gv=(hv.required=pne,hv),mne=(()=>{class e{static __NG_ELEMENT_ID__=hne}return e})();function hne(e){return gne(Ho(),Bo(),(e&16)==16)}function gne(e,t,n){if(oo(e)&&!n){let n=bo(e.index,t);return new Kf(n,n)}if(e.type&175){let e=t[15];return new Kf(e,t)}return null}var _v=new Oi(``),_ne=new Oi(``);function vv(e){return!e.moduleRef}function vne(e){let t=vv(e)?e.r3Injector:e.moduleRef.injector,n=t.get(Ps);return n.run(()=>{vv(e)?e.r3Injector.resolveInjectorInitializers():e.moduleRef.resolveInjectorInitializers();let r=t.get(qs),i;if(n.runOutsideAngular(()=>{i=n.onError.subscribe({next:r})}),vv(e)){let n=()=>t.destroy(),r=e.platformInjector.get(_v);r.add(n),t.onDestroy(()=>{i.unsubscribe(),r.delete(n)})}else{let t=()=>e.moduleRef.destroy(),n=e.platformInjector.get(_v);n.add(t),e.moduleRef.onDestroy(()=>{Vh(e.allPlatformModules,e.moduleRef),i.unsubscribe(),n.delete(t)})}return bne(r,n,()=>{let n=t.get(Es),r=n.add(),i=t.get(yh);return i.runInitializers(),i.donePromise.then(()=>{if(Dg(t.get(rv,Eg)||`en-US`),!t.get(_ne,!0))return vv(e)?t.get(zh):(e.allPlatformModules.push(e.moduleRef),e.moduleRef);if(vv(e)){let n=t.get(zh);return e.rootComponent!==void 0&&n.bootstrap(e.rootComponent),n}return yne?.(e.moduleRef,e.allPlatformModules),e.moduleRef}).finally(()=>void n.remove(r))})})}var yne;function bne(e,t,n){try{let r=n();return rh(r)?r.catch(n=>{throw t.runOutsideAngular(()=>e(n)),n}):r}catch(n){throw t.runOutsideAngular(()=>e(n)),n}}var yv=null;function xne(e=[],t){return bs.create({name:t,providers:[{provide:La,useValue:`platform`},{provide:_v,useValue:new Set([()=>yv=null])},...e]})}function Sne(e=[]){if(yv)return yv;let t=xne(e);return yv=t,Lh(),Cne(t),t}function Cne(e){let t=e.get(Qs,null);eo(e,()=>{t?.forEach(e=>e())})}function wne(e){let{rootComponent:t,appProviders:n,platformProviders:r,platformRef:i}=e;Nc(bc.BootstrapApplicationStart);try{let e=i?.injector??Sne(r);return vne({r3Injector:new oh({providers:[one(),Js,...n||[]],parent:e,debugName:``,runEnvironmentInitializers:!1}).injector,platformInjector:e,rootComponent:t})}catch(e){return Promise.reject(e)}finally{Nc(bc.BootstrapApplicationEnd)}}function bv(e){return typeof e==`boolean`?e:e!=null&&e!==`false`}var xv=Symbol(`NOT_SET`),Sv=new Set,Tne={...Pn,kind:`afterRenderEffectPhase`,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,value:xv,cleanup:null,consumerMarkedDirty(){if(this.sequence.impl.executing){if(this.sequence.lastPhase===null||this.sequence.lastPhase(cn(r),r.value),r.signal[rn]=r,r.registerCleanupFn=e=>(r.cleanup??=new Set).add(e),this.nodes[e]=r,this.hooks[e]=e=>r.phaseFn(e)}}afterRun(){super.afterRun(),this.lastPhase=null}destroy(){if(this.onDestroyFns!==null)for(let e of this.onDestroyFns)e();super.destroy();for(let e of this.nodes)if(e)try{for(let t of e.cleanup??Sv)t()}finally{bn(e)}}};function Cv(e,t){let n=t?.injector??x(bs),r=n.get(rc),i=n.get(id),a=n.get(td,null,{optional:!0});i.impl??=n.get(od);let o=e;typeof o==`function`&&(o={mixedReadWrite:e});let s=n.get(tc,null,{optional:!0}),c=new Ene(i.impl,[o.earlyRead,o.write,o.mixedReadWrite,o.read],s?.view,r,n,a?.snapshot(null));return i.impl.register(c),c}var wv=null;function Tv(){return wv}function Dne(e){wv??=e}var One=class{},Ev=(function(e){return e[e.Format=0]=`Format`,e[e.Standalone=1]=`Standalone`,e})(Ev||{}),Dv=(function(e){return e[e.Narrow=0]=`Narrow`,e[e.Abbreviated=1]=`Abbreviated`,e[e.Wide=2]=`Wide`,e[e.Short=3]=`Short`,e})(Dv||{}),Ov=(function(e){return e[e.Short=0]=`Short`,e[e.Medium=1]=`Medium`,e[e.Long=2]=`Long`,e[e.Full=3]=`Full`,e})(Ov||{}),kv={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};function kne(e){return Sg(e)[wg.LocaleId]}function Ane(e,t,n){let r=Sg(e);return Fv(Fv([r[wg.DayPeriodsFormat],r[wg.DayPeriodsStandalone]],t),n)}function jne(e,t,n){let r=Sg(e);return Fv(Fv([r[wg.DaysFormat],r[wg.DaysStandalone]],t),n)}function Mne(e,t,n){let r=Sg(e);return Fv(Fv([r[wg.MonthsFormat],r[wg.MonthsStandalone]],t),n)}function Nne(e,t){let n=Sg(e)[wg.Eras];return Fv(n,t)}function Av(e,t){return Fv(Sg(e)[wg.DateFormat],t)}function jv(e,t){return Fv(Sg(e)[wg.TimeFormat],t)}function Mv(e,t){let n=Sg(e)[wg.DateTimeFormat];return Fv(n,t)}function Nv(e,t){let n=Sg(e),r=n[wg.NumberSymbols][t];if(r===void 0){if(t===kv.CurrencyDecimal)return n[wg.NumberSymbols][kv.Decimal];if(t===kv.CurrencyGroup)return n[wg.NumberSymbols][kv.Group]}return r}function Pv(e){if(!e[wg.ExtraData])throw new pi(2303,!1)}function Pne(e){let t=Sg(e);return Pv(t),(t[wg.ExtraData][2]||[]).map(e=>typeof e==`string`?Iv(e):[Iv(e[0]),Iv(e[1])])}function Fne(e,t,n){let r=Sg(e);return Pv(r),Fv(Fv([r[wg.ExtraData][0],r[wg.ExtraData][1]],t)||[],n)||[]}function Fv(e,t){for(let n=t;n>-1;n--)if(e[n]!==void 0)return e[n];throw new pi(2304,!1)}function Iv(e){let[t,n]=e.split(`:`);return{hours:+t,minutes:+n}}var Ine=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,Lv=Object.create(null),Lne=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,Rne=256;function zne(e,t,n,r){let i=Yne(e);Bne(t),t=zv(n,t)||t;let a=[],o;for(;t;)if(o=Lne.exec(t),o){a=a.concat(o.slice(1));let e=a.pop();if(!e)break;t=e}else{a.push(t);break}let s=i.getTimezoneOffset();r&&(s=Xv(r,s),i=Jne(i,r));let c=``;return a.forEach(e=>{let t=Kne(e);c+=t?t(i,n,s):e===`''`?`'`:e.replace(/(^'|'$)/g,``).replace(/''/g,`'`)}),c}function Bne(e){if(e.length>Rne)throw new pi(2300,!1)}function Rv(e,t,n){let r=new Date(0);return r.setFullYear(e,t,n),r.setHours(0,0,0),r}function zv(e,t){let n=kne(e);if(Lv[n]??=Object.create(null),Lv[n][t])return Lv[n][t];let r=``;switch(t){case`shortDate`:r=Av(e,Ov.Short);break;case`mediumDate`:r=Av(e,Ov.Medium);break;case`longDate`:r=Av(e,Ov.Long);break;case`fullDate`:r=Av(e,Ov.Full);break;case`shortTime`:r=jv(e,Ov.Short);break;case`mediumTime`:r=jv(e,Ov.Medium);break;case`longTime`:r=jv(e,Ov.Long);break;case`fullTime`:r=jv(e,Ov.Full);break;case`short`:let t=zv(e,`shortTime`),n=zv(e,`shortDate`);r=Bv(Mv(e,Ov.Short),[t,n]);break;case`medium`:let i=zv(e,`mediumTime`),a=zv(e,`mediumDate`);r=Bv(Mv(e,Ov.Medium),[i,a]);break;case`long`:let o=zv(e,`longTime`),s=zv(e,`longDate`);r=Bv(Mv(e,Ov.Long),[o,s]);break;case`full`:let c=zv(e,`fullTime`),l=zv(e,`fullDate`);r=Bv(Mv(e,Ov.Full),[c,l])}return r&&(Lv[n][t]=r),r}function Bv(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(e,n){return Object.hasOwn(t,n)?t[n]:e})),e}function Vv(e,t,n=`-`,r,i){let a=``;(e<0||i&&e<=0)&&(i?e=-e+1:(e=-e,a=n));let o=String(e);for(;o.length0||s>-n)&&(s+=n),e===3)s===0&&n===-12&&(s=12);else if(e===6)return Vne(s,t);let c=Nv(o,kv.MinusSign);return Vv(s,t,c,r,i)}}function Hne(e,t){switch(e){case 0:return t.getFullYear();case 1:return t.getMonth();case 2:return t.getDate();case 3:return t.getHours();case 4:return t.getMinutes();case 5:return t.getSeconds();case 6:return t.getMilliseconds();case 7:return t.getDay();default:throw new pi(2301,!1)}}function Uv(e,t,n=Ev.Format,r=!1){return function(i,a){return Une(i,a,e,t,n,r)}}function Une(e,t,n,r,i,a){switch(n){case 2:return Mne(t,i,r)[e.getMonth()];case 1:return jne(t,i,r)[e.getDay()];case 0:let n=e.getHours(),o=e.getMinutes();if(a){let e=Pne(t),a=Fne(t,i,r),s=e.findIndex(e=>{if(Array.isArray(e)){let[t,r]=e,i=n>=t.hours&&o>=t.minutes,a=n0?Math.floor(i/60):Math.ceil(i/60);switch(e){case 0:return(i>=0?`+`:``)+Vv(o,2,a)+Vv(Math.abs(i%60),2,a);case 1:return`GMT`+(i>=0?`+`:``)+Vv(o,1,a);case 2:return`GMT`+(i>=0?`+`:``)+Vv(o,2,a)+`:`+Vv(Math.abs(i%60),2,a);case 3:return r===0?`Z`:(i>=0?`+`:``)+Vv(o,2,a)+`:`+Vv(Math.abs(i%60),2,a);default:throw new pi(2310,!1)}}}var Wne=0,Gv=4;function Gne(e){let t=Rv(e,Wne,1).getDay();return Rv(e,0,1+(t<=Gv?Gv:11)-t)}function Kv(e){let t=e.getDay(),n=t===0?-3:Gv-t;return Rv(e.getFullYear(),e.getMonth(),e.getDate()+n)}function qv(e,t=!1){return function(n,r){let i;if(t){let e=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,t=n.getDate();i=1+Math.floor((t+e)/7)}else{let e=Kv(n),t=Gne(e.getFullYear()),r=e.getTime()-t.getTime();i=1+Math.round(r/6048e5)}return Vv(i,e,Nv(r,kv.MinusSign))}}function Jv(e,t=!1){return function(n,r){return Vv(Kv(n).getFullYear(),e,Nv(r,kv.MinusSign),t)}}var Yv=Object.create(null);function Kne(e){if(Yv[e])return Yv[e];let t;switch(e){case`G`:case`GG`:case`GGG`:t=Uv(3,Dv.Abbreviated);break;case`GGGG`:t=Uv(3,Dv.Wide);break;case`GGGGG`:t=Uv(3,Dv.Narrow);break;case`y`:t=Hv(0,1,0,!1,!0);break;case`yy`:t=Hv(0,2,0,!0,!0);break;case`yyy`:t=Hv(0,3,0,!1,!0);break;case`yyyy`:t=Hv(0,4,0,!1,!0);break;case`Y`:t=Jv(1);break;case`YY`:t=Jv(2,!0);break;case`YYY`:t=Jv(3);break;case`YYYY`:t=Jv(4);break;case`M`:case`L`:t=Hv(1,1,1);break;case`MM`:case`LL`:t=Hv(1,2,1);break;case`MMM`:t=Uv(2,Dv.Abbreviated);break;case`MMMM`:t=Uv(2,Dv.Wide);break;case`MMMMM`:t=Uv(2,Dv.Narrow);break;case`LLL`:t=Uv(2,Dv.Abbreviated,Ev.Standalone);break;case`LLLL`:t=Uv(2,Dv.Wide,Ev.Standalone);break;case`LLLLL`:t=Uv(2,Dv.Narrow,Ev.Standalone);break;case`w`:t=qv(1);break;case`ww`:t=qv(2);break;case`W`:t=qv(1,!0);break;case`d`:t=Hv(2,1);break;case`dd`:t=Hv(2,2);break;case`c`:case`cc`:t=Hv(7,1);break;case`ccc`:t=Uv(1,Dv.Abbreviated,Ev.Standalone);break;case`cccc`:t=Uv(1,Dv.Wide,Ev.Standalone);break;case`ccccc`:t=Uv(1,Dv.Narrow,Ev.Standalone);break;case`cccccc`:t=Uv(1,Dv.Short,Ev.Standalone);break;case`E`:case`EE`:case`EEE`:t=Uv(1,Dv.Abbreviated);break;case`EEEE`:t=Uv(1,Dv.Wide);break;case`EEEEE`:t=Uv(1,Dv.Narrow);break;case`EEEEEE`:t=Uv(1,Dv.Short);break;case`a`:case`aa`:case`aaa`:t=Uv(0,Dv.Abbreviated);break;case`aaaa`:t=Uv(0,Dv.Wide);break;case`aaaaa`:t=Uv(0,Dv.Narrow);break;case`b`:case`bb`:case`bbb`:t=Uv(0,Dv.Abbreviated,Ev.Standalone,!0);break;case`bbbb`:t=Uv(0,Dv.Wide,Ev.Standalone,!0);break;case`bbbbb`:t=Uv(0,Dv.Narrow,Ev.Standalone,!0);break;case`B`:case`BB`:case`BBB`:t=Uv(0,Dv.Abbreviated,Ev.Format,!0);break;case`BBBB`:t=Uv(0,Dv.Wide,Ev.Format,!0);break;case`BBBBB`:t=Uv(0,Dv.Narrow,Ev.Format,!0);break;case`h`:t=Hv(3,1,-12);break;case`hh`:t=Hv(3,2,-12);break;case`H`:t=Hv(3,1);break;case`HH`:t=Hv(3,2);break;case`m`:t=Hv(4,1);break;case`mm`:t=Hv(4,2);break;case`s`:t=Hv(5,1);break;case`ss`:t=Hv(5,2);break;case`S`:t=Hv(6,1);break;case`SS`:t=Hv(6,2);break;case`SSS`:t=Hv(6,3);break;case`Z`:case`ZZ`:case`ZZZ`:t=Wv(0);break;case`ZZZZZ`:t=Wv(3);break;case`O`:case`OO`:case`OOO`:case`z`:case`zz`:case`zzz`:t=Wv(1);break;case`OOOO`:case`ZZZZ`:case`zzzz`:t=Wv(2);break;default:return null}return Yv[e]=t,t}function Xv(e,t){e=e.replace(/:/g,``);let n=Date.parse(`Jan 01, 1970 00:00:00 `+e)/6e4;return isNaN(n)?t:n}function qne(e,t){return e=new Date(e.getTime()),e.setMinutes(e.getMinutes()+t),e}function Jne(e,t,n){let r=e.getTimezoneOffset();return qne(e,-1*(Xv(t,r)-r))}function Yne(e){if(Zv(e))return e;if(typeof e==`number`&&!isNaN(e))return new Date(e);if(typeof e==`string`){if(e=e.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(e)){let[t,n=1,r=1]=e.split(`-`).map(e=>+e);return Rv(t,n-1,r)}let t=parseFloat(e);if(!isNaN(e-t))return new Date(t);let n;if(n=e.match(Ine))return Xne(n)}let t=new Date(e);if(!Zv(t))throw new pi(2311,!1);return t}function Xne(e){let t=new Date(0),n=0,r=0,i=e[8]?t.setUTCFullYear:t.setFullYear,a=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=Number(e[9]+e[10]),r=Number(e[9]+e[11])),i.call(t,Number(e[1]),Number(e[2])-1,Number(e[3]));let o=Number(e[4]||0)-n,s=Number(e[5]||0)-r,c=Number(e[6]||0),l=Math.floor(parseFloat(`0.`+(e[7]||0))*1e3);return a.call(t,o,s,c,l),t}function Zv(e){return e instanceof Date&&!isNaN(e.valueOf())}var Qv=(()=>{class e{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;injector=x(bs);constructor(e){this._viewContainerRef=e}ngOnChanges(e){if(this._shouldRecreateView(e)){let e=this._viewContainerRef;if(this._viewRef&&e.remove(e.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let t=this._createContextForwardProxy();this._viewRef=e.createEmbeddedView(this.ngTemplateOutlet,t,{injector:this._getInjector()})}}_getInjector(){return this.ngTemplateOutletInjector===`outlet`?this.injector:this.ngTemplateOutletInjector??void 0}_shouldRecreateView(e){return!!e.ngTemplateOutlet||!!e.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(e,t,n)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,t,n):!1,get:(e,t,n)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,t,n)}})}static ɵfac=function(t){return new(t||e)(Up(Cm))};static ɵdir=fh({type:e,selectors:[[``,`ngTemplateOutlet`,``]],inputs:{ngTemplateOutletContext:`ngTemplateOutletContext`,ngTemplateOutlet:`ngTemplateOutlet`,ngTemplateOutletInjector:`ngTemplateOutletInjector`},features:[wc]})}return e})();function Zne(e,t){return new pi(2100,!1)}var Qne=`mediumDate`,$ne=new Oi(``),ere=new Oi(``),$v=(()=>{class e{locale;defaultTimezone;defaultOptions;constructor(e,t,n){this.locale=e,this.defaultTimezone=t,this.defaultOptions=n}transform(t,n,r,i){if(t==null||t===``||t!==t)return null;try{let e=n??this.defaultOptions?.dateFormat??Qne,a=r??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return zne(t,e,i||this.locale,a)}catch(t){throw Zne(e,t.message)}}static ɵfac=function(t){return new(t||e)(Up(rv,16),Up($ne,24),Up(ere,24))};static ɵpipe=ph({name:`date`,type:e,pure:!0})}return e})(),ey=(()=>{class e{transform(e){return JSON.stringify(e,null,2)}static ɵfac=function(t){return new(t||e)};static ɵpipe=ph({name:`json`,type:e,pure:!1})}return e})();function tre(e,t){t=encodeURIComponent(t);for(let n of e.split(`;`)){let e=n.indexOf(`=`),[r,i]=e==-1?[n,``]:[n.slice(0,e),n.slice(e+1)];if(r.trim()!==t)continue;let a=i;try{a=decodeURIComponent(i)}catch{}return a.length>1&&a[0]===`"`&&a[a.length-1]===`"`&&(a=a.slice(1,-1)),a}return null}var nre=`browser`,ty=class{_doc;constructor(e){this._doc=e}manager},ny=(()=>{class e extends ty{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,n,r){return e.addEventListener(t,n,r),()=>this.removeEventListener(e,t,n,r)}removeEventListener(e,t,n,r){return e.removeEventListener(t,n,r)}static ɵfac=function(t){return new(t||e)(ra(xs))};static ɵprov=xi({token:e,factory:e.ɵfac})}return e})(),ry=new Oi(``),iy=(()=>{class e{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,t){this._zone=t,e.forEach(e=>{e.manager=this});let n=e.filter(e=>!(e instanceof ny));this._plugins=n.slice().reverse();let r=e.find(e=>e instanceof ny);r&&this._plugins.push(r)}addEventListener(e,t,n,r){return this._findPluginFor(t).addEventListener(e,t,n,r)}getZone(){return this._zone}_findPluginFor(e){let t=this._eventNameToPlugin.get(e);if(t)return t;if(t=this._plugins.find(t=>t.supports(e)),!t)throw new pi(-5101,!1);return this._eventNameToPlugin.set(e,t),t}static ɵfac=function(t){return new(t||e)(ra(ry),ra(Ps))};static ɵprov=xi({token:e,factory:e.ɵfac})}return e})(),ay=`ng-app-id`;function oy(e){for(let t of e)t.remove()}function sy(e,t){let n=t.createElement(`style`);return n.textContent=e,n}function rre(e,t,n,r){let i=e.head?.querySelectorAll(`style[${ay}="${t}"],link[${ay}="${t}"]`);if(!i||i.length===0)return!1;for(let e of i)e.removeAttribute(ay),e instanceof HTMLLinkElement?r.set(e.href.slice(e.href.lastIndexOf(`/`)+1),{usage:0,elements:[e]}):e.textContent&&n.set(e.textContent,{usage:0,elements:[e]});return!0}function cy(e,t){let n=t.createElement(`link`);return n.setAttribute(`rel`,`stylesheet`),n.setAttribute(`href`,e),n}var ly=(()=>{class e{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(e,t,n,r={}){this.doc=e,this.appId=t,this.nonce=n,rre(e,t,this.inline,this.external)&&this.hosts.add(e.head)}addStyles(e,t){for(let t of e)this.addUsage(t,this.inline,sy);t?.forEach(e=>this.addUsage(e,this.external,cy))}removeStyles(e,t){for(let t of e)this.removeUsage(t,this.inline);t?.forEach(e=>this.removeUsage(e,this.external))}addUsage(e,t,n){let r=t.get(e);r?r.usage++:t.set(e,{usage:1,elements:[...this.hosts].map(t=>this.addElement(t,n(e,this.doc)))})}removeUsage(e,t){let n=t.get(e);n&&(n.usage--,n.usage<=0&&(oy(n.elements),t.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])oy(e);this.hosts.clear()}addHost(e){if(!this.hosts.has(e)){this.hosts.add(e);for(let[t,{elements:n}]of this.inline)n.push(this.addElement(e,sy(t,this.doc)));for(let[t,{elements:n}]of this.external)n.push(this.addElement(e,cy(t,this.doc)))}}removeHost(e){this.hosts.delete(e);for(let t of[...this.inline.values(),...this.external.values()]){let n=[];for(let r of t.elements)r.parentNode===e?r.remove():n.push(r);t.elements=n}}addElement(e,t){return this.nonce&&t.setAttribute(`nonce`,this.nonce),e.appendChild(t)}static ɵfac=function(t){return new(t||e)(ra(xs),ra(Xs),ra(ec,8),ra($s))};static ɵprov=xi({token:e,factory:e.ɵfac})}return e})(),uy={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`},dy=/%COMP%/g,fy=`%COMP%`,ire=`_nghost-${fy}`,are=`_ngcontent-${fy}`,ore=!0,sre=new Oi(``,{factory:()=>ore}),cre=new Oi(``);function lre(e){return are.replace(dy,e)}function ure(e){return ire.replace(dy,e)}function py(e,t){return t.map(t=>t.replace(dy,e))}var my=(()=>{class e{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;cssVarNamespace;constructor(e,t,n,r,i,a,o=null,s=null,c=null){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.removeStylesOnCompDestroy=r,this.doc=i,this.ngZone=a,this.nonce=o,this.tracingService=s,this.cssVarNamespace=c??``,this.defaultRenderer=new hy(e,i,a,this.tracingService,this.cssVarNamespace)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;let n=this.getOrCreateRenderer(e,t);return n instanceof yy?n.applyToHost(e):n instanceof vy&&n.applyStyles(),n}getOrCreateRenderer(e,t){let n=this.rendererByCompId,r=n.get(t.id);if(!r){let i=this.doc,a=this.ngZone,o=this.eventManager,s=this.sharedStylesHost,c=this.removeStylesOnCompDestroy,l=this.tracingService;switch(t.encapsulation){case su.Emulated:r=new yy(o,s,t,this.appId,c,i,a,l,this.cssVarNamespace);break;case su.ShadowDom:return new _y(o,e,t,i,a,this.nonce,l,this.cssVarNamespace,s);case su.ExperimentalIsolatedShadowDom:return new _y(o,e,t,i,a,this.nonce,l,this.cssVarNamespace);default:r=new vy(o,s,t,c,i,a,l,this.cssVarNamespace)}n.set(t.id,r)}return r}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static ɵfac=function(t){return new(t||e)(ra(iy),ra(Vp),ra(Xs),ra(sre),ra(xs),ra(Ps),ra(ec),ra(td,8),ra(cre,8))};static ɵprov=xi({token:e,factory:e.ɵfac})}return e})(),hy=class{eventManager;doc;ngZone;tracingService;cssVarNamespace;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,t,n,r,i=``){this.eventManager=e,this.doc=t,this.ngZone=n,this.tracingService=r,this.cssVarNamespace=i}destroy(){}destroyNode=null;createElement(e,t){return t?this.doc.createElementNS(uy[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(gy(e)?e.content:e).appendChild(t)}insertBefore(e,t,n){if(e){let r=gy(e)?e.content:e;if(n!=null&&n.parentNode!==r)throw new pi(-5106,!1);r.insertBefore(t,n)}}removeChild(e,t){t.remove()}selectRootElement(e,t){let n=typeof e==`string`?this.doc.querySelector(e):e;if(!n)throw new pi(-5104,!1);return t||(n.textContent=``),n}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,n,r){if(r){t=r+`:`+t;let i=uy[r];i?e.setAttributeNS(i,t,n):e.setAttribute(t,n)}else e.setAttribute(t,n)}removeAttribute(e,t,n){if(n){let r=uy[n];r?e.removeAttributeNS(r,t):e.removeAttribute(`${n}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,n,r){let i=t.startsWith(`--`);i&&(t=t.replace(`%NS%`,this.cssVarNamespace)),i||r&(Iu.DashCase|Iu.Important)?e.style.setProperty(t,n,r&Iu.Important?`important`:``):e.style[t]=n}removeStyle(e,t,n){let r=t.startsWith(`--`);r&&(t=t.replace(`%NS%`,this.cssVarNamespace)),r||n&Iu.DashCase?e.style.removeProperty(t):e.style[t]=``}setProperty(e,t,n){e!=null&&(e[t]=n)}setValue(e,t){e.nodeValue=t}listen(e,t,n,r){if(typeof e==`string`&&(e=Tv().getGlobalEventTarget(this.doc,e),!e))throw new pi(-5102,!1);let i=this.decoratePreventDefault(n);return this.tracingService?.wrapEventListener&&(i=this.tracingService.wrapEventListener(e,t,i)),this.eventManager.addEventListener(e,t,i,r)}decoratePreventDefault(e){return t=>{if(t===`__ngUnwrap__`)return e;e(t)===!1&&t.preventDefault()}}};function gy(e){return e.tagName===`TEMPLATE`&&e.content!==void 0}var _y=class extends hy{hostEl;sharedStylesHost;shadowRoot;constructor(e,t,n,r,i,a,o,s,c){super(e,r,i,o,s),this.hostEl=t,this.sharedStylesHost=c,this.shadowRoot=t.attachShadow({mode:`open`}),this.sharedStylesHost&&this.sharedStylesHost.addHost(this.shadowRoot);let l=n.styles;l=py(n.id,l).map(e=>e.replace(/%NS%/g,s));for(let e of l){let t=document.createElement(`style`);a&&t.setAttribute(`nonce`,a),t.textContent=e,this.shadowRoot.appendChild(t)}let u=n.getExternalStyles?.();if(u)for(let e of u){let t=cy(e,r);a&&t.setAttribute(`nonce`,a),this.shadowRoot.appendChild(t)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,n){return super.insertBefore(this.nodeOrShadowRoot(e),t,n)}removeChild(e,t){return super.removeChild(null,t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost&&this.sharedStylesHost.removeHost(this.shadowRoot)}},vy=class extends hy{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,t,n,r,i,a,o,s,c){super(e,i,a,o,s),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=r;let l=n.styles,u=c?py(c,l):l;this.styles=u.map(e=>e.replace(/%NS%/g,s)),this.styleUrls=n.getExternalStyles?.(c)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&Uu.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},yy=class extends vy{contentAttr;hostAttr;constructor(e,t,n,r,i,a,o,s,c){let l=r+`-`+n.id;super(e,t,n,i,a,o,s,c,l),this.contentAttr=lre(l),this.hostAttr=ure(l)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,``)}createElement(e,t){let n=super.createElement(e,t);return super.setAttribute(n,this.contentAttr,``),n}},dre=class e extends One{supportsDOMEvents=!0;static makeCurrent(){Dne(new e)}onAndCancel(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.remove()}createElement(e,t){return t||=this.getDefaultDocument(),t.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument(`fakeTitle`)}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return t===`window`?window:t===`document`?e:t===`body`?e.body:null}getBaseHref(e){let t=fre();return t==null?null:pre(t)}resetBaseElement(){by=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return tre(document.cookie,e)}},by=null;function fre(){return by||=document.head.querySelector(`base`),by?by.getAttribute(`href`):null}function pre(e){return new URL(e,document.baseURI).pathname}var xy=[`alt`,`control`,`meta`,`shift`],mre={"\b":`Backspace`," ":`Tab`,"":`Delete`,"\x1B":`Escape`,Del:`Delete`,Esc:`Escape`,Left:`ArrowLeft`,Right:`ArrowRight`,Up:`ArrowUp`,Down:`ArrowDown`,Menu:`ContextMenu`,Scroll:`ScrollLock`,Win:`OS`},hre={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey},gre=(()=>{class e extends ty{constructor(e){super(e)}supports(t){return e.parseEventName(t)!=null}addEventListener(t,n,r,i){let a=e.parseEventName(n),o=e.eventCallback(a.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Tv().onAndCancel(t,a.domEventName,o,i))}static parseEventName(t){let n=t.toLowerCase().split(`.`),r=n.shift();if(n.length===0||r!==`keydown`&&r!==`keyup`)return null;let i=e._normalizeKey(n.pop()),a=``,o=n.indexOf(`code`);if(o>-1&&(n.splice(o,1),a=`code.`),xy.forEach(e=>{let t=n.indexOf(e);t>-1&&(n.splice(t,1),a+=e+`.`)}),a+=i,n.length!=0||i.length===0)return null;let s={};return s.domEventName=r,s.fullKey=a,s}static matchEventFullKeyCode(e,t){let n=mre[e.key]||e.key,r=``;return t.indexOf(`code.`)>-1&&(n=e.code,r=`code.`),n==null||!n?!1:(n=n.toLowerCase(),n===` `?n=`space`:n===`.`&&(n=`dot`),xy.forEach(t=>{if(t!==n){let n=hre[t];n(e)&&(r+=t+`.`)}}),r+=n,r===t)}static eventCallback(t,n,r){return i=>{e.matchEventFullKeyCode(i,t)&&r.runGuarded(()=>n(i))}}static _normalizeKey(e){return e===`esc`?`escape`:e}static ɵfac=function(t){return new(t||e)(ra(xs))};static ɵprov=xi({token:e,factory:e.ɵfac})}return e})();async function _re(e,t,n){return wne({rootComponent:e,...vre(t,n)})}function vre(e,t){return{platformRef:t?.platformRef,appProviders:[...Cre,...e?.providers??[]],platformProviders:Sre}}function yre(){dre.makeCurrent()}function bre(){return new Ks}function xre(){return Yl(document),document}var Sre=[{provide:$s,useValue:nre},{provide:Qs,useValue:yre,multi:!0},{provide:xs,useFactory:xre}],Cre=[{provide:La,useValue:`root`},{provide:Ks,useFactory:bre},{provide:ry,useClass:ny,multi:!0},{provide:ry,useClass:gre,multi:!0},my,{provide:Vp,useClass:ly},{provide:ly,useExisting:Vp},iy,{provide:sp,useExisting:my},[]];function Sy(e,t){let n=`\x1B[${e}m`,r=`\x1B[${t}m`;return((e,...t)=>{if(Array.isArray(e)&&`raw`in e){let i=e,a=``;for(let e=0;e{let r=new Ere({code:i,why:Cy(a.why,e),fix:Cy(a.fix,e),docs:o,cause:e.cause,sources:e.sources,data:Cy(a.data,e)},s);for(let e of t)e(r,n);return r};n[i]=s}return n}function kre(e){return t=>{let n=`${e.bold(e.red(`[${t.name}]`))} ${t.message}`,r=[];return t.fix&&r.push(`${e.dim(`fix:`)} ${t.fix}`),t.sources?.length&&r.push(`${e.dim(`sources:`)} ${t.sources.join(`, `)}`),t.docs&&r.push(`${e.dim(`see:`)} ${e.cyan(t.docs)}`),r.length===0?n:[n,...r.map((t,n)=>`${e.dim(n{e=n,t=r}),resolve:e,reject:t}}var Ey=Math.random.bind(Math),Dy=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function Oy(e=21){let t=``,n=e;for(;n--;)t+=Dy[Ey()*64|0];return t}var ky=6e4,Ay=e=>e,jy=Ay,{clearTimeout:My,setTimeout:Ny}=globalThis;function Py(e,t){let{post:n,on:r,off:i=()=>{},eventNames:a=[],serialize:o=Ay,deserialize:s=jy,resolver:c,bind:l=`rpc`,timeout:u=ky,proxify:d=!0}=t,f=!1,p=new Map,m,ee;async function h(e,r,i,a){if(f)throw Error(`[birpc] rpc is closed, cannot call "${e}"`);let s={m:e,a:r,t:`q`};a&&(s.o=!0);let c=async e=>n(o(e));if(i){await c(s);return}if(m)try{await m}finally{m=void 0}let{promise:l,resolve:d,reject:h}=Ty(),g=Oy();s.i=g;let te;async function ne(n=s){return u>=0&&(te=Ny(()=>{try{if(t.onTimeoutError?.call(ee,e,r)!==!0)throw Error(`[birpc] timeout on calling "${e}"`)}catch(e){h(e)}p.delete(g)},u),typeof te==`object`&&(te=te.unref?.())),p.set(g,{resolve:d,reject:h,timeoutId:te,method:e}),await c(n),l}try{t.onRequest?await t.onRequest.call(ee,s,ne,d):await ne()}catch(e){if(t.onGeneralError?.call(ee,e)!==!0)throw e;return}finally{My(te),p.delete(g)}return l}let g={$call:(e,...t)=>h(e,t,!1),$callOptional:(e,...t)=>h(e,t,!1,!0),$callEvent:(e,...t)=>h(e,t,!0),$callRaw:e=>h(e.method,e.args,e.event,e.optional),$rejectPendingCalls:ne,get $closed(){return f},get $meta(){return t.meta},$close:te,$functions:e};ee=d?new Proxy({},{get(t,n){if(Object.hasOwn(g,n))return g[n];if(n===`then`&&!a.includes(`then`)&&!(`then`in e))return;let r=(...e)=>h(n,e,!0);if(a.includes(n))return r.asEvent=r,r;let i=(...e)=>h(n,e,!1);return i.asEvent=r,i}}):g;function te(e){f=!0,p.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),p.clear(),i(re)}function ne(e){let t=Array.from(p.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return p.clear(),t}async function re(r,...i){let a;try{a=s(r)}catch(e){if(t.onGeneralError?.call(ee,e)!==!0)throw e;return}if(a.t===`q`){let{m:r,a:s,o:u}=a,d,f,p=await(c?c.call(ee,r,e[r]):e[r]);if(u&&(p||=()=>void 0),!p)f=Error(`[birpc] function "${r}" not found`);else try{d=await p.apply(l===`rpc`?ee:e,s)}catch(e){f=e}if(a.i){if(f&&t.onFunctionError&&t.onFunctionError.call(ee,f,r,s)===!0)return;if(!f)try{await n(o({t:`s`,i:a.i,r:d}),...i);return}catch(e){if(f=e,t.onGeneralError?.call(ee,e,r,s)!==!0)throw e}try{await n(o({t:`s`,i:a.i,e:f}),...i)}catch(e){if(t.onGeneralError?.call(ee,e,r,s)!==!0)throw e}}}else{let{i:e,r:t,e:n}=a,r=p.get(e);r&&(My(r.timeoutId),n?r.reject(n):r.resolve(t)),p.delete(e)}}return m=r(re),ee}function Fy(e,t){return t.safety?t.safety:e===`static`||e===`query`||e==null?`read`:`action`}var Iy=Object.freeze({type:`object`,additionalProperties:!0});function Ly(e){let t=e[`~standard`];if(t.jsonSchema)try{return t.jsonSchema.input({target:`draft-2020-12`})}catch{return Iy}return Iy}function Ry(e){if(!e||e.length===0)return{type:`object`,properties:{}};let t={},n=[];for(let r=0;rn[`arg${t}`]);if(`arg0`in n){let e=[];for(;`arg${e.length}`in n;)e.push(n[`arg${e.length}`]);return e}return Object.keys(n).length===0?[]:void 0}function By(e,t){return zy(e,t)??[e]}function Vy(e){return typeof e==`string`?`'${e}'`:new Gy().serialize(e)}var Hy=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Uy=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Hy.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Wy(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;ia?-1:1)}return e.length===t.length?r:e.lengththis.compare(e[0],t[0])),r=`${e}{`;for(let e=0;ethis.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e})(),Ky=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],qy=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Jy=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,Yy=[],Xy=class{_data=new Zy;_hash=new Zy([...Ky]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);let t=this._nDataBytes*8,n=this._data.sigBytes*8;return this._data.words[n>>>5]|=128<<24-n%32,this._data.words[(n+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(n+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7];for(let n=0;n<64;n++){if(n<16)Yy[n]=e[t+n]|0;else{let e=Yy[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=Yy[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;Yy[n]=t+Yy[n-7]+i+Yy[n-16]}let d=s&c^~s&l,f=r&i^r&a^i&a,p=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),ee=u+m+d+qy[n]+Yy[n],h=p+f;u=l,l=c,c=s,s=o+ee|0,o=a,a=i,i=r,r=ee+h|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+u|0}_append(e){typeof e==`string`&&(e=Zy.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let t,n=this._data.sigBytes/64;n=e?Math.ceil(n):Math.max((n|0)-this._minBufferSize,0);let r=n*16,i=Math.min(r*4,this._data.sigBytes);if(r){for(let e=0;e>>2]|=(n.charCodeAt(e)&255)<<24-e%4*8;return new e(i,r)}toBase64(){let e=[];for(let t=0;t>>2]>>>24-t%4*8&255,r=this.words[t+1>>>2]>>>24-(t+1)%4*8&255,i=this.words[t+2>>>2]>>>24-(t+2)%4*8&255,a=n<<16|r<<8|i;for(let n=0;n<4&&t*8+n*6>>6*(3-n)&63))}return e.join(``)}concat(e){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let t=0;t>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=n<<24-(this.sigBytes+t)%4*8}else for(let t=0;t>>2]=e.words[t>>>2];this.sigBytes+=e.sigBytes}};function Qy(e){return new Xy().finalize(e).toBase64()}function $y(e){return Qy(Vy(e))}function eb(e){return $y(e)}function tb(){let e={};function t(t,...n){let r=e[t]||[];for(let e=0,t=r.length;e{e[t]=e[t]?.filter(e=>n!==e)}}function i(e,t){let n=r(e,((...e)=>(n(),t(...e))));return n}return{_listeners:e,emit:t,emitOnce:n,on:r,once:i}}var nb=/^[\w+.-]{2,}:\/\//;function rb(e){return e.endsWith(`/`)?e:`${e}/`}function ib(e){return(e.endsWith(`/`)?e.slice(0,-1):e)||`/`}function ab(e,...t){let n=e;for(let e of t)e&&e!==`/`&&(n=n?rb(n)+e.replace(/^\.?\//,``):e);return n}function ob(e,t){if(!t||t===`/`||nb.test(e))return e;let n=ib(t);return e.startsWith(n)?e:ab(n,e)}function sb(e,t){let n=e.match(nb);return t+(n?e.slice(n[0].length):e)}var cb=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function lb(e=21){let t=``,n=e;for(;n--;)t+=cb[Math.random()*64|0];return t}var ub=Symbol.for(`immer-nothing`),db=Symbol.for(`immer-draftable`),fb=Symbol.for(`immer-state`),pb=[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},`This object has been frozen and should not be mutated`,function(e){return`Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? `+e},`An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.`,`Immer forbids circular references`,"The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},`Object.defineProperty() cannot be used on an Immer draft`,`Object.setPrototypeOf() cannot be used on an Immer draft`,`Immer only supports deleting array indices`,`Immer only supports setting array indices and the 'length' property`,function(e){return`'original' expects a draft, got: ${e}`}];function mb(e,...t){{let n=pb[e],r=Rb(n)?n.apply(null,t):n;throw Error(`[Immer] ${r}`)}}var hb=Object,gb=hb.getPrototypeOf,_b=`constructor`,vb=`prototype`,yb=`configurable`,bb=`enumerable`,xb=`writable`,Sb=`value`,Cb=e=>!!e&&!!e[fb];function wb(e){return e?Db(e)||Pb(e)||!!e[db]||!!e[_b]?.[db]||Fb(e)||Ib(e):!1}var Tb=hb[vb][_b].toString(),Eb=new WeakMap;function Db(e){if(!e||!Lb(e))return!1;let t=gb(e);if(t===null||t===hb[vb])return!0;let n=hb.hasOwnProperty.call(t,_b)&&t[_b];if(n===Object)return!0;if(!Rb(n))return!1;let r=Eb.get(n);return r===void 0&&(r=Function.toString.call(n),Eb.set(n,r)),r===Tb}function Ob(e,t,n=!0){kb(e)===0?(n?Reflect.ownKeys(e):hb.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function kb(e){let t=e[fb];return t?t.type_:Pb(e)?1:Fb(e)?2:Ib(e)?3:0}var Ab=(e,t,n=kb(e))=>n===2?e.has(t):hb[vb].hasOwnProperty.call(e,t),jb=(e,t,n=kb(e))=>n===2?e.get(t):e[t],Mb=(e,t,n,r=kb(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Nb(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Pb=Array.isArray,Fb=e=>e instanceof Map,Ib=e=>e instanceof Set,Lb=e=>typeof e==`object`,Rb=e=>typeof e==`function`,zb=e=>typeof e==`boolean`;function Bb(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Vb=e=>Lb(e)?e?.[fb]:null,Hb=e=>e.copy_||e.base_,Ub=e=>e.modified_?e.copy_:e.base_;function Wb(e,t){if(Fb(e))return new Map(e);if(Ib(e))return new Set(e);if(Pb(e))return Array[vb].slice.call(e);let n=Db(e);if(t===!0||t===`class_only`&&!n){let t=hb.getOwnPropertyDescriptors(e);delete t[fb];let n=Reflect.ownKeys(t);for(let r=0;r1&&hb.defineProperties(e,{set:qb,add:qb,clear:qb,delete:qb}),hb.freeze(e),t&&Ob(e,(e,t)=>{Gb(t,!0)},!1),e)}function Kb(){mb(2)}var qb={[Sb]:Kb};function Jb(e){return e===null||!Lb(e)||hb.isFrozen(e)}var Yb=`MapSet`,Xb=`Patches`,Zb=`ArrayMethods`,Qb={};function $b(e){let t=Qb[e];return t||mb(0,e),t}var ex=e=>!!Qb[e];function tx(e,t){Qb[e]||(Qb[e]=t)}var nx,rx=()=>nx,ix=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ex(Yb)?$b(Yb):void 0,arrayMethodsPlugin_:ex(Zb)?$b(Zb):void 0});function ax(e,t){t&&(e.patchPlugin_=$b(Xb),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ox(e){sx(e),e.drafts_.forEach(lx),e.drafts_=null}function sx(e){e===nx&&(nx=e.parent_)}var cx=e=>nx=ix(nx,e);function lx(e){let t=e[fb];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ux(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[fb].modified_&&(ox(t),mb(4)),wb(e)&&(e=dx(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[fb].base_,e,t)}else e=dx(t,n);return fx(t,e,!0),ox(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===ub?void 0:e}function dx(e,t){if(Jb(t))return t;let n=t[fb];if(!n)return bx(t,e.handledSet_,e);if(!mx(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);vx(n,e)}return n.copy_}function fx(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Gb(t,n)}function px(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var mx=(e,t)=>e.scope_===t,hx=[];function gx(e,t,n,r){let i=Hb(e),a=e.type_;if(r!==void 0&&jb(i,r,a)===t){Mb(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Ob(i,(e,n)=>{if(Cb(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??hx;for(let e of o)Mb(i,e,n,a)}function _x(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!mx(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Ub(i);gx(e,i.draft_??i,a,n),vx(i,r)})}function vx(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}px(e)}}function yx(e,t,n){let{scope_:r}=e;if(Cb(n)){let i=n[fb];mx(i,r)&&i.callbacks_.push(function(){kx(e),gx(e,n,Ub(i),t)})}else wb(n)&&e.callbacks_.push(function(){let i=Hb(e);e.type_===3?i.has(n)&&bx(n,r.handledSet_,r):jb(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&bx(jb(e.copy_,t,e.type_),r.handledSet_,r)})}function bx(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Cb(e)||t.has(e)||!wb(e)||Jb(e)?e:(t.add(e),Ob(e,(r,i)=>{if(Cb(i)){let t=i[fb];mx(t,n)&&(Mb(e,r,Ub(t),e.type_),px(t))}else wb(i)&&bx(i,t,n)}),e)}function xx(e,t){let n=Pb(e),r={type_:+!!n,scope_:t?t.scope_:rx(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=Sx;n&&(i=[r],a=Cx);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var Sx={get(e,t){if(t===fb)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=Hb(e);if(!Ab(i,t,e.type_))return Ex(e,i,t);let a=i[t];if(e.finalized_||!wb(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Bb(t))return a;if(a===wx(e.base_,t)||Tx(e,t,a)){kx(e);let n=e.type_===1?+t:t,r=jx(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in Hb(e)},ownKeys(e){return Reflect.ownKeys(Hb(e))},set(e,t,n){let r=Dx(Hb(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=wx(Hb(e),t),i=r?.[fb];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(Nb(n,r)&&(n!==void 0||Ab(e.base_,t,e.type_)))return!0;kx(e),Ox(e)}return e.copy_[t]===n&&(n!==void 0||Ab(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),yx(e,t,n),!0)},deleteProperty(e,t){return kx(e),wx(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Ox(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Hb(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[xb]:!0,[yb]:e.type_!==1||t!==`length`,[bb]:r[bb],[Sb]:n[t]}},defineProperty(){mb(11)},getPrototypeOf(e){return gb(e.base_)},setPrototypeOf(){mb(12)}},Cx={};for(let e in Sx){let t=Sx[e];Cx[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}Cx.deleteProperty=function(e,t){return isNaN(parseInt(t))&&mb(13),Cx.set.call(this,e,t,void 0)},Cx.set=function(e,t,n){return t!==`length`&&isNaN(parseInt(t))&&mb(14),Sx.set.call(this,e[0],t,n,e[0])};function wx(e,t){let n=e[fb];return(n?Hb(n):e)[t]}function Tx(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!wb(n)||n[fb]?!1:e.baseRefs_.has(n)}function Ex(e,t,n){let r=Dx(t,n);return r?Sb in r?r[Sb]:r.get?.call(e.draft_):void 0}function Dx(e,t){if(!(t in e))return;let n=gb(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=gb(n)}}function Ox(e){e.modified_||(e.modified_=!0,e.parent_&&Ox(e.parent_))}function kx(e){e.copy_||=(e.assigned_=new Map,Wb(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ax=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Rb(e)&&!Rb(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Rb(t)||mb(6),n!==void 0&&!Rb(n)&&mb(7);let r;if(wb(e)){let i=cx(this),a=jx(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?ox(i):sx(i)}return ax(i,n),ux(r,i)}if(!e||!Lb(e)){if(r=t(e),r===void 0&&(r=e),r===ub&&(r=void 0),this.autoFreeze_&&Gb(r,!0),n){let t=[],i=[];$b(Xb).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}mb(1,e)},this.produceWithPatches=(e,t)=>{if(Rb(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},zb(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),zb(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),zb(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){wb(e)||mb(8),Cb(e)&&(e=Mx(e));let t=cx(this),n=jx(t,e,void 0);return n[fb].isManual_=!0,sx(t),n}finishDraft(e,t){let n=e&&e[fb];(!n||!n.isManual_)&&mb(9);let{scope_:r}=n;return ax(r,t),ux(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=$b(Xb).applyPatches_;return Cb(e)?r(e,t):this.produce(e,e=>r(e,t))}};function jx(e,t,n,r){let[i,a]=Fb(t)?$b(Yb).proxyMap_(t,n):Ib(t)?$b(Yb).proxySet_(t,n):xx(t,n);return(n?.scope_??rx()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?_x(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function Mx(e){return Cb(e)||mb(10,e),Nx(e)}function Nx(e){if(!wb(e)||Jb(e))return e;let t=e[fb],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Wb(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Wb(e,!0);let i=n;return Ib(n)&&(n=new Set),Ob(i,(e,t)=>{Mb(n,e,Nx(t))},r),t&&(t.finalized_=!1),n}function Px(){pb.push(`Sets cannot have "replace" patches.`,function(e){return`Unsupported patch operation: `+e},function(e){return`Cannot apply patch, path doesn't resolve: `+e},`Patching reserved attributes like __proto__, prototype and constructor is not allowed`);function e(n,r=[]){if(n.key_!==void 0){let e=n.parent_.copy_??n.parent_.base_,t=Vb(jb(e,n.key_)),i=jb(e,n.key_);if(i===void 0||i!==n.draft_&&i!==n.base_&&i!==n.copy_||t!=null&&t.base_!==n.base_)return null;let a=n.parent_.type_===3,o;if(a){let e=n.parent_;o=Array.from(e.drafts_.keys()).indexOf(n.key_)}else o=n.key_;if(!(a&&e.size>o||Ab(e,o))||n.parent_.type_===1&&n.parent_.allIndicesReassigned_)return null;r.push(o)}if(n.parent_)return e(n.parent_,r);r.reverse();try{t(n.copy_,r)}catch{return null}return r}function t(e,t){let n=e;for(let e=0;e{let u=jb(o,e,c),f=jb(s,e,c),p=l?Ab(o,e)?n:`add`:r;if(u===f&&p===n)return;let m=t.concat(e);i.push(p===r?{op:p,path:m}:{op:p,path:m,value:d(f)}),a.push(p===`add`?{op:r,path:m}:p===r?{op:`add`,path:m,value:d(u)}:{op:n,path:m,value:d(u)})})}function s(e,t,n,i){let{base_:a,copy_:o}=e,s=0;a.forEach(e=>{if(!o.has(e)){let a=t.concat([s]);n.push({op:r,path:a,value:e}),i.unshift({op:`add`,path:a,value:e})}s++}),s=0,o.forEach(e=>{if(!a.has(e)){let a=t.concat([s]);n.push({op:`add`,path:a,value:e}),i.unshift({op:r,path:a,value:e})}s++})}function c(e,t,r){let{patches_:i,inversePatches_:a}=r;i.push({op:n,path:[],value:t===ub?void 0:t}),a.push({op:n,path:[],value:e})}function l(e,t){return t.forEach(t=>{let{path:i,op:a}=t,o=e;for(let e=0;e[e,u(t)]));if(Ib(e))return new Set(Array.from(e).map(u));let t=Object.create(gb(e));for(let n in e)t[n]=u(e[n]);return Ab(e,db)&&(t[db]=e[db]),t}function d(e){return Cb(e)?u(e):e}tx(Xb,{applyPatches_:l,generatePatches_:i,generateReplacementPatches_:c,getPath:e})}globalThis.Iterator?.from;var Fx=new Ax,Ix=Fx.produce,Lx=Fx.produceWithPatches.bind(Fx),Rx=Fx.applyPatches.bind(Fx),zx=1e3;function Bx(e,t){if(e.add(t),e.size>zx){let t=e.values().next().value;t!==void 0&&e.delete(t)}}function Vx(e){let{enablePatches:t=!1}=e;t&&Px();let n=tb(),r=e.initialValue,i=new Set;return{on:n.on,value:()=>r,patch:(e,t=lb())=>{i.has(t)||(Px(),r=Rx(r,e),Bx(i,t),n.emit(`updated`,r,void 0,t))},mutate:(e,a=lb())=>{if(!i.has(a)){if(Bx(i,a),t){let[t,i]=Lx(r,e);if(t===r)return;r=t,n.emit(`updated`,r,i,a)}else{let t=Ix(r,e);if(t===r)return;r=t,n.emit(`updated`,r,void 0,a)}}},syncIds:i}}var Hx=typeof self==`object`?self:globalThis,Ux=new Set([`Error`,`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`,`AggregateError`]),Wx=new Set([`Boolean`,`Number`,`String`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float16Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]);function Gx(e,t){let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o,r=Ux.has(e)?Hx[e]:void 0;return n(new(r??Hx.Error)(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}if(typeof a==`string`&&Wx.has(a))return n(new Hx[a](o),i);throw TypeError(`unable to deserialize unsafe or unknown type: ${String(a)}`)};return r}function Kx(e){return Gx(new Map,e)(0)}var qx=``,{toString:Jx}={},{keys:Yx}=Object;function Xx(e){let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Jx.call(e).slice(8,-1);switch(n){case`Array`:return[1,qx];case`Object`:return[2,qx];case`Date`:return[3,qx];case`RegExp`:return[4,qx];case`Map`:return[5,qx];case`Set`:return[6,qx];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]}function Zx([e,t]){return e===0&&(t===`function`||t===`symbol`)}function Qx(e,t,n,r){let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Xx(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize ${s}`);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Yx(r))(e||!Zx(Xx(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Zx(Xx(n))||Zx(Xx(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Zx(Xx(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a}function $x(e,t={}){let n=[];return Qx(!(t.json||t.lossy),!!t.json,new Map,n)(e),n}var{parse:eS,stringify:tS}=JSON,nS={json:!0,lossy:!0};function rS(e){return Kx(eS(e))}function iS(e){return tS($x(e,nS))}function aS(e){return Kx(e)}function oS(e){return iS(e)}function sS(e){return rS(e)}var cS=256,lS=class extends Error{name=`StreamClosedError`};function uS(e={}){let t=e.id??lb(),n=Math.max(0,e.replayWindow??0),r=tb(),i=new AbortController,a=[],o=!1,s=0;function c(e){if(o)throw new lS(`Cannot write to a closed stream "${t}"`);s+=1,n>0&&(a.push({seq:s,chunk:e}),a.length>n&&(a.length-n===1?a.shift():a.splice(0,a.length-n))),r.emit(`chunk`,s,e)}function l(e){if(o)return;o=!0;let t=fS(e);i.abort(e),r.emit(`end`,t)}function u(){o||(o=!0,i.signal.aborted||i.abort(`stream closed`),r.emit(`end`,void 0))}function d(e){o||i.signal.aborted||i.abort(e??`aborted`)}let f=new WritableStream({write(e){c(e)},close(){u()},abort(e){l(e)}});return{id:t,signal:i.signal,get closed(){return o},get lastSeq(){return s},write:c,error:l,close:u,abort:d,writable:f,events:r,buffer:a}}function dS(e={}){let t=e.id??lb(),n=Math.max(1,e.highWaterMark??cS),r=[],i=0,a=!1,o=!1,s,c,l,u;function d(){if(c){if(r.length>0){let e=r.shift(),t=c;c=void 0,t.resolve({value:e,done:!1});return}if(a){let e=c;if(c=void 0,s){let t=Error(s.message);t.name=s.name,e.reject(t)}else e.resolve({value:void 0,done:!0})}}}function f(){if(l){for(;r.length>0;){let e=r.shift();try{l.enqueue(e)}catch{break}}if(a&&l){try{if(s){let e=Error(s.message);e.name=s.name,l.error(e)}else l.close()}catch{}l=void 0}}}function p(t,s){if(!(a||o)&&!(t<=i)){if(i=t,r.push(s),r.length>n){let t=r.length-n;r.splice(0,t),e.onOverflow?.(t)}d(),u&&f()}}function m(e){a||(a=!0,s=e,d(),u&&f())}function ee(){o||a||(o=!0,e.onCancel?.(),m(void 0))}function h(){return u||(u=new ReadableStream({start(e){l=e,f()},cancel(){ee()}}),u)}return{id:t,get cancelled(){return o},get done(){return a},get lastSeenSeq(){return i},get readable(){return h()},cancel:ee,_push:p,_end:m,[Symbol.asyncIterator](){return{next(){if(r.length>0)return Promise.resolve({value:r.shift(),done:!1});if(a){if(s){let e=Error(s.message);return e.name=s.name,Promise.reject(e)}return Promise.resolve({value:void 0,done:!0})}return new Promise((e,t)=>{c={resolve:e,reject:t}})},return(){return ee(),Promise.resolve({value:void 0,done:!0})}}}}}function fS(e){if(e instanceof Error)return{name:e.name||`Error`,message:e.message};if(typeof e==`string`)return{name:`Error`,message:e};try{return{name:`Error`,message:JSON.stringify(e)}}catch{return{name:`Error`,message:String(e)}}}var pS=128;function mS(e){return e.replace(/[^\w-]+/g,`_`).slice(0,pS)}var hS=`modulepreload`,gS=function(e,t){return new URL(e,t).href},_S={},vS=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=gS(t,n),t=s(t),t in _S)return;_S[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:hS,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},yS=`__connection.json`,bS=`__DEVFRAME_CONNECTION__`,xS=`x-birpc-session`,SS=`__rpc-dump/index.json`,CS=`devframe:services`,wS=`devframe_otp`,TS=`devframe_auth_token`;wy.postMessage.remoteAssetsError;var ES=class{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>eb(e))}updateOptions(e){this.options={...this.options,...e}}cached(e,t){let n=this.cacheMap.get(e);if(n)return n.get(this.keySerializer(t))}has(e,t){return this.cacheMap.get(e)?.has(this.keySerializer(t))??!1}apply(e,t){let n=this.cacheMap.get(e.m)||new Map;n.set(this.keySerializer(e.a),t),this.cacheMap.set(e.m,n)}validate(e){return this.options.functions.includes(e)}clear(e){e?this.cacheMap.delete(e):this.cacheMap.clear()}},DS=Mre({docsBase:`https://devfra.me/errors`,codes:{DF0019:{why:e=>`RPC function "${e.name}" has \`agent\` set but \`jsonSerializable\` is \`false\`; MCP requires JSON-serializable data.`,fix:"Remove `jsonSerializable: false`, or remove `agent` to keep it RPC-only."},DF0020:{why:e=>`RPC function "${e.name}" declares \`jsonSerializable: true\` but the value at "${e.path}" is a ${e.type}.`,fix:"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."},DF0021:{why:e=>`RPC function "${e.name}" is already registered`,fix:"Use the `force` parameter to overwrite an existing registration."},DF0022:{why:e=>`RPC function "${e.name}" is not registered. Use register() to add new functions.`},DF0023:{why:e=>`RPC function "${e.name}" is not registered`},DF0024:{why:e=>`Either handler or setup function must be provided for RPC function "${e.name}"`},DF0025:{why:e=>`Function "${e.name}" not found in dump store`},DF0026:{why:e=>`No dump match for "${e.name}" with args: ${e.args}`},DF0027:{why:e=>`Function "${e.name}" with type "${e.type}" cannot have dump configuration. Only "static" and "query" types support dumps.`},DF0028:{why:e=>`Function "${e.name}" with type "${e.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,fix:"Remove `snapshot: true`, or change the function type to `query`."},DF0043:{why:e=>`RPC function "${e.name}" received an invalid argument at position ${e.index}: ${e.issues}`,fix:"Pass a value that satisfies the `args` schema declared for this function."},DF0044:{why:e=>`RPC function "${e.name}" returned a value that failed its \`returns\` schema: ${e.issues}`,fix:"Make the handler return a value that satisfies the `returns` schema, or relax the schema."}}});function OS(e){if(e.agent&&e.jsonSerializable===!1)throw DS.DF0019({name:e.name});e.agent&&!e.jsonSerializable&&(e.jsonSerializable=!0)}async function kS(e,t){let n=e[`~standard`].validate(t);return n instanceof Promise?await n:n}function AS(e){return e.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `)}async function jS(e,t,n){let r=n.slice();if(!t||t.length===0)return r;for(let r=0;r{n.get(t)===r&&n.delete(t)}),n.set(t,r)),await r}if(!e.__promise){let n=Promise.resolve(e.setup(t));n.catch(()=>{e.__promise===n&&(e.__promise=void 0)}),e.__promise=n}return await e.__promise}async function PS(e,t){let n=e.handler;if(!n){let r=await NS(e,t);if(!r.handler)throw DS.DF0024({name:e.name});n=r.handler}let r=e.args,i=e.returns;if(!r&&!i)return n;let a=n;return async(...t)=>{let n=await jS(e.name,r,t),o=await a(...n);return await MS(e.name,i,o)}}var FS=class{context;definitions=new Map;functions;_onChanged=[];constructor(e){this.context=e;let t=this.definitions,n=this;this.functions=new Proxy({},{get(e,r){let i=t.get(r);if(i)return PS(i,n.context)},has(e,n){return t.has(n)},getOwnPropertyDescriptor(e,n){return{value:t.get(n)?.handler,configurable:!0,enumerable:!0}},ownKeys(){return Array.from(t.keys())}})}register(e,t=!1){if(this.definitions.has(e.name)&&!t)throw DS.DF0021({name:e.name});OS(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}update(e,t=!1){if(!this.definitions.has(e.name)&&!t)throw DS.DF0022({name:e.name});OS(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}onChanged(e){return this._onChanged.push(e),()=>{let t=this._onChanged.indexOf(e);t!==-1&&this._onChanged.splice(t,1)}}async getHandler(e){return await PS(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw DS.DF0023({name:String(e)});return{args:t.args,returns:t.returns}}has(e){return this.definitions.has(e)}get(e){return this.definitions.get(e)}list(){return Array.from(this.definitions.keys())}};function IS(e,t=``){return JSON.stringify(e,function(e,n){let r=this,i=r==null?n:r[e];if(i===void 0){if(Array.isArray(r))throw RS(t,`undefined`,r,e);return n}return i!==null&&LS(i,r,e,t),n})}function LS(e,t,n,r){if(typeof e==`bigint`)throw RS(r,`BigInt`,t,n);if(typeof e!=`object`)return;if(e instanceof Map)throw RS(r,`Map`,t,n);if(e instanceof Set)throw RS(r,`Set`,t,n);if(e instanceof Date)throw RS(r,`Date`,t,n);if(Array.isArray(e))return;let i=Object.getPrototypeOf(e);if(i!==null&&i!==Object.prototype)throw RS(r,e.constructor?.name??`class instance`,t,n)}function RS(e,t,n,r){let i=zS(n,r);return DS.DF0020({name:e||``,type:t,path:i})}function zS(e,t){return Array.isArray(e)?`[${t}]`:t===``?``:t}var BS=`__DEVFRAME_CONNECTION_META__`,VS=`__DEVFRAME_CONNECTION_AUTH_TOKEN__`;function HS(e){let t=[()=>window?.[e],()=>globalThis?.[e],()=>parent.window?.[e]];for(let e of t)try{let t=e();if(t)return t}catch{}}function US(){return HS(bS)}function WS(){return HS(BS)}function GS(e){if(e)return e;try{let e=localStorage.getItem(VS);if(e)return e}catch{}return HS(VS)}function KS(e){globalThis[bS]=e,globalThis[BS]={...e.connectionMeta,baseUrl:e.metaBaseUrl},e.authToken&&qS(e.authToken)}function qS(e){try{localStorage.setItem(VS,e)}catch{}globalThis[VS]=e;let t=US();t&&(globalThis[bS]={...t,authToken:e})}function JS(e){let t=ob(yS,e);try{return new URL(t,globalThis.location?.href).href}catch{return t}}function YS(e,t){return t&&t!==e.authToken?{...e,authToken:t}:e}function XS(){let e=US();if(e)return YS(e,GS()??e.authToken??e.connectionMeta.authToken);let t=WS();if(t)return{connectionMeta:t,metaBaseUrl:t.baseUrl??JS(`./`),authToken:GS(t.authToken)}}async function ZS(e={}){if(e.connection){let t=YS(e.connection,GS(e.authToken??e.connection.authToken??e.connection.connectionMeta.authToken));return KS(t),t}let t=Array.isArray(e.baseURL)?e.baseURL:[e.baseURL??`./`];if(e.connectionMeta){let n={connectionMeta:e.connectionMeta,metaBaseUrl:JS(t[0]??`./`),authToken:GS(e.authToken??e.connectionMeta.authToken)};return KS(n),n}let n=XS();if(n){let t=YS(n,GS(e.authToken??n.authToken??n.connectionMeta.authToken));return KS(t),t}let r=[];for(let n of t){let t=ob(yS,n),i=JS(n);try{let n=await fetch(t);if(!n.ok)throw Error(`Failed to fetch connection meta from ${i}: ${n.status}`);let r=await n.json(),a=n.url||i,o={connectionMeta:r,metaBaseUrl:r.baseUrl?new URL(r.baseUrl,a).href:a,authToken:GS(e.authToken??r.authToken)};return KS(o),o}catch(e){r.push(e)}}throw Error(`Failed to get connection meta from ${t.join(`, `)}`,{cause:r})}var QS=class extends Error{name=`DevframeConnectionError`;kind;constructor(e,t,n){super(t,n),this.kind=e}};function $S(e=wS){try{let t=globalThis.location?.hash?.replace(/^#/,``)??``;return new URLSearchParams(t).get(e)||void 0}catch{return}}function eC(e){try{let t=new URL(globalThis.location.href),n=new URLSearchParams(t.hash.replace(/^#/,``));if(!n.has(e))return;n.delete(e),t.hash=n.toString(),globalThis.history?.replaceState(globalThis.history.state,``,t.href)}catch{}}function tC(e=wS){let t=$S(e);return t&&eC(e),t}async function nC(e,t={}){let n=tC(t.param??`devframe_otp`);return n?e.isTrusted?!0:e.requestTrustWithCode(n):!1}function rC(e){let t={},n=new WeakMap,r,i=()=>(r??=e.sharedState.get(CS,{initialValue:{}}).then(e=>(t=e.value(),e.on(`updated`,e=>{t=e}),e)),r);return i(),{state:i,has:e=>e in t,keys:()=>Object.keys(t),get:r=>{let i=t[r];if(!i)return;let a=n.get(i);return a||(a={...i,rpc:e.scope(i.scope).rpc},n.set(i,a)),a}}}function iC(e){let t=new Map,n=new Map,r=new Map,i=new Set,a=e.connectionMeta.backend===`static`;function o(e,t){let n=r.get(e);return n&&typeof n==`object`&&!Array.isArray(n)&&typeof t==`object`&&!Array.isArray(t)?{...n,...t}:t}e.client.register({name:wy.broadcast.clientStateUpdated,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.mutate(()=>o(e,n),r)}}),e.client.register({name:wy.broadcast.clientStatePatch,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.patch(n,r)}});function s(t,n){let r=[];return r.push(n.on(`updated`,(n,r,i)=>{a||(r?e.callEvent(`devframe:rpc:server-state:patch`,t,r,i):e.callEvent(`devframe:rpc:server-state:set`,t,n,i))})),()=>{for(let e of r)e()}}return{keys:()=>Array.from(t.keys()),onKeyAdded(e){return i.add(e),()=>{i.delete(e)}},delete(e){let i=n.get(e);n.delete(e);let a=t.delete(e);return r.delete(e),i?.(),a},get:async(c,l)=>{if(l?.initialValue!==void 0&&r.set(c,l.initialValue),t.has(c))return t.get(c);let u=Vx({initialValue:l?.initialValue,enablePatches:!1});async function d(){if(a||e.callEvent(`devframe:rpc:server-state:subscribe`,c),l?.initialValue!==void 0){t.set(c,u);for(let e of i)e(c);return e.call(`devframe:rpc:server-state:get`,c).then(e=>{e!==void 0&&u.mutate(()=>o(c,e))}).catch(e=>{console.error(`Error getting server state`,e)}),n.set(c,s(c,u)),u}{let r=await e.call(`devframe:rpc:server-state:get`,c);u.mutate(()=>o(c,r)),t.set(c,u);for(let e of i)e(c);return n.set(c,s(c,u)),u}}return new Promise((t,n)=>{if(e.isTrusted)d().then(t,n);else{t(u);let n=!1;e.events.on(wy.client.isTrustedUpdated,e=>{e&&!n&&(n=!0,d())})}})}}}var aC=new Map;function oC(e=aC){let t=new Map;return{serialize:n=>{let r;return n.t===`q`?r=n.m:(r=t.get(n.i),t.delete(n.i)),!(n.t===`s`&&`e`in n)&&r&&e.get(r)?.jsonSerializable===!0?IS(n,r??``):`s:${oS(n)}`},deserialize:e=>{let n=e.startsWith(`s:`)?sS(e.slice(2)):JSON.parse(e);return n.t===`q`&&n.i&&n.m&&t.set(n.i,n.m),n}}}function sC(){}function cC(e){let t=e.search(/\n\n|\r\n\r\n/);if(!(t<0))return{frame:e.slice(0,t),rest:e.slice(t+(e[t]===`\r`?4:2))}}function lC(e){let t=`message`,n=[];for(let r of e.split(/\r?\n/))r.startsWith(`:`)||(r.startsWith(`event:`)?t=r.slice(6).trimStart():r.startsWith(`data:`)&&n.push(r.slice(5).replace(/^ /,``)));return{event:t,data:n}}function uC(e){let{onConnected:t=sC,onError:n=sC,onDisconnected:r=sC,definitions:i,fetch:a=globalThis.fetch.bind(globalThis)}=e,o=e.url;e.authToken&&(o=`${o}${o.includes(`?`)?`&`:`?`}${TS}=${encodeURIComponent(e.authToken)}`);let s=oC(i),c=new AbortController,l=!1,u,d,f,p,m=new Promise((e,t)=>{f=e,p=t});m.catch(()=>{});function ee(e){l||(l=!0,p(e),n(e),r())}function h(){l||(l=!0,p(Error(`Devframe SSE stream closed`)),r())}function g(e,n){if(e===`session`){f(n),t();return}u?.(n)}async function te(e){let t=e.getReader();d=t;let n=new TextDecoder,r=``;for(;;){let{done:e,value:i}=await t.read();if(e)break;for(r+=n.decode(i,{stream:!0});;){let e=cC(r);if(!e)break;r=e.rest;let{event:t,data:n}=lC(e.frame);n.length>0&&g(t,n.join(` -`))}}h()}return(async()=>{try{let e=await a(o,{headers:{accept:`text/event-stream`},signal:c.signal});if(!e.ok||!e.body)throw Error(`Devframe SSE stream request failed: ${e.status}`);await te(e.body)}catch(e){if(c.signal.aborted){h();return}ee(e instanceof Error?e:Error(String(e)))}})(),{close:()=>{l=!0,c.abort(),d?.cancel().catch(()=>{})},on:e=>{u=e},post:async e=>{let t;try{t=await m}catch{return}if(l){n(Error(`Devframe SSE channel is closed; message dropped`));return}try{let n=await a(o,{method:`POST`,headers:{"content-type":`text/plain; charset=utf-8`,[xS]:t},body:e});if(n.status===200){let e=await n.text();e&&u?.(e);return}if(!n.ok)throw Error(`Devframe SSE POST failed: ${n.status}`)}catch(e){n(e instanceof Error?e:Error(String(e)))}},serialize:s.serialize,deserialize:s.deserialize}}function dC(e,t){let{channel:n,rpcOptions:r={}}=t;return Py(e,{...n,timeout:-1,...r,proxify:!1})}function fC(e){let{transport:t,authToken:n,connectionMeta:r,events:i,clientRpc:a,rpcOptions:o={},callTimeout:s=0}=e,c=!1,l=`connecting`,u=null,d=Promise.withResolvers();function f(e,t=null){if(t?u=t:e===`connected`&&(u=null),e===l)return;let n=l;l=e,i.emit(wy.client.connectionStatus,e,n)}let p=new Set;function m(e){for(let t of[...p])t.reject(e)}function ee(){return l===`disconnected`||l===`error`?new QS(`connection`,`[devframe] Not connected to the devframe server`,{cause:u??void 0}):l===`unauthorized`?new QS(`auth`,`[devframe] Not authorized by the devframe server`,{cause:u??void 0}):null}function h(e,t){return new Promise((n,r)=>{let a=!1,o,c={reject(e){a||(l(),i.emit(wy.client.error,e,t),r(e))}};function l(){a=!0,p.delete(c),o&&clearTimeout(o)}p.add(c),s>0&&(o=setTimeout(()=>{c.reject(new QS(`timeout`,`[devframe] RPC call "${t}" timed out after ${s}ms`))},s)),e.then(e=>{a||(l(),n(e))},e=>{if(a)return;l();let n=e instanceof Error?e:Error(String(e));i.emit(wy.client.error,n,t),r(n)})})}let g=new Map;for(let e of r.jsonSerializableMethods??[])g.set(e,{jsonSerializable:!0});let te=e.createChannel({definitions:g,onError(e){f(`error`,e),i.emit(wy.client.connectionError,e),m(new QS(`connection`,`[devframe] Connection to the devframe server failed`,{cause:e}))},onDisconnected(){l!==`error`&&f(`disconnected`),m(new QS(`connection`,`[devframe] Disconnected from the devframe server`,{cause:u??void 0}))}}),ne=dC(a.functions,{channel:te,rpcOptions:o});a.register({name:wy.broadcast.authRevoked,type:`event`,handler:()=>{c=!1;let e=new QS(`auth`,`[devframe] The devframe server revoked this client's trust`);f(`unauthorized`,e),i.emit(wy.client.connectionError,e),m(e),i.emit(wy.client.isTrustedUpdated,!1)}});let re=n;async function ie(e){re=e;let t=await ne.$call(`anonymous:devframe:auth`,{authToken:e,ua:navigator.userAgent,origin:location.origin});if(c=t.isTrusted,c)d.resolve(!0),f(`connected`);else{let e=new QS(`auth`,`[devframe] The devframe server refused this client's credentials`);f(`unauthorized`,e),i.emit(wy.client.connectionError,e)}return i.emit(wy.client.isTrustedUpdated,c),t.isTrusted}async function ae(e){let t=(await ne.$call(`anonymous:devframe:auth:exchange`,{code:e,ua:navigator.userAgent,origin:location.origin}))?.authToken??null;return t&&(re=t,c=!0,d.resolve(!0),f(`connected`),i.emit(wy.client.isTrustedUpdated,!0)),t}async function oe(e={}){await ne.$call(`anonymous:devframe:auth:request-code`,{ua:navigator.userAgent,origin:location.origin,...e.reissue?{reissue:!0}:{}})}async function se(){return c?!0:ie(re??``)}async function ce(e=6e4){if(c&&d.resolve(!0),e<=0)return d.promise;let t;try{return await Promise.race([d.promise,new Promise((n,r)=>{t=setTimeout(()=>{r(Error(`[devframe] Timeout waiting for rpc to be trusted`))},e)})]),c}finally{clearTimeout(t)}}return{transport:t,get isTrusted(){return c},get status(){return l},get connectionError(){return u},requestTrust:se,requestTrustWithToken:ie,requestTrustWithCode:ae,requestAuthCode:oe,ensureTrusted:ce,call:(...e)=>{let t=String(e[0]),n=ee();return n?(i.emit(wy.client.error,n,t),Promise.reject(n)):h(ne.$call(...e),t)},callEvent:(...e)=>{let t=ee();if(t){i.emit(wy.client.error,t,String(e[0]));return}return ne.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),n=ee();return n?(i.emit(wy.client.error,n,t),Promise.reject(n)):h(ne.$callOptional(...e),t)},close:()=>{te.close()}}}function pC(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})();if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`;return new URL(e.path??`/`,`${r.protocol}//${t}`).href}return new URL(e.path??``,r).href}let i=e??``;return/^https?:\/\//i.test(i)?i:new URL(i,r).href}function mC(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},sseOptions:s={},callTimeout:c=0}=e,l=pC(n.sse,r??`./`,location);return fC({transport:`sse`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>uC({url:l,authToken:t,definitions:e.definitions,...s,onConnected(){s.onConnected?.()},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(){e.onDisconnected(),s.onDisconnected?.()}})})}function hC(e){let{name:t,message:n,cause:r,...i}=e,a=r instanceof Error?r:gC(r)?hC(r):r,o=a===void 0?Error(n):Error(n,{cause:a});return o.name=t,Object.assign(o,i),o}function gC(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}function _C(e){return typeof e==`object`&&!!e&&e.type===`static`&&typeof e.path==`string`}function vC(e){return typeof e==`object`&&!!e&&e.type===`query`&&typeof e.records==`object`&&e.records!==null}function yC(e){return typeof e==`object`&&!!e&&(`output`in e||`error`in e)}function bC(e){if(e.error)throw hC(e.error);return e.output}function xC(e){return e.some(e=>e!=null)}function SC(e){return typeof e==`object`&&e&&`serialization`in e&&`data`in e?e.data:e}function CC(e,t){let n=new Map,r=new Map;function i(e,t){return t===`structured-clone`&&Array.isArray(e)?aS(e):e}function a(e,t){return i(SC(e),t)}async function o(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>a(t,e.serialization)));let r=await n.get(e.path);return yC(r)?bC(r):r}async function s(e,n){return r.has(e)||r.set(e,t(e).then(e=>a(e,n))),await r.get(e)}async function c(t,n){if(!(t in e))throw Error(`[devframe-rpc] Function "${t}" not found in dump store`);let r=e[t];if(_C(r)){if(xC(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if(vC(r)){let e=eb(n),i=r.records[e];if(i)return bC(await s(i,r.serialization));if(r.fallback)return bC(await s(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!xC(n))return r;throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await c(e,t),callOptional:async(t,n)=>{if(t in e)return await c(t,n)},callEvent:async(e,t)=>{}}}async function wC(e){let t=CC(await e.fetchJsonFromBases(SS),e.fetchJsonFromBases);return{transport:`static`,isTrusted:!0,status:`connected`,connectionError:null,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,requestTrustWithCode:async()=>null,requestAuthCode:async()=>{},ensureTrusted:async()=>!0,call:(...e)=>t.call(e[0],e.slice(1)),callEvent:(...e)=>t.callEvent(e[0],e.slice(1)),callOptional:(...e)=>t.callOptional(e[0],e.slice(1)),close:()=>{}}}var TC=``;function EC(e,t){return`${e}${TC}${t}`}function DC(e){let t=new Map,n=new Map;e.client.register({name:wy.broadcast.streamingChunk,type:`event`,handler(e,n,r,i){t.get(EC(e,n))?._push(r,i)}}),e.client.register({name:wy.broadcast.streamingEnd,type:`event`,handler(e,n,r){let i=EC(e,n),a=t.get(i);a&&(a._end(r),t.delete(i))}}),e.client.register({name:wy.broadcast.streamingUploadCancel,type:`event`,handler(e,t){let r=EC(e,t),i=n.get(r);i&&(i.abort(`server cancelled upload`),n.delete(r))}}),e.events.on(wy.client.isTrustedUpdated,n=>{if(n)for(let[n,r]of t){if(r.cancelled||r.done)continue;let t=n.indexOf(TC);if(t<0)continue;let i=n.slice(0,t),a=n.slice(t+1);e.callEvent(`devframe:streaming:subscribe`,i,a,{afterSeq:r.lastSeenSeq})}});function r(n,r,i={}){let a=EC(n,r),o=t.get(a);if(o)return o;let s=dS({id:r,highWaterMark:i.highWaterMark,onOverflow(e){console.warn(`[devframe] DF0029: Stream "${n}#${r}" dropped ${e} chunk(s) after exceeding the client high-water mark.`)},onCancel(){e.callEvent(`devframe:streaming:cancel`,n,r),t.delete(a)}});if(t.set(a,s),e.isTrusted)e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:0});else{let i=e.events.on(wy.client.isTrustedUpdated,o=>{o&&(i(),t.has(a)&&!s.cancelled&&!s.done&&e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:s.lastSeenSeq}))})}return s}function i(t,r){let i=EC(t,r),a=n.get(i);if(a)return a;let o=uS({id:r});return o.events.on(`chunk`,(n,i)=>{e.callEvent(`devframe:streaming:upload-chunk`,t,r,n,i)}),o.events.on(`end`,a=>{e.callEvent(`devframe:streaming:upload-end`,t,r,a),n.delete(i)}),n.set(i,o),o}return{subscribe:r,upload:i}}function OC(){}var kC=new Map;function AC(e){let t=e.url;e.authToken&&(t=`${t}?${TS}=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=OC,onError:i=OC,onDisconnected:a=OC,definitions:o=kC}=e;n.addEventListener(`open`,e=>{r(e)}),n.addEventListener(`error`,e=>{let t=e instanceof Error?e:Error(e.type);i(t)}),n.addEventListener(`close`,e=>{a(e)});let s=oC(o);return{close:()=>{n.close()},on:e=>{n.addEventListener(`message`,t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN){n.send(e);return}if(n.readyState===WebSocket.CONNECTING){let t=()=>{i(),n.readyState===WebSocket.OPEN&&n.send(e)},r=()=>i();function i(){n.removeEventListener(`open`,t),n.removeEventListener(`close`,r)}n.addEventListener(`open`,t),n.addEventListener(`close`,r);return}i(Error(`Devframe WebSocket is not open; message dropped`))},serialize:s.serialize,deserialize:s.deserialize}}function jC(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})(),i=r.protocol===`https:`?`wss:`:`ws:`;if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`,n=new URL(e.path??`/`,`${i}//${t}`);return n.protocol=i,n.href}let t=new URL(e.path??``,r);return t.protocol=i,t.href}if(typeof e==`number`)return`${i}//${r.hostname}:${e}`;let a=e??``;if(/^wss?:\/\//i.test(a))return a;if(/^https?:\/\//i.test(a))return sb(a,/^https/i.test(a)?`wss://`:`ws://`);let o=new URL(a,r);return o.protocol=i,o.href}function MC(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},wsOptions:s={},callTimeout:c=0}=e,l=jC(n.websocket,r??`./`,location);return fC({transport:`websocket`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>AC({url:l,authToken:t,definitions:e.definitions,...s,onConnected(e){s.onConnected?.(e)},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(t){e.onDisconnected(),s.onDisconnected?.(t)}})})}function NC(e){return e.includes(`:`)}function PC(e,t){return NC(t)?t:`${e}:${t}`}function FC(e){return{async get(t){return(await e()).value()?.[t]},async set(t,n){(await e()).mutate(e=>{if(e===void 0)return{[t]:n};e[t]=n})},async delete(t){(await e()).mutate(e=>{e!==void 0&&delete e[t]})},async all(){return(await e()).value()??{}},async onChange(t){return(await e()).on(`updated`,e=>t(e??{}))}}}function IC(e,t,n){let r=`devframe:settings:${n}:${t}`,i;function a(){return i||=(async()=>(await e.ensureTrusted(),e.sharedState.get(r)))().catch(e=>{throw i=void 0,e}),i}return FC(a)}function LC(e,t){return{global:IC(e,t,`global`),project:IC(e,t,`project`)}}function RC(e,t){return{namespace:t,base:e,rpc:{namespace:t,register(n){if(NC(n.name))throw Error(`[devframe] Scoped client RPC registration for namespace "${t}" received an already-namespaced function name "${n.name}". Pass a bare name without a ":" separator.`);e.client.register({...n,name:`${t}:${n.name}`})},call:((n,...r)=>e.call(PC(t,n),...r)),callEvent:((n,...r)=>e.callEvent(PC(t,n),...r)),callOptional:((n,...r)=>e.callOptional(PC(t,n),...r)),sharedState:((n,r)=>e.sharedState.get(PC(t,n),r)),streaming:{subscribe:(n,r,i)=>e.streaming.subscribe(PC(t,n),r,i),upload:(n,r)=>e.streaming.upload(PC(t,n),r)}},settings:LC(e,t),scope:e.scope}}function zC(){if(typeof document<`u`){let e=document.modelContext;if(e)return e}if(typeof navigator<`u`){let e=navigator.modelContext;if(e)return e}}function BC(e,t={}){let n=t.modelContext??zC();if(!n)return()=>{};let r=n,i=new Map,a=new Map;function o(t,n){let o=mS(t.name),s=a.get(o);if(s&&s!==t.name){console.warn(`[devframe] WebMCP tool name "${o}" (from "${t.name}") collides with "${s}"; keeping the first registration.`);return}let c=new AbortController,l=Fy(t.type,n),u=r.registerTool({name:o,description:n.description,inputSchema:Ry(t.args),annotations:{title:n.title??t.name,readOnlyHint:l===`read`,destructiveHint:l===`destructive`},execute:n=>VC(t,e.context,n)},{signal:c.signal});u&&`then`in u&&u.then(()=>{},()=>{}),a.set(o,t.name),i.set(t.name,()=>{c.abort(),u&&`unregister`in u&&typeof u.unregister==`function`&&u.unregister(),a.delete(o)})}function s(t){let n=t?[t]:[...e.definitions.keys()];for(let t of n){i.get(t)?.(),i.delete(t);let n=e.definitions.get(t),r=n?.agent;n&&r&&o(n,r)}}s();let c=e.onChanged(e=>s(e));return()=>{c();for(let e of i.values())e();i.clear()}}async function VC(e,t,n){try{let r=By(n,e.args?.length);return{content:[{type:`text`,text:HC(await(await PS(e,t))(...r))}]}}catch(e){return{isError:!0,content:[{type:`text`,text:UC(e)}]}}}function HC(e){return e===void 0?`undefined`:typeof e==`string`?e:JSON.stringify(e,null,2)}function UC(e){if(!(e instanceof Error))return String(e);let t=e.cause instanceof Error?` (cause: ${e.cause.message})`:``;return`${e.name}: ${e.message}${t}`}function WC(e,t){if(t.backend===`static`)return`static`;let n=t.websocket!==void 0,r=t.sse!==void 0;if(e===`websocket`){if(!n)throw Error(`[devframe] transport: 'websocket' was requested, but this server does not advertise a WebSocket endpoint`);return`websocket`}if(e===`sse`){if(!r)throw Error(`[devframe] transport: 'sse' was requested, but this server does not advertise an SSE endpoint`);return`sse`}if(t.backend===`sse`&&r)return`sse`;if(n)return`websocket`;if(r)return`sse`;throw Error(`[devframe] This server advertises no RPC transport (backend "none"), so there is nothing to connect to. Enable the WebSocket or SSE endpoint on the server, or use its static/MCP surfaces instead.`)}async function GC(e={}){let{baseURL:t=`./`,rpcOptions:n={},cacheOptions:r=!1}=e,i=tb(),a=Array.isArray(t)?t:[t],o=await ZS(e),{connectionMeta:s,metaBaseUrl:c,authToken:l}=o,u=a[0]??`./`;try{u=new URL(`.`,c).href}catch{}let d=new ES({functions:[],...typeof e.cacheOptions==`object`?e.cacheOptions:{}}),f={rpc:void 0},p=new FS(f),m=e.webmcp===!1?void 0:BC(p),ee,h=!1,g=0,te;function ne(){g++,te=void 0,d.clear(),r===!0&&d.updateOptions({functions:[]})}r&&(p.register({name:wy.broadcast.cacheInvalidate,type:`event`,handler:ne}),i.on(wy.client.connectionStatus,ne),i.on(wy.client.isTrustedUpdated,ne));async function re(e){let t=[u,...a.filter(e=>e!==u)].filter(e=>e!=null),n=[];for(let r of t)try{return await fetch(ob(e,r)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(`, `)}`,{cause:n})}let ie=e.callTimeout??0,ae=ie>0?ie:1/0,oe,se={authToken:l,connectionMeta:s,metaBaseUrl:c,events:i,clientRpc:p,callTimeout:e.callTimeout,rpcOptions:{...n,async onRequest(e,t,i){let a=performance.now()+ae;if(await n.onRequest?.call(this,e,t,i),r===!0&&e.i&&oe.isTrusted&&!e.m.startsWith(`anonymous:`)&&e.m!==`devframe:rpc:cacheable-functions`){function t(){if(performance.now()>=a)throw new QS(`timeout`,`[devframe] RPC call "${e.m}" timed out after ${ie}ms`)}for(;!te&&(t(),!(h||oe.status!==`connected`));){let e=g;te=oe.callOptional(`devframe:rpc:cacheable-functions`).then(t=>{e===g&&d.updateOptions({functions:t??[]})}).catch(t=>{throw e===g&&(te=void 0),t}),await te}await te,t()}let o=g;if(r&&e.i&&!h&&oe.isTrusted&&d.validate(e.m)){if(d.has(e.m,e.a))return i(d.cached(e.m,e.a));let n=await t(e);o===g&&!h&&d.apply(e,n)}else await t(e)}}},ce=WC(e.transport??`auto`,s);oe=ce===`static`?await wC({fetchJsonFromBases:re}):ce===`sse`?mC({...se,sseOptions:e.sseOptions}):MC({...se,wsOptions:e.wsOptions});let le;try{le=new BroadcastChannel(`devframe-auth`)}catch{}let ue,de=!1;function fe(e){return((...t)=>de||!ue?e(...t):ue.then(()=>e(...t)))}function pe(){h=!0,ne();try{ee?.(),m?.()}finally{try{le?.close()}finally{oe.close?.()}}}let me={events:i,get isTrusted(){return oe.isTrusted},get status(){return oe.status},get connectionError(){return oe.connectionError},get transport(){return oe.transport??ce},get connection(){return o},connectionMeta:s,ensureTrusted:oe.ensureTrusted,requestTrust:oe.requestTrust,requestTrustWithToken:async e=>(qS(e),o={...o,authToken:e},oe.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let t=await oe.requestTrustWithCode(e);if(!t)return!1;qS(t),o={...o,authToken:t};try{le?.postMessage({type:`auth-update`,authToken:t})}catch{}return!0},requestAuthCode:e=>oe.requestAuthCode(e),call:fe(oe.call),callEvent:fe(oe.callEvent),callOptional:fe(oe.callOptional),client:p,sharedState:void 0,services:void 0,streaming:void 0,cacheManager:d,scope:void 0,close:pe};me.sharedState=iC(me),me.streaming=DC(me),me.services=rC(me);let he=new Map;me.scope=(e=>{if(!e)return me;let t=he.get(e);return t||(t=RC(me,e),he.set(e,t)),t}),f.rpc=me;function ge(){try{return typeof window<`u`&&window.self===window.top}catch{return!1}}async function _e(){if(e.simpleAuth!==!1&&ge()&&typeof globalThis.prompt==`function`)for(await me.requestAuthCode().catch(()=>{});!me.isTrusted;){let e=globalThis.prompt(`devframe: enter the authentication code shown in your terminal`);if(e==null)return;let t=e.trim();if(t&&await me.requestTrustWithCode(t))return}}async function ve(){let t=await oe.requestTrust(),n=e.otpParam??`devframe_otp`,r=n?await nC(me,{param:n}):!1;t||r||me.isTrusted||await _e()}return ue=ve().then(()=>{de=!0},()=>{de=!0}),s.mcp&&vS(async()=>{let{setupBrowserAgentRpcBridge:e}=await import(`./browser-agent-rpc-KH4HHvHf-DqNFcBHr.js`);return{setupBrowserAgentRpcBridge:e}},[],import.meta.url).then(({setupBrowserAgentRpcBridge:e})=>{h||(ee=e(me))}).catch(()=>{}),le&&(le.onmessage=e=>{e.data?.type===`auth-update`&&e.data.authToken&&me.requestTrustWithToken(e.data.authToken)}),me}var KC=GC,qC=[`components`,`injectors`,`signals`,`ngrx`,`tanstackQuery`,`forms`,`router`,`pipes`,`http`,`analog`,`capacitor`,`errors`,`plugins`,`performance`,`build`],JC=[`angular`,`ngrx`,`analog`,`angular-native`,`nativescript`,`capacitor`];function YC(e){return`pangular:${e}`}var XC=[`forms`,`router`,`ngrx`,`http`,`analog`,`components`,`tanstackQuery`,`plugins`],ZC={refreshMs:{default:3e3,min:500,max:8e3},navigations:{default:50,min:5,max:500},formTimeline:{default:200,min:10,max:2e3},httpCalls:{default:200,min:10,max:2e3},changeLog:{default:200,min:10,max:2e3},cdCycles:{default:200,min:10,max:2e3},cdSlowMs:{default:16,min:1,max:1e3},capacitorCalls:{default:200,min:10,max:2e3},idleAfterMs:{default:6e4,min:0,max:6e5}},QC={"opted-out":`the request sets transferCache: false`,post:`POST requests are left out unless includePostRequests is set`,method:`only GET, HEAD and POST requests are cached`,"auth-headers":`it sends an Authorization, Proxy-Authorization or Cookie header`,credentials:`it sends credentials (withCredentials or credentials: include/same-origin)`,"no-cache-request":`the request asks for no-store, no-cache or private`,"no-cache-response":`the response has Cache-Control no-store, no-cache or private`,"set-cookie":`the response sets a cookie`,error:`failed responses are not stored`,mocked:`a fault rule answered before the transfer cache ran`,filter:`the transferCache filter passed to withPangular() left it out`,"cache-off-or-filter":`the transfer cache is off, or its filter (or another withHttpTransferCacheOptions setting) left it out`},$C=[[0,`Network error (offline)`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Content Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Content`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[499,`Client Closed Request`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[510,`Not Extended`],[511,`Network Authentication Required`],[520,`Web Server Returned an Unknown Error`],[521,`Web Server Is Down`],[522,`Connection Timed Out`],[523,`Origin Is Unreachable`],[524,`A Timeout Occurred`]];function ew(e){return $C.some(([t])=>t===e)}var tw=/^[a-z][a-z0-9-]{0,39}$/;function nw(e,t){let n=t.plugins?.[e],r=t.inspectors.plugins&&tw.test(e)&&(n?.enabled??!0);return{enabled:r,tools:r&&t.agent.tools.plugins&&(n?.tools??!0),actions:r&&t.actions.plugins&&(n?.actions??!0)}}var rw=`pangular`,iw={mod:`Mod`,ctrl:`Ctrl`,control:`Ctrl`,meta:`Meta`,cmd:`Meta`,command:`Meta`,alt:`Alt`,option:`Alt`,opt:`Alt`,shift:`Shift`},aw=[`Mod`,`Ctrl`,`Meta`,`Alt`,`Shift`];function ow(e){if(typeof e!=`string`||e.length>40)return;let t=e.split(`+`).map(e=>e.trim());if(t.some(e=>!e))return;let n=new Set,r;for(let e of t){let t=iw[e.toLowerCase()];if(t){if(n.has(t))return;n.add(t);continue}if(r!==void 0)return;if(/^[a-z0-9]$/i.test(e))r=e.toUpperCase();else if(/^f([1-9]|1[0-2])$/i.test(e))r=e.toUpperCase();else return}if(r&&[...n].some(e=>e!==`Shift`)&&!(n.has(`Mod`)&&(n.has(`Ctrl`)||n.has(`Meta`))))return[...aw.filter(e=>n.has(e)),r].join(`+`)}function sw(e,t,n){let r=t.split(`+`),i=r.pop(),a=new Set(r),o=a.has(`Ctrl`)||a.has(`Mod`)&&!n,s=a.has(`Meta`)||a.has(`Mod`)&&n;if(e.ctrlKey!==o||e.metaKey!==s||e.altKey!==a.has(`Alt`)||e.shiftKey!==a.has(`Shift`))return!1;if(/^F\d+$/.test(i))return e.key.toUpperCase()===i;let c=/^\d$/.test(i)?`Digit${i}`:`Key${i}`;return e.code?e.code===c:e.key.toUpperCase()===i}function cw(e,t){if(!t)return e.replace(/^Mod\b/,`Ctrl`);let n={Mod:`⌘`,Meta:`⌘`,Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`};return e.split(`+`).map(e=>n[e]??e).join(``)}var lw=[{id:`dashboard`,label:`Dashboard`},{id:`timeline`,label:`Timeline`},{id:`audit`,label:`Audit`},{id:`analog`,label:`Analog`,inspector:`analog`},{id:`components`,label:`Components`,inspector:`components`},{id:`routes`,label:`Routes`,inspector:`router`},{id:`signals`,label:`Signals`,inspector:`signals`},{id:`injectors`,label:`Injectors`,inspector:`injectors`},{id:`store`,label:`Store`,inspector:`ngrx`},{id:`queries`,label:`Queries`,inspector:`tanstackQuery`},{id:`forms`,label:`Forms`,inspector:`forms`},{id:`pipes`,label:`Pipes`,inspector:`pipes`},{id:`network`,label:`SSR & HTTP`,inspector:`http`},{id:`errors`,label:`Errors`,inspector:`errors`},{id:`performance`,label:`Performance`,inspector:`performance`},{id:`build`,label:`Build`,inspector:`build`},{id:`capacitor`,label:`Capacitor`,inspector:`capacitor`},{id:`plugins`,label:`Plugins`,inspector:`plugins`}],uw=1e4;function dw(e){return lw.filter(t=>!(`inspector`in t)||e.inspectors[t.inspector])}var fw={components:`a component instance, by its id in the component tree`,injectors:`a component's element injector, by the component's id`,signals:`a component's signal graph, by the component's id`,forms:`a form, by its id`},pw=200;function mw(e){let t=new URLSearchParams({tab:e.tab});return e.id&&t.set(`id`,e.id),e.page&&t.set(`page`,e.page),`#${t.toString()}`}function hw(e){let t=new URLSearchParams(e.replace(/^#/,``)),n=e=>{let n=t.get(e)?.trim();return n&&n.length<=pw?n:void 0},r=n(`tab`);if(!r)return null;let i=n(`id`),a=n(`page`);return{tab:r,...i?{id:i}:{},...a?{page:a}:{}}}var gw=[{id:`settings`,title:`Open settings`,group:`Go to`,keywords:`preferences tabs`},{id:`pick-component`,title:`Pick component on page`,group:`Actions`,keywords:`select inspect element`,inspector:`components`},{id:`cd-record-start`,title:`Start recording change detection`,group:`Actions`,keywords:`profiler cycles`,inspector:`components`},{id:`cd-record-stop`,title:`Stop recording change detection`,group:`Actions`,keywords:`profiler cycles`,inspector:`components`},{id:`cd-clear`,title:`Clear change detection recording`,group:`Actions`,keywords:`reset recordings cycles`,inspector:`components`},{id:`theme:system`,title:`Theme: follow the system`,group:`Theme`,keywords:`auto`},{id:`theme:light`,title:`Theme: light`,group:`Theme`},{id:`theme:dark`,title:`Theme: dark`,group:`Theme`},{id:`dock:float`,title:`Popup: float`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:bottom`,title:`Popup: dock to the bottom`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:right`,title:`Popup: dock to the right`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:reset-size`,title:`Popup: reset the docked size`,group:`Popup`,keywords:`splitter resize height width`,popupOnly:!0},{id:`popout`,title:`Popup: open in its own window`,group:`Popup`,keywords:`pop out detach new window`,popupOnly:!0},{id:`popout:return`,title:`Popup: back into the page`,group:`Popup`,keywords:`pop in attach dock window`,popupOnly:!0}];function _w(e){let t=dw(e).map(e=>({id:`tab:${e.id}`,title:`Go to ${e.label}`,group:`Go to`,keywords:`tab open`})),n=gw.filter(t=>!t.inspector||e.inspectors[t.inspector]).map(({inspector:e,...t})=>t);return[...t,...n]}function vw(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var yw=Object.freeze({minLength:24,threshold:4.5}),bw={min:16,max:512},xw={min:2,max:6};function Sw(e){return typeof e==`number`&&Number.isInteger(e)&&e>=bw.min&&e<=bw.max}function Cw(e){return typeof e==`number`&&Number.isFinite(e)&&e>=xw.min&&e<=xw.max}function ww(e){if(e===!0)return{...yw};if(!e||typeof e!=`object`||Array.isArray(e))return;let{minLength:t,threshold:n}=e;return{minLength:Sw(t)?t:yw.minLength,threshold:Cw(n)?n:yw.threshold}}function Tw(e){let t=ww(e);return t?{entropy:t}:{}}function Ew(e,t){return typeof e==`boolean`?e:t}var Dw=100,Ow=100;function kw(e){if(!Array.isArray(e))return[];let t=e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e&&e.length<=Ow);return[...new Set(t)].slice(0,Dw)}function Aw(e,t){let{default:n,min:r,max:i}=ZC[t];return typeof e!=`number`||!Number.isFinite(e)?n:Math.min(i,Math.max(r,Math.round(e)))}function jw(e,t){return Object.fromEntries(e.map(e=>[e,t(e)]))}function Mw(e){let t=vw(e),n=vw(t.agent),r=vw(t.inspectors),i=vw(n.tools),a=vw(t.actions),o=Ew(t.actions,!0),s=vw(t.redaction),c=vw(t.limits),l=jw(qC,e=>Ew(r[e],!0));return{inspectors:l,agent:{readOnly:Ew(n.readOnly,!1),tools:jw(qC,e=>l[e]&&Ew(i[e],!0)),browserTools:Ew(n.browserTools,!1)},actions:jw(XC,e=>l[e]&&Ew(a[e],o)),redaction:{secretNames:kw(s.secretNames),unmask:kw(s.unmask),...Tw(s.entropy)},limits:Object.fromEntries(Object.keys(ZC).map(e=>[e,Aw(c[e],e)])),popup:{hotkey:zw(vw(t.popup).hotkey)},plugins:Rw(t.plugins),lint:{rules:Iw(t.lint)},analog:Pw(t.analog),ngrx:{trace:Ew(vw(t.ngrx).trace,!1)}}}var Nw=500;function Pw(e){let t=vw(e).contentSchema;return typeof t==`string`&&t.trim()&&t.length<=Nw?{contentSchema:t.trim()}:{}}var Fw=200;function Iw(e){let t=vw(vw(e).rules),n={};for(let[e,r]of Object.entries(t).slice(0,Fw))typeof r==`boolean`&&(n[e]=r);return n}var Lw=100;function Rw(e){let t={};for(let[n,r]of Object.entries(vw(e)).slice(0,Lw)){if(!tw.test(n))continue;if(typeof r==`boolean`){t[n]={enabled:r,tools:!0,actions:!0};continue}let e=vw(r);r!==void 0&&Object.keys(e).length&&(t[n]={enabled:Ew(e.enabled,!0),tools:Ew(e.tools,!0),actions:Ew(e.actions,!0)})}return t}function zw(e){return e===!1?!1:ow(e)??`Alt+Shift+P`}function Bw(e){let t=e?.configs;return Mw(t?.[rw])}function Vw(e){return`${{forms:`Writing to forms`,router:`Navigating and clearing navigations`,ngrx:`Restoring NgRx state, dispatching actions and changing the Store DevTools history`,http:`Changing HTTP mock rules and SSR overrides, refetching the TransferState payload, and clearing HTTP calls`,analog:`Calling API routes, clearing server calls, running Nitro tasks and purging the Nitro cache`,components:`Editing component properties and signals`,tanstackQuery:`Invalidating and refetching TanStack queries`,plugins:`Running plugin actions`}[e]} is turned off in the devtools config (actions.${e}).`}var Hw=[`pangular:build-meta`],Uw={components:`Components`,injectors:`Injectors`,signals:`Signals`,ngrx:`NgRx`,tanstackQuery:`TanStack Query`,forms:`Forms`,router:`Router`,pipes:`Pipes`,http:`HTTP`,analog:`Analog`,capacitor:`Capacitor`,errors:`Errors`,plugins:`Plugins`,performance:`Performance`,build:`Build`},Ww={forms:`Form writes`,router:`Navigation`,ngrx:`NgRx restore, dispatch and Store DevTools`,http:`HTTP mocking`,analog:`Analog API calls`,components:`Component edits`,tanstackQuery:`TanStack Query invalidate and refetch`,plugins:`Plugin actions`},Gw={refreshMs:e=>`poll every ${e} ms`,navigations:e=>`${e} navigations`,formTimeline:e=>`${e} form events`,httpCalls:e=>`${e} HTTP calls`,changeLog:e=>`${e} NgRx changes`,cdCycles:e=>`${e} change detection cycles`,cdSlowMs:e=>`slow cycles over ${e} ms`,capacitorCalls:e=>`${e} Capacitor plugin calls`,idleAfterMs:e=>e?`idle ${e/1e3} s after the last agent call`:`never idle`};function Kw(e){if(!e)return[];let t=[`On`];return e.minLength!==yw.minLength&&t.push(`${e.minLength} characters or more`),e.threshold!==yw.threshold&&t.push(`up to ${e.threshold} bits per character`),t}function qw(e){let t=[],n=(e,n)=>{n.length&&t.push({label:e,value:n.join(`, `)})},r=qC.filter(t=>e.inspectors[t]);n(`Inspectors off`,qC.filter(t=>!e.inspectors[t]).map(e=>Uw[e])),n(`Agent`,e.agent.readOnly?[`Read-only`]:[]),n(`Hidden from the agent`,r.filter(t=>!e.agent.tools[t]).map(e=>Uw[e])),n(`Blocked actions`,XC.filter(t=>e.inspectors[t]&&!e.actions[t]).map(e=>Ww[e])),n(`Extra secret names`,e.redaction.secretNames),n(`Unmasked names`,e.redaction.unmask),n(`Entropy masking`,Kw(e.redaction.entropy)),n(`Limits`,Object.keys(ZC).filter(t=>e.limits[t]!==ZC[t].default).map(t=>Gw[t](e.limits[t]))),e.popup.hotkey!==`Alt+Shift+P`&&n(`Popup shortcut`,[e.popup.hotkey===!1?`Off`:e.popup.hotkey]);let i=Object.entries(e.plugins??{});return n(`Plugins off`,i.filter(([,e])=>!e.enabled).map(([e])=>e)),n(`Plugin tools or actions off`,i.filter(([,e])=>e.enabled&&(!e.tools||!e.actions)).map(([e,t])=>`${e} (${[!t.tools&&`tools`,!t.actions&&`actions`].filter(Boolean).join(`, `)})`)),n(`Lint rules off`,Object.entries(e.lint?.rules??{}).filter(([,e])=>!e).map(([e])=>e)),t}function Jw(e){let t={tags:[],directives:[],text:``},n=e.toLowerCase();return n=n.replace(/<\s*([^<>\s]+)\s*>/g,(e,n)=>(t.tags.push({value:n,exact:!0}),` `)),n=n.replace(/\[\s*([^[\]\s]+)\s*\]/g,(e,n)=>(t.directives.push({value:n,exact:!0}),` `)),n=n.replace(/(^|\s)([<[])([^<>[\]\s]*)$/,(e,n,r,i)=>(i&&(r===`<`?t.tags:t.directives).push({value:i,exact:!1}),n)),t.text=n.replace(/\s+/g,` `).trim(),t}function Yw(e){return!e.tags.length&&!e.directives.length&&!e.text}function Xw(e,t){let n=e.tag.toLowerCase(),r=(e.directives??[]).map(e=>e.toLowerCase()),i=(e.attributes??[]).map(e=>e.toLowerCase()),a=[...r,...r.map(e=>e.replace(/directive$/,``)),...i];for(let{value:e,exact:r}of t.tags)if(r?n!==e:!n.startsWith(e))return!1;for(let{value:e,exact:n}of t.directives)if(!a.some(t=>n?t===e:t.includes(e)))return!1;if(t.text){let a=t.text;if(!(e.name.toLowerCase().includes(a)||n.includes(a)||r.some(e=>e.includes(a))||i.some(e=>e.includes(a))))return!1}return!0}var Zw={debugApi:{subject:`Live data`,since:`12.0`},injectorProviders:{subject:`Reading providers and environment injectors`,since:`16.2`},injectorMetadata:{subject:`The full injector tree`,since:`17.0`},isSignal:{subject:`Telling signals apart in component values`,since:`17.1`},signalGraph:{subject:`The live signal graph`,since:`20.1`},deferBlocks:{subject:`Listing @defer blocks`,since:`19.1`},forBlocks:{subject:`Listing @for blocks`,since:`22.0`},profiler:{subject:`Recording change detection`,since:`20.0`},angularProfiling:{subject:`Angular profiling`,since:`20.0`},routerInstance:{subject:`The router debug util`,since:`20.3`}};function Qw(e){let t=/^(\d+)\.(\d+)/.exec(e.trim());return t?`${t[1]}.${t[2]}`:e.trim()}function $w(e){let t=/^(\d+)(?:\.(\d+))?/.exec(e.trim());return t?[Number(t[1]),Number(t[2]??0)]:null}function eT(e,t){let n=$w(e),r=$w(t);return!n||!r?!1:n[0]===r[0]?n[1]>=r[1]:n[0]>r[0]}function tT(e,t){return e?.capabilities?.[t]===!1}function nT(e,t){let n=Zw[e],r=`${n.subject} needs Angular ${n.since} or later`;if(!t)return`${r}; this page's Angular version is unknown.`;let i=Qw(t);return eT(t,n.since)?`${r} in a development build; this page runs Angular ${i} without it, which usually means a production build.`:`${r}; this page runs Angular ${i}.`}function rT(e){return e.hydration===`hydrated`&&e.hydratedAt===void 0?`hydrated before inspection`:e.hydration}var iT=/^on (viewport|interaction|hover)\b/;function aT(e){let t=e.filter(e=>!/^(prefetch|hydrate) /.test(e));return t.length>0&&t.every(e=>iT.test(e))}function oT(e,t){let n=[],r=e.since>0?Math.max(0,Math.round((t-e.since)/1e3)):0;return e.state===`error`&&n.push({kind:`failed`,text:`failed to load`,label:`failed`}),(e.state===`placeholder`||e.state===`initial`)&&r*1e3>=1e4&&n.push(aT(e.triggers)?{kind:`waiting`,text:`waiting for its trigger for ${r}s`,label:`waiting ${r}s`,seconds:r}:{kind:`stuck`,text:`on its placeholder for ${r}s`,label:`stuck ${r}s`,seconds:r}),e.hydrateNever?n.push({kind:`hydrate-never`,text:`hydrate never: the server HTML stays static`,label:`hydrate never`}):e.hydration===`dehydrated`&&n.push({kind:`dehydrated`,text:`still dehydrated`,label:`dehydrated`}),n}var sT=`pangular-page-id`,cT=null;function lT(e){cT=e}function uT(){if(cT)return cT;try{return new URLSearchParams(location.search).get(`pageId`)||(window.top===window?null:sessionStorage.getItem(sT)||null)}catch{return null}}function dT(e,t){if(t.chosen&&e[t.chosen])return t.chosen;if(t.host)return t.host;if(t.previous&&e[t.previous])return t.previous;let n=null;for(let t of Object.values(e))(!n||t.reportedAt>n.reportedAt)&&(n=t);return n?.pageId??null}function fT(e,t){return e?t?e.pages?.[t]??null:e:null}function pT(e,t){return e?t?e.pages?.[t]??null:e.graph??null:null}function mT(){return{functions:[...Hw]}}function hT(e,t,n){return e?e.scope(`pangular`).rpc.call(t,...n===void 0?[]:[n]):Promise.resolve(null)}function gT(e,t,n){return hT(e,t,n).then(e=>e,()=>null)}function _T(e){return e?.connectionMeta.backend===`static`}function vT(e){let t=()=>{let t=e()?.scope(`pangular`).rpc;t&&(t.callEvent(`request-page-highlight`,null),t.callEvent(`request-form-highlight`,null))};return addEventListener(`pagehide`,t),()=>{removeEventListener(`pagehide`,t),t()}}function yT(e=globalThis){delete e.__DEVFRAME_CONNECTION__,delete e.__DEVFRAME_CONNECTION_META__}function bT(e){return e.split(`@`)[1]??``}var xT={signal:`Signal Forms`,reactive:`Reactive`,template:`Template-driven`},ST={own:`validator`,directive:`template attribute`,tree:`cross-field rule`,async:`async`,parse:`parse`,submission:`server`,schema:`schema`,manual:`setErrors`},CT=gT,wT={key:`name looks secret`,"input-type":`password input`,autocomplete:`autocomplete is a secret kind`,marker:`marked as mask`,parent:`inside a secret group`,config:`listed in mask`};function TT(e){return wT[e]??e}var ET=`https://pangular-inspector.dev/security/#opt-fields-in-or-out`;async function DT(e,t){return await CT(e,`request-form-action`,t)??{ok:!1,error:`The devtools server did not answer.`}}function OT(e){return`${e.ok?e.message??`Done.`:e.error??`Failed.`}${e.skipped?.length?` Skipped: ${e.skipped.map(e=>`${e.path} (${e.reason})`).join(`, `)}.`:``}${e.status?` Status: ${e.status}.`:``}`}var kT=/"(?:[^"\\\n]|\\.)*"|`([^`\n]*)`|\*\*/g;function AT(e){return(e??``).replace(/^_Labels, paths.*_\n\n/,``).replace(kT,(e,t)=>t??(e===`**`?``:e))}function jT(e,t){let n=Math.max(0,e-t),r=Math.ceil(n/6e4);if(r<60)return`in ${r} min`;let i=Math.round(r/60);return i<48?`in ${i} ${i===1?`hour`:`hours`}`:`in ${Math.round(i/24)} days`}function MT(e,t){return e.length?e.join(`, `):t}function NT(e,t){let n=[];if(n.push({label:`One-time code`,value:e.auth?e.oneTimeCode.state===`locked`?`Locked after too many wrong codes: run pangular token --rotate or restart the server for a new code`:e.oneTimeCode.expiresAt?`On, current code expires ${jT(e.oneTimeCode.expiresAt,t)}`:`On`:`Off: every client is trusted`}),e.auth){let{count:r,nextExpiresAt:i,lastExpiresAt:a}=e.tokens;n.push({label:`Trusted clients`,value:r?r===1||i===a?`${r} ${r===1?`token`:`tokens`}, expires ${jT(i??t,t)}`:`${r} tokens, the first expires ${jT(i??t,t)}, the last ${jT(a??t,t)}`:`None`}),e.pairingTokens&&n.push({label:`Pairing tokens`,value:`${e.pairingTokens} accepted instead of the code`})}return e.reported?(n.push({label:`Reach`,value:e.network?`This machine and other machines`:`This machine only`}),n.push({label:`Allowed origins`,value:e.originCheck?`${MT(e.allowedOrigins,`This machine and the Chrome extension`)}${e.customOrigins?`, plus a custom origin check`:``}`:`Any: the origin check is off`}),(e.allowedHosts===`any`||e.allowedHosts.length)&&n.push({label:`Allowed hosts`,value:e.allowedHosts===`any`?`Any`:e.allowedHosts.join(`, `)}),n):n}function PT(e){return Bw(e?.connectionMeta)}function FT(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)?[...e]:void 0}function IT(e,t){if(!t||typeof t!=`object`)return e;let n=FT(t.secretNames),r=FT(t.unmask);if(!n||!r)return e;let i=ww(t.entropy);return{...e,redaction:i?{secretNames:n,unmask:r,entropy:i}:{secretNames:n,unmask:r}}}function LT(e,t){return PT(e).actions[t]}var RT={components:`components`,routes:`router`,signals:`signals`,injectors:`injectors`,store:`ngrx`,queries:`tanstackQuery`,forms:`forms`,pipes:`pipes`,network:`http`,analog:`analog`,capacitor:`capacitor`,errors:`errors`,plugins:`plugins`,performance:`performance`,build:`build`};function zT(e){return RT[e]}var BT=`https://pangular-inspector.dev/getting-started/configuration/#inspectors-and-agent-tools`;function VT(e,t){let n=RT[e];return!n||t.inspectors[n]}function HT(e,t){e&1&&(w(),fg(0,`rect`,5)(1,`rect`,6)(2,`rect`,7)(3,`rect`,8))}function UT(e,t){e&1&&(w(),fg(0,`path`,9)(1,`circle`,10)(2,`circle`,11)(3,`path`,12))}function WT(e,t){e&1&&(w(),fg(0,`path`,13)(1,`path`,14))}function GT(e,t){e&1&&(w(),fg(0,`path`,15)(1,`path`,16)(2,`path`,17))}function KT(e,t){e&1&&(w(),fg(0,`circle`,18)(1,`path`,19)(2,`circle`,20))}function qT(e,t){e&1&&(w(),fg(0,`path`,1))}function JT(e,t){e&1&&(w(),fg(0,`path`,21)(1,`path`,22)(2,`path`,23)(3,`path`,24))}function YT(e,t){e&1&&(w(),fg(0,`ellipse`,25)(1,`path`,26)(2,`path`,27))}function XT(e,t){e&1&&(w(),fg(0,`rect`,28)(1,`path`,29)(2,`path`,30)(3,`path`,31))}function ZT(e,t){e&1&&(w(),fg(0,`circle`,32)(1,`path`,9)(2,`path`,33))}function QT(e,t){e&1&&(w(),fg(0,`path`,34)(1,`path`,35)(2,`path`,36)(3,`path`,37)(4,`circle`,38))}function $T(e,t){e&1&&(w(),fg(0,`circle`,39)(1,`path`,40))}function eE(e,t){e&1&&(w(),fg(0,`ellipse`,41)(1,`path`,42)(2,`path`,43)(3,`path`,44)(4,`path`,45))}function tE(e,t){e&1&&(w(),fg(0,`circle`,32)(1,`path`,46)(2,`path`,47))}function nE(e,t){e&1&&(w(),fg(0,`path`,48)(1,`path`,49))}function rE(e,t){e&1&&(w(),fg(0,`path`,50)(1,`path`,51)(2,`path`,52))}function iE(e,t){e&1&&(w(),fg(0,`path`,2))}function aE(e,t){e&1&&(w(),fg(0,`path`,3))}function oE(e,t){e&1&&(w(),fg(0,`path`,4))}var sE=class e{name=$.required();static ɵfac=function(t){return new(t||e)};static ɵcmp=O({type:e,selectors:[[`app-tab-icon`]],inputs:{name:[1,`name`]},decls:20,vars:1,consts:[[`viewBox`,`0 0 24 24`,`width`,`16`,`height`,`16`,`fill`,`none`,`stroke`,`currentColor`,`stroke-width`,`1.8`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,`aria-hidden`,`true`],[`d`,`M22 12h-4l-3 9L9 3l-3 9H2`],[`d`,`M10 3h4v3a2 2 0 1 0 4 0V5h1a2 2 0 0 1 2 2v4h-2a2 2 0 1 0 0 4h2v4a2 2 0 0 1-2 2h-4v-2a2 2 0 1 0-4 0v2H7a2 2 0 0 1-2-2v-4H4a2 2 0 1 1 0-4h1V7a2 2 0 0 1 2-2h3Z`],[`d`,`m8 3 4 8 5-5 5 15H2L8 3z`],[`fill`,`currentColor`,`stroke`,`none`,`transform`,`translate(1.8 1.8) scale(0.85)`,`d`,`M24 3.7l-5.766 5.766 5.725 5.736-3.713 3.712L5.073 3.742 8.786.03l5.736 5.726L20.284 0 24 3.7zM.029 8.785l3.713-3.713 15.173 15.173-3.713 3.714-5.732-5.726L3.7 24 0 20.285l5.754-5.764L.029 8.785z`],[`x`,`3`,`y`,`3`,`width`,`7`,`height`,`9`,`rx`,`1.5`],[`x`,`14`,`y`,`3`,`width`,`7`,`height`,`5`,`rx`,`1.5`],[`x`,`14`,`y`,`12`,`width`,`7`,`height`,`9`,`rx`,`1.5`],[`x`,`3`,`y`,`16`,`width`,`7`,`height`,`5`,`rx`,`1.5`],[`d`,`M3 12h18`],[`cx`,`7`,`cy`,`12`,`r`,`2`],[`cx`,`14`,`cy`,`12`,`r`,`2`],[`d`,`M18 7v10`],[`d`,`M9 11l2 2 4-4`],[`d`,`M12 3 4 6v6c0 4.5 3.4 8.3 8 9 4.6-.7 8-4.5 8-9V6l-8-3Z`],[`d`,`M12 2 3 7l9 5 9-5-9-5Z`],[`d`,`m3 12 9 5 9-5`],[`d`,`m3 17 9 5 9-5`],[`cx`,`6`,`cy`,`19`,`r`,`3`],[`d`,`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`],[`cx`,`18`,`cy`,`5`,`r`,`3`],[`d`,`M12 22v-5`],[`d`,`M9 8V2`],[`d`,`M15 8V2`],[`d`,`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`],[`cx`,`12`,`cy`,`5`,`rx`,`9`,`ry`,`3`],[`d`,`M3 5v14a9 3 0 0 0 18 0V5`],[`d`,`M3 12a9 3 0 0 0 18 0`],[`x`,`3`,`y`,`4`,`width`,`18`,`height`,`16`,`rx`,`2`],[`d`,`M7 9h10`],[`d`,`M7 13h6`],[`d`,`M7 17h8`],[`cx`,`12`,`cy`,`12`,`r`,`9`],[`d`,`M12 3a14 14 0 0 1 0 18a14 14 0 0 1 0-18Z`],[`d`,`M4 7h10`],[`d`,`M4 17h6`],[`d`,`m14 13 4 4-4 4`],[`d`,`M10 17h8`],[`cx`,`18`,`cy`,`7`,`r`,`3`],[`cx`,`12`,`cy`,`12`,`r`,`3`],[`d`,`M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z`],[`cx`,`11`,`cy`,`5`,`rx`,`8`,`ry`,`3`],[`d`,`M3 5v6c0 1.66 3.58 3 8 3`],[`d`,`M3 11v6c0 1.66 3.58 3 8 3`],[`d`,`M21 14a4 4 0 1 1-1.2-2.85L21 12.3`],[`d`,`M21 9v3.3h-3.3`],[`d`,`M12 7v6`],[`d`,`M12 16.5v.01`],[`d`,`M12 14l4-4`],[`d`,`M3.34 19a10 10 0 1 1 17.32 0`],[`d`,`M21 16V8l-9-5-9 5v8l9 5 9-5Z`],[`d`,`m3.3 7 8.7 5 8.7-5`],[`d`,`M12 22V12`]],template:function(e,t){if(e&1&&(w(),R(0,`svg`,0),A(1,HT,4,0)(2,UT,4,0)(3,WT,2,0)(4,GT,3,0)(5,KT,3,0)(6,qT,1,0,`:svg:path`,1)(7,JT,4,0)(8,YT,3,0)(9,XT,4,0)(10,ZT,3,0)(11,QT,5,0)(12,$T,2,0)(13,eE,5,0)(14,tE,3,0)(15,nE,2,0)(16,rE,3,0)(17,iE,1,0,`:svg:path`,2)(18,aE,1,0,`:svg:path`,3)(19,oE,1,0,`:svg:path`,4),z()),e&2){let e;D(),j((e=t.name())===`dashboard`?1:e===`timeline`?2:e===`audit`?3:e===`components`?4:e===`routes`?5:e===`signals`?6:e===`injectors`?7:e===`store`?8:e===`forms`?9:e===`network`?10:e===`pipes`?11:e===`settings`?12:e===`queries`?13:e===`errors`?14:e===`performance`?15:e===`build`?16:e===`plugins`?17:e===`analog`?18:e===`capacitor`?19:-1)}},styles:[`[_nghost-%COMP%] { +`))}}h()}return(async()=>{try{let e=await a(o,{headers:{accept:`text/event-stream`},signal:c.signal});if(!e.ok||!e.body)throw Error(`Devframe SSE stream request failed: ${e.status}`);await te(e.body)}catch(e){if(c.signal.aborted){h();return}ee(e instanceof Error?e:Error(String(e)))}})(),{close:()=>{l=!0,c.abort(),d?.cancel().catch(()=>{})},on:e=>{u=e},post:async e=>{let t;try{t=await m}catch{return}if(l){n(Error(`Devframe SSE channel is closed; message dropped`));return}try{let n=await a(o,{method:`POST`,headers:{"content-type":`text/plain; charset=utf-8`,[xS]:t},body:e});if(n.status===200){let e=await n.text();e&&u?.(e);return}if(!n.ok)throw Error(`Devframe SSE POST failed: ${n.status}`)}catch(e){n(e instanceof Error?e:Error(String(e)))}},serialize:s.serialize,deserialize:s.deserialize}}function dC(e,t){let{channel:n,rpcOptions:r={}}=t;return Py(e,{...n,timeout:-1,...r,proxify:!1})}function fC(e){let{transport:t,authToken:n,connectionMeta:r,events:i,clientRpc:a,rpcOptions:o={},callTimeout:s=0}=e,c=!1,l=`connecting`,u=null,d=Promise.withResolvers();function f(e,t=null){if(t?u=t:e===`connected`&&(u=null),e===l)return;let n=l;l=e,i.emit(wy.client.connectionStatus,e,n)}let p=new Set;function m(e){for(let t of[...p])t.reject(e)}function ee(){return l===`disconnected`||l===`error`?new QS(`connection`,`[devframe] Not connected to the devframe server`,{cause:u??void 0}):l===`unauthorized`?new QS(`auth`,`[devframe] Not authorized by the devframe server`,{cause:u??void 0}):null}function h(e,t){return new Promise((n,r)=>{let a=!1,o,c={reject(e){a||(l(),i.emit(wy.client.error,e,t),r(e))}};function l(){a=!0,p.delete(c),o&&clearTimeout(o)}p.add(c),s>0&&(o=setTimeout(()=>{c.reject(new QS(`timeout`,`[devframe] RPC call "${t}" timed out after ${s}ms`))},s)),e.then(e=>{a||(l(),n(e))},e=>{if(a)return;l();let n=e instanceof Error?e:Error(String(e));i.emit(wy.client.error,n,t),r(n)})})}let g=new Map;for(let e of r.jsonSerializableMethods??[])g.set(e,{jsonSerializable:!0});let te=e.createChannel({definitions:g,onError(e){f(`error`,e),i.emit(wy.client.connectionError,e),m(new QS(`connection`,`[devframe] Connection to the devframe server failed`,{cause:e}))},onDisconnected(){l!==`error`&&f(`disconnected`),m(new QS(`connection`,`[devframe] Disconnected from the devframe server`,{cause:u??void 0}))}}),ne=dC(a.functions,{channel:te,rpcOptions:o});a.register({name:wy.broadcast.authRevoked,type:`event`,handler:()=>{c=!1;let e=new QS(`auth`,`[devframe] The devframe server revoked this client's trust`);f(`unauthorized`,e),i.emit(wy.client.connectionError,e),m(e),i.emit(wy.client.isTrustedUpdated,!1)}});let re=n;async function ie(e){re=e;let t=await ne.$call(`anonymous:devframe:auth`,{authToken:e,ua:navigator.userAgent,origin:location.origin});if(c=t.isTrusted,c)d.resolve(!0),f(`connected`);else{let e=new QS(`auth`,`[devframe] The devframe server refused this client's credentials`);f(`unauthorized`,e),i.emit(wy.client.connectionError,e)}return i.emit(wy.client.isTrustedUpdated,c),t.isTrusted}async function ae(e){let t=(await ne.$call(`anonymous:devframe:auth:exchange`,{code:e,ua:navigator.userAgent,origin:location.origin}))?.authToken??null;return t&&(re=t,c=!0,d.resolve(!0),f(`connected`),i.emit(wy.client.isTrustedUpdated,!0)),t}async function oe(e={}){await ne.$call(`anonymous:devframe:auth:request-code`,{ua:navigator.userAgent,origin:location.origin,...e.reissue?{reissue:!0}:{}})}async function se(){return c?!0:ie(re??``)}async function ce(e=6e4){if(c&&d.resolve(!0),e<=0)return d.promise;let t;try{return await Promise.race([d.promise,new Promise((n,r)=>{t=setTimeout(()=>{r(Error(`[devframe] Timeout waiting for rpc to be trusted`))},e)})]),c}finally{clearTimeout(t)}}return{transport:t,get isTrusted(){return c},get status(){return l},get connectionError(){return u},requestTrust:se,requestTrustWithToken:ie,requestTrustWithCode:ae,requestAuthCode:oe,ensureTrusted:ce,call:(...e)=>{let t=String(e[0]),n=ee();return n?(i.emit(wy.client.error,n,t),Promise.reject(n)):h(ne.$call(...e),t)},callEvent:(...e)=>{let t=ee();if(t){i.emit(wy.client.error,t,String(e[0]));return}return ne.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),n=ee();return n?(i.emit(wy.client.error,n,t),Promise.reject(n)):h(ne.$callOptional(...e),t)},close:()=>{te.close()}}}function pC(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})();if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`;return new URL(e.path??`/`,`${r.protocol}//${t}`).href}return new URL(e.path??``,r).href}let i=e??``;return/^https?:\/\//i.test(i)?i:new URL(i,r).href}function mC(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},sseOptions:s={},callTimeout:c=0}=e,l=pC(n.sse,r??`./`,location);return fC({transport:`sse`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>uC({url:l,authToken:t,definitions:e.definitions,...s,onConnected(){s.onConnected?.()},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(){e.onDisconnected(),s.onDisconnected?.()}})})}function hC(e){let{name:t,message:n,cause:r,...i}=e,a=r instanceof Error?r:gC(r)?hC(r):r,o=a===void 0?Error(n):Error(n,{cause:a});return o.name=t,Object.assign(o,i),o}function gC(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}function _C(e){return typeof e==`object`&&!!e&&e.type===`static`&&typeof e.path==`string`}function vC(e){return typeof e==`object`&&!!e&&e.type===`query`&&typeof e.records==`object`&&e.records!==null}function yC(e){return typeof e==`object`&&!!e&&(`output`in e||`error`in e)}function bC(e){if(e.error)throw hC(e.error);return e.output}function xC(e){return e.some(e=>e!=null)}function SC(e){return typeof e==`object`&&e&&`serialization`in e&&`data`in e?e.data:e}function CC(e,t){let n=new Map,r=new Map;function i(e,t){return t===`structured-clone`&&Array.isArray(e)?aS(e):e}function a(e,t){return i(SC(e),t)}async function o(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>a(t,e.serialization)));let r=await n.get(e.path);return yC(r)?bC(r):r}async function s(e,n){return r.has(e)||r.set(e,t(e).then(e=>a(e,n))),await r.get(e)}async function c(t,n){if(!(t in e))throw Error(`[devframe-rpc] Function "${t}" not found in dump store`);let r=e[t];if(_C(r)){if(xC(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if(vC(r)){let e=eb(n),i=r.records[e];if(i)return bC(await s(i,r.serialization));if(r.fallback)return bC(await s(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!xC(n))return r;throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await c(e,t),callOptional:async(t,n)=>{if(t in e)return await c(t,n)},callEvent:async(e,t)=>{}}}async function wC(e){let t=CC(await e.fetchJsonFromBases(SS),e.fetchJsonFromBases);return{transport:`static`,isTrusted:!0,status:`connected`,connectionError:null,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,requestTrustWithCode:async()=>null,requestAuthCode:async()=>{},ensureTrusted:async()=>!0,call:(...e)=>t.call(e[0],e.slice(1)),callEvent:(...e)=>t.callEvent(e[0],e.slice(1)),callOptional:(...e)=>t.callOptional(e[0],e.slice(1)),close:()=>{}}}var TC=``;function EC(e,t){return`${e}${TC}${t}`}function DC(e){let t=new Map,n=new Map;e.client.register({name:wy.broadcast.streamingChunk,type:`event`,handler(e,n,r,i){t.get(EC(e,n))?._push(r,i)}}),e.client.register({name:wy.broadcast.streamingEnd,type:`event`,handler(e,n,r){let i=EC(e,n),a=t.get(i);a&&(a._end(r),t.delete(i))}}),e.client.register({name:wy.broadcast.streamingUploadCancel,type:`event`,handler(e,t){let r=EC(e,t),i=n.get(r);i&&(i.abort(`server cancelled upload`),n.delete(r))}}),e.events.on(wy.client.isTrustedUpdated,n=>{if(n)for(let[n,r]of t){if(r.cancelled||r.done)continue;let t=n.indexOf(TC);if(t<0)continue;let i=n.slice(0,t),a=n.slice(t+1);e.callEvent(`devframe:streaming:subscribe`,i,a,{afterSeq:r.lastSeenSeq})}});function r(n,r,i={}){let a=EC(n,r),o=t.get(a);if(o)return o;let s=dS({id:r,highWaterMark:i.highWaterMark,onOverflow(e){console.warn(`[devframe] DF0029: Stream "${n}#${r}" dropped ${e} chunk(s) after exceeding the client high-water mark.`)},onCancel(){e.callEvent(`devframe:streaming:cancel`,n,r),t.delete(a)}});if(t.set(a,s),e.isTrusted)e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:0});else{let i=e.events.on(wy.client.isTrustedUpdated,o=>{o&&(i(),t.has(a)&&!s.cancelled&&!s.done&&e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:s.lastSeenSeq}))})}return s}function i(t,r){let i=EC(t,r),a=n.get(i);if(a)return a;let o=uS({id:r});return o.events.on(`chunk`,(n,i)=>{e.callEvent(`devframe:streaming:upload-chunk`,t,r,n,i)}),o.events.on(`end`,a=>{e.callEvent(`devframe:streaming:upload-end`,t,r,a),n.delete(i)}),n.set(i,o),o}return{subscribe:r,upload:i}}function OC(){}var kC=new Map;function AC(e){let t=e.url;e.authToken&&(t=`${t}?${TS}=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=OC,onError:i=OC,onDisconnected:a=OC,definitions:o=kC}=e;n.addEventListener(`open`,e=>{r(e)}),n.addEventListener(`error`,e=>{let t=e instanceof Error?e:Error(e.type);i(t)}),n.addEventListener(`close`,e=>{a(e)});let s=oC(o);return{close:()=>{n.close()},on:e=>{n.addEventListener(`message`,t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN){n.send(e);return}if(n.readyState===WebSocket.CONNECTING){let t=()=>{i(),n.readyState===WebSocket.OPEN&&n.send(e)},r=()=>i();function i(){n.removeEventListener(`open`,t),n.removeEventListener(`close`,r)}n.addEventListener(`open`,t),n.addEventListener(`close`,r);return}i(Error(`Devframe WebSocket is not open; message dropped`))},serialize:s.serialize,deserialize:s.deserialize}}function jC(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})(),i=r.protocol===`https:`?`wss:`:`ws:`;if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`,n=new URL(e.path??`/`,`${i}//${t}`);return n.protocol=i,n.href}let t=new URL(e.path??``,r);return t.protocol=i,t.href}if(typeof e==`number`)return`${i}//${r.hostname}:${e}`;let a=e??``;if(/^wss?:\/\//i.test(a))return a;if(/^https?:\/\//i.test(a))return sb(a,/^https/i.test(a)?`wss://`:`ws://`);let o=new URL(a,r);return o.protocol=i,o.href}function MC(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},wsOptions:s={},callTimeout:c=0}=e,l=jC(n.websocket,r??`./`,location);return fC({transport:`websocket`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>AC({url:l,authToken:t,definitions:e.definitions,...s,onConnected(e){s.onConnected?.(e)},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(t){e.onDisconnected(),s.onDisconnected?.(t)}})})}function NC(e){return e.includes(`:`)}function PC(e,t){return NC(t)?t:`${e}:${t}`}function FC(e){return{async get(t){return(await e()).value()?.[t]},async set(t,n){(await e()).mutate(e=>{if(e===void 0)return{[t]:n};e[t]=n})},async delete(t){(await e()).mutate(e=>{e!==void 0&&delete e[t]})},async all(){return(await e()).value()??{}},async onChange(t){return(await e()).on(`updated`,e=>t(e??{}))}}}function IC(e,t,n){let r=`devframe:settings:${n}:${t}`,i;function a(){return i||=(async()=>(await e.ensureTrusted(),e.sharedState.get(r)))().catch(e=>{throw i=void 0,e}),i}return FC(a)}function LC(e,t){return{global:IC(e,t,`global`),project:IC(e,t,`project`)}}function RC(e,t){return{namespace:t,base:e,rpc:{namespace:t,register(n){if(NC(n.name))throw Error(`[devframe] Scoped client RPC registration for namespace "${t}" received an already-namespaced function name "${n.name}". Pass a bare name without a ":" separator.`);e.client.register({...n,name:`${t}:${n.name}`})},call:((n,...r)=>e.call(PC(t,n),...r)),callEvent:((n,...r)=>e.callEvent(PC(t,n),...r)),callOptional:((n,...r)=>e.callOptional(PC(t,n),...r)),sharedState:((n,r)=>e.sharedState.get(PC(t,n),r)),streaming:{subscribe:(n,r,i)=>e.streaming.subscribe(PC(t,n),r,i),upload:(n,r)=>e.streaming.upload(PC(t,n),r)}},settings:LC(e,t),scope:e.scope}}function zC(){if(typeof document<`u`){let e=document.modelContext;if(e)return e}if(typeof navigator<`u`){let e=navigator.modelContext;if(e)return e}}function BC(e,t={}){let n=t.modelContext??zC();if(!n)return()=>{};let r=n,i=new Map,a=new Map;function o(t,n){let o=mS(t.name),s=a.get(o);if(s&&s!==t.name){console.warn(`[devframe] WebMCP tool name "${o}" (from "${t.name}") collides with "${s}"; keeping the first registration.`);return}let c=new AbortController,l=Fy(t.type,n),u=r.registerTool({name:o,description:n.description,inputSchema:Ry(t.args),annotations:{title:n.title??t.name,readOnlyHint:l===`read`,destructiveHint:l===`destructive`},execute:n=>VC(t,e.context,n)},{signal:c.signal});u&&`then`in u&&u.then(()=>{},()=>{}),a.set(o,t.name),i.set(t.name,()=>{c.abort(),u&&`unregister`in u&&typeof u.unregister==`function`&&u.unregister(),a.delete(o)})}function s(t){let n=t?[t]:[...e.definitions.keys()];for(let t of n){i.get(t)?.(),i.delete(t);let n=e.definitions.get(t),r=n?.agent;n&&r&&o(n,r)}}s();let c=e.onChanged(e=>s(e));return()=>{c();for(let e of i.values())e();i.clear()}}async function VC(e,t,n){try{let r=By(n,e.args?.length);return{content:[{type:`text`,text:HC(await(await PS(e,t))(...r))}]}}catch(e){return{isError:!0,content:[{type:`text`,text:UC(e)}]}}}function HC(e){return e===void 0?`undefined`:typeof e==`string`?e:JSON.stringify(e,null,2)}function UC(e){if(!(e instanceof Error))return String(e);let t=e.cause instanceof Error?` (cause: ${e.cause.message})`:``;return`${e.name}: ${e.message}${t}`}function WC(e,t){if(t.backend===`static`)return`static`;let n=t.websocket!==void 0,r=t.sse!==void 0;if(e===`websocket`){if(!n)throw Error(`[devframe] transport: 'websocket' was requested, but this server does not advertise a WebSocket endpoint`);return`websocket`}if(e===`sse`){if(!r)throw Error(`[devframe] transport: 'sse' was requested, but this server does not advertise an SSE endpoint`);return`sse`}if(t.backend===`sse`&&r)return`sse`;if(n)return`websocket`;if(r)return`sse`;throw Error(`[devframe] This server advertises no RPC transport (backend "none"), so there is nothing to connect to. Enable the WebSocket or SSE endpoint on the server, or use its static/MCP surfaces instead.`)}async function GC(e={}){let{baseURL:t=`./`,rpcOptions:n={},cacheOptions:r=!1}=e,i=tb(),a=Array.isArray(t)?t:[t],o=await ZS(e),{connectionMeta:s,metaBaseUrl:c,authToken:l}=o,u=a[0]??`./`;try{u=new URL(`.`,c).href}catch{}let d=new ES({functions:[],...typeof e.cacheOptions==`object`?e.cacheOptions:{}}),f={rpc:void 0},p=new FS(f),m=e.webmcp===!1?void 0:BC(p),ee,h=!1,g=0,te;function ne(){g++,te=void 0,d.clear(),r===!0&&d.updateOptions({functions:[]})}r&&(p.register({name:wy.broadcast.cacheInvalidate,type:`event`,handler:ne}),i.on(wy.client.connectionStatus,ne),i.on(wy.client.isTrustedUpdated,ne));async function re(e){let t=[u,...a.filter(e=>e!==u)].filter(e=>e!=null),n=[];for(let r of t)try{return await fetch(ob(e,r)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(`, `)}`,{cause:n})}let ie=e.callTimeout??0,ae=ie>0?ie:1/0,oe,se={authToken:l,connectionMeta:s,metaBaseUrl:c,events:i,clientRpc:p,callTimeout:e.callTimeout,rpcOptions:{...n,async onRequest(e,t,i){let a=performance.now()+ae;if(await n.onRequest?.call(this,e,t,i),r===!0&&e.i&&oe.isTrusted&&!e.m.startsWith(`anonymous:`)&&e.m!==`devframe:rpc:cacheable-functions`){function t(){if(performance.now()>=a)throw new QS(`timeout`,`[devframe] RPC call "${e.m}" timed out after ${ie}ms`)}for(;!te&&(t(),!(h||oe.status!==`connected`));){let e=g;te=oe.callOptional(`devframe:rpc:cacheable-functions`).then(t=>{e===g&&d.updateOptions({functions:t??[]})}).catch(t=>{throw e===g&&(te=void 0),t}),await te}await te,t()}let o=g;if(r&&e.i&&!h&&oe.isTrusted&&d.validate(e.m)){if(d.has(e.m,e.a))return i(d.cached(e.m,e.a));let n=await t(e);o===g&&!h&&d.apply(e,n)}else await t(e)}}},ce=WC(e.transport??`auto`,s);oe=ce===`static`?await wC({fetchJsonFromBases:re}):ce===`sse`?mC({...se,sseOptions:e.sseOptions}):MC({...se,wsOptions:e.wsOptions});let le;try{le=new BroadcastChannel(`devframe-auth`)}catch{}let ue,de=!1;function fe(e){return((...t)=>de||!ue?e(...t):ue.then(()=>e(...t)))}function pe(){h=!0,ne();try{ee?.(),m?.()}finally{try{le?.close()}finally{oe.close?.()}}}let me={events:i,get isTrusted(){return oe.isTrusted},get status(){return oe.status},get connectionError(){return oe.connectionError},get transport(){return oe.transport??ce},get connection(){return o},connectionMeta:s,ensureTrusted:oe.ensureTrusted,requestTrust:oe.requestTrust,requestTrustWithToken:async e=>(qS(e),o={...o,authToken:e},oe.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let t=await oe.requestTrustWithCode(e);if(!t)return!1;qS(t),o={...o,authToken:t};try{le?.postMessage({type:`auth-update`,authToken:t})}catch{}return!0},requestAuthCode:e=>oe.requestAuthCode(e),call:fe(oe.call),callEvent:fe(oe.callEvent),callOptional:fe(oe.callOptional),client:p,sharedState:void 0,services:void 0,streaming:void 0,cacheManager:d,scope:void 0,close:pe};me.sharedState=iC(me),me.streaming=DC(me),me.services=rC(me);let he=new Map;me.scope=(e=>{if(!e)return me;let t=he.get(e);return t||(t=RC(me,e),he.set(e,t)),t}),f.rpc=me;function ge(){try{return typeof window<`u`&&window.self===window.top}catch{return!1}}async function _e(){if(e.simpleAuth!==!1&&ge()&&typeof globalThis.prompt==`function`)for(await me.requestAuthCode().catch(()=>{});!me.isTrusted;){let e=globalThis.prompt(`devframe: enter the authentication code shown in your terminal`);if(e==null)return;let t=e.trim();if(t&&await me.requestTrustWithCode(t))return}}async function ve(){let t=await oe.requestTrust(),n=e.otpParam??`devframe_otp`,r=n?await nC(me,{param:n}):!1;t||r||me.isTrusted||await _e()}return ue=ve().then(()=>{de=!0},()=>{de=!0}),s.mcp&&vS(async()=>{let{setupBrowserAgentRpcBridge:e}=await import(`./browser-agent-rpc-KH4HHvHf-G6FmeCEh.js`);return{setupBrowserAgentRpcBridge:e}},[],import.meta.url).then(({setupBrowserAgentRpcBridge:e})=>{h||(ee=e(me))}).catch(()=>{}),le&&(le.onmessage=e=>{e.data?.type===`auth-update`&&e.data.authToken&&me.requestTrustWithToken(e.data.authToken)}),me}var KC=GC,qC=[`components`,`injectors`,`signals`,`ngrx`,`tanstackQuery`,`forms`,`router`,`pipes`,`http`,`analog`,`capacitor`,`errors`,`plugins`,`performance`,`build`],JC=[`angular`,`ngrx`,`analog`,`angular-native`,`nativescript`,`capacitor`];function YC(e){return`pangular:${e}`}var XC=[`forms`,`router`,`ngrx`,`http`,`analog`,`components`,`tanstackQuery`,`plugins`],ZC={refreshMs:{default:3e3,min:500,max:8e3},navigations:{default:50,min:5,max:500},formTimeline:{default:200,min:10,max:2e3},httpCalls:{default:200,min:10,max:2e3},changeLog:{default:200,min:10,max:2e3},cdCycles:{default:200,min:10,max:2e3},cdSlowMs:{default:16,min:1,max:1e3},capacitorCalls:{default:200,min:10,max:2e3},idleAfterMs:{default:6e4,min:0,max:6e5}},QC={"opted-out":`the request sets transferCache: false`,post:`POST requests are left out unless includePostRequests is set`,method:`only GET, HEAD and POST requests are cached`,"auth-headers":`it sends an Authorization, Proxy-Authorization or Cookie header`,credentials:`it sends credentials (withCredentials or credentials: include/same-origin)`,"no-cache-request":`the request asks for no-store, no-cache or private`,"no-cache-response":`the response has Cache-Control no-store, no-cache or private`,"set-cookie":`the response sets a cookie`,error:`failed responses are not stored`,mocked:`a fault rule answered before the transfer cache ran`,filter:`the transferCache filter passed to withPangular() left it out`,"cache-off-or-filter":`the transfer cache is off, or its filter (or another withHttpTransferCacheOptions setting) left it out`},$C=[[0,`Network error (offline)`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Content Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Content`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[499,`Client Closed Request`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[510,`Not Extended`],[511,`Network Authentication Required`],[520,`Web Server Returned an Unknown Error`],[521,`Web Server Is Down`],[522,`Connection Timed Out`],[523,`Origin Is Unreachable`],[524,`A Timeout Occurred`]];function ew(e){return $C.some(([t])=>t===e)}var tw=/^[a-z][a-z0-9-]{0,39}$/;function nw(e,t){let n=t.plugins?.[e],r=t.inspectors.plugins&&tw.test(e)&&(n?.enabled??!0);return{enabled:r,tools:r&&t.agent.tools.plugins&&(n?.tools??!0),actions:r&&t.actions.plugins&&(n?.actions??!0)}}var rw=`pangular`,iw={mod:`Mod`,ctrl:`Ctrl`,control:`Ctrl`,meta:`Meta`,cmd:`Meta`,command:`Meta`,alt:`Alt`,option:`Alt`,opt:`Alt`,shift:`Shift`},aw=[`Mod`,`Ctrl`,`Meta`,`Alt`,`Shift`];function ow(e){if(typeof e!=`string`||e.length>40)return;let t=e.split(`+`).map(e=>e.trim());if(t.some(e=>!e))return;let n=new Set,r;for(let e of t){let t=iw[e.toLowerCase()];if(t){if(n.has(t))return;n.add(t);continue}if(r!==void 0)return;if(/^[a-z0-9]$/i.test(e))r=e.toUpperCase();else if(/^f([1-9]|1[0-2])$/i.test(e))r=e.toUpperCase();else return}if(r&&[...n].some(e=>e!==`Shift`)&&!(n.has(`Mod`)&&(n.has(`Ctrl`)||n.has(`Meta`))))return[...aw.filter(e=>n.has(e)),r].join(`+`)}function sw(e,t,n){let r=t.split(`+`),i=r.pop(),a=new Set(r),o=a.has(`Ctrl`)||a.has(`Mod`)&&!n,s=a.has(`Meta`)||a.has(`Mod`)&&n;if(e.ctrlKey!==o||e.metaKey!==s||e.altKey!==a.has(`Alt`)||e.shiftKey!==a.has(`Shift`))return!1;if(/^F\d+$/.test(i))return e.key.toUpperCase()===i;let c=/^\d$/.test(i)?`Digit${i}`:`Key${i}`;return e.code?e.code===c:e.key.toUpperCase()===i}function cw(e,t){if(!t)return e.replace(/^Mod\b/,`Ctrl`);let n={Mod:`⌘`,Meta:`⌘`,Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`};return e.split(`+`).map(e=>n[e]??e).join(``)}var lw=[{id:`dashboard`,label:`Dashboard`},{id:`timeline`,label:`Timeline`},{id:`audit`,label:`Audit`},{id:`analog`,label:`Analog`,inspector:`analog`},{id:`components`,label:`Components`,inspector:`components`},{id:`routes`,label:`Routes`,inspector:`router`},{id:`signals`,label:`Signals`,inspector:`signals`},{id:`injectors`,label:`Injectors`,inspector:`injectors`},{id:`store`,label:`Store`,inspector:`ngrx`},{id:`queries`,label:`Queries`,inspector:`tanstackQuery`},{id:`forms`,label:`Forms`,inspector:`forms`},{id:`pipes`,label:`Pipes`,inspector:`pipes`},{id:`network`,label:`SSR & HTTP`,inspector:`http`},{id:`errors`,label:`Errors`,inspector:`errors`},{id:`performance`,label:`Performance`,inspector:`performance`},{id:`build`,label:`Build`,inspector:`build`},{id:`capacitor`,label:`Capacitor`,inspector:`capacitor`},{id:`plugins`,label:`Plugins`,inspector:`plugins`}],uw=1e4;function dw(e){return lw.filter(t=>!(`inspector`in t)||e.inspectors[t.inspector])}var fw={components:`a component instance, by its id in the component tree`,injectors:`a component's element injector, by the component's id`,signals:`a component's signal graph, by the component's id`,forms:`a form, by its id`},pw=200;function mw(e){let t=new URLSearchParams({tab:e.tab});return e.id&&t.set(`id`,e.id),e.page&&t.set(`page`,e.page),`#${t.toString()}`}function hw(e){let t=new URLSearchParams(e.replace(/^#/,``)),n=e=>{let n=t.get(e)?.trim();return n&&n.length<=pw?n:void 0},r=n(`tab`);if(!r)return null;let i=n(`id`),a=n(`page`);return{tab:r,...i?{id:i}:{},...a?{page:a}:{}}}var gw=[{id:`settings`,title:`Open settings`,group:`Go to`,keywords:`preferences tabs`},{id:`pick-component`,title:`Pick component on page`,group:`Actions`,keywords:`select inspect element`,inspector:`components`},{id:`cd-record-start`,title:`Start recording change detection`,group:`Actions`,keywords:`profiler cycles`,inspector:`components`},{id:`cd-record-stop`,title:`Stop recording change detection`,group:`Actions`,keywords:`profiler cycles`,inspector:`components`},{id:`cd-clear`,title:`Clear change detection recording`,group:`Actions`,keywords:`reset recordings cycles`,inspector:`components`},{id:`theme:system`,title:`Theme: follow the system`,group:`Theme`,keywords:`auto`},{id:`theme:light`,title:`Theme: light`,group:`Theme`},{id:`theme:dark`,title:`Theme: dark`,group:`Theme`},{id:`dock:float`,title:`Popup: float`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:bottom`,title:`Popup: dock to the bottom`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:right`,title:`Popup: dock to the right`,group:`Popup`,keywords:`dock`,popupOnly:!0},{id:`dock:reset-size`,title:`Popup: reset the docked size`,group:`Popup`,keywords:`splitter resize height width`,popupOnly:!0},{id:`popout`,title:`Popup: open in its own window`,group:`Popup`,keywords:`pop out detach new window`,popupOnly:!0},{id:`popout:return`,title:`Popup: back into the page`,group:`Popup`,keywords:`pop in attach dock window`,popupOnly:!0}];function _w(e){let t=dw(e).map(e=>({id:`tab:${e.id}`,title:`Go to ${e.label}`,group:`Go to`,keywords:`tab open`})),n=gw.filter(t=>!t.inspector||e.inspectors[t.inspector]).map(({inspector:e,...t})=>t);return[...t,...n]}function vw(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var yw=Object.freeze({minLength:24,threshold:4.5}),bw={min:16,max:512},xw={min:2,max:6};function Sw(e){return typeof e==`number`&&Number.isInteger(e)&&e>=bw.min&&e<=bw.max}function Cw(e){return typeof e==`number`&&Number.isFinite(e)&&e>=xw.min&&e<=xw.max}function ww(e){if(e===!0)return{...yw};if(!e||typeof e!=`object`||Array.isArray(e))return;let{minLength:t,threshold:n}=e;return{minLength:Sw(t)?t:yw.minLength,threshold:Cw(n)?n:yw.threshold}}function Tw(e){let t=ww(e);return t?{entropy:t}:{}}function Ew(e,t){return typeof e==`boolean`?e:t}var Dw=100,Ow=100;function kw(e){if(!Array.isArray(e))return[];let t=e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e&&e.length<=Ow);return[...new Set(t)].slice(0,Dw)}function Aw(e,t){let{default:n,min:r,max:i}=ZC[t];return typeof e!=`number`||!Number.isFinite(e)?n:Math.min(i,Math.max(r,Math.round(e)))}function jw(e,t){return Object.fromEntries(e.map(e=>[e,t(e)]))}function Mw(e){let t=vw(e),n=vw(t.agent),r=vw(t.inspectors),i=vw(n.tools),a=vw(t.actions),o=Ew(t.actions,!0),s=vw(t.redaction),c=vw(t.limits),l=jw(qC,e=>Ew(r[e],!0));return{inspectors:l,agent:{readOnly:Ew(n.readOnly,!1),tools:jw(qC,e=>l[e]&&Ew(i[e],!0)),browserTools:Ew(n.browserTools,!1)},actions:jw(XC,e=>l[e]&&Ew(a[e],o)),redaction:{secretNames:kw(s.secretNames),unmask:kw(s.unmask),...Tw(s.entropy)},limits:Object.fromEntries(Object.keys(ZC).map(e=>[e,Aw(c[e],e)])),popup:{hotkey:zw(vw(t.popup).hotkey)},plugins:Rw(t.plugins),lint:{rules:Iw(t.lint)},analog:Pw(t.analog),ngrx:{trace:Ew(vw(t.ngrx).trace,!1)}}}var Nw=500;function Pw(e){let t=vw(e).contentSchema;return typeof t==`string`&&t.trim()&&t.length<=Nw?{contentSchema:t.trim()}:{}}var Fw=200;function Iw(e){let t=vw(vw(e).rules),n={};for(let[e,r]of Object.entries(t).slice(0,Fw))typeof r==`boolean`&&(n[e]=r);return n}var Lw=100;function Rw(e){let t={};for(let[n,r]of Object.entries(vw(e)).slice(0,Lw)){if(!tw.test(n))continue;if(typeof r==`boolean`){t[n]={enabled:r,tools:!0,actions:!0};continue}let e=vw(r);r!==void 0&&Object.keys(e).length&&(t[n]={enabled:Ew(e.enabled,!0),tools:Ew(e.tools,!0),actions:Ew(e.actions,!0)})}return t}function zw(e){return e===!1?!1:ow(e)??`Alt+Shift+P`}function Bw(e){let t=e?.configs;return Mw(t?.[rw])}function Vw(e){return`${{forms:`Writing to forms`,router:`Navigating and clearing navigations`,ngrx:`Restoring NgRx state, dispatching actions and changing the Store DevTools history`,http:`Changing HTTP mock rules and SSR overrides, refetching the TransferState payload, and clearing HTTP calls`,analog:`Calling API routes, clearing server calls, running Nitro tasks and purging the Nitro cache`,components:`Editing component properties and signals`,tanstackQuery:`Invalidating and refetching TanStack queries`,plugins:`Running plugin actions`}[e]} is turned off in the devtools config (actions.${e}).`}var Hw=[`pangular:build-meta`],Uw={components:`Components`,injectors:`Injectors`,signals:`Signals`,ngrx:`NgRx`,tanstackQuery:`TanStack Query`,forms:`Forms`,router:`Router`,pipes:`Pipes`,http:`HTTP`,analog:`Analog`,capacitor:`Capacitor`,errors:`Errors`,plugins:`Plugins`,performance:`Performance`,build:`Build`},Ww={forms:`Form writes`,router:`Navigation`,ngrx:`NgRx restore, dispatch and Store DevTools`,http:`HTTP mocking`,analog:`Analog API calls`,components:`Component edits`,tanstackQuery:`TanStack Query invalidate and refetch`,plugins:`Plugin actions`},Gw={refreshMs:e=>`poll every ${e} ms`,navigations:e=>`${e} navigations`,formTimeline:e=>`${e} form events`,httpCalls:e=>`${e} HTTP calls`,changeLog:e=>`${e} NgRx changes`,cdCycles:e=>`${e} change detection cycles`,cdSlowMs:e=>`slow cycles over ${e} ms`,capacitorCalls:e=>`${e} Capacitor plugin calls`,idleAfterMs:e=>e?`idle ${e/1e3} s after the last agent call`:`never idle`};function Kw(e){if(!e)return[];let t=[`On`];return e.minLength!==yw.minLength&&t.push(`${e.minLength} characters or more`),e.threshold!==yw.threshold&&t.push(`up to ${e.threshold} bits per character`),t}function qw(e){let t=[],n=(e,n)=>{n.length&&t.push({label:e,value:n.join(`, `)})},r=qC.filter(t=>e.inspectors[t]);n(`Inspectors off`,qC.filter(t=>!e.inspectors[t]).map(e=>Uw[e])),n(`Agent`,e.agent.readOnly?[`Read-only`]:[]),n(`Hidden from the agent`,r.filter(t=>!e.agent.tools[t]).map(e=>Uw[e])),n(`Blocked actions`,XC.filter(t=>e.inspectors[t]&&!e.actions[t]).map(e=>Ww[e])),n(`Extra secret names`,e.redaction.secretNames),n(`Unmasked names`,e.redaction.unmask),n(`Entropy masking`,Kw(e.redaction.entropy)),n(`Limits`,Object.keys(ZC).filter(t=>e.limits[t]!==ZC[t].default).map(t=>Gw[t](e.limits[t]))),e.popup.hotkey!==`Alt+Shift+P`&&n(`Popup shortcut`,[e.popup.hotkey===!1?`Off`:e.popup.hotkey]);let i=Object.entries(e.plugins??{});return n(`Plugins off`,i.filter(([,e])=>!e.enabled).map(([e])=>e)),n(`Plugin tools or actions off`,i.filter(([,e])=>e.enabled&&(!e.tools||!e.actions)).map(([e,t])=>`${e} (${[!t.tools&&`tools`,!t.actions&&`actions`].filter(Boolean).join(`, `)})`)),n(`Lint rules off`,Object.entries(e.lint?.rules??{}).filter(([,e])=>!e).map(([e])=>e)),t}function Jw(e){let t={tags:[],directives:[],text:``},n=e.toLowerCase();return n=n.replace(/<\s*([^<>\s]+)\s*>/g,(e,n)=>(t.tags.push({value:n,exact:!0}),` `)),n=n.replace(/\[\s*([^[\]\s]+)\s*\]/g,(e,n)=>(t.directives.push({value:n,exact:!0}),` `)),n=n.replace(/(^|\s)([<[])([^<>[\]\s]*)$/,(e,n,r,i)=>(i&&(r===`<`?t.tags:t.directives).push({value:i,exact:!1}),n)),t.text=n.replace(/\s+/g,` `).trim(),t}function Yw(e){return!e.tags.length&&!e.directives.length&&!e.text}function Xw(e,t){let n=e.tag.toLowerCase(),r=(e.directives??[]).map(e=>e.toLowerCase()),i=(e.attributes??[]).map(e=>e.toLowerCase()),a=[...r,...r.map(e=>e.replace(/directive$/,``)),...i];for(let{value:e,exact:r}of t.tags)if(r?n!==e:!n.startsWith(e))return!1;for(let{value:e,exact:n}of t.directives)if(!a.some(t=>n?t===e:t.includes(e)))return!1;if(t.text){let a=t.text;if(!(e.name.toLowerCase().includes(a)||n.includes(a)||r.some(e=>e.includes(a))||i.some(e=>e.includes(a))))return!1}return!0}var Zw={debugApi:{subject:`Live data`,since:`12.0`},injectorProviders:{subject:`Reading providers and environment injectors`,since:`16.2`},injectorMetadata:{subject:`The full injector tree`,since:`17.0`},isSignal:{subject:`Telling signals apart in component values`,since:`17.1`},signalGraph:{subject:`The live signal graph`,since:`20.1`},deferBlocks:{subject:`Listing @defer blocks`,since:`19.1`},forBlocks:{subject:`Listing @for blocks`,since:`22.0`},profiler:{subject:`Recording change detection`,since:`20.0`},angularProfiling:{subject:`Angular profiling`,since:`20.0`},routerInstance:{subject:`The router debug util`,since:`20.3`}};function Qw(e){let t=/^(\d+)\.(\d+)/.exec(e.trim());return t?`${t[1]}.${t[2]}`:e.trim()}function $w(e){let t=/^(\d+)(?:\.(\d+))?/.exec(e.trim());return t?[Number(t[1]),Number(t[2]??0)]:null}function eT(e,t){let n=$w(e),r=$w(t);return!n||!r?!1:n[0]===r[0]?n[1]>=r[1]:n[0]>r[0]}function tT(e,t){return e?.capabilities?.[t]===!1}function nT(e,t){let n=Zw[e],r=`${n.subject} needs Angular ${n.since} or later`;if(!t)return`${r}; this page's Angular version is unknown.`;let i=Qw(t);return eT(t,n.since)?`${r} in a development build; this page runs Angular ${i} without it, which usually means a production build.`:`${r}; this page runs Angular ${i}.`}function rT(e){return e.hydration===`hydrated`&&e.hydratedAt===void 0?`hydrated before inspection`:e.hydration}var iT=/^on (viewport|interaction|hover)\b/;function aT(e){let t=e.filter(e=>!/^(prefetch|hydrate) /.test(e));return t.length>0&&t.every(e=>iT.test(e))}function oT(e,t){let n=[],r=e.since>0?Math.max(0,Math.round((t-e.since)/1e3)):0;return e.state===`error`&&n.push({kind:`failed`,text:`failed to load`,label:`failed`}),(e.state===`placeholder`||e.state===`initial`)&&r*1e3>=1e4&&n.push(aT(e.triggers)?{kind:`waiting`,text:`waiting for its trigger for ${r}s`,label:`waiting ${r}s`,seconds:r}:{kind:`stuck`,text:`on its placeholder for ${r}s`,label:`stuck ${r}s`,seconds:r}),e.hydrateNever?n.push({kind:`hydrate-never`,text:`hydrate never: the server HTML stays static`,label:`hydrate never`}):e.hydration===`dehydrated`&&n.push({kind:`dehydrated`,text:`still dehydrated`,label:`dehydrated`}),n}var sT=`pangular-page-id`,cT=null;function lT(e){cT=e}function uT(){if(cT)return cT;try{return new URLSearchParams(location.search).get(`pageId`)||(window.top===window?null:sessionStorage.getItem(sT)||null)}catch{return null}}function dT(e,t){if(t.chosen&&e[t.chosen])return t.chosen;if(t.host)return t.host;if(t.previous&&e[t.previous])return t.previous;let n=null;for(let t of Object.values(e))(!n||t.reportedAt>n.reportedAt)&&(n=t);return n?.pageId??null}function fT(e,t){return e?t?e.pages?.[t]??null:e:null}function pT(e,t){return e?t?e.pages?.[t]??null:e.graph??null:null}function mT(){return{functions:[...Hw]}}function hT(e,t,n){return e?e.scope(`pangular`).rpc.call(t,...n===void 0?[]:[n]):Promise.resolve(null)}function gT(e,t,n){return hT(e,t,n).then(e=>e,()=>null)}function _T(e){return e?.connectionMeta.backend===`static`}function vT(e){let t=()=>{let t=e()?.scope(`pangular`).rpc;t&&(t.callEvent(`request-page-highlight`,null),t.callEvent(`request-form-highlight`,null))};return addEventListener(`pagehide`,t),()=>{removeEventListener(`pagehide`,t),t()}}function yT(e=globalThis){delete e.__DEVFRAME_CONNECTION__,delete e.__DEVFRAME_CONNECTION_META__}function bT(e){return e.split(`@`)[1]??``}var xT={signal:`Signal Forms`,reactive:`Reactive`,template:`Template-driven`},ST={own:`validator`,directive:`template attribute`,tree:`cross-field rule`,async:`async`,parse:`parse`,submission:`server`,schema:`schema`,manual:`setErrors`},CT=gT,wT={key:`name looks secret`,"input-type":`password input`,autocomplete:`autocomplete is a secret kind`,marker:`marked as mask`,parent:`inside a secret group`,config:`listed in mask`};function TT(e){return wT[e]??e}var ET=`https://pangular-inspector.dev/security/#opt-fields-in-or-out`;async function DT(e,t){return await CT(e,`request-form-action`,t)??{ok:!1,error:`The devtools server did not answer.`}}function OT(e){return`${e.ok?e.message??`Done.`:e.error??`Failed.`}${e.skipped?.length?` Skipped: ${e.skipped.map(e=>`${e.path} (${e.reason})`).join(`, `)}.`:``}${e.status?` Status: ${e.status}.`:``}`}var kT=/"(?:[^"\\\n]|\\.)*"|`([^`\n]*)`|\*\*/g;function AT(e){return(e??``).replace(/^_Labels, paths.*_\n\n/,``).replace(kT,(e,t)=>t??(e===`**`?``:e))}function jT(e,t){let n=Math.max(0,e-t),r=Math.ceil(n/6e4);if(r<60)return`in ${r} min`;let i=Math.round(r/60);return i<48?`in ${i} ${i===1?`hour`:`hours`}`:`in ${Math.round(i/24)} days`}function MT(e,t){return e.length?e.join(`, `):t}function NT(e,t){let n=[];if(n.push({label:`One-time code`,value:e.auth?e.oneTimeCode.state===`locked`?`Locked after too many wrong codes: run pangular token --rotate or restart the server for a new code`:e.oneTimeCode.expiresAt?`On, current code expires ${jT(e.oneTimeCode.expiresAt,t)}`:`On`:`Off: every client is trusted`}),e.auth){let{count:r,nextExpiresAt:i,lastExpiresAt:a}=e.tokens;n.push({label:`Trusted clients`,value:r?r===1||i===a?`${r} ${r===1?`token`:`tokens`}, expires ${jT(i??t,t)}`:`${r} tokens, the first expires ${jT(i??t,t)}, the last ${jT(a??t,t)}`:`None`}),e.pairingTokens&&n.push({label:`Pairing tokens`,value:`${e.pairingTokens} accepted instead of the code`})}return e.reported?(n.push({label:`Reach`,value:e.network?`This machine and other machines`:`This machine only`}),n.push({label:`Allowed origins`,value:e.originCheck?`${MT(e.allowedOrigins,`This machine and the Chrome extension`)}${e.customOrigins?`, plus a custom origin check`:``}`:`Any: the origin check is off`}),(e.allowedHosts===`any`||e.allowedHosts.length)&&n.push({label:`Allowed hosts`,value:e.allowedHosts===`any`?`Any`:e.allowedHosts.join(`, `)}),n):n}function PT(e){return Bw(e?.connectionMeta)}function FT(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)?[...e]:void 0}function IT(e,t){if(!t||typeof t!=`object`)return e;let n=FT(t.secretNames),r=FT(t.unmask);if(!n||!r)return e;let i=ww(t.entropy);return{...e,redaction:i?{secretNames:n,unmask:r,entropy:i}:{secretNames:n,unmask:r}}}function LT(e,t){return PT(e).actions[t]}var RT={components:`components`,routes:`router`,signals:`signals`,injectors:`injectors`,store:`ngrx`,queries:`tanstackQuery`,forms:`forms`,pipes:`pipes`,network:`http`,analog:`analog`,capacitor:`capacitor`,errors:`errors`,plugins:`plugins`,performance:`performance`,build:`build`};function zT(e){return RT[e]}var BT=`https://pangular-inspector.dev/getting-started/configuration/#inspectors-and-agent-tools`;function VT(e,t){let n=RT[e];return!n||t.inspectors[n]}function HT(e,t){e&1&&(w(),fg(0,`rect`,5)(1,`rect`,6)(2,`rect`,7)(3,`rect`,8))}function UT(e,t){e&1&&(w(),fg(0,`path`,9)(1,`circle`,10)(2,`circle`,11)(3,`path`,12))}function WT(e,t){e&1&&(w(),fg(0,`path`,13)(1,`path`,14))}function GT(e,t){e&1&&(w(),fg(0,`path`,15)(1,`path`,16)(2,`path`,17))}function KT(e,t){e&1&&(w(),fg(0,`circle`,18)(1,`path`,19)(2,`circle`,20))}function qT(e,t){e&1&&(w(),fg(0,`path`,1))}function JT(e,t){e&1&&(w(),fg(0,`path`,21)(1,`path`,22)(2,`path`,23)(3,`path`,24))}function YT(e,t){e&1&&(w(),fg(0,`ellipse`,25)(1,`path`,26)(2,`path`,27))}function XT(e,t){e&1&&(w(),fg(0,`rect`,28)(1,`path`,29)(2,`path`,30)(3,`path`,31))}function ZT(e,t){e&1&&(w(),fg(0,`circle`,32)(1,`path`,9)(2,`path`,33))}function QT(e,t){e&1&&(w(),fg(0,`path`,34)(1,`path`,35)(2,`path`,36)(3,`path`,37)(4,`circle`,38))}function $T(e,t){e&1&&(w(),fg(0,`circle`,39)(1,`path`,40))}function eE(e,t){e&1&&(w(),fg(0,`ellipse`,41)(1,`path`,42)(2,`path`,43)(3,`path`,44)(4,`path`,45))}function tE(e,t){e&1&&(w(),fg(0,`circle`,32)(1,`path`,46)(2,`path`,47))}function nE(e,t){e&1&&(w(),fg(0,`path`,48)(1,`path`,49))}function rE(e,t){e&1&&(w(),fg(0,`path`,50)(1,`path`,51)(2,`path`,52))}function iE(e,t){e&1&&(w(),fg(0,`path`,2))}function aE(e,t){e&1&&(w(),fg(0,`path`,3))}function oE(e,t){e&1&&(w(),fg(0,`path`,4))}var sE=class e{name=$.required();static ɵfac=function(t){return new(t||e)};static ɵcmp=O({type:e,selectors:[[`app-tab-icon`]],inputs:{name:[1,`name`]},decls:20,vars:1,consts:[[`viewBox`,`0 0 24 24`,`width`,`16`,`height`,`16`,`fill`,`none`,`stroke`,`currentColor`,`stroke-width`,`1.8`,`stroke-linecap`,`round`,`stroke-linejoin`,`round`,`aria-hidden`,`true`],[`d`,`M22 12h-4l-3 9L9 3l-3 9H2`],[`d`,`M10 3h4v3a2 2 0 1 0 4 0V5h1a2 2 0 0 1 2 2v4h-2a2 2 0 1 0 0 4h2v4a2 2 0 0 1-2 2h-4v-2a2 2 0 1 0-4 0v2H7a2 2 0 0 1-2-2v-4H4a2 2 0 1 1 0-4h1V7a2 2 0 0 1 2-2h3Z`],[`d`,`m8 3 4 8 5-5 5 15H2L8 3z`],[`fill`,`currentColor`,`stroke`,`none`,`transform`,`translate(1.8 1.8) scale(0.85)`,`d`,`M24 3.7l-5.766 5.766 5.725 5.736-3.713 3.712L5.073 3.742 8.786.03l5.736 5.726L20.284 0 24 3.7zM.029 8.785l3.713-3.713 15.173 15.173-3.713 3.714-5.732-5.726L3.7 24 0 20.285l5.754-5.764L.029 8.785z`],[`x`,`3`,`y`,`3`,`width`,`7`,`height`,`9`,`rx`,`1.5`],[`x`,`14`,`y`,`3`,`width`,`7`,`height`,`5`,`rx`,`1.5`],[`x`,`14`,`y`,`12`,`width`,`7`,`height`,`9`,`rx`,`1.5`],[`x`,`3`,`y`,`16`,`width`,`7`,`height`,`5`,`rx`,`1.5`],[`d`,`M3 12h18`],[`cx`,`7`,`cy`,`12`,`r`,`2`],[`cx`,`14`,`cy`,`12`,`r`,`2`],[`d`,`M18 7v10`],[`d`,`M9 11l2 2 4-4`],[`d`,`M12 3 4 6v6c0 4.5 3.4 8.3 8 9 4.6-.7 8-4.5 8-9V6l-8-3Z`],[`d`,`M12 2 3 7l9 5 9-5-9-5Z`],[`d`,`m3 12 9 5 9-5`],[`d`,`m3 17 9 5 9-5`],[`cx`,`6`,`cy`,`19`,`r`,`3`],[`d`,`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`],[`cx`,`18`,`cy`,`5`,`r`,`3`],[`d`,`M12 22v-5`],[`d`,`M9 8V2`],[`d`,`M15 8V2`],[`d`,`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`],[`cx`,`12`,`cy`,`5`,`rx`,`9`,`ry`,`3`],[`d`,`M3 5v14a9 3 0 0 0 18 0V5`],[`d`,`M3 12a9 3 0 0 0 18 0`],[`x`,`3`,`y`,`4`,`width`,`18`,`height`,`16`,`rx`,`2`],[`d`,`M7 9h10`],[`d`,`M7 13h6`],[`d`,`M7 17h8`],[`cx`,`12`,`cy`,`12`,`r`,`9`],[`d`,`M12 3a14 14 0 0 1 0 18a14 14 0 0 1 0-18Z`],[`d`,`M4 7h10`],[`d`,`M4 17h6`],[`d`,`m14 13 4 4-4 4`],[`d`,`M10 17h8`],[`cx`,`18`,`cy`,`7`,`r`,`3`],[`cx`,`12`,`cy`,`12`,`r`,`3`],[`d`,`M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z`],[`cx`,`11`,`cy`,`5`,`rx`,`8`,`ry`,`3`],[`d`,`M3 5v6c0 1.66 3.58 3 8 3`],[`d`,`M3 11v6c0 1.66 3.58 3 8 3`],[`d`,`M21 14a4 4 0 1 1-1.2-2.85L21 12.3`],[`d`,`M21 9v3.3h-3.3`],[`d`,`M12 7v6`],[`d`,`M12 16.5v.01`],[`d`,`M12 14l4-4`],[`d`,`M3.34 19a10 10 0 1 1 17.32 0`],[`d`,`M21 16V8l-9-5-9 5v8l9 5 9-5Z`],[`d`,`m3.3 7 8.7 5 8.7-5`],[`d`,`M12 22V12`]],template:function(e,t){if(e&1&&(w(),R(0,`svg`,0),A(1,HT,4,0)(2,UT,4,0)(3,WT,2,0)(4,GT,3,0)(5,KT,3,0)(6,qT,1,0,`:svg:path`,1)(7,JT,4,0)(8,YT,3,0)(9,XT,4,0)(10,ZT,3,0)(11,QT,5,0)(12,$T,2,0)(13,eE,5,0)(14,tE,3,0)(15,nE,2,0)(16,rE,3,0)(17,iE,1,0,`:svg:path`,2)(18,aE,1,0,`:svg:path`,3)(19,oE,1,0,`:svg:path`,4),z()),e&2){let e;D(),j((e=t.name())===`dashboard`?1:e===`timeline`?2:e===`audit`?3:e===`components`?4:e===`routes`?5:e===`signals`?6:e===`injectors`?7:e===`store`?8:e===`forms`?9:e===`network`?10:e===`pipes`?11:e===`settings`?12:e===`queries`?13:e===`errors`?14:e===`performance`?15:e===`build`?16:e===`plugins`?17:e===`analog`?18:e===`capacitor`?19:-1)}},styles:[`[_nghost-%COMP%] { display: inline-flex; flex-shrink: 0; }`]})},cE=(e,t)=>t.tab,lE=(e,t)=>t.label;function uE(e,t){e&1&&K(0),e&2&&J(` `,W().meta()?.projectName,` `)}function dE(e,t){e&1&&K(0,` Project details unavailable `)}function fE(e,t){e&1&&K(0,` Loading… `)}function pE(e,t){e&1&&(K(0,` Run `),F(1,`code`),K(2,`pangular build`),I(),K(3,` again to rebuild the report. `))}function mE(e,t){e&1&&K(0,` Check that the dev server is running. `)}function hE(e,t){if(e&1){let e=B();F(0,`button`,13),H(`click`,function(){return S(e),C(W(2).loadMeta())}),K(1,`Try again`),I()}}function gE(e,t){if(e&1&&(F(0,`p`,11),A(1,pE,4,0)(2,mE,1,0),I(),A(3,hE,2,0,`button`,12)),e&2){let e=W();D(),j(e.staticReport()?1:2),D(2),j(e.staticReport()?-1:3)}}function _E(e,t){e&1&&(F(0,`li`,5)(1,`span`),K(2,`Analog`),I(),K(3),I()),e&2&&(D(3),q(t))}function vE(e,t){e&1&&(F(0,`li`)(1,`span`),K(2,`Change detection`),I(),K(3),I()),e&2&&(D(3),q(t))}function yE(e,t){if(e&1&&(F(0,`span`,20),K(1),I(),F(2,`span`,21),K(3),I()),e&2){let e=W().$implicit,t=W();D(),q(t.cards()[e.tab]?.value),D(2),q(t.cards()[e.tab]?.sub)}}function bE(e,t){e&1&&(F(0,`span`,22),K(1,`–`),I(),F(2,`span`,21),K(3,`Count unavailable`),I())}function xE(e,t){e&1&&(L(0,`span`,23),F(1,`span`,21),K(2,`Counting…`),I())}function SE(e,t){if(e&1){let e=B();F(0,`button`,14),H(`click`,function(){let t=S(e).$implicit;return C(W().navigate.emit(t.tab))}),F(1,`span`,15)(2,`span`,16),L(3,`app-tab-icon`,17),I(),F(4,`span`,18),K(5,`→`),I()(),F(6,`span`,19),K(7),I(),A(8,yE,4,2)(9,bE,4,0)(10,xE,3,0),I()}if(e&2){let e,n=t.$implicit,r=t.$index,i=W().stateOf(n.tab);n_(`animation-delay`,60*r,`ms`),k(`aria-busy`,i===`loading`),D(3),P(`name`,n.tab),D(4),q(n.label),D(),j((e=i)===`ready`?8:e===`error`?9:10)}}function CE(e,t){e&1&&(F(0,`p`),K(1,`Loading…`),I())}function wE(e,t){if(e&1&&(F(0,`div`)(1,`dt`),K(2),I(),F(3,`dd`),K(4),I()()),e&2){let e=t.$implicit;D(2),q(e.label),D(2),q(e.value)}}function TE(e,t){if(e&1&&(F(0,`dl`),M(1,wE,5,2,`div`,null,lE),I()),e&2){let e=W();D(),N(e.configItems())}}function EE(e,t){e&1&&(F(0,`p`),K(1,`Defaults`),I())}function DE(e,t){if(e&1&&(F(0,`div`)(1,`dt`),K(2),I(),F(3,`dd`),K(4),I()()),e&2){let e=t.$implicit;D(2),q(e.label),D(2),q(e.value)}}function OE(e,t){e&1&&(F(0,`section`,10)(1,`h2`,24),K(2,`Security`),I(),F(3,`dl`),M(4,DE,5,2,`div`,null,lE),I()()),e&2&&(D(4),N(t))}var kE=[{tab:`components`,label:`Components`},{tab:`routes`,label:`Routes`},{tab:`signals`,label:`Signals`},{tab:`injectors`,label:`Injectors`},{tab:`store`,label:`NgRx declarations`},{tab:`pipes`,label:`Pipes`},{tab:`forms`,label:`Forms`},{tab:`network`,label:`SSR & HTTP`}];function AE(e){return kE.filter(t=>VT(t.tab,e))}var jE={zoneless:`Zoneless`,zone:`zone.js`,"zone-unused":`Zoneless, zone.js loaded`};function ME(e){return e&&Object.hasOwn(jE,e)?jE[e]:null}var NE=new Set([`signal`,`computed`,`linkedSignal`,`effect`]),PE={action:[`action`,`actions`],reducer:[`reducer`,`reducers`],effect:[`effect`,`effects`],selector:[`selector`,`selectors`],feature:[`feature`,`features`],"store-setup":[`setup call`,`setup calls`],"signal-store":[`signal store`,`signal stores`],"signal-state":[`signal state`,`signal states`],"signal-method":[`signal method`,`signal methods`]};function FE(e,t,n){return`${e} ${e===1?t:n}`}function IE(e,t){for(let n of e??[])t(n),IE(n.children,t)}function LE(e){if(!e.some(e=>e.kind))return{value:e.length,sub:`discovered in source`};let t=e.filter(e=>e.kind===`directive`).length;return{value:e.length-t,sub:`components · ${FE(t,`directive`,`directives`)}`}}function RE(e){if(!e.some(e=>e.kind))return{value:e.length,sub:`route entries in source`};let t=e.filter(e=>e.kind===`redirect`).length;return{value:new Set(e.filter(e=>e.kind===`page`).map(e=>e.fullPath??e.path??``)).size,sub:`navigable paths · ${FE(t,`redirect`,`redirects`)}`}}function zE(e){let t=new Map;for(let n of e)n.kind&&t.set(n.kind,(t.get(n.kind)??0)+1);if(!t.size)return{value:e.length,sub:`declarations in source`};let n=[...t].sort((e,t)=>t[1]-e[1]).map(([e,t])=>{let[n,r]=PE[e]??[e,e];return FE(t,n,r)});return{value:e.length,sub:n.join(` · `)}}function BE(e,t){let n=e?.forms??[],r=t?n.filter(e=>bT(e.id)===t):n;if(!r.length)return{value:0,sub:`no forms on the page yet`};let i=r.filter(e=>e.root?.status===`INVALID`).length;return{value:r.length,sub:`${r.length===1?`form`:`forms`} · ${i} invalid`}}function VE(e){return e.cancelled||e.status===void 0?!1:e.status===0||e.status>=400}function HE(e,t){let n=e?.pages??[],r=t?n.find(e=>e.pageId===t)??null:n.reduce((e,t)=>!e||t.reportedAt>e.reportedAt?t:e,null),i=t&&!r?[]:e?.serverCalls??[],a=r?.initialUrl,o=[...a?i.filter(e=>!e.pageUrl||e.pageUrl===a):i,...r?.calls??[]];if(!o.length)return{value:0,sub:`no calls recorded yet`};let s=o.filter(VE).length;return{value:o.length,sub:`${o.length===1?`call`:`calls`} · ${s} failed`}}var UE=class e{rpc=$(null);navigate=lv();staticReport=X(()=>_T(this.rpc()));meta=T(null);security=T(null);redaction=T(null);config=X(()=>IT(PT(this.rpc()),this.redaction()));stats=X(()=>this.rpc()?AE(this.config()):[]);configItems=X(()=>qw(this.config()));metaState=T(`loading`);states=T({});rows=T({});injectorTree=T(null);signalGraph=T(null);formsState=T(null);httpState=T(null);pageId=uT();destroyRef=x(Ss);stopLive=[];zone=X(()=>ME(fT(this.injectorTree(),this.pageId)?.zone));liveInjectors=X(()=>{let e=fT(this.injectorTree(),this.pageId);if(!e?.roots?.length)return null;let t=0,n=0,r=e=>{t++,n+=e.providers?.length??0};return IE(e.roots,r),IE(e.environment,r),{injectors:t,providers:n}});liveSignals=X(()=>{let e=pT(this.signalGraph(),this.pageId);return e?.nodes?.length?e.nodes.filter(e=>NE.has(e.kind??``)).length:null});cards=X(()=>{let e=this.rows(),t={};if(e.components&&(t.components=LE(e.components)),e.routes&&(t.routes=RE(e.routes)),e.store&&(t.store=zE(e.store)),e.pipes){let n=e.pipes.filter(e=>e.builtin).length;t.pipes={value:e.pipes.length-n,sub:n?`custom pipes · ${n} built-in in use`:`custom pipes in source`}}let n=this.liveSignals();n===null?e.signals&&(t.signals={value:e.signals.length,sub:`signal declarations in source`}):t.signals={value:n,sub:e.signals?`live on the page · ${e.signals.length} declared in source`:`live on the page`};let r=this.liveInjectors();r?t.injectors={value:r.injectors,sub:`live injectors · ${FE(r.providers,`provider`,`providers`)}`}:e.injectors&&(t.injectors={value:e.injectors.filter(e=>e.type!==`injection`).length,sub:`provider declarations in source`});let i=this.formsState();i&&(t.forms=BE(i,this.pageId));let a=this.httpState();return a&&(t.network=HE(a,this.pageId)),t});loadMeta(e=this.rpc()){e&&(this.metaState.set(`loading`),e.scope(`pangular`).rpc.call(`build-meta`).then(t=>{this.rpc()===e&&(this.meta.set(t),this.metaState.set(`ready`))}).catch(()=>{this.rpc()===e&&this.metaState.set(`error`)}))}loadRedaction(e){this.redaction.set(null),!_T(e)&&hT(e,`redaction-config`).then(t=>{this.rpc()===e&&this.redaction.set(t)}).catch(()=>{})}loadSecurity(e){this.security.set(null),!_T(e)&&gT(e,`security-status`).then(t=>{this.rpc()===e&&t&&this.security.set(NT(t,Date.now()))})}constructor(){E(()=>{let e=this.rpc();if(!e)return;let t=e.scope(`pangular`);this.states.set({}),this.rows.set({}),this.formsState.set(null),this.httpState.set(null),this.loadMeta(e),this.loadRedaction(e),this.loadSecurity(e);let n=PT(e),r=e=>VT(e,n);r(`components`)&&this.load(t.rpc.call(`get-components`),`components`),r(`routes`)&&this.load(t.rpc.call(`get-routes`),`routes`),r(`signals`)&&this.load(t.rpc.call(`get-signals`),`signals`),r(`injectors`)&&this.load(t.rpc.call(`get-providers`),`injectors`),r(`store`)&&this.load(t.rpc.call(`get-ngrx-store`),`store`),r(`pipes`)&&this.load(t.rpc.call(`get-pipes`),`pipes`),this.watchLive(e,n)}),this.destroyRef.onDestroy(()=>this.unwatch())}stateOf(e){return(e===`signals`?this.liveSignals():e===`injectors`?this.liveInjectors():null)===null?this.states()[e]??`loading`:`ready`}load(e,t){let n=e=>this.states.update(n=>({...n,[t]:e}));e.then(e=>{this.rows.update(n=>({...n,[t]:Array.isArray(e)?e:[]})),n(`ready`)}).catch(()=>n(`error`))}async watchLive(e,t){this.unwatch();let n=e.scope(`pangular`).rpc,r=async(t,r,i)=>{let a=e=>i&&this.states.update(t=>({...t,[i]:e}));try{let i=await n.sharedState(t);if(this.destroyRef.destroyed||this.rpc()!==e)return;r(i.value()),a(`ready`),this.stopLive.push(i.on(`updated`,e=>r(e)))}catch{if(this.destroyRef.destroyed||this.rpc()!==e)return;r(null),a(`error`)}};await Promise.all([t.inspectors.injectors&&r(`injector-tree`,e=>this.injectorTree.set(e)),t.inspectors.signals&&r(`signal-graph`,e=>this.signalGraph.set(e)),VT(`forms`,t)&&r(`forms`,e=>this.formsState.set(e??{}),`forms`),VT(`network`,t)&&r(`http`,e=>this.httpState.set(e??{}),`network`)])}unwatch(){for(let e of this.stopLive.splice(0))e()}static ɵfac=function(t){return new(t||e)};static ɵcmp=O({type:e,selectors:[[`app-dashboard`]],inputs:{rpc:[1,`rpc`]},outputs:{navigate:`navigate`},decls:34,vars:15,consts:[[`aria-labelledby`,`project-title`,1,`project`],[1,`project-head`],[1,`eyebrow`],[`id`,`project-title`],[1,`chips`],[1,`analog`],[1,`grid`],[`type`,`button`,1,`stat`,3,`animation-delay`],[`aria-labelledby`,`config-title`,1,`config`],[`id`,`config-title`],[`aria-labelledby`,`security-title`,1,`config`],[1,`hint`],[`type`,`button`,1,`retry`],[`type`,`button`,1,`retry`,3,`click`],[`type`,`button`,1,`stat`,3,`click`],[1,`top`],[1,`icon`],[3,`name`],[`aria-hidden`,`true`,1,`go`],[1,`label`],[1,`big`],[1,`sub`],[1,`big`,`muted`],[`aria-hidden`,`true`,1,`big`,`skeleton`],[`id`,`security-title`]],template:function(e,t){if(e&1&&(F(0,`section`,0)(1,`div`,1)(2,`p`,2),K(3,`Project`),I(),F(4,`h2`,3),A(5,uE,1,1)(6,dE,1,0)(7,fE,1,0),I(),A(8,gE,4,2),I(),F(9,`ul`,4)(10,`li`)(11,`span`),K(12,`Angular`),I(),K(13),I(),F(14,`li`)(15,`span`),K(16,`TypeScript`),I(),K(17),I(),F(18,`li`)(19,`span`),K(20,`SSR`),I(),K(21),I(),A(22,_E,4,1,`li`,5),A(23,vE,4,1,`li`),I()(),F(24,`div`,6),M(25,SE,11,6,`button`,7,cE),I(),F(27,`section`,8)(28,`h2`,9),K(29,`Configuration`),I(),A(30,CE,2,0,`p`)(31,TE,3,0,`dl`)(32,EE,2,0,`p`),I(),A(33,OE,6,0,`section`,10)),e&2){let e,n,r,i;k(`aria-busy`,t.metaState()===`loading`),D(4),G(`muted`,t.metaState()!==`ready`),D(),j((e=t.metaState())===`ready`?5:e===`error`?6:7),D(3),j(t.metaState()===`error`?8:-1),D(),G(`pending`,t.metaState()===`loading`),D(4),q(t.meta()?.angularVersion??`…`),D(4),q(t.meta()?.typescript??`…`),D(4),q(t.meta()?t.meta()?.ssr?`On`:`Off`:`…`),D(),j((n=t.meta()?.analog)?22:-1,n),D(),j((r=t.zone())?23:-1,r),D(2),N(t.stats()),D(2),k(`aria-busy`,!t.rpc()),D(3),j(t.rpc()?t.configItems().length?31:32:30),D(3),j((i=t.security())?33:-1,i)}},dependencies:[sE],styles:[`[_nghost-%COMP%] { @@ -3927,7 +3927,7 @@ pre[_ngcontent-%COMP%] { .inline-detail[_ngcontent-%COMP%] .show-form[_ngcontent-%COMP%] { margin: 0 16px; -}`]})};function NI(e){return e.line?`${e.file}:${e.line}`:e.file}function PI(e,t){let n=t.filter(t=>t.fullPath===e.fullPath&&t.redirectTo!==void 0==(e.redirectTo!==void 0));return n.find(t=>!!e.component&&t.component===e.component)??n.find(t=>!t.component||!e.component)}function FI(e){return e?.apps&&e.apps.length>1?e.apps:[]}function II(e,t){let n=FI(e).find(e=>e.id===t);return n?n.primary?{...e,appId:n.id}:{pageId:e.pageId,reportedAt:e.reportedAt,changedAt:e.changedAt,snapshot:n.snapshot??null,navigations:n.navigations??[],dropped:n.dropped,generation:n.generation,config:n.config,configTruncated:n.configTruncated,activeIds:n.activeIds,setup:n.setup,loops:n.loops,apps:e.apps,appId:n.id}:e}var LI=gT;function RI(e){return e.startsWith(`/`)&&!e.startsWith(`//`)&&!/^\/*[a-z][a-z0-9+.-]*:/i.test(e)&&!e.includes(`[redacted]`)&&e.length<=2e3}var zI=`Could not reach the page.`;async function BI(e,t,n,r){return await LI(e,`request-router-action`,{pageId:t,...r?{app:r}:{},request:n})??{error:`Could not reach the page.`}}function VI(e){return e===`succeeded`?`good`:e===`redirected`||e===`pending`||e===`skipped`?`warn`:e===`cancelled`||e===`failed`?`bad`:``}var HI=()=>[],UI=(e,t)=>t[0],WI=(e,t)=>t.input;function GI(e,t){if(e&1&&(R(0,`p`,3),K(1,` The browser shows `),R(2,`code`),K(3),z(),K(4,`, not the router URL (skipLocationChange, browserUrl, a failed navigation or code that changed history). `),z()),e&2){let e=W();D(3),q(e.browserUrl)}}function KI(e,t){if(e&1&&(R(0,`p`,13),K(1),z()),e&2){let e=W(3);D(),q(e.navigationOff)}}function qI(e,t){if(e&1){let e=B();R(0,`div`,9),fg(1,`span`,10),R(2,`span`,11),K(3,`Navigating to `),R(4,`code`),K(5),z(),K(6),z(),R(7,`button`,12),U(`click`,function(){return S(e),C(W(2).abort())}),K(8,` Abort `),z()(),A(9,KI,2,1,`p`,13)}if(e&2){let e=t,n=W(2);D(5),q(e.url),D(),J(` (#`,e.id,`)`),D(),V(`disabled`,!n.navigationAllowed()),k(`aria-describedby`,n.navigationAllowed()?null:`route-current-writes-off`),D(2),j(n.navigationAllowed()?-1:9)}}function JI(e,t){if(e&1&&(R(0,`p`,4),K(1),z()),e&2){let e=W(2);D(),q(e.message())}}function YI(e,t){if(e&1&&(R(0,`dt`),K(1,`Document title`),z(),R(2,`dd`),K(3),z()),e&2){let e=W();D(3),q(e.title)}}function XI(e,t){if(e&1&&(R(0,`dt`),K(1,`Query params`),z(),R(2,`dd`)(3,`code`),K(4),Q_(5,`json`),z()()),e&2){let e=W();D(4),q($_(5,1,e.queryParams))}}function ZI(e,t){if(e&1&&(R(0,`dt`),K(1,`Fragment`),z(),R(2,`dd`)(3,`code`),K(4),z()()),e&2){let e=W();D(4),q(e.fragment)}}function QI(e,t){if(e&1&&(R(0,`span`,15),K(1),z()),e&2){let e=W().$implicit;D(),J(`, `,e.nesting)}}function $I(e,t){if(e&1&&(R(0,`span`,16),K(1),z()),e&2){let e=W().$implicit;D(),q(e.route.outlet)}}function eL(e,t){e&1&&(R(0,`span`,16),K(1,`lazy`),z())}function tL(e,t){if(e&1&&(R(0,`div`,17),K(1),z()),e&2){let e=W().$implicit;D(),Y(` title `,e.route.title,``,e.route.ownTitle===!1?` (inherited)`:``,` `)}}function nL(e,t){if(e&1&&(R(0,`code`,18),K(1),z()),e&2){let e=W().$implicit;D(),q(e.route.component)}}function rL(e,t){e&1&&(R(0,`span`,21),K(1,`–`),z(),R(2,`span`,15),K(3,`none`),z())}function iL(e,t){e&1&&(R(0,`span`,16),K(1,`inherited`),z())}function aL(e,t){if(e&1&&(R(0,`div`,19)(1,`code`),K(2),Q_(3,`json`),z(),A(4,iL,2,0,`span`,16),z()),e&2){let e=t.$implicit,n=W().$implicit;D(2),Y(``,e[0],`: `,$_(3,3,e[1])),D(2),j(n.route.paramSources?.[e[0]]===`inherited`?4:-1)}}function oL(e,t){e&1&&(R(0,`span`,21),K(1,`–`),z(),R(2,`span`,15),K(3,`none`),z())}function sL(e,t){e&1&&(R(0,`span`,16),K(1),z()),e&2&&(D(),q(t))}function cL(e,t){if(e&1&&(R(0,`div`,20)(1,`code`),K(2),Q_(3,`json`),z(),A(4,sL,2,1,`span`,16),z()),e&2){let e,n=t.$implicit,r=W().$implicit;D(2),Y(``,n[0],`: `,$_(3,3,n[1])),D(2),j((e=r.route.dataSources?.[n[0]])?4:-1,e)}}function lL(e,t){e&1&&(R(0,`span`,21),K(1,`–`),z(),R(2,`span`,15),K(3,`none`),z())}function uL(e,t){if(e&1&&(R(0,`span`,16),K(1),z()),e&2){let e=t.$implicit;D(),q(e)}}function dL(e,t){if(e&1&&(R(0,`span`,16),K(1),z()),e&2){let e=t.$implicit;D(),J(`resolve `,e)}}function fL(e,t){e&1&&(R(0,`span`,21),K(1,`–`),z(),R(2,`span`,15),K(3,`none`),z())}function pL(e,t){if(e&1&&(R(0,`tr`)(1,`td`,14),K(2),A(3,QI,2,1,`span`,15),A(4,$I,2,1,`span`,16),A(5,eL,2,0,`span`,16),A(6,tL,2,2,`div`,17),z(),R(7,`td`),A(8,nL,2,1,`code`,18)(9,rL,4,0),z(),R(10,`td`),M(11,aL,5,5,`div`,19,UI,!1,oL,4,0),z(),R(14,`td`),M(15,cL,5,5,`div`,20,UI,!1,lL,4,0),z(),R(18,`td`),M(19,uL,2,1,`span`,16,tg),M(21,dL,2,1,`span`,16,tg),A(23,fL,4,0),z()()),e&2){let e=t.$implicit,n=W(2);D(),n_(`padding-left`,14+e.depth*16,`px`),D(),J(` `,e.label,` `),D(),j(e.nesting?3:-1),D(),j(e.route.outlet===`primary`?-1:4),D(),j(e.route.lazy?5:-1),D(),j(e.route.title?6:-1),D(2),j(e.route.component?8:9),D(3),N(n.entries(e.route.params)),D(4),N(n.entries(e.route.data)),D(4),N(n.guardList(e.route)),D(2),N(e.route.resolvers??K_(11,HI)),D(2),j(!n.guardList(e.route).length&&!e.route.resolvers?.length?23:-1)}}function mL(e,t){if(e&1&&(R(0,`span`,15),K(1),z()),e&2){let e=W().$implicit;D(),J(``,e.nesting,`, `)}}function hL(e,t){if(e&1){let e=B();R(0,`button`,27),U(`click`,function(){S(e);let t=W(2).$implicit,n=W(3);return C(n.showComponent.emit({pageId:n.page().pageId,id:t.outlet.devtoolsId}))}),K(1,` Show in Components`),R(2,`span`,15),K(3),z()()}if(e&2){let e=W(2).$implicit;D(3),J(`: `,e.outlet.component??e.outlet.element??`routed component`)}}function gL(e,t){if(e&1&&(R(0,`code`),K(1),z(),K(2,` for `),R(3,`code`),K(4),z(),A(5,hL,4,1,`button`,26)),e&2){let e=W().$implicit,t=W(3);D(),q(e.outlet.component??`?`),D(3),q(e.outlet.route??`?`),D(),j(e.outlet.devtoolsId&&t.componentsOn()?5:-1)}}function _L(e,t){e&1&&(R(0,`span`,24),K(1,`not activated`),z())}function vL(e,t){e&1&&(R(0,`span`,16),K(1,`detached by reuse strategy`),z())}function yL(e,t){if(e&1&&(R(0,`span`,16),K(1),z()),e&2){let e=t.$implicit;D(),Y(`input `,e.input,` ← `,e.source)}}function bL(e,t){if(e&1&&(R(0,`span`,25),K(1,`routerOutletData `),R(2,`code`),K(3),z()()),e&2){let e=W().$implicit;D(3),q(e.outlet.data)}}function xL(e,t){if(e&1&&(R(0,`li`)(1,`span`,16),K(2),z(),A(3,mL,2,1,`span`,15),A(4,gL,6,3)(5,_L,2,0,`span`,24),A(6,vL,2,0,`span`,16),M(7,yL,2,2,`span`,16,WI),A(9,bL,4,1,`span`,25),z()),e&2){let e=t.$implicit,n=W(3);n_(`padding-left`,10+e.depth*16,`px`),D(2),q(e.outlet.outlet),D(),j(e.nesting?3:-1),D(),j(e.outlet.activated?4:5),D(2),j(e.outlet.detached?6:-1),D(),N(n.boundInputs(e.outlet)),D(2),j(e.outlet.data===void 0?-1:9)}}function SL(e,t){if(e&1&&(R(0,`h3`),K(1,`Outlets`),z(),R(2,`ul`,22),M(3,xL,10,7,`li`,23,eg),z()),e&2){let e=W(2);D(3),N(e.outletRows())}}function CL(e,t){if(e&1&&(R(0,`p`,1)(1,`span`,2),K(2,`URL`),z(),R(3,`code`),K(4),z()(),A(5,GI,5,1,`p`,3),A(6,qI,10,5),A(7,JI,2,1,`p`,4),R(8,`dl`,5),A(9,YI,4,1),A(10,XI,6,3),A(11,ZI,5,1),z(),R(12,`h3`),K(13,`Active routes`),z(),R(14,`div`,6)(15,`table`,7)(16,`thead`)(17,`tr`)(18,`th`,8),K(19,`Route`),z(),R(20,`th`,8),K(21,`Component`),z(),R(22,`th`,8),K(23,`Params`),z(),R(24,`th`,8),K(25,`Data`),z(),R(26,`th`,8),K(27,`Guards and resolvers`),z()()(),R(28,`tbody`),M(29,pL,24,12,`tr`,null,eg),z()()(),A(31,SL,5,0)),e&2){let e,n=t,r=W();D(4),q(n.url),D(),j(n.urlDrift&&n.browserUrl?5:-1),D(),j((e=n.pending)?6:-1,e),D(),j(r.message()?7:-1),D(2),j(n.title?9:-1),D(),j(r.hasKeys(n.queryParams)?10:-1),D(),j(n.fragment?11:-1),D(18),N(r.rows()),D(2),j(r.outletRows().length?31:-1)}}function wL(e,t){e&1&&(R(0,`div`,0)(1,`p`,28),K(2,`This page reports no Router.`),z(),R(3,`p`,24),K(4,` Add `),R(5,`code`),K(6,`provideRouter()`),z(),K(7,` to the app config and navigate once to see the active routes here. `),z()())}function TL(e){return e.component?`${e.component} in the ${e.outlet} outlet`:`the ${e.outlet} outlet`}var EL=class e{page=$.required();rpc=$(null);navigationAllowed=X(()=>LT(this.rpc(),`router`));navigationOff=Vw(`router`);componentsOn=X(()=>PT(this.rpc()).inspectors.components);showComponent=lv();pageId=X(()=>this.page().pageId);message=Q({source:this.pageId,computation:()=>``});rows=X(()=>{let e=[],t=(n,r,i)=>{let a=r===0&&!n.path?`(root)`:`/`+n.path,o=i===void 0?void 0:`level ${r+1}, child of ${i}`;e.push({route:n,depth:r,label:a,nesting:o});for(let e of n.children)t(e,r+1,a)},n=this.page().snapshot?.root;return n&&t(n,0),e});outletRows=X(()=>{let e=[],t=(n,r,i)=>{for(let a of n){let n=i&&`level ${r+1}, inside ${TL(i)}`;e.push({outlet:a,depth:r,nesting:n}),a.children&&t(a.children,r+1,a)}};return t(this.page().outlets??[],0),e});hasKeys(e){return Object.keys(e).length>0}entries(e){return Object.entries(e)}guardList(e){return Object.entries(e.guards??{}).flatMap(([e,t])=>(t??[]).map(t=>`${e} ${t}`))}boundInputs(e){return(e.inputs??[]).filter(e=>e.source!==`unset`)}async abort(){let e=this.pageId(),t=await BI(this.rpc(),e,{action:`abort`},this.page().appId);e===this.pageId()&&this.message.set(t.error?String(t.error):`Aborted navigation #${t.aborted}.`)}static ɵfac=function(t){return new(t||e)};static ɵcmp=O({type:e,selectors:[[`app-route-current`]],inputs:{page:[1,`page`],rpc:[1,`rpc`]},outputs:{showComponent:`showComponent`},decls:2,vars:1,consts:[[1,`empty`],[1,`url`],[1,`url-label`],[`role`,`note`,1,`note`],[`role`,`status`,1,`muted`],[1,`facts`],[`role`,`region`,`aria-label`,`Active routes`,`tabindex`,`0`,1,`table-scroll`],[1,`active-routes`],[`scope`,`col`],[`role`,`status`,1,`pending`],[`aria-hidden`,`true`,1,`pulse`],[1,`pending-text`],[`type`,`button`,1,`small`,3,`click`,`disabled`],[`id`,`route-current-writes-off`,1,`muted`],[1,`path`],[1,`visually-hidden`],[1,`tag`],[1,`sub`],[1,`component`],[1,`entry`],[1,`entry`,`data`],[`aria-hidden`,`true`,1,`nil`],[1,`outlets`],[3,`padding-left`],[1,`muted`],[1,`outlet-data`],[`type`,`button`,1,`small`,`show-component`],[`type`,`button`,1,`small`,`show-component`,3,`click`],[1,`empty-title`]],template:function(e,t){if(e&1&&A(0,CL,32,8)(1,wL,8,0,`div`,0),e&2){let e;j((e=t.page().snapshot)?0:1,e)}},dependencies:[ey],styles:[`.muted[_ngcontent-%COMP%] { +}`]})};function NI(e){return e.line?`${e.file}:${e.line}`:e.file}function PI(e,t){let n=t.filter(t=>t.fullPath===e.fullPath&&t.redirectTo!==void 0==(e.redirectTo!==void 0));return n.find(t=>!!e.component&&t.component===e.component)??n.find(t=>!t.component||!e.component)}function FI(e){return e?.apps&&e.apps.length>1?e.apps:[]}function II(e,t){let n=FI(e).find(e=>e.id===t);return n?n.primary?{...e,appId:n.id}:{pageId:e.pageId,reportedAt:e.reportedAt,changedAt:e.changedAt,snapshot:n.snapshot??null,navigations:n.navigations??[],dropped:n.dropped,generation:n.generation,config:n.config,configTruncated:n.configTruncated,activeIds:n.activeIds,setup:n.setup,outlets:n.outlets,links:n.links,linksTruncated:n.linksTruncated,linksUnchecked:n.linksUnchecked,preloads:n.preloads,instrumented:e.instrumented,loops:n.loops,apps:e.apps,appId:n.id}:e}var LI=gT;function RI(e){return e.startsWith(`/`)&&!e.startsWith(`//`)&&!/^\/*[a-z][a-z0-9+.-]*:/i.test(e)&&!e.includes(`[redacted]`)&&e.length<=2e3}var zI=`Could not reach the page.`;async function BI(e,t,n,r){return await LI(e,`request-router-action`,{pageId:t,...r?{app:r}:{},request:n})??{error:`Could not reach the page.`}}function VI(e){return e===`succeeded`?`good`:e===`redirected`||e===`pending`||e===`skipped`?`warn`:e===`cancelled`||e===`failed`?`bad`:``}var HI=()=>[],UI=(e,t)=>t[0],WI=(e,t)=>t.input;function GI(e,t){if(e&1&&(R(0,`p`,3),K(1,` The browser shows `),R(2,`code`),K(3),z(),K(4,`, not the router URL (skipLocationChange, browserUrl, a failed navigation or code that changed history). `),z()),e&2){let e=W();D(3),q(e.browserUrl)}}function KI(e,t){if(e&1&&(R(0,`p`,13),K(1),z()),e&2){let e=W(3);D(),q(e.navigationOff)}}function qI(e,t){if(e&1){let e=B();R(0,`div`,9),fg(1,`span`,10),R(2,`span`,11),K(3,`Navigating to `),R(4,`code`),K(5),z(),K(6),z(),R(7,`button`,12),U(`click`,function(){return S(e),C(W(2).abort())}),K(8,` Abort `),z()(),A(9,KI,2,1,`p`,13)}if(e&2){let e=t,n=W(2);D(5),q(e.url),D(),J(` (#`,e.id,`)`),D(),V(`disabled`,!n.navigationAllowed()),k(`aria-describedby`,n.navigationAllowed()?null:`route-current-writes-off`),D(2),j(n.navigationAllowed()?-1:9)}}function JI(e,t){if(e&1&&(R(0,`p`,4),K(1),z()),e&2){let e=W(2);D(),q(e.message())}}function YI(e,t){if(e&1&&(R(0,`dt`),K(1,`Document title`),z(),R(2,`dd`),K(3),z()),e&2){let e=W();D(3),q(e.title)}}function XI(e,t){if(e&1&&(R(0,`dt`),K(1,`Query params`),z(),R(2,`dd`)(3,`code`),K(4),Q_(5,`json`),z()()),e&2){let e=W();D(4),q($_(5,1,e.queryParams))}}function ZI(e,t){if(e&1&&(R(0,`dt`),K(1,`Fragment`),z(),R(2,`dd`)(3,`code`),K(4),z()()),e&2){let e=W();D(4),q(e.fragment)}}function QI(e,t){if(e&1&&(R(0,`span`,15),K(1),z()),e&2){let e=W().$implicit;D(),J(`, `,e.nesting)}}function $I(e,t){if(e&1&&(R(0,`span`,16),K(1),z()),e&2){let e=W().$implicit;D(),q(e.route.outlet)}}function eL(e,t){e&1&&(R(0,`span`,16),K(1,`lazy`),z())}function tL(e,t){if(e&1&&(R(0,`div`,17),K(1),z()),e&2){let e=W().$implicit;D(),Y(` title `,e.route.title,``,e.route.ownTitle===!1?` (inherited)`:``,` `)}}function nL(e,t){if(e&1&&(R(0,`code`,18),K(1),z()),e&2){let e=W().$implicit;D(),q(e.route.component)}}function rL(e,t){e&1&&(R(0,`span`,21),K(1,`–`),z(),R(2,`span`,15),K(3,`none`),z())}function iL(e,t){e&1&&(R(0,`span`,16),K(1,`inherited`),z())}function aL(e,t){if(e&1&&(R(0,`div`,19)(1,`code`),K(2),Q_(3,`json`),z(),A(4,iL,2,0,`span`,16),z()),e&2){let e=t.$implicit,n=W().$implicit;D(2),Y(``,e[0],`: `,$_(3,3,e[1])),D(2),j(n.route.paramSources?.[e[0]]===`inherited`?4:-1)}}function oL(e,t){e&1&&(R(0,`span`,21),K(1,`–`),z(),R(2,`span`,15),K(3,`none`),z())}function sL(e,t){e&1&&(R(0,`span`,16),K(1),z()),e&2&&(D(),q(t))}function cL(e,t){if(e&1&&(R(0,`div`,20)(1,`code`),K(2),Q_(3,`json`),z(),A(4,sL,2,1,`span`,16),z()),e&2){let e,n=t.$implicit,r=W().$implicit;D(2),Y(``,n[0],`: `,$_(3,3,n[1])),D(2),j((e=r.route.dataSources?.[n[0]])?4:-1,e)}}function lL(e,t){e&1&&(R(0,`span`,21),K(1,`–`),z(),R(2,`span`,15),K(3,`none`),z())}function uL(e,t){if(e&1&&(R(0,`span`,16),K(1),z()),e&2){let e=t.$implicit;D(),q(e)}}function dL(e,t){if(e&1&&(R(0,`span`,16),K(1),z()),e&2){let e=t.$implicit;D(),J(`resolve `,e)}}function fL(e,t){e&1&&(R(0,`span`,21),K(1,`–`),z(),R(2,`span`,15),K(3,`none`),z())}function pL(e,t){if(e&1&&(R(0,`tr`)(1,`td`,14),K(2),A(3,QI,2,1,`span`,15),A(4,$I,2,1,`span`,16),A(5,eL,2,0,`span`,16),A(6,tL,2,2,`div`,17),z(),R(7,`td`),A(8,nL,2,1,`code`,18)(9,rL,4,0),z(),R(10,`td`),M(11,aL,5,5,`div`,19,UI,!1,oL,4,0),z(),R(14,`td`),M(15,cL,5,5,`div`,20,UI,!1,lL,4,0),z(),R(18,`td`),M(19,uL,2,1,`span`,16,tg),M(21,dL,2,1,`span`,16,tg),A(23,fL,4,0),z()()),e&2){let e=t.$implicit,n=W(2);D(),n_(`padding-left`,14+e.depth*16,`px`),D(),J(` `,e.label,` `),D(),j(e.nesting?3:-1),D(),j(e.route.outlet===`primary`?-1:4),D(),j(e.route.lazy?5:-1),D(),j(e.route.title?6:-1),D(2),j(e.route.component?8:9),D(3),N(n.entries(e.route.params)),D(4),N(n.entries(e.route.data)),D(4),N(n.guardList(e.route)),D(2),N(e.route.resolvers??K_(11,HI)),D(2),j(!n.guardList(e.route).length&&!e.route.resolvers?.length?23:-1)}}function mL(e,t){if(e&1&&(R(0,`span`,15),K(1),z()),e&2){let e=W().$implicit;D(),J(``,e.nesting,`, `)}}function hL(e,t){if(e&1){let e=B();R(0,`button`,27),U(`click`,function(){S(e);let t=W(2).$implicit,n=W(3);return C(n.showComponent.emit({pageId:n.page().pageId,id:t.outlet.devtoolsId}))}),K(1,` Show in Components`),R(2,`span`,15),K(3),z()()}if(e&2){let e=W(2).$implicit;D(3),J(`: `,e.outlet.component??e.outlet.element??`routed component`)}}function gL(e,t){if(e&1&&(R(0,`code`),K(1),z(),K(2,` for `),R(3,`code`),K(4),z(),A(5,hL,4,1,`button`,26)),e&2){let e=W().$implicit,t=W(3);D(),q(e.outlet.component??`?`),D(3),q(e.outlet.route??`?`),D(),j(e.outlet.devtoolsId&&t.componentsOn()?5:-1)}}function _L(e,t){e&1&&(R(0,`span`,24),K(1,`not activated`),z())}function vL(e,t){e&1&&(R(0,`span`,16),K(1,`detached by reuse strategy`),z())}function yL(e,t){if(e&1&&(R(0,`span`,16),K(1),z()),e&2){let e=t.$implicit;D(),Y(`input `,e.input,` ← `,e.source)}}function bL(e,t){if(e&1&&(R(0,`span`,25),K(1,`routerOutletData `),R(2,`code`),K(3),z()()),e&2){let e=W().$implicit;D(3),q(e.outlet.data)}}function xL(e,t){if(e&1&&(R(0,`li`)(1,`span`,16),K(2),z(),A(3,mL,2,1,`span`,15),A(4,gL,6,3)(5,_L,2,0,`span`,24),A(6,vL,2,0,`span`,16),M(7,yL,2,2,`span`,16,WI),A(9,bL,4,1,`span`,25),z()),e&2){let e=t.$implicit,n=W(3);n_(`padding-left`,10+e.depth*16,`px`),D(2),q(e.outlet.outlet),D(),j(e.nesting?3:-1),D(),j(e.outlet.activated?4:5),D(2),j(e.outlet.detached?6:-1),D(),N(n.boundInputs(e.outlet)),D(2),j(e.outlet.data===void 0?-1:9)}}function SL(e,t){if(e&1&&(R(0,`h3`),K(1,`Outlets`),z(),R(2,`ul`,22),M(3,xL,10,7,`li`,23,eg),z()),e&2){let e=W(2);D(3),N(e.outletRows())}}function CL(e,t){if(e&1&&(R(0,`p`,1)(1,`span`,2),K(2,`URL`),z(),R(3,`code`),K(4),z()(),A(5,GI,5,1,`p`,3),A(6,qI,10,5),A(7,JI,2,1,`p`,4),R(8,`dl`,5),A(9,YI,4,1),A(10,XI,6,3),A(11,ZI,5,1),z(),R(12,`h3`),K(13,`Active routes`),z(),R(14,`div`,6)(15,`table`,7)(16,`thead`)(17,`tr`)(18,`th`,8),K(19,`Route`),z(),R(20,`th`,8),K(21,`Component`),z(),R(22,`th`,8),K(23,`Params`),z(),R(24,`th`,8),K(25,`Data`),z(),R(26,`th`,8),K(27,`Guards and resolvers`),z()()(),R(28,`tbody`),M(29,pL,24,12,`tr`,null,eg),z()()(),A(31,SL,5,0)),e&2){let e,n=t,r=W();D(4),q(n.url),D(),j(n.urlDrift&&n.browserUrl?5:-1),D(),j((e=n.pending)?6:-1,e),D(),j(r.message()?7:-1),D(2),j(n.title?9:-1),D(),j(r.hasKeys(n.queryParams)?10:-1),D(),j(n.fragment?11:-1),D(18),N(r.rows()),D(2),j(r.outletRows().length?31:-1)}}function wL(e,t){e&1&&(R(0,`div`,0)(1,`p`,28),K(2,`This page reports no Router.`),z(),R(3,`p`,24),K(4,` Add `),R(5,`code`),K(6,`provideRouter()`),z(),K(7,` to the app config and navigate once to see the active routes here. `),z()())}function TL(e){return e.component?`${e.component} in the ${e.outlet} outlet`:`the ${e.outlet} outlet`}var EL=class e{page=$.required();rpc=$(null);navigationAllowed=X(()=>LT(this.rpc(),`router`));navigationOff=Vw(`router`);componentsOn=X(()=>PT(this.rpc()).inspectors.components);showComponent=lv();pageId=X(()=>this.page().pageId);message=Q({source:this.pageId,computation:()=>``});rows=X(()=>{let e=[],t=(n,r,i)=>{let a=r===0&&!n.path?`(root)`:`/`+n.path,o=i===void 0?void 0:`level ${r+1}, child of ${i}`;e.push({route:n,depth:r,label:a,nesting:o});for(let e of n.children)t(e,r+1,a)},n=this.page().snapshot?.root;return n&&t(n,0),e});outletRows=X(()=>{let e=[],t=(n,r,i)=>{for(let a of n){let n=i&&`level ${r+1}, inside ${TL(i)}`;e.push({outlet:a,depth:r,nesting:n}),a.children&&t(a.children,r+1,a)}};return t(this.page().outlets??[],0),e});hasKeys(e){return Object.keys(e).length>0}entries(e){return Object.entries(e)}guardList(e){return Object.entries(e.guards??{}).flatMap(([e,t])=>(t??[]).map(t=>`${e} ${t}`))}boundInputs(e){return(e.inputs??[]).filter(e=>e.source!==`unset`)}async abort(){let e=this.pageId(),t=await BI(this.rpc(),e,{action:`abort`},this.page().appId);e===this.pageId()&&this.message.set(t.error?String(t.error):`Aborted navigation #${t.aborted}.`)}static ɵfac=function(t){return new(t||e)};static ɵcmp=O({type:e,selectors:[[`app-route-current`]],inputs:{page:[1,`page`],rpc:[1,`rpc`]},outputs:{showComponent:`showComponent`},decls:2,vars:1,consts:[[1,`empty`],[1,`url`],[1,`url-label`],[`role`,`note`,1,`note`],[`role`,`status`,1,`muted`],[1,`facts`],[`role`,`region`,`aria-label`,`Active routes`,`tabindex`,`0`,1,`table-scroll`],[1,`active-routes`],[`scope`,`col`],[`role`,`status`,1,`pending`],[`aria-hidden`,`true`,1,`pulse`],[1,`pending-text`],[`type`,`button`,1,`small`,3,`click`,`disabled`],[`id`,`route-current-writes-off`,1,`muted`],[1,`path`],[1,`visually-hidden`],[1,`tag`],[1,`sub`],[1,`component`],[1,`entry`],[1,`entry`,`data`],[`aria-hidden`,`true`,1,`nil`],[1,`outlets`],[3,`padding-left`],[1,`muted`],[1,`outlet-data`],[`type`,`button`,1,`small`,`show-component`],[`type`,`button`,1,`small`,`show-component`,3,`click`],[1,`empty-title`]],template:function(e,t){if(e&1&&A(0,CL,32,8)(1,wL,8,0,`div`,0),e&2){let e;j((e=t.page().snapshot)?0:1,e)}},dependencies:[ey],styles:[`.muted[_ngcontent-%COMP%] { color: var(--%NS%text-2); font-size: 13px; line-height: 1.5; diff --git a/extension/ui/index.html b/extension/ui/index.html index 537e589a..b5729685 100644 --- a/extension/ui/index.html +++ b/extension/ui/index.html @@ -9,7 +9,7 @@ Pangular Inspector - + diff --git a/packages/devtools/CHANGELOG.md b/packages/devtools/CHANGELOG.md index bd9bdc35..c265f862 100644 --- a/packages/devtools/CHANGELOG.md +++ b/packages/devtools/CHANGELOG.md @@ -243,6 +243,7 @@ What remains: `/config` exports `DEFAULT_POPUP_HOTKEY`, `PANGULAR_ACTIONS`, `PAN - **Follow navigations from an agent.** `pangular:follow-navigations` returns the navigations that are new or changed since a cursor, across pages, and can wait up to 30 seconds for the next one, so an agent can follow a login and redirect flow without polling. - **What happens if I go to a URL.** The **Config** view has a **What happens** button, and agents a `pangular:preview-navigation` tool, that predict a navigation from the live route config without navigating: the redirects it follows, the route chain and params, and in order the guards, lazy chunks, resolvers and components that run, with each route's source file and the render mode. - **Several apps on one page.** A page that bootstraps more than one Angular app with its own Router, such as several `bootstrapApplication()` roots or micro-frontends, reports each app's route, navigations, config and setup under a stable app id. The Routes tab shows an **App** picker on such a page, and the router agent tools take an optional `app` argument. A page with one app reports and shows exactly what it did before (#485). +- **Each app's outlets, links, preloads and guard runs.** On a page with several apps, the overlay watches every app's Router as it watches the first: each app reports its own outlets, links, preloads, callers and guard and resolver runs, and a `RouterLink` click or a redirect counts for its own app only. **Record each guard and resolver** covers every app. `follow-navigations` takes `app` to follow another app, and follows the first app without it (#368). #### CLI diff --git a/packages/devtools/src/__tests__/router-apps-overlay.test.ts b/packages/devtools/src/__tests__/router-apps-overlay.test.ts index ae6c2698..0a8abf63 100644 --- a/packages/devtools/src/__tests__/router-apps-overlay.test.ts +++ b/packages/devtools/src/__tests__/router-apps-overlay.test.ts @@ -41,7 +41,7 @@ function fakeRouter(url: string, paths: string[]) { listeners, navigated, url, - config: paths.map((path) => ({ path })), + config: paths.map((path) => ({ path }) as Record), routerState: { snapshot: { root: { url: [], params: {}, data: {}, queryParams: {}, fragment: null, children: [] }, @@ -64,14 +64,45 @@ function emit(router: ReturnType, event: Record>) { +function install( + routers: Map>, + extra: Record = {}, +) { (window as { ng?: unknown }).ng = { getComponent: () => ({}), getInjector: (el: Element) => ({ tag: el.localName }), ɵgetRouterInstance: (injector: { tag: string }) => routers.get(injector.tag) ?? null, + ...extra, }; } +/** Angular's preloader class, found by name like the overlay finds it. */ +class RouterPreloader {} + +/** Gives a fake Router an activated primary outlet showing `component`, and RouterLink helpers. */ +function withOutlet>(router: T, component: string) { + class Routed {} + Object.defineProperty(Routed, 'name', { value: component }); + return Object.assign(router, { + serializeUrl: (tree: unknown) => String(tree), + isActive: () => false, + navigationTransitions: { + rootContexts: { + contexts: new Map([ + [ + 'primary', + { + outlet: { isActivated: true, component: new Routed() }, + route: null, + children: null, + }, + ], + ]), + }, + }, + }); +} + describe('overlay router report with several apps', () => { beforeEach(() => { reports.length = 0; @@ -157,6 +188,105 @@ describe('overlay router report with several apps', () => { } }); + it("files each app's outlets, links, preloads, guard runs and callers under that app", async () => { + document.body.innerHTML = + 'Home' + + 'Basket'; + const shell = withOutlet(fakeRouter('/home', ['home']), 'Shell'); + const cart = withOutlet(fakeRouter('/cart', ['cart', 'checkout']), 'CartPage'); + const cartGuard = () => true; + cart.config[1]['canActivate'] = [cartGuard]; + const strategy = (name: string) => ({ + name, + preload: (_route: unknown, load: () => unknown) => load(), + }); + const preloaders = new Map([ + ['app-root', { preloadingStrategy: strategy('shell') }], + ['cart-widget', { preloadingStrategy: strategy('cart') }], + ]); + const links = new Map([ + [document.getElementById('home')!, { urlTree: '/home', router: shell }], + [document.getElementById('basket')!, { urlTree: '/cart', router: cart }], + ]); + install( + new Map([ + ['app-root', shell], + ['cart-widget', cart], + ]), + { + getDirectives: (el: Element) => (links.has(el) ? [links.get(el)] : []), + ɵgetInjectorResolutionPath: (injector: unknown) => [injector], + ɵgetInjectorProviders: () => [{ token: RouterPreloader }], + getInjector: (el: Element) => ({ + tag: el.localName, + get: (token: unknown) => + token === RouterPreloader ? (preloaders.get(el.localName) ?? null) : null, + }), + }, + ); + const { initOverlay } = await import('../overlay.ts'); + const dispose = await initOverlay(); + try { + await vi.advanceTimersByTimeAsync(2_000); + // The cart app's code navigates, its guard runs, and its preloader loads a route. + void cart.navigateByUrl('/checkout'); + emit(cart, { type: 0, id: 1, url: '/checkout' }); + (cart.config[1]['canActivate'] as (() => boolean)[])[0](); + emit(cart, { type: 1, id: 1, url: '/checkout', urlAfterRedirects: '/checkout' }); + preloaders.get('cart-widget')!.preloadingStrategy.preload({ path: 'orders' }, () => ({})); + // A navigation of the first app in the same breath gets no caller of the cart's. + emit(shell, { type: 0, id: 1, url: '/home' }); + emit(shell, { type: 1, id: 1, url: '/home', urlAfterRedirects: '/home' }); + await vi.advanceTimersByTimeAsync(2_000); + const last = reports.at(-1)! as { + navigations: { url: string; caller?: string; runs?: unknown[] }[]; + outlets: { component?: string }[]; + links: { text: string; href?: string }[]; + preloads: unknown[]; + apps: { + id: string; + navigations?: { url: string; caller?: string; runs?: { guard: string }[] }[]; + outlets?: { component?: string }[]; + links?: { text: string; href?: string }[]; + preloads?: { path: string }[]; + }[]; + }; + expect(last.outlets.map((o) => o.component)).toEqual(['Shell']); + expect(last.links.map((l) => l.text)).toEqual(['Home']); + expect(last.preloads).toEqual([]); + expect(last.navigations.map((n) => [n.url, n.caller, n.runs])).toEqual([ + ['/home', undefined, undefined], + ]); + const app = last.apps[1]; + expect(app.id).toBe('cart-widget'); + expect(app.outlets?.map((o) => o.component)).toEqual(['CartPage']); + expect(app.links?.map((l) => [l.text, l.href])).toEqual([['Basket', '/cart']]); + expect(app.preloads?.map((p) => p.path)).toEqual(['orders']); + expect(app.navigations).toEqual([ + expect.objectContaining({ + url: '/checkout', + caller: expect.stringMatching(/^navigateByUrl\(\)/), + runs: [expect.objectContaining({ guard: 'cartGuard', route: '/checkout' })], + }), + ]); + + // Turning guard recording off from the cart app turns it off on the page. + routerAction?.({ + requestId: 'r3', + pageId: (last as unknown as { pageId: string }).pageId, + app: 'cart-widget', + request: { action: 'instrument', on: false }, + }); + await vi.advanceTimersByTimeAsync(100); + expect(actions).toContainEqual( + expect.objectContaining({ requestId: 'r3', result: { instrumented: false } }), + ); + expect((cart.config[1]['canActivate'] as unknown[])[0]).toBe(cartGuard); + } finally { + dispose(); + } + }); + it('keeps the report of a page with one app as it was', async () => { document.body.innerHTML = ''; install(new Map([['app-root', fakeRouter('/home', ['home'])]])); diff --git a/packages/devtools/src/__tests__/router-apps.test.ts b/packages/devtools/src/__tests__/router-apps.test.ts index 1459ca89..42f76edf 100644 --- a/packages/devtools/src/__tests__/router-apps.test.ts +++ b/packages/devtools/src/__tests__/router-apps.test.ts @@ -84,7 +84,8 @@ describe('router apps on one page', () => { apps.scan(ng, roots, primary); expect(apps.count).toBe(2); expect(apps.primaryRoot(null)).toBe(shell); - expect(cartRouter.listeners.size).toBe(1); + // Its navigations, and the guards check that wraps lazily loaded guards. + expect(cartRouter.listeners.size).toBe(2); expect(shellRouter.listeners.size).toBe(0); cartRouter.emit({ type: 0, id: 1, url: '/checkout' }); @@ -110,7 +111,7 @@ describe('router apps on one page', () => { // The same root keeps its id; a scan with the same roots does not look again. apps.scan(ng, roots, primary); expect(apps.report(ng, 2)!.map((app) => app.id)).toEqual(['app-root', 'cart-widget']); - expect(cartRouter.listeners.size).toBe(1); + expect(cartRouter.listeners.size).toBe(2); expect(apps.target('cart-widget')?.router).toBe(cartRouter); expect(apps.target('app-root')).toBeNull(); expect(apps.isPrimary('app-root')).toBe(true); @@ -238,6 +239,9 @@ const appsList: RouterAppReport[] = [ }, ], activeIds: ['0'], + outlets: [{ outlet: 'primary', activated: true, component: 'Checkout' }], + links: [{ text: 'Pay', element: 'a', devtoolsId: 'd1', href: '/checkout', active: true }], + preloads: [{ path: 'orders', startedAt: 1, ms: 3 }], }, ]; @@ -290,6 +294,10 @@ describe('router apps on the server', () => { expect(view.config?.[0].component).toBe('Checkout'); expect(cart.note).toContain('`app-root`'); + expect(view.outlets).toEqual([{ outlet: 'primary', activated: true, component: 'Checkout' }]); + expect(view.links?.map((link) => link.text)).toEqual(['Pay']); + expect(view.preloads).toEqual([{ path: 'orders', startedAt: 1, ms: 3 }]); + const plain = routerStateForApp(state, { page: 'p2' }); expect(plain).toEqual({ state, note: '' }); expect(routerStateForApp(state, { page: 'p2', app: 'x' })).toHaveProperty('error'); @@ -323,11 +331,62 @@ describe('router agent tools with several apps', () => { expect(cart).toContain('/checkout'); expect(cart).toContain('**URL** `/checkout`'); expect(cart).not.toContain('**URL** `/home`'); + expect(cart).toContain('Checkout'); const routes = await call('list-routes', { app: 'cart-widget' }); expect(routes).toContain('Checkout'); expect(await call('list-routes', { app: 'nope' })).toContain('has no app'); }); + it('follows the navigations of the app named by `app`, and of the first app by default', async () => { + const { push, call, ctx } = await boot(); + await push('push-router', routerReport({ apps: appsList })); + const first = await call('follow-navigations'); + expect(first).toContain('`/home`'); + expect(first).not.toContain('`/checkout`'); + expect(first).toContain('several Angular apps'); + const cart = await call('follow-navigations', { app: 'CartWidget' }); + expect(cart).toContain('app `cart-widget` #1 `/checkout`'); + expect(cart).not.toContain('`/home`'); + const cursor = Number(cart.match(/Next cursor: (\d+)/)?.[1]); + expect(await call('follow-navigations', { app: 'app-root', since: 0 })).toContain('`/home`'); + expect(await call('follow-navigations', { app: 'nope' })).toContain('has no app'); + expect(await call('follow-navigations', { app: 3 })).toContain('must be a string'); + + // A new cart navigation reaches a follower of the cart app only. + const next = structuredClone(appsList); + next[1].navigations!.push({ + id: 2, + url: '/cart/paid', + trigger: 'imperative', + startedAt: 3, + endedAt: 4, + outcome: 'succeeded', + }); + await push('push-router', routerReport({ apps: next })); + const later = await call('follow-navigations', { app: 'cart-widget', since: cursor }); + expect(later).toContain('`/cart/paid`'); + expect(await call('follow-navigations', { since: cursor })).toContain('No new navigation'); + + // Clearing the cart app drops its entries from the stream only. + await ctx.rpc.invokeLocal( + 'pangular:clear-router-navigations' as never, + ...([{ pageId: 'p1', app: 'cart-widget' }] as never), + ); + expect(await call('follow-navigations', { app: 'cart-widget' })).toContain( + 'No navigations recorded yet', + ); + expect(await call('follow-navigations')).toContain('`/home`'); + }); + + it('follows a single-app page exactly as before', async () => { + const { push, call } = await boot(); + await push('push-router', routerReport()); + const text = await call('follow-navigations'); + expect(text).toContain('`/home`'); + expect(text).not.toContain('Angular apps'); + expect(await call('follow-navigations', { app: 'x' })).toContain('one Angular app'); + }); + it('shows the panel no data for an app the page does not have', async () => { const { push, ctx } = await boot(); await push('push-router', routerReport({ apps: appsList })); diff --git a/packages/devtools/src/__tests__/router-open-redirect.test.ts b/packages/devtools/src/__tests__/router-open-redirect.test.ts index cbf645cb..fd68b97b 100644 --- a/packages/devtools/src/__tests__/router-open-redirect.test.ts +++ b/packages/devtools/src/__tests__/router-open-redirect.test.ts @@ -80,7 +80,7 @@ describe('live redirect-from-query check', () => { it('flags code that navigates to a return URL from the current query', () => { const router = routerAt('/login?returnUrl=%2Forders%2F7'); const navigations: NavigationRecord[] = []; - setCaller('navigateByUrl() from LoginPage.submit', true); + setCaller('navigateByUrl() from LoginPage.submit', true, router); applyRouterEvent(navigations, { type: 0, id: 4, url: '/orders/7' }, Date.now(), router); expect(navigations[0].queryRedirect).toEqual({ param: 'returnUrl', diff --git a/packages/devtools/src/__tests__/router-per-app-state.test.ts b/packages/devtools/src/__tests__/router-per-app-state.test.ts new file mode 100644 index 00000000..8d146915 --- /dev/null +++ b/packages/devtools/src/__tests__/router-per-app-state.test.ts @@ -0,0 +1,173 @@ +// @vitest-environment jsdom +import { afterEach, describe, expect, it } from 'vitest'; +import { + applyRouterEvent, + noteFailedCall, + setCaller, + setGeneration, + WRAPPED, + type NavigationRecord, +} from '../router.ts'; +import { captureCallers, instrument } from '../router-actions.ts'; + +/** The parts of a Router the per-router state reads. */ +function fakeRouter(url: string) { + return { url, config: [] as Record[] }; +} + +const start = (id: number, url: string) => ({ type: 0, id, url }); + +describe('router state kept per Router', () => { + it('gives the caller to the app whose navigation starts, not to another app', () => { + const shell = fakeRouter('/'); + const cart = fakeRouter('/cart'); + const shellNavs: NavigationRecord[] = []; + const cartNavs: NavigationRecord[] = []; + setCaller('navigateByUrl() from CartPage.buy', false, cart); + applyRouterEvent(shellNavs, start(1, '/home'), Date.now(), shell); + applyRouterEvent(cartNavs, start(1, '/checkout'), Date.now(), cart); + expect(shellNavs[0].caller).toBeUndefined(); + expect(cartNavs[0].caller).toBe('navigateByUrl() from CartPage.buy'); + }); + + it('links a redirect to the next navigation of the same app only', () => { + const shell = fakeRouter('/'); + const cart = fakeRouter('/cart'); + const shellNavs: NavigationRecord[] = []; + const cartNavs: NavigationRecord[] = []; + applyRouterEvent(cartNavs, start(1, '/checkout'), 0, cart); + applyRouterEvent(cartNavs, { type: 2, id: 1, code: 0, reason: 'Redirecting' }, 1, cart); + // The redirect request comes before the navigation it starts. + applyRouterEvent(cartNavs, { url: '/login', navigationBehaviorOptions: {} }, 2, cart); + applyRouterEvent(shellNavs, start(5, '/home'), 3, shell); + applyRouterEvent(cartNavs, start(2, '/login'), 4, cart); + expect(shellNavs[0].redirectedFrom).toBeUndefined(); + expect(cartNavs[1]).toMatchObject({ url: '/login', redirectedFrom: 1 }); + }); + + it('stamps each app with its own config generation and numbers failed calls per app', () => { + const shell = fakeRouter('/'); + const cart = fakeRouter('/cart'); + setGeneration(4, shell); + setGeneration(9, cart); + const shellNavs: NavigationRecord[] = []; + const cartNavs: NavigationRecord[] = []; + applyRouterEvent(shellNavs, start(1, '/a'), 0, shell); + applyRouterEvent(cartNavs, start(1, '/b'), 0, cart); + expect(shellNavs[0].generation).toBe(4); + expect(cartNavs[0].generation).toBe(9); + + noteFailedCall(shellNavs, '/x', new Error('nope'), 1, shell); + noteFailedCall(cartNavs, '/y', new Error('nope'), 1, cart); + noteFailedCall(cartNavs, '/z', new Error('nope'), 2, cart); + expect(shellNavs.at(-1)).toMatchObject({ id: -1, generation: 4 }); + expect(cartNavs.slice(-2).map((nav) => nav.id)).toEqual([-1, -2]); + }); +}); + +describe('RouterLink clicks on a page with several apps', () => { + afterEach(() => { + document.body.innerHTML = ''; + }); + + it('notes the click as the caller of the app whose link it is', () => { + document.body.innerHTML = 'HomeBasket'; + const shell = { ...fakeRouter('/'), navigate: () => true, navigateByUrl: () => true }; + const cart = { ...fakeRouter('/cart'), navigate: () => true, navigateByUrl: () => true }; + const links = new Map([ + [document.getElementById('shell')!, { urlTree: {}, router: shell }], + [document.getElementById('cart')!, { urlTree: {}, router: cart }], + ]); + const ng = { getDirectives: (el: Element) => (links.has(el) ? [links.get(el)] : []) }; + const shellNavs: NavigationRecord[] = []; + const cartNavs: NavigationRecord[] = []; + const stops = [captureCallers(shell, shellNavs, ng), captureCallers(cart, cartNavs, ng)]; + try { + document.getElementById('cart')!.click(); + applyRouterEvent(shellNavs, start(1, '/home'), Date.now(), shell); + applyRouterEvent(cartNavs, start(1, '/basket'), Date.now(), cart); + expect(shellNavs[0].caller).toBeUndefined(); + expect(cartNavs[0].caller).toBe('RouterLink a "Basket"'); + } finally { + for (const stop of stops) stop(); + } + }); +}); + +describe('guard recording on a page with several apps', () => { + function appWith(routes: Record[]) { + let current: object | null = null; + return { + config: routes, + serializeUrl: String, + currentNavigation: () => current, + navigating(on: boolean) { + current = on ? {} : null; + }, + }; + } + const pending = (id: number, url: string): NavigationRecord => ({ + id, + url, + trigger: 'imperative', + startedAt: 0, + outcome: 'pending', + }); + + it('records a guard each app has into that app', () => { + const shellGuard = () => true; + const cartGuard = () => false; + const shell = appWith([{ path: 'a', canActivate: [shellGuard] }]); + const cart = appWith([{ path: 'b', canActivate: [cartGuard] }]); + const shellNavs = [pending(1, '/a')]; + const cartNavs = [pending(1, '/b')]; + const stops = [instrument(shell, shellNavs), instrument(cart, cartNavs)]; + (shell.config[0]['canActivate'] as (() => boolean)[])[0](); + (cart.config[0]['canActivate'] as (() => boolean)[])[0](); + expect(shellNavs[0].runs).toEqual([expect.objectContaining({ route: '/a', result: 'true' })]); + expect(cartNavs[0].runs).toEqual([expect.objectContaining({ route: '/b', result: 'false' })]); + for (const stop of stops) stop(); + expect((shell.config[0]['canActivate'] as unknown[])[0]).toBe(shellGuard); + }); + + it('records a guard two apps share into the app that is navigating, and unwraps after both', () => { + class AuthGuard { + canActivate() { + return true; + } + } + const own = AuthGuard.prototype.canActivate; + const routes = (path: string) => [{ path, canActivate: [AuthGuard] }]; + const shell = appWith(routes('a')); + const cart = appWith(routes('b')); + const shellNavs: NavigationRecord[] = []; + const cartNavs = [pending(3, '/b')]; + const stopShell = instrument(shell, shellNavs); + const stopCart = instrument(cart, cartNavs); + expect((AuthGuard.prototype.canActivate as unknown as Record)[WRAPPED]).toBe( + own, + ); + cart.navigating(true); + new AuthGuard().canActivate(); + expect(shellNavs).toEqual([]); + expect(cartNavs[0].runs).toEqual([expect.objectContaining({ guard: 'AuthGuard' })]); + + // Both apps navigating: the run goes to the one whose Router is busy now. + shellNavs.push(pending(7, '/a')); + cart.navigating(false); + shell.navigating(true); + new AuthGuard().canActivate(); + expect(shellNavs[0].runs).toHaveLength(1); + expect(cartNavs[0].runs).toHaveLength(1); + + // The shell app lets go first: the cart app still records. + stopShell(); + expect(AuthGuard.prototype.canActivate).not.toBe(own); + shell.navigating(false); + cart.navigating(true); + new AuthGuard().canActivate(); + expect(cartNavs[0].runs).toHaveLength(2); + stopCart(); + expect(AuthGuard.prototype.canActivate).toBe(own); + }); +}); diff --git a/packages/devtools/src/__tests__/router-stream.test.ts b/packages/devtools/src/__tests__/router-stream.test.ts index 1e3d5ca5..40022fca 100644 --- a/packages/devtools/src/__tests__/router-stream.test.ts +++ b/packages/devtools/src/__tests__/router-stream.test.ts @@ -34,6 +34,34 @@ describe('NavigationStream', () => { expect(stream.read(read.cursor).entries).toEqual([]); }); + it('keeps the apps of one page apart and reads the first app with null', () => { + const stream = new NavigationStream(); + stream.record('a', [nav(1)]); + stream.record('a', [nav(1)], 'cart-widget'); + // The same navigation id in two apps is two entries. + expect(stream.read(0).entries.map((e) => [e.nav.id, e.appId])).toEqual([ + [1, undefined], + [1, 'cart-widget'], + ]); + expect(stream.read(0, 'a', null).entries.map((e) => e.appId)).toEqual([undefined]); + expect(stream.read(0, 'a', 'cart-widget').entries.map((e) => e.appId)).toEqual(['cart-widget']); + expect(streamText(stream.read(0, 'a', 'cart-widget'), { waited: false })).toContain( + 'page `a` app `cart-widget` #1', + ); + stream.record('a', [nav(1, { outcome: 'succeeded', endedAt: 5 })], 'cart-widget'); + expect(stream.read(2, 'a', 'cart-widget').entries[0].updated).toBe(true); + + // Clearing one app leaves the other; the first app is cleared with null. + stream.clear('a', 'cart-widget'); + expect(stream.read(0).entries.map((e) => e.appId)).toEqual([undefined]); + stream.record('a', [nav(2)], 'cart-widget'); + stream.clear('a', null); + expect(stream.read(0).entries.map((e) => e.appId)).toEqual(['cart-widget']); + stream.clear('a'); + expect(stream.read(0).entries).toEqual([]); + expect(stream.pageIds().size).toBe(0); + }); + it('keeps pages apart and filters by page', () => { const stream = new NavigationStream(); stream.record('a', [nav(1)]); diff --git a/packages/devtools/src/devframe-router-tools.ts b/packages/devtools/src/devframe-router-tools.ts index 788008e5..9121484e 100644 --- a/packages/devtools/src/devframe-router-tools.ts +++ b/packages/devtools/src/devframe-router-tools.ts @@ -1,5 +1,10 @@ import { diffNavigationsText } from './rpc/router-diff.ts'; -import { APP_ARGUMENT, routerStateForApp } from './rpc/router-apps.ts'; +import { + APP_ARGUMENT, + FOLLOW_APP_ARGUMENT, + routerStateForApp, + streamAppFor, +} from './rpc/router-apps.ts'; import { MAX_WAIT_MS, streamText, type NavigationStream } from './rpc/router-stream.ts'; import { previewNavigationText } from './rpc/router-preview.ts'; import type { HttpCall } from './http-rules.ts'; @@ -197,11 +202,12 @@ export function registerRouterAgentTools(env: RegisterRouterAgentToolsEnv) { agent.registerTool({ id: 'pangular:follow-navigations', title: 'Follow navigations', - description: `New and changed navigations since a cursor, oldest first, to follow a login or redirect flow without polling. Without \`since\`, the latest 5 and a cursor; pass it back as \`since\`, with \`waitMs\` (up to ${MAX_WAIT_MS}) to wait for the next one.`, + description: `New and changed navigations since a cursor, oldest first, to follow a login or redirect flow without polling. Without \`since\`, the latest 5 and a cursor; pass it back as \`since\`, with \`waitMs\` (up to ${MAX_WAIT_MS}) to wait for the next one. \`app\` follows another app of a page that runs several.`, inputSchema: { type: 'object', properties: { page: pageProperty, + app: FOLLOW_APP_ARGUMENT, since: { type: 'integer', minimum: 0, @@ -216,21 +222,24 @@ export function registerRouterAgentTools(env: RegisterRouterAgentToolsEnv) { }, }, }, - handler: async (args: { page?: string; since?: number; waitMs?: number }) => { + handler: async (args: { page?: string; app?: unknown; since?: number; waitMs?: number }) => { const state = routerState.value() as RouterState; if (args.page && !state.pages.some((p) => p.pageId === args.page)) { return { markdown: noPage(args.page, state) }; } + const scoped = streamAppFor(state, args); + if ('error' in scoped) return { markdown: refusal(scoped.error) }; + const { page, app, note } = scoped; if (typeof args.since !== 'number' || !Number.isFinite(args.since)) { - const all = navigationStream.read(0, args.page); + const all = navigationStream.read(0, page, app); const read = { ...all, entries: all.entries.slice(-5) }; delete read.reset; - return { markdown: streamText(read, { waited: false }) }; + return { markdown: streamText(read, { waited: false }) + note }; } const since = Math.floor(args.since); const wait = typeof args.waitMs === 'number' && args.waitMs > 0 ? args.waitMs : 0; - const read = await navigationStream.wait(since, wait, args.page); - return { markdown: streamText(read, { since, waited: wait > 0 }) }; + const read = await navigationStream.wait(since, wait, page, app); + return { markdown: streamText(read, { since, waited: wait > 0 }) + note }; }, }); diff --git a/packages/devtools/src/devframe.ts b/packages/devtools/src/devframe.ts index db0ee26e..6d2c7eeb 100644 --- a/packages/devtools/src/devframe.ts +++ b/packages/devtools/src/devframe.ts @@ -1018,7 +1018,7 @@ const pangular = defineDevframe({ dropGoneStreamPages(); // A report that failed to merge left no page, so its navigations stay out of the stream. if (routerPages.has(report.pageId)) { - navigationStream.record(report.pageId, report.navigations); + navigationStream.recordReport(report); } return { hasConfig: !!routerPages.get(report.pageId)?.config }; }, @@ -1255,8 +1255,8 @@ const pangular = defineDevframe({ if (clearRouterNavigations(routerPages, pageId, Date.now(), app)) { applyRouter(currentRouter(routerPages)); } - // The stream follows the first app only. - if (!secondary) navigationStream.clear(pageId); + // Each app's navigations in the stream go with its history; the first app's carry no id. + navigationStream.clear(pageId, app ? (secondary ? app : null) : undefined); void my.rpc.broadcast({ method: 'router-clear', args: [app ? { pageId, app } : { pageId }], diff --git a/packages/devtools/src/overlay.ts b/packages/devtools/src/overlay.ts index 78be6fd9..cd2e17a2 100644 --- a/packages/devtools/src/overlay.ts +++ b/packages/devtools/src/overlay.ts @@ -50,7 +50,7 @@ import { } from './router.ts'; import { ConfigTracker, activeIds, walkConfig, type RouteNode } from './router-config.ts'; import { detectSetup, preloaderOf, type RouterSetup } from './router-setup.ts'; -import { linksOf, outletsOf } from './router-links.ts'; +import { outletsOf } from './router-links.ts'; import { captureCallers, captureDiagnostics, @@ -660,13 +660,13 @@ async function startOverlay( let sentGeneration = -1; const routerScan = createScanBackoff(); // The other Angular apps on the page that have a Router (`router-apps.ts`). - const routerApps = new RouterApps(onRouterChange); + const routerApps = new RouterApps(onRouterChange, instrumented); let lastRouterPayload = ''; let lastRouterPushAt = 0; let routerPushTimer: ReturnType | undefined; let routerDomDirty = true; let outlets: ReturnType = []; - let links: ReturnType = []; + let links: ReturnType = []; let linksTruncated = 0; let linksUnchecked = 0; const routerDomObserver = @@ -702,6 +702,7 @@ async function startOverlay( instrumented = on; storeInstrumented(on); if (on && router) stopInstrument = instrument(router, navigations); + routerApps.setInstrumented(on); lastRouterPayload = ''; scheduleRouterPush(); } @@ -780,7 +781,7 @@ async function startOverlay( config = walkConfig(router, cut); configTruncated = cut.routes; setup = detectSetup(ng, router, routerCount, routerRoot); - setGeneration(configTracker.generation); + setGeneration(configTracker.generation, router); if (instrumented) { stopInstrument?.(); stopInstrument = instrument(router, navigations); @@ -794,16 +795,17 @@ async function startOverlay( if (routerDomDirty) { routerApps.scan(ng, Array.from(document.querySelectorAll('[ng-version]')), router, true); } - const apps = routerApps.report(ng, routerCount); - if (apps) report['apps'] = apps; if (routerDomDirty) { routerDomDirty = false; outlets = outletsOf(router); const cut = { links: 0, unchecked: 0 }; - links = linksOf(ng, router, cut); + // One pass over the page files each app's links under that app. + links = routerApps.links(ng, router, cut); linksTruncated = cut.links; linksUnchecked = cut.unchecked; } + const apps = routerApps.report(ng, routerCount); + if (apps) report['apps'] = apps; report['outlets'] = outlets; report['links'] = links; if (linksTruncated) report['linksTruncated'] = linksTruncated; @@ -1000,9 +1002,6 @@ async function startOverlay( if (!app && !routerApps.isPrimary(message.app)) { return respond({ error: `This page has no app \`${String(message.app).slice(0, 40)}\`.` }); } - if (app && message.request.action === 'instrument') { - return respond({ error: 'Guard recording runs in the first app only.' }); - } runAction( app?.router ?? router, app?.navigations ?? navigations, diff --git a/packages/devtools/src/router-actions.ts b/packages/devtools/src/router-actions.ts index 51ee3910..e99b6d07 100644 --- a/packages/devtools/src/router-actions.ts +++ b/packages/devtools/src/router-actions.ts @@ -26,6 +26,13 @@ import { type RouterDebugApi, WRAPPED, } from './router.ts'; +import { + joinWrapper, + keepWrapper, + targetOfRun, + targetsOf, + type GuardTarget, +} from './router-guard-targets.ts'; import type { PreloadRecord } from './router-types.ts'; export type { PreloadRecord } from './router-types.ts'; @@ -85,6 +92,16 @@ export function routerLinkOf(target: Element | null, ng?: RouterDebugApi): Eleme return null; } +/** + * The Router a RouterLink navigates with (its `router` field, as + * `isRouterLink` reads it), or null when the debug API can't tell. + */ +export function linkRouterOf(link: Element, ng?: RouterDebugApi): AnyRecord | null { + if (!ng?.getDirectives) return null; + const directive = read(() => (ng.getDirectives?.(link) ?? []).find(isRouterLink), undefined); + return read(() => (directive?.['router'] as AnyRecord | undefined) ?? null, null); +} + const INSTRUMENT_KEY = 'pangular-router-instrument'; /** Whether instrumentation is on for this tab: on unless it was turned off. */ @@ -136,7 +153,7 @@ export function captureCallers( router[method] = function (this: unknown, ...args: unknown[]) { if (!fromClick && depth === 0) { const caller = stackCaller(); - setCaller(`${method}()${caller ? ` from ${caller}` : ''}`); + setCaller(`${method}()${caller ? ` from ${caller}` : ''}`, false, router); } fromClick = false; depth++; @@ -147,7 +164,7 @@ export function captureCallers( () => (typeof args[0] === 'string' ? args[0] : JSON.stringify(args[0])) ?? '', '', ); - noteFailedCall(navigations, target, error, Date.now()); + noteFailedCall(navigations, target, error, Date.now(), router); throw error; } finally { depth--; @@ -157,8 +174,11 @@ export function captureCallers( const onClick = (event: Event) => { const link = routerLinkOf(event.target as Element | null, ng); if (!link) return; + // On a page with several apps, a link of another app starts that app's navigation. + const owner = linkRouterOf(link, ng); + if (owner && owner !== router) return; fromClick = true; - setCaller(`RouterLink ${describeElement(link)}`, true); + setCaller(`RouterLink ${describeElement(link)}`, true, router); queueMicrotaskOutside(() => { setTimeoutOutside(() => (fromClick = false)); }); @@ -431,23 +451,26 @@ function resolverLabelAt(entry: unknown) { function wrapFunction( original: AnyRecord, label: { guard: string; kind: string; route: string }, - router: AnyRecord, - navigations: NavigationRecord[], + targets: GuardTarget[], labelAt?: (args: unknown[]) => { guard?: string; route?: string }, ): AnyRecord { const wrapped = function (this: unknown, ...args: unknown[]) { const started = performance.now(); const at = (labelAt && read(() => labelAt(args), null)) ?? {}; - const record: Recorder = (value, threw, outcome) => - noteRun(navigations, { + // Picked when the run starts: the app whose navigation runs this guard. + const target = targetOfRun(targetsOf(wrapped, targets)); + const record: Recorder = (value, threw, outcome) => { + if (!target) return; + noteRun(target.navigations, { ...label, guard: at.guard ?? label.guard, route: at.route ?? label.route, result: threw ? `threw ${redactMessage(String((threw as AnyRecord)?.['message'] ?? threw))}` - : (outcome ?? describeResult(value, router)), + : (outcome ?? describeResult(value, target.router)), ms: Math.round(performance.now() - started), }); + }; try { return track((original as unknown as (...a: unknown[]) => unknown).apply(this, args), record); } catch (error) { @@ -464,11 +487,36 @@ function isClass(entry: unknown, method: string): boolean { return read(() => typeof (entry as AnyRecord)['prototype']?.[method] === 'function', false); } +/** + * Wraps the function held at one place (a guard class method, a routes array + * entry, a resolve key) for `target`, or adds `target` to the wrapper another + * app put there. A function some other code marked as wrapped is left alone. + */ +function wrapAt( + holder: AnyRecord, + key: string | number, + target: GuardTarget, + wrapping: Wrapping, + wrap: (original: AnyRecord, targets: GuardTarget[]) => AnyRecord, +): void { + const current = read(() => holder[key] as unknown, null); + if (typeof current !== 'function') return; + const joined = joinWrapper(current, target); + if (joined !== null) { + if (joined) wrapping.restore.push(joined); + return; + } + if ((current as AnyRecord)[WRAPPED]) return; + const targets = [target]; + const wrapper = wrap(current as AnyRecord, targets); + holder[key] = wrapper; + wrapping.restore.push(keepWrapper(wrapper, targets, () => (holder[key] = current))); +} + function instrumentRoutes( routes: AnyRecord[], parent: string, - router: AnyRecord, - navigations: NavigationRecord[], + target: GuardTarget, wrapping: Wrapping, depth: number, ) { @@ -482,27 +530,20 @@ function instrumentRoutes( list.forEach((entry, index) => { const method = GUARD_METHODS[kind]; if (isClass(entry, method)) { - const proto = (entry as AnyRecord)['prototype']; - const original = proto[method]; - if (original[WRAPPED]) return; - proto[method] = wrapFunction( - original, - { guard: nameOf(entry), kind, route: path }, - router, - navigations, - guardLabelAt(kind, entry), + wrapAt((entry as AnyRecord)['prototype'], method, target, wrapping, (original, targets) => + wrapFunction( + original, + { guard: nameOf(entry), kind, route: path }, + targets, + guardLabelAt(kind, entry), + ), ); - wrapping.restore.push(() => (proto[method] = original)); - } else if (typeof entry === 'function' && !(entry as AnyRecord)[WRAPPED]) { + } else if (typeof entry === 'function') { const label = nameOf(entry) === 'anonymous function' ? `${kind}[${index}]` : nameOf(entry); - list[index] = wrapFunction( - entry as AnyRecord, - { guard: label, kind, route: path }, - router, - navigations, + wrapAt(list as AnyRecord, index, target, wrapping, (original, targets) => + wrapFunction(original, { guard: label, kind, route: path }, targets), ); - wrapping.restore.push(() => (list[index] = entry)); } }); } @@ -511,35 +552,26 @@ function instrumentRoutes( const entry = (resolve as AnyRecord)[key as string]; const label = { guard: `${keyName(key)}: ${nameOf(entry)}`, kind: 'resolve', route: path }; if (isClass(entry, 'resolve')) { - const proto = entry['prototype']; - const original = proto['resolve']; - if (original[WRAPPED]) continue; - proto['resolve'] = wrapFunction( - original, - label, - router, - navigations, - resolverLabelAt(entry), + wrapAt(entry['prototype'], 'resolve', target, wrapping, (original, targets) => + wrapFunction(original, label, targets, resolverLabelAt(entry)), + ); + } else if (typeof entry === 'function') { + wrapAt(resolve as AnyRecord, key as string, target, wrapping, (original, targets) => + wrapFunction(original, label, targets), ); - wrapping.restore.push(() => (proto['resolve'] = original)); - } else if (typeof entry === 'function' && !entry[WRAPPED]) { - (resolve as AnyRecord)[key as string] = wrapFunction(entry, label, router, navigations); - wrapping.restore.push(() => ((resolve as AnyRecord)[key as string] = entry)); } } instrumentRoutes( read(() => route['children'] as AnyRecord[], []), path, - router, - navigations, + target, wrapping, depth + 1, ); instrumentRoutes( read(() => route['_loadedRoutes'] as AnyRecord[], []), path, - router, - navigations, + target, wrapping, depth + 1, ); @@ -557,8 +589,7 @@ export function instrument(router: AnyRecord, navigations: NavigationRecord[]): instrumentRoutes( read(() => router['config'] as AnyRecord[], []), '', - router, - navigations, + { router, navigations }, wrapping, 0, ); @@ -810,7 +841,7 @@ function probe(router: AnyRecord, navigations: NavigationRecord[], url: string): // Set before navigating: a skipped navigation (same URL) emits its event synchronously. const current = navigationIdOf(router); targetId = current < 0 ? current : current + 1; - setCaller('probe from DevTools', true); + setCaller('probe from DevTools', true, router); // 'reload' so probing the current URL is matched instead of skipped as the same URL. let promise: Promise | null = null; try { @@ -887,7 +918,7 @@ export async function runAction( const extras: AnyRecord = {}; if (request.extras?.replaceUrl) extras['replaceUrl'] = true; if (request.extras?.skipLocationChange) extras['skipLocationChange'] = true; - setCaller('navigate from DevTools', true); + setCaller('navigate from DevTools', true, router); const promise = read(() => router['navigateByUrl'](url, extras) as Promise, null); promise?.catch?.(() => {}); const id = navigationIdOf(router); @@ -931,7 +962,7 @@ export async function runAction( const extras: AnyRecord = {}; if (record.extras?.includes('replaceUrl')) extras['replaceUrl'] = true; if (record.extras?.includes('skipLocationChange')) extras['skipLocationChange'] = true; - setCaller(`replay of #${record.id} from DevTools`, true); + setCaller(`replay of #${record.id} from DevTools`, true, router); const promise = read( () => router['navigateByUrl'](record.url, extras) as Promise, null, diff --git a/packages/devtools/src/router-app-watch.ts b/packages/devtools/src/router-app-watch.ts new file mode 100644 index 00000000..0a8aef5d --- /dev/null +++ b/packages/devtools/src/router-app-watch.ts @@ -0,0 +1,78 @@ +import { + watchRouter, + type AnyRecord, + type NavigationRecord, + type RouterDebugApi, +} from './router.ts'; +import { + captureCallers, + captureDiagnostics, + capturePreloads, + instrument, + onGuardsCheckStart, +} from './router-actions.ts'; +import { ConfigTracker } from './router-config.ts'; +import { preloaderOf } from './router-setup.ts'; +import type { PreloadRecord } from './router-types.ts'; + +/** What the overlay watches on one app of a page that runs several. */ +export interface AppWatch { + /** Turns guard and resolver recording on or off for this app. */ + setInstrumented(on: boolean): void; + /** Stops every watch and unwraps what was wrapped. */ + stop(): void; +} + +/** + * Watches one app's Router as the overlay watches the first app's: its + * events, who starts each navigation, what the error handler did, the + * preloads its own preloader runs, and (when on) each guard and resolver run. + * Everything lands in this app's `navigations` and `preloads`, never another + * app's. + */ +export function watchApp( + ng: RouterDebugApi, + router: AnyRecord, + root: Element, + navigations: NavigationRecord[], + preloads: PreloadRecord[], + onChange: () => void, + instrumented: boolean, +): AppWatch { + const cleanup: (() => void)[] = []; + const stop = watchRouter(router, navigations, onChange); + if (stop) cleanup.push(stop); + let stopInstrument: (() => void) | null = null; + // Its own tracker: the report's tracker must still see a config change. + const loaded = new ConfigTracker(); + loaded.update(router); + const setInstrumented = (on: boolean) => { + stopInstrument?.(); + stopInstrument = on ? instrument(router, navigations) : null; + }; + // Lazy routes load during a navigation: wrap their guards before they run. + cleanup.push( + onGuardsCheckStart(router, () => { + if (!stopInstrument || !loaded.update(router)) return; + const previous = stopInstrument; + const next = instrument(router, navigations); + stopInstrument = () => { + next(); + previous(); + }; + }), + ); + cleanup.push(captureCallers(router, navigations, ng)); + cleanup.push(captureDiagnostics(router, navigations)); + cleanup.push(capturePreloads(preloaderOf(ng, root), preloads, onChange)); + setInstrumented(instrumented); + return { + setInstrumented, + stop() { + for (const fn of cleanup) fn(); + cleanup.length = 0; + stopInstrument?.(); + stopInstrument = null; + }, + }; +} diff --git a/packages/devtools/src/router-apps.ts b/packages/devtools/src/router-apps.ts index f995700c..40069382 100644 --- a/packages/devtools/src/router-apps.ts +++ b/packages/devtools/src/router-apps.ts @@ -4,16 +4,18 @@ import { droppedNavigations, findRouterRoots, read, + setGeneration, snapshotRouter, - watchRouter, type AnyRecord, type NavigationRecord, type RouterDebugApi, } from './router.ts'; +import { watchApp, type AppWatch } from './router-app-watch.ts'; import { ConfigTracker, activeIds, walkConfig, type RouteNode } from './router-config.ts'; +import { linksOf, linksOfRouters, outletsOf } from './router-links.ts'; import { detectSetup, type RouterSetup } from './router-setup.ts'; -import type { RouterAppReport } from './router-types.ts'; +import type { LinkInfo, OutletInfo, PreloadRecord, RouterAppReport } from './router-types.ts'; export type { RouterAppReport } from './router-types.ts'; /** Most apps one page reports. */ @@ -61,7 +63,12 @@ interface WatchedApp { root: Element; router: AnyRecord; navigations: NavigationRecord[]; - stop: (() => void) | null; + preloads: PreloadRecord[]; + watch: AppWatch; + outlets: OutletInfo[]; + links: LinkInfo[]; + linksTruncated: number; + linksUnchecked: number; tracker: ConfigTracker; config?: RouteNode[]; configTruncated: number; @@ -70,19 +77,55 @@ interface WatchedApp { /** * The apps on a page that each have a Router. The overlay keeps watching the - * first app as before; this watches every other app's router events and - * describes each one in the report's `apps` list. A page with one app - * reports no list, so its report stays as it was. + * first app as before; this watches every other app the same way (its router + * events, callers, error handler, preloads and, when on, guard runs) and + * describes each one, with its own outlets and links, in the report's `apps` + * list. A page with one app reports no list, so its report stays as it was. */ export class RouterApps { private primary: { id: string; name: string; selector: string; root: Element } | null = null; private others: WatchedApp[] = []; private roots: Element[] = []; + private instrumented = false; private readonly onChange: () => void; - constructor(onChange: () => void) { + constructor(onChange: () => void, instrumented = false) { this.onChange = onChange; + this.instrumented = instrumented; + } + + /** Turns guard and resolver recording on or off in every app other than the first. */ + setInstrumented(on: boolean): void { + this.instrumented = on; + for (const app of this.others) app.watch.setInstrumented(on); + } + + /** + * The links of the first app, from one pass over the page that also files + * every other app's links under that app. On a page with one app this is + * `linksOf` as it always was. Reads each app's outlets too. + */ + links( + ng: RouterDebugApi, + primary: AnyRecord, + cut: { links: number; unchecked?: number }, + ): LinkInfo[] { + this.dropGone(); + if (!this.primary || !this.others.length) return linksOf(ng, primary, cut); + const cuts = this.others.map(() => ({ links: 0, unchecked: 0 })); + const [first, ...rest] = linksOfRouters( + ng, + [primary, ...this.others.map((app) => app.router)], + [cut, ...cuts], + ); + this.others.forEach((app, index) => { + app.links = rest[index]; + app.linksTruncated = cuts[index].links; + app.linksUnchecked = cuts[index].unchecked; + app.outlets = read(() => outletsOf(app.router), []); + }); + return first; } /** @@ -115,6 +158,7 @@ export class RouterApps { keep.add(router); if (this.others.some((app) => app.router === router)) continue; const navigations: NavigationRecord[] = []; + const preloads: PreloadRecord[] = []; this.others.push({ id: appIdOf(root), name: appNameOf(ng, root), @@ -122,7 +166,12 @@ export class RouterApps { root, router, navigations, - stop: watchRouter(router, navigations, this.onChange), + preloads, + watch: watchApp(ng, router, root, navigations, preloads, this.onChange, this.instrumented), + outlets: read(() => outletsOf(router), []), + links: [], + linksTruncated: 0, + linksUnchecked: 0, tracker: new ConfigTracker(), configTruncated: 0, }); @@ -158,6 +207,7 @@ export class RouterApps { app.config = walkConfig(app.router, cut); app.configTruncated = cut.routes; app.setup = read(() => detectSetup(ng, app.router, routers, app.root), undefined); + setGeneration(app.tracker.generation, app.router); } const entry: RouterAppReport = { id: app.id, @@ -168,7 +218,12 @@ export class RouterApps { generation: app.tracker.generation, config: app.config, activeIds: read(() => activeIds(app.router), []), + outlets: app.outlets, + links: app.links, + preloads: app.preloads, }; + if (app.linksTruncated) entry.linksTruncated = app.linksTruncated; + if (app.linksUnchecked) entry.linksUnchecked = app.linksUnchecked; const dropped = droppedNavigations(app.navigations); if (dropped) entry.dropped = dropped; if (app.configTruncated) entry.configTruncated = app.configTruncated; @@ -197,7 +252,7 @@ export class RouterApps { /** Stops watching every app, after the first app's router went away. */ reset(): void { - for (const app of this.others) app.stop?.(); + for (const app of this.others) app.watch.stop(); this.others = []; this.primary = null; this.roots = []; @@ -215,7 +270,7 @@ export class RouterApps { } private drop(app: WatchedApp): void { - app.stop?.(); + app.watch.stop(); this.others = this.others.filter((other) => other !== app); } } diff --git a/packages/devtools/src/router-guard-targets.ts b/packages/devtools/src/router-guard-targets.ts new file mode 100644 index 00000000..66758724 --- /dev/null +++ b/packages/devtools/src/router-guard-targets.ts @@ -0,0 +1,83 @@ +import { read, type AnyRecord, type NavigationRecord } from './router.ts'; + +/** An app whose guard and resolver runs a wrapper records: its Router and navigation list. */ +export interface GuardTarget { + router: AnyRecord; + navigations: NavigationRecord[]; +} + +interface Wrapped { + targets: GuardTarget[]; + uninstall: () => void; +} + +// Each wrapper the overlay installed, with the apps it records for. Two apps +// on one page can share a guard (one class, or one routes array), and the +// guard is wrapped once, so its runs go to whichever of them is navigating. +const wrappers = new WeakMap(); + +function detach(wrapper: object, target: GuardTarget): void { + const wrapped = wrappers.get(wrapper); + if (!wrapped) return; + wrapped.targets = wrapped.targets.filter((t) => t !== target); + if (wrapped.targets.length) return; + wrappers.delete(wrapper); + wrapped.uninstall(); +} + +/** + * Keeps a wrapper the overlay just installed. `targets` is the live list the + * wrapper records into. The returned function drops `target`; the last app + * to let go puts the app's own function back with `uninstall`. + */ +export function keepWrapper( + wrapper: object, + targets: GuardTarget[], + uninstall: () => void, +): () => void { + const wrapped: Wrapped = { targets, uninstall }; + wrappers.set(wrapper, wrapped); + const target = targets[0]; + // The list the wrapper reads is replaced on detach, so it reads it through here. + return () => detach(wrapper, target); +} + +/** The apps a wrapper records for right now. */ +export function targetsOf(wrapper: object, fallback: GuardTarget[]): GuardTarget[] { + return wrappers.get(wrapper)?.targets ?? fallback; +} + +/** + * Adds `target` to a wrapper another app installed. Returns the function that + * removes it again, `undefined` when the app already records through it, and + * `null` when the value is not a wrapper this overlay keeps. + */ +export function joinWrapper(value: unknown, target: GuardTarget): (() => void) | undefined | null { + if (!value || (typeof value !== 'function' && typeof value !== 'object')) return null; + const wrapped = wrappers.get(value); + if (!wrapped) return null; + if (wrapped.targets.some((t) => t.navigations === target.navigations)) return undefined; + wrapped.targets = [...wrapped.targets, target]; + return () => detach(value, target); +} + +function navigating(router: AnyRecord): boolean { + return read(() => { + const current = + typeof router['currentNavigation'] === 'function' + ? router['currentNavigation']() + : router['getCurrentNavigation']?.(); + return !!current; + }, false); +} + +/** + * The app a guard run belongs to: the only one, else the one with a + * navigation in progress, preferring the one whose Router is navigating now. + */ +export function targetOfRun(targets: GuardTarget[]): GuardTarget | undefined { + if (targets.length <= 1) return targets[0]; + const pending = targets.filter((t) => t.navigations.some((nav) => nav.outcome === 'pending')); + if (pending.length <= 1) return pending[0] ?? targets[0]; + return pending.find((t) => navigating(t.router)) ?? pending[0]; +} diff --git a/packages/devtools/src/router-links.ts b/packages/devtools/src/router-links.ts index 5d1d44f8..bcb21ba5 100644 --- a/packages/devtools/src/router-links.ts +++ b/packages/devtools/src/router-links.ts @@ -160,19 +160,45 @@ export function linksOf( router: AnyRecord, cut: { links: number; unchecked?: number } = { links: 0 }, ): LinkInfo[] { - if (typeof document === 'undefined' || !ng.getDirectives) return []; + return linksOfRouters(ng, [router], [cut])[0]; +} + +/** The Router a RouterLink or RouterLinkActive directive was created with, if it says. */ +function ownerOf(link: AnyRecord | undefined, active: AnyRecord | undefined): unknown { + return ( + read(() => link?.['router'] as unknown, undefined) ?? + read(() => active?.['router'] as unknown, undefined) + ); +} + +/** + * {@link linksOf} for several apps' Routers in one pass over the page: each + * link goes to the list of the Router its directive holds, and a link whose + * Router is not listed goes to the first. `cuts[i]` counts the links of + * `routers[i]` that did not fit; each gets the page's unchecked count. + */ +export function linksOfRouters( + ng: RouterDebugApi, + routers: AnyRecord[], + cuts: { links: number; unchecked?: number }[], +): LinkInfo[][] { + const lists: LinkInfo[][] = routers.map(() => []); + if (typeof document === 'undefined' || !ng.getDirectives || !routers.length) return lists; const candidates = document.querySelectorAll(LINK_CANDIDATES); const checked = Math.min(candidates.length, MAX_LINK_CANDIDATES); - cut.unchecked = candidates.length - checked; - const out: LinkInfo[] = []; + for (const cut of cuts) cut.unchecked = candidates.length - checked; for (let i = 0; i < checked; i++) { const element = candidates[i]; const directives = read(() => ng.getDirectives?.(element) ?? [], []); const link = directives.find(isRouterLink); const active = directives.find(isLinkActive); if (!link && !active) continue; + const index = + routers.length > 1 ? Math.max(0, routers.indexOf(ownerOf(link, active) as AnyRecord)) : 0; + const router = routers[index]; + const out = lists[index]; if (out.length >= MAX_LINKS) { - cut.links++; + if (cuts[index]) cuts[index].links++; continue; } const info: LinkInfo = { @@ -200,5 +226,5 @@ export function linksOf( } out.push(info); } - return out; + return lists; } diff --git a/packages/devtools/src/router-track.ts b/packages/devtools/src/router-track.ts new file mode 100644 index 00000000..802867c0 --- /dev/null +++ b/packages/devtools/src/router-track.ts @@ -0,0 +1,34 @@ +/** + * What the overlay remembers between the events of one Router: the caller of + * the next navigation, a redirect waiting for the navigation it starts, the + * config generation and the count of calls that threw before a navigation + * started. Each Router has its own, so on a page that runs several Angular + * apps one app's caller or redirect is never pinned on another app's + * navigation. + */ +export interface RouterTrack { + caller: { text: string; at: number; sticky?: boolean } | null; + redirect: { from: number; kind: string } | null; + generation: number; + failedCalls: number; +} + +function freshTrack(): RouterTrack { + return { caller: null, redirect: null, generation: 0, failedCalls: 0 }; +} + +// Keyed by the Router, so a router the app drops takes its state with it. +const tracks = new WeakMap(); +// For calls that name no router, such as tests that fold events into a list. +const unowned = freshTrack(); + +/** The state of one Router; calls that name no router share one state. */ +export function trackOf(router: object | null | undefined): RouterTrack { + if (!router || typeof router !== 'object') return unowned; + let track = tracks.get(router); + if (!track) { + track = freshTrack(); + tracks.set(router, track); + } + return track; +} diff --git a/packages/devtools/src/router-types.ts b/packages/devtools/src/router-types.ts index c029645d..4a5326b2 100644 --- a/packages/devtools/src/router-types.ts +++ b/packages/devtools/src/router-types.ts @@ -416,6 +416,14 @@ export interface RouterAppReport { configTruncated?: number; activeIds?: string[]; setup?: RouterSetup; + /** This app's outlet tree, from its own Router. */ + outlets?: OutletInfo[]; + /** The RouterLink and RouterLinkActive directives created with this app's Router. */ + links?: LinkInfo[]; + linksTruncated?: number; + linksUnchecked?: number; + /** The preloads this app's own preloader ran. */ + preloads?: PreloadRecord[]; /** Navigation loops in this app's history; the server adds them, the page never sends them. */ loops?: NavigationLoop[]; } diff --git a/packages/devtools/src/router.ts b/packages/devtools/src/router.ts index 91a4c6e8..e0e89671 100644 --- a/packages/devtools/src/router.ts +++ b/packages/devtools/src/router.ts @@ -5,6 +5,7 @@ import { decode, isSecretKey, knownSecrets, redactText, rememberSecret } from '. import { clip } from './text.ts'; import { matchedRoutesOf } from './router-matched.ts'; import { navigationFromQuery, redirectFromQuery } from './router-open-redirect.ts'; +import { trackOf } from './router-track.ts'; import type { RouteGuards, ActiveRoute, @@ -109,18 +110,22 @@ interface NavState { const navState = new WeakMap(); const seenRoutes = new WeakSet(); -let pendingCaller: { text: string; at: number; sticky?: boolean } | null = null; -let pendingRedirect: { from: number; kind: string } | null = null; -let configGeneration = 0; let navigationLimit = 50; -export function setCaller(text: string, sticky = false) { - if (!sticky && pendingCaller?.sticky && Date.now() - pendingCaller.at < 50) return; - pendingCaller = { text: clip(redactText(text, knownSecrets), 200), at: Date.now(), sticky }; +/** + * Notes who starts the next navigation of `router`: a RouterLink click, the + * code that called `navigate()`, or a DevTools action. Each Router keeps its + * own (`router-track.ts`), so one app's caller never lands on another's. + */ +export function setCaller(text: string, sticky = false, router?: object | null) { + const track = trackOf(router); + if (!sticky && track.caller?.sticky && Date.now() - track.caller.at < 50) return; + track.caller = { text: clip(redactText(text, knownSecrets), 200), at: Date.now(), sticky }; } -export function setGeneration(generation: number) { - configGeneration = generation; +/** The config generation the next navigations of `router` are stamped with. */ +export function setGeneration(generation: number, router?: object | null) { + trackOf(router).generation = generation; } /** How many navigations a page keeps (`limits.navigations`). */ @@ -833,16 +838,16 @@ export function noteRun(navigations: NavigationRecord[], run: GuardRun) { nav.runs = [...(nav.runs ?? []), { ...run, result: redactMessage(run.result) }].slice(-40); } -let failedCalls = 0; - export function noteFailedCall( navigations: NavigationRecord[], url: string, error: unknown, at: number, + router?: object | null, ) { + const track = trackOf(router); navigations.push({ - id: -++failedCalls, + id: -++track.failedCalls, url: redactUrl(url), trigger: 'imperative', startedAt: at, @@ -850,8 +855,8 @@ export function noteFailedCall( outcome: 'failed', reason: errorText(error), errorCode: errorCodeOf(error), - caller: pendingCaller?.text, - generation: configGeneration, + caller: track.caller?.text, + generation: track.generation, }); trimNavigations(navigations, navigationLimit); } @@ -907,6 +912,7 @@ export function applyRouterEvent( const type = routerEventType(event); const id = read(() => event['id'] as number, -1); const current = findPending(navigations); + const track = trackOf(router); if (type === undefined) { if (isRedirectRequest(event)) { let source: NavigationRecord | undefined; @@ -932,7 +938,7 @@ export function applyRouterEvent( nav.id > source!.id && nav.outcome === 'pending' && nav.redirectedFrom === undefined, ); if (follower) follower.redirectedFrom = source.id; - else pendingRedirect = { from: source.id, kind: source.redirectKind }; + else track.redirect = { from: source.id, kind: source.redirectKind }; return true; } if (!current) return false; @@ -950,7 +956,7 @@ export function applyRouterEvent( trigger: String(event['navigationTrigger'] ?? 'imperative'), startedAt: at, outcome: 'pending', - generation: configGeneration, + generation: track.generation, }; const state = stateOf(nav); state.secrets = configSecretsFor(router, url); @@ -963,13 +969,13 @@ export function applyRouterEvent( }, null); const listed = extrasOf(extras, event['restoredState']); if (listed) nav.extras = listed; - if (pendingCaller && at - pendingCaller.at < 2000 && nav.trigger === 'imperative') { - nav.caller = pendingCaller.text; + if (track.caller && at - track.caller.at < 2000 && nav.trigger === 'imperative') { + nav.caller = track.caller.text; } - pendingCaller = null; - if (pendingRedirect) { - nav.redirectedFrom = pendingRedirect.from; - pendingRedirect = null; + track.caller = null; + if (track.redirect) { + nav.redirectedFrom = track.redirect.from; + track.redirect = null; } else { linkCancelledRedirect(navigations, nav); } @@ -1024,11 +1030,11 @@ export function applyRouterEvent( trigger: skippedTriggerOf(router, id), startedAt: at, outcome: 'pending', - generation: configGeneration, + generation: track.generation, }; - if (pendingCaller && at - pendingCaller.at < 2000 && nav.trigger === 'imperative') - nav.caller = pendingCaller.text; - pendingCaller = null; + if (track.caller && at - track.caller.at < 2000 && nav.trigger === 'imperative') + nav.caller = track.caller.text; + track.caller = null; navigations.push(nav); } const nav = navigations.find((n) => n.id === id); @@ -1197,7 +1203,7 @@ export function lastNavigationOf(router: AnyRecord, at: number): NavigationRecor startedAt: at, outcome: 'succeeded', beforeConnect: true, - generation: configGeneration, + generation: trackOf(router).generation, }; } @@ -1225,7 +1231,7 @@ export function currentNavigationOf(router: AnyRecord, at: number): NavigationRe startedAt: at, outcome: 'pending', beforeConnect: true, - generation: configGeneration, + generation: trackOf(router).generation, }; stateOf(record).secrets = secrets; return record; diff --git a/packages/devtools/src/rpc/router-apps.ts b/packages/devtools/src/rpc/router-apps.ts index bb13f336..a434afb7 100644 --- a/packages/devtools/src/rpc/router-apps.ts +++ b/packages/devtools/src/rpc/router-apps.ts @@ -2,6 +2,7 @@ import type { RouterAppReport } from '../router-apps.ts'; import { code } from './forms-tools.ts'; import { detectLoops } from './router-loops.ts'; import { pickPage, type RouterPage, type RouterState } from './router-tools.ts'; +import type { StreamApp } from './router-stream.ts'; /** The `app` argument of the router agent tools. */ export const APP_ARGUMENT = { @@ -10,6 +11,13 @@ export const APP_ARGUMENT = { 'On a page that runs several Angular apps with a Router, the app to read: its id or root component name, as the answer lists them. Defaults to the first app.', } as const; +/** The `app` argument of `follow-navigations`. */ +export const FOLLOW_APP_ARGUMENT = { + type: 'string', + description: + "On a page that runs several Angular apps with a Router, the app to follow: its id or root component name, as `inspect-route` lists them. Defaults to each page's first app.", +} as const; + /** The apps of a page that runs more than one Angular app with a Router, else none. */ export function routerAppsOf(page: RouterPage | undefined): RouterAppReport[] { return page?.apps && page.apps.length > 1 ? page.apps : []; @@ -33,10 +41,10 @@ export function findRouterApp(page: RouterPage, app: string): RouterAppReport | } /** - * The page as one of its apps sees it: that app's route, navigations, config - * and setup in place of the first app's, with the page-wide parts the - * overlay reads for the first app only (outlets, links, preloads, guard - * recording) left out. The first app's own entry gives the page unchanged. + * The page as one of its apps sees it: that app's route, navigations, config, + * setup, outlets, links and preloads in place of the first app's. Guard + * recording is one switch for the whole page. The first app's own entry + * gives the page unchanged. */ export function routerAppPage(page: RouterPage, app: RouterAppReport): RouterPage { if (app.primary) return { ...page, appId: app.id }; @@ -56,6 +64,12 @@ export function routerAppPage(page: RouterPage, app: RouterAppReport): RouterPag if (app.configTruncated) view.configTruncated = app.configTruncated; if (app.activeIds) view.activeIds = app.activeIds; if (app.setup) view.setup = app.setup; + if (app.outlets) view.outlets = app.outlets; + if (app.links) view.links = app.links; + if (app.linksTruncated) view.linksTruncated = app.linksTruncated; + if (app.linksUnchecked) view.linksUnchecked = app.linksUnchecked; + if (app.preloads) view.preloads = app.preloads; + if (page.instrumented !== undefined) view.instrumented = page.instrumented; view.loops = detectLoops(navigations, app.config); return view; } @@ -103,3 +117,43 @@ export function routerStateForApp( note: routerAppsNote(view), }; } + +/** + * The page and app `follow-navigations` reads, for its `app` argument. + * Without `app` it follows the first app of every page (or of `page`), as on + * a page with one app; the note then names the other apps where there are any. + */ +export function streamAppFor( + state: RouterState, + args: { page?: string; app?: unknown }, +): { page?: string; app: StreamApp; note: string } | { error: string } { + if (args.app === undefined || args.app === null || args.app === '') { + const several = state.pages.filter( + (p) => (!args.page || p.pageId === args.page) && routerAppsOf(p).length, + ); + const note = several.length + ? `\n\n${several.length === 1 ? `Page ${code(several[0].pageId)} runs` : `${several.length} pages run`} several Angular apps with a Router; this follows the first app. Pass \`app\` to follow another.` + : ''; + return { page: args.page, app: null, note }; + } + if (typeof args.app !== 'string') return { error: 'Pass `app` as a string.' }; + const page = pickPage(state, args.page); + if (!page) return { error: 'No page reports a Router yet, so there is no app to follow.' }; + const apps = routerAppsOf(page); + if (!apps.length) { + return { + error: `Page ${code(page.pageId)} runs one Angular app with a Router, so there is no app to pick. Leave \`app\` out.`, + }; + } + const app = findRouterApp(page, args.app); + if (!app) { + return { + error: `Page ${code(page.pageId)} has no app ${code(args.app.slice(0, 60))}. Its apps are ${apps.map(label).join(', ')}.`, + }; + } + return { + page: page.pageId, + app: app.primary ? null : app.id, + note: routerAppsNote({ ...page, appId: app.id }), + }; +} diff --git a/packages/devtools/src/rpc/router-stream.ts b/packages/devtools/src/rpc/router-stream.ts index 293791e1..e029eb04 100644 --- a/packages/devtools/src/rpc/router-stream.ts +++ b/packages/devtools/src/rpc/router-stream.ts @@ -1,4 +1,5 @@ import type { NavigationRecord } from '../router.ts'; +import type { RouterReport } from '../router-types.ts'; import { code, UNTRUSTED } from './forms-tools.ts'; import { capped, MAX_TOOL_CHARS } from './router-tools.ts'; @@ -6,6 +7,8 @@ import { capped, MAX_TOOL_CHARS } from './router-tools.ts'; export interface StreamEntry { seq: number; pageId: string; + /** The app of a page that runs several, for any app but the first. */ + appId?: string; nav: NavigationRecord; /** It was in the stream before, with another outcome or target. */ updated: boolean; @@ -37,11 +40,28 @@ function signature(nav: NavigationRecord): string { ].join('|'); } +/** The key of one navigation of one app of one page; the page id comes first. */ +function keyOf(pageId: string, appId: string | undefined, nav: NavigationRecord): string { + return `${pageId}\u0000${appId ?? ''}\u0000${nav.id}\u0000${nav.startedAt}`; +} + +/** + * Which apps a read or a clear covers: `undefined` every app, `null` the + * first app only, a string that one app. + */ +export type StreamApp = string | null | undefined; + +function inApp(entryApp: string | undefined, app: StreamApp): boolean { + return app === undefined || (app === null ? entryApp === undefined : entryApp === app); +} + /** * Every navigation the pages report, in the order the server saw them, each * with a sequence number. A navigation comes again with a higher number when * its outcome, target or end changes, so an agent that reads with the last - * cursor sees a pending navigation once it ends. Probes are left out. + * cursor sees a pending navigation once it ends. Probes are left out. On a + * page that runs several Angular apps, each app's navigations carry its id; + * the first app's carry none. */ export class NavigationStream { private seq = 0; @@ -50,12 +70,15 @@ export class NavigationStream { private waiters = new Set<() => void>(); private dropped = 0; - /** Adds the navigations of one report that are new or changed. Returns how many. */ - record(pageId: string, navigations: readonly NavigationRecord[]): number { + /** + * Adds the navigations of one report that are new or changed, for the first + * app of the page or, with `appId`, another app. Returns how many. + */ + record(pageId: string, navigations: readonly NavigationRecord[], appId?: string): number { let added = 0; for (const nav of navigations) { if (nav.probe) continue; - const key = `${pageId}\u0000${nav.id}\u0000${nav.startedAt}`; + const key = keyOf(pageId, appId, nav); const sig = signature(nav); const before = this.signatures.get(key); if (before === sig) continue; @@ -64,11 +87,14 @@ export class NavigationStream { (entry) => !( entry.pageId === pageId && + entry.appId === appId && entry.nav.id === nav.id && entry.nav.startedAt === nav.startedAt ), ); - this.entries.push({ seq: ++this.seq, pageId, nav, updated: before !== undefined }); + const entry: StreamEntry = { seq: ++this.seq, pageId, nav, updated: before !== undefined }; + if (appId !== undefined) entry.appId = appId; + this.entries.push(entry); added++; } if (this.entries.length > MAX_STREAM_ENTRIES) { @@ -77,9 +103,7 @@ export class NavigationStream { this.entries.splice(0, cut); } if (this.signatures.size > MAX_STREAM_ENTRIES * 4) { - const keep = new Set( - this.entries.map((e) => `${e.pageId}\u0000${e.nav.id}\u0000${e.nav.startedAt}`), - ); + const keep = new Set(this.entries.map((e) => keyOf(e.pageId, e.appId, e.nav))); for (const key of this.signatures.keys()) if (!keep.has(key)) this.signatures.delete(key); } // A copy: each waiter removes itself from the set when it wakes. @@ -88,16 +112,28 @@ export class NavigationStream { return added; } + /** Adds a router report's navigations: the first app's, then each other app's under its id. */ + recordReport(report: RouterReport): number { + let added = this.record(report.pageId, report.navigations); + for (const app of report.apps ?? []) { + if (!app.primary) added += this.record(report.pageId, app.navigations ?? [], app.id); + } + return added; + } + /** * Forgets the navigations of one page, or of every page, after they were - * cleared or the page went away. The cursor keeps counting, so a cursor an - * agent holds stays valid. + * cleared or the page went away; with `app`, only those of one app (see + * {@link StreamApp}). The cursor keeps counting, so a cursor an agent holds + * stays valid. */ - clear(pageId?: string): void { - const gone = (id: string) => pageId === undefined || id === pageId; - this.entries = this.entries.filter((entry) => !gone(entry.pageId)); + clear(pageId?: string, app?: StreamApp): void { + const gone = (id: string, appId: string | undefined) => + (pageId === undefined || id === pageId) && inApp(appId, app); + this.entries = this.entries.filter((entry) => !gone(entry.pageId, entry.appId)); for (const key of this.signatures.keys()) { - if (gone(key.slice(0, key.indexOf('\u0000')))) this.signatures.delete(key); + const [id, appId] = key.split('\u0000'); + if (gone(id, appId || undefined)) this.signatures.delete(key); } } @@ -116,11 +152,16 @@ export class NavigationStream { return this.seq; } - /** The entries after `since`, for one page or every page. */ - read(since: number, pageId?: string): StreamRead { + /** + * The entries after `since`, for one page or every page, and for the apps + * `app` names (see {@link StreamApp}). + */ + read(since: number, pageId?: string, app?: StreamApp): StreamRead { const reset = since > this.seq || since < 0; const from = reset ? 0 : since; - const entries = this.entries.filter((e) => e.seq > from && (!pageId || e.pageId === pageId)); + const entries = this.entries.filter( + (e) => e.seq > from && (!pageId || e.pageId === pageId) && inApp(e.appId, app), + ); const out: StreamRead = { entries, cursor: this.seq }; if (reset) out.reset = true; if (!reset && this.dropped > from) out.missed = this.dropped - from; @@ -131,8 +172,8 @@ export class NavigationStream { * Like {@link read}, but when nothing came after `since` yet, waits up to * `ms` (at most {@link MAX_WAIT_MS}) for the next navigation first. */ - async wait(since: number, ms: number, pageId?: string): Promise { - const first = this.read(since, pageId); + async wait(since: number, ms: number, pageId?: string, app?: StreamApp): Promise { + const first = this.read(since, pageId, app); const limit = Math.max(0, Math.min(MAX_WAIT_MS, ms)); if (first.entries.length || first.reset || limit === 0) return first; await new Promise((resolve) => { @@ -142,13 +183,13 @@ export class NavigationStream { resolve(); }; const check = () => { - if (this.read(since, pageId).entries.length) done(); + if (this.read(since, pageId, app).entries.length) done(); }; const timer = setTimeout(done, limit); timer.unref?.(); this.waiters.add(check); }); - return this.read(since, pageId); + return this.read(since, pageId, app); } } @@ -163,7 +204,8 @@ function line(entry: StreamEntry): string { ? `: ${code(nav.reason)}` : ''; const took = nav.endedAt !== undefined ? ` in ${nav.endedAt - nav.startedAt}ms` : ''; - return `- [${entry.seq}] page ${code(entry.pageId)} #${nav.id} ${code(nav.url)}${target}: **${nav.outcome}**${took}${redirect}${reason}${entry.updated ? ' (updated)' : ''}`; + const app = entry.appId ? ` app ${code(entry.appId)}` : ''; + return `- [${entry.seq}] page ${code(entry.pageId)}${app} #${nav.id} ${code(nav.url)}${target}: **${nav.outcome}**${took}${redirect}${reason}${entry.updated ? ' (updated)' : ''}`; } /** The stream read as markdown for the `follow-navigations` tool. */ diff --git a/packages/devtools/src/rpc/router-tools.ts b/packages/devtools/src/rpc/router-tools.ts index 85c91b9b..16db7b29 100644 --- a/packages/devtools/src/rpc/router-tools.ts +++ b/packages/devtools/src/rpc/router-tools.ts @@ -414,7 +414,12 @@ function isRouterApp(value: unknown, maxNavigations: number): boolean { ) && optional(app.configTruncated, isNumber) && optional(app.activeIds, (v) => isNames(v, MAX_ROUTES)) && - optional(app.setup, (v) => isRecord(v) && isPlain(v, { n: 500 })) + optional(app.setup, (v) => isRecord(v) && isPlain(v, { n: 500 })) && + optional(app.outlets, (v) => Array.isArray(v) && isPlain(v, { n: 3_000 })) && + optional(app.links, (v) => Array.isArray(v) && v.length <= 100 && isPlain(v, { n: 3_000 })) && + optional(app.linksTruncated, isNumber) && + optional(app.linksUnchecked, isNumber) && + optional(app.preloads, (v) => Array.isArray(v) && v.length <= 50 && isPlain(v, { n: 500 })) ); } diff --git a/scripts/e2e-mcp.mjs b/scripts/e2e-mcp.mjs index 4b76e430..ec08063f 100644 --- a/scripts/e2e-mcp.mjs +++ b/scripts/e2e-mcp.mjs @@ -1519,6 +1519,14 @@ async function runActions(state) { r.markdown.slice(0, 400), ); await act('record-guards', { on: true }); + // follow-navigations follows one app of a page that runs several; the demo runs one. + r = await act('follow-navigations', { app: 'app-root' }, 'refusal'); + write( + 'follow-navigations', + 'an app on a page with one app is refused with the reason', + /one Angular app/.test(r.markdown), + r.markdown.slice(0, 300), + ); // The old actions are gone: `probe` is not a `navigate` action any more. await act('navigate', { action: 'probe', url: '/trips' }, 'refusal'); const navs = await read('explain-navigation', { limit: 3 });