diff --git a/.eslintignore b/.eslintignore index 8f9434ed3..b83169aeb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -49,3 +49,5 @@ package-lock.json /suites-experimental/responsive-design/build-dev/ /suites-experimental/stormbox-react/ +/suites-experimental/tools-gps-tracks-angular +/suites-experimental/tools-gps-tracks-angular/** diff --git a/.prettierignore b/.prettierignore index 40d154c13..03a2ccaaa 100644 --- a/.prettierignore +++ b/.prettierignore @@ -49,3 +49,5 @@ package-lock.json /suites-experimental/responsive-design/build-dev/ /suites-experimental/responsive-design/**/*.generated.css /suites-experimental/stormbox-react/ +/suites-experimental/tools-gps-tracks-angular +/suites-experimental/tools-gps-tracks-angular/** diff --git a/suites-experimental/suites.mjs b/suites-experimental/suites.mjs index eb6f8302c..befd304e0 100644 --- a/suites-experimental/suites.mjs +++ b/suites-experimental/suites.mjs @@ -736,4 +736,72 @@ export const ExperimentalSuites = freezeSuites([ }), ], }, + { + name: "Tools-GPS-Tracks-Angular", + url: "suites-experimental/tools-gps-tracks-angular/dist/index.html", + resources: "suites-experimental/tools-gps-tracks-angular/dist/resources.txt", + tags: ["experimental", "charts", "gpx"], + type: "async", + async prepare(page) { + await page.waitForElement("#app-is-ready"); + }, + tests: [ + new BenchmarkTestStep("LoadAndParseFiles", async (page) => { + const complete = new Promise((resolve) => { + page.addEventListener("load-and-parse-complete", resolve, { once: true }); + }); + page.querySelector("#btn-step-load").click(); + await complete; + page.layout(); + }), + new BenchmarkTestStep("DisplayAnalysisMetrics", async (page) => { + const complete = new Promise((resolve) => { + page.addEventListener("analysis-complete", resolve, { once: true }); + }); + page.querySelector("#btn-step-analysis").click(); + await complete; + page.layout(); + }), + new BenchmarkTestStep("DisplayInsights", async (page) => { + const complete = new Promise((resolve) => { + page.addEventListener("insights-complete", resolve, { once: true }); + }); + page.querySelector("#btn-step-insights").click(); + await complete; + page.layout(); + }), + new BenchmarkTestStep("DisplayDetails", async (page) => { + const complete = new Promise((resolve) => { + page.addEventListener("details-complete", resolve, { once: true }); + }); + page.querySelector("#btn-step-details").click(); + await complete; + page.layout(); + }), + new BenchmarkTestStep("DisplayAggregateMetrics", async (page) => { + const complete = new Promise((resolve) => { + page.addEventListener("aggregate-complete", resolve, { once: true }); + }); + page.querySelector("#btn-step-aggregate").click(); + await complete; + page.layout(); + }), + new BenchmarkTestStep("DisplayEvolutionMetrics", async (page) => { + const complete = new Promise((resolve) => { + page.addEventListener("evolution-complete", resolve, { once: true }); + }); + page.querySelector("#btn-step-evolution").click(); + await complete; + page.layout(); + }), + new BenchmarkTestStep("DisplayCourses", async (page) => { + const complete = new Promise((resolve) => { + page.addEventListener("courses-complete", resolve, { once: true }); + }); + page.querySelector("#btn-step-courses").click(); + await complete; + page.layout(); + }), + ], + }, ]); diff --git a/suites-experimental/tools-gps-tracks-angular/.gitignore b/suites-experimental/tools-gps-tracks-angular/.gitignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/suites-experimental/tools-gps-tracks-angular/.prettierignore b/suites-experimental/tools-gps-tracks-angular/.prettierignore new file mode 100644 index 000000000..f4464f026 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/.prettierignore @@ -0,0 +1,3 @@ +dist/ +test-data/ +src/css/uPlot.min.css diff --git a/suites-experimental/tools-gps-tracks-angular/.prettierrc b/suites-experimental/tools-gps-tracks-angular/.prettierrc new file mode 100644 index 000000000..ca8527e0d --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/.prettierrc @@ -0,0 +1,7 @@ +{ + "semi": true, + "trailingComma": "all", + "singleQuote": true, + "printWidth": 100, + "tabWidth": 2 +} diff --git a/suites-experimental/tools-gps-tracks-angular/LICENSE b/suites-experimental/tools-gps-tracks-angular/LICENSE new file mode 100644 index 000000000..74eccfcc9 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/LICENSE @@ -0,0 +1,28 @@ +BSD 3-Clause License + +Copyright (c) 2026, Camillo Bruni + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/suites-experimental/tools-gps-tracks-angular/README.md b/suites-experimental/tools-gps-tracks-angular/README.md new file mode 100644 index 000000000..a90e019da --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/README.md @@ -0,0 +1,28 @@ +# Tools-GPS-Tracks-Angular Workload + +## Description + +This workload simulates an offline-capable GPS track analyzer and activity dashboard (`weg-strasse`) built with Angular 19 standalone `@Component`s (`AppComponent`, `GraphsTabComponent`, `InsightsTabComponent`, `DetailsTabComponent`, `CombinedTabComponent`, `EvolutionTabComponent`, `CoursesTabComponent`) and `TrackStateService`. It parses binary and XML activity tracks (`.fit`, `.gpx`, `.tcx`, `.kml`) compressed with `gzip`, persists activity data in IndexedDB, and computes physiological and geospatial analytics rendered via Angular templates (`*ngIf`, `*ngFor`, `ChangeDetectorRef.detectChanges()`) and `uPlot` Canvas charts. + +## Benchmark Steps + +1. **LoadAndParseFiles**: Fetches, decompresses (`DecompressionStream`), and parses 6 synthetic GPS activity tracks (`.gpx.gz`, `.tcx.gz`, `.fit.gz`), computes track statistics and power/heart-rate duration curves, persists tracks in IndexedDB, and renders the map and metric charts. +2. **DisplayAnalysisMetrics**: Simulates brush selection and hover interactions across telemetry charts, updating track statistics and map segments over the selected range. +3. **DisplayInsights**: Renders the Insights view with power and heart-rate duration curves, physiological training zones, aerobic decoupling / W' balance analytics, and kilometer split tables. +4. **DisplayDetails**: Renders the Details view with device/sensor metadata, lap and gear-shift breakdowns, and editing interactions. +5. **DisplayAggregateMetrics**: Renders the Aggregate view, computing multi-track sliding-window cross-correlations, comparative telemetry tables, and overlaid multi-track charts. +6. **DisplayEvolutionMetrics**: Renders the Evolution and Accumulated views, modeling acute/chronic training load (ATL/CTL/TSB) and plotting multi-metric progression and cumulative timelines. +7. **DisplayCourses**: Creates a multi-waypoint course, matches candidate tracks passing through geospatial gates, and renders course segment leaderboards and corridor comparisons. + +## Requirements + +Please always compile inside the latest `node` LTS requirement (`>=24.0.0`). + +## Building + +Run `npm install` inside `/suites-experimental/tools-gps-tracks-angular`, then run `npm run build` to typecheck, generate deterministic compressed test tracks in `test-data/`, bundle the application and sourcemaps into `dist/`, and generate `dist/resources.txt`. + +## Develop & Run Locally + +1. Run `npm install` inside `/suites-experimental/tools-gps-tracks-angular`. +2. Run `npm run dev` to watch, rebuild on source changes, and start a local development server for `dist/`. diff --git a/suites-experimental/tools-gps-tracks-angular/build.js b/suites-experimental/tools-gps-tracks-angular/build.js new file mode 100644 index 000000000..5d6b8ab6d --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/build.js @@ -0,0 +1,231 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import * as esbuild from 'esbuild'; +import { readFile, writeFile, mkdir, copyFile, cp, rm, readdir } from 'fs/promises'; +import path from 'path'; +import { execSync } from 'child_process'; +import { generateResourcesFile } from '../../resources/shared/generate-resources.mjs'; + +const args = process.argv.slice(2); +const watch = args.includes('--watch'); + +const baseConfig = { + bundle: true, + minify: !watch, + sourcemap: true, + format: 'esm', + target: ['es2020'], + outdir: 'dist', + assetNames: '[name]', + outExtension: { '.js': '.mjs' }, + define: { + ngDevMode: 'false', + }, + loader: { + '.woff2': 'file', + '.png': 'file', + '.svg': 'file', + }, +}; + +async function copyStaticAssets() { + const assets = [ + { src: 'src/index.html', dest: 'index.html' }, + { src: 'material_symbols_rounded.woff2', dest: 'material_symbols_rounded.woff2' }, + ]; + await mkdir('dist', { recursive: true }); + + for (const asset of assets) { + try { + await copyFile(asset.src, path.join('dist', asset.dest)); + console.log(`Copied ${asset.src} to dist/${asset.dest}`); + } catch (e) { + console.warn(`Could not copy ${asset.src}: ${e.message}`); + } + } + + try { + await cp('test-data', path.join('dist', 'test-data'), { recursive: true }); + console.log('Copied test-data to dist/test-data'); + } catch (e) { + console.warn(`Could not copy test-data: ${e.message}`); + } +} + +async function collectLicenses() { + const deps = ['uplot', 'fit-file-parser', '@angular/core', 'rxjs', 'zone.js']; + let output = ''; + + try { + const rootLicense = await readFile('LICENSE', 'utf-8'); + output += `TOOLS-GPS-TRACKS-ANGULAR LICENSE\n===========\n\n${rootLicense}\n\n`; + } catch (e) {} + + for (const dep of deps) { + try { + let content; + try { + content = await readFile(path.join('node_modules', dep, 'LICENSE'), 'utf-8'); + } catch { + content = await readFile(path.join('node_modules', dep, 'LICENSE.txt'), 'utf-8'); + } + output += `\n\n------------------------------------------------------------------------------\n${dep.toUpperCase()} LICENSE\n------------------------------------------------------------------------------\n\n${content}\n`; + } catch (e) { + console.warn(`Could not find license for ${dep}`); + } + } + + output += `\n\n------------------------------------------------------------------------------\nBUNDLED FONT ASSETS LICENSE (MATERIAL SYMBOLS)\n------------------------------------------------------------------------------\n\n`; + output += `Assets: material_symbols_rounded.woff2 (and hashed build assets)\n`; + output += `Copyright Google LLC\n\n`; + output += `Licensed under the Apache License, Version 2.0 (the "License");\n`; + output += `you may not use these assets except in compliance with the License.\n`; + output += `You may obtain a copy of the License at\n\n`; + output += ` http://www.apache.org/licenses/LICENSE-2.0\n\n`; + output += `Unless required by applicable law or agreed to in writing, software\n`; + output += `distributed under the License is distributed on an "AS IS" BASIS,\n`; + output += `WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n`; + output += `See the License for the specific language governing permissions and\n`; + output += `limitations under the License.\n\n`; + output += `MODIFICATION AND SUBSETTING NOTICE (Apache License 2.0, Section 4(b)):\n`; + output += `These font binaries are subsetted and modified derivatives of the original\n`; + output += `Google Material Symbols font files, containing only the\n`; + output += `specific glyphs and icons utilized by the Tools-GPS-Tracks-Angular benchmark workload.\n`; + + try { + const testDataDir = path.join('dist', 'test-data'); + let testFiles = []; + try { + const manifestPath = path.join(testDataDir, 'manifest.json'); + const manifestData = JSON.parse(await readFile(manifestPath, 'utf-8')); + testFiles = Array.isArray(manifestData) ? [...manifestData, 'manifest.json'] : []; + } catch (e) { + testFiles = await readdir(testDataDir); + } + + output += `\n\n------------------------------------------------------------------------------\nBUNDLED GPS TEST TRACKS LICENSE (dist/test-data/*)\n------------------------------------------------------------------------------\n\n`; + output += `Bundled synthetic GPS test track files:\n`; + testFiles.sort().forEach((file) => { + output += `- dist/test-data/${file}\n`; + }); + output += `\nBSD 3-Clause License\n\n`; + output += `Copyright (c) 2026, Camillo Bruni / Speedometer Contributors\n\n`; + output += `Redistribution and use in source and binary forms, with or without\n`; + output += `modification, are permitted provided that the following conditions are met:\n\n`; + output += `1. Redistributions of source code must retain the above copyright notice, this\n`; + output += ` list of conditions and the following disclaimer.\n\n`; + output += `2. Redistributions in binary form must reproduce the above copyright notice,\n`; + output += ` this list of conditions and the following disclaimer in the documentation\n`; + output += ` and/or other materials provided with the distribution.\n\n`; + output += `3. Neither the name of the copyright holder nor the names of its\n`; + output += ` contributors may be used to endorse or promote products derived from\n`; + output += ` this software without specific prior written permission.\n\n`; + output += `THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\n`; + output += `AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n`; + output += `IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n`; + output += `DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n`; + output += `FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n`; + output += `DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n`; + output += `SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n`; + output += `CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n`; + output += `OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n`; + output += `OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n`; + } catch (e) { + console.warn(`Could not collect bundled GPS test track licenses: ${e.message}`); + } + + await mkdir('dist', { recursive: true }); + await writeFile(path.join('dist', 'LICENSE'), output); + console.log('Generated dist/LICENSE with NPM dependencies and bundled data assets.'); +} + +function generateTestData() { + console.log('Generating synthetic GPS track test data...'); + execSync('node scripts/generate-test-data.mjs', { stdio: 'inherit' }); +} + +async function build() { + await rm('dist', { recursive: true, force: true }); + generateTestData(); + + // 1. Bundle main app code + const ctxWeg = await esbuild.context({ + ...baseConfig, + entryPoints: ['src/app.ts'], + entryNames: 'tools-gps-tracks-angular', + external: ['uplot', 'fit-file-parser'], + }); + + const ctxOverride = await esbuild.context({ + ...baseConfig, + entryPoints: ['src/benchmark-override.ts'], + entryNames: 'benchmark-override', + }); + + // 2. Bundle Vendors + const vendorEntryPoints = { + uplot: 'node_modules/uplot/dist/uPlot.esm.js', + 'fit-file-parser': 'src/vendor-fit.ts', + }; + + const vendorCtxs = await Promise.all( + Object.entries(vendorEntryPoints).map(([name, entry]) => + esbuild.context({ + ...baseConfig, + entryPoints: [entry], + entryNames: name, + }), + ), + ); + + // 3. Bundle CSS + const ctxCss = await esbuild.context({ + ...baseConfig, + entryPoints: ['src/css/styles.css'], + entryNames: 'styles', + }); + + if (watch) { + await copyStaticAssets(); + await Promise.all([ + ctxWeg.watch(), + ctxOverride.watch(), + ctxCss.watch(), + ...vendorCtxs.map((c) => c.watch()), + ]); + await generateResourcesFile(path.join(import.meta.dirname, 'dist')); + + const { host, port } = await ctxWeg.serve({ + servedir: 'dist', + fallback: 'index.html', + }); + console.log(`Development server: http://${host}:${port}`); + } else { + await Promise.all([ + ctxWeg.rebuild(), + ctxOverride.rebuild(), + ctxCss.rebuild(), + ...vendorCtxs.map((c) => c.rebuild()), + ]); + + await copyStaticAssets(); + await collectLicenses(); + + await Promise.all([ + ctxWeg.dispose(), + ctxOverride.dispose(), + ctxCss.dispose(), + ...vendorCtxs.map((c) => c.dispose()), + ]); + + await generateResourcesFile(path.join(import.meta.dirname, 'dist')); + console.log('Build complete. Production files and resources.txt are in dist/'); + } +} + +build().catch((err) => { + console.error(err); + process.exit(1); +}); diff --git a/suites-experimental/tools-gps-tracks-angular/dist/LICENSE b/suites-experimental/tools-gps-tracks-angular/dist/LICENSE new file mode 100644 index 000000000..58d845f9f --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/LICENSE @@ -0,0 +1,423 @@ +TOOLS-GPS-TRACKS-ANGULAR LICENSE +=========== + +BSD 3-Clause License + +Copyright (c) 2026, Camillo Bruni + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + +------------------------------------------------------------------------------ +UPLOT LICENSE +------------------------------------------------------------------------------ + +The MIT License (MIT) + +Copyright (c) 2022 Leon Sorokin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +------------------------------------------------------------------------------ +FIT-FILE-PARSER LICENSE +------------------------------------------------------------------------------ + +The MIT License (MIT) + +Copyright (c) 2015 Pierre Jacquier +http://pierrejacquier.com | @pierremtb + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + + +------------------------------------------------------------------------------ +@ANGULAR/CORE LICENSE +------------------------------------------------------------------------------ + +The MIT License + +Copyright (c) 2010-2025 Google LLC. https://angular.dev/license + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + + +------------------------------------------------------------------------------ +RXJS LICENSE +------------------------------------------------------------------------------ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + + +------------------------------------------------------------------------------ +ZONE.JS LICENSE +------------------------------------------------------------------------------ + +The MIT License + +Copyright (c) 2010-2025 Google LLC. https://angular.dev/license + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + + +------------------------------------------------------------------------------ +BUNDLED FONT ASSETS LICENSE (MATERIAL SYMBOLS) +------------------------------------------------------------------------------ + +Assets: material_symbols_rounded.woff2 (and hashed build assets) +Copyright Google LLC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use these assets except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +MODIFICATION AND SUBSETTING NOTICE (Apache License 2.0, Section 4(b)): +These font binaries are subsetted and modified derivatives of the original +Google Material Symbols font files, containing only the +specific glyphs and icons utilized by the Tools-GPS-Tracks-Angular benchmark workload. + + +------------------------------------------------------------------------------ +BUNDLED GPS TEST TRACKS LICENSE (dist/test-data/*) +------------------------------------------------------------------------------ + +Bundled synthetic GPS test track files: +- dist/test-data/activity_1_alps_stage.gpx.gz +- dist/test-data/activity_2_forest_mtb.gpx.gz +- dist/test-data/activity_3_road_race.tcx.gz +- dist/test-data/activity_4_intervals.tcx.gz +- dist/test-data/activity_5_grand_tour.fit.gz +- dist/test-data/activity_6_weekend_ride.fit.gz +- dist/test-data/manifest.json + +BSD 3-Clause License + +Copyright (c) 2026, Camillo Bruni / Speedometer Contributors + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/suites-experimental/tools-gps-tracks-angular/dist/benchmark-override.mjs b/suites-experimental/tools-gps-tracks-angular/dist/benchmark-override.mjs new file mode 100644 index 000000000..bbaea5108 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/benchmark-override.mjs @@ -0,0 +1,2 @@ +var o=539363104;window.__resetBenchmarkSeed=()=>{o=539363104};Math.random=()=>{let e=o+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296};window.requestAnimationFrame=e=>window.setTimeout(()=>e(performance.now()),0);window.cancelAnimationFrame=e=>{window.clearTimeout(e)};try{Object.defineProperty(window,"devicePixelRatio",{get:()=>1,configurable:!0})}catch{}try{Object.defineProperty(navigator,"language",{get:()=>"en-US",configurable:!0}),Object.defineProperty(navigator,"languages",{get:()=>["en-US"],configurable:!0})}catch{}typeof CanvasRenderingContext2D<"u"&&(CanvasRenderingContext2D.prototype.measureText=function(e){let n=this.font||"10px sans-serif",i=n.match(/(\d+(?:\.\d+)?)px/),t=i?parseFloat(i[1]):10,r=/\bbold\b|\b[6-9]00\b/i.test(n),c=t*(r?.6:.55),a=String(e).length*c;return{width:a,actualBoundingBoxLeft:0,actualBoundingBoxRight:a,actualBoundingBoxAscent:t*.8,actualBoundingBoxDescent:t*.2,fontBoundingBoxAscent:t*.8,fontBoundingBoxDescent:t*.2,emHeightAscent:t*.8,emHeightDescent:t*.2,hangingBaseline:t*.8,alphabeticBaseline:0,ideographicBaseline:-t*.2}}); +//# sourceMappingURL=benchmark-override.mjs.map diff --git a/suites-experimental/tools-gps-tracks-angular/dist/benchmark-override.mjs.map b/suites-experimental/tools-gps-tracks-angular/dist/benchmark-override.mjs.map new file mode 100644 index 000000000..979aa8e1f --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/benchmark-override.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/benchmark-override.ts"], + "sourcesContent": ["// Copyright (c) 2026, Camillo Bruni.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n'use strict';\n\n// Deterministic PRNG (Mulberry32) for reproducible benchmark runs.\nlet seed = 0x20260720;\n(window as any).__resetBenchmarkSeed = (): void => {\n seed = 0x20260720;\n};\nMath.random = (): number => {\n let t = (seed += 0x6d2b79f5);\n t = Math.imul(t ^ (t >>> 15), t | 1);\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61);\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n};\n\nwindow.requestAnimationFrame = (callback: FrameRequestCallback): number => {\n return window.setTimeout(() => callback(performance.now()), 0);\n};\n\nwindow.cancelAnimationFrame = (id: number): void => {\n window.clearTimeout(id);\n};\n\n// Normalize devicePixelRatio to 1 so uPlot and canvas rendering execute\n// identical code paths (e.g. decimation thresholds and canvas dimensions) across browsers.\ntry {\n Object.defineProperty(window, 'devicePixelRatio', {\n get: () => 1,\n configurable: true,\n });\n} catch (_) {}\n\n// Normalize navigator.language to en-US so Intl.NumberFormat / locale formatters\n// produce identical strings across browsers and OS locales.\ntry {\n Object.defineProperty(navigator, 'language', {\n get: () => 'en-US',\n configurable: true,\n });\n Object.defineProperty(navigator, 'languages', {\n get: () => ['en-US'],\n configurable: true,\n });\n} catch (_) {}\n\n// Normalize CanvasRenderingContext2D.prototype.measureText so canvas layout calculations\n// (histogram padding, axis label bounding boxes, cursor pills) do not vary with OS/browser\n// system-ui font glyph metrics.\nif (typeof CanvasRenderingContext2D !== 'undefined') {\n CanvasRenderingContext2D.prototype.measureText = function (text: string): TextMetrics {\n const fontStr = this.font || '10px sans-serif';\n const sizeMatch = fontStr.match(/(\\d+(?:\\.\\d+)?)px/);\n const fontSize = sizeMatch ? parseFloat(sizeMatch[1]) : 10;\n const isBold = /\\bbold\\b|\\b[6-9]00\\b/i.test(fontStr);\n const charWidth = fontSize * (isBold ? 0.6 : 0.55);\n const width = String(text).length * charWidth;\n return {\n width,\n actualBoundingBoxLeft: 0,\n actualBoundingBoxRight: width,\n actualBoundingBoxAscent: fontSize * 0.8,\n actualBoundingBoxDescent: fontSize * 0.2,\n fontBoundingBoxAscent: fontSize * 0.8,\n fontBoundingBoxDescent: fontSize * 0.2,\n emHeightAscent: fontSize * 0.8,\n emHeightDescent: fontSize * 0.2,\n hangingBaseline: fontSize * 0.8,\n alphabeticBaseline: 0,\n ideographicBaseline: -fontSize * 0.2,\n } as TextMetrics;\n };\n}\n"], + "mappings": "AAOA,IAAIA,EAAO,UACV,OAAe,qBAAuB,IAAY,CACjDA,EAAO,SACT,EACA,KAAK,OAAS,IAAc,CAC1B,IAAIC,EAAKD,GAAQ,WACjB,OAAAC,EAAI,KAAK,KAAKA,EAAKA,IAAM,GAAKA,EAAI,CAAC,EACnCA,GAAKA,EAAI,KAAK,KAAKA,EAAKA,IAAM,EAAIA,EAAI,EAAE,IAC/BA,EAAKA,IAAM,MAAS,GAAK,UACpC,EAEA,OAAO,sBAAyBC,GACvB,OAAO,WAAW,IAAMA,EAAS,YAAY,IAAI,CAAC,EAAG,CAAC,EAG/D,OAAO,qBAAwBC,GAAqB,CAClD,OAAO,aAAaA,CAAE,CACxB,EAIA,GAAI,CACF,OAAO,eAAe,OAAQ,mBAAoB,CAChD,IAAK,IAAM,EACX,aAAc,EAChB,CAAC,CACH,MAAY,CAAC,CAIb,GAAI,CACF,OAAO,eAAe,UAAW,WAAY,CAC3C,IAAK,IAAM,QACX,aAAc,EAChB,CAAC,EACD,OAAO,eAAe,UAAW,YAAa,CAC5C,IAAK,IAAM,CAAC,OAAO,EACnB,aAAc,EAChB,CAAC,CACH,MAAY,CAAC,CAKT,OAAO,yBAA6B,MACtC,yBAAyB,UAAU,YAAc,SAAUC,EAA2B,CACpF,IAAMC,EAAU,KAAK,MAAQ,kBACvBC,EAAYD,EAAQ,MAAM,mBAAmB,EAC7CE,EAAWD,EAAY,WAAWA,EAAU,CAAC,CAAC,EAAI,GAClDE,EAAS,wBAAwB,KAAKH,CAAO,EAC7CI,EAAYF,GAAYC,EAAS,GAAM,KACvCE,EAAQ,OAAON,CAAI,EAAE,OAASK,EACpC,MAAO,CACL,MAAAC,EACA,sBAAuB,EACvB,uBAAwBA,EACxB,wBAAyBH,EAAW,GACpC,yBAA0BA,EAAW,GACrC,sBAAuBA,EAAW,GAClC,uBAAwBA,EAAW,GACnC,eAAgBA,EAAW,GAC3B,gBAAiBA,EAAW,GAC5B,gBAAiBA,EAAW,GAC5B,mBAAoB,EACpB,oBAAqB,CAACA,EAAW,EACnC,CACF", + "names": ["seed", "t", "callback", "id", "text", "fontStr", "sizeMatch", "fontSize", "isBold", "charWidth", "width"] +} diff --git a/suites-experimental/tools-gps-tracks-angular/dist/fit-file-parser.mjs b/suites-experimental/tools-gps-tracks-angular/dist/fit-file-parser.mjs new file mode 100644 index 000000000..9d5189e66 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/fit-file-parser.mjs @@ -0,0 +1,15 @@ +var ot=Object.create;var Ie=Object.defineProperty;var ut=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var ft=Object.getPrototypeOf,dt=Object.prototype.hasOwnProperty;var le=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var pt=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ct(e))!dt.call(i,s)&&s!==t&&Ie(i,s,{get:()=>e[s],enumerable:!(n=ut(e,s))||n.enumerable});return i};var gt=(i,e,t)=>(t=i!=null?ot(ft(i)):{},pt(e||!i||!i.__esModule?Ie(t,"default",{value:i,enumerable:!0}):t,i));var je=le(K=>{"use strict";K.byteLength=mt;K.toByteArray=wt;K.fromByteArray=xt;var z=[],B=[],ht=typeof Uint8Array<"u"?Uint8Array:Array,ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(M=0,Ue=ae.length;M0)throw new Error("Invalid string. Length must be a multiple of 4");var t=i.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function mt(i){var e=Ae(i),t=e[0],n=e[1];return(t+n)*3/4-n}function yt(i,e,t){return(e+t)*3/4-t}function wt(i){var e,t=Ae(i),n=t[0],s=t[1],_=new ht(yt(i,n,s)),l=0,r=s>0?n-4:n,o;for(o=0;o>16&255,_[l++]=e>>8&255,_[l++]=e&255;return s===2&&(e=B[i.charCodeAt(o)]<<2|B[i.charCodeAt(o+1)]>>4,_[l++]=e&255),s===1&&(e=B[i.charCodeAt(o)]<<10|B[i.charCodeAt(o+1)]<<4|B[i.charCodeAt(o+2)]>>2,_[l++]=e>>8&255,_[l++]=e&255),_}function bt(i){return z[i>>18&63]+z[i>>12&63]+z[i>>6&63]+z[i&63]}function kt(i,e,t){for(var n,s=[],_=e;_r?r:l+_));return n===1?(e=i[t-1],s.push(z[e>>2]+z[e<<4&63]+"==")):n===2&&(e=(i[t-2]<<8)+i[t-1],s.push(z[e>>10]+z[e>>4&63]+z[e<<2&63]+"=")),s.join("")}});var Te=le(re=>{re.read=function(i,e,t,n,s){var _,l,r=s*8-n-1,o=(1<>1,u=-7,c=t?s-1:0,g=t?-1:1,f=i[e+c];for(c+=g,_=f&(1<<-u)-1,f>>=-u,u+=r;u>0;_=_*256+i[e+c],c+=g,u-=8);for(l=_&(1<<-u)-1,_>>=-u,u+=n;u>0;l=l*256+i[e+c],c+=g,u-=8);if(_===0)_=1-d;else{if(_===o)return l?NaN:(f?-1:1)*(1/0);l=l+Math.pow(2,n),_=_-d}return(f?-1:1)*l*Math.pow(2,_-n)};re.write=function(i,e,t,n,s,_){var l,r,o,d=_*8-s-1,u=(1<>1,g=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:_-1,x=n?1:-1,h=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(r=isNaN(e)?1:0,l=u):(l=Math.floor(Math.log(e)/Math.LN2),e*(o=Math.pow(2,-l))<1&&(l--,o*=2),l+c>=1?e+=g/o:e+=g*Math.pow(2,1-c),e*o>=2&&(l++,o/=2),l+c>=u?(r=0,l=u):l+c>=1?(r=(e*o-1)*Math.pow(2,s),l=l+c):(r=e*Math.pow(2,c-1)*Math.pow(2,s),l=0));s>=8;i[t+f]=r&255,f+=x,r/=256,s-=8);for(l=l<0;i[t+f]=l&255,f+=x,l/=256,d-=8);i[t+f-x]|=h*128}});var Xe=le(V=>{"use strict";var oe=je(),P=Te(),Ce=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;V.Buffer=a;V.SlowBuffer=qt;V.INSPECT_MAX_BYTES=50;var Z=2147483647;V.kMaxLength=Z;a.TYPED_ARRAY_SUPPORT=vt();!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function vt(){try{let i=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(i,e),i.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function T(i){if(i>Z)throw new RangeError('The value "'+i+'" is invalid for option "size"');let e=new Uint8Array(i);return Object.setPrototypeOf(e,a.prototype),e}function a(i,e,t){if(typeof i=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return de(i)}return Le(i,e,t)}a.poolSize=8192;function Le(i,e,t){if(typeof i=="string")return Bt(i,e);if(ArrayBuffer.isView(i))return Et(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(q(i,ArrayBuffer)||i&&q(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(q(i,SharedArrayBuffer)||i&&q(i.buffer,SharedArrayBuffer)))return ce(i,e,t);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=i.valueOf&&i.valueOf();if(n!=null&&n!==i)return a.from(n,e,t);let s=zt(i);if(s)return s;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return a.from(i[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}a.from=function(i,e,t){return Le(i,e,t)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function Me(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function Ft(i,e,t){return Me(i),i<=0?T(i):e!==void 0?typeof t=="string"?T(i).fill(e,t):T(i).fill(e):T(i)}a.alloc=function(i,e,t){return Ft(i,e,t)};function de(i){return Me(i),T(i<0?0:pe(i)|0)}a.allocUnsafe=function(i){return de(i)};a.allocUnsafeSlow=function(i){return de(i)};function Bt(i,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Ne(i,e)|0,n=T(t),s=n.write(i,e);return s!==t&&(n=n.slice(0,s)),n}function ue(i){let e=i.length<0?0:pe(i.length)|0,t=T(e);for(let n=0;n=Z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Z.toString(16)+" bytes");return i|0}function qt(i){return+i!=i&&(i=0),a.alloc(+i)}a.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==a.prototype};a.compare=function(e,t){if(q(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,s=t.length;for(let _=0,l=Math.min(n,s);_s.length?(a.isBuffer(l)||(l=a.from(l)),l.copy(s,_)):Uint8Array.prototype.set.call(s,l,_);else if(a.isBuffer(l))l.copy(s,_);else throw new TypeError('"list" argument must be an Array of Buffers');_+=l.length}return s};function Ne(i,e){if(a.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||q(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);let t=i.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let s=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return fe(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Je(i).length;default:if(s)return n?-1:fe(i).length;e=(""+e).toLowerCase(),s=!0}}a.byteLength=Ne;function It(i,e,t){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(i||(i="utf8");;)switch(i){case"hex":return Mt(this,e,t);case"utf8":case"utf-8":return $e(this,e,t);case"ascii":return Dt(this,e,t);case"latin1":case"binary":return Lt(this,e,t);case"base64":return Rt(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function N(i,e,t){let n=i[e];i[e]=i[t],i[t]=n}a.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Ce&&(a.prototype[Ce]=a.prototype.inspect);a.prototype.compare=function(e,t,n,s,_){if(q(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),s===void 0&&(s=0),_===void 0&&(_=this.length),t<0||n>e.length||s<0||_>this.length)throw new RangeError("out of range index");if(s>=_&&t>=n)return 0;if(s>=_)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,s>>>=0,_>>>=0,this===e)return 0;let l=_-s,r=n-t,o=Math.min(l,r),d=this.slice(s,_),u=e.slice(t,n);for(let c=0;c2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,he(t)&&(t=s?0:i.length-1),t<0&&(t=i.length+t),t>=i.length){if(s)return-1;t=i.length-1}else if(t<0)if(s)t=0;else return-1;if(typeof e=="string"&&(e=a.from(e,n)),a.isBuffer(e))return e.length===0?-1:Re(i,e,t,n,s);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?s?Uint8Array.prototype.indexOf.call(i,e,t):Uint8Array.prototype.lastIndexOf.call(i,e,t):Re(i,[e],t,n,s);throw new TypeError("val must be string, number or Buffer")}function Re(i,e,t,n,s){let _=1,l=i.length,r=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(i.length<2||e.length<2)return-1;_=2,l/=2,r/=2,t/=2}function o(u,c){return _===1?u[c]:u.readUInt16BE(c*_)}let d;if(s){let u=-1;for(d=t;dl&&(t=l-r),d=t;d>=0;d--){let u=!0;for(let c=0;cs&&(n=s)):n=s;let _=e.length;n>_/2&&(n=_/2);let l;for(l=0;l>>0,isFinite(n)?(n=n>>>0,s===void 0&&(s="utf8")):(s=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let _=this.length-t;if((n===void 0||n>_)&&(n=_),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");let l=!1;for(;;)switch(s){case"hex":return Ut(this,e,t,n);case"utf8":case"utf-8":return At(this,e,t,n);case"ascii":case"latin1":case"binary":return jt(this,e,t,n);case"base64":return Tt(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ct(this,e,t,n);default:if(l)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),l=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Rt(i,e,t){return e===0&&t===i.length?oe.fromByteArray(i):oe.fromByteArray(i.slice(e,t))}function $e(i,e,t){t=Math.min(i.length,t);let n=[],s=e;for(;s239?4:_>223?3:_>191?2:1;if(s+r<=t){let o,d,u,c;switch(r){case 1:_<128&&(l=_);break;case 2:o=i[s+1],(o&192)===128&&(c=(_&31)<<6|o&63,c>127&&(l=c));break;case 3:o=i[s+1],d=i[s+2],(o&192)===128&&(d&192)===128&&(c=(_&15)<<12|(o&63)<<6|d&63,c>2047&&(c<55296||c>57343)&&(l=c));break;case 4:o=i[s+1],d=i[s+2],u=i[s+3],(o&192)===128&&(d&192)===128&&(u&192)===128&&(c=(_&15)<<18|(o&63)<<12|(d&63)<<6|u&63,c>65535&&c<1114112&&(l=c))}}l===null?(l=65533,r=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|l&1023),n.push(l),s+=r}return St(n)}var Se=4096;function St(i){let e=i.length;if(e<=Se)return String.fromCharCode.apply(String,i);let t="",n=0;for(;nn)&&(t=n);let s="";for(let _=e;_n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||b(e,t,this.length);let s=this[e],_=1,l=0;for(;++l>>0,t=t>>>0,n||b(e,t,this.length);let s=this[e+--t],_=1;for(;t>0&&(_*=256);)s+=this[e+--t]*_;return s};a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e=e>>>0,t||b(e,1,this.length),this[e]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||b(e,2,this.length),this[e]|this[e+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||b(e,2,this.length),this[e]<<8|this[e+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||b(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};a.prototype.readBigUInt64LE=C(function(e){e=e>>>0,H(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Y(e,this.length-8);let s=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,_=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(s)+(BigInt(_)<>>0,H(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Y(e,this.length-8);let s=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],_=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(s)<>>0,t=t>>>0,n||b(e,t,this.length);let s=this[e],_=1,l=0;for(;++l=_&&(s-=Math.pow(2,8*t)),s};a.prototype.readIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||b(e,t,this.length);let s=t,_=1,l=this[e+--s];for(;s>0&&(_*=256);)l+=this[e+--s]*_;return _*=128,l>=_&&(l-=Math.pow(2,8*t)),l};a.prototype.readInt8=function(e,t){return e=e>>>0,t||b(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};a.prototype.readInt16LE=function(e,t){e=e>>>0,t||b(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(e,t){e=e>>>0,t||b(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(e,t){return e=e>>>0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};a.prototype.readInt32BE=function(e,t){return e=e>>>0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};a.prototype.readBigInt64LE=C(function(e){e=e>>>0,H(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Y(e,this.length-8);let s=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(s)<>>0,H(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Y(e,this.length-8);let s=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(s)<>>0,t||b(e,4,this.length),P.read(this,e,!0,23,4)};a.prototype.readFloatBE=function(e,t){return e=e>>>0,t||b(e,4,this.length),P.read(this,e,!1,23,4)};a.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||b(e,8,this.length),P.read(this,e,!0,52,8)};a.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||b(e,8,this.length),P.read(this,e,!1,52,8)};function k(i,e,t,n,s,_){if(!a.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<_)throw new RangeError('"value" argument is out of bounds');if(t+n>i.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,n,s){if(e=+e,t=t>>>0,n=n>>>0,!s){let r=Math.pow(2,8*n)-1;k(this,e,t,n,r,0)}let _=1,l=0;for(this[t]=e&255;++l>>0,n=n>>>0,!s){let r=Math.pow(2,8*n)-1;k(this,e,t,n,r,0)}let _=n-1,l=1;for(this[t+_]=e&255;--_>=0&&(l*=256);)this[t+_]=e/l&255;return t+n};a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,n){return e=+e,t=t>>>0,n||k(this,e,t,1,255,0),this[t]=e&255,t+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||k(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||k(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||k(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function Pe(i,e,t,n,s){Ye(e,n,s,i,t,7);let _=Number(e&BigInt(4294967295));i[t++]=_,_=_>>8,i[t++]=_,_=_>>8,i[t++]=_,_=_>>8,i[t++]=_;let l=Number(e>>BigInt(32)&BigInt(4294967295));return i[t++]=l,l=l>>8,i[t++]=l,l=l>>8,i[t++]=l,l=l>>8,i[t++]=l,t}function He(i,e,t,n,s){Ye(e,n,s,i,t,7);let _=Number(e&BigInt(4294967295));i[t+7]=_,_=_>>8,i[t+6]=_,_=_>>8,i[t+5]=_,_=_>>8,i[t+4]=_;let l=Number(e>>BigInt(32)&BigInt(4294967295));return i[t+3]=l,l=l>>8,i[t+2]=l,l=l>>8,i[t+1]=l,l=l>>8,i[t]=l,t+8}a.prototype.writeBigUInt64LE=C(function(e,t=0){return Pe(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeBigUInt64BE=C(function(e,t=0){return He(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeIntLE=function(e,t,n,s){if(e=+e,t=t>>>0,!s){let o=Math.pow(2,8*n-1);k(this,e,t,n,o-1,-o)}let _=0,l=1,r=0;for(this[t]=e&255;++_>0)-r&255;return t+n};a.prototype.writeIntBE=function(e,t,n,s){if(e=+e,t=t>>>0,!s){let o=Math.pow(2,8*n-1);k(this,e,t,n,o-1,-o)}let _=n-1,l=1,r=0;for(this[t+_]=e&255;--_>=0&&(l*=256);)e<0&&r===0&&this[t+_+1]!==0&&(r=1),this[t+_]=(e/l>>0)-r&255;return t+n};a.prototype.writeInt8=function(e,t,n){return e=+e,t=t>>>0,n||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};a.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||k(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};a.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};a.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||k(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};a.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};a.prototype.writeBigInt64LE=C(function(e,t=0){return Pe(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});a.prototype.writeBigInt64BE=C(function(e,t=0){return He(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ve(i,e,t,n,s,_){if(t+n>i.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ge(i,e,t,n,s){return e=+e,t=t>>>0,s||Ve(i,e,t,4,34028234663852886e22,-34028234663852886e22),P.write(i,e,t,n,23,4),t+4}a.prototype.writeFloatLE=function(e,t,n){return Ge(this,e,t,!0,n)};a.prototype.writeFloatBE=function(e,t,n){return Ge(this,e,t,!1,n)};function We(i,e,t,n,s){return e=+e,t=t>>>0,s||Ve(i,e,t,8,17976931348623157e292,-17976931348623157e292),P.write(i,e,t,n,52,8),t+8}a.prototype.writeDoubleLE=function(e,t,n){return We(this,e,t,!0,n)};a.prototype.writeDoubleBE=function(e,t,n){return We(this,e,t,!1,n)};a.prototype.copy=function(e,t,n,s){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!s&&s!==0&&(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let _;if(typeof e=="number")for(_=t;_2**32?s=De(String(t)):typeof t=="bigint"&&(s=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(s=De(s)),s+="n"),n+=` It must be ${e}. Received ${s}`,n},RangeError);function De(i){let e="",t=i.length,n=i[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${i.slice(t-3,t)}${e}`;return`${i.slice(0,t)}${e}`}function Ot(i,e,t){H(e,"offset"),(i[e]===void 0||i[e+t]===void 0)&&Y(e,i.length-(t+1))}function Ye(i,e,t,n,s,_){if(i>t||i3?e===0||e===BigInt(0)?r=`>= 0${l} and < 2${l} ** ${(_+1)*8}${l}`:r=`>= -(2${l} ** ${(_+1)*8-1}${l}) and < 2 ** ${(_+1)*8-1}${l}`:r=`>= ${e}${l} and <= ${t}${l}`,new $.ERR_OUT_OF_RANGE("value",r,i)}Ot(n,s,_)}function H(i,e){if(typeof i!="number")throw new $.ERR_INVALID_ARG_TYPE(e,"number",i)}function Y(i,e,t){throw Math.floor(i)!==i?(H(i,t),new $.ERR_OUT_OF_RANGE(t||"offset","an integer",i)):e<0?new $.ERR_BUFFER_OUT_OF_BOUNDS:new $.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,i)}var $t=/[^+/0-9A-Za-z-_]/g;function Pt(i){if(i=i.split("=")[0],i=i.trim().replace($t,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function fe(i,e){e=e||1/0;let t,n=i.length,s=null,_=[];for(let l=0;l55295&&t<57344){if(!s){if(t>56319){(e-=3)>-1&&_.push(239,191,189);continue}else if(l+1===n){(e-=3)>-1&&_.push(239,191,189);continue}s=t;continue}if(t<56320){(e-=3)>-1&&_.push(239,191,189),s=t;continue}t=(s-55296<<10|t-56320)+65536}else s&&(e-=3)>-1&&_.push(239,191,189);if(s=null,t<128){if((e-=1)<0)break;_.push(t)}else if(t<2048){if((e-=2)<0)break;_.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;_.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;_.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return _}function Ht(i){let e=[];for(let t=0;t>8,s=t%256,_.push(s),_.push(n);return _}function Je(i){return oe.toByteArray(Pt(i))}function Q(i,e,t,n){let s;for(s=0;s=e.length||s>=i.length);++s)e[s+t]=i[s];return s}function q(i,e){return i instanceof e||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===e.name}function he(i){return i!==i}var Gt=function(){let i="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let s=0;s<16;++s)e[n+s]=i[t]+i[s]}return e}();function C(i){return typeof BigInt>"u"?Wt:i}function Wt(){throw new Error("BigInt not supported")}});var et=gt(Xe(),1);var Yt=14.5037738,w={scConst:180/Math.pow(2,31),options:{speedUnits:{"m/s":{multiplier:1,offset:0},mph:{multiplier:3600/1609.344,offset:0},"km/h":{multiplier:3600/1e3,offset:0}},lengthUnits:{m:{multiplier:1,offset:0},mi:{multiplier:1/1609.344,offset:0},km:{multiplier:1/1e3,offset:0}},temperatureUnits:{"\xB0C":{multiplier:1,offset:0},kelvin:{multiplier:1,offset:-273.15},fahrenheit:{multiplier:9/5,offset:32}},pressureUnits:{cbar:{multiplier:1,offset:0},bar:{multiplier:1/100,offset:0},psi:{multiplier:1/100*Yt,offset:0}}},messages:{0:{name:"file_id",0:{field:"type",type:"file",scale:null,offset:0,units:""},1:{field:"manufacturer",type:"manufacturer",scale:null,offset:0,units:""},2:{field:"product",type:"uint16",scale:null,offset:0,units:""},3:{field:"serial_number",type:"uint32z",scale:null,offset:0,units:""},4:{field:"time_created",type:"date_time",scale:null,offset:0,units:""},5:{field:"number",type:"uint16",scale:null,offset:0,units:""},8:{field:"product_name",type:"string",scale:null,offset:0,units:""}},1:{name:"capabilities",0:{field:"languages",type:"uint8z",scale:null,offset:0,units:""},1:{field:"sports",type:"sport_bits_0",scale:null,offset:0,units:""},21:{field:"workouts_supported",type:"workout_capabilities",scale:null,offset:0,units:""},23:{field:"connectivity_supported",type:"connectivity_capabilities",scale:null,offset:0,units:""}},2:{name:"device_settings",0:{field:"active_time_zone",type:"uint8",scale:null,offset:0,units:""},1:{field:"utc_offset",type:"uint32",scale:null,offset:0,units:""},2:{field:"time_offset",type:"uint32",scale:null,offset:0,units:"s"},5:{field:"time_zone_offset",type:"sint8",scale:4,offset:0,units:"hr"},55:{field:"display_orientation",type:"display_orientation",scale:null,offset:0,units:""},56:{field:"mounting_side",type:"side",scale:null,offset:0,units:""},94:{field:"number_of_screens",type:"uint8",scale:null,offset:0,units:""},95:{field:"smart_notification_display_orientation",type:"display_orientation",scale:null,offset:0,units:""}},3:{name:"user_profile",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"friendly_name",type:"string",scale:null,offset:0,units:""},1:{field:"gender",type:"gender",scale:null,offset:0,units:""},2:{field:"age",type:"uint8",scale:null,offset:0,units:"years"},3:{field:"height",type:"uint8",scale:100,offset:0,units:"m"},4:{field:"weight",type:"uint16",scale:10,offset:0,units:"kg"},5:{field:"language",type:"language",scale:null,offset:0,units:""},6:{field:"elev_setting",type:"display_measure",scale:null,offset:0,units:""},7:{field:"weight_setting",type:"display_measure",scale:null,offset:0,units:""},8:{field:"resting_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},9:{field:"default_max_running_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},10:{field:"default_max_biking_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},11:{field:"default_max_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},12:{field:"hr_setting",type:"display_heart",scale:null,offset:0,units:""},13:{field:"speed_setting",type:"display_measure",scale:null,offset:0,units:""},14:{field:"dist_setting",type:"display_measure",scale:null,offset:0,units:""},16:{field:"power_setting",type:"display_power",scale:null,offset:0,units:""},17:{field:"activity_class",type:"activity_class",scale:null,offset:0,units:""},18:{field:"position_setting",type:"display_position",scale:null,offset:0,units:""},21:{field:"temperature_setting",type:"display_measure",scale:null,offset:0,units:""},22:{field:"local_id",type:"user_local_id",scale:null,offset:0,units:""},23:{field:"global_id",type:"byte",scale:null,offset:0,units:""},28:{field:"wake_time",type:"localtime_into_day",scale:null,offset:0,units:""},29:{field:"sleep_time",type:"localtime_into_day",scale:null,offset:0,units:""},30:{field:"height_setting",type:"display_measure",scale:null,offset:0,units:""}},4:{name:"hrm_profile",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"enabled",type:"bool",scale:null,offset:0,units:""},1:{field:"hrm_ant_id",type:"uint16z",scale:null,offset:0,units:""},2:{field:"log_hrv",type:"bool",scale:null,offset:0,units:""},3:{field:"hrm_ant_id_trans_type",type:"uint8z",scale:null,offset:0,units:""}},5:{name:"sdm_profile",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"enabled",type:"bool",scale:null,offset:0,units:""},1:{field:"sdm_ant_id",type:"uint16z",scale:null,offset:0,units:""},2:{field:"sdm_cal_factor",type:"uint16",scale:10,offset:0,units:"%"},3:{field:"odometer",type:"uint32",scale:100,offset:0,units:"m"},4:{field:"speed_source",type:"bool",scale:null,offset:0,units:""},5:{field:"sdm_ant_id_trans_type",type:"uint8z",scale:null,offset:0,units:""},7:{field:"odometer_rollover",type:"uint8",scale:null,offset:0,units:""}},6:{name:"bike_profile",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"name",type:"string",scale:null,offset:0,units:""},1:{field:"sport",type:"sport",scale:null,offset:0,units:""},2:{field:"sub_sport",type:"sub_sport",scale:null,offset:0,units:""},3:{field:"odometer",type:"uint32",scale:100,offset:0,units:"m"},4:{field:"bike_spd_ant_id",type:"uint16z",scale:null,offset:0,units:""},5:{field:"bike_cad_ant_id",type:"uint16z",scale:null,offset:0,units:""},6:{field:"bike_spdcad_ant_id",type:"uint16z",scale:null,offset:0,units:""},7:{field:"bike_power_ant_id",type:"uint16z",scale:null,offset:0,units:""},8:{field:"custom_wheelsize",type:"uint16",scale:1e3,offset:0,units:"m"},9:{field:"auto_wheelsize",type:"uint16",scale:1e3,offset:0,units:"m"},10:{field:"bike_weight",type:"uint16",scale:10,offset:0,units:"kg"},11:{field:"power_cal_factor",type:"uint16",scale:10,offset:0,units:"%"},12:{field:"auto_wheel_cal",type:"bool",scale:null,offset:0,units:""},13:{field:"auto_power_zero",type:"bool",scale:null,offset:0,units:""},14:{field:"id",type:"uint8",scale:null,offset:0,units:""},15:{field:"spd_enabled",type:"bool",scale:null,offset:0,units:""},16:{field:"cad_enabled",type:"bool",scale:null,offset:0,units:""},17:{field:"spdcad_enabled",type:"bool",scale:null,offset:0,units:""},18:{field:"power_enabled",type:"bool",scale:null,offset:0,units:""},19:{field:"crank_length",type:"uint8",scale:2,offset:-110,units:"mm"},20:{field:"enabled",type:"bool",scale:null,offset:0,units:""},21:{field:"bike_spd_ant_id_trans_type",type:"uint8z",scale:null,offset:0,units:""},22:{field:"bike_cad_ant_id_trans_type",type:"uint8z",scale:null,offset:0,units:""},23:{field:"bike_spdcad_ant_id_trans_type",type:"uint8z",scale:null,offset:0,units:""},24:{field:"bike_power_ant_id_trans_type",type:"uint8z",scale:null,offset:0,units:""},37:{field:"odometer_rollover",type:"uint8",scale:null,offset:0,units:""},38:{field:"front_gear_num",type:"uint8z",scale:null,offset:0,units:""},39:{field:"front_gear",type:"uint8z",scale:null,offset:0,units:""},40:{field:"rear_gear_num",type:"uint8z",scale:null,offset:0,units:""},41:{field:"rear_gear",type:"uint8z",scale:null,offset:0,units:""},44:{field:"shimano_di2_enabled",type:"bool",scale:null,offset:0,units:""}},7:{name:"zones_target",1:{field:"max_heart_rate",type:"uint8",scale:null,offset:0,units:""},2:{field:"threshold_heart_rate",type:"uint8",scale:null,offset:0,units:""},3:{field:"functional_threshold_power",type:"uint16",scale:null,offset:0,units:""},5:{field:"hr_calc_type",type:"hr_zone_calc",scale:null,offset:0,units:""},7:{field:"pwr_calc_type",type:"pwr_zone_calc",scale:null,offset:0,units:""}},8:{name:"hr_zone",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},1:{field:"high_bpm",type:"uint8",scale:null,offset:0,units:"bpm"},2:{field:"name",type:"string",scale:null,offset:0,units:""}},9:{name:"power_zone",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},1:{field:"high_value",type:"uint16",scale:null,offset:0,units:"watts"},2:{field:"name",type:"string",scale:null,offset:0,units:""}},10:{name:"met_zone",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},1:{field:"high_bpm",type:"uint8",scale:null,offset:0,units:""},2:{field:"calories",type:"uint16",scale:10,offset:0,units:"kcal / min"},3:{field:"fat_calories",type:"uint8",scale:10,offset:0,units:"kcal / min"}},12:{name:"sport",0:{field:"sport",type:"sport",scale:null,offset:0,units:""},1:{field:"sub_sport",type:"sub_sport",scale:null,offset:0,units:""},3:{field:"name",type:"string",scale:null,offset:0,units:""}},15:{name:"goal",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"sport",type:"sport",scale:null,offset:0,units:""},1:{field:"sub_sport",type:"sub_sport",scale:null,offset:0,units:""},2:{field:"start_date",type:"date_time",scale:null,offset:0,units:""},3:{field:"end_date",type:"date_time",scale:null,offset:0,units:""},4:{field:"type",type:"goal",scale:null,offset:0,units:""},5:{field:"value",type:"uint32",scale:null,offset:0,units:""},6:{field:"repeat",type:"bool",scale:null,offset:0,units:""},7:{field:"target_value",type:"uint32",scale:null,offset:0,units:""},8:{field:"recurrence",type:"goal_recurrence",scale:null,offset:0,units:""},9:{field:"recurrence_value",type:"uint16",scale:null,offset:0,units:""},10:{field:"enabled",type:"bool",scale:null,offset:0,units:""}},18:{name:"session",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"event",type:"event",scale:null,offset:0,units:""},1:{field:"event_type",type:"event_type",scale:null,offset:0,units:""},2:{field:"start_time",type:"date_time",scale:null,offset:0,units:""},3:{field:"start_position_lat",type:"sint32",scale:null,offset:0,units:"semicircles"},4:{field:"start_position_long",type:"sint32",scale:null,offset:0,units:"semicircles"},5:{field:"sport",type:"sport",scale:null,offset:0,units:""},6:{field:"sub_sport",type:"sub_sport",scale:null,offset:0,units:""},7:{field:"total_elapsed_time",type:"uint32",scale:1e3,offset:0,units:"s"},8:{field:"total_timer_time",type:"uint32",scale:1e3,offset:0,units:"s"},9:{field:"total_distance",type:"uint32",scale:100,offset:0,units:"m"},10:{field:"total_cycles",type:"uint32",scale:null,offset:0,units:"cycles"},11:{field:"total_calories",type:"uint16",scale:null,offset:0,units:"kcal"},13:{field:"total_fat_calories",type:"uint16",scale:null,offset:0,units:"kcal"},14:{field:"avg_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},15:{field:"max_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},16:{field:"avg_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},17:{field:"max_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},18:{field:"avg_cadence",type:"uint8",scale:null,offset:0,units:"rpm"},19:{field:"max_cadence",type:"uint8",scale:null,offset:0,units:"rpm"},20:{field:"avg_power",type:"uint16",scale:null,offset:0,units:"watts"},21:{field:"max_power",type:"uint16",scale:null,offset:0,units:"watts"},22:{field:"total_ascent",type:"uint16",scale:null,offset:0,units:"m"},23:{field:"total_descent",type:"uint16",scale:null,offset:0,units:"m"},24:{field:"total_training_effect",type:"uint8",scale:10,offset:0,units:""},25:{field:"first_lap_index",type:"uint16",scale:null,offset:0,units:""},26:{field:"num_laps",type:"uint16",scale:null,offset:0,units:""},27:{field:"event_group",type:"uint8",scale:null,offset:0,units:""},28:{field:"trigger",type:"session_trigger",scale:null,offset:0,units:""},29:{field:"nec_lat",type:"sint32",scale:null,offset:0,units:"semicircles"},30:{field:"nec_long",type:"sint32",scale:null,offset:0,units:"semicircles"},31:{field:"swc_lat",type:"sint32",scale:null,offset:0,units:"semicircles"},32:{field:"swc_long",type:"sint32",scale:null,offset:0,units:"semicircles"},34:{field:"normalized_power",type:"uint16",scale:null,offset:0,units:"watts"},35:{field:"training_stress_score",type:"uint16",scale:10,offset:0,units:"tss"},36:{field:"intensity_factor",type:"uint16",scale:1e3,offset:0,units:"if"},37:{field:"left_right_balance",type:"left_right_balance_100",scale:100,offset:0,units:"%"},38:{field:"end_position_lat",type:"sint32",scale:null,offset:0,units:"semicircles"},39:{field:"end_position_long",type:"sint32",scale:null,offset:0,units:"semicircles"},41:{field:"avg_stroke_count",type:"uint32",scale:10,offset:0,units:"strokes/lap"},42:{field:"avg_stroke_distance",type:"uint16",scale:100,offset:0,units:"m"},43:{field:"swim_stroke",type:"swim_stroke",scale:null,offset:0,units:"swim_stroke"},44:{field:"pool_length",type:"uint16",scale:100,offset:0,units:"m"},45:{field:"threshold_power",type:"uint16",scale:null,offset:0,units:"watts"},46:{field:"pool_length_unit",type:"display_measure",scale:null,offset:0,units:""},47:{field:"num_active_lengths",type:"uint16",scale:null,offset:0,units:"lengths"},48:{field:"total_work",type:"uint32",scale:null,offset:0,units:"J"},49:{field:"avg_altitude",type:"uint16",scale:5,offset:-500,units:"m"},50:{field:"max_altitude",type:"uint16",scale:5,offset:-500,units:"m"},51:{field:"gps_accuracy",type:"uint8",scale:null,offset:0,units:"m"},52:{field:"avg_grade",type:"sint16",scale:100,offset:0,units:"%"},53:{field:"avg_pos_grade",type:"sint16",scale:100,offset:0,units:"%"},54:{field:"avg_neg_grade",type:"sint16",scale:100,offset:0,units:"%"},55:{field:"max_pos_grade",type:"sint16",scale:100,offset:0,units:"%"},56:{field:"max_neg_grade",type:"sint16",scale:100,offset:0,units:"%"},57:{field:"avg_temperature",type:"sint8",scale:null,offset:0,units:"C"},58:{field:"max_temperature",type:"sint8",scale:null,offset:0,units:"C"},59:{field:"total_moving_time",type:"uint32",scale:1e3,offset:0,units:"s"},60:{field:"avg_pos_vertical_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},61:{field:"avg_neg_vertical_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},62:{field:"max_pos_vertical_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},63:{field:"max_neg_vertical_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},64:{field:"min_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},65:{field:"time_in_hr_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},66:{field:"time_in_speed_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},67:{field:"time_in_cadence_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},68:{field:"time_in_power_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},69:{field:"avg_lap_time",type:"uint32",scale:1e3,offset:0,units:"s"},70:{field:"best_lap_index",type:"uint16",scale:null,offset:0,units:""},71:{field:"min_altitude",type:"uint16",scale:5,offset:-500,units:"m"},82:{field:"player_score",type:"uint16",scale:null,offset:0,units:""},83:{field:"opponent_score",type:"uint16",scale:null,offset:0,units:""},84:{field:"opponent_name",type:"string",scale:null,offset:0,units:""},85:{field:"stroke_count",type:"uint16",scale:null,offset:0,units:"counts"},86:{field:"zone_count",type:"uint16",scale:null,offset:0,units:"counts"},87:{field:"max_ball_speed",type:"uint16",scale:100,offset:0,units:"m/s"},88:{field:"avg_ball_speed",type:"uint16",scale:100,offset:0,units:"m/s"},89:{field:"avg_vertical_oscillation",type:"uint16",scale:10,offset:0,units:"mm"},90:{field:"avg_stance_time_percent",type:"uint16",scale:100,offset:0,units:"percent"},91:{field:"avg_stance_time",type:"uint16",scale:10,offset:0,units:"ms"},92:{field:"avg_fractional_cadence",type:"uint8",scale:128,offset:0,units:"rpm"},93:{field:"max_fractional_cadence",type:"uint8",scale:128,offset:0,units:"rpm"},94:{field:"total_fractional_cycles",type:"uint8",scale:128,offset:0,units:"cycles"},95:{field:"avg_total_hemoglobin_conc",type:"uint16",scale:100,offset:0,units:"g/dL"},96:{field:"min_total_hemoglobin_conc",type:"uint16",scale:100,offset:0,units:"g/dL"},97:{field:"max_total_hemoglobin_conc",type:"uint16",scale:100,offset:0,units:"g/dL"},98:{field:"avg_saturated_hemoglobin_percent",type:"uint16",scale:10,offset:0,units:"%"},99:{field:"min_saturated_hemoglobin_percent",type:"uint16",scale:10,offset:0,units:"%"},100:{field:"max_saturated_hemoglobin_percent",type:"uint16",scale:10,offset:0,units:"%"},101:{field:"avg_left_torque_effectiveness",type:"uint8",scale:2,offset:0,units:"percent"},102:{field:"avg_right_torque_effectiveness",type:"uint8",scale:2,offset:0,units:"percent"},103:{field:"avg_left_pedal_smoothness",type:"uint8",scale:2,offset:0,units:"percent"},104:{field:"avg_right_pedal_smoothness",type:"uint8",scale:2,offset:0,units:"percent"},105:{field:"avg_combined_pedal_smoothness",type:"uint8",scale:2,offset:0,units:"percent"},111:{field:"sport_index",type:"uint8",scale:null,offset:0,units:""},112:{field:"time_standing",type:"uint32",scale:1e3,offset:0,units:"s"},113:{field:"stand_count",type:"uint16",scale:null,offset:0,units:""},114:{field:"avg_left_pco",type:"sint8",scale:null,offset:0,units:"mm"},115:{field:"avg_right_pco",type:"sint8",scale:null,offset:0,units:"mm"},116:{field:"avg_left_power_phase",type:"uint8",scale:.7111111,offset:0,units:"degrees"},117:{field:"avg_left_power_phase_peak",type:"uint8",scale:.7111111,offset:0,units:"degrees"},118:{field:"avg_right_power_phase",type:"uint8",scale:.7111111,offset:0,units:"degrees"},119:{field:"avg_right_power_phase_peak",type:"uint8",scale:.7111111,offset:0,units:"degrees"},120:{field:"avg_power_position",type:"uint16",scale:null,offset:0,units:"watts"},121:{field:"max_power_position",type:"uint16",scale:null,offset:0,units:"watts"},122:{field:"avg_cadence_position",type:"uint8",scale:null,offset:0,units:"rpm"},123:{field:"max_cadence_position",type:"uint8",scale:null,offset:0,units:"rpm"},124:{field:"enhanced_avg_speed",type:"uint32",scale:1e3,offset:0,units:"m/s"},125:{field:"enhanced_max_speed",type:"uint32",scale:1e3,offset:0,units:"m/s"},126:{field:"enhanced_avg_altitude",type:"uint32",scale:5,offset:-500,units:"m"},127:{field:"enhanced_min_altitude",type:"uint32",scale:5,offset:-500,units:"m"},128:{field:"enhanced_max_altitude",type:"uint32",scale:5,offset:-500,units:"m"},129:{field:"avg_lev_motor_power",type:"uint16",scale:null,offset:0,units:"watts"},130:{field:"max_lev_motor_power",type:"uint16",scale:null,offset:0,units:"watts"},131:{field:"lev_battery_consumption",type:"uint8",scale:2,offset:0,units:"percent"},132:{field:"avg_vertical_ratio",type:"uint16",scale:100,offset:0,units:"percent"},133:{field:"avg_stance_time_balance",type:"uint16",scale:100,offset:0,units:"percent"},134:{field:"avg_step_length",type:"uint16",scale:10,offset:0,units:"mm"},137:{field:"total_anaerobic_training_effect",type:"uint8",scale:10,offset:0,units:""},139:{field:"avg_vam",type:"uint16",scale:1,offset:0,units:"m/h"},192:{field:"workout_feel",type:"uint8",scale:null,offset:0,units:""},193:{field:"workout_rpe",type:"uint8",scale:10,offset:0,units:""},110:{field:"sport_profile_name",type:"string",scale:null,offset:0,units:""},168:{field:"training_load_peak",type:"uint32",scale:1,offset:0,units:""},169:{field:"enhanced_avg_respiration_rate",type:"uint16",scale:100,offset:0,units:"breaths/min"},150:{field:"min_temperature",type:"sint8",scale:null,offset:0,units:"C"},170:{field:"enhanced_max_respiration_rate",type:"uint16",scale:100,offset:0,units:"breaths/min"},178:{field:"est_sweat_loss",type:"uint16",scale:1,offset:0,units:"ml"},180:{field:"enhanced_min_respiration_rate",type:"uint16",scale:100,offset:0,units:"breaths/min"},181:{field:"total_grit",type:"float32",scale:1,offset:0,units:"kGrit"},182:{field:"total_flow",type:"float32",scale:1,offset:0,units:"Flow"},183:{field:"jump_count",type:"uint16",scale:1,offset:0,units:""},186:{field:"avg_grit",type:"float32",scale:1,offset:0,units:"kGrit"},187:{field:"avg_flow",type:"float32",scale:1,offset:0,units:"Flow"},188:{field:"primary_benefit",type:"uint8",scale:1,offset:0,units:""},196:{field:"resting_calories",type:"uint16",scale:1,offset:0,units:"kcal"},214:{field:"avg_grit",type:"float32",scale:null,offset:0,units:""},215:{field:"avg_flow",type:"float32",scale:null,offset:0,units:""},140:{field:"recovery_advisor",type:"uint16",scale:1,offset:0,units:"min"}},19:{name:"lap",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"event",type:"event",scale:null,offset:0,units:""},1:{field:"event_type",type:"event_type",scale:null,offset:0,units:""},2:{field:"start_time",type:"date_time",scale:null,offset:0,units:""},3:{field:"start_position_lat",type:"sint32",scale:null,offset:0,units:"semicircles"},4:{field:"start_position_long",type:"sint32",scale:null,offset:0,units:"semicircles"},5:{field:"end_position_lat",type:"sint32",scale:null,offset:0,units:"semicircles"},6:{field:"end_position_long",type:"sint32",scale:null,offset:0,units:"semicircles"},7:{field:"total_elapsed_time",type:"uint32",scale:1e3,offset:0,units:"s"},8:{field:"total_timer_time",type:"uint32",scale:1e3,offset:0,units:"s"},9:{field:"total_distance",type:"uint32",scale:100,offset:0,units:"m"},10:{field:"total_cycles",type:"uint32",scale:null,offset:0,units:"cycles"},11:{field:"total_calories",type:"uint16",scale:null,offset:0,units:"kcal"},12:{field:"total_fat_calories",type:"uint16",scale:null,offset:0,units:"kcal"},13:{field:"avg_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},14:{field:"max_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},15:{field:"avg_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},16:{field:"max_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},17:{field:"avg_cadence",type:"uint8",scale:null,offset:0,units:"rpm"},18:{field:"max_cadence",type:"uint8",scale:null,offset:0,units:"rpm"},19:{field:"avg_power",type:"uint16",scale:null,offset:0,units:"watts"},20:{field:"max_power",type:"uint16",scale:null,offset:0,units:"watts"},21:{field:"total_ascent",type:"uint16",scale:null,offset:0,units:"m"},22:{field:"total_descent",type:"uint16",scale:null,offset:0,units:"m"},23:{field:"intensity",type:"intensity",scale:null,offset:0,units:""},24:{field:"lap_trigger",type:"lap_trigger",scale:null,offset:0,units:""},25:{field:"sport",type:"sport",scale:null,offset:0,units:""},26:{field:"event_group",type:"uint8",scale:null,offset:0,units:""},32:{field:"num_lengths",type:"uint16",scale:null,offset:0,units:"lengths"},33:{field:"normalized_power",type:"uint16",scale:null,offset:0,units:"watts"},34:{field:"left_right_balance",type:"left_right_balance_100",scale:100,offset:0,units:"%"},35:{field:"first_length_index",type:"uint16",scale:null,offset:0,units:""},37:{field:"avg_stroke_distance",type:"uint16",scale:100,offset:0,units:"m"},38:{field:"swim_stroke",type:"swim_stroke",scale:null,offset:0,units:""},39:{field:"sub_sport",type:"sub_sport",scale:null,offset:0,units:""},40:{field:"num_active_lengths",type:"uint16",scale:null,offset:0,units:"lengths"},41:{field:"total_work",type:"uint32",scale:null,offset:0,units:"J"},42:{field:"avg_altitude",type:"uint16",scale:5,offset:-500,units:"m"},43:{field:"max_altitude",type:"uint16",scale:5,offset:-500,units:"m"},44:{field:"gps_accuracy",type:"uint8",scale:null,offset:0,units:"m"},45:{field:"avg_grade",type:"sint16",scale:100,offset:0,units:"%"},46:{field:"avg_pos_grade",type:"sint16",scale:100,offset:0,units:"%"},47:{field:"avg_neg_grade",type:"sint16",scale:100,offset:0,units:"%"},48:{field:"max_pos_grade",type:"sint16",scale:100,offset:0,units:"%"},49:{field:"max_neg_grade",type:"sint16",scale:100,offset:0,units:"%"},50:{field:"avg_temperature",type:"sint8",scale:null,offset:0,units:"C"},51:{field:"max_temperature",type:"sint8",scale:null,offset:0,units:"C"},52:{field:"total_moving_time",type:"uint32",scale:1e3,offset:0,units:"s"},53:{field:"avg_pos_vertical_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},54:{field:"avg_neg_vertical_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},55:{field:"max_pos_vertical_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},56:{field:"max_neg_vertical_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},57:{field:"time_in_hr_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},58:{field:"time_in_speed_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},59:{field:"time_in_cadence_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},60:{field:"time_in_power_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},61:{field:"repetition_num",type:"uint16",scale:null,offset:0,units:""},62:{field:"min_altitude",type:"uint16",scale:5,offset:-500,units:"m"},63:{field:"min_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},71:{field:"wkt_step_index",type:"message_index",scale:null,offset:0,units:""},74:{field:"opponent_score",type:"uint16",scale:null,offset:0,units:""},75:{field:"stroke_count",type:"uint16",scale:null,offset:0,units:"counts"},76:{field:"zone_count",type:"uint16",scale:null,offset:0,units:"counts"},77:{field:"avg_vertical_oscillation",type:"uint16",scale:10,offset:0,units:"mm"},78:{field:"avg_stance_time_percent",type:"uint16",scale:100,offset:0,units:"percent"},79:{field:"avg_stance_time",type:"uint16",scale:10,offset:0,units:"ms"},80:{field:"avg_fractional_cadence",type:"uint8",scale:128,offset:0,units:"rpm"},81:{field:"max_fractional_cadence",type:"uint8",scale:128,offset:0,units:"rpm"},82:{field:"total_fractional_cycles",type:"uint8",scale:128,offset:0,units:"cycles"},83:{field:"player_score",type:"uint16",scale:null,offset:0,units:""},84:{field:"avg_total_hemoglobin_conc",type:"uint16",scale:100,offset:0,units:"g/dL"},85:{field:"min_total_hemoglobin_conc",type:"uint16",scale:100,offset:0,units:"g/dL"},86:{field:"max_total_hemoglobin_conc",type:"uint16",scale:100,offset:0,units:"g/dL"},87:{field:"avg_saturated_hemoglobin_percent",type:"uint16",scale:10,offset:0,units:"%"},88:{field:"min_saturated_hemoglobin_percent",type:"uint16",scale:10,offset:0,units:"%"},89:{field:"max_saturated_hemoglobin_percent",type:"uint16",scale:10,offset:0,units:"%"},91:{field:"avg_left_torque_effectiveness",type:"uint8",scale:2,offset:0,units:"percent"},92:{field:"avg_right_torque_effectiveness",type:"uint8",scale:2,offset:0,units:"percent"},93:{field:"avg_left_pedal_smoothness",type:"uint8",scale:2,offset:0,units:"percent"},94:{field:"avg_right_pedal_smoothness",type:"uint8",scale:2,offset:0,units:"percent"},95:{field:"avg_combined_pedal_smoothness",type:"uint8",scale:2,offset:0,units:"percent"},98:{field:"time_standing",type:"uint32",scale:1e3,offset:0,units:"s"},99:{field:"stand_count",type:"uint16",scale:null,offset:0,units:""},100:{field:"avg_left_pco",type:"sint8",scale:null,offset:0,units:"mm"},101:{field:"avg_right_pco",type:"sint8",scale:null,offset:0,units:"mm"},102:{field:"avg_left_power_phase",type:"uint8",scale:.7111111,offset:0,units:"degrees"},103:{field:"avg_left_power_phase_peak",type:"uint8",scale:.7111111,offset:0,units:"degrees"},104:{field:"avg_right_power_phase",type:"uint8",scale:.7111111,offset:0,units:"degrees"},105:{field:"avg_right_power_phase_peak",type:"uint8",scale:.7111111,offset:0,units:"degrees"},106:{field:"avg_power_position",type:"uint16",scale:null,offset:0,units:"watts"},107:{field:"max_power_position",type:"uint16",scale:null,offset:0,units:"watts"},108:{field:"avg_cadence_position",type:"uint8",scale:null,offset:0,units:"rpm"},109:{field:"max_cadence_position",type:"uint8",scale:null,offset:0,units:"rpm"},110:{field:"enhanced_avg_speed",type:"uint32",scale:1e3,offset:0,units:"m/s"},111:{field:"enhanced_max_speed",type:"uint32",scale:1e3,offset:0,units:"m/s"},112:{field:"enhanced_avg_altitude",type:"uint32",scale:5,offset:-500,units:"m"},113:{field:"enhanced_min_altitude",type:"uint32",scale:5,offset:-500,units:"m"},114:{field:"enhanced_max_altitude",type:"uint32",scale:5,offset:-500,units:"m"},115:{field:"avg_lev_motor_power",type:"uint16",scale:null,offset:0,units:"watts"},116:{field:"max_lev_motor_power",type:"uint16",scale:null,offset:0,units:"watts"},117:{field:"lev_battery_consumption",type:"uint8",scale:2,offset:0,units:"percent"},118:{field:"avg_vertical_ratio",type:"uint16",scale:100,offset:0,units:"percent"},119:{field:"avg_stance_time_balance",type:"uint16",scale:100,offset:0,units:"percent"},120:{field:"avg_step_length",type:"uint16",scale:10,offset:0,units:"mm"},121:{field:"avg_vam",type:"uint16",scale:1e3,offset:0,units:"m/s"}},20:{name:"record",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},114:{field:"grit",type:"float32",scale:null,offset:0,units:""},115:{field:"flow",type:"float32",scale:null,offset:0,units:""},0:{field:"position_lat",type:"sint32",scale:null,offset:0,units:"semicircles"},1:{field:"position_long",type:"sint32",scale:null,offset:0,units:"semicircles"},2:{field:"altitude",type:"uint16",scale:5,offset:-500,units:"m"},3:{field:"heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},4:{field:"cadence",type:"uint8",scale:null,offset:0,units:"rpm"},5:{field:"distance",type:"uint32",scale:100,offset:0,units:"m"},6:{field:"speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},7:{field:"power",type:"uint16",scale:null,offset:0,units:"watts"},8:{field:"compressed_speed_distance",type:"byte",scale:100.16,offset:0,units:"m/s,m"},9:{field:"grade",type:"sint16",scale:100,offset:0,units:"%"},10:{field:"resistance",type:"uint8",scale:null,offset:0,units:""},11:{field:"time_from_course",type:"sint32",scale:1e3,offset:0,units:"s"},12:{field:"cycle_length",type:"uint8",scale:100,offset:0,units:"m"},13:{field:"temperature",type:"sint8",scale:null,offset:0,units:"C"},17:{field:"speed_1s",type:"uint8",scale:16,offset:0,units:"m/s"},18:{field:"cycles",type:"uint8",scale:null,offset:0,units:"cycles"},19:{field:"total_cycles",type:"uint32",scale:null,offset:0,units:"cycles"},28:{field:"compressed_accumulated_power",type:"uint16",scale:null,offset:0,units:"watts"},29:{field:"accumulated_power",type:"uint32",scale:null,offset:0,units:"watts"},30:{field:"left_right_balance",type:"left_right_balance",scale:null,offset:0,units:""},31:{field:"gps_accuracy",type:"uint8",scale:null,offset:0,units:"m"},32:{field:"vertical_speed",type:"sint16",scale:1e3,offset:0,units:"m/s"},33:{field:"calories",type:"uint16",scale:null,offset:0,units:"kcal"},39:{field:"vertical_oscillation",type:"uint16",scale:10,offset:0,units:"mm"},40:{field:"stance_time_percent",type:"uint16",scale:100,offset:0,units:"percent"},41:{field:"stance_time",type:"uint16",scale:10,offset:0,units:"ms"},42:{field:"activity_type",type:"activity_type",scale:null,offset:0,units:""},43:{field:"left_torque_effectiveness",type:"uint8",scale:2,offset:0,units:"percent"},44:{field:"right_torque_effectiveness",type:"uint8",scale:2,offset:0,units:"percent"},45:{field:"left_pedal_smoothness",type:"uint8",scale:2,offset:0,units:"percent"},46:{field:"right_pedal_smoothness",type:"uint8",scale:2,offset:0,units:"percent"},47:{field:"combined_pedal_smoothness",type:"uint8",scale:2,offset:0,units:"percent"},48:{field:"time128",type:"uint8",scale:128,offset:0,units:"s"},49:{field:"stroke_type",type:"stroke_type",scale:null,offset:0,units:""},50:{field:"zone",type:"uint8",scale:null,offset:0,units:""},51:{field:"ball_speed",type:"uint16",scale:100,offset:0,units:"m/s"},52:{field:"cadence256",type:"uint16",scale:256,offset:0,units:"rpm"},53:{field:"fractional_cadence",type:"uint8",scale:128,offset:0,units:"rpm"},54:{field:"total_hemoglobin_conc",type:"uint16",scale:100,offset:0,units:"g/dL"},55:{field:"total_hemoglobin_conc_min",type:"uint16",scale:100,offset:0,units:"g/dL"},56:{field:"total_hemoglobin_conc_max",type:"uint16",scale:100,offset:0,units:"g/dL"},57:{field:"saturated_hemoglobin_percent",type:"uint16",scale:10,offset:0,units:"%"},58:{field:"saturated_hemoglobin_percent_min",type:"uint16",scale:10,offset:0,units:"%"},59:{field:"saturated_hemoglobin_percent_max",type:"uint16",scale:10,offset:0,units:"%"},62:{field:"device_index",type:"device_index",scale:null,offset:0,units:""},67:{field:"left_pco",type:"sint8",scale:null,offset:0,units:"mm"},68:{field:"right_pco",type:"sint8",scale:null,offset:0,units:"mm"},69:{field:"left_power_phase",type:"uint8",scale:.7111111,offset:0,units:"degrees"},70:{field:"left_power_phase_peak",type:"uint8",scale:.7111111,offset:0,units:"degrees"},71:{field:"right_power_phase",type:"uint8",scale:.7111111,offset:0,units:"degrees"},72:{field:"right_power_phase_peak",type:"uint8",scale:.7111111,offset:0,units:"degrees"},73:{field:"enhanced_speed",type:"uint32",scale:1e3,offset:0,units:"m/s"},78:{field:"enhanced_altitude",type:"uint32",scale:5,offset:-500,units:"m"},81:{field:"battery_soc",type:"uint8",scale:2,offset:0,units:"percent"},82:{field:"motor_power",type:"uint16",scale:null,offset:0,units:"watts"},83:{field:"vertical_ratio",type:"uint16",scale:100,offset:0,units:"percent"},84:{field:"stance_time_balance",type:"uint16",scale:100,offset:0,units:"percent"},85:{field:"step_length",type:"uint16",scale:10,offset:0,units:"mm"},91:{field:"absolute_pressure",type:"uint32",scale:null,offset:0,units:"Pa"},92:{field:"depth",type:"uint32",scale:null,offset:0,units:"m"},93:{field:"next_stop_depth",type:"uint32",scale:null,offset:0,units:"m"},94:{field:"next_stop_time",type:"uint32",scale:null,offset:0,units:"s"},95:{field:"time_to_surface",type:"uint32",scale:null,offset:0,units:"s"},96:{field:"ndl_time",type:"uint32",scale:null,offset:0,units:"s"},97:{field:"cns_load",type:"uint8",scale:null,offset:0,units:"percent"},98:{field:"n2_load",type:"uint16",scale:null,offset:0,units:"percent"}},285:{name:"jump",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"distance",type:"float32",scale:null,offset:0,units:"m"},1:{field:"height",type:"float32",scale:null,offset:0,units:"m"},2:{field:"rotations",type:"uint8",scale:null,offset:0,units:""},3:{field:"hang_time",type:"float32",scale:null,offset:0,units:"s"},4:{field:"score",type:"float32",scale:null,offset:0,units:""},5:{field:"position_lat",type:"sint32",scale:null,offset:0,units:"semicircles"},6:{field:"position_long",type:"sint32",scale:null,offset:0,units:"semicircles"},7:{field:"speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},8:{field:"enhanced_speed",type:"uint32",scale:1e3,offset:0,units:"m/s"}},21:{name:"event",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"event",type:"event",scale:null,offset:0,units:""},1:{field:"event_type",type:"event_type",scale:null,offset:0,units:""},2:{field:"data16",type:"uint16",scale:null,offset:0,units:""},3:{field:"data",type:"uint32",scale:null,offset:0,units:""},4:{field:"event_group",type:"uint8",scale:null,offset:0,units:""},7:{field:"score",type:"uint16",scale:null,offset:0,units:""},8:{field:"opponent_score",type:"uint16",scale:null,offset:0,units:""},9:{field:"front_gear_num",type:"uint8z",scale:null,offset:0,units:""},10:{field:"front_gear",type:"uint8z",scale:null,offset:0,units:""},11:{field:"rear_gear_num",type:"uint8z",scale:null,offset:0,units:""},12:{field:"rear_gear",type:"uint8z",scale:null,offset:0,units:""},13:{field:"device_index",type:"device_index",scale:null,offset:0,units:""}},23:{name:"device_info",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"device_index",type:"uint8",scale:null,offset:0,units:""},1:{field:"device_type",type:"uint8",scale:null,offset:0,units:""},2:{field:"manufacturer",type:"manufacturer",scale:null,offset:0,units:""},3:{field:"serial_number",type:"uint32z",scale:null,offset:0,units:""},4:{field:"product",type:"uint16",scale:null,offset:0,units:""},5:{field:"software_version",type:"uint16",scale:100,offset:0,units:""},6:{field:"hardware_version",type:"uint8",scale:null,offset:0,units:""},7:{field:"cum_operating_time",type:"uint32",scale:null,offset:0,units:"s"},10:{field:"battery_voltage",type:"uint16",scale:256,offset:0,units:"V"},32:{field:"battery_level",type:"uint8",scale:null,offset:0,units:"percent"},11:{field:"battery_status",type:"battery_status",scale:null,offset:0,units:""},18:{field:"sensor_position",type:"body_location",scale:null,offset:0,units:""},19:{field:"descriptor",type:"string",scale:null,offset:0,units:""},20:{field:"ant_transmission_type",type:"uint8z",scale:null,offset:0,units:""},21:{field:"ant_device_number",type:"uint16z",scale:null,offset:0,units:""},22:{field:"ant_network",type:"ant_network",scale:null,offset:0,units:""},24:{field:"ant_id",type:"uint32z",scale:null,offset:0,units:""},25:{field:"source_type",type:"source_type",scale:null,offset:0,units:""},27:{field:"product_name",type:"string",scale:null,offset:0,units:""}},26:{name:"workout",4:{field:"sport",type:"sport",scale:null,offset:0,units:""},5:{field:"capabilities",type:"workout_capabilities",scale:null,offset:0,units:""},6:{field:"num_valid_steps",type:"uint16",scale:null,offset:0,units:""},8:{field:"wkt_name",type:"string",scale:null,offset:0,units:""}},27:{name:"workout_step",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"wkt_step_name",type:"string",scale:null,offset:0,units:""},1:{field:"duration_type",type:"wkt_step_duration",scale:null,offset:0,units:""},2:{field:"duration_value",type:"uint32",scale:null,offset:0,units:""},3:{field:"target_type",type:"wkt_step_target",scale:null,offset:0,units:""},4:{field:"target_value",type:"uint32",scale:null,offset:0,units:""},5:{field:"custom_target_value_low",type:"uint32",scale:null,offset:0,units:""},6:{field:"custom_target_value_high",type:"uint32",scale:null,offset:0,units:""},7:{field:"intensity",type:"intensity",scale:null,offset:0,units:""}},30:{name:"weight_scale",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"weight",type:"weight",scale:100,offset:0,units:"kg"},1:{field:"percent_fat",type:"uint16",scale:100,offset:0,units:"%"},2:{field:"percent_hydration",type:"uint16",scale:100,offset:0,units:"%"},3:{field:"visceral_fat_mass",type:"uint16",scale:100,offset:0,units:"kg"},4:{field:"bone_mass",type:"uint16",scale:100,offset:0,units:"kg"},5:{field:"muscle_mass",type:"uint16",scale:100,offset:0,units:"kg"},7:{field:"basal_met",type:"uint16",scale:4,offset:0,units:"kcal/day"},8:{field:"physique_rating",type:"uint8",scale:null,offset:0,units:""},9:{field:"active_met",type:"uint16",scale:4,offset:0,units:"kcal/day"},10:{field:"metabolic_age",type:"uint8",scale:null,offset:0,units:"years"},11:{field:"visceral_fat_rating",type:"uint8",scale:null,offset:0,units:""},12:{field:"user_profile_index",type:"message_index",scale:null,offset:0,units:""}},31:{name:"course",4:{field:"sport",type:"sport",scale:null,offset:0,units:""},5:{field:"name",type:"string",scale:null,offset:0,units:""},6:{field:"capabilities",type:"course_capabilities",scale:null,offset:0,units:""}},32:{name:"course_point",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},1:{field:"timestamp",type:"date_time",scale:null,offset:0,units:""},2:{field:"position_lat",type:"sint32",scale:null,offset:0,units:"semicircles"},3:{field:"position_long",type:"sint32",scale:null,offset:0,units:"semicircles"},4:{field:"distance",type:"uint32",scale:100,offset:0,units:"m"},5:{field:"type",type:"course_point",scale:null,offset:0,units:""},6:{field:"name",type:"string",scale:null,offset:0,units:""},8:{field:"favorite",type:"bool",scale:null,offset:0,units:""}},33:{name:"totals",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"timer_time",type:"uint32",scale:null,offset:0,units:"s"},1:{field:"distance",type:"uint32",scale:null,offset:0,units:"m"},2:{field:"calories",type:"uint32",scale:null,offset:0,units:"kcal"},3:{field:"sport",type:"sport",scale:null,offset:0,units:""},4:{field:"elapsed_time",type:"uint32",scale:null,offset:0,units:"s"},5:{field:"sessions",type:"uint16",scale:null,offset:0,units:""},6:{field:"active_time",type:"uint32",scale:null,offset:0,units:"s"},9:{field:"sport_index",type:"uint8",scale:null,offset:0,units:""}},34:{name:"activity",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:""},0:{field:"total_timer_time",type:"uint32",scale:1e3,offset:0,units:"s"},1:{field:"num_sessions",type:"uint16",scale:null,offset:0,units:""},2:{field:"type",type:"activity",scale:null,offset:0,units:""},3:{field:"event",type:"event",scale:null,offset:0,units:""},4:{field:"event_type",type:"event_type",scale:null,offset:0,units:""},5:{field:"local_timestamp",type:"local_date_time",scale:null,offset:0,units:""},6:{field:"event_group",type:"uint8",scale:null,offset:0,units:""}},35:{name:"software",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},3:{field:"version",type:"uint16",scale:100,offset:0,units:""},5:{field:"part_number",type:"string",scale:null,offset:0,units:""}},37:{name:"file_capabilities",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"type",type:"file",scale:null,offset:0,units:""},1:{field:"flags",type:"file_flags",scale:null,offset:0,units:""},2:{field:"directory",type:"string",scale:null,offset:0,units:""},3:{field:"max_count",type:"uint16",scale:null,offset:0,units:""},4:{field:"max_size",type:"uint32",scale:null,offset:0,units:"bytes"}},38:{name:"mesg_capabilities",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"file",type:"file",scale:null,offset:0,units:""},1:{field:"mesg_num",type:"mesg_num",scale:null,offset:0,units:""},2:{field:"count_type",type:"mesg_count",scale:null,offset:0,units:""},3:{field:"count",type:"uint16",scale:null,offset:0,units:""}},39:{name:"field_capabilities",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"file",type:"file",scale:null,offset:0,units:""},1:{field:"mesg_num",type:"mesg_num",scale:null,offset:0,units:""},2:{field:"field_num",type:"uint8",scale:null,offset:0,units:""},3:{field:"count",type:"uint16",scale:null,offset:0,units:""}},49:{name:"file_creator",0:{field:"software_version",type:"uint16",scale:null,offset:0,units:""},1:{field:"hardware_version",type:"uint8",scale:null,offset:0,units:""}},51:{name:"blood_pressure",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"systolic_pressure",type:"uint16",scale:null,offset:0,units:"mmHg"},1:{field:"diastolic_pressure",type:"uint16",scale:null,offset:0,units:"mmHg"},2:{field:"mean_arterial_pressure",type:"uint16",scale:null,offset:0,units:"mmHg"},3:{field:"map_3_sample_mean",type:"uint16",scale:null,offset:0,units:"mmHg"},4:{field:"map_morning_values",type:"uint16",scale:null,offset:0,units:"mmHg"},5:{field:"map_evening_values",type:"uint16",scale:null,offset:0,units:"mmHg"},6:{field:"heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},7:{field:"heart_rate_type",type:"hr_type",scale:null,offset:0,units:""},8:{field:"status",type:"bp_status",scale:null,offset:0,units:""},9:{field:"user_profile_index",type:"message_index",scale:null,offset:0,units:""}},55:{name:"monitoring",253:{field:"timestamp",type:"uint32",scale:null,offset:0,units:""},0:{field:"device_index",type:"device_index",scale:null,offset:0,units:""},1:{field:"calories",type:"uint16",scale:null,offset:0,units:"kcal"},2:{field:"distance",type:"float32",scale:null,offset:0,units:"m"},3:{field:"cycles",type:"float32",scale:null,offset:0,units:"cycles"},4:{field:"active_time",type:"float32",scale:null,offset:0,units:"s"},5:{field:"activity_type",type:"activity_type",scale:null,offset:0,units:""},6:{field:"activity_subtype",type:"activity_subtype",scale:null,offset:0,units:""},7:{field:"activity_level",type:"activity_level",scale:null,offset:0,units:"s"},8:{field:"distance16",type:"uint16",scale:null,offset:0,units:"m"},9:{field:"cycles16",type:"uint16",scale:null,offset:0,units:"cycles"},10:{field:"active_time16",type:"uint16",scale:null,offset:0,units:""},11:{field:"local_timestamp",type:"uint32",scale:null,offset:0,units:""},12:{field:"temperature",type:"float32",scale:null,offset:0,units:"C"},14:{field:"temperature_min",type:"float32",scale:null,offset:0,units:"C"},15:{field:"temperature_max",type:"float32",scale:null,offset:0,units:"C"},16:{field:"activity_time",type:"int32",scale:null,offset:0,units:""},19:{field:"active_calories",type:"uint16",scale:null,offset:0,units:"kcal"},24:{field:"current_activity_type_intensity",type:"uint8",scale:null,offset:0,units:""},25:{field:"timestamp_min8",type:"uint8",scale:null,offset:0,units:""},26:{field:"timestamp16",type:"uint16",scale:null,offset:0,units:""},27:{field:"heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},28:{field:"intensity",type:"uint8",scale:null,offset:0,units:""},29:{field:"duration_min",type:"uint16",scale:null,offset:0,units:""},30:{field:"duration",type:"uint32",scale:null,offset:0,units:""},31:{field:"ascent",type:"float32",scale:null,offset:0,units:"m"},32:{field:"descent",type:"float32",scale:null,offset:0,units:"m"},33:{field:"moderate_activity_minutes",type:"uint16",scale:null,offset:0,units:""},34:{field:"vigorous_activity_inutes",type:"uint16",scale:null,offset:0,units:""}},78:{name:"hrv",0:{field:"time",type:"uint16_array",scale:1e3,offset:0,units:"s"}},101:{name:"length",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"event",type:"event",scale:null,offset:0,units:""},1:{field:"event_type",type:"event_type",scale:null,offset:0,units:""},2:{field:"start_time",type:"date_time",scale:null,offset:0,units:""},3:{field:"total_elapsed_time",type:"uint32",scale:1e3,offset:0,units:"s"},4:{field:"total_timer_time",type:"uint32",scale:1e3,offset:0,units:"s"},5:{field:"total_strokes",type:"uint16",scale:null,offset:0,units:"strokes"},6:{field:"avg_speed",type:"uint16",scale:1e3,offset:0,units:"m/s"},7:{field:"swim_stroke",type:"swim_stroke",scale:null,offset:0,units:"swim_stroke"},9:{field:"avg_swimming_cadence",type:"uint8",scale:null,offset:0,units:"strokes/min"},10:{field:"event_group",type:"uint8",scale:null,offset:0,units:""},11:{field:"total_calories",type:"uint16",scale:null,offset:0,units:"kcal"},12:{field:"length_type",type:"length_type",scale:null,offset:0,units:"length_type"},18:{field:"player_score",type:"uint16",scale:null,offset:0,units:""},19:{field:"opponent_score",type:"uint16",scale:null,offset:0,units:""},20:{field:"stroke_count",type:"uint16",scale:null,offset:0,units:"counts"},21:{field:"zone_count",type:"uint16",scale:null,offset:0,units:"counts"}},103:{name:"monitoring_info",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:""},0:{field:"local_timestamp",type:"uint32",scale:null,offset:0,units:""},1:{field:"activity_type",type:"activity_type",scale:null,offset:0,units:""},3:{field:"cycles_to_distance",type:"float32",scale:null,offset:0,units:"cycles"},4:{field:"cycles_to_calories",type:"float32",scale:null,offset:0,units:"kcal"},5:{field:"resting_metabolic_rate",type:"uint16",scale:null,offset:0,units:""}},108:{name:"o_hr_settings",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:""},0:{field:"enabled",type:"byte",scale:null,offset:0,units:""}},140:{name:"activity_metrics",1:{field:"new_max_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},4:{field:"aerobic_training_effect",type:"uint8",scale:10,offset:0,units:""},7:{field:"vo2_max",type:"uint32",scale:65536/3.5,offset:0,units:"ml/kg/min"},9:{field:"recovery_time",type:"uint16",scale:null,offset:0,units:"min"},11:{field:"sport",type:"sport",scale:null,offset:0,units:""},20:{field:"anaerobic_training_effect",type:"uint8",scale:10,offset:0,units:""},29:{field:"first_vo2_max",type:"uint32",scale:65536/3.5,offset:0,units:"ml/kg/min"},41:{field:"primary_benefit",type:"uint8",scale:null,offset:0,units:""},60:{field:"total_ascent",type:"uint16",scale:null,offset:0,units:"m"},61:{field:"total_descent",type:"uint16",scale:null,offset:0,units:"m"},62:{field:"avg_power",type:"uint16",scale:null,offset:0,units:"watts"},63:{field:"avg_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"}},206:{name:"field_description",0:{field:"developer_data_index",type:"uint8",scale:null,offset:0,units:""},1:{field:"field_definition_number",type:"uint8",scale:null,offset:0,units:""},2:{field:"fit_base_type_id",type:"uint8",scale:null,offset:0,units:""},3:{field:"field_name",type:"string",scale:null,offset:0,units:""},6:{field:"scale",type:"uint8",scale:null,offset:0,units:""},7:{field:"offset",type:"sint8",scale:null,offset:0,units:""},8:{field:"units",type:"string",scale:null,offset:0,units:""},15:{field:"native_field_num",type:"uint8",scale:null,offset:0,units:""}},227:{name:"stress_level",0:{field:"stress_level_value",type:"uint16",scale:null,offset:0,units:""},1:{field:"stress_level_time",type:"date_time",scale:null,offset:0,units:"s"},2:{field:"field_two",type:"sint8",scale:null,offset:0,units:""},3:{field:"body_battery",type:"uint8",scale:null,offset:0,units:""},4:{field:"field_four",type:"uint8",scale:null,offset:0,units:""}},207:{name:"developer_data_id",0:{field:"developer_id",type:"uint8",scale:null,offset:0,units:""},1:{field:"application_id",type:"byte_array",scale:null,offset:0,units:""},2:{field:"manufacturer_id",type:"manufacturer",scale:null,offset:0,units:""},3:{field:"developer_data_index",type:"uint8",scale:null,offset:0,units:""},4:{field:"application_version",type:"uint8",scale:null,offset:0,units:""}},258:{name:"dive_settings",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"name",type:"string",scale:null,offset:0,units:""},1:{field:"model",type:"tissue_model_type",scale:null,offset:0,units:""},2:{field:"gf_low",type:"uint8",scale:null,offset:0,units:"percent"},3:{field:"gf_high",type:"uint8",scale:null,offset:0,units:"percent"},4:{field:"water_type",type:"water_type",scale:null,offset:0,units:""},5:{field:"water_density",type:"float32",scale:null,offset:0,units:"kg/m^3"},6:{field:"po2_warn",type:"uint8",scale:null,offset:0,units:"percent"},7:{field:"po2_critical",type:"uint8",scale:null,offset:0,units:"percent"},8:{field:"po2_deco",type:"uint8",scale:null,offset:0,units:"percent"},9:{field:"safety_stop_enabled",type:"bool",scale:null,offset:0,units:""},10:{field:"bottom_depth",type:"float32",scale:null,offset:0,units:""},11:{field:"bottom_time",type:"uint32",scale:null,offset:0,units:""},12:{field:"apnea_countdown_enabled",type:"bool",scale:null,offset:0,units:""},13:{field:"apnea_countdown_time",type:"uint32",scale:null,offset:0,units:""},14:{field:"backlight_mode",type:"dive_backlight_mode",scale:null,offset:0,units:""},15:{field:"backlight_brightness",type:"uint8",scale:null,offset:0,units:""},16:{field:"backlight_timeout",type:"backlight_timeout",scale:null,offset:0,units:""},17:{field:"repeat_dive_time",type:"uint16",scale:null,offset:0,units:"s"},18:{field:"safety_stop_time",type:"uint16",scale:null,offset:0,units:"s"},19:{field:"heart_rate_source_type",type:"source_type",scale:null,offset:0,units:""},20:{field:"heart_rate_source",type:"uint8",scale:null,offset:0,units:""}},259:{name:"dive_gas",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"helium_content",type:"uint8",scale:null,offset:0,units:"percent"},1:{field:"oxygen_content",type:"uint8",scale:null,offset:0,units:"percent"},2:{field:"status",type:"dive_gas_status",scale:null,offset:0,units:""}},262:{name:"dive_alarm",254:{field:"message_index",type:"message_index",scale:null,offset:0,units:""},0:{field:"depth",type:"uint32",scale:null,offset:0,units:"m"},1:{field:"time",type:"sint32",scale:null,offset:0,units:"s"},2:{field:"enabled",type:"bool",scale:null,offset:0,units:""},3:{field:"alarm_type",type:"dive_alarm_type",scale:null,offset:0,units:""},4:{field:"sound",type:"tone",scale:null,offset:0,units:""},5:{field:"dive_types",type:"sub_sport",scale:null,offset:0,units:""}},268:{name:"dive_summary",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"reference_mesg",type:"mesg_num",scale:null,offset:0,units:""},1:{field:"reference_index",type:"message_index",scale:null,offset:0,units:""},2:{field:"avg_depth",type:"uint32",scale:null,offset:0,units:"m"},3:{field:"max_depth",type:"uint32",scale:null,offset:0,units:"m"},4:{field:"surface_interval",type:"uint32",scale:null,offset:0,units:"s"},5:{field:"start_cns",type:"uint8",scale:null,offset:0,units:"percent"},6:{field:"end_cns",type:"uint8",scale:null,offset:0,units:"percent"},7:{field:"start_n2",type:"uint16",scale:null,offset:0,units:"percent"},8:{field:"end_n2",type:"uint16",scale:null,offset:0,units:"percent"},9:{field:"o2_toxicity",type:"uint16",scale:null,offset:0,units:"OTUs"},10:{field:"dive_number",type:"uint32",scale:null,offset:0,units:""},11:{field:"bottom_time",type:"uint32",scale:null,offset:0,units:"s"}},319:{name:"tank_update",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"sensor",type:"uint32",scale:null,offset:0,units:""},1:{field:"pressure",type:"uint16",scale:null,offset:0,units:"cbar"}},323:{name:"tank_summary",0:{field:"sensor",type:"uint32",scale:null,offset:0,units:""},1:{field:"start_pressure",type:"uint16",scale:null,offset:0,units:"cbar"},2:{field:"end_pressure",type:"uint16",scale:null,offset:0,units:"cbar"},3:{field:"volume_used",type:"uint16",scale:null,offset:0,units:"cbar"}},216:{name:"time_in_zone",253:{field:"timestamp",type:"date_time",scale:null,offset:0,units:"s"},0:{field:"reference_mesg",type:"uint16",scale:null,offset:0,units:""},1:{field:"reference_index",type:"uint16",scale:null,offset:0,units:""},2:{field:"time_in_hr_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},3:{field:"time_in_speed_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},4:{field:"time_in_power_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},5:{field:"time_in_power_zone",type:"uint32_array",scale:1e3,offset:0,units:"s"},6:{field:"hr_zone_high_boundary",type:"uint8_array",scale:null,offset:0,units:"bpm"},7:{field:"speed_zone_high_boundary",type:"uint16_array",scale:1e3,offset:0,units:"m/s"},8:{field:"power_zone_high_boundary",type:"uint16_array",scale:null,offset:0,units:"watts"},9:{field:"power_zone_high_boundary",type:"uint16_array",scale:null,offset:0,units:"watts"},10:{field:"max_heart_rate_deprecated",type:"uint8",scale:null,offset:0,units:"bpm"},11:{field:"max_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},12:{field:"resting_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},13:{field:"threshold_heart_rate",type:"uint8",scale:null,offset:0,units:"bpm"},14:{field:"pwr_calc_type",type:"pwr_zone_calc",scale:null,offset:0,units:""},15:{field:"functional_threshold_power",type:"uint16",scale:null,offset:0,units:"watts"}}},types:{file:{1:"device",2:"settings",3:"sport",4:"activity",5:"workout",6:"course",7:"schedules",9:"weight",10:"totals",11:"goals",14:"blood_pressure",15:"monitoring_a",20:"activity_summary",28:"monitoring_daily",32:"monitoring_b",34:"segment",35:"segment_list",40:"exd_configuration",247:"mfg_range_min",254:"mfg_range_max"},mesg_num:{0:"file_id",1:"capabilities",2:"device_settings",3:"user_profile",4:"hrm_profile",5:"sdm_profile",6:"bike_profile",7:"zones_target",8:"hr_zone",9:"power_zone",10:"met_zone",12:"sport",15:"goal",18:"session",19:"lap",20:"record",21:"event",23:"device_info",26:"workout",27:"workout_step",28:"schedule",30:"weight_scale",31:"course",32:"course_point",33:"totals",34:"activity",35:"software",37:"file_capabilities",38:"mesg_capabilities",39:"field_capabilities",49:"file_creator",51:"blood_pressure",53:"speed_zone",55:"monitoring",72:"training_file",78:"hrv",80:"ant_rx",81:"ant_tx",82:"ant_channel_id",101:"length",103:"monitoring_info",105:"pad",106:"slave_device",127:"connectivity",128:"weather_conditions",129:"weather_alert",131:"cadence_zone",132:"hr",140:"activity_metrics",142:"segment_lap",145:"memo_glob",148:"segment_id",149:"segment_leaderboard_entry",150:"segment_point",151:"segment_file",158:"workout_session",159:"watchface_settings",160:"gps_metadata",161:"camera_event",162:"timestamp_correlation",164:"gyroscope_data",165:"accelerometer_data",167:"three_d_sensor_calibration",169:"video_frame",174:"obdii_data",177:"nmea_sentence",178:"aviation_attitude",184:"video",185:"video_title",186:"video_description",187:"video_clip",200:"exd_screen_configuration",201:"exd_data_field_configuration",202:"exd_data_concept_configuration",206:"field_description",207:"developer_data_id",208:"magnetometer_data",209:"barometer_data",210:"one_d_sensor_calibration",225:"set",227:"stress_level",258:"dive_settings",259:"dive_gas",262:"dive_alarm",264:"exercise_title",268:"dive_summary",285:"jump",317:"climb_pro",319:"tank_update",323:"tank_summary",216:"time_in_zone",347:"o_hr_settings",65280:"mfg_range_min",65534:"mfg_range_max"},checksum:{0:"clear",1:"ok"},file_flags:{0:0,2:"read",4:"write",8:"erase"},mesg_count:{0:"num_per_file",1:"max_per_file",2:"max_per_file_type"},date_time:{0:0,268435456:"min"},local_date_time:{0:0,268435456:"min"},message_index:{0:0,4095:"mask",28672:"reserved",32768:"selected"},gender:{0:"female",1:"male"},language:{0:"english",1:"french",2:"italian",3:"german",4:"spanish",5:"croatian",6:"czech",7:"danish",8:"dutch",9:"finnish",10:"greek",11:"hungarian",12:"norwegian",13:"polish",14:"portuguese",15:"slovakian",16:"slovenian",17:"swedish",18:"russian",19:"turkish",20:"latvian",21:"ukrainian",22:"arabic",23:"farsi",24:"bulgarian",25:"romanian",26:"chinese",27:"japanese",28:"korean",29:"taiwanese",30:"thai",31:"hebrew",32:"brazilian_portuguese",33:"indonesian",34:"malaysian",35:"vietnamese",36:"burmese",37:"mongolian",254:"custom"},language_bits_0:{0:0,1:"english",2:"french",4:"italian",8:"german",16:"spanish",32:"croatian",64:"czech",128:"danish"},language_bits_1:{0:0,1:"dutch",2:"finnish",4:"greek",8:"hungarian",16:"norwegian",32:"polish",64:"portuguese",128:"slovakian"},language_bits_2:{0:0,1:"slovenian",2:"swedish",4:"russian",8:"turkish",16:"latvian",32:"ukrainian",64:"arabic",128:"farsi"},language_bits_3:{0:0,1:"bulgarian",2:"romanian",4:"chinese",8:"japanese",16:"korean",32:"taiwanese",64:"thai",128:"hebrew"},language_bits_4:{0:0,1:"brazilian_portuguese",2:"indonesian",4:"malaysian",8:"vietnamese",16:"burmese",32:"mongolian"},time_zone:{0:"almaty",1:"bangkok",2:"bombay",3:"brasilia",4:"cairo",5:"cape_verde_is",6:"darwin",7:"eniwetok",8:"fiji",9:"hong_kong",10:"islamabad",11:"kabul",12:"magadan",13:"mid_atlantic",14:"moscow",15:"muscat",16:"newfoundland",17:"samoa",18:"sydney",19:"tehran",20:"tokyo",21:"us_alaska",22:"us_atlantic",23:"us_central",24:"us_eastern",25:"us_hawaii",26:"us_mountain",27:"us_pacific",28:"other",29:"auckland",30:"kathmandu",31:"europe_western_wet",32:"europe_central_cet",33:"europe_eastern_eet",34:"jakarta",35:"perth",36:"adelaide",37:"brisbane",38:"tasmania",39:"iceland",40:"amsterdam",41:"athens",42:"barcelona",43:"berlin",44:"brussels",45:"budapest",46:"copenhagen",47:"dublin",48:"helsinki",49:"lisbon",50:"london",51:"madrid",52:"munich",53:"oslo",54:"paris",55:"prague",56:"reykjavik",57:"rome",58:"stockholm",59:"vienna",60:"warsaw",61:"zurich",62:"quebec",63:"ontario",64:"manitoba",65:"saskatchewan",66:"alberta",67:"british_columbia",68:"boise",69:"boston",70:"chicago",71:"dallas",72:"denver",73:"kansas_city",74:"las_vegas",75:"los_angeles",76:"miami",77:"minneapolis",78:"new_york",79:"new_orleans",80:"phoenix",81:"santa_fe",82:"seattle",83:"washington_dc",84:"us_arizona",85:"chita",86:"ekaterinburg",87:"irkutsk",88:"kaliningrad",89:"krasnoyarsk",90:"novosibirsk",91:"petropavlovsk_kamchatskiy",92:"samara",93:"vladivostok",94:"mexico_central",95:"mexico_mountain",96:"mexico_pacific",97:"cape_town",98:"winkhoek",99:"lagos",100:"riyahd",101:"venezuela",102:"australia_lh",103:"santiago",253:"manual",254:"automatic"},display_measure:{0:"metric",1:"statute",2:"nautical"},display_heart:{0:"bpm",1:"max",2:"reserve"},display_power:{0:"watts",1:"percent_ftp"},display_position:{0:"degree",1:"degree_minute",2:"degree_minute_second",3:"austrian_grid",4:"british_grid",5:"dutch_grid",6:"hungarian_grid",7:"finnish_grid",8:"german_grid",9:"icelandic_grid",10:"indonesian_equatorial",11:"indonesian_irian",12:"indonesian_southern",13:"india_zone_0",14:"india_zone_IA",15:"india_zone_IB",16:"india_zone_IIA",17:"india_zone_IIB",18:"india_zone_IIIA",19:"india_zone_IIIB",20:"india_zone_IVA",21:"india_zone_IVB",22:"irish_transverse",23:"irish_grid",24:"loran",25:"maidenhead_grid",26:"mgrs_grid",27:"new_zealand_grid",28:"new_zealand_transverse",29:"qatar_grid",30:"modified_swedish_grid",31:"swedish_grid",32:"south_african_grid",33:"swiss_grid",34:"taiwan_grid",35:"united_states_grid",36:"utm_ups_grid",37:"west_malayan",38:"borneo_rso",39:"estonian_grid",40:"latvian_grid",41:"swedish_ref_99_grid"},switch:{0:"off",1:"on",2:"auto"},sport:{0:"generic",1:"running",2:"cycling",3:"transition",4:"fitness_equipment",5:"swimming",6:"basketball",7:"soccer",8:"tennis",9:"american_football",10:"training",11:"walking",12:"cross_country_skiing",13:"alpine_skiing",14:"snowboarding",15:"rowing",16:"mountaineering",17:"hiking",18:"multisport",19:"paddling",20:"flying",21:"e_biking",22:"motorcycling",23:"boating",24:"driving",25:"golf",26:"hang_gliding",27:"horseback_riding",28:"hunting",29:"fishing",30:"inline_skating",31:"rock_climbing",32:"sailing",33:"ice_skating",34:"sky_diving",35:"snowshoeing",36:"snowmobiling",37:"stand_up_paddleboarding",38:"surfing",39:"wakeboarding",40:"water_skiing",41:"kayaking",42:"rafting",43:"windsurfing",44:"kitesurfing",45:"tactical",46:"jumpmaster",47:"boxing",48:"floor_climbing",53:"diving",254:"all"},sport_bits_0:{0:0,1:"generic",2:"running",4:"cycling",8:"transition",16:"fitness_equipment",32:"swimming",64:"basketball",128:"soccer"},sport_bits_1:{0:0,1:"tennis",2:"american_football",4:"training",8:"walking",16:"cross_country_skiing",32:"alpine_skiing",64:"snowboarding",128:"rowing"},sport_bits_2:{0:0,1:"mountaineering",2:"hiking",4:"multisport",8:"paddling",16:"flying",32:"e_biking",64:"motorcycling",128:"boating"},sport_bits_3:{0:0,1:"driving",2:"golf",4:"hang_gliding",8:"horseback_riding",16:"hunting",32:"fishing",64:"inline_skating",128:"rock_climbing"},sport_bits_4:{0:0,1:"sailing",2:"ice_skating",4:"sky_diving",8:"snowshoeing",16:"snowmobiling",32:"stand_up_paddleboarding",64:"surfing",128:"wakeboarding"},sport_bits_5:{0:0,1:"water_skiing",2:"kayaking",4:"rafting",8:"windsurfing",16:"kitesurfing",32:"tactical",64:"jumpmaster",128:"boxing"},sport_bits_6:{0:0,1:"floor_climbing"},sub_sport:{0:"generic",1:"treadmill",2:"street",3:"trail",4:"track",5:"spin",6:"indoor_cycling",7:"road",8:"mountain",9:"downhill",10:"recumbent",11:"cyclocross",12:"hand_cycling",13:"track_cycling",14:"indoor_rowing",15:"elliptical",16:"stair_climbing",17:"lap_swimming",18:"open_water",19:"flexibility_training",20:"strength_training",21:"warm_up",22:"match",23:"exercise",24:"challenge",25:"indoor_skiing",26:"cardio_training",27:"indoor_walking",28:"e_bike_fitness",29:"bmx",30:"casual_walking",31:"speed_walking",32:"bike_to_run_transition",33:"run_to_bike_transition",34:"swim_to_bike_transition",35:"atv",36:"motocross",37:"backcountry",38:"resort",39:"rc_drone",40:"wingsuit",41:"whitewater",42:"skate_skiing",43:"yoga",44:"pilates",45:"indoor_running",46:"gravel_cycling",47:"e_bike_mountain",48:"commuting",49:"mixed_surface",50:"navigate",51:"track_me",52:"map",53:"single_gas_diving",54:"multi_gas_diving",55:"gauge_diving",56:"apnea_diving",57:"apnea_hunting",58:"virtual_activity",59:"obstacle",254:"all"},sport_event:{0:"uncategorized",1:"geocaching",2:"fitness",3:"recreation",4:"race",5:"special_event",6:"training",7:"transportation",8:"touring"},activity:{0:"manual",1:"auto_multi_sport"},intensity:{0:"active",1:"rest",2:"warmup",3:"cooldown",4:"recovery",5:"interval",6:"other"},session_trigger:{0:"activity_end",1:"manual",2:"auto_multi_sport",3:"fitness_equipment"},autolap_trigger:{0:"time",1:"distance",2:"position_start",3:"position_lap",4:"position_waypoint",5:"position_marked",6:"off"},lap_trigger:{0:"manual",1:"time",2:"distance",3:"position_start",4:"position_lap",5:"position_waypoint",6:"position_marked",7:"session_end",8:"fitness_equipment"},time_mode:{0:"hour12",1:"hour24",2:"military",3:"hour_12_with_seconds",4:"hour_24_with_seconds",5:"utc"},backlight_mode:{0:"off",1:"manual",2:"key_and_messages",3:"auto_brightness",4:"smart_notifications",5:"key_and_messages_night",6:"key_and_messages_and_smart_notifications"},date_mode:{0:"day_month",1:"month_day"},backlight_timeout:{0:"infinite"},event:{0:"timer",3:"workout",4:"workout_step",5:"power_down",6:"power_up",7:"off_course",8:"session",9:"lap",10:"course_point",11:"battery",12:"virtual_partner_pace",13:"hr_high_alert",14:"hr_low_alert",15:"speed_high_alert",16:"speed_low_alert",17:"cad_high_alert",18:"cad_low_alert",19:"power_high_alert",20:"power_low_alert",21:"recovery_hr",22:"battery_low",23:"time_duration_alert",24:"distance_duration_alert",25:"calorie_duration_alert",26:"activity",27:"fitness_equipment",28:"length",32:"user_marker",33:"sport_point",36:"calibration",42:"front_gear_change",43:"rear_gear_change",44:"rider_position_change",45:"elev_high_alert",46:"elev_low_alert",47:"comm_timeout"},event_type:{0:"start",1:"stop",2:"consecutive_depreciated",3:"marker",4:"stop_all",5:"begin_depreciated",6:"end_depreciated",7:"end_all_depreciated",8:"stop_disable",9:"stop_disable_all"},timer_trigger:{0:"manual",1:"auto",2:"fitness_equipment"},fitness_equipment_state:{0:"ready",1:"in_use",2:"paused",3:"unknown"},tone:{0:"off",1:"tone",2:"vibrate",3:"tone_and_vibrate"},autoscroll:{0:"none",1:"slow",2:"medium",3:"fast"},activity_class:{0:0,100:"level_max",127:"level",128:"athlete"},hr_zone_calc:{0:"custom",1:"percent_max_hr",2:"percent_hrr"},pwr_zone_calc:{0:"custom",1:"percent_ftp"},wkt_step_duration:{0:"time",1:"distance",2:"hr_less_than",3:"hr_greater_than",4:"calories",5:"open",6:"repeat_until_steps_cmplt",7:"repeat_until_time",8:"repeat_until_distance",9:"repeat_until_calories",10:"repeat_until_hr_less_than",11:"repeat_until_hr_greater_than",12:"repeat_until_power_less_than",13:"repeat_until_power_greater_than",14:"power_less_than",15:"power_greater_than",16:"training_peaks_tss",17:"repeat_until_power_last_lap_less_than",18:"repeat_until_max_power_last_lap_less_than",19:"power_3s_less_than",20:"power_10s_less_than",21:"power_30s_less_than",22:"power_3s_greater_than",23:"power_10s_greater_than",24:"power_30s_greater_than",25:"power_lap_less_than",26:"power_lap_greater_than",27:"repeat_until_training_peaks_tss",28:"repetition_time",29:"reps"},wkt_step_target:{0:"speed",1:"heart_rate",2:"open",3:"cadence",4:"power",5:"grade",6:"resistance",7:"power_3s",8:"power_10s",9:"power_30s",10:"power_lap",11:"swim_stroke",12:"speed_lap",13:"heart_rate_lap"},goal:{0:"time",1:"distance",2:"calories",3:"frequency",4:"steps",5:"ascent",6:"active_minutes"},goal_recurrence:{0:"off",1:"daily",2:"weekly",3:"monthly",4:"yearly",5:"custom"},goal_source:{0:"auto",1:"community",2:"user"},schedule:{0:"workout",1:"course"},course_point:{0:"generic",1:"summit",2:"valley",3:"water",4:"food",5:"danger",6:"left",7:"right",8:"straight",9:"first_aid",10:"fourth_category",11:"third_category",12:"second_category",13:"first_category",14:"hors_category",15:"sprint",16:"left_fork",17:"right_fork",18:"middle_fork",19:"slight_left",20:"sharp_left",21:"slight_right",22:"sharp_right",23:"u_turn",24:"segment_start",25:"segment_end"},manufacturer:{0:0,1:"garmin",2:"garmin_fr405_antfs",3:"zephyr",4:"dayton",5:"idt",6:"srm",7:"quarq",8:"ibike",9:"saris",10:"spark_hk",11:"tanita",12:"echowell",13:"dynastream_oem",14:"nautilus",15:"dynastream",16:"timex",17:"metrigear",18:"xelic",19:"beurer",20:"cardiosport",21:"a_and_d",22:"hmm",23:"suunto",24:"thita_elektronik",25:"gpulse",26:"clean_mobile",27:"pedal_brain",28:"peaksware",29:"saxonar",30:"lemond_fitness",31:"dexcom",32:"wahoo_fitness",33:"octane_fitness",34:"archinoetics",35:"the_hurt_box",36:"citizen_systems",37:"magellan",38:"osynce",39:"holux",40:"concept2",42:"one_giant_leap",43:"ace_sensor",44:"brim_brothers",45:"xplova",46:"perception_digital",47:"bf1systems",48:"pioneer",49:"spantec",50:"metalogics",51:"4iiiis",52:"seiko_epson",53:"seiko_epson_oem",54:"ifor_powell",55:"maxwell_guider",56:"star_trac",57:"breakaway",58:"alatech_technology_ltd",59:"mio_technology_europe",60:"rotor",61:"geonaute",62:"id_bike",63:"specialized",64:"wtek",65:"physical_enterprises",66:"north_pole_engineering",67:"bkool",68:"cateye",69:"stages_cycling",70:"sigmasport",71:"tomtom",72:"peripedal",73:"wattbike",76:"moxy",77:"ciclosport",78:"powerbahn",79:"acorn_projects_aps",80:"lifebeam",81:"bontrager",82:"wellgo",83:"scosche",84:"magura",85:"woodway",86:"elite",87:"nielsen_kellerman",88:"dk_city",89:"tacx",90:"direction_technology",91:"magtonic",92:"1partcarbon",93:"inside_ride_technologies",94:"sound_of_motion",95:"stryd",96:"icg",97:"mipulse",98:"bsx_athletics",99:"look",100:"campagnolo_srl",101:"body_bike_smart",102:"praxisworks",103:"limits_technology",104:"topaction_technology",105:"cosinuss",106:"fitcare",107:"magene",108:"giant_manufacturing_co",109:"tigrasport",110:"salutron",111:"technogym",112:"bryton_sensors",113:"latitude_limited",114:"soaring_technology",115:"igpsport",116:"thinkrider",117:"gopher_sport",118:"waterrower",119:"orangetheory",120:"inpeak",121:"kinetic",122:"johnson_health_tech",123:"polar_electro",124:"seesense",125:"nci_technology",255:"development",257:"healthandlife",258:"lezyne",259:"scribe_labs",260:"zwift",261:"watteam",262:"recon",263:"favero_electronics",264:"dynovelo",265:"strava",266:"precor",267:"bryton",268:"sram",269:"navman",270:"cobi",271:"spivi",272:"mio_magellan",273:"evesports",274:"sensitivus_gauge",275:"podoon",276:"life_time_fitness",277:"falco_e_motors",278:"minoura",279:"cycliq",280:"luxottica",281:"trainer_road",282:"the_sufferfest",283:"fullspeedahead",284:"virtualtraining",285:"feedbacksports",286:"omata",287:"vdo",288:"magneticdays",289:"hammerhead",290:"kinetic_by_kurt",291:"shapelog",292:"dabuziduo",293:"jetblack",294:"coros",295:"virtugo",296:"velosense",5759:"actigraphcorp"},garmin_product:{0:"hrm_bike",1:"hrm1",2:"axh01",3:"axb01",4:"axb02",5:"hrm2ss",6:"dsi_alf02",7:"hrm3ss",8:"hrm_run_single_byte_product_id",9:"bsm",10:"bcm",11:"axs01",12:"hrm_tri_single_byte_product_id",14:"fr225_single_byte_product_id",473:"fr301_china",474:"fr301_japan",475:"fr301_korea",494:"fr301_taiwan",717:"fr405",782:"fr50",987:"fr405_japan",988:"fr60",1011:"dsi_alf01",1018:"fr310xt",1036:"edge500",1124:"fr110",1169:"edge800",1199:"edge500_taiwan",1213:"edge500_japan",1253:"chirp",1274:"fr110_japan",1325:"edge200",1328:"fr910xt",1333:"edge800_taiwan",1334:"edge800_japan",1341:"alf04",1345:"fr610",1360:"fr210_japan",1380:"vector_ss",1381:"vector_cp",1386:"edge800_china",1387:"edge500_china",1410:"fr610_japan",1422:"edge500_korea",1436:"fr70",1446:"fr310xt_4t",1461:"amx",1482:"fr10",1497:"edge800_korea",1499:"swim",1537:"fr910xt_china",1551:"fenix",1555:"edge200_taiwan",1561:"edge510",1567:"edge810",1570:"tempe",1600:"fr910xt_japan",1623:"fr620",1632:"fr220",1664:"fr910xt_korea",1688:"fr10_japan",1721:"edge810_japan",1735:"virb_elite",1736:"edge_touring",1742:"edge510_japan",1743:"hrm_tri",1752:"hrm_run",1765:"fr920xt",1821:"edge510_asia",1822:"edge810_china",1823:"edge810_taiwan",1836:"edge1000",1837:"vivo_fit",1853:"virb_remote",1885:"vivo_ki",1903:"fr15",1907:"vivo_active",1918:"edge510_korea",1928:"fr620_japan",1929:"fr620_china",1930:"fr220_japan",1931:"fr220_china",1936:"approach_s6",1956:"vivo_smart",1967:"fenix2",1988:"epix",2050:"fenix3",2052:"edge1000_taiwan",2053:"edge1000_japan",2061:"fr15_japan",2067:"edge520",2070:"edge1000_china",2072:"fr620_russia",2073:"fr220_russia",2079:"vector_s",2100:"edge1000_korea",2130:"fr920xt_taiwan",2131:"fr920xt_china",2132:"fr920xt_japan",2134:"virbx",2135:"vivo_smart_apac",2140:"etrex_touch",2147:"edge25",2148:"fr25",2150:"vivo_fit2",2153:"fr225",2156:"fr630",2157:"fr230",2158:"fr735xt",2160:"vivo_active_apac",2161:"vector_2",2162:"vector_2s",2172:"virbxe",2173:"fr620_taiwan",2174:"fr220_taiwan",2175:"truswing",2188:"fenix3_china",2189:"fenix3_twn",2192:"varia_headlight",2193:"varia_taillight_old",2204:"edge_explore_1000",2219:"fr225_asia",2225:"varia_radar_taillight",2226:"varia_radar_display",2238:"edge20",2262:"d2_bravo",2266:"approach_s20",2276:"varia_remote",2327:"hrm4_run",2337:"vivo_active_hr",2348:"vivo_smart_hr",2368:"vivo_move",2398:"varia_vision",2406:"vivo_fit3",2413:"fenix3_hr",2417:"virb_ultra_30",2429:"index_smart_scale",2431:"fr235",2432:"fenix3_chronos",2441:"oregon7xx",2444:"rino7xx",2496:"nautix",2530:"edge_820",2531:"edge_explore_820",2544:"fenix5s",2547:"d2_bravo_titanium",2567:"varia_ut800",2593:"running_dynamics_pod",2604:"fenix5x",2606:"vivo_fit_jr",2691:"fr935",2697:"fenix5",2859:"descent",10007:"sdm4",10014:"edge_remote",20119:"training_center",65531:"connectiq_simulator",65532:"android_antplus_plugin",65534:"connect"},antplus_device_type:{1:"antfs",11:"bike_power",12:"environment_sensor_legacy",15:"multi_sport_speed_distance",16:"control",17:"fitness_equipment",18:"blood_pressure",19:"geocache_node",20:"light_electric_vehicle",25:"env_sensor",26:"racquet",27:"control_hub",31:"muscle_oxygen",34:"shifting",35:"bike_light_main",36:"bike_light_shared",38:"exd",40:"bike_radar",46:"bike_aero",119:"weight_scale",120:"heart_rate",121:"bike_speed_cadence",122:"bike_cadence",123:"bike_speed",124:"stride_speed_distance"},local_device_type:{0:"gps",1:"glonass",2:"gps_glonass",3:"accelerometer",4:"barometer",5:"temperature",10:"whr",12:"sensor_hub"},ble_device_type:{0:"connected_gps",1:"heart_rate",2:"bike_power",3:"bike_speed_cadence",4:"bike_speed",5:"bike_cadence",6:"footpod",7:"bike_trainer"},ant_network:{0:"public",1:"antplus",2:"antfs",3:"private"},workout_capabilities:{0:0,1:"interval",2:"custom",4:"fitness_equipment",8:"firstbeat",16:"new_leaf",32:"tcx",128:"speed",256:"heart_rate",512:"distance",1024:"cadence",2048:"power",4096:"grade",8192:"resistance",16384:"protected"},battery_status:{0:0,1:"new",2:"good",3:"ok",4:"low",5:"critical",6:"charging",7:"unknown"},hr_type:{0:"normal",1:"irregular"},course_capabilities:{0:0,1:"processed",2:"valid",4:"time",8:"distance",16:"position",32:"heart_rate",64:"power",128:"cadence",256:"training",512:"navigation",1024:"bikeway"},weight:{0:0,65534:"calculating"},workout_hr:{0:0,100:"bpm_offset"},workout_power:{0:0,1e3:"watts_offset"},bp_status:{0:"no_error",1:"error_incomplete_data",2:"error_no_measurement",3:"error_data_out_of_range",4:"error_irregular_heart_rate"},user_local_id:{0:"local_min",15:"local_max",16:"stationary_min",255:"stationary_max",256:"portable_min",65534:"portable_max"},swim_stroke:{0:"freestyle",1:"backstroke",2:"breaststroke",3:"butterfly",4:"drill",5:"mixed",6:"im"},activity_type:{0:"generic",1:"running",2:"cycling",3:"transition",4:"fitness_equipment",5:"swimming",6:"walking",8:"sedentary",254:"all"},activity_subtype:{0:"generic",1:"treadmill",2:"street",3:"trail",4:"track",5:"spin",6:"indoor_cycling",7:"road",8:"mountain",9:"downhill",10:"recumbent",11:"cyclocross",12:"hand_cycling",13:"track_cycling",14:"indoor_rowing",15:"elliptical",16:"stair_climbing",17:"lap_swimming",18:"open_water",254:"all"},activity_level:{0:"low",1:"medium",2:"high"},side:{0:"right",1:"left"},left_right_balance:{0:0,127:"mask",128:"right"},left_right_balance_100:{0:0,16383:"mask",32768:"right"},length_type:{0:"idle",1:"active"},day_of_week:{0:"sunday",1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday"},connectivity_capabilities:{0:0,1:"bluetooth",2:"bluetooth_le",4:"ant",8:"activity_upload",16:"course_download",32:"workout_download",64:"live_track",128:"weather_conditions",256:"weather_alerts",512:"gps_ephemeris_download",1024:"explicit_archive",2048:"setup_incomplete",4096:"continue_sync_after_software_update",8192:"connect_iq_app_download",16384:"golf_course_download",32768:"device_initiates_sync",65536:"connect_iq_watch_app_download",131072:"connect_iq_widget_download",262144:"connect_iq_watch_face_download",524288:"connect_iq_data_field_download",1048576:"connect_iq_app_managment",2097152:"swing_sensor",4194304:"swing_sensor_remote",8388608:"incident_detection",16777216:"audio_prompts",33554432:"wifi_verification",67108864:"true_up",134217728:"find_my_watch",268435456:"remote_manual_sync",536870912:"live_track_auto_start",1073741824:"live_track_messaging",2147483648:"instant_input"},weather_report:{0:"current",1:"hourly_forecast",2:"daily_forecast"},weather_status:{0:"clear",1:"partly_cloudy",2:"mostly_cloudy",3:"rain",4:"snow",5:"windy",6:"thunderstorms",7:"wintry_mix",8:"fog",11:"hazy",12:"hail",13:"scattered_showers",14:"scattered_thunderstorms",15:"unknown_precipitation",16:"light_rain",17:"heavy_rain",18:"light_snow",19:"heavy_snow",20:"light_rain_snow",21:"heavy_rain_snow",22:"cloudy"},weather_severity:{0:"unknown",1:"warning",2:"watch",3:"advisory",4:"statement"},weather_severe_type:{0:"unspecified",1:"tornado",2:"tsunami",3:"hurricane",4:"extreme_wind",5:"typhoon",6:"inland_hurricane",7:"hurricane_force_wind",8:"waterspout",9:"severe_thunderstorm",10:"wreckhouse_winds",11:"les_suetes_wind",12:"avalanche",13:"flash_flood",14:"tropical_storm",15:"inland_tropical_storm",16:"blizzard",17:"ice_storm",18:"freezing_rain",19:"debris_flow",20:"flash_freeze",21:"dust_storm",22:"high_wind",23:"winter_storm",24:"heavy_freezing_spray",25:"extreme_cold",26:"wind_chill",27:"cold_wave",28:"heavy_snow_alert",29:"lake_effect_blowing_snow",30:"snow_squall",31:"lake_effect_snow",32:"winter_weather",33:"sleet",34:"snowfall",35:"snow_and_blowing_snow",36:"blowing_snow",37:"snow_alert",38:"arctic_outflow",39:"freezing_drizzle",40:"storm",41:"storm_surge",42:"rainfall",43:"areal_flood",44:"coastal_flood",45:"lakeshore_flood",46:"excessive_heat",47:"heat",48:"weather",49:"high_heat_and_humidity",50:"humidex_and_health",51:"humidex",52:"gale",53:"freezing_spray",54:"special_marine",55:"squall",56:"strong_wind",57:"lake_wind",58:"marine_weather",59:"wind",60:"small_craft_hazardous_seas",61:"hazardous_seas",62:"small_craft",63:"small_craft_winds",64:"small_craft_rough_bar",65:"high_water_level",66:"ashfall",67:"freezing_fog",68:"dense_fog",69:"dense_smoke",70:"blowing_dust",71:"hard_freeze",72:"freeze",73:"frost",74:"fire_weather",75:"flood",76:"rip_tide",77:"high_surf",78:"smog",79:"air_quality",80:"brisk_wind",81:"air_stagnation",82:"low_water",83:"hydrological",84:"special_weather"},stroke_type:{0:"no_event",1:"other",2:"serve",3:"forehand",4:"backhand",5:"smash"},body_location:{0:"left_leg",1:"left_calf",2:"left_shin",3:"left_hamstring",4:"left_quad",5:"left_glute",6:"right_leg",7:"right_calf",8:"right_shin",9:"right_hamstring",10:"right_quad",11:"right_glute",12:"torso_back",13:"left_lower_back",14:"left_upper_back",15:"right_lower_back",16:"right_upper_back",17:"torso_front",18:"left_abdomen",19:"left_chest",20:"right_abdomen",21:"right_chest",22:"left_arm",23:"left_shoulder",24:"left_bicep",25:"left_tricep",26:"left_brachioradialis",27:"left_forearm_extensors",28:"right_arm",29:"right_shoulder",30:"right_bicep",31:"right_tricep",32:"right_brachioradialis",33:"right_forearm_extensors",34:"neck",35:"throat",36:"waist_mid_back",37:"waist_front",38:"waist_left",39:"waist_right"},segment_lap_status:{0:"end",1:"fail"},segment_leaderboard_type:{0:"overall",1:"personal_best",2:"connections",3:"group",4:"challenger",5:"kom",6:"qom",7:"pr",8:"goal",9:"rival",10:"club_leader"},segment_delete_status:{0:"do_not_delete",1:"delete_one",2:"delete_all"},segment_selection_type:{0:"starred",1:"suggested"},source_type:{0:"ant",1:"antplus",2:"bluetooth",3:"bluetooth_low_energy",4:"wifi",5:"local"},display_orientation:{0:"auto",1:"portrait",2:"landscape",3:"portrait_flipped",4:"landscape_flipped"},workout_equipment:{0:"none",1:"swim_fins",2:"swim_kickboard",3:"swim_paddles",4:"swim_pull_buoy",5:"swim_snorkel"},watchface_mode:{0:"digital",1:"analog",2:"connect_iq",3:"disabled"},digital_watchface_layout:{0:"traditional",1:"modern",2:"bold"},analog_watchface_layout:{0:"minimal",1:"traditional",2:"modern"},rider_position_type:{0:"seated",1:"standing",2:"transition_to_seated",3:"transition_to_standing"},power_phase_type:{0:"power_phase_start_angle",1:"power_phase_end_angle",2:"power_phase_arc_length",3:"power_phase_center"},camera_event_type:{0:"video_start",1:"video_split",2:"video_end",3:"photo_taken",4:"video_second_stream_start",5:"video_second_stream_split",6:"video_second_stream_end",7:"video_split_start",8:"video_second_stream_split_start",11:"video_pause",12:"video_second_stream_pause",13:"video_resume",14:"video_second_stream_resume"},sensor_type:{0:"accelerometer",1:"gyroscope",2:"compass",3:"barometer"},bike_light_network_config_type:{0:"auto",4:"individual",5:"high_visibility",6:"trail"},comm_timeout_type:{0:"wildcard_pairing_timeout",1:"pairing_timeout",2:"connection_lost",3:"connection_timeout"},camera_orientation_type:{0:"camera_orientation_0",1:"camera_orientation_90",2:"camera_orientation_180",3:"camera_orientation_270"},attitude_stage:{0:"failed",1:"aligning",2:"degraded",3:"valid"},attitude_validity:{0:0,1:"track_angle_heading_valid",2:"pitch_valid",4:"roll_valid",8:"lateral_body_accel_valid",16:"normal_body_accel_valid",32:"turn_rate_valid",64:"hw_fail",128:"mag_invalid",256:"no_gps",512:"gps_invalid",1024:"solution_coasting",2048:"true_track_angle",4096:"magnetic_heading"},auto_sync_frequency:{0:"never",1:"occasionally",2:"frequent",3:"once_a_day",4:"remote"},exd_layout:{0:"full_screen",1:"half_vertical",2:"half_horizontal",3:"half_vertical_right_split",4:"half_horizontal_bottom_split",5:"full_quarter_split",6:"half_vertical_left_split",7:"half_horizontal_top_split"},exd_display_type:{0:"numerical",1:"simple",2:"graph",3:"bar",4:"circle_graph",5:"virtual_partner",6:"balance",7:"string_list",8:"string",9:"simple_dynamic_icon",10:"gauge"},exd_data_units:{0:"no_units",1:"laps",2:"miles_per_hour",3:"kilometers_per_hour",4:"feet_per_hour",5:"meters_per_hour",6:"degrees_celsius",7:"degrees_farenheit",8:"zone",9:"gear",10:"rpm",11:"bpm",12:"degrees",13:"millimeters",14:"meters",15:"kilometers",16:"feet",17:"yards",18:"kilofeet",19:"miles",20:"time",21:"enum_turn_type",22:"percent",23:"watts",24:"watts_per_kilogram",25:"enum_battery_status",26:"enum_bike_light_beam_angle_mode",27:"enum_bike_light_battery_status",28:"enum_bike_light_network_config_type",29:"lights",30:"seconds",31:"minutes",32:"hours",33:"calories",34:"kilojoules",35:"milliseconds",36:"second_per_mile",37:"second_per_kilometer",38:"centimeter",39:"enum_course_point",40:"bradians",41:"enum_sport",42:"inches_hg",43:"mm_hg",44:"mbars",45:"hecto_pascals",46:"feet_per_min",47:"meters_per_min",48:"meters_per_sec",49:"eight_cardinal"},exd_qualifiers:{0:"no_qualifier",1:"instantaneous",2:"average",3:"lap",4:"maximum",5:"maximum_average",6:"maximum_lap",7:"last_lap",8:"average_lap",9:"to_destination",10:"to_go",11:"to_next",12:"next_course_point",13:"total",14:"three_second_average",15:"ten_second_average",16:"thirty_second_average",17:"percent_maximum",18:"percent_maximum_average",19:"lap_percent_maximum",20:"elapsed",21:"sunrise",22:"sunset",23:"compared_to_virtual_partner",24:"maximum_24h",25:"minimum_24h",26:"minimum",27:"first",28:"second",29:"third",30:"shifter",31:"last_sport",32:"moving",33:"stopped",34:"estimated_total",242:"zone_9",243:"zone_8",244:"zone_7",245:"zone_6",246:"zone_5",247:"zone_4",248:"zone_3",249:"zone_2",250:"zone_1"},exd_descriptors:{0:"bike_light_battery_status",1:"beam_angle_status",2:"batery_level",3:"light_network_mode",4:"number_lights_connected",5:"cadence",6:"distance",7:"estimated_time_of_arrival",8:"heading",9:"time",10:"battery_level",11:"trainer_resistance",12:"trainer_target_power",13:"time_seated",14:"time_standing",15:"elevation",16:"grade",17:"ascent",18:"descent",19:"vertical_speed",20:"di2_battery_level",21:"front_gear",22:"rear_gear",23:"gear_ratio",24:"heart_rate",25:"heart_rate_zone",26:"time_in_heart_rate_zone",27:"heart_rate_reserve",28:"calories",29:"gps_accuracy",30:"gps_signal_strength",31:"temperature",32:"time_of_day",33:"balance",34:"pedal_smoothness",35:"power",36:"functional_threshold_power",37:"intensity_factor",38:"work",39:"power_ratio",40:"normalized_power",41:"training_stress_Score",42:"time_on_zone",43:"speed",44:"laps",45:"reps",46:"workout_step",47:"course_distance",48:"navigation_distance",49:"course_estimated_time_of_arrival",50:"navigation_estimated_time_of_arrival",51:"course_time",52:"navigation_time",53:"course_heading",54:"navigation_heading",55:"power_zone",56:"torque_effectiveness",57:"timer_time",58:"power_weight_ratio",59:"left_platform_center_offset",60:"right_platform_center_offset",61:"left_power_phase_start_angle",62:"right_power_phase_start_angle",63:"left_power_phase_finish_angle",64:"right_power_phase_finish_angle",65:"gears",66:"pace",67:"training_effect",68:"vertical_oscillation",69:"vertical_ratio",70:"ground_contact_time",71:"left_ground_contact_time_balance",72:"right_ground_contact_time_balance",73:"stride_length",74:"running_cadence",75:"performance_condition",76:"course_type",77:"time_in_power_zone",78:"navigation_turn",79:"course_location",80:"navigation_location",81:"compass",82:"gear_combo",83:"muscle_oxygen",84:"icon",85:"compass_heading",86:"gps_heading",87:"gps_elevation",88:"anaerobic_training_effect",89:"course",90:"off_course",91:"glide_ratio",92:"vertical_distance",93:"vmg",94:"ambient_pressure",95:"pressure",96:"vam"},auto_activity_detect:{0:"none",1:"running",2:"cycling",4:"swimming",8:"walking",16:"elliptical",32:"sedentary"},supported_exd_screen_layouts:{0:0,1:"full_screen",2:"half_vertical",4:"half_horizontal",8:"half_vertical_right_split",16:"half_horizontal_bottom_split",32:"full_quarter_split",64:"half_vertical_left_split",128:"half_horizontal_top_split"},fit_base_type:{0:"enum",1:"sint8",2:"uint8",7:"string",10:"uint8z",13:"byte",131:"sint16",132:"uint16",133:"sint32",134:"uint32",136:"float32",137:"float64",139:"uint16z",140:"uint32z",142:"sint64",143:"uint64",144:"uint64z"},turn_type:{0:"arriving_idx",1:"arriving_left_idx",2:"arriving_right_idx",3:"arriving_via_idx",4:"arriving_via_left_idx",5:"arriving_via_right_idx",6:"bear_keep_left_idx",7:"bear_keep_right_idx",8:"continue_idx",9:"exit_left_idx",10:"exit_right_idx",11:"ferry_idx",12:"roundabout_45_idx",13:"roundabout_90_idx",14:"roundabout_135_idx",15:"roundabout_180_idx",16:"roundabout_225_idx",17:"roundabout_270_idx",18:"roundabout_315_idx",19:"roundabout_360_idx",20:"roundabout_neg_45_idx",21:"roundabout_neg_90_idx",22:"roundabout_neg_135_idx",23:"roundabout_neg_180_idx",24:"roundabout_neg_225_idx",25:"roundabout_neg_270_idx",26:"roundabout_neg_315_idx",27:"roundabout_neg_360_idx",28:"roundabout_generic_idx",29:"roundabout_neg_generic_idx",30:"sharp_turn_left_idx",31:"sharp_turn_right_idx",32:"turn_left_idx",33:"turn_right_idx",34:"uturn_left_idx",35:"uturn_right_idx",36:"icon_inv_idx",37:"icon_idx_cnt"},bike_light_beam_angle_mode:{0:"manual",1:"auto"},fit_base_unit:{0:"other",1:"kilogram",2:"pound"},set_type:{0:"rest",1:"active"},exercise_category:{0:"bench_press",1:"calf_raise",2:"cardio",3:"carry",4:"chop",5:"core",6:"crunch",7:"curl",8:"deadlift",9:"flye",10:"hip_raise",11:"hip_stability",12:"hip_swing",13:"hyperextension",14:"lateral_raise",15:"leg_curl",16:"leg_raise",17:"lunge",18:"olympic_lift",19:"plank",20:"plyo",21:"pull_up",22:"push_up",23:"row",24:"shoulder_press",25:"shoulder_stability",26:"shrug",27:"sit_up",28:"squat",29:"total_body",30:"triceps_extension",31:"warm_up",32:"run",65534:"unknown"},bench_press_exercise_name:{0:"alternating_dumbbell_chest_press_on_swiss_ball",1:"barbell_bench_press",2:"barbell_board_bench_press",3:"barbell_floor_press",4:"close_grip_barbell_bench_press",5:"decline_dumbbell_bench_press",6:"dumbbell_bench_press",7:"dumbbell_floor_press",8:"incline_barbell_bench_press",9:"incline_dumbbell_bench_press",10:"incline_smith_machine_bench_press",11:"isometric_barbell_bench_press",12:"kettlebell_chest_press",13:"neutral_grip_dumbbell_bench_press",14:"neutral_grip_dumbbell_incline_bench_press",15:"one_arm_floor_press",16:"weighted_one_arm_floor_press",17:"partial_lockout",18:"reverse_grip_barbell_bench_press",19:"reverse_grip_incline_bench_press",20:"single_arm_cable_chest_press",21:"single_arm_dumbbell_bench_press",22:"smith_machine_bench_press",23:"swiss_ball_dumbbell_chest_press",24:"triple_stop_barbell_bench_press",25:"wide_grip_barbell_bench_press",26:"alternating_dumbbell_chest_press"},calf_raise_exercise_name:{0:"3_way_calf_raise",1:"3_way_weighted_calf_raise",2:"3_way_single_leg_calf_raise",3:"3_way_weighted_single_leg_calf_raise",4:"donkey_calf_raise",5:"weighted_donkey_calf_raise",6:"seated_calf_raise",7:"weighted_seated_calf_raise",8:"seated_dumbbell_toe_raise",9:"single_leg_bent_knee_calf_raise",10:"weighted_single_leg_bent_knee_calf_raise",11:"single_leg_decline_push_up",12:"single_leg_donkey_calf_raise",13:"weighted_single_leg_donkey_calf_raise",14:"single_leg_hip_raise_with_knee_hold",15:"single_leg_standing_calf_raise",16:"single_leg_standing_dumbbell_calf_raise",17:"standing_barbell_calf_raise",18:"standing_calf_raise",19:"weighted_standing_calf_raise",20:"standing_dumbbell_calf_raise"},cardio_exercise_name:{0:"bob_and_weave_circle",1:"weighted_bob_and_weave_circle",2:"cardio_core_crawl",3:"weighted_cardio_core_crawl",4:"double_under",5:"weighted_double_under",6:"jump_rope",7:"weighted_jump_rope",8:"jump_rope_crossover",9:"weighted_jump_rope_crossover",10:"jump_rope_jog",11:"weighted_jump_rope_jog",12:"jumping_jacks",13:"weighted_jumping_jacks",14:"ski_moguls",15:"weighted_ski_moguls",16:"split_jacks",17:"weighted_split_jacks",18:"squat_jacks",19:"weighted_squat_jacks",20:"triple_under",21:"weighted_triple_under"},carry_exercise_name:{0:"bar_holds",1:"farmers_walk",2:"farmers_walk_on_toes",3:"hex_dumbbell_hold",4:"overhead_carry"},chop_exercise_name:{0:"cable_pull_through",1:"cable_rotational_lift",2:"cable_woodchop",3:"cross_chop_to_knee",4:"weighted_cross_chop_to_knee",5:"dumbbell_chop",6:"half_kneeling_rotation",7:"weighted_half_kneeling_rotation",8:"half_kneeling_rotational_chop",9:"half_kneeling_rotational_reverse_chop",10:"half_kneeling_stability_chop",11:"half_kneeling_stability_reverse_chop",12:"kneeling_rotational_chop",13:"kneeling_rotational_reverse_chop",14:"kneeling_stability_chop",15:"kneeling_woodchopper",16:"medicine_ball_wood_chops",17:"power_squat_chops",18:"weighted_power_squat_chops",19:"standing_rotational_chop",20:"standing_split_rotational_chop",21:"standing_split_rotational_reverse_chop",22:"standing_stability_reverse_chop"},core_exercise_name:{0:"abs_jabs",1:"weighted_abs_jabs",2:"alternating_plate_reach",3:"barbell_rollout",4:"weighted_barbell_rollout",5:"body_bar_oblique_twist",6:"cable_core_press",7:"cable_side_bend",8:"side_bend",9:"weighted_side_bend",10:"crescent_circle",11:"weighted_crescent_circle",12:"cycling_russian_twist",13:"weighted_cycling_russian_twist",14:"elevated_feet_russian_twist",15:"weighted_elevated_feet_russian_twist",16:"half_turkish_get_up",17:"kettlebell_windmill",18:"kneeling_ab_wheel",19:"weighted_kneeling_ab_wheel",20:"modified_front_lever",21:"open_knee_tucks",22:"weighted_open_knee_tucks",23:"side_abs_leg_lift",24:"weighted_side_abs_leg_lift",25:"swiss_ball_jackknife",26:"weighted_swiss_ball_jackknife",27:"swiss_ball_pike",28:"weighted_swiss_ball_pike",29:"swiss_ball_rollout",30:"weighted_swiss_ball_rollout",31:"triangle_hip_press",32:"weighted_triangle_hip_press",33:"trx_suspended_jackknife",34:"weighted_trx_suspended_jackknife",35:"u_boat",36:"weighted_u_boat",37:"windmill_switches",38:"weighted_windmill_switches",39:"alternating_slide_out",40:"weighted_alternating_slide_out",41:"ghd_back_extensions",42:"weighted_ghd_back_extensions",43:"overhead_walk",44:"inchworm",45:"weighted_modified_front_lever",46:"russian_twist",47:"abdominal_leg_rotations",48:"arm_and_leg_extension_on_knees",49:"bicycle",50:"bicep_curl_with_leg_extension",51:"cat_cow",52:"corkscrew",53:"criss_cross",54:"criss_cross_with_ball",55:"double_leg_stretch",56:"knee_folds",57:"lower_lift",58:"neck_pull",59:"pelvic_clocks",60:"roll_over",61:"roll_up",62:"rolling",63:"rowing_1",64:"rowing_2",65:"scissors",66:"single_leg_circles",67:"single_leg_stretch",68:"snake_twist_1_and_2",69:"swan",70:"swimming",71:"teaser",72:"the_hundred"},crunch_exercise_name:{0:"bicycle_crunch",1:"cable_crunch",2:"circular_arm_crunch",3:"crossed_arms_crunch",4:"weighted_crossed_arms_crunch",5:"cross_leg_reverse_crunch",6:"weighted_cross_leg_reverse_crunch",7:"crunch_chop",8:"weighted_crunch_chop",9:"double_crunch",10:"weighted_double_crunch",11:"elbow_to_knee_crunch",12:"weighted_elbow_to_knee_crunch",13:"flutter_kicks",14:"weighted_flutter_kicks",15:"foam_roller_reverse_crunch_on_bench",16:"weighted_foam_roller_reverse_crunch_on_bench",17:"foam_roller_reverse_crunch_with_dumbbell",18:"foam_roller_reverse_crunch_with_medicine_ball",19:"frog_press",20:"hanging_knee_raise_oblique_crunch",21:"weighted_hanging_knee_raise_oblique_crunch",22:"hip_crossover",23:"weighted_hip_crossover",24:"hollow_rock",25:"weighted_hollow_rock",26:"incline_reverse_crunch",27:"weighted_incline_reverse_crunch",28:"kneeling_cable_crunch",29:"kneeling_cross_crunch",30:"weighted_kneeling_cross_crunch",31:"kneeling_oblique_cable_crunch",32:"knees_to_elbow",33:"leg_extensions",34:"weighted_leg_extensions",35:"leg_levers",36:"mcgill_curl_up",37:"weighted_mcgill_curl_up",38:"modified_pilates_roll_up_with_ball",39:"weighted_modified_pilates_roll_up_with_ball",40:"pilates_crunch",41:"weighted_pilates_crunch",42:"pilates_roll_up_with_ball",43:"weighted_pilates_roll_up_with_ball",44:"raised_legs_crunch",45:"weighted_raised_legs_crunch",46:"reverse_crunch",47:"weighted_reverse_crunch",48:"reverse_crunch_on_a_bench",49:"weighted_reverse_crunch_on_a_bench",50:"reverse_curl_and_lift",51:"weighted_reverse_curl_and_lift",52:"rotational_lift",53:"weighted_rotational_lift",54:"seated_alternating_reverse_crunch",55:"weighted_seated_alternating_reverse_crunch",56:"seated_leg_u",57:"weighted_seated_leg_u",58:"side_to_side_crunch_and_weave",59:"weighted_side_to_side_crunch_and_weave",60:"single_leg_reverse_crunch",61:"weighted_single_leg_reverse_crunch",62:"skater_crunch_cross",63:"weighted_skater_crunch_cross",64:"standing_cable_crunch",65:"standing_side_crunch",66:"step_climb",67:"weighted_step_climb",68:"swiss_ball_crunch",69:"swiss_ball_reverse_crunch",70:"weighted_swiss_ball_reverse_crunch",71:"swiss_ball_russian_twist",72:"weighted_swiss_ball_russian_twist",73:"swiss_ball_side_crunch",74:"weighted_swiss_ball_side_crunch",75:"thoracic_crunches_on_foam_roller",76:"weighted_thoracic_crunches_on_foam_roller",77:"triceps_crunch",78:"weighted_bicycle_crunch",79:"weighted_crunch",80:"weighted_swiss_ball_crunch",81:"toes_to_bar",82:"weighted_toes_to_bar",83:"crunch",84:"straight_leg_crunch_with_ball"},curl_exercise_name:{0:"alternating_dumbbell_biceps_curl",1:"alternating_dumbbell_biceps_curl_on_swiss_ball",2:"alternating_incline_dumbbell_biceps_curl",3:"barbell_biceps_curl",4:"barbell_reverse_wrist_curl",5:"barbell_wrist_curl",6:"behind_the_back_barbell_reverse_wrist_curl",7:"behind_the_back_one_arm_cable_curl",8:"cable_biceps_curl",9:"cable_hammer_curl",10:"cheating_barbell_biceps_curl",11:"close_grip_ez_bar_biceps_curl",12:"cross_body_dumbbell_hammer_curl",13:"dead_hang_biceps_curl",14:"decline_hammer_curl",15:"dumbbell_biceps_curl_with_static_hold",16:"dumbbell_hammer_curl",17:"dumbbell_reverse_wrist_curl",18:"dumbbell_wrist_curl",19:"ez_bar_preacher_curl",20:"forward_bend_biceps_curl",21:"hammer_curl_to_press",22:"incline_dumbbell_biceps_curl",23:"incline_offset_thumb_dumbbell_curl",24:"kettlebell_biceps_curl",25:"lying_concentration_cable_curl",26:"one_arm_preacher_curl",27:"plate_pinch_curl",28:"preacher_curl_with_cable",29:"reverse_ez_bar_curl",30:"reverse_grip_wrist_curl",31:"reverse_grip_barbell_biceps_curl",32:"seated_alternating_dumbbell_biceps_curl",33:"seated_dumbbell_biceps_curl",34:"seated_reverse_dumbbell_curl",35:"split_stance_offset_pinky_dumbbell_curl",36:"standing_alternating_dumbbell_curls",37:"standing_dumbbell_biceps_curl",38:"standing_ez_bar_biceps_curl",39:"static_curl",40:"swiss_ball_dumbbell_overhead_triceps_extension",41:"swiss_ball_ez_bar_preacher_curl",42:"twisting_standing_dumbbell_biceps_curl",43:"wide_grip_ez_bar_biceps_curl"},deadlift_exercise_name:{0:"barbell_deadlift",1:"barbell_straight_leg_deadlift",2:"dumbbell_deadlift",3:"dumbbell_single_leg_deadlift_to_row",4:"dumbbell_straight_leg_deadlift",5:"kettlebell_floor_to_shelf",6:"one_arm_one_leg_deadlift",7:"rack_pull",8:"rotational_dumbbell_straight_leg_deadlift",9:"single_arm_deadlift",10:"single_leg_barbell_deadlift",11:"single_leg_barbell_straight_leg_deadlift",12:"single_leg_deadlift_with_barbell",13:"single_leg_rdl_circuit",14:"single_leg_romanian_deadlift_with_dumbbell",15:"sumo_deadlift",16:"sumo_deadlift_high_pull",17:"trap_bar_deadlift",18:"wide_grip_barbell_deadlift"},flye_exercise_name:{0:"cable_crossover",1:"decline_dumbbell_flye",2:"dumbbell_flye",3:"incline_dumbbell_flye",4:"kettlebell_flye",5:"kneeling_rear_flye",6:"single_arm_standing_cable_reverse_flye",7:"swiss_ball_dumbbell_flye",8:"arm_rotations",9:"hug_a_tree"},hip_raise_exercise_name:{0:"barbell_hip_thrust_on_floor",1:"barbell_hip_thrust_with_bench",2:"bent_knee_swiss_ball_reverse_hip_raise",3:"weighted_bent_knee_swiss_ball_reverse_hip_raise",4:"bridge_with_leg_extension",5:"weighted_bridge_with_leg_extension",6:"clam_bridge",7:"front_kick_tabletop",8:"weighted_front_kick_tabletop",9:"hip_extension_and_cross",10:"weighted_hip_extension_and_cross",11:"hip_raise",12:"weighted_hip_raise",13:"hip_raise_with_feet_on_swiss_ball",14:"weighted_hip_raise_with_feet_on_swiss_ball",15:"hip_raise_with_head_on_bosu_ball",16:"weighted_hip_raise_with_head_on_bosu_ball",17:"hip_raise_with_head_on_swiss_ball",18:"weighted_hip_raise_with_head_on_swiss_ball",19:"hip_raise_with_knee_squeeze",20:"weighted_hip_raise_with_knee_squeeze",21:"incline_rear_leg_extension",22:"weighted_incline_rear_leg_extension",23:"kettlebell_swing",24:"marching_hip_raise",25:"weighted_marching_hip_raise",26:"marching_hip_raise_with_feet_on_a_swiss_ball",27:"weighted_marching_hip_raise_with_feet_on_a_swiss_ball",28:"reverse_hip_raise",29:"weighted_reverse_hip_raise",30:"single_leg_hip_raise",31:"weighted_single_leg_hip_raise",32:"single_leg_hip_raise_with_foot_on_bench",33:"weighted_single_leg_hip_raise_with_foot_on_bench",34:"single_leg_hip_raise_with_foot_on_bosu_ball",35:"weighted_single_leg_hip_raise_with_foot_on_bosu_ball",36:"single_leg_hip_raise_with_foot_on_foam_roller",37:"weighted_single_leg_hip_raise_with_foot_on_foam_roller",38:"single_leg_hip_raise_with_foot_on_medicine_ball",39:"weighted_single_leg_hip_raise_with_foot_on_medicine_ball",40:"single_leg_hip_raise_with_head_on_bosu_ball",41:"weighted_single_leg_hip_raise_with_head_on_bosu_ball",42:"weighted_clam_bridge",43:"single_leg_swiss_ball_hip_raise_and_leg_curl",44:"clams",45:"inner_thigh_circles",46:"inner_thigh_side_lift",47:"leg_circles",48:"leg_lift",49:"leg_lift_in_external_rotation"},hip_stability_exercise_name:{0:"band_side_lying_leg_raise",1:"dead_bug",2:"weighted_dead_bug",3:"external_hip_raise",4:"weighted_external_hip_raise",5:"fire_hydrant_kicks",6:"weighted_fire_hydrant_kicks",7:"hip_circles",8:"weighted_hip_circles",9:"inner_thigh_lift",10:"weighted_inner_thigh_lift",11:"lateral_walks_with_band_at_ankles",12:"pretzel_side_kick",13:"weighted_pretzel_side_kick",14:"prone_hip_internal_rotation",15:"weighted_prone_hip_internal_rotation",16:"quadruped",17:"quadruped_hip_extension",18:"weighted_quadruped_hip_extension",19:"quadruped_with_leg_lift",20:"weighted_quadruped_with_leg_lift",21:"side_lying_leg_raise",22:"weighted_side_lying_leg_raise",23:"sliding_hip_adduction",24:"weighted_sliding_hip_adduction",25:"standing_adduction",26:"weighted_standing_adduction",27:"standing_cable_hip_abduction",28:"standing_hip_abduction",29:"weighted_standing_hip_abduction",30:"standing_rear_leg_raise",31:"weighted_standing_rear_leg_raise",32:"supine_hip_internal_rotation",33:"weighted_supine_hip_internal_rotation"},hip_swing_excercise_name:{0:"single_arm_kettlebell_swing",1:"single_arm_dumbbell_swing",2:"step_out_swing"},hyperextension_exercise_name:{0:"back_extension_with_opposite_arm_and_leg_reach",1:"weighted_back_extension_with_opposite_arm_and_leg_reach",2:"base_rotations",3:"weighted_base_rotations",4:"bent_knee_reverse_hyperextension",5:"weighted_bent_knee_reverse_hyperextension",6:"hollow_hold_and_roll",7:"weighted_hollow_hold_and_roll",8:"kicks",9:"weighted_kicks",10:"knee_raises",11:"weighted_knee_raises",12:"kneeling_superman",13:"weighted_kneeling_superman",14:"lat_pull_down_with_row",15:"medicine_ball_deadlift_to_reach",16:"one_arm_one_leg_row",17:"one_arm_row_with_band",18:"overhead_lunge_with_medicine_ball",19:"plank_knee_tucks",20:"weighted_plank_knee_tucks",21:"side_step",22:"weighted_side_step",23:"single_leg_back_extension",24:"weighted_single_leg_back_extension",25:"spine_extension",26:"weighted_spine_extension",27:"static_back_extension",28:"weighted_static_back_extension",29:"superman_from_floor",30:"weighted_superman_from_floor",31:"swiss_ball_back_extension",32:"weighted_swiss_ball_back_extension",33:"swiss_ball_hyperextension",34:"weighted_swiss_ball_hyperextension",35:"swiss_ball_opposite_arm_and_leg_lift",36:"weighted_swiss_ball_opposite_arm_and_leg_lift",37:"superman_on_swiss_ball",38:"cobra",39:"supine_floor_barre"},lateral_raise_exercise_name:{0:"45_degree_cable_external_rotation",1:"alternating_lateral_raise_with_static_hold",2:"bar_muscle_up",3:"bent_over_lateral_raise",4:"cable_diagonal_raise",5:"cable_front_raise",6:"calorie_row",7:"combo_shoulder_raise",8:"dumbbell_diagonal_raise",9:"dumbbell_v_raise",10:"front_raise",11:"leaning_dumbbell_lateral_raise",12:"lying_dumbbell_raise",13:"muscle_up",14:"one_arm_cable_lateral_raise",15:"overhand_grip_rear_lateral_raise",16:"plate_raises",17:"ring_dip",18:"weighted_ring_dip",19:"ring_muscle_up",20:"weighted_ring_muscle_up",21:"rope_climb",22:"weighted_rope_climb",23:"scaption",24:"seated_lateral_raise",25:"seated_rear_lateral_raise",26:"side_lying_lateral_raise",27:"standing_lift",28:"suspended_row",29:"underhand_grip_rear_lateral_raise",30:"wall_slide",31:"weighted_wall_slide",32:"arm_circles",33:"shaving_the_head"},leg_curl_exercise_name:{0:"leg_curl",1:"weighted_leg_curl",2:"good_morning",3:"seated_barbell_good_morning",4:"single_leg_barbell_good_morning",5:"single_leg_sliding_leg_curl",6:"sliding_leg_curl",7:"split_barbell_good_morning",8:"split_stance_extension",9:"staggered_stance_good_morning",10:"swiss_ball_hip_raise_and_leg_curl",11:"zercher_good_morning"},leg_raise_exercise_name:{0:"hanging_knee_raise",1:"hanging_leg_raise",2:"weighted_hanging_leg_raise",3:"hanging_single_leg_raise",4:"weighted_hanging_single_leg_raise",5:"kettlebell_leg_raises",6:"leg_lowering_drill",7:"weighted_leg_lowering_drill",8:"lying_straight_leg_raise",9:"weighted_lying_straight_leg_raise",10:"medicine_ball_leg_drops",11:"quadruped_leg_raise",12:"weighted_quadruped_leg_raise",13:"reverse_leg_raise",14:"weighted_reverse_leg_raise",15:"reverse_leg_raise_on_swiss_ball",16:"weighted_reverse_leg_raise_on_swiss_ball",17:"single_leg_lowering_drill",18:"weighted_single_leg_lowering_drill",19:"weighted_hanging_knee_raise",20:"lateral_stepover",21:"weighted_lateral_stepover"},lunge_exercise_name:{0:"overhead_lunge",1:"lunge_matrix",2:"weighted_lunge_matrix",3:"alternating_barbell_forward_lunge",4:"alternating_dumbbell_lunge_with_reach",5:"back_foot_elevated_dumbbell_split_squat",6:"barbell_box_lunge",7:"barbell_bulgarian_split_squat",8:"barbell_crossover_lunge",9:"barbell_front_split_squat",10:"barbell_lunge",11:"barbell_reverse_lunge",12:"barbell_side_lunge",13:"barbell_split_squat",14:"core_control_rear_lunge",15:"diagonal_lunge",16:"drop_lunge",17:"dumbbell_box_lunge",18:"dumbbell_bulgarian_split_squat",19:"dumbbell_crossover_lunge",20:"dumbbell_diagonal_lunge",21:"dumbbell_lunge",22:"dumbbell_lunge_and_rotation",23:"dumbbell_overhead_bulgarian_split_squat",24:"dumbbell_reverse_lunge_to_high_knee_and_press",25:"dumbbell_side_lunge",26:"elevated_front_foot_barbell_split_squat",27:"front_foot_elevated_dumbbell_split_squat",28:"gunslinger_lunge",29:"lawnmower_lunge",30:"low_lunge_with_isometric_adduction",31:"low_side_to_side_lunge",32:"lunge",33:"weighted_lunge",34:"lunge_with_arm_reach",35:"lunge_with_diagonal_reach",36:"lunge_with_side_bend",37:"offset_dumbbell_lunge",38:"offset_dumbbell_reverse_lunge",39:"overhead_bulgarian_split_squat",40:"overhead_dumbbell_reverse_lunge",41:"overhead_dumbbell_split_squat",42:"overhead_lunge_with_rotation",43:"reverse_barbell_box_lunge",44:"reverse_box_lunge",45:"reverse_dumbbell_box_lunge",46:"reverse_dumbbell_crossover_lunge",47:"reverse_dumbbell_diagonal_lunge",48:"reverse_lunge_with_reach_back",49:"weighted_reverse_lunge_with_reach_back",50:"reverse_lunge_with_twist_and_overhead_reach",51:"weighted_reverse_lunge_with_twist_and_overhead_reach",52:"reverse_sliding_box_lunge",53:"weighted_reverse_sliding_box_lunge",54:"reverse_sliding_lunge",55:"weighted_reverse_sliding_lunge",56:"runners_lunge_to_balance",57:"weighted_runners_lunge_to_balance",58:"shifting_side_lunge",59:"side_and_crossover_lunge",60:"weighted_side_and_crossover_lunge",61:"side_lunge",62:"weighted_side_lunge",63:"side_lunge_and_press",64:"side_lunge_jump_off",65:"side_lunge_sweep",66:"weighted_side_lunge_sweep",67:"side_lunge_to_crossover_tap",68:"weighted_side_lunge_to_crossover_tap",69:"side_to_side_lunge_chops",70:"weighted_side_to_side_lunge_chops",71:"siff_jump_lunge",72:"weighted_siff_jump_lunge",73:"single_arm_reverse_lunge_and_press",74:"sliding_lateral_lunge",75:"weighted_sliding_lateral_lunge",76:"walking_barbell_lunge",77:"walking_dumbbell_lunge",78:"walking_lunge",79:"weighted_walking_lunge",80:"wide_grip_overhead_barbell_split_squat"},olympic_lift_exercise_name:{0:"barbell_hang_power_clean",1:"barbell_hang_squat_clean",2:"barbell_power_clean",3:"barbell_power_snatch",4:"barbell_squat_clean",5:"clean_and_jerk",6:"barbell_hang_power_snatch",7:"barbell_hang_pull",8:"barbell_high_pull",9:"barbell_snatch",10:"barbell_split_jerk",11:"clean",12:"dumbbell_clean",13:"dumbbell_hang_pull",14:"one_hand_dumbbell_split_snatch",15:"push_jerk",16:"single_arm_dumbbell_snatch",17:"single_arm_hang_snatch",18:"single_arm_kettlebell_snatch",19:"split_jerk",20:"squat_clean_and_jerk"},plank_exercise_name:{0:"45_degree_plank",1:"weighted_45_degree_plank",2:"90_degree_static_hold",3:"weighted_90_degree_static_hold",4:"bear_crawl",5:"weighted_bear_crawl",6:"cross_body_mountain_climber",7:"weighted_cross_body_mountain_climber",8:"elbow_plank_pike_jacks",9:"weighted_elbow_plank_pike_jacks",10:"elevated_feet_plank",11:"weighted_elevated_feet_plank",12:"elevator_abs",13:"weighted_elevator_abs",14:"extended_plank",15:"weighted_extended_plank",16:"full_plank_passe_twist",17:"weighted_full_plank_passe_twist",18:"inching_elbow_plank",19:"weighted_inching_elbow_plank",20:"inchworm_to_side_plank",21:"weighted_inchworm_to_side_plank",22:"kneeling_plank",23:"weighted_kneeling_plank",24:"kneeling_side_plank_with_leg_lift",25:"weighted_kneeling_side_plank_with_leg_lift",26:"lateral_roll",27:"weighted_lateral_roll",28:"lying_reverse_plank",29:"weighted_lying_reverse_plank",30:"medicine_ball_mountain_climber",31:"weighted_medicine_ball_mountain_climber",32:"modified_mountain_climber_and_extension",33:"weighted_modified_mountain_climber_and_extension",34:"mountain_climber",35:"weighted_mountain_climber",36:"mountain_climber_on_sliding_discs",37:"weighted_mountain_climber_on_sliding_discs",38:"mountain_climber_with_feet_on_bosu_ball",39:"weighted_mountain_climber_with_feet_on_bosu_ball",40:"mountain_climber_with_hands_on_bench",41:"mountain_climber_with_hands_on_swiss_ball",42:"weighted_mountain_climber_with_hands_on_swiss_ball",43:"plank",44:"plank_jacks_with_feet_on_sliding_discs",45:"weighted_plank_jacks_with_feet_on_sliding_discs",46:"plank_knee_twist",47:"weighted_plank_knee_twist",48:"plank_pike_jumps",49:"weighted_plank_pike_jumps",50:"plank_pikes",51:"weighted_plank_pikes",52:"plank_to_stand_up",53:"weighted_plank_to_stand_up",54:"plank_with_arm_raise",55:"weighted_plank_with_arm_raise",56:"plank_with_knee_to_elbow",57:"weighted_plank_with_knee_to_elbow",58:"plank_with_oblique_crunch",59:"weighted_plank_with_oblique_crunch",60:"plyometric_side_plank",61:"weighted_plyometric_side_plank",62:"rolling_side_plank",63:"weighted_rolling_side_plank",64:"side_kick_plank",65:"weighted_side_kick_plank",66:"side_plank",67:"weighted_side_plank",68:"side_plank_and_row",69:"weighted_side_plank_and_row",70:"side_plank_lift",71:"weighted_side_plank_lift",72:"side_plank_with_elbow_on_bosu_ball",73:"weighted_side_plank_with_elbow_on_bosu_ball",74:"side_plank_with_feet_on_bench",75:"weighted_side_plank_with_feet_on_bench",76:"side_plank_with_knee_circle",77:"weighted_side_plank_with_knee_circle",78:"side_plank_with_knee_tuck",79:"weighted_side_plank_with_knee_tuck",80:"side_plank_with_leg_lift",81:"weighted_side_plank_with_leg_lift",82:"side_plank_with_reach_under",83:"weighted_side_plank_with_reach_under",84:"single_leg_elevated_feet_plank",85:"weighted_single_leg_elevated_feet_plank",86:"single_leg_flex_and_extend",87:"weighted_single_leg_flex_and_extend",88:"single_leg_side_plank",89:"weighted_single_leg_side_plank",90:"spiderman_plank",91:"weighted_spiderman_plank",92:"straight_arm_plank",93:"weighted_straight_arm_plank",94:"straight_arm_plank_with_shoulder_touch",95:"weighted_straight_arm_plank_with_shoulder_touch",96:"swiss_ball_plank",97:"weighted_swiss_ball_plank",98:"swiss_ball_plank_leg_lift",99:"weighted_swiss_ball_plank_leg_lift",100:"swiss_ball_plank_leg_lift_and_hold",101:"swiss_ball_plank_with_feet_on_bench",102:"weighted_swiss_ball_plank_with_feet_on_bench",103:"swiss_ball_prone_jackknife",104:"weighted_swiss_ball_prone_jackknife",105:"swiss_ball_side_plank",106:"weighted_swiss_ball_side_plank",107:"three_way_plank",108:"weighted_three_way_plank",109:"towel_plank_and_knee_in",110:"weighted_towel_plank_and_knee_in",111:"t_stabilization",112:"weighted_t_stabilization",113:"turkish_get_up_to_side_plank",114:"weighted_turkish_get_up_to_side_plank",115:"two_point_plank",116:"weighted_two_point_plank",117:"weighted_plank",118:"wide_stance_plank_with_diagonal_arm_lift",119:"weighted_wide_stance_plank_with_diagonal_arm_lift",120:"wide_stance_plank_with_diagonal_leg_lift",121:"weighted_wide_stance_plank_with_diagonal_leg_lift",122:"wide_stance_plank_with_leg_lift",123:"weighted_wide_stance_plank_with_leg_lift",124:"wide_stance_plank_with_opposite_arm_and_leg_lift",125:"weighted_mountain_climber_with_hands_on_bench",126:"weighted_swiss_ball_plank_leg_lift_and_hold",127:"weighted_wide_stance_plank_with_opposite_arm_and_leg_lift",128:"plank_with_feet_on_swiss_ball",129:"side_plank_to_plank_with_reach_under",130:"bridge_with_glute_lower_lift",131:"bridge_one_leg_bridge",132:"plank_with_arm_variations",133:"plank_with_leg_lift",134:"reverse_plank_with_leg_pull"},plyo_exercise_name:{0:"alternating_jump_lunge",1:"weighted_alternating_jump_lunge",2:"barbell_jump_squat",3:"body_weight_jump_squat",4:"weighted_jump_squat",5:"cross_knee_strike",6:"weighted_cross_knee_strike",7:"depth_jump",8:"weighted_depth_jump",9:"dumbbell_jump_squat",10:"dumbbell_split_jump",11:"front_knee_strike",12:"weighted_front_knee_strike",13:"high_box_jump",14:"weighted_high_box_jump",15:"isometric_explosive_body_weight_jump_squat",16:"weighted_isometric_explosive_jump_squat",17:"lateral_leap_and_hop",18:"weighted_lateral_leap_and_hop",19:"lateral_plyo_squats",20:"weighted_lateral_plyo_squats",21:"lateral_slide",22:"weighted_lateral_slide",23:"medicine_ball_overhead_throws",24:"medicine_ball_side_throw",25:"medicine_ball_slam",26:"side_to_side_medicine_ball_throws",27:"side_to_side_shuffle_jump",28:"weighted_side_to_side_shuffle_jump",29:"squat_jump_onto_box",30:"weighted_squat_jump_onto_box",31:"squat_jumps_in_and_out",32:"weighted_squat_jumps_in_and_out"},pull_up_exercise_name:{0:"banded_pull_ups",1:"30_degree_lat_pulldown",2:"band_assisted_chin_up",3:"close_grip_chin_up",4:"weighted_close_grip_chin_up",5:"close_grip_lat_pulldown",6:"crossover_chin_up",7:"weighted_crossover_chin_up",8:"ez_bar_pullover",9:"hanging_hurdle",10:"weighted_hanging_hurdle",11:"kneeling_lat_pulldown",12:"kneeling_underhand_grip_lat_pulldown",13:"lat_pulldown",14:"mixed_grip_chin_up",15:"weighted_mixed_grip_chin_up",16:"mixed_grip_pull_up",17:"weighted_mixed_grip_pull_up",18:"reverse_grip_pulldown",19:"standing_cable_pullover",20:"straight_arm_pulldown",21:"swiss_ball_ez_bar_pullover",22:"towel_pull_up",23:"weighted_towel_pull_up",24:"weighted_pull_up",25:"wide_grip_lat_pulldown",26:"wide_grip_pull_up",27:"weighted_wide_grip_pull_up",28:"burpee_pull_up",29:"weighted_burpee_pull_up",30:"jumping_pull_ups",31:"weighted_jumping_pull_ups",32:"kipping_pull_up",33:"weighted_kipping_pull_up",34:"l_pull_up",35:"weighted_l_pull_up",36:"suspended_chin_up",37:"weighted_suspended_chin_up",38:"pull_up"},push_up_exercise_name:{0:"chest_press_with_band",1:"alternating_staggered_push_up",2:"weighted_alternating_staggered_push_up",3:"alternating_hands_medicine_ball_push_up",4:"weighted_alternating_hands_medicine_ball_push_up",5:"bosu_ball_push_up",6:"weighted_bosu_ball_push_up",7:"clapping_push_up",8:"weighted_clapping_push_up",9:"close_grip_medicine_ball_push_up",10:"weighted_close_grip_medicine_ball_push_up",11:"close_hands_push_up",12:"weighted_close_hands_push_up",13:"decline_push_up",14:"weighted_decline_push_up",15:"diamond_push_up",16:"weighted_diamond_push_up",17:"explosive_crossover_push_up",18:"weighted_explosive_crossover_push_up",19:"explosive_push_up",20:"weighted_explosive_push_up",21:"feet_elevated_side_to_side_push_up",22:"weighted_feet_elevated_side_to_side_push_up",23:"hand_release_push_up",24:"weighted_hand_release_push_up",25:"handstand_push_up",26:"weighted_handstand_push_up",27:"incline_push_up",28:"weighted_incline_push_up",29:"isometric_explosive_push_up",30:"weighted_isometric_explosive_push_up",31:"judo_push_up",32:"weighted_judo_push_up",33:"kneeling_push_up",34:"weighted_kneeling_push_up",35:"medicine_ball_chest_pass",36:"medicine_ball_push_up",37:"weighted_medicine_ball_push_up",38:"one_arm_push_up",39:"weighted_one_arm_push_up",40:"weighted_push_up",41:"push_up_and_row",42:"weighted_push_up_and_row",43:"push_up_plus",44:"weighted_push_up_plus",45:"push_up_with_feet_on_swiss_ball",46:"weighted_push_up_with_feet_on_swiss_ball",47:"push_up_with_one_hand_on_medicine_ball",48:"weighted_push_up_with_one_hand_on_medicine_ball",49:"shoulder_push_up",50:"weighted_shoulder_push_up",51:"single_arm_medicine_ball_push_up",52:"weighted_single_arm_medicine_ball_push_up",53:"spiderman_push_up",54:"weighted_spiderman_push_up",55:"stacked_feet_push_up",56:"weighted_stacked_feet_push_up",57:"staggered_hands_push_up",58:"weighted_staggered_hands_push_up",59:"suspended_push_up",60:"weighted_suspended_push_up",61:"swiss_ball_push_up",62:"weighted_swiss_ball_push_up",63:"swiss_ball_push_up_plus",64:"weighted_swiss_ball_push_up_plus",65:"t_push_up",66:"weighted_t_push_up",67:"triple_stop_push_up",68:"weighted_triple_stop_push_up",69:"wide_hands_push_up",70:"weighted_wide_hands_push_up",71:"parallette_handstand_push_up",72:"weighted_parallette_handstand_push_up",73:"ring_handstand_push_up",74:"weighted_ring_handstand_push_up",75:"ring_push_up",76:"weighted_ring_push_up",77:"push_up",78:"pilates_pushup"},row_exercise_name:{0:"barbell_straight_leg_deadlift_to_row",1:"cable_row_standing",2:"dumbbell_row",3:"elevated_feet_inverted_row",4:"weighted_elevated_feet_inverted_row",5:"face_pull",6:"face_pull_with_external_rotation",7:"inverted_row_with_feet_on_swiss_ball",8:"weighted_inverted_row_with_feet_on_swiss_ball",9:"kettlebell_row",10:"modified_inverted_row",11:"weighted_modified_inverted_row",12:"neutral_grip_alternating_dumbbell_row",13:"one_arm_bent_over_row",14:"one_legged_dumbbell_row",15:"renegade_row",16:"reverse_grip_barbell_row",17:"rope_handle_cable_row",18:"seated_cable_row",19:"seated_dumbbell_row",20:"single_arm_cable_row",21:"single_arm_cable_row_and_rotation",22:"single_arm_inverted_row",23:"weighted_single_arm_inverted_row",24:"single_arm_neutral_grip_dumbbell_row",25:"single_arm_neutral_grip_dumbbell_row_and_rotation",26:"suspended_inverted_row",27:"weighted_suspended_inverted_row",28:"t_bar_row",29:"towel_grip_inverted_row",30:"weighted_towel_grip_inverted_row",31:"underhand_grip_cable_row",32:"v_grip_cable_row",33:"wide_grip_seated_cable_row"},shoulder_press_exercise_name:{0:"alternating_dumbbell_shoulder_press",1:"arnold_press",2:"barbell_front_squat_to_push_press",3:"barbell_push_press",4:"barbell_shoulder_press",5:"dead_curl_press",6:"dumbbell_alternating_shoulder_press_and_twist",7:"dumbbell_hammer_curl_to_lunge_to_press",8:"dumbbell_push_press",9:"floor_inverted_shoulder_press",10:"weighted_floor_inverted_shoulder_press",11:"inverted_shoulder_press",12:"weighted_inverted_shoulder_press",13:"one_arm_push_press",14:"overhead_barbell_press",15:"overhead_dumbbell_press",16:"seated_barbell_shoulder_press",17:"seated_dumbbell_shoulder_press",18:"single_arm_dumbbell_shoulder_press",19:"single_arm_step_up_and_press",20:"smith_machine_overhead_press",21:"split_stance_hammer_curl_to_press",22:"swiss_ball_dumbbell_shoulder_press",23:"weight_plate_front_raise"},shoulder_stability_exercise_name:{0:"90_degree_cable_external_rotation",1:"band_external_rotation",2:"band_internal_rotation",3:"bent_arm_lateral_raise_and_external_rotation",4:"cable_external_rotation",5:"dumbbell_face_pull_with_external_rotation",6:"floor_i_raise",7:"weighted_floor_i_raise",8:"floor_t_raise",9:"weighted_floor_t_raise",10:"floor_y_raise",11:"weighted_floor_y_raise",12:"incline_i_raise",13:"weighted_incline_i_raise",14:"incline_l_raise",15:"weighted_incline_l_raise",16:"incline_t_raise",17:"weighted_incline_t_raise",18:"incline_w_raise",19:"weighted_incline_w_raise",20:"incline_y_raise",21:"weighted_incline_y_raise",22:"lying_external_rotation",23:"seated_dumbbell_external_rotation",24:"standing_l_raise",25:"swiss_ball_i_raise",26:"weighted_swiss_ball_i_raise",27:"swiss_ball_t_raise",28:"weighted_swiss_ball_t_raise",29:"swiss_ball_w_raise",30:"weighted_swiss_ball_w_raise",31:"swiss_ball_y_raise",32:"weighted_swiss_ball_y_raise"},shrug_exercise_name:{0:"barbell_jump_shrug",1:"barbell_shrug",2:"barbell_upright_row",3:"behind_the_back_smith_machine_shrug",4:"dumbbell_jump_shrug",5:"dumbbell_shrug",6:"dumbbell_upright_row",7:"incline_dumbbell_shrug",8:"overhead_barbell_shrug",9:"overhead_dumbbell_shrug",10:"scaption_and_shrug",11:"scapular_retraction",12:"serratus_chair_shrug",13:"weighted_serratus_chair_shrug",14:"serratus_shrug",15:"weighted_serratus_shrug",16:"wide_grip_jump_shrug"},sit_up_exercise_name:{0:"alternating_sit_up",1:"weighted_alternating_sit_up",2:"bent_knee_v_up",3:"weighted_bent_knee_v_up",4:"butterfly_sit_up",5:"weighted_butterfly_situp",6:"cross_punch_roll_up",7:"weighted_cross_punch_roll_up",8:"crossed_arms_sit_up",9:"weighted_crossed_arms_sit_up",10:"get_up_sit_up",11:"weighted_get_up_sit_up",12:"hovering_sit_up",13:"weighted_hovering_sit_up",14:"kettlebell_sit_up",15:"medicine_ball_alternating_v_up",16:"medicine_ball_sit_up",17:"medicine_ball_v_up",18:"modified_sit_up",19:"negative_sit_up",20:"one_arm_full_sit_up",21:"reclining_circle",22:"weighted_reclining_circle",23:"reverse_curl_up",24:"weighted_reverse_curl_up",25:"single_leg_swiss_ball_jackknife",26:"weighted_single_leg_swiss_ball_jackknife",27:"the_teaser",28:"the_teaser_weighted",29:"three_part_roll_down",30:"weighted_three_part_roll_down",31:"v_up",32:"weighted_v_up",33:"weighted_russian_twist_on_swiss_ball",34:"weighted_sit_up",35:"x_abs",36:"weighted_x_abs",37:"sit_up"},squat_exercise_name:{0:"leg_press",1:"back_squat_with_body_bar",2:"back_squats",3:"weighted_back_squats",4:"balancing_squat",5:"weighted_balancing_squat",6:"barbell_back_squat",7:"barbell_box_squat",8:"barbell_front_squat",9:"barbell_hack_squat",10:"barbell_hang_squat_snatch",11:"barbell_lateral_step_up",12:"barbell_quarter_squat",13:"barbell_siff_squat",14:"barbell_squat_snatch",15:"barbell_squat_with_heels_raised",16:"barbell_stepover",17:"barbell_step_up",18:"bench_squat_with_rotational_chop",19:"weighted_bench_squat_with_rotational_chop",20:"body_weight_wall_squat",21:"weighted_wall_squat",22:"box_step_squat",23:"weighted_box_step_squat",24:"braced_squat",25:"crossed_arm_barbell_front_squat",26:"crossover_dumbbell_step_up",27:"dumbbell_front_squat",28:"dumbbell_split_squat",29:"dumbbell_squat",30:"dumbbell_squat_clean",31:"dumbbell_stepover",32:"dumbbell_step_up",33:"elevated_single_leg_squat",34:"weighted_elevated_single_leg_squat",35:"figure_four_squats",36:"weighted_figure_four_squats",37:"goblet_squat",38:"kettlebell_squat",39:"kettlebell_swing_overhead",40:"kettlebell_swing_with_flip_to_squat",41:"lateral_dumbbell_step_up",42:"one_legged_squat",43:"overhead_dumbbell_squat",44:"overhead_squat",45:"partial_single_leg_squat",46:"weighted_partial_single_leg_squat",47:"pistol_squat",48:"weighted_pistol_squat",49:"plie_slides",50:"weighted_plie_slides",51:"plie_squat",52:"weighted_plie_squat",53:"prisoner_squat",54:"weighted_prisoner_squat",55:"single_leg_bench_get_up",56:"weighted_single_leg_bench_get_up",57:"single_leg_bench_squat",58:"weighted_single_leg_bench_squat",59:"single_leg_squat_on_swiss_ball",60:"weighted_single_leg_squat_on_swiss_ball",61:"squat",62:"weighted_squat",63:"squats_with_band",64:"staggered_squat",65:"weighted_staggered_squat",66:"step_up",67:"weighted_step_up",68:"suitcase_squats",69:"sumo_squat",70:"sumo_squat_slide_in",71:"weighted_sumo_squat_slide_in",72:"sumo_squat_to_high_pull",73:"sumo_squat_to_stand",74:"weighted_sumo_squat_to_stand",75:"sumo_squat_with_rotation",76:"weighted_sumo_squat_with_rotation",77:"swiss_ball_body_weight_wall_squat",78:"weighted_swiss_ball_wall_squat",79:"thrusters",80:"uneven_squat",81:"weighted_uneven_squat",82:"waist_slimming_squat",83:"wall_ball",84:"wide_stance_barbell_squat",85:"wide_stance_goblet_squat",86:"zercher_squat",87:"kbs_overhead",88:"squat_and_side_kick",89:"squat_jumps_in_n_out",90:"pilates_plie_squats_parallel_turned_out_flat_and_heels",91:"releve_straight_leg_and_knee_bent_with_one_leg_variation"},total_body_exercise_name:{0:"burpee",1:"weighted_burpee",2:"burpee_box_jump",3:"weighted_burpee_box_jump",4:"high_pull_burpee",5:"man_makers",6:"one_arm_burpee",7:"squat_thrusts",8:"weighted_squat_thrusts",9:"squat_plank_push_up",10:"weighted_squat_plank_push_up",11:"standing_t_rotation_balance",12:"weighted_standing_t_rotation_balance"},triceps_extension_exercise_name:{0:"bench_dip",1:"weighted_bench_dip",2:"body_weight_dip",3:"cable_kickback",4:"cable_lying_triceps_extension",5:"cable_overhead_triceps_extension",6:"dumbbell_kickback",7:"dumbbell_lying_triceps_extension",8:"ez_bar_overhead_triceps_extension",9:"incline_dip",10:"weighted_incline_dip",11:"incline_ez_bar_lying_triceps_extension",12:"lying_dumbbell_pullover_to_extension",13:"lying_ez_bar_triceps_extension",14:"lying_triceps_extension_to_close_grip_bench_press",15:"overhead_dumbbell_triceps_extension",16:"reclining_triceps_press",17:"reverse_grip_pressdown",18:"reverse_grip_triceps_pressdown",19:"rope_pressdown",20:"seated_barbell_overhead_triceps_extension",21:"seated_dumbbell_overhead_triceps_extension",22:"seated_ez_bar_overhead_triceps_extension",23:"seated_single_arm_overhead_dumbbell_extension",24:"single_arm_dumbbell_overhead_triceps_extension",25:"single_dumbbell_seated_overhead_triceps_extension",26:"single_leg_bench_dip_and_kick",27:"weighted_single_leg_bench_dip_and_kick",28:"single_leg_dip",29:"weighted_single_leg_dip",30:"static_lying_triceps_extension",31:"suspended_dip",32:"weighted_suspended_dip",33:"swiss_ball_dumbbell_lying_triceps_extension",34:"swiss_ball_ez_bar_lying_triceps_extension",35:"swiss_ball_ez_bar_overhead_triceps_extension",36:"tabletop_dip",37:"weighted_tabletop_dip",38:"triceps_extension_on_floor",39:"triceps_pressdown",40:"weighted_dip"},warm_up_exercise_name:{0:"quadruped_rocking",1:"neck_tilts",2:"ankle_circles",3:"ankle_dorsiflexion_with_band",4:"ankle_internal_rotation",5:"arm_circles",6:"bent_over_reach_to_sky",7:"cat_camel",8:"elbow_to_foot_lunge",9:"forward_and_backward_leg_swings",10:"groiners",11:"inverted_hamstring_stretch",12:"lateral_duck_under",13:"neck_rotations",14:"opposite_arm_and_leg_balance",15:"reach_roll_and_lift",16:"scorpion",17:"shoulder_circles",18:"side_to_side_leg_swings",19:"sleeper_stretch",20:"slide_out",21:"swiss_ball_hip_crossover",22:"swiss_ball_reach_roll_and_lift",23:"swiss_ball_windshield_wipers",24:"thoracic_rotation",25:"walking_high_kicks",26:"walking_high_knees",27:"walking_knee_hugs",28:"walking_leg_cradles",29:"walkout",30:"walkout_from_push_up_position"},run_exercise_name:{0:"run",1:"walk",2:"jog",3:"sprint"},water_type:{0:"fresh",1:"salt",2:"en13319",3:"custom"},tissue_model_type:{0:"zhl_16c"},dive_gas_status:{0:"disabled",1:"enabled",2:"backup_only"},dive_alarm_type:{0:"depth",1:"time"},dive_backlight_mode:{0:"at_depth",1:"always_on"},favero_product:{10:"assioma_uno",12:"assioma_duo"}}};function Jt(i,e){let t=w.messages[e];return t?t[i]||{}:{}}function Xt(i){let e=w.messages[i];return e?e.name:""}function me(i){return{name:Xt(i),getAttributes:e=>Jt(e,i)}}var Kt=96,Ke=128,ye=6310656e5,ee=0;function tt(i,e){let t=0;i||e.reverse();for(let n=0;n>>0;return t}function Zt(i,e,t,n){if(e.type==="uint8_array"){let s=[];for(let _=0;_127?s-256:s}return i[t]}function Ze(i,e,t,n){switch(e){case"date_time":case"local_date_time":return new Date(i*1e3+ye);case"sint32":return i*w.scConst;case"uint8":case"sint16":case"uint32":case"uint16":return t?i/t+n:i;case"uint32_array":case"uint16_array":case"uint8_array":if(Array.isArray(i)){let s=e.replace("_array","");return i.map(_=>it(_,s)?null:t?_/t+n:_)}return t?i/t+n:i;default:{if(!w.types[e])return i;let s=[];for(let l in w.types[e])l in w.types[e]&&s.push(String(w.types[e][l]));if(!s.includes("mask")){let r=w.types[e][String(i)];return r===void 0?i:r}let _={};for(let l in w.types[e])l in w.types[e]&&(w.types[e][l]==="mask"?_.value=i&Number(l):_[w.types[e][l]]=!!((i&Number(l))>>7));return _}}}function it(i,e){switch(e){case"enum":return i===255;case"sint8":return i===127;case"uint8":return i===255;case"sint16":return i===32767;case"uint16":return i===65535;case"sint32":return i===2147483647;case"uint32":return i===4294967295;case"string":return i===0;case"float32":return i===4294967295;case"float64":return i===18446744073709552e3;case"uint8z":return i===0;case"uint16z":return i===0;case"uint32z":return i===0;case"byte":return i===255;case"sint64":return i===9223372036854776e3;case"uint64":return i===18446744073709552e3;case"uint64z":return i===0;default:return!1}}function te(i,e,t){let s=w.options[e][t];return s?i*s.multiplier+s.offset:i}function Qe(i,e,t,n){switch(e){case"device_type":{let s=n.source_type==="local"||n.source_type===5,_=n.source_type==="bluetooth_low_energy"||n.source_type===3||n.source_type==="bluetooth"||n.source_type===2,l=n.source_type==="antplus"||n.source_type===1||n.source_type==="ant"||n.source_type===0;return s?w.types.local_device_type[i]||i:_?w.types.ble_device_type[i]||i:l&&w.types.antplus_device_type[i]||i}case"speed":case"enhanced_speed":case"vertical_speed":case"avg_speed":case"max_speed":case"speed_1s":case"ball_speed":case"enhanced_avg_speed":case"enhanced_max_speed":case"avg_pos_vertical_speed":case"max_pos_vertical_speed":case"avg_neg_vertical_speed":case"max_neg_vertical_speed":return te(i,"speedUnits",t.speedUnit);case"distance":case"total_distance":case"enhanced_avg_altitude":case"enhanced_min_altitude":case"enhanced_max_altitude":case"enhanced_altitude":case"height":case"odometer":case"avg_stroke_distance":case"min_altitude":case"avg_altitude":case"max_altitude":case"total_ascent":case"total_descent":case"altitude":case"cycle_length":case"auto_wheelsize":case"custom_wheelsize":case"gps_accuracy":return te(i,"lengthUnits",t.lengthUnit);case"temperature":case"avg_temperature":case"max_temperature":return te(i,"temperatureUnits",t.temperatureUnit);case"pressure":case"start_pressure":case"end_pressure":return te(i,"pressureUnits",t.pressureUnit);case"ant_id":{let s=i>>>28&15,_=i>>>24&15,l=i>>>16&255,r=i&65535;return`${s.toString(16).toUpperCase()}-${_.toString(16).toUpperCase()}-${l.toString(16).toUpperCase().padStart(2,"0")}-${r.toString(16).toUpperCase().padStart(4,"0")}`}default:return i}}function nt(i,e,t,n,s,_,l){let r=i[n],o=r&15;if((r&Ke)===Ke)o=(r&Kt)>>5;else if((r&64)===64){let h=(r&32)===32,y=i[n+2]===0,m=i[n+5],I=h?i[n+5+m*3+1]:0,F={littleEndian:y,globalMessageNumber:tt(y,[i[n+3],i[n+4]]),numberOfFields:m+I,fieldDefs:[]},U=me(F.globalMessageNumber);for(let E=0;E>4&4095,s=s^r^n[l&15],r=n[s&15],s=s>>4&4095,s=s^r^n[l>>4&15]}return s}function be(i,e,t){let n=[...i],s=0;for(let _=0;_c)r.push(u);else if(o<=c){s=d;break}}else r.push(u)}n[_][e]||(n[_][e]=r)}return n}function _t(i,e){let t=[...i],n=0;for(let s=0;su)l.push(d);else if(r<=u){n=o;break}}else l.push(d)}t[s].laps||(t[s].laps=l)}return t}var J=class{constructor(e={}){this.options={force:e.force!=null?e.force:!0,speedUnit:e.speedUnit||"m/s",lengthUnit:e.lengthUnit||"m",temperatureUnit:e.temperatureUnit||"celsius",elapsedRecordField:e.elapsedRecordField||!1,pressureUnit:e.pressureUnit||"bar",mode:e.mode||"list"}}parseAsync(e){return new Promise((t,n)=>{this.parse(e,(s,_)=>{s?n(s):_&&t(_)})})}parse(e,t){var n;let s=new Uint8Array(st(e));if(s.length<12&&(t("File to small to be a FIT file",void 0),!this.options.force))return;let _=s[0];if(_!==14&&_!==12&&(t("Incorrect header size",void 0),!this.options.force))return;let l="";for(let L=8;L<12;L++)l+=String.fromCharCode(s[L]);if(l!==".FIT"&&(t("Missing '.FIT' in header",void 0),!this.options.force))return;if(_===14){let L=s[12]+(s[13]<<8),W=we(s,0,12);if(L!==W&&!this.options.force)return}let r=s[1],o=s[2]+(s[3]<<8),u=s[4]+(s[5]<<8)+(s[6]<<16)+(s[7]<<24)+_,c=s[u]+(s[u+1]<<8),g=we(s,_===12?0:_,u);if(c!==g&&!this.options.force)return;let f={profileVersion:o,protocolVersion:r},x=[],h=[],y=[],m=[],I=[],F=[],U=[],O=[],G=[],E=[],v=[],A=[],R=[],S=[],j=[],D=[],X=[],ke=[],ie=[],xe=[],ve=[],Fe=[],Be=[],Ee=[],ne=_,lt=[],at=[],ze=this.options.mode==="cascade",rt=ze||this.options.mode==="both",se,_e,qe=0;for(;ne *) + +buffer/index.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) +*/ +//# sourceMappingURL=fit-file-parser.mjs.map diff --git a/suites-experimental/tools-gps-tracks-angular/dist/fit-file-parser.mjs.map b/suites-experimental/tools-gps-tracks-angular/dist/fit-file-parser.mjs.map new file mode 100644 index 000000000..6f402eab4 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/fit-file-parser.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../node_modules/base64-js/index.js", "../node_modules/ieee754/index.js", "../node_modules/buffer/index.js", "../node_modules/fit-file-parser/dist/binary.js", "../node_modules/fit-file-parser/dist/fit.js", "../node_modules/fit-file-parser/dist/messages.js", "../node_modules/fit-file-parser/dist/helper.js", "../node_modules/fit-file-parser/dist/fit-parser.js", "../src/vendor-fit.ts"], + "sourcesContent": ["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n", "/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n", "/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n", "import { Buffer } from 'buffer';\nimport { FIT } from './fit.js';\nimport { getFitMessage, getFitMessageBaseType } from './messages.js';\nconst CompressedLocalMsgNumMask = 0x60;\nconst CompressedHeaderMask = 0x80;\nconst GarminTimeOffset = 631065600000;\nlet monitoring_timestamp = 0;\nexport function addEndian(littleEndian, bytes) {\n let result = 0;\n if (!littleEndian)\n bytes.reverse();\n for (let i = 0; i < bytes.length; i++) {\n result += (bytes[i] << (i << 3)) >>> 0;\n }\n return result;\n}\nfunction readData(blob, fDef, startIndex, options) {\n if (fDef.type === 'uint8_array') {\n const array8 = [];\n for (let i = 0; i < fDef.size; i++) {\n array8.push(blob[startIndex + i]);\n }\n return array8;\n }\n if (fDef.endianAbility) {\n const temp = [];\n for (let i = 0; i < fDef.size; i++) {\n temp.push(blob[startIndex + i]);\n }\n const { buffer } = new Uint8Array(temp);\n const dataView = new DataView(buffer);\n try {\n switch (fDef.type) {\n case 'sint16':\n return dataView.getInt16(0, fDef.littleEndian);\n case 'uint16':\n case 'uint16z':\n return dataView.getUint16(0, fDef.littleEndian);\n case 'sint32':\n return dataView.getInt32(0, fDef.littleEndian);\n case 'uint32':\n case 'uint32z':\n return dataView.getUint32(0, fDef.littleEndian);\n case 'float32':\n return dataView.getFloat32(0, fDef.littleEndian);\n case 'float64':\n return dataView.getFloat64(0, fDef.littleEndian);\n case 'uint32_array': {\n const array32 = [];\n for (let i = 0; i < fDef.size; i += 4) {\n array32.push(dataView.getUint32(i, fDef.littleEndian));\n }\n return array32;\n }\n case 'uint16_array': {\n const array16 = [];\n for (let i = 0; i < fDef.size; i += 2) {\n array16.push(dataView.getUint16(i, fDef.littleEndian));\n }\n return array16;\n }\n }\n }\n catch (e) {\n if (!options.force) {\n throw e;\n }\n }\n return addEndian(fDef.littleEndian, temp);\n }\n if (fDef.type === 'string') {\n const temp = [];\n for (let i = 0; i < fDef.size; i++) {\n if (blob[startIndex + i]) {\n temp.push(blob[startIndex + i]);\n }\n }\n return Buffer.from(temp).toString('utf-8');\n }\n if (fDef.type === 'byte_array') {\n const temp = [];\n for (let i = 0; i < fDef.size; i++) {\n temp.push(blob[startIndex + i]);\n }\n return temp;\n }\n if (fDef.type === 'sint8') {\n const val = blob[startIndex];\n return val > 127 ? val - 256 : val;\n }\n return blob[startIndex];\n}\nfunction formatByType(data, type, scale, offset) {\n switch (type) {\n case 'date_time':\n case 'local_date_time':\n return new Date(data * 1000 + GarminTimeOffset);\n case 'sint32':\n return data * FIT.scConst;\n case 'uint8':\n case 'sint16':\n case 'uint32':\n case 'uint16':\n return scale ? data / scale + offset : data;\n case 'uint32_array':\n case 'uint16_array':\n case 'uint8_array':\n if (Array.isArray(data)) {\n const baseType = type.replace('_array', '');\n return data.map((dataItem) => {\n if (isInvalidValue(dataItem, baseType)) {\n return null;\n }\n return scale ? dataItem / scale + offset : dataItem;\n });\n }\n return scale ? data / scale + offset : data;\n default:\n {\n if (!FIT.types[type]) {\n return data;\n }\n // Quick check for a mask\n const values = [];\n for (const key in FIT.types[type]) {\n if (key in FIT.types[type]) {\n values.push(String(FIT.types[type][key]));\n }\n }\n if (!values.includes('mask')) {\n const typeMap = FIT.types[type];\n const mapped = typeMap[String(data)];\n return mapped === undefined ? data : mapped;\n }\n const dataItem = {};\n for (const key in FIT.types[type]) {\n if (key in FIT.types[type]) {\n if (FIT.types[type][key] === 'mask') {\n dataItem.value = data & Number(key);\n }\n else {\n dataItem[FIT.types[type][key]] = !!((data & Number(key)) >> 7); // Not sure if we need the >> 7 and casting to boolean but from all the masked props of fields so far this seems to be the case\n }\n }\n }\n return dataItem;\n }\n }\n}\nfunction isInvalidValue(data, type) {\n switch (type) {\n case 'enum':\n return data === 0xFF;\n case 'sint8':\n return data === 0x7F;\n case 'uint8':\n return data === 0xFF;\n case 'sint16':\n return data === 0x7FFF;\n case 'uint16':\n return data === 0xFFFF;\n case 'sint32':\n return data === 0x7FFFFFFF;\n case 'uint32':\n return data === 0xFFFFFFFF;\n case 'string':\n return data === 0x00;\n case 'float32':\n return data === 0xFFFFFFFF;\n case 'float64':\n // eslint-disable-next-line no-loss-of-precision\n return data === 0xFFFFFFFFFFFFFFFF;\n case 'uint8z':\n return data === 0x00;\n case 'uint16z':\n return data === 0x0000;\n case 'uint32z':\n return data === 0x000000;\n case 'byte':\n return data === 0xFF;\n case 'sint64':\n // eslint-disable-next-line no-loss-of-precision\n return data === 0x7FFFFFFFFFFFFFFF;\n case 'uint64':\n // eslint-disable-next-line no-loss-of-precision\n return data === 0xFFFFFFFFFFFFFFFF;\n case 'uint64z':\n return data === 0x0000000000000000;\n default:\n return false;\n }\n}\nfunction convertTo(data, unitsList, unitName) {\n const options = FIT.options[unitsList];\n const unit = options[unitName];\n return unit ? data * unit.multiplier + unit.offset : data;\n}\nfunction applyOptions(data, field, options, fields) {\n switch (field) {\n case 'device_type': {\n const isLocal = fields.source_type === 'local' || fields.source_type === 5;\n const isBLE = fields.source_type === 'bluetooth_low_energy' || fields.source_type === 3 || fields.source_type === 'bluetooth' || fields.source_type === 2;\n const isANT = fields.source_type === 'antplus' || fields.source_type === 1 || fields.source_type === 'ant' || fields.source_type === 0;\n if (isLocal) {\n return FIT.types.local_device_type[data] || data;\n }\n if (isBLE) {\n return FIT.types.ble_device_type[data] || data;\n }\n if (isANT) {\n return FIT.types.antplus_device_type[data] || data;\n }\n return data;\n }\n case 'speed':\n case 'enhanced_speed':\n case 'vertical_speed':\n case 'avg_speed':\n case 'max_speed':\n case 'speed_1s':\n case 'ball_speed':\n case 'enhanced_avg_speed':\n case 'enhanced_max_speed':\n case 'avg_pos_vertical_speed':\n case 'max_pos_vertical_speed':\n case 'avg_neg_vertical_speed':\n case 'max_neg_vertical_speed':\n return convertTo(data, 'speedUnits', options.speedUnit);\n case 'distance':\n case 'total_distance':\n case 'enhanced_avg_altitude':\n case 'enhanced_min_altitude':\n case 'enhanced_max_altitude':\n case 'enhanced_altitude':\n case 'height':\n case 'odometer':\n case 'avg_stroke_distance':\n case 'min_altitude':\n case 'avg_altitude':\n case 'max_altitude':\n case 'total_ascent':\n case 'total_descent':\n case 'altitude':\n case 'cycle_length':\n case 'auto_wheelsize':\n case 'custom_wheelsize':\n case 'gps_accuracy':\n return convertTo(data, 'lengthUnits', options.lengthUnit);\n case 'temperature':\n case 'avg_temperature':\n case 'max_temperature':\n return convertTo(data, 'temperatureUnits', options.temperatureUnit);\n case 'pressure':\n case 'start_pressure':\n case 'end_pressure':\n return convertTo(data, 'pressureUnits', options.pressureUnit);\n case 'ant_id': {\n const n1 = (data >>> 28) & 0xF;\n const n2 = (data >>> 24) & 0xF;\n const n3 = (data >>> 16) & 0xFF;\n const n4 = data & 0xFFFF;\n return `${n1.toString(16).toUpperCase()}-${n2.toString(16).toUpperCase()}-${n3.toString(16).toUpperCase().padStart(2, '0')}-${n4.toString(16).toUpperCase().padStart(4, '0')}`;\n }\n default:\n return data;\n }\n}\nexport function readRecord(blob, messageTypes, developerFields, startIndex, options, startDate, pausedTime) {\n const recordHeader = blob[startIndex];\n let localMessageType = recordHeader & 15;\n if ((recordHeader & CompressedHeaderMask) === CompressedHeaderMask) {\n // compressed timestamp\n localMessageType = (recordHeader & CompressedLocalMsgNumMask) >> 5;\n }\n else if ((recordHeader & 64) === 64) {\n // is definition message\n // startIndex + 1 is reserved\n const hasDeveloperData = (recordHeader & 32) === 32;\n const lEnd = blob[startIndex + 2] === 0;\n const numberOfFields = blob[startIndex + 5];\n const numberOfDeveloperDataFields = hasDeveloperData\n ? blob[startIndex + 5 + numberOfFields * 3 + 1]\n : 0;\n const mTypeDef = {\n littleEndian: lEnd,\n globalMessageNumber: addEndian(lEnd, [\n blob[startIndex + 3],\n blob[startIndex + 4],\n ]),\n numberOfFields: numberOfFields + numberOfDeveloperDataFields,\n fieldDefs: [],\n };\n const message = getFitMessage(mTypeDef.globalMessageNumber);\n for (let i = 0; i < numberOfFields; i++) {\n const fDefIndex = startIndex + 6 + i * 3;\n const baseType = blob[fDefIndex + 2];\n const { field, type } = message.getAttributes(blob[fDefIndex]);\n const fDef = {\n type,\n fDefNo: blob[fDefIndex],\n size: blob[fDefIndex + 1],\n endianAbility: (baseType & 128) === 128,\n littleEndian: lEnd,\n baseTypeNo: baseType & 15,\n name: field,\n dataType: getFitMessageBaseType(baseType & 15),\n };\n mTypeDef.fieldDefs.push(fDef);\n }\n // numberOfDeveloperDataFields = 0 so it wont crash here and wont loop\n for (let i = 0; i < numberOfDeveloperDataFields; i++) {\n // If we fail to parse then try catch\n try {\n const fDefIndex = startIndex + 6 + numberOfFields * 3 + 1 + i * 3;\n const fieldNum = blob[fDefIndex];\n const size = blob[fDefIndex + 1];\n const devDataIndex = blob[fDefIndex + 2];\n const devDef = developerFields[devDataIndex][fieldNum];\n const baseType = devDef.fit_base_type_id;\n const fDef = {\n type: FIT.types.fit_base_type[baseType],\n fDefNo: fieldNum,\n size,\n endianAbility: (baseType & 128) === 128,\n littleEndian: lEnd,\n baseTypeNo: baseType & 15,\n name: devDef.field_name,\n dataType: getFitMessageBaseType(baseType & 15),\n scale: devDef.scale || 1,\n offset: devDef.offset || 0,\n developerDataIndex: devDataIndex,\n isDeveloperField: true,\n };\n mTypeDef.fieldDefs.push(fDef);\n }\n catch (e) {\n if (options.force) {\n continue;\n }\n throw e;\n }\n }\n messageTypes[localMessageType] = mTypeDef;\n const nextIndex = startIndex + 6 + mTypeDef.numberOfFields * 3;\n const nextIndexWithDeveloperData = nextIndex + 1;\n return {\n messageType: 'definition',\n nextIndex: hasDeveloperData ? nextIndexWithDeveloperData : nextIndex,\n };\n }\n const messageType = messageTypes[localMessageType] || messageTypes[0];\n // TODO: handle compressed header ((recordHeader & 128) == 128)\n // uncompressed header\n let messageSize = 0;\n let readDataFromIndex = startIndex + 1;\n const fields = {};\n const message = getFitMessage(messageType.globalMessageNumber);\n const rawFields = [];\n for (let i = 0; i < messageType.fieldDefs.length; i++) {\n const fDef = messageType.fieldDefs[i];\n const data = readData(blob, fDef, readDataFromIndex, options);\n if (!isInvalidValue(data, fDef.type)) {\n rawFields.push({ fDef, data });\n }\n readDataFromIndex += fDef.size;\n messageSize += fDef.size;\n }\n for (const { fDef, data } of rawFields) {\n const { field } = fDef.isDeveloperField ? { field: fDef.name } : message.getAttributes(fDef.fDefNo);\n if (field !== 'unknown' && field !== '' && field !== undefined) {\n fields[field] = data;\n }\n }\n for (const { fDef, data } of rawFields) {\n if (fDef.isDeveloperField) {\n const field = fDef.name;\n const { type } = fDef;\n const { scale } = fDef;\n const { offset } = fDef;\n fields[fDef.name] = applyOptions(formatByType(data, type, scale, offset), field, options, fields);\n }\n else {\n const { field, type, scale, offset } = message.getAttributes(fDef.fDefNo);\n if (field !== 'unknown' && field !== '' && field !== undefined) {\n fields[field] = applyOptions(formatByType(data, type, scale, offset), field, options, fields);\n }\n }\n if (message.name === 'record' && options.elapsedRecordField) {\n fields.elapsed_time = (fields.timestamp - (startDate || 0)) / 1000;\n fields.timer_time = fields.elapsed_time - pausedTime;\n }\n }\n if (message.name === 'field_description') {\n developerFields[fields.developer_data_index]\n = developerFields[fields.developer_data_index] || [];\n developerFields[fields.developer_data_index][fields.field_definition_number] = fields;\n }\n if (message.name === 'monitoring') {\n // TODO weirdly uses global variables?\n // we need to keep the raw timestamp value so we can calculate subsequent timestamp16 fields\n if (fields.timestamp) {\n monitoring_timestamp = fields.timestamp;\n fields.timestamp = new Date(fields.timestamp * 1000 + GarminTimeOffset);\n }\n if (fields.timestamp16 && !fields.timestamp) {\n monitoring_timestamp\n += (fields.timestamp16 - (monitoring_timestamp & 0xFFFF)) & 0xFFFF;\n // fields.timestamp = monitoring_timestamp;\n fields.timestamp = new Date(monitoring_timestamp * 1000 + GarminTimeOffset);\n }\n }\n return {\n messageType: message.name,\n nextIndex: startIndex + messageSize + 1,\n message: fields,\n };\n}\nexport function getArrayBuffer(buffer) {\n if (buffer instanceof ArrayBuffer) {\n return buffer;\n }\n const ab = new ArrayBuffer(buffer.length);\n const view = new Uint8Array(ab);\n for (let i = 0; i < buffer.length; ++i) {\n view[i] = buffer[i];\n }\n return ab;\n}\nexport function calculateCRC(blob, start, end) {\n const crcTable = [\n 0x0000,\n 0xCC01,\n 0xD801,\n 0x1400,\n 0xF001,\n 0x3C00,\n 0x2800,\n 0xE401,\n 0xA001,\n 0x6C00,\n 0x7800,\n 0xB401,\n 0x5000,\n 0x9C01,\n 0x8801,\n 0x4400,\n ];\n let crc = 0;\n for (let i = start; i < end; i++) {\n const byteVal = blob[i];\n let tmp = crcTable[crc & 0xF];\n crc = (crc >> 4) & 0x0FFF;\n crc = crc ^ tmp ^ crcTable[byteVal & 0xF];\n tmp = crcTable[crc & 0xF];\n crc = (crc >> 4) & 0x0FFF;\n crc = crc ^ tmp ^ crcTable[(byteVal >> 4) & 0xF];\n }\n return crc;\n}\n", "const metersInOneKilometer = 1000;\nconst secondsInOneHour = 3600;\n// according to https://en.wikipedia.org/wiki/Mile\nconst metersInOneMile = 1609.344;\nconst centiBarsInOneBar = 100;\nconst psiInOneBar = 14.5037738;\n// TODO we dont have comprehensive output types bc its a bit cumbersome to maintain typescript types and this giant mapping object\n// which contains all the types and values\n// i would wish for some kind of inference mechanism here but for now we leave it as any\n// maybe zod could help here\nexport const FIT = {\n scConst: 180 / Math.pow(2, 31),\n options: {\n speedUnits: {\n // native speed unit: meters per second [m/s]\n 'm/s': {\n multiplier: 1,\n offset: 0,\n },\n // miles per hour [mph]\n 'mph': {\n multiplier: secondsInOneHour / metersInOneMile,\n offset: 0,\n },\n // kilometers per hour [km/h]\n 'km/h': {\n multiplier: secondsInOneHour / metersInOneKilometer,\n offset: 0,\n },\n },\n lengthUnits: {\n // native length unit: meters [m]\n m: {\n multiplier: 1,\n offset: 0,\n },\n // (international) mile [mi]\n mi: {\n multiplier: 1 / metersInOneMile,\n offset: 0,\n },\n // kilometer [km]\n km: {\n multiplier: 1 / metersInOneKilometer,\n offset: 0,\n },\n },\n temperatureUnits: {\n // native temperature unit: degree Celsius [\u00B0C]\n '\u00B0C': {\n multiplier: 1,\n offset: 0,\n },\n // kelvin [K]\n 'kelvin': {\n multiplier: 1,\n offset: -273.15,\n },\n // degree fahrenheit [\u00B0F]\n 'fahrenheit': {\n multiplier: 9 / 5,\n offset: 32,\n },\n },\n pressureUnits: {\n cbar: {\n multiplier: 1,\n offset: 0,\n },\n bar: {\n multiplier: 1 / centiBarsInOneBar,\n offset: 0,\n },\n psi: {\n multiplier: (1 / centiBarsInOneBar) * psiInOneBar,\n offset: 0,\n },\n },\n },\n messages: {\n 0: {\n name: 'file_id',\n 0: { field: 'type', type: 'file', scale: null, offset: 0, units: '' },\n 1: {\n field: 'manufacturer',\n type: 'manufacturer',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'product',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'serial_number',\n type: 'uint32z',\n scale: null,\n offset: 0,\n units: '',\n },\n 4: {\n field: 'time_created',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 5: { field: 'number', type: 'uint16', scale: null, offset: 0, units: '' },\n 8: {\n field: 'product_name',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 1: {\n name: 'capabilities',\n 0: {\n field: 'languages',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'sports',\n type: 'sport_bits_0',\n scale: null,\n offset: 0,\n units: '',\n },\n 21: {\n field: 'workouts_supported',\n type: 'workout_capabilities',\n scale: null,\n offset: 0,\n units: '',\n },\n 23: {\n field: 'connectivity_supported',\n type: 'connectivity_capabilities',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 2: {\n name: 'device_settings',\n 0: {\n field: 'active_time_zone',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'utc_offset',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'time_offset',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 's',\n },\n 5: {\n field: 'time_zone_offset',\n type: 'sint8',\n scale: 4,\n offset: 0,\n units: 'hr',\n },\n 55: {\n field: 'display_orientation',\n type: 'display_orientation',\n scale: null,\n offset: 0,\n units: '',\n },\n 56: {\n field: 'mounting_side',\n type: 'side',\n scale: null,\n offset: 0,\n units: '',\n },\n 94: {\n field: 'number_of_screens',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 95: {\n field: 'smart_notification_display_orientation',\n type: 'display_orientation',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 3: {\n name: 'user_profile',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: {\n field: 'friendly_name',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: { field: 'gender', type: 'gender', scale: null, offset: 0, units: '' },\n 2: {\n field: 'age',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'years',\n },\n 3: { field: 'height', type: 'uint8', scale: 100, offset: 0, units: 'm' },\n 4: { field: 'weight', type: 'uint16', scale: 10, offset: 0, units: 'kg' },\n 5: {\n field: 'language',\n type: 'language',\n scale: null,\n offset: 0,\n units: '',\n },\n 6: {\n field: 'elev_setting',\n type: 'display_measure',\n scale: null,\n offset: 0,\n units: '',\n },\n 7: {\n field: 'weight_setting',\n type: 'display_measure',\n scale: null,\n offset: 0,\n units: '',\n },\n 8: {\n field: 'resting_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 9: {\n field: 'default_max_running_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 10: {\n field: 'default_max_biking_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 11: {\n field: 'default_max_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 12: {\n field: 'hr_setting',\n type: 'display_heart',\n scale: null,\n offset: 0,\n units: '',\n },\n 13: {\n field: 'speed_setting',\n type: 'display_measure',\n scale: null,\n offset: 0,\n units: '',\n },\n 14: {\n field: 'dist_setting',\n type: 'display_measure',\n scale: null,\n offset: 0,\n units: '',\n },\n 16: {\n field: 'power_setting',\n type: 'display_power',\n scale: null,\n offset: 0,\n units: '',\n },\n 17: {\n field: 'activity_class',\n type: 'activity_class',\n scale: null,\n offset: 0,\n units: '',\n },\n 18: {\n field: 'position_setting',\n type: 'display_position',\n scale: null,\n offset: 0,\n units: '',\n },\n 21: {\n field: 'temperature_setting',\n type: 'display_measure',\n scale: null,\n offset: 0,\n units: '',\n },\n 22: {\n field: 'local_id',\n type: 'user_local_id',\n scale: null,\n offset: 0,\n units: '',\n },\n 23: {\n field: 'global_id',\n type: 'byte',\n scale: null,\n offset: 0,\n units: '',\n },\n 28: {\n field: 'wake_time',\n type: 'localtime_into_day',\n scale: null,\n offset: 0,\n units: '',\n },\n 29: {\n field: 'sleep_time',\n type: 'localtime_into_day',\n scale: null,\n offset: 0,\n units: '',\n },\n 30: {\n field: 'height_setting',\n type: 'display_measure',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 4: {\n name: 'hrm_profile',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: { field: 'enabled', type: 'bool', scale: null, offset: 0, units: '' },\n 1: {\n field: 'hrm_ant_id',\n type: 'uint16z',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: { field: 'log_hrv', type: 'bool', scale: null, offset: 0, units: '' },\n 3: {\n field: 'hrm_ant_id_trans_type',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 5: {\n name: 'sdm_profile',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: { field: 'enabled', type: 'bool', scale: null, offset: 0, units: '' },\n 1: {\n field: 'sdm_ant_id',\n type: 'uint16z',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'sdm_cal_factor',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 3: {\n field: 'odometer',\n type: 'uint32',\n scale: 100,\n offset: 0,\n units: 'm',\n },\n 4: {\n field: 'speed_source',\n type: 'bool',\n scale: null,\n offset: 0,\n units: '',\n },\n 5: {\n field: 'sdm_ant_id_trans_type',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 7: {\n field: 'odometer_rollover',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 6: {\n name: 'bike_profile',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: { field: 'name', type: 'string', scale: null, offset: 0, units: '' },\n 1: { field: 'sport', type: 'sport', scale: null, offset: 0, units: '' },\n 2: {\n field: 'sub_sport',\n type: 'sub_sport',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'odometer',\n type: 'uint32',\n scale: 100,\n offset: 0,\n units: 'm',\n },\n 4: {\n field: 'bike_spd_ant_id',\n type: 'uint16z',\n scale: null,\n offset: 0,\n units: '',\n },\n 5: {\n field: 'bike_cad_ant_id',\n type: 'uint16z',\n scale: null,\n offset: 0,\n units: '',\n },\n 6: {\n field: 'bike_spdcad_ant_id',\n type: 'uint16z',\n scale: null,\n offset: 0,\n units: '',\n },\n 7: {\n field: 'bike_power_ant_id',\n type: 'uint16z',\n scale: null,\n offset: 0,\n units: '',\n },\n 8: {\n field: 'custom_wheelsize',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm',\n },\n 9: {\n field: 'auto_wheelsize',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm',\n },\n 10: {\n field: 'bike_weight',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'kg',\n },\n 11: {\n field: 'power_cal_factor',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 12: {\n field: 'auto_wheel_cal',\n type: 'bool',\n scale: null,\n offset: 0,\n units: '',\n },\n 13: {\n field: 'auto_power_zero',\n type: 'bool',\n scale: null,\n offset: 0,\n units: '',\n },\n 14: { field: 'id', type: 'uint8', scale: null, offset: 0, units: '' },\n 15: {\n field: 'spd_enabled',\n type: 'bool',\n scale: null,\n offset: 0,\n units: '',\n },\n 16: {\n field: 'cad_enabled',\n type: 'bool',\n scale: null,\n offset: 0,\n units: '',\n },\n 17: {\n field: 'spdcad_enabled',\n type: 'bool',\n scale: null,\n offset: 0,\n units: '',\n },\n 18: {\n field: 'power_enabled',\n type: 'bool',\n scale: null,\n offset: 0,\n units: '',\n },\n 19: {\n field: 'crank_length',\n type: 'uint8',\n scale: 2,\n offset: -110,\n units: 'mm',\n },\n 20: { field: 'enabled', type: 'bool', scale: null, offset: 0, units: '' },\n 21: {\n field: 'bike_spd_ant_id_trans_type',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 22: {\n field: 'bike_cad_ant_id_trans_type',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 23: {\n field: 'bike_spdcad_ant_id_trans_type',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 24: {\n field: 'bike_power_ant_id_trans_type',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 37: {\n field: 'odometer_rollover',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 38: {\n field: 'front_gear_num',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 39: {\n field: 'front_gear',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 40: {\n field: 'rear_gear_num',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 41: {\n field: 'rear_gear',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 44: {\n field: 'shimano_di2_enabled',\n type: 'bool',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 7: {\n name: 'zones_target',\n 1: {\n field: 'max_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'threshold_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'functional_threshold_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 5: {\n field: 'hr_calc_type',\n type: 'hr_zone_calc',\n scale: null,\n offset: 0,\n units: '',\n },\n 7: {\n field: 'pwr_calc_type',\n type: 'pwr_zone_calc',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 8: {\n name: 'hr_zone',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'high_bpm',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 2: { field: 'name', type: 'string', scale: null, offset: 0, units: '' },\n },\n 9: {\n name: 'power_zone',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'high_value',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 2: { field: 'name', type: 'string', scale: null, offset: 0, units: '' },\n },\n 10: {\n name: 'met_zone',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'high_bpm',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'calories',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'kcal / min',\n },\n 3: {\n field: 'fat_calories',\n type: 'uint8',\n scale: 10,\n offset: 0,\n units: 'kcal / min',\n },\n },\n 12: {\n name: 'sport',\n 0: { field: 'sport', type: 'sport', scale: null, offset: 0, units: '' },\n 1: {\n field: 'sub_sport',\n type: 'sub_sport',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: { field: 'name', type: 'string', scale: null, offset: 0, units: '' },\n },\n 15: {\n name: 'goal',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: { field: 'sport', type: 'sport', scale: null, offset: 0, units: '' },\n 1: {\n field: 'sub_sport',\n type: 'sub_sport',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'start_date',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'end_date',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 4: { field: 'type', type: 'goal', scale: null, offset: 0, units: '' },\n 5: { field: 'value', type: 'uint32', scale: null, offset: 0, units: '' },\n 6: { field: 'repeat', type: 'bool', scale: null, offset: 0, units: '' },\n 7: {\n field: 'target_value',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 8: {\n field: 'recurrence',\n type: 'goal_recurrence',\n scale: null,\n offset: 0,\n units: '',\n },\n 9: {\n field: 'recurrence_value',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 10: { field: 'enabled', type: 'bool', scale: null, offset: 0, units: '' },\n },\n 18: {\n name: 'session',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: { field: 'event', type: 'event', scale: null, offset: 0, units: '' },\n 1: {\n field: 'event_type',\n type: 'event_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'start_time',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'start_position_lat',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 4: {\n field: 'start_position_long',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 5: { field: 'sport', type: 'sport', scale: null, offset: 0, units: '' },\n 6: {\n field: 'sub_sport',\n type: 'sub_sport',\n scale: null,\n offset: 0,\n units: '',\n },\n 7: {\n field: 'total_elapsed_time',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 8: {\n field: 'total_timer_time',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 9: {\n field: 'total_distance',\n type: 'uint32',\n scale: 100,\n offset: 0,\n units: 'm',\n },\n 10: {\n field: 'total_cycles',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'cycles',\n },\n 11: {\n field: 'total_calories',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'kcal',\n },\n 13: {\n field: 'total_fat_calories',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'kcal',\n },\n 14: {\n field: 'avg_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 15: {\n field: 'max_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 16: {\n field: 'avg_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 17: {\n field: 'max_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 18: {\n field: 'avg_cadence',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'rpm',\n },\n 19: {\n field: 'max_cadence',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'rpm',\n },\n 20: {\n field: 'avg_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 21: {\n field: 'max_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 22: {\n field: 'total_ascent',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 23: {\n field: 'total_descent',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 24: {\n field: 'total_training_effect',\n type: 'uint8',\n scale: 10,\n offset: 0,\n units: '',\n },\n 25: {\n field: 'first_lap_index',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 26: {\n field: 'num_laps',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 27: {\n field: 'event_group',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 28: {\n field: 'trigger',\n type: 'session_trigger',\n scale: null,\n offset: 0,\n units: '',\n },\n 29: {\n field: 'nec_lat',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 30: {\n field: 'nec_long',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 31: {\n field: 'swc_lat',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 32: {\n field: 'swc_long',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 34: {\n field: 'normalized_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 35: {\n field: 'training_stress_score',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'tss',\n },\n 36: {\n field: 'intensity_factor',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'if',\n },\n 37: {\n field: 'left_right_balance',\n type: 'left_right_balance_100',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 38: {\n field: 'end_position_lat',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 39: {\n field: 'end_position_long',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 41: {\n field: 'avg_stroke_count',\n type: 'uint32',\n scale: 10,\n offset: 0,\n units: 'strokes/lap',\n },\n 42: {\n field: 'avg_stroke_distance',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'm',\n },\n 43: {\n field: 'swim_stroke',\n type: 'swim_stroke',\n scale: null,\n offset: 0,\n units: 'swim_stroke',\n },\n 44: {\n field: 'pool_length',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'm',\n },\n 45: {\n field: 'threshold_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 46: {\n field: 'pool_length_unit',\n type: 'display_measure',\n scale: null,\n offset: 0,\n units: '',\n },\n 47: {\n field: 'num_active_lengths',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'lengths',\n },\n 48: {\n field: 'total_work',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'J',\n },\n 49: {\n field: 'avg_altitude',\n type: 'uint16',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 50: {\n field: 'max_altitude',\n type: 'uint16',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 51: {\n field: 'gps_accuracy',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 52: {\n field: 'avg_grade',\n type: 'sint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 53: {\n field: 'avg_pos_grade',\n type: 'sint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 54: {\n field: 'avg_neg_grade',\n type: 'sint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 55: {\n field: 'max_pos_grade',\n type: 'sint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 56: {\n field: 'max_neg_grade',\n type: 'sint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 57: {\n field: 'avg_temperature',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'C',\n },\n 58: {\n field: 'max_temperature',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'C',\n },\n 59: {\n field: 'total_moving_time',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 60: {\n field: 'avg_pos_vertical_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 61: {\n field: 'avg_neg_vertical_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 62: {\n field: 'max_pos_vertical_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 63: {\n field: 'max_neg_vertical_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 64: {\n field: 'min_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 65: {\n field: 'time_in_hr_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 66: {\n field: 'time_in_speed_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 67: {\n field: 'time_in_cadence_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 68: {\n field: 'time_in_power_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 69: {\n field: 'avg_lap_time',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 70: {\n field: 'best_lap_index',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 71: {\n field: 'min_altitude',\n type: 'uint16',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 82: {\n field: 'player_score',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 83: {\n field: 'opponent_score',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 84: {\n field: 'opponent_name',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n 85: {\n field: 'stroke_count',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'counts',\n },\n 86: {\n field: 'zone_count',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'counts',\n },\n 87: {\n field: 'max_ball_speed',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'm/s',\n },\n 88: {\n field: 'avg_ball_speed',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'm/s',\n },\n 89: {\n field: 'avg_vertical_oscillation',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'mm',\n },\n 90: {\n field: 'avg_stance_time_percent',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'percent',\n },\n 91: {\n field: 'avg_stance_time',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'ms',\n },\n 92: {\n field: 'avg_fractional_cadence',\n type: 'uint8',\n scale: 128,\n offset: 0,\n units: 'rpm',\n },\n 93: {\n field: 'max_fractional_cadence',\n type: 'uint8',\n scale: 128,\n offset: 0,\n units: 'rpm',\n },\n 94: {\n field: 'total_fractional_cycles',\n type: 'uint8',\n scale: 128,\n offset: 0,\n units: 'cycles',\n },\n 95: {\n field: 'avg_total_hemoglobin_conc',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'g/dL',\n },\n 96: {\n field: 'min_total_hemoglobin_conc',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'g/dL',\n },\n 97: {\n field: 'max_total_hemoglobin_conc',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'g/dL',\n },\n 98: {\n field: 'avg_saturated_hemoglobin_percent',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 99: {\n field: 'min_saturated_hemoglobin_percent',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 100: {\n field: 'max_saturated_hemoglobin_percent',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 101: {\n field: 'avg_left_torque_effectiveness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 102: {\n field: 'avg_right_torque_effectiveness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 103: {\n field: 'avg_left_pedal_smoothness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 104: {\n field: 'avg_right_pedal_smoothness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 105: {\n field: 'avg_combined_pedal_smoothness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 111: {\n field: 'sport_index',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 112: {\n field: 'time_standing',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 113: {\n field: 'stand_count',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 114: {\n field: 'avg_left_pco',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'mm',\n },\n 115: {\n field: 'avg_right_pco',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'mm',\n },\n 116: {\n field: 'avg_left_power_phase',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 117: {\n field: 'avg_left_power_phase_peak',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 118: {\n field: 'avg_right_power_phase',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 119: {\n field: 'avg_right_power_phase_peak',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 120: {\n field: 'avg_power_position',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 121: {\n field: 'max_power_position',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 122: {\n field: 'avg_cadence_position',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'rpm',\n },\n 123: {\n field: 'max_cadence_position',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'rpm',\n },\n 124: {\n field: 'enhanced_avg_speed',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 125: {\n field: 'enhanced_max_speed',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 126: {\n field: 'enhanced_avg_altitude',\n type: 'uint32',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 127: {\n field: 'enhanced_min_altitude',\n type: 'uint32',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 128: {\n field: 'enhanced_max_altitude',\n type: 'uint32',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 129: {\n field: 'avg_lev_motor_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 130: {\n field: 'max_lev_motor_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 131: {\n field: 'lev_battery_consumption',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 132: {\n field: 'avg_vertical_ratio',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'percent',\n },\n 133: {\n field: 'avg_stance_time_balance',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'percent',\n },\n 134: {\n field: 'avg_step_length',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'mm',\n },\n 137: {\n field: 'total_anaerobic_training_effect',\n type: 'uint8',\n scale: 10,\n offset: 0,\n units: '',\n },\n 139: {\n field: 'avg_vam',\n type: 'uint16',\n scale: 1, // Raw 100 -> 100 (User specific m/h)\n offset: 0,\n units: 'm/h',\n },\n 192: {\n field: 'workout_feel',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 193: {\n field: 'workout_rpe',\n type: 'uint8',\n scale: 10,\n offset: 0,\n units: '',\n },\n 110: {\n field: 'sport_profile_name',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n 168: {\n field: 'training_load_peak',\n type: 'uint32',\n scale: 1,\n offset: 0,\n units: '',\n },\n 169: {\n field: 'enhanced_avg_respiration_rate',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'breaths/min',\n },\n 150: {\n field: 'min_temperature',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'C',\n },\n 170: {\n field: 'enhanced_max_respiration_rate',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'breaths/min',\n },\n 178: {\n field: 'est_sweat_loss',\n type: 'uint16',\n scale: 1, // ml\n offset: 0,\n units: 'ml',\n },\n 180: {\n field: 'enhanced_min_respiration_rate',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'breaths/min',\n },\n 181: {\n field: 'total_grit',\n type: 'float32',\n scale: 1,\n offset: 0,\n units: 'kGrit',\n },\n 182: {\n field: 'total_flow',\n type: 'float32',\n scale: 1,\n offset: 0,\n units: 'Flow',\n },\n 183: {\n field: 'jump_count',\n type: 'uint16',\n scale: 1,\n offset: 0,\n units: '',\n },\n 186: {\n field: 'avg_grit',\n type: 'float32',\n scale: 1,\n offset: 0,\n units: 'kGrit',\n },\n 187: {\n field: 'avg_flow',\n type: 'float32',\n scale: 1,\n offset: 0,\n units: 'Flow',\n },\n 188: {\n field: 'primary_benefit',\n type: 'uint8',\n scale: 1,\n offset: 0,\n units: '',\n },\n 196: {\n field: 'resting_calories',\n type: 'uint16',\n scale: 1,\n offset: 0,\n units: 'kcal',\n },\n 214: {\n field: 'avg_grit',\n type: 'float32',\n scale: null,\n offset: 0,\n units: '',\n },\n 215: {\n field: 'avg_flow',\n type: 'float32',\n scale: null,\n offset: 0,\n units: '',\n },\n 140: {\n field: 'recovery_advisor',\n type: 'uint16', // Minutes?\n scale: 1,\n offset: 0,\n units: 'min',\n },\n },\n 19: {\n name: 'lap',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: { field: 'event', type: 'event', scale: null, offset: 0, units: '' },\n 1: {\n field: 'event_type',\n type: 'event_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'start_time',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'start_position_lat',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 4: {\n field: 'start_position_long',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 5: {\n field: 'end_position_lat',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 6: {\n field: 'end_position_long',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 7: {\n field: 'total_elapsed_time',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 8: {\n field: 'total_timer_time',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 9: {\n field: 'total_distance',\n type: 'uint32',\n scale: 100,\n offset: 0,\n units: 'm',\n },\n 10: {\n field: 'total_cycles',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'cycles',\n },\n 11: {\n field: 'total_calories',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'kcal',\n },\n 12: {\n field: 'total_fat_calories',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'kcal',\n },\n 13: {\n field: 'avg_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 14: {\n field: 'max_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 15: {\n field: 'avg_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 16: {\n field: 'max_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 17: {\n field: 'avg_cadence',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'rpm',\n },\n 18: {\n field: 'max_cadence',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'rpm',\n },\n 19: {\n field: 'avg_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 20: {\n field: 'max_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 21: {\n field: 'total_ascent',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 22: {\n field: 'total_descent',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 23: {\n field: 'intensity',\n type: 'intensity',\n scale: null,\n offset: 0,\n units: '',\n },\n 24: {\n field: 'lap_trigger',\n type: 'lap_trigger',\n scale: null,\n offset: 0,\n units: '',\n },\n 25: { field: 'sport', type: 'sport', scale: null, offset: 0, units: '' },\n 26: {\n field: 'event_group',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 32: {\n field: 'num_lengths',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'lengths',\n },\n 33: {\n field: 'normalized_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 34: {\n field: 'left_right_balance',\n type: 'left_right_balance_100',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 35: {\n field: 'first_length_index',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 37: {\n field: 'avg_stroke_distance',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'm',\n },\n 38: {\n field: 'swim_stroke',\n type: 'swim_stroke',\n scale: null,\n offset: 0,\n units: '',\n },\n 39: {\n field: 'sub_sport',\n type: 'sub_sport',\n scale: null,\n offset: 0,\n units: '',\n },\n 40: {\n field: 'num_active_lengths',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'lengths',\n },\n 41: {\n field: 'total_work',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'J',\n },\n 42: {\n field: 'avg_altitude',\n type: 'uint16',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 43: {\n field: 'max_altitude',\n type: 'uint16',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 44: {\n field: 'gps_accuracy',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 45: {\n field: 'avg_grade',\n type: 'sint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 46: {\n field: 'avg_pos_grade',\n type: 'sint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 47: {\n field: 'avg_neg_grade',\n type: 'sint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 48: {\n field: 'max_pos_grade',\n type: 'sint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 49: {\n field: 'max_neg_grade',\n type: 'sint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 50: {\n field: 'avg_temperature',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'C',\n },\n 51: {\n field: 'max_temperature',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'C',\n },\n 52: {\n field: 'total_moving_time',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 53: {\n field: 'avg_pos_vertical_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 54: {\n field: 'avg_neg_vertical_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 55: {\n field: 'max_pos_vertical_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 56: {\n field: 'max_neg_vertical_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 57: {\n field: 'time_in_hr_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 58: {\n field: 'time_in_speed_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 59: {\n field: 'time_in_cadence_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 60: {\n field: 'time_in_power_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 61: {\n field: 'repetition_num',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 62: {\n field: 'min_altitude',\n type: 'uint16',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 63: {\n field: 'min_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 71: {\n field: 'wkt_step_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 74: {\n field: 'opponent_score',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 75: {\n field: 'stroke_count',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'counts',\n },\n 76: {\n field: 'zone_count',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'counts',\n },\n 77: {\n field: 'avg_vertical_oscillation',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'mm',\n },\n 78: {\n field: 'avg_stance_time_percent',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'percent',\n },\n 79: {\n field: 'avg_stance_time',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'ms',\n },\n 80: {\n field: 'avg_fractional_cadence',\n type: 'uint8',\n scale: 128,\n offset: 0,\n units: 'rpm',\n },\n 81: {\n field: 'max_fractional_cadence',\n type: 'uint8',\n scale: 128,\n offset: 0,\n units: 'rpm',\n },\n 82: {\n field: 'total_fractional_cycles',\n type: 'uint8',\n scale: 128,\n offset: 0,\n units: 'cycles',\n },\n 83: {\n field: 'player_score',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 84: {\n field: 'avg_total_hemoglobin_conc',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'g/dL',\n },\n 85: {\n field: 'min_total_hemoglobin_conc',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'g/dL',\n },\n 86: {\n field: 'max_total_hemoglobin_conc',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'g/dL',\n },\n 87: {\n field: 'avg_saturated_hemoglobin_percent',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 88: {\n field: 'min_saturated_hemoglobin_percent',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 89: {\n field: 'max_saturated_hemoglobin_percent',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 91: {\n field: 'avg_left_torque_effectiveness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 92: {\n field: 'avg_right_torque_effectiveness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 93: {\n field: 'avg_left_pedal_smoothness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 94: {\n field: 'avg_right_pedal_smoothness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 95: {\n field: 'avg_combined_pedal_smoothness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 98: {\n field: 'time_standing',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 99: {\n field: 'stand_count',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 100: {\n field: 'avg_left_pco',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'mm',\n },\n 101: {\n field: 'avg_right_pco',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'mm',\n },\n 102: {\n field: 'avg_left_power_phase',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 103: {\n field: 'avg_left_power_phase_peak',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 104: {\n field: 'avg_right_power_phase',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 105: {\n field: 'avg_right_power_phase_peak',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 106: {\n field: 'avg_power_position',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 107: {\n field: 'max_power_position',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 108: {\n field: 'avg_cadence_position',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'rpm',\n },\n 109: {\n field: 'max_cadence_position',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'rpm',\n },\n 110: {\n field: 'enhanced_avg_speed',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 111: {\n field: 'enhanced_max_speed',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 112: {\n field: 'enhanced_avg_altitude',\n type: 'uint32',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 113: {\n field: 'enhanced_min_altitude',\n type: 'uint32',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 114: {\n field: 'enhanced_max_altitude',\n type: 'uint32',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 115: {\n field: 'avg_lev_motor_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 116: {\n field: 'max_lev_motor_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 117: {\n field: 'lev_battery_consumption',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 118: {\n field: 'avg_vertical_ratio',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'percent',\n },\n 119: {\n field: 'avg_stance_time_balance',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'percent',\n },\n 120: {\n field: 'avg_step_length',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'mm',\n },\n 121: {\n field: 'avg_vam',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n },\n 20: {\n name: 'record',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 114: {\n field: 'grit',\n type: 'float32',\n scale: null,\n offset: 0,\n units: '',\n },\n 115: {\n field: 'flow',\n type: 'float32',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: {\n field: 'position_lat',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 1: {\n field: 'position_long',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 2: {\n field: 'altitude',\n type: 'uint16',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 3: {\n field: 'heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 4: {\n field: 'cadence',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'rpm',\n },\n 5: {\n field: 'distance',\n type: 'uint32',\n scale: 100,\n offset: 0,\n units: 'm',\n },\n 6: {\n field: 'speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 7: {\n field: 'power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 8: {\n field: 'compressed_speed_distance',\n type: 'byte',\n scale: 100.16,\n offset: 0,\n units: 'm/s,m',\n },\n 9: { field: 'grade', type: 'sint16', scale: 100, offset: 0, units: '%' },\n 10: {\n field: 'resistance',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 11: {\n field: 'time_from_course',\n type: 'sint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 12: {\n field: 'cycle_length',\n type: 'uint8',\n scale: 100,\n offset: 0,\n units: 'm',\n },\n 13: {\n field: 'temperature',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'C',\n },\n 17: {\n field: 'speed_1s',\n type: 'uint8',\n scale: 16,\n offset: 0,\n units: 'm/s',\n },\n 18: {\n field: 'cycles',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'cycles',\n },\n 19: {\n field: 'total_cycles',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'cycles',\n },\n 28: {\n field: 'compressed_accumulated_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 29: {\n field: 'accumulated_power',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 30: {\n field: 'left_right_balance',\n type: 'left_right_balance',\n scale: null,\n offset: 0,\n units: '',\n },\n 31: {\n field: 'gps_accuracy',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 32: {\n field: 'vertical_speed',\n type: 'sint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 33: {\n field: 'calories',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'kcal',\n },\n 39: {\n field: 'vertical_oscillation',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'mm',\n },\n 40: {\n field: 'stance_time_percent',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'percent',\n },\n 41: {\n field: 'stance_time',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'ms',\n },\n 42: {\n field: 'activity_type',\n type: 'activity_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 43: {\n field: 'left_torque_effectiveness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 44: {\n field: 'right_torque_effectiveness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 45: {\n field: 'left_pedal_smoothness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 46: {\n field: 'right_pedal_smoothness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 47: {\n field: 'combined_pedal_smoothness',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 48: {\n field: 'time128',\n type: 'uint8',\n scale: 128,\n offset: 0,\n units: 's',\n },\n 49: {\n field: 'stroke_type',\n type: 'stroke_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 50: { field: 'zone', type: 'uint8', scale: null, offset: 0, units: '' },\n 51: {\n field: 'ball_speed',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'm/s',\n },\n 52: {\n field: 'cadence256',\n type: 'uint16',\n scale: 256,\n offset: 0,\n units: 'rpm',\n },\n 53: {\n field: 'fractional_cadence',\n type: 'uint8',\n scale: 128,\n offset: 0,\n units: 'rpm',\n },\n 54: {\n field: 'total_hemoglobin_conc',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'g/dL',\n },\n 55: {\n field: 'total_hemoglobin_conc_min',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'g/dL',\n },\n 56: {\n field: 'total_hemoglobin_conc_max',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'g/dL',\n },\n 57: {\n field: 'saturated_hemoglobin_percent',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 58: {\n field: 'saturated_hemoglobin_percent_min',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 59: {\n field: 'saturated_hemoglobin_percent_max',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: '%',\n },\n 62: {\n field: 'device_index',\n type: 'device_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 67: {\n field: 'left_pco',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'mm',\n },\n 68: {\n field: 'right_pco',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: 'mm',\n },\n 69: {\n field: 'left_power_phase',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 70: {\n field: 'left_power_phase_peak',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 71: {\n field: 'right_power_phase',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 72: {\n field: 'right_power_phase_peak',\n type: 'uint8',\n scale: 0.7111111,\n offset: 0,\n units: 'degrees',\n },\n 73: {\n field: 'enhanced_speed',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 78: {\n field: 'enhanced_altitude',\n type: 'uint32',\n scale: 5,\n offset: -500,\n units: 'm',\n },\n 81: {\n field: 'battery_soc',\n type: 'uint8',\n scale: 2,\n offset: 0,\n units: 'percent',\n },\n 82: {\n field: 'motor_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 83: {\n field: 'vertical_ratio',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'percent',\n },\n 84: {\n field: 'stance_time_balance',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'percent',\n },\n 85: {\n field: 'step_length',\n type: 'uint16',\n scale: 10,\n offset: 0,\n units: 'mm',\n },\n 91: {\n field: 'absolute_pressure',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'Pa',\n },\n 92: {\n field: 'depth',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 93: {\n field: 'next_stop_depth',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 94: {\n field: 'next_stop_time',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 's',\n },\n 95: {\n field: 'time_to_surface',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 's',\n },\n 96: {\n field: 'ndl_time',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 's',\n },\n 97: {\n field: 'cns_load',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 98: {\n field: 'n2_load',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n },\n 285: {\n name: 'jump',\n 253: { field: 'timestamp', type: 'date_time', scale: null, offset: 0, units: 's' },\n 0: { field: 'distance', type: 'float32', scale: null, offset: 0, units: 'm' },\n 1: { field: 'height', type: 'float32', scale: null, offset: 0, units: 'm' },\n 2: { field: 'rotations', type: 'uint8', scale: null, offset: 0, units: '' },\n 3: { field: 'hang_time', type: 'float32', scale: null, offset: 0, units: 's' },\n 4: { field: 'score', type: 'float32', scale: null, offset: 0, units: '' },\n 5: { field: 'position_lat', type: 'sint32', scale: null, offset: 0, units: 'semicircles' },\n 6: { field: 'position_long', type: 'sint32', scale: null, offset: 0, units: 'semicircles' },\n 7: { field: 'speed', type: 'uint16', scale: 1000, offset: 0, units: 'm/s' },\n 8: { field: 'enhanced_speed', type: 'uint32', scale: 1000, offset: 0, units: 'm/s' },\n },\n 21: {\n name: 'event',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: { field: 'event', type: 'event', scale: null, offset: 0, units: '' },\n 1: {\n field: 'event_type',\n type: 'event_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: { field: 'data16', type: 'uint16', scale: null, offset: 0, units: '' },\n 3: { field: 'data', type: 'uint32', scale: null, offset: 0, units: '' },\n 4: {\n field: 'event_group',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 7: { field: 'score', type: 'uint16', scale: null, offset: 0, units: '' },\n 8: {\n field: 'opponent_score',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 9: {\n field: 'front_gear_num',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 10: {\n field: 'front_gear',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 11: {\n field: 'rear_gear_num',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 12: {\n field: 'rear_gear',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 13: {\n field: 'device_index',\n type: 'device_index',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 23: {\n name: 'device_info',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: {\n field: 'device_index',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'device_type',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'manufacturer',\n type: 'manufacturer',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'serial_number',\n type: 'uint32z',\n scale: null,\n offset: 0,\n units: '',\n },\n 4: {\n field: 'product',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 5: {\n field: 'software_version',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: '',\n },\n 6: {\n field: 'hardware_version',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 7: {\n field: 'cum_operating_time',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 's',\n },\n 10: {\n field: 'battery_voltage',\n type: 'uint16',\n scale: 256,\n offset: 0,\n units: 'V',\n },\n 32: {\n field: 'battery_level',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 11: {\n field: 'battery_status',\n type: 'battery_status',\n scale: null,\n offset: 0,\n units: '',\n },\n 18: {\n field: 'sensor_position',\n type: 'body_location',\n scale: null,\n offset: 0,\n units: '',\n },\n 19: {\n field: 'descriptor',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n 20: {\n field: 'ant_transmission_type',\n type: 'uint8z',\n scale: null,\n offset: 0,\n units: '',\n },\n 21: {\n field: 'ant_device_number',\n type: 'uint16z',\n scale: null,\n offset: 0,\n units: '',\n },\n 22: {\n field: 'ant_network',\n type: 'ant_network',\n scale: null,\n offset: 0,\n units: '',\n },\n 24: {\n field: 'ant_id',\n type: 'uint32z',\n scale: null,\n offset: 0,\n units: '',\n },\n 25: {\n field: 'source_type',\n type: 'source_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 27: {\n field: 'product_name',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 26: {\n name: 'workout',\n 4: { field: 'sport', type: 'sport', scale: null, offset: 0, units: '' },\n 5: {\n field: 'capabilities',\n type: 'workout_capabilities',\n scale: null,\n offset: 0,\n units: '',\n },\n 6: {\n field: 'num_valid_steps',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 8: {\n field: 'wkt_name',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 27: {\n name: 'workout_step',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: {\n field: 'wkt_step_name',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'duration_type',\n type: 'wkt_step_duration',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'duration_value',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'target_type',\n type: 'wkt_step_target',\n scale: null,\n offset: 0,\n units: '',\n },\n 4: {\n field: 'target_value',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 5: {\n field: 'custom_target_value_low',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 6: {\n field: 'custom_target_value_high',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 7: {\n field: 'intensity',\n type: 'intensity',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 30: {\n name: 'weight_scale',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: {\n field: 'weight',\n type: 'weight',\n scale: 100,\n offset: 0,\n units: 'kg',\n },\n 1: {\n field: 'percent_fat',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 2: {\n field: 'percent_hydration',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: '%',\n },\n 3: {\n field: 'visceral_fat_mass',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'kg',\n },\n 4: {\n field: 'bone_mass',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'kg',\n },\n 5: {\n field: 'muscle_mass',\n type: 'uint16',\n scale: 100,\n offset: 0,\n units: 'kg',\n },\n 7: {\n field: 'basal_met',\n type: 'uint16',\n scale: 4,\n offset: 0,\n units: 'kcal/day',\n },\n 8: {\n field: 'physique_rating',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 9: {\n field: 'active_met',\n type: 'uint16',\n scale: 4,\n offset: 0,\n units: 'kcal/day',\n },\n 10: {\n field: 'metabolic_age',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'years',\n },\n 11: {\n field: 'visceral_fat_rating',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 12: {\n field: 'user_profile_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 31: {\n name: 'course',\n 4: { field: 'sport', type: 'sport', scale: null, offset: 0, units: '' },\n 5: { field: 'name', type: 'string', scale: null, offset: 0, units: '' },\n 6: {\n field: 'capabilities',\n type: 'course_capabilities',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 32: {\n name: 'course_point',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'position_lat',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 3: {\n field: 'position_long',\n type: 'sint32',\n scale: null,\n offset: 0,\n units: 'semicircles',\n },\n 4: {\n field: 'distance',\n type: 'uint32',\n scale: 100,\n offset: 0,\n units: 'm',\n },\n 5: {\n field: 'type',\n type: 'course_point',\n scale: null,\n offset: 0,\n units: '',\n },\n 6: { field: 'name', type: 'string', scale: null, offset: 0, units: '' },\n 8: { field: 'favorite', type: 'bool', scale: null, offset: 0, units: '' },\n },\n 33: {\n name: 'totals',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: {\n field: 'timer_time',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 's',\n },\n 1: {\n field: 'distance',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 2: {\n field: 'calories',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'kcal',\n },\n 3: { field: 'sport', type: 'sport', scale: null, offset: 0, units: '' },\n 4: {\n field: 'elapsed_time',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 's',\n },\n 5: {\n field: 'sessions',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 6: {\n field: 'active_time',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 's',\n },\n 9: {\n field: 'sport_index',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 34: {\n name: 'activity',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: {\n field: 'total_timer_time',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 1: {\n field: 'num_sessions',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: { field: 'type', type: 'activity', scale: null, offset: 0, units: '' },\n 3: { field: 'event', type: 'event', scale: null, offset: 0, units: '' },\n 4: {\n field: 'event_type',\n type: 'event_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 5: {\n field: 'local_timestamp',\n type: 'local_date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 6: {\n field: 'event_group',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 35: {\n name: 'software',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: { field: 'version', type: 'uint16', scale: 100, offset: 0, units: '' },\n 5: {\n field: 'part_number',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 37: {\n name: 'file_capabilities',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: { field: 'type', type: 'file', scale: null, offset: 0, units: '' },\n 1: {\n field: 'flags',\n type: 'file_flags',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'directory',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'max_count',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 4: {\n field: 'max_size',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'bytes',\n },\n },\n 38: {\n name: 'mesg_capabilities',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: { field: 'file', type: 'file', scale: null, offset: 0, units: '' },\n 1: {\n field: 'mesg_num',\n type: 'mesg_num',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'count_type',\n type: 'mesg_count',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: { field: 'count', type: 'uint16', scale: null, offset: 0, units: '' },\n },\n 39: {\n name: 'field_capabilities',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: { field: 'file', type: 'file', scale: null, offset: 0, units: '' },\n 1: {\n field: 'mesg_num',\n type: 'mesg_num',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'field_num',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: { field: 'count', type: 'uint16', scale: null, offset: 0, units: '' },\n },\n 49: {\n name: 'file_creator',\n 0: {\n field: 'software_version',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'hardware_version',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 51: {\n name: 'blood_pressure',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: {\n field: 'systolic_pressure',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'mmHg',\n },\n 1: {\n field: 'diastolic_pressure',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'mmHg',\n },\n 2: {\n field: 'mean_arterial_pressure',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'mmHg',\n },\n 3: {\n field: 'map_3_sample_mean',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'mmHg',\n },\n 4: {\n field: 'map_morning_values',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'mmHg',\n },\n 5: {\n field: 'map_evening_values',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'mmHg',\n },\n 6: {\n field: 'heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 7: {\n field: 'heart_rate_type',\n type: 'hr_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 8: {\n field: 'status',\n type: 'bp_status',\n scale: null,\n offset: 0,\n units: '',\n },\n 9: {\n field: 'user_profile_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 55: {\n name: 'monitoring',\n 253: {\n field: 'timestamp',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: {\n field: 'device_index',\n type: 'device_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'calories',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'kcal',\n },\n 2: {\n field: 'distance',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 3: {\n field: 'cycles',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 'cycles',\n },\n 4: {\n field: 'active_time',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 's',\n },\n 5: {\n field: 'activity_type',\n type: 'activity_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 6: {\n field: 'activity_subtype',\n type: 'activity_subtype',\n scale: null,\n offset: 0,\n units: '',\n },\n 7: {\n field: 'activity_level',\n type: 'activity_level',\n scale: null,\n offset: 0,\n units: 's',\n },\n 8: {\n field: 'distance16',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 9: {\n field: 'cycles16',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'cycles',\n },\n 10: {\n field: 'active_time16',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 11: {\n field: 'local_timestamp',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 12: {\n field: 'temperature',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 'C',\n },\n 14: {\n field: 'temperature_min',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 'C',\n },\n 15: {\n field: 'temperature_max',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 'C',\n },\n 16: {\n field: 'activity_time',\n type: 'int32',\n scale: null,\n offset: 0,\n units: '',\n },\n 19: {\n field: 'active_calories',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'kcal',\n },\n 24: {\n field: 'current_activity_type_intensity',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 25: {\n field: 'timestamp_min8',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 26: {\n field: 'timestamp16',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 27: {\n field: 'heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 28: {\n field: 'intensity',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 29: {\n field: 'duration_min',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 30: {\n field: 'duration',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 31: {\n field: 'ascent',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 32: {\n field: 'descent',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 33: {\n field: 'moderate_activity_minutes',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 34: {\n field: 'vigorous_activity_inutes',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 78: {\n name: 'hrv',\n 0: {\n field: 'time',\n type: 'uint16_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n },\n 101: {\n name: 'length',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: { field: 'event', type: 'event', scale: null, offset: 0, units: '' },\n 1: {\n field: 'event_type',\n type: 'event_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'start_time',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'total_elapsed_time',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 4: {\n field: 'total_timer_time',\n type: 'uint32',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 5: {\n field: 'total_strokes',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'strokes',\n },\n 6: {\n field: 'avg_speed',\n type: 'uint16',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 7: {\n field: 'swim_stroke',\n type: 'swim_stroke',\n scale: null,\n offset: 0,\n units: 'swim_stroke',\n },\n 9: {\n field: 'avg_swimming_cadence',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'strokes/min',\n },\n 10: {\n field: 'event_group',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 11: {\n field: 'total_calories',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'kcal',\n },\n 12: {\n field: 'length_type',\n type: 'length_type',\n scale: null,\n offset: 0,\n units: 'length_type',\n },\n 18: {\n field: 'player_score',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 19: {\n field: 'opponent_score',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 20: {\n field: 'stroke_count',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'counts',\n },\n 21: {\n field: 'zone_count',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'counts',\n },\n },\n 103: {\n name: 'monitoring_info',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: {\n field: 'local_timestamp',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'activity_type',\n type: 'activity_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'cycles_to_distance',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 'cycles',\n },\n 4: {\n field: 'cycles_to_calories',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 'kcal',\n },\n 5: {\n field: 'resting_metabolic_rate',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 108: {\n name: 'o_hr_settings',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: { field: 'enabled', type: 'byte', scale: null, offset: 0, units: '' },\n },\n 140: {\n name: 'activity_metrics',\n 1: {\n field: 'new_max_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 4: {\n field: 'aerobic_training_effect',\n type: 'uint8',\n scale: 10,\n offset: 0,\n units: '',\n },\n 7: {\n field: 'vo2_max',\n type: 'uint32',\n scale: 65536 / 3.5,\n offset: 0,\n units: 'ml/kg/min',\n },\n 9: {\n field: 'recovery_time',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'min',\n },\n 11: {\n field: 'sport',\n type: 'sport',\n scale: null,\n offset: 0,\n units: '',\n },\n 20: {\n field: 'anaerobic_training_effect',\n type: 'uint8',\n scale: 10,\n offset: 0,\n units: '',\n },\n 29: {\n field: 'first_vo2_max',\n type: 'uint32',\n scale: 65536 / 3.5,\n offset: 0,\n units: 'ml/kg/min',\n },\n 41: {\n field: 'primary_benefit',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 60: {\n field: 'total_ascent',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 61: {\n field: 'total_descent',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 62: {\n field: 'avg_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 63: {\n field: 'avg_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n },\n 206: {\n name: 'field_description',\n 0: {\n field: 'developer_data_index',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'field_definition_number',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'fit_base_type_id',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'field_name',\n type: 'string',\n scale: null,\n offset: 0,\n units: '',\n },\n // 4: { field: 'array', type: 'uint8', scale: null, offset: 0, units: '' },\n // 5: { field: 'components', type: 'string', scale: null, offset: 0, units: '' },\n 6: { field: 'scale', type: 'uint8', scale: null, offset: 0, units: '' },\n 7: { field: 'offset', type: 'sint8', scale: null, offset: 0, units: '' },\n 8: { field: 'units', type: 'string', scale: null, offset: 0, units: '' },\n // 9: { field: 'bits', type: 'string', scale: null, offset: 0, units: '' },\n // 10: { field: 'accumulate', type: 'string', scale: null, offset: 0, units: '' },\n // 13: { field: 'fit_base_unit_id', type: 'uint16', scale: null, offset: 0, units: '' },\n // 14: { field: 'native_mesg_num', type: 'mesg_num', scale: null, offset: 0, units: '' },\n 15: {\n field: 'native_field_num',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 227: {\n name: 'stress_level',\n 0: {\n field: 'stress_level_value',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'stress_level_time',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 2: {\n field: 'field_two',\n type: 'sint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'body_battery',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 4: {\n field: 'field_four',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 207: {\n name: 'developer_data_id',\n 0: {\n field: 'developer_id',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'application_id',\n type: 'byte_array',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'manufacturer_id',\n type: 'manufacturer',\n scale: null,\n offset: 0,\n units: '',\n },\n 3: {\n field: 'developer_data_index',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 4: {\n field: 'application_version',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 258: {\n name: 'dive_settings',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: { field: 'name', type: 'string', scale: null, offset: 0, units: '' },\n 1: {\n field: 'model',\n type: 'tissue_model_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'gf_low',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 3: {\n field: 'gf_high',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 4: {\n field: 'water_type',\n type: 'water_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 5: {\n field: 'water_density',\n type: 'float32',\n scale: null,\n offset: 0,\n units: 'kg/m^3',\n },\n 6: {\n field: 'po2_warn',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 7: {\n field: 'po2_critical',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 8: {\n field: 'po2_deco',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 9: {\n field: 'safety_stop_enabled',\n type: 'bool',\n scale: null,\n offset: 0,\n units: '',\n },\n 10: {\n field: 'bottom_depth',\n type: 'float32',\n scale: null,\n offset: 0,\n units: '',\n },\n 11: {\n field: 'bottom_time',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 12: {\n field: 'apnea_countdown_enabled',\n type: 'bool',\n scale: null,\n offset: 0,\n units: '',\n },\n 13: {\n field: 'apnea_countdown_time',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 14: {\n field: 'backlight_mode',\n type: 'dive_backlight_mode',\n scale: null,\n offset: 0,\n units: '',\n },\n 15: {\n field: 'backlight_brightness',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n 16: {\n field: 'backlight_timeout',\n type: 'backlight_timeout',\n scale: null,\n offset: 0,\n units: '',\n },\n 17: {\n field: 'repeat_dive_time',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 's',\n },\n 18: {\n field: 'safety_stop_time',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 's',\n },\n 19: {\n field: 'heart_rate_source_type',\n type: 'source_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 20: {\n field: 'heart_rate_source',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 259: {\n name: 'dive_gas',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: {\n field: 'helium_content',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 1: {\n field: 'oxygen_content',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 2: {\n field: 'status',\n type: 'dive_gas_status',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 262: {\n name: 'dive_alarm',\n 254: {\n field: 'message_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 0: { field: 'depth', type: 'uint32', scale: null, offset: 0, units: 'm' },\n 1: { field: 'time', type: 'sint32', scale: null, offset: 0, units: 's' },\n 2: { field: 'enabled', type: 'bool', scale: null, offset: 0, units: '' },\n 3: {\n field: 'alarm_type',\n type: 'dive_alarm_type',\n scale: null,\n offset: 0,\n units: '',\n },\n 4: { field: 'sound', type: 'tone', scale: null, offset: 0, units: '' },\n 5: {\n field: 'dive_types',\n type: 'sub_sport',\n scale: null,\n offset: 0,\n units: '',\n },\n },\n 268: {\n name: 'dive_summary',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: {\n field: 'reference_mesg',\n type: 'mesg_num',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'reference_index',\n type: 'message_index',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'avg_depth',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 3: {\n field: 'max_depth',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 'm',\n },\n 4: {\n field: 'surface_interval',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 's',\n },\n 5: {\n field: 'start_cns',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 6: {\n field: 'end_cns',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 7: {\n field: 'start_n2',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 8: {\n field: 'end_n2',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'percent',\n },\n 9: {\n field: 'o2_toxicity',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'OTUs',\n },\n 10: {\n field: 'dive_number',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: '',\n },\n 11: {\n field: 'bottom_time',\n type: 'uint32',\n scale: null,\n offset: 0,\n units: 's',\n },\n },\n 319: {\n name: 'tank_update',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: { field: 'sensor', type: 'uint32', scale: null, offset: 0, units: '' },\n 1: {\n field: 'pressure',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'cbar',\n },\n },\n 323: {\n name: 'tank_summary',\n 0: { field: 'sensor', type: 'uint32', scale: null, offset: 0, units: '' },\n 1: {\n field: 'start_pressure',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'cbar',\n },\n 2: {\n field: 'end_pressure',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'cbar',\n },\n 3: {\n field: 'volume_used',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'cbar',\n },\n },\n 216: {\n name: 'time_in_zone',\n 253: {\n field: 'timestamp',\n type: 'date_time',\n scale: null,\n offset: 0,\n units: 's',\n },\n 0: {\n field: 'reference_mesg',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 1: {\n field: 'reference_index',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: '',\n },\n 2: {\n field: 'time_in_hr_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 3: {\n field: 'time_in_speed_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 4: {\n field: 'time_in_power_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 5: {\n field: 'time_in_power_zone',\n type: 'uint32_array',\n scale: 1000,\n offset: 0,\n units: 's',\n },\n 6: {\n field: 'hr_zone_high_boundary',\n type: 'uint8_array',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 7: {\n field: 'speed_zone_high_boundary',\n type: 'uint16_array',\n scale: 1000,\n offset: 0,\n units: 'm/s',\n },\n 8: {\n field: 'power_zone_high_boundary',\n type: 'uint16_array',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 9: {\n field: 'power_zone_high_boundary',\n type: 'uint16_array',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n 10: {\n field: 'max_heart_rate_deprecated',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 11: {\n field: 'max_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 12: {\n field: 'resting_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 13: {\n field: 'threshold_heart_rate',\n type: 'uint8',\n scale: null,\n offset: 0,\n units: 'bpm',\n },\n 14: {\n field: 'pwr_calc_type',\n type: 'pwr_zone_calc',\n scale: null,\n offset: 0,\n units: '',\n },\n 15: {\n field: 'functional_threshold_power',\n type: 'uint16',\n scale: null,\n offset: 0,\n units: 'watts',\n },\n },\n },\n types: {\n file: {\n 1: 'device',\n 2: 'settings',\n 3: 'sport',\n 4: 'activity',\n 5: 'workout',\n 6: 'course',\n 7: 'schedules',\n 9: 'weight',\n 10: 'totals',\n 11: 'goals',\n 14: 'blood_pressure',\n 15: 'monitoring_a',\n 20: 'activity_summary',\n 28: 'monitoring_daily',\n 32: 'monitoring_b',\n 34: 'segment',\n 35: 'segment_list',\n 40: 'exd_configuration',\n 247: 'mfg_range_min',\n 254: 'mfg_range_max',\n },\n mesg_num: {\n 0: 'file_id',\n 1: 'capabilities',\n 2: 'device_settings',\n 3: 'user_profile',\n 4: 'hrm_profile',\n 5: 'sdm_profile',\n 6: 'bike_profile',\n 7: 'zones_target',\n 8: 'hr_zone',\n 9: 'power_zone',\n 10: 'met_zone',\n 12: 'sport',\n 15: 'goal',\n 18: 'session',\n 19: 'lap',\n 20: 'record',\n 21: 'event',\n 23: 'device_info',\n 26: 'workout',\n 27: 'workout_step',\n 28: 'schedule',\n 30: 'weight_scale',\n 31: 'course',\n 32: 'course_point',\n 33: 'totals',\n 34: 'activity',\n 35: 'software',\n 37: 'file_capabilities',\n 38: 'mesg_capabilities',\n 39: 'field_capabilities',\n 49: 'file_creator',\n 51: 'blood_pressure',\n 53: 'speed_zone',\n 55: 'monitoring',\n 72: 'training_file',\n 78: 'hrv',\n 80: 'ant_rx',\n 81: 'ant_tx',\n 82: 'ant_channel_id',\n 101: 'length',\n 103: 'monitoring_info',\n 105: 'pad',\n 106: 'slave_device',\n 127: 'connectivity',\n 128: 'weather_conditions',\n 129: 'weather_alert',\n 131: 'cadence_zone',\n 132: 'hr',\n 140: 'activity_metrics',\n 142: 'segment_lap',\n 145: 'memo_glob',\n 148: 'segment_id',\n 149: 'segment_leaderboard_entry',\n 150: 'segment_point',\n 151: 'segment_file',\n 158: 'workout_session',\n 159: 'watchface_settings',\n 160: 'gps_metadata',\n 161: 'camera_event',\n 162: 'timestamp_correlation',\n 164: 'gyroscope_data',\n 165: 'accelerometer_data',\n 167: 'three_d_sensor_calibration',\n 169: 'video_frame',\n 174: 'obdii_data',\n 177: 'nmea_sentence',\n 178: 'aviation_attitude',\n 184: 'video',\n 185: 'video_title',\n 186: 'video_description',\n 187: 'video_clip',\n 200: 'exd_screen_configuration',\n 201: 'exd_data_field_configuration',\n 202: 'exd_data_concept_configuration',\n 206: 'field_description',\n 207: 'developer_data_id',\n 208: 'magnetometer_data',\n 209: 'barometer_data',\n 210: 'one_d_sensor_calibration',\n 225: 'set',\n 227: 'stress_level',\n 258: 'dive_settings',\n 259: 'dive_gas',\n 262: 'dive_alarm',\n 264: 'exercise_title',\n 268: 'dive_summary',\n 285: 'jump',\n 317: 'climb_pro',\n 319: 'tank_update',\n 323: 'tank_summary',\n 216: 'time_in_zone',\n 347: 'o_hr_settings',\n 65280: 'mfg_range_min',\n 65534: 'mfg_range_max',\n },\n checksum: {\n 0: 'clear',\n 1: 'ok',\n },\n file_flags: {\n 0: 0,\n 2: 'read',\n 4: 'write',\n 8: 'erase',\n },\n mesg_count: {\n 0: 'num_per_file',\n 1: 'max_per_file',\n 2: 'max_per_file_type',\n },\n date_time: {\n 0: 0,\n 268435456: 'min',\n },\n local_date_time: {\n 0: 0,\n 268435456: 'min',\n },\n message_index: {\n 0: 0,\n 4095: 'mask',\n 28672: 'reserved',\n 32768: 'selected',\n },\n gender: {\n 0: 'female',\n 1: 'male',\n },\n language: {\n 0: 'english',\n 1: 'french',\n 2: 'italian',\n 3: 'german',\n 4: 'spanish',\n 5: 'croatian',\n 6: 'czech',\n 7: 'danish',\n 8: 'dutch',\n 9: 'finnish',\n 10: 'greek',\n 11: 'hungarian',\n 12: 'norwegian',\n 13: 'polish',\n 14: 'portuguese',\n 15: 'slovakian',\n 16: 'slovenian',\n 17: 'swedish',\n 18: 'russian',\n 19: 'turkish',\n 20: 'latvian',\n 21: 'ukrainian',\n 22: 'arabic',\n 23: 'farsi',\n 24: 'bulgarian',\n 25: 'romanian',\n 26: 'chinese',\n 27: 'japanese',\n 28: 'korean',\n 29: 'taiwanese',\n 30: 'thai',\n 31: 'hebrew',\n 32: 'brazilian_portuguese',\n 33: 'indonesian',\n 34: 'malaysian',\n 35: 'vietnamese',\n 36: 'burmese',\n 37: 'mongolian',\n 254: 'custom',\n },\n language_bits_0: {\n 0: 0,\n 1: 'english',\n 2: 'french',\n 4: 'italian',\n 8: 'german',\n 16: 'spanish',\n 32: 'croatian',\n 64: 'czech',\n 128: 'danish',\n },\n language_bits_1: {\n 0: 0,\n 1: 'dutch',\n 2: 'finnish',\n 4: 'greek',\n 8: 'hungarian',\n 16: 'norwegian',\n 32: 'polish',\n 64: 'portuguese',\n 128: 'slovakian',\n },\n language_bits_2: {\n 0: 0,\n 1: 'slovenian',\n 2: 'swedish',\n 4: 'russian',\n 8: 'turkish',\n 16: 'latvian',\n 32: 'ukrainian',\n 64: 'arabic',\n 128: 'farsi',\n },\n language_bits_3: {\n 0: 0,\n 1: 'bulgarian',\n 2: 'romanian',\n 4: 'chinese',\n 8: 'japanese',\n 16: 'korean',\n 32: 'taiwanese',\n 64: 'thai',\n 128: 'hebrew',\n },\n language_bits_4: {\n 0: 0,\n 1: 'brazilian_portuguese',\n 2: 'indonesian',\n 4: 'malaysian',\n 8: 'vietnamese',\n 16: 'burmese',\n 32: 'mongolian',\n },\n time_zone: {\n 0: 'almaty',\n 1: 'bangkok',\n 2: 'bombay',\n 3: 'brasilia',\n 4: 'cairo',\n 5: 'cape_verde_is',\n 6: 'darwin',\n 7: 'eniwetok',\n 8: 'fiji',\n 9: 'hong_kong',\n 10: 'islamabad',\n 11: 'kabul',\n 12: 'magadan',\n 13: 'mid_atlantic',\n 14: 'moscow',\n 15: 'muscat',\n 16: 'newfoundland',\n 17: 'samoa',\n 18: 'sydney',\n 19: 'tehran',\n 20: 'tokyo',\n 21: 'us_alaska',\n 22: 'us_atlantic',\n 23: 'us_central',\n 24: 'us_eastern',\n 25: 'us_hawaii',\n 26: 'us_mountain',\n 27: 'us_pacific',\n 28: 'other',\n 29: 'auckland',\n 30: 'kathmandu',\n 31: 'europe_western_wet',\n 32: 'europe_central_cet',\n 33: 'europe_eastern_eet',\n 34: 'jakarta',\n 35: 'perth',\n 36: 'adelaide',\n 37: 'brisbane',\n 38: 'tasmania',\n 39: 'iceland',\n 40: 'amsterdam',\n 41: 'athens',\n 42: 'barcelona',\n 43: 'berlin',\n 44: 'brussels',\n 45: 'budapest',\n 46: 'copenhagen',\n 47: 'dublin',\n 48: 'helsinki',\n 49: 'lisbon',\n 50: 'london',\n 51: 'madrid',\n 52: 'munich',\n 53: 'oslo',\n 54: 'paris',\n 55: 'prague',\n 56: 'reykjavik',\n 57: 'rome',\n 58: 'stockholm',\n 59: 'vienna',\n 60: 'warsaw',\n 61: 'zurich',\n 62: 'quebec',\n 63: 'ontario',\n 64: 'manitoba',\n 65: 'saskatchewan',\n 66: 'alberta',\n 67: 'british_columbia',\n 68: 'boise',\n 69: 'boston',\n 70: 'chicago',\n 71: 'dallas',\n 72: 'denver',\n 73: 'kansas_city',\n 74: 'las_vegas',\n 75: 'los_angeles',\n 76: 'miami',\n 77: 'minneapolis',\n 78: 'new_york',\n 79: 'new_orleans',\n 80: 'phoenix',\n 81: 'santa_fe',\n 82: 'seattle',\n 83: 'washington_dc',\n 84: 'us_arizona',\n 85: 'chita',\n 86: 'ekaterinburg',\n 87: 'irkutsk',\n 88: 'kaliningrad',\n 89: 'krasnoyarsk',\n 90: 'novosibirsk',\n 91: 'petropavlovsk_kamchatskiy',\n 92: 'samara',\n 93: 'vladivostok',\n 94: 'mexico_central',\n 95: 'mexico_mountain',\n 96: 'mexico_pacific',\n 97: 'cape_town',\n 98: 'winkhoek',\n 99: 'lagos',\n 100: 'riyahd',\n 101: 'venezuela',\n 102: 'australia_lh',\n 103: 'santiago',\n 253: 'manual',\n 254: 'automatic',\n },\n display_measure: {\n 0: 'metric',\n 1: 'statute',\n 2: 'nautical',\n },\n display_heart: {\n 0: 'bpm',\n 1: 'max',\n 2: 'reserve',\n },\n display_power: {\n 0: 'watts',\n 1: 'percent_ftp',\n },\n display_position: {\n 0: 'degree',\n 1: 'degree_minute',\n 2: 'degree_minute_second',\n 3: 'austrian_grid',\n 4: 'british_grid',\n 5: 'dutch_grid',\n 6: 'hungarian_grid',\n 7: 'finnish_grid',\n 8: 'german_grid',\n 9: 'icelandic_grid',\n 10: 'indonesian_equatorial',\n 11: 'indonesian_irian',\n 12: 'indonesian_southern',\n 13: 'india_zone_0',\n 14: 'india_zone_IA',\n 15: 'india_zone_IB',\n 16: 'india_zone_IIA',\n 17: 'india_zone_IIB',\n 18: 'india_zone_IIIA',\n 19: 'india_zone_IIIB',\n 20: 'india_zone_IVA',\n 21: 'india_zone_IVB',\n 22: 'irish_transverse',\n 23: 'irish_grid',\n 24: 'loran',\n 25: 'maidenhead_grid',\n 26: 'mgrs_grid',\n 27: 'new_zealand_grid',\n 28: 'new_zealand_transverse',\n 29: 'qatar_grid',\n 30: 'modified_swedish_grid',\n 31: 'swedish_grid',\n 32: 'south_african_grid',\n 33: 'swiss_grid',\n 34: 'taiwan_grid',\n 35: 'united_states_grid',\n 36: 'utm_ups_grid',\n 37: 'west_malayan',\n 38: 'borneo_rso',\n 39: 'estonian_grid',\n 40: 'latvian_grid',\n 41: 'swedish_ref_99_grid',\n },\n switch: {\n 0: 'off',\n 1: 'on',\n 2: 'auto',\n },\n sport: {\n 0: 'generic',\n 1: 'running',\n 2: 'cycling',\n 3: 'transition',\n 4: 'fitness_equipment',\n 5: 'swimming',\n 6: 'basketball',\n 7: 'soccer',\n 8: 'tennis',\n 9: 'american_football',\n 10: 'training',\n 11: 'walking',\n 12: 'cross_country_skiing',\n 13: 'alpine_skiing',\n 14: 'snowboarding',\n 15: 'rowing',\n 16: 'mountaineering',\n 17: 'hiking',\n 18: 'multisport',\n 19: 'paddling',\n 20: 'flying',\n 21: 'e_biking',\n 22: 'motorcycling',\n 23: 'boating',\n 24: 'driving',\n 25: 'golf',\n 26: 'hang_gliding',\n 27: 'horseback_riding',\n 28: 'hunting',\n 29: 'fishing',\n 30: 'inline_skating',\n 31: 'rock_climbing',\n 32: 'sailing',\n 33: 'ice_skating',\n 34: 'sky_diving',\n 35: 'snowshoeing',\n 36: 'snowmobiling',\n 37: 'stand_up_paddleboarding',\n 38: 'surfing',\n 39: 'wakeboarding',\n 40: 'water_skiing',\n 41: 'kayaking',\n 42: 'rafting',\n 43: 'windsurfing',\n 44: 'kitesurfing',\n 45: 'tactical',\n 46: 'jumpmaster',\n 47: 'boxing',\n 48: 'floor_climbing',\n 53: 'diving',\n 254: 'all',\n },\n sport_bits_0: {\n 0: 0,\n 1: 'generic',\n 2: 'running',\n 4: 'cycling',\n 8: 'transition',\n 16: 'fitness_equipment',\n 32: 'swimming',\n 64: 'basketball',\n 128: 'soccer',\n },\n sport_bits_1: {\n 0: 0,\n 1: 'tennis',\n 2: 'american_football',\n 4: 'training',\n 8: 'walking',\n 16: 'cross_country_skiing',\n 32: 'alpine_skiing',\n 64: 'snowboarding',\n 128: 'rowing',\n },\n sport_bits_2: {\n 0: 0,\n 1: 'mountaineering',\n 2: 'hiking',\n 4: 'multisport',\n 8: 'paddling',\n 16: 'flying',\n 32: 'e_biking',\n 64: 'motorcycling',\n 128: 'boating',\n },\n sport_bits_3: {\n 0: 0,\n 1: 'driving',\n 2: 'golf',\n 4: 'hang_gliding',\n 8: 'horseback_riding',\n 16: 'hunting',\n 32: 'fishing',\n 64: 'inline_skating',\n 128: 'rock_climbing',\n },\n sport_bits_4: {\n 0: 0,\n 1: 'sailing',\n 2: 'ice_skating',\n 4: 'sky_diving',\n 8: 'snowshoeing',\n 16: 'snowmobiling',\n 32: 'stand_up_paddleboarding',\n 64: 'surfing',\n 128: 'wakeboarding',\n },\n sport_bits_5: {\n 0: 0,\n 1: 'water_skiing',\n 2: 'kayaking',\n 4: 'rafting',\n 8: 'windsurfing',\n 16: 'kitesurfing',\n 32: 'tactical',\n 64: 'jumpmaster',\n 128: 'boxing',\n },\n sport_bits_6: {\n 0: 0,\n 1: 'floor_climbing',\n },\n sub_sport: {\n 0: 'generic',\n 1: 'treadmill',\n 2: 'street',\n 3: 'trail',\n 4: 'track',\n 5: 'spin',\n 6: 'indoor_cycling',\n 7: 'road',\n 8: 'mountain',\n 9: 'downhill',\n 10: 'recumbent',\n 11: 'cyclocross',\n 12: 'hand_cycling',\n 13: 'track_cycling',\n 14: 'indoor_rowing',\n 15: 'elliptical',\n 16: 'stair_climbing',\n 17: 'lap_swimming',\n 18: 'open_water',\n 19: 'flexibility_training',\n 20: 'strength_training',\n 21: 'warm_up',\n 22: 'match',\n 23: 'exercise',\n 24: 'challenge',\n 25: 'indoor_skiing',\n 26: 'cardio_training',\n 27: 'indoor_walking',\n 28: 'e_bike_fitness',\n 29: 'bmx',\n 30: 'casual_walking',\n 31: 'speed_walking',\n 32: 'bike_to_run_transition',\n 33: 'run_to_bike_transition',\n 34: 'swim_to_bike_transition',\n 35: 'atv',\n 36: 'motocross',\n 37: 'backcountry',\n 38: 'resort',\n 39: 'rc_drone',\n 40: 'wingsuit',\n 41: 'whitewater',\n 42: 'skate_skiing',\n 43: 'yoga',\n 44: 'pilates',\n 45: 'indoor_running',\n 46: 'gravel_cycling',\n 47: 'e_bike_mountain',\n 48: 'commuting',\n 49: 'mixed_surface',\n 50: 'navigate',\n 51: 'track_me',\n 52: 'map',\n 53: 'single_gas_diving',\n 54: 'multi_gas_diving',\n 55: 'gauge_diving',\n 56: 'apnea_diving',\n 57: 'apnea_hunting',\n 58: 'virtual_activity',\n 59: 'obstacle',\n 254: 'all',\n },\n sport_event: {\n 0: 'uncategorized',\n 1: 'geocaching',\n 2: 'fitness',\n 3: 'recreation',\n 4: 'race',\n 5: 'special_event',\n 6: 'training',\n 7: 'transportation',\n 8: 'touring',\n },\n activity: {\n 0: 'manual',\n 1: 'auto_multi_sport',\n },\n intensity: {\n 0: 'active',\n 1: 'rest',\n 2: 'warmup',\n 3: 'cooldown',\n 4: 'recovery',\n 5: 'interval',\n 6: 'other',\n },\n session_trigger: {\n 0: 'activity_end',\n 1: 'manual',\n 2: 'auto_multi_sport',\n 3: 'fitness_equipment',\n },\n autolap_trigger: {\n 0: 'time',\n 1: 'distance',\n 2: 'position_start',\n 3: 'position_lap',\n 4: 'position_waypoint',\n 5: 'position_marked',\n 6: 'off',\n },\n lap_trigger: {\n 0: 'manual',\n 1: 'time',\n 2: 'distance',\n 3: 'position_start',\n 4: 'position_lap',\n 5: 'position_waypoint',\n 6: 'position_marked',\n 7: 'session_end',\n 8: 'fitness_equipment',\n },\n time_mode: {\n 0: 'hour12',\n 1: 'hour24',\n 2: 'military',\n 3: 'hour_12_with_seconds',\n 4: 'hour_24_with_seconds',\n 5: 'utc',\n },\n backlight_mode: {\n 0: 'off',\n 1: 'manual',\n 2: 'key_and_messages',\n 3: 'auto_brightness',\n 4: 'smart_notifications',\n 5: 'key_and_messages_night',\n 6: 'key_and_messages_and_smart_notifications',\n },\n date_mode: {\n 0: 'day_month',\n 1: 'month_day',\n },\n backlight_timeout: {\n 0: 'infinite',\n },\n event: {\n 0: 'timer',\n 3: 'workout',\n 4: 'workout_step',\n 5: 'power_down',\n 6: 'power_up',\n 7: 'off_course',\n 8: 'session',\n 9: 'lap',\n 10: 'course_point',\n 11: 'battery',\n 12: 'virtual_partner_pace',\n 13: 'hr_high_alert',\n 14: 'hr_low_alert',\n 15: 'speed_high_alert',\n 16: 'speed_low_alert',\n 17: 'cad_high_alert',\n 18: 'cad_low_alert',\n 19: 'power_high_alert',\n 20: 'power_low_alert',\n 21: 'recovery_hr',\n 22: 'battery_low',\n 23: 'time_duration_alert',\n 24: 'distance_duration_alert',\n 25: 'calorie_duration_alert',\n 26: 'activity',\n 27: 'fitness_equipment',\n 28: 'length',\n 32: 'user_marker',\n 33: 'sport_point',\n 36: 'calibration',\n 42: 'front_gear_change',\n 43: 'rear_gear_change',\n 44: 'rider_position_change',\n 45: 'elev_high_alert',\n 46: 'elev_low_alert',\n 47: 'comm_timeout',\n },\n event_type: {\n 0: 'start',\n 1: 'stop',\n 2: 'consecutive_depreciated',\n 3: 'marker',\n 4: 'stop_all',\n 5: 'begin_depreciated',\n 6: 'end_depreciated',\n 7: 'end_all_depreciated',\n 8: 'stop_disable',\n 9: 'stop_disable_all',\n },\n timer_trigger: {\n 0: 'manual',\n 1: 'auto',\n 2: 'fitness_equipment',\n },\n fitness_equipment_state: {\n 0: 'ready',\n 1: 'in_use',\n 2: 'paused',\n 3: 'unknown',\n },\n tone: {\n 0: 'off',\n 1: 'tone',\n 2: 'vibrate',\n 3: 'tone_and_vibrate',\n },\n autoscroll: {\n 0: 'none',\n 1: 'slow',\n 2: 'medium',\n 3: 'fast',\n },\n activity_class: {\n 0: 0,\n 100: 'level_max',\n 127: 'level',\n 128: 'athlete',\n },\n hr_zone_calc: {\n 0: 'custom',\n 1: 'percent_max_hr',\n 2: 'percent_hrr',\n },\n pwr_zone_calc: {\n 0: 'custom',\n 1: 'percent_ftp',\n },\n wkt_step_duration: {\n 0: 'time',\n 1: 'distance',\n 2: 'hr_less_than',\n 3: 'hr_greater_than',\n 4: 'calories',\n 5: 'open',\n 6: 'repeat_until_steps_cmplt',\n 7: 'repeat_until_time',\n 8: 'repeat_until_distance',\n 9: 'repeat_until_calories',\n 10: 'repeat_until_hr_less_than',\n 11: 'repeat_until_hr_greater_than',\n 12: 'repeat_until_power_less_than',\n 13: 'repeat_until_power_greater_than',\n 14: 'power_less_than',\n 15: 'power_greater_than',\n 16: 'training_peaks_tss',\n 17: 'repeat_until_power_last_lap_less_than',\n 18: 'repeat_until_max_power_last_lap_less_than',\n 19: 'power_3s_less_than',\n 20: 'power_10s_less_than',\n 21: 'power_30s_less_than',\n 22: 'power_3s_greater_than',\n 23: 'power_10s_greater_than',\n 24: 'power_30s_greater_than',\n 25: 'power_lap_less_than',\n 26: 'power_lap_greater_than',\n 27: 'repeat_until_training_peaks_tss',\n 28: 'repetition_time',\n 29: 'reps',\n },\n wkt_step_target: {\n 0: 'speed',\n 1: 'heart_rate',\n 2: 'open',\n 3: 'cadence',\n 4: 'power',\n 5: 'grade',\n 6: 'resistance',\n 7: 'power_3s',\n 8: 'power_10s',\n 9: 'power_30s',\n 10: 'power_lap',\n 11: 'swim_stroke',\n 12: 'speed_lap',\n 13: 'heart_rate_lap',\n },\n goal: {\n 0: 'time',\n 1: 'distance',\n 2: 'calories',\n 3: 'frequency',\n 4: 'steps',\n 5: 'ascent',\n 6: 'active_minutes',\n },\n goal_recurrence: {\n 0: 'off',\n 1: 'daily',\n 2: 'weekly',\n 3: 'monthly',\n 4: 'yearly',\n 5: 'custom',\n },\n goal_source: {\n 0: 'auto',\n 1: 'community',\n 2: 'user',\n },\n schedule: {\n 0: 'workout',\n 1: 'course',\n },\n course_point: {\n 0: 'generic',\n 1: 'summit',\n 2: 'valley',\n 3: 'water',\n 4: 'food',\n 5: 'danger',\n 6: 'left',\n 7: 'right',\n 8: 'straight',\n 9: 'first_aid',\n 10: 'fourth_category',\n 11: 'third_category',\n 12: 'second_category',\n 13: 'first_category',\n 14: 'hors_category',\n 15: 'sprint',\n 16: 'left_fork',\n 17: 'right_fork',\n 18: 'middle_fork',\n 19: 'slight_left',\n 20: 'sharp_left',\n 21: 'slight_right',\n 22: 'sharp_right',\n 23: 'u_turn',\n 24: 'segment_start',\n 25: 'segment_end',\n },\n manufacturer: {\n 0: 0,\n 1: 'garmin',\n 2: 'garmin_fr405_antfs',\n 3: 'zephyr',\n 4: 'dayton',\n 5: 'idt',\n 6: 'srm',\n 7: 'quarq',\n 8: 'ibike',\n 9: 'saris',\n 10: 'spark_hk',\n 11: 'tanita',\n 12: 'echowell',\n 13: 'dynastream_oem',\n 14: 'nautilus',\n 15: 'dynastream',\n 16: 'timex',\n 17: 'metrigear',\n 18: 'xelic',\n 19: 'beurer',\n 20: 'cardiosport',\n 21: 'a_and_d',\n 22: 'hmm',\n 23: 'suunto',\n 24: 'thita_elektronik',\n 25: 'gpulse',\n 26: 'clean_mobile',\n 27: 'pedal_brain',\n 28: 'peaksware',\n 29: 'saxonar',\n 30: 'lemond_fitness',\n 31: 'dexcom',\n 32: 'wahoo_fitness',\n 33: 'octane_fitness',\n 34: 'archinoetics',\n 35: 'the_hurt_box',\n 36: 'citizen_systems',\n 37: 'magellan',\n 38: 'osynce',\n 39: 'holux',\n 40: 'concept2',\n 42: 'one_giant_leap',\n 43: 'ace_sensor',\n 44: 'brim_brothers',\n 45: 'xplova',\n 46: 'perception_digital',\n 47: 'bf1systems',\n 48: 'pioneer',\n 49: 'spantec',\n 50: 'metalogics',\n 51: '4iiiis',\n 52: 'seiko_epson',\n 53: 'seiko_epson_oem',\n 54: 'ifor_powell',\n 55: 'maxwell_guider',\n 56: 'star_trac',\n 57: 'breakaway',\n 58: 'alatech_technology_ltd',\n 59: 'mio_technology_europe',\n 60: 'rotor',\n 61: 'geonaute',\n 62: 'id_bike',\n 63: 'specialized',\n 64: 'wtek',\n 65: 'physical_enterprises',\n 66: 'north_pole_engineering',\n 67: 'bkool',\n 68: 'cateye',\n 69: 'stages_cycling',\n 70: 'sigmasport',\n 71: 'tomtom',\n 72: 'peripedal',\n 73: 'wattbike',\n 76: 'moxy',\n 77: 'ciclosport',\n 78: 'powerbahn',\n 79: 'acorn_projects_aps',\n 80: 'lifebeam',\n 81: 'bontrager',\n 82: 'wellgo',\n 83: 'scosche',\n 84: 'magura',\n 85: 'woodway',\n 86: 'elite',\n 87: 'nielsen_kellerman',\n 88: 'dk_city',\n 89: 'tacx',\n 90: 'direction_technology',\n 91: 'magtonic',\n 92: '1partcarbon',\n 93: 'inside_ride_technologies',\n 94: 'sound_of_motion',\n 95: 'stryd',\n 96: 'icg',\n 97: 'mipulse',\n 98: 'bsx_athletics',\n 99: 'look',\n 100: 'campagnolo_srl',\n 101: 'body_bike_smart',\n 102: 'praxisworks',\n 103: 'limits_technology',\n 104: 'topaction_technology',\n 105: 'cosinuss',\n 106: 'fitcare',\n 107: 'magene',\n 108: 'giant_manufacturing_co',\n 109: 'tigrasport',\n 110: 'salutron',\n 111: 'technogym',\n 112: 'bryton_sensors',\n 113: 'latitude_limited',\n 114: 'soaring_technology',\n 115: 'igpsport',\n 116: 'thinkrider',\n 117: 'gopher_sport',\n 118: 'waterrower',\n 119: 'orangetheory',\n 120: 'inpeak',\n 121: 'kinetic',\n 122: 'johnson_health_tech',\n 123: 'polar_electro',\n 124: 'seesense',\n 125: 'nci_technology',\n 255: 'development',\n 257: 'healthandlife',\n 258: 'lezyne',\n 259: 'scribe_labs',\n 260: 'zwift',\n 261: 'watteam',\n 262: 'recon',\n 263: 'favero_electronics',\n 264: 'dynovelo',\n 265: 'strava',\n 266: 'precor',\n 267: 'bryton',\n 268: 'sram',\n 269: 'navman',\n 270: 'cobi',\n 271: 'spivi',\n 272: 'mio_magellan',\n 273: 'evesports',\n 274: 'sensitivus_gauge',\n 275: 'podoon',\n 276: 'life_time_fitness',\n 277: 'falco_e_motors',\n 278: 'minoura',\n 279: 'cycliq',\n 280: 'luxottica',\n 281: 'trainer_road',\n 282: 'the_sufferfest',\n 283: 'fullspeedahead',\n 284: 'virtualtraining',\n 285: 'feedbacksports',\n 286: 'omata',\n 287: 'vdo',\n 288: 'magneticdays',\n 289: 'hammerhead',\n 290: 'kinetic_by_kurt',\n 291: 'shapelog',\n 292: 'dabuziduo',\n 293: 'jetblack',\n 294: 'coros',\n 295: 'virtugo',\n 296: 'velosense',\n 5759: 'actigraphcorp',\n },\n garmin_product: {\n 0: 'hrm_bike',\n 1: 'hrm1',\n 2: 'axh01',\n 3: 'axb01',\n 4: 'axb02',\n 5: 'hrm2ss',\n 6: 'dsi_alf02',\n 7: 'hrm3ss',\n 8: 'hrm_run_single_byte_product_id',\n 9: 'bsm',\n 10: 'bcm',\n 11: 'axs01',\n 12: 'hrm_tri_single_byte_product_id',\n 14: 'fr225_single_byte_product_id',\n 473: 'fr301_china',\n 474: 'fr301_japan',\n 475: 'fr301_korea',\n 494: 'fr301_taiwan',\n 717: 'fr405',\n 782: 'fr50',\n 987: 'fr405_japan',\n 988: 'fr60',\n 1011: 'dsi_alf01',\n 1018: 'fr310xt',\n 1036: 'edge500',\n 1124: 'fr110',\n 1169: 'edge800',\n 1199: 'edge500_taiwan',\n 1213: 'edge500_japan',\n 1253: 'chirp',\n 1274: 'fr110_japan',\n 1325: 'edge200',\n 1328: 'fr910xt',\n 1333: 'edge800_taiwan',\n 1334: 'edge800_japan',\n 1341: 'alf04',\n 1345: 'fr610',\n 1360: 'fr210_japan',\n 1380: 'vector_ss',\n 1381: 'vector_cp',\n 1386: 'edge800_china',\n 1387: 'edge500_china',\n 1410: 'fr610_japan',\n 1422: 'edge500_korea',\n 1436: 'fr70',\n 1446: 'fr310xt_4t',\n 1461: 'amx',\n 1482: 'fr10',\n 1497: 'edge800_korea',\n 1499: 'swim',\n 1537: 'fr910xt_china',\n 1551: 'fenix',\n 1555: 'edge200_taiwan',\n 1561: 'edge510',\n 1567: 'edge810',\n 1570: 'tempe',\n 1600: 'fr910xt_japan',\n 1623: 'fr620',\n 1632: 'fr220',\n 1664: 'fr910xt_korea',\n 1688: 'fr10_japan',\n 1721: 'edge810_japan',\n 1735: 'virb_elite',\n 1736: 'edge_touring',\n 1742: 'edge510_japan',\n 1743: 'hrm_tri',\n 1752: 'hrm_run',\n 1765: 'fr920xt',\n 1821: 'edge510_asia',\n 1822: 'edge810_china',\n 1823: 'edge810_taiwan',\n 1836: 'edge1000',\n 1837: 'vivo_fit',\n 1853: 'virb_remote',\n 1885: 'vivo_ki',\n 1903: 'fr15',\n 1907: 'vivo_active',\n 1918: 'edge510_korea',\n 1928: 'fr620_japan',\n 1929: 'fr620_china',\n 1930: 'fr220_japan',\n 1931: 'fr220_china',\n 1936: 'approach_s6',\n 1956: 'vivo_smart',\n 1967: 'fenix2',\n 1988: 'epix',\n 2050: 'fenix3',\n 2052: 'edge1000_taiwan',\n 2053: 'edge1000_japan',\n 2061: 'fr15_japan',\n 2067: 'edge520',\n 2070: 'edge1000_china',\n 2072: 'fr620_russia',\n 2073: 'fr220_russia',\n 2079: 'vector_s',\n 2100: 'edge1000_korea',\n 2130: 'fr920xt_taiwan',\n 2131: 'fr920xt_china',\n 2132: 'fr920xt_japan',\n 2134: 'virbx',\n 2135: 'vivo_smart_apac',\n 2140: 'etrex_touch',\n 2147: 'edge25',\n 2148: 'fr25',\n 2150: 'vivo_fit2',\n 2153: 'fr225',\n 2156: 'fr630',\n 2157: 'fr230',\n 2158: 'fr735xt',\n 2160: 'vivo_active_apac',\n 2161: 'vector_2',\n 2162: 'vector_2s',\n 2172: 'virbxe',\n 2173: 'fr620_taiwan',\n 2174: 'fr220_taiwan',\n 2175: 'truswing',\n 2188: 'fenix3_china',\n 2189: 'fenix3_twn',\n 2192: 'varia_headlight',\n 2193: 'varia_taillight_old',\n 2204: 'edge_explore_1000',\n 2219: 'fr225_asia',\n 2225: 'varia_radar_taillight',\n 2226: 'varia_radar_display',\n 2238: 'edge20',\n 2262: 'd2_bravo',\n 2266: 'approach_s20',\n 2276: 'varia_remote',\n 2327: 'hrm4_run',\n 2337: 'vivo_active_hr',\n 2348: 'vivo_smart_hr',\n 2368: 'vivo_move',\n 2398: 'varia_vision',\n 2406: 'vivo_fit3',\n 2413: 'fenix3_hr',\n 2417: 'virb_ultra_30',\n 2429: 'index_smart_scale',\n 2431: 'fr235',\n 2432: 'fenix3_chronos',\n 2441: 'oregon7xx',\n 2444: 'rino7xx',\n 2496: 'nautix',\n 2530: 'edge_820',\n 2531: 'edge_explore_820',\n 2544: 'fenix5s',\n 2547: 'd2_bravo_titanium',\n 2567: 'varia_ut800',\n 2593: 'running_dynamics_pod',\n 2604: 'fenix5x',\n 2606: 'vivo_fit_jr',\n 2691: 'fr935',\n 2697: 'fenix5',\n 2859: 'descent',\n 10007: 'sdm4',\n 10014: 'edge_remote',\n 20119: 'training_center',\n 65531: 'connectiq_simulator',\n 65532: 'android_antplus_plugin',\n 65534: 'connect',\n },\n antplus_device_type: {\n 1: 'antfs',\n 11: 'bike_power',\n 12: 'environment_sensor_legacy',\n 15: 'multi_sport_speed_distance',\n 16: 'control',\n 17: 'fitness_equipment',\n 18: 'blood_pressure',\n 19: 'geocache_node',\n 20: 'light_electric_vehicle',\n 25: 'env_sensor',\n 26: 'racquet',\n 27: 'control_hub',\n 31: 'muscle_oxygen',\n 34: 'shifting',\n 35: 'bike_light_main',\n 36: 'bike_light_shared',\n 38: 'exd',\n 40: 'bike_radar',\n 46: 'bike_aero',\n 119: 'weight_scale',\n 120: 'heart_rate',\n 121: 'bike_speed_cadence',\n 122: 'bike_cadence',\n 123: 'bike_speed',\n 124: 'stride_speed_distance',\n },\n local_device_type: {\n 0: 'gps',\n 1: 'glonass',\n 2: 'gps_glonass',\n 3: 'accelerometer',\n 4: 'barometer',\n 5: 'temperature',\n 10: 'whr',\n 12: 'sensor_hub',\n },\n ble_device_type: {\n 0: 'connected_gps',\n 1: 'heart_rate',\n 2: 'bike_power',\n 3: 'bike_speed_cadence',\n 4: 'bike_speed',\n 5: 'bike_cadence',\n 6: 'footpod',\n 7: 'bike_trainer',\n },\n ant_network: {\n 0: 'public',\n 1: 'antplus',\n 2: 'antfs',\n 3: 'private',\n },\n workout_capabilities: {\n 0: 0,\n 1: 'interval',\n 2: 'custom',\n 4: 'fitness_equipment',\n 8: 'firstbeat',\n 16: 'new_leaf',\n 32: 'tcx',\n 128: 'speed',\n 256: 'heart_rate',\n 512: 'distance',\n 1024: 'cadence',\n 2048: 'power',\n 4096: 'grade',\n 8192: 'resistance',\n 16384: 'protected',\n },\n battery_status: {\n 0: 0,\n 1: 'new',\n 2: 'good',\n 3: 'ok',\n 4: 'low',\n 5: 'critical',\n 6: 'charging',\n 7: 'unknown',\n },\n hr_type: {\n 0: 'normal',\n 1: 'irregular',\n },\n course_capabilities: {\n 0: 0,\n 1: 'processed',\n 2: 'valid',\n 4: 'time',\n 8: 'distance',\n 16: 'position',\n 32: 'heart_rate',\n 64: 'power',\n 128: 'cadence',\n 256: 'training',\n 512: 'navigation',\n 1024: 'bikeway',\n },\n weight: {\n 0: 0,\n 65534: 'calculating',\n },\n workout_hr: {\n 0: 0,\n 100: 'bpm_offset',\n },\n workout_power: {\n 0: 0,\n 1000: 'watts_offset',\n },\n bp_status: {\n 0: 'no_error',\n 1: 'error_incomplete_data',\n 2: 'error_no_measurement',\n 3: 'error_data_out_of_range',\n 4: 'error_irregular_heart_rate',\n },\n user_local_id: {\n 0: 'local_min',\n 15: 'local_max',\n 16: 'stationary_min',\n 255: 'stationary_max',\n 256: 'portable_min',\n 65534: 'portable_max',\n },\n swim_stroke: {\n 0: 'freestyle',\n 1: 'backstroke',\n 2: 'breaststroke',\n 3: 'butterfly',\n 4: 'drill',\n 5: 'mixed',\n 6: 'im',\n },\n activity_type: {\n 0: 'generic',\n 1: 'running',\n 2: 'cycling',\n 3: 'transition',\n 4: 'fitness_equipment',\n 5: 'swimming',\n 6: 'walking',\n 8: 'sedentary',\n 254: 'all',\n },\n activity_subtype: {\n 0: 'generic',\n 1: 'treadmill',\n 2: 'street',\n 3: 'trail',\n 4: 'track',\n 5: 'spin',\n 6: 'indoor_cycling',\n 7: 'road',\n 8: 'mountain',\n 9: 'downhill',\n 10: 'recumbent',\n 11: 'cyclocross',\n 12: 'hand_cycling',\n 13: 'track_cycling',\n 14: 'indoor_rowing',\n 15: 'elliptical',\n 16: 'stair_climbing',\n 17: 'lap_swimming',\n 18: 'open_water',\n 254: 'all',\n },\n activity_level: {\n 0: 'low',\n 1: 'medium',\n 2: 'high',\n },\n side: {\n 0: 'right',\n 1: 'left',\n },\n left_right_balance: {\n 0: 0,\n 127: 'mask',\n 128: 'right',\n },\n left_right_balance_100: {\n 0: 0,\n 16383: 'mask',\n 32768: 'right',\n },\n length_type: {\n 0: 'idle',\n 1: 'active',\n },\n day_of_week: {\n 0: 'sunday',\n 1: 'monday',\n 2: 'tuesday',\n 3: 'wednesday',\n 4: 'thursday',\n 5: 'friday',\n 6: 'saturday',\n },\n connectivity_capabilities: {\n 0: 0,\n 1: 'bluetooth',\n 2: 'bluetooth_le',\n 4: 'ant',\n 8: 'activity_upload',\n 16: 'course_download',\n 32: 'workout_download',\n 64: 'live_track',\n 128: 'weather_conditions',\n 256: 'weather_alerts',\n 512: 'gps_ephemeris_download',\n 1024: 'explicit_archive',\n 2048: 'setup_incomplete',\n 4096: 'continue_sync_after_software_update',\n 8192: 'connect_iq_app_download',\n 16384: 'golf_course_download',\n 32768: 'device_initiates_sync',\n 65536: 'connect_iq_watch_app_download',\n 131072: 'connect_iq_widget_download',\n 262144: 'connect_iq_watch_face_download',\n 524288: 'connect_iq_data_field_download',\n 1048576: 'connect_iq_app_managment',\n 2097152: 'swing_sensor',\n 4194304: 'swing_sensor_remote',\n 8388608: 'incident_detection',\n 16777216: 'audio_prompts',\n 33554432: 'wifi_verification',\n 67108864: 'true_up',\n 134217728: 'find_my_watch',\n 268435456: 'remote_manual_sync',\n 536870912: 'live_track_auto_start',\n 1073741824: 'live_track_messaging',\n 2147483648: 'instant_input',\n },\n weather_report: {\n 0: 'current',\n 1: 'hourly_forecast',\n 2: 'daily_forecast',\n },\n weather_status: {\n 0: 'clear',\n 1: 'partly_cloudy',\n 2: 'mostly_cloudy',\n 3: 'rain',\n 4: 'snow',\n 5: 'windy',\n 6: 'thunderstorms',\n 7: 'wintry_mix',\n 8: 'fog',\n 11: 'hazy',\n 12: 'hail',\n 13: 'scattered_showers',\n 14: 'scattered_thunderstorms',\n 15: 'unknown_precipitation',\n 16: 'light_rain',\n 17: 'heavy_rain',\n 18: 'light_snow',\n 19: 'heavy_snow',\n 20: 'light_rain_snow',\n 21: 'heavy_rain_snow',\n 22: 'cloudy',\n },\n weather_severity: {\n 0: 'unknown',\n 1: 'warning',\n 2: 'watch',\n 3: 'advisory',\n 4: 'statement',\n },\n weather_severe_type: {\n 0: 'unspecified',\n 1: 'tornado',\n 2: 'tsunami',\n 3: 'hurricane',\n 4: 'extreme_wind',\n 5: 'typhoon',\n 6: 'inland_hurricane',\n 7: 'hurricane_force_wind',\n 8: 'waterspout',\n 9: 'severe_thunderstorm',\n 10: 'wreckhouse_winds',\n 11: 'les_suetes_wind',\n 12: 'avalanche',\n 13: 'flash_flood',\n 14: 'tropical_storm',\n 15: 'inland_tropical_storm',\n 16: 'blizzard',\n 17: 'ice_storm',\n 18: 'freezing_rain',\n 19: 'debris_flow',\n 20: 'flash_freeze',\n 21: 'dust_storm',\n 22: 'high_wind',\n 23: 'winter_storm',\n 24: 'heavy_freezing_spray',\n 25: 'extreme_cold',\n 26: 'wind_chill',\n 27: 'cold_wave',\n 28: 'heavy_snow_alert',\n 29: 'lake_effect_blowing_snow',\n 30: 'snow_squall',\n 31: 'lake_effect_snow',\n 32: 'winter_weather',\n 33: 'sleet',\n 34: 'snowfall',\n 35: 'snow_and_blowing_snow',\n 36: 'blowing_snow',\n 37: 'snow_alert',\n 38: 'arctic_outflow',\n 39: 'freezing_drizzle',\n 40: 'storm',\n 41: 'storm_surge',\n 42: 'rainfall',\n 43: 'areal_flood',\n 44: 'coastal_flood',\n 45: 'lakeshore_flood',\n 46: 'excessive_heat',\n 47: 'heat',\n 48: 'weather',\n 49: 'high_heat_and_humidity',\n 50: 'humidex_and_health',\n 51: 'humidex',\n 52: 'gale',\n 53: 'freezing_spray',\n 54: 'special_marine',\n 55: 'squall',\n 56: 'strong_wind',\n 57: 'lake_wind',\n 58: 'marine_weather',\n 59: 'wind',\n 60: 'small_craft_hazardous_seas',\n 61: 'hazardous_seas',\n 62: 'small_craft',\n 63: 'small_craft_winds',\n 64: 'small_craft_rough_bar',\n 65: 'high_water_level',\n 66: 'ashfall',\n 67: 'freezing_fog',\n 68: 'dense_fog',\n 69: 'dense_smoke',\n 70: 'blowing_dust',\n 71: 'hard_freeze',\n 72: 'freeze',\n 73: 'frost',\n 74: 'fire_weather',\n 75: 'flood',\n 76: 'rip_tide',\n 77: 'high_surf',\n 78: 'smog',\n 79: 'air_quality',\n 80: 'brisk_wind',\n 81: 'air_stagnation',\n 82: 'low_water',\n 83: 'hydrological',\n 84: 'special_weather',\n },\n stroke_type: {\n 0: 'no_event',\n 1: 'other',\n 2: 'serve',\n 3: 'forehand',\n 4: 'backhand',\n 5: 'smash',\n },\n body_location: {\n 0: 'left_leg',\n 1: 'left_calf',\n 2: 'left_shin',\n 3: 'left_hamstring',\n 4: 'left_quad',\n 5: 'left_glute',\n 6: 'right_leg',\n 7: 'right_calf',\n 8: 'right_shin',\n 9: 'right_hamstring',\n 10: 'right_quad',\n 11: 'right_glute',\n 12: 'torso_back',\n 13: 'left_lower_back',\n 14: 'left_upper_back',\n 15: 'right_lower_back',\n 16: 'right_upper_back',\n 17: 'torso_front',\n 18: 'left_abdomen',\n 19: 'left_chest',\n 20: 'right_abdomen',\n 21: 'right_chest',\n 22: 'left_arm',\n 23: 'left_shoulder',\n 24: 'left_bicep',\n 25: 'left_tricep',\n 26: 'left_brachioradialis',\n 27: 'left_forearm_extensors',\n 28: 'right_arm',\n 29: 'right_shoulder',\n 30: 'right_bicep',\n 31: 'right_tricep',\n 32: 'right_brachioradialis',\n 33: 'right_forearm_extensors',\n 34: 'neck',\n 35: 'throat',\n 36: 'waist_mid_back',\n 37: 'waist_front',\n 38: 'waist_left',\n 39: 'waist_right',\n },\n segment_lap_status: {\n 0: 'end',\n 1: 'fail',\n },\n segment_leaderboard_type: {\n 0: 'overall',\n 1: 'personal_best',\n 2: 'connections',\n 3: 'group',\n 4: 'challenger',\n 5: 'kom',\n 6: 'qom',\n 7: 'pr',\n 8: 'goal',\n 9: 'rival',\n 10: 'club_leader',\n },\n segment_delete_status: {\n 0: 'do_not_delete',\n 1: 'delete_one',\n 2: 'delete_all',\n },\n segment_selection_type: {\n 0: 'starred',\n 1: 'suggested',\n },\n source_type: {\n 0: 'ant',\n 1: 'antplus',\n 2: 'bluetooth',\n 3: 'bluetooth_low_energy',\n 4: 'wifi',\n 5: 'local',\n },\n display_orientation: {\n 0: 'auto',\n 1: 'portrait',\n 2: 'landscape',\n 3: 'portrait_flipped',\n 4: 'landscape_flipped',\n },\n workout_equipment: {\n 0: 'none',\n 1: 'swim_fins',\n 2: 'swim_kickboard',\n 3: 'swim_paddles',\n 4: 'swim_pull_buoy',\n 5: 'swim_snorkel',\n },\n watchface_mode: {\n 0: 'digital',\n 1: 'analog',\n 2: 'connect_iq',\n 3: 'disabled',\n },\n digital_watchface_layout: {\n 0: 'traditional',\n 1: 'modern',\n 2: 'bold',\n },\n analog_watchface_layout: {\n 0: 'minimal',\n 1: 'traditional',\n 2: 'modern',\n },\n rider_position_type: {\n 0: 'seated',\n 1: 'standing',\n 2: 'transition_to_seated',\n 3: 'transition_to_standing',\n },\n power_phase_type: {\n 0: 'power_phase_start_angle',\n 1: 'power_phase_end_angle',\n 2: 'power_phase_arc_length',\n 3: 'power_phase_center',\n },\n camera_event_type: {\n 0: 'video_start',\n 1: 'video_split',\n 2: 'video_end',\n 3: 'photo_taken',\n 4: 'video_second_stream_start',\n 5: 'video_second_stream_split',\n 6: 'video_second_stream_end',\n 7: 'video_split_start',\n 8: 'video_second_stream_split_start',\n 11: 'video_pause',\n 12: 'video_second_stream_pause',\n 13: 'video_resume',\n 14: 'video_second_stream_resume',\n },\n sensor_type: {\n 0: 'accelerometer',\n 1: 'gyroscope',\n 2: 'compass',\n 3: 'barometer',\n },\n bike_light_network_config_type: {\n 0: 'auto',\n 4: 'individual',\n 5: 'high_visibility',\n 6: 'trail',\n },\n comm_timeout_type: {\n 0: 'wildcard_pairing_timeout',\n 1: 'pairing_timeout',\n 2: 'connection_lost',\n 3: 'connection_timeout',\n },\n camera_orientation_type: {\n 0: 'camera_orientation_0',\n 1: 'camera_orientation_90',\n 2: 'camera_orientation_180',\n 3: 'camera_orientation_270',\n },\n attitude_stage: {\n 0: 'failed',\n 1: 'aligning',\n 2: 'degraded',\n 3: 'valid',\n },\n attitude_validity: {\n 0: 0,\n 1: 'track_angle_heading_valid',\n 2: 'pitch_valid',\n 4: 'roll_valid',\n 8: 'lateral_body_accel_valid',\n 16: 'normal_body_accel_valid',\n 32: 'turn_rate_valid',\n 64: 'hw_fail',\n 128: 'mag_invalid',\n 256: 'no_gps',\n 512: 'gps_invalid',\n 1024: 'solution_coasting',\n 2048: 'true_track_angle',\n 4096: 'magnetic_heading',\n },\n auto_sync_frequency: {\n 0: 'never',\n 1: 'occasionally',\n 2: 'frequent',\n 3: 'once_a_day',\n 4: 'remote',\n },\n exd_layout: {\n 0: 'full_screen',\n 1: 'half_vertical',\n 2: 'half_horizontal',\n 3: 'half_vertical_right_split',\n 4: 'half_horizontal_bottom_split',\n 5: 'full_quarter_split',\n 6: 'half_vertical_left_split',\n 7: 'half_horizontal_top_split',\n },\n exd_display_type: {\n 0: 'numerical',\n 1: 'simple',\n 2: 'graph',\n 3: 'bar',\n 4: 'circle_graph',\n 5: 'virtual_partner',\n 6: 'balance',\n 7: 'string_list',\n 8: 'string',\n 9: 'simple_dynamic_icon',\n 10: 'gauge',\n },\n exd_data_units: {\n 0: 'no_units',\n 1: 'laps',\n 2: 'miles_per_hour',\n 3: 'kilometers_per_hour',\n 4: 'feet_per_hour',\n 5: 'meters_per_hour',\n 6: 'degrees_celsius',\n 7: 'degrees_farenheit',\n 8: 'zone',\n 9: 'gear',\n 10: 'rpm',\n 11: 'bpm',\n 12: 'degrees',\n 13: 'millimeters',\n 14: 'meters',\n 15: 'kilometers',\n 16: 'feet',\n 17: 'yards',\n 18: 'kilofeet',\n 19: 'miles',\n 20: 'time',\n 21: 'enum_turn_type',\n 22: 'percent',\n 23: 'watts',\n 24: 'watts_per_kilogram',\n 25: 'enum_battery_status',\n 26: 'enum_bike_light_beam_angle_mode',\n 27: 'enum_bike_light_battery_status',\n 28: 'enum_bike_light_network_config_type',\n 29: 'lights',\n 30: 'seconds',\n 31: 'minutes',\n 32: 'hours',\n 33: 'calories',\n 34: 'kilojoules',\n 35: 'milliseconds',\n 36: 'second_per_mile',\n 37: 'second_per_kilometer',\n 38: 'centimeter',\n 39: 'enum_course_point',\n 40: 'bradians',\n 41: 'enum_sport',\n 42: 'inches_hg',\n 43: 'mm_hg',\n 44: 'mbars',\n 45: 'hecto_pascals',\n 46: 'feet_per_min',\n 47: 'meters_per_min',\n 48: 'meters_per_sec',\n 49: 'eight_cardinal',\n },\n exd_qualifiers: {\n 0: 'no_qualifier',\n 1: 'instantaneous',\n 2: 'average',\n 3: 'lap',\n 4: 'maximum',\n 5: 'maximum_average',\n 6: 'maximum_lap',\n 7: 'last_lap',\n 8: 'average_lap',\n 9: 'to_destination',\n 10: 'to_go',\n 11: 'to_next',\n 12: 'next_course_point',\n 13: 'total',\n 14: 'three_second_average',\n 15: 'ten_second_average',\n 16: 'thirty_second_average',\n 17: 'percent_maximum',\n 18: 'percent_maximum_average',\n 19: 'lap_percent_maximum',\n 20: 'elapsed',\n 21: 'sunrise',\n 22: 'sunset',\n 23: 'compared_to_virtual_partner',\n 24: 'maximum_24h',\n 25: 'minimum_24h',\n 26: 'minimum',\n 27: 'first',\n 28: 'second',\n 29: 'third',\n 30: 'shifter',\n 31: 'last_sport',\n 32: 'moving',\n 33: 'stopped',\n 34: 'estimated_total',\n 242: 'zone_9',\n 243: 'zone_8',\n 244: 'zone_7',\n 245: 'zone_6',\n 246: 'zone_5',\n 247: 'zone_4',\n 248: 'zone_3',\n 249: 'zone_2',\n 250: 'zone_1',\n },\n exd_descriptors: {\n 0: 'bike_light_battery_status',\n 1: 'beam_angle_status',\n 2: 'batery_level',\n 3: 'light_network_mode',\n 4: 'number_lights_connected',\n 5: 'cadence',\n 6: 'distance',\n 7: 'estimated_time_of_arrival',\n 8: 'heading',\n 9: 'time',\n 10: 'battery_level',\n 11: 'trainer_resistance',\n 12: 'trainer_target_power',\n 13: 'time_seated',\n 14: 'time_standing',\n 15: 'elevation',\n 16: 'grade',\n 17: 'ascent',\n 18: 'descent',\n 19: 'vertical_speed',\n 20: 'di2_battery_level',\n 21: 'front_gear',\n 22: 'rear_gear',\n 23: 'gear_ratio',\n 24: 'heart_rate',\n 25: 'heart_rate_zone',\n 26: 'time_in_heart_rate_zone',\n 27: 'heart_rate_reserve',\n 28: 'calories',\n 29: 'gps_accuracy',\n 30: 'gps_signal_strength',\n 31: 'temperature',\n 32: 'time_of_day',\n 33: 'balance',\n 34: 'pedal_smoothness',\n 35: 'power',\n 36: 'functional_threshold_power',\n 37: 'intensity_factor',\n 38: 'work',\n 39: 'power_ratio',\n 40: 'normalized_power',\n 41: 'training_stress_Score',\n 42: 'time_on_zone',\n 43: 'speed',\n 44: 'laps',\n 45: 'reps',\n 46: 'workout_step',\n 47: 'course_distance',\n 48: 'navigation_distance',\n 49: 'course_estimated_time_of_arrival',\n 50: 'navigation_estimated_time_of_arrival',\n 51: 'course_time',\n 52: 'navigation_time',\n 53: 'course_heading',\n 54: 'navigation_heading',\n 55: 'power_zone',\n 56: 'torque_effectiveness',\n 57: 'timer_time',\n 58: 'power_weight_ratio',\n 59: 'left_platform_center_offset',\n 60: 'right_platform_center_offset',\n 61: 'left_power_phase_start_angle',\n 62: 'right_power_phase_start_angle',\n 63: 'left_power_phase_finish_angle',\n 64: 'right_power_phase_finish_angle',\n 65: 'gears',\n 66: 'pace',\n 67: 'training_effect',\n 68: 'vertical_oscillation',\n 69: 'vertical_ratio',\n 70: 'ground_contact_time',\n 71: 'left_ground_contact_time_balance',\n 72: 'right_ground_contact_time_balance',\n 73: 'stride_length',\n 74: 'running_cadence',\n 75: 'performance_condition',\n 76: 'course_type',\n 77: 'time_in_power_zone',\n 78: 'navigation_turn',\n 79: 'course_location',\n 80: 'navigation_location',\n 81: 'compass',\n 82: 'gear_combo',\n 83: 'muscle_oxygen',\n 84: 'icon',\n 85: 'compass_heading',\n 86: 'gps_heading',\n 87: 'gps_elevation',\n 88: 'anaerobic_training_effect',\n 89: 'course',\n 90: 'off_course',\n 91: 'glide_ratio',\n 92: 'vertical_distance',\n 93: 'vmg',\n 94: 'ambient_pressure',\n 95: 'pressure',\n 96: 'vam',\n },\n auto_activity_detect: {\n 0: 'none',\n 1: 'running',\n 2: 'cycling',\n 4: 'swimming',\n 8: 'walking',\n 16: 'elliptical',\n 32: 'sedentary',\n },\n supported_exd_screen_layouts: {\n 0: 0,\n 1: 'full_screen',\n 2: 'half_vertical',\n 4: 'half_horizontal',\n 8: 'half_vertical_right_split',\n 16: 'half_horizontal_bottom_split',\n 32: 'full_quarter_split',\n 64: 'half_vertical_left_split',\n 128: 'half_horizontal_top_split',\n },\n fit_base_type: {\n 0: 'enum',\n 1: 'sint8',\n 2: 'uint8',\n 7: 'string',\n 10: 'uint8z',\n 13: 'byte',\n 131: 'sint16',\n 132: 'uint16',\n 133: 'sint32',\n 134: 'uint32',\n 136: 'float32',\n 137: 'float64',\n 139: 'uint16z',\n 140: 'uint32z',\n 142: 'sint64',\n 143: 'uint64',\n 144: 'uint64z',\n },\n turn_type: {\n 0: 'arriving_idx',\n 1: 'arriving_left_idx',\n 2: 'arriving_right_idx',\n 3: 'arriving_via_idx',\n 4: 'arriving_via_left_idx',\n 5: 'arriving_via_right_idx',\n 6: 'bear_keep_left_idx',\n 7: 'bear_keep_right_idx',\n 8: 'continue_idx',\n 9: 'exit_left_idx',\n 10: 'exit_right_idx',\n 11: 'ferry_idx',\n 12: 'roundabout_45_idx',\n 13: 'roundabout_90_idx',\n 14: 'roundabout_135_idx',\n 15: 'roundabout_180_idx',\n 16: 'roundabout_225_idx',\n 17: 'roundabout_270_idx',\n 18: 'roundabout_315_idx',\n 19: 'roundabout_360_idx',\n 20: 'roundabout_neg_45_idx',\n 21: 'roundabout_neg_90_idx',\n 22: 'roundabout_neg_135_idx',\n 23: 'roundabout_neg_180_idx',\n 24: 'roundabout_neg_225_idx',\n 25: 'roundabout_neg_270_idx',\n 26: 'roundabout_neg_315_idx',\n 27: 'roundabout_neg_360_idx',\n 28: 'roundabout_generic_idx',\n 29: 'roundabout_neg_generic_idx',\n 30: 'sharp_turn_left_idx',\n 31: 'sharp_turn_right_idx',\n 32: 'turn_left_idx',\n 33: 'turn_right_idx',\n 34: 'uturn_left_idx',\n 35: 'uturn_right_idx',\n 36: 'icon_inv_idx',\n 37: 'icon_idx_cnt',\n },\n bike_light_beam_angle_mode: {\n 0: 'manual',\n 1: 'auto',\n },\n fit_base_unit: {\n 0: 'other',\n 1: 'kilogram',\n 2: 'pound',\n },\n set_type: {\n 0: 'rest',\n 1: 'active',\n },\n exercise_category: {\n 0: 'bench_press',\n 1: 'calf_raise',\n 2: 'cardio',\n 3: 'carry',\n 4: 'chop',\n 5: 'core',\n 6: 'crunch',\n 7: 'curl',\n 8: 'deadlift',\n 9: 'flye',\n 10: 'hip_raise',\n 11: 'hip_stability',\n 12: 'hip_swing',\n 13: 'hyperextension',\n 14: 'lateral_raise',\n 15: 'leg_curl',\n 16: 'leg_raise',\n 17: 'lunge',\n 18: 'olympic_lift',\n 19: 'plank',\n 20: 'plyo',\n 21: 'pull_up',\n 22: 'push_up',\n 23: 'row',\n 24: 'shoulder_press',\n 25: 'shoulder_stability',\n 26: 'shrug',\n 27: 'sit_up',\n 28: 'squat',\n 29: 'total_body',\n 30: 'triceps_extension',\n 31: 'warm_up',\n 32: 'run',\n 65534: 'unknown',\n },\n bench_press_exercise_name: {\n 0: 'alternating_dumbbell_chest_press_on_swiss_ball',\n 1: 'barbell_bench_press',\n 2: 'barbell_board_bench_press',\n 3: 'barbell_floor_press',\n 4: 'close_grip_barbell_bench_press',\n 5: 'decline_dumbbell_bench_press',\n 6: 'dumbbell_bench_press',\n 7: 'dumbbell_floor_press',\n 8: 'incline_barbell_bench_press',\n 9: 'incline_dumbbell_bench_press',\n 10: 'incline_smith_machine_bench_press',\n 11: 'isometric_barbell_bench_press',\n 12: 'kettlebell_chest_press',\n 13: 'neutral_grip_dumbbell_bench_press',\n 14: 'neutral_grip_dumbbell_incline_bench_press',\n 15: 'one_arm_floor_press',\n 16: 'weighted_one_arm_floor_press',\n 17: 'partial_lockout',\n 18: 'reverse_grip_barbell_bench_press',\n 19: 'reverse_grip_incline_bench_press',\n 20: 'single_arm_cable_chest_press',\n 21: 'single_arm_dumbbell_bench_press',\n 22: 'smith_machine_bench_press',\n 23: 'swiss_ball_dumbbell_chest_press',\n 24: 'triple_stop_barbell_bench_press',\n 25: 'wide_grip_barbell_bench_press',\n 26: 'alternating_dumbbell_chest_press',\n },\n calf_raise_exercise_name: {\n 0: '3_way_calf_raise',\n 1: '3_way_weighted_calf_raise',\n 2: '3_way_single_leg_calf_raise',\n 3: '3_way_weighted_single_leg_calf_raise',\n 4: 'donkey_calf_raise',\n 5: 'weighted_donkey_calf_raise',\n 6: 'seated_calf_raise',\n 7: 'weighted_seated_calf_raise',\n 8: 'seated_dumbbell_toe_raise',\n 9: 'single_leg_bent_knee_calf_raise',\n 10: 'weighted_single_leg_bent_knee_calf_raise',\n 11: 'single_leg_decline_push_up',\n 12: 'single_leg_donkey_calf_raise',\n 13: 'weighted_single_leg_donkey_calf_raise',\n 14: 'single_leg_hip_raise_with_knee_hold',\n 15: 'single_leg_standing_calf_raise',\n 16: 'single_leg_standing_dumbbell_calf_raise',\n 17: 'standing_barbell_calf_raise',\n 18: 'standing_calf_raise',\n 19: 'weighted_standing_calf_raise',\n 20: 'standing_dumbbell_calf_raise',\n },\n cardio_exercise_name: {\n 0: 'bob_and_weave_circle',\n 1: 'weighted_bob_and_weave_circle',\n 2: 'cardio_core_crawl',\n 3: 'weighted_cardio_core_crawl',\n 4: 'double_under',\n 5: 'weighted_double_under',\n 6: 'jump_rope',\n 7: 'weighted_jump_rope',\n 8: 'jump_rope_crossover',\n 9: 'weighted_jump_rope_crossover',\n 10: 'jump_rope_jog',\n 11: 'weighted_jump_rope_jog',\n 12: 'jumping_jacks',\n 13: 'weighted_jumping_jacks',\n 14: 'ski_moguls',\n 15: 'weighted_ski_moguls',\n 16: 'split_jacks',\n 17: 'weighted_split_jacks',\n 18: 'squat_jacks',\n 19: 'weighted_squat_jacks',\n 20: 'triple_under',\n 21: 'weighted_triple_under',\n },\n carry_exercise_name: {\n 0: 'bar_holds',\n 1: 'farmers_walk',\n 2: 'farmers_walk_on_toes',\n 3: 'hex_dumbbell_hold',\n 4: 'overhead_carry',\n },\n chop_exercise_name: {\n 0: 'cable_pull_through',\n 1: 'cable_rotational_lift',\n 2: 'cable_woodchop',\n 3: 'cross_chop_to_knee',\n 4: 'weighted_cross_chop_to_knee',\n 5: 'dumbbell_chop',\n 6: 'half_kneeling_rotation',\n 7: 'weighted_half_kneeling_rotation',\n 8: 'half_kneeling_rotational_chop',\n 9: 'half_kneeling_rotational_reverse_chop',\n 10: 'half_kneeling_stability_chop',\n 11: 'half_kneeling_stability_reverse_chop',\n 12: 'kneeling_rotational_chop',\n 13: 'kneeling_rotational_reverse_chop',\n 14: 'kneeling_stability_chop',\n 15: 'kneeling_woodchopper',\n 16: 'medicine_ball_wood_chops',\n 17: 'power_squat_chops',\n 18: 'weighted_power_squat_chops',\n 19: 'standing_rotational_chop',\n 20: 'standing_split_rotational_chop',\n 21: 'standing_split_rotational_reverse_chop',\n 22: 'standing_stability_reverse_chop',\n },\n core_exercise_name: {\n 0: 'abs_jabs',\n 1: 'weighted_abs_jabs',\n 2: 'alternating_plate_reach',\n 3: 'barbell_rollout',\n 4: 'weighted_barbell_rollout',\n 5: 'body_bar_oblique_twist',\n 6: 'cable_core_press',\n 7: 'cable_side_bend',\n 8: 'side_bend',\n 9: 'weighted_side_bend',\n 10: 'crescent_circle',\n 11: 'weighted_crescent_circle',\n 12: 'cycling_russian_twist',\n 13: 'weighted_cycling_russian_twist',\n 14: 'elevated_feet_russian_twist',\n 15: 'weighted_elevated_feet_russian_twist',\n 16: 'half_turkish_get_up',\n 17: 'kettlebell_windmill',\n 18: 'kneeling_ab_wheel',\n 19: 'weighted_kneeling_ab_wheel',\n 20: 'modified_front_lever',\n 21: 'open_knee_tucks',\n 22: 'weighted_open_knee_tucks',\n 23: 'side_abs_leg_lift',\n 24: 'weighted_side_abs_leg_lift',\n 25: 'swiss_ball_jackknife',\n 26: 'weighted_swiss_ball_jackknife',\n 27: 'swiss_ball_pike',\n 28: 'weighted_swiss_ball_pike',\n 29: 'swiss_ball_rollout',\n 30: 'weighted_swiss_ball_rollout',\n 31: 'triangle_hip_press',\n 32: 'weighted_triangle_hip_press',\n 33: 'trx_suspended_jackknife',\n 34: 'weighted_trx_suspended_jackknife',\n 35: 'u_boat',\n 36: 'weighted_u_boat',\n 37: 'windmill_switches',\n 38: 'weighted_windmill_switches',\n 39: 'alternating_slide_out',\n 40: 'weighted_alternating_slide_out',\n 41: 'ghd_back_extensions',\n 42: 'weighted_ghd_back_extensions',\n 43: 'overhead_walk',\n 44: 'inchworm',\n 45: 'weighted_modified_front_lever',\n 46: 'russian_twist',\n 47: 'abdominal_leg_rotations',\n 48: 'arm_and_leg_extension_on_knees',\n 49: 'bicycle',\n 50: 'bicep_curl_with_leg_extension',\n 51: 'cat_cow',\n 52: 'corkscrew',\n 53: 'criss_cross',\n 54: 'criss_cross_with_ball',\n 55: 'double_leg_stretch',\n 56: 'knee_folds',\n 57: 'lower_lift',\n 58: 'neck_pull',\n 59: 'pelvic_clocks',\n 60: 'roll_over',\n 61: 'roll_up',\n 62: 'rolling',\n 63: 'rowing_1',\n 64: 'rowing_2',\n 65: 'scissors',\n 66: 'single_leg_circles',\n 67: 'single_leg_stretch',\n 68: 'snake_twist_1_and_2',\n 69: 'swan',\n 70: 'swimming',\n 71: 'teaser',\n 72: 'the_hundred',\n },\n crunch_exercise_name: {\n 0: 'bicycle_crunch',\n 1: 'cable_crunch',\n 2: 'circular_arm_crunch',\n 3: 'crossed_arms_crunch',\n 4: 'weighted_crossed_arms_crunch',\n 5: 'cross_leg_reverse_crunch',\n 6: 'weighted_cross_leg_reverse_crunch',\n 7: 'crunch_chop',\n 8: 'weighted_crunch_chop',\n 9: 'double_crunch',\n 10: 'weighted_double_crunch',\n 11: 'elbow_to_knee_crunch',\n 12: 'weighted_elbow_to_knee_crunch',\n 13: 'flutter_kicks',\n 14: 'weighted_flutter_kicks',\n 15: 'foam_roller_reverse_crunch_on_bench',\n 16: 'weighted_foam_roller_reverse_crunch_on_bench',\n 17: 'foam_roller_reverse_crunch_with_dumbbell',\n 18: 'foam_roller_reverse_crunch_with_medicine_ball',\n 19: 'frog_press',\n 20: 'hanging_knee_raise_oblique_crunch',\n 21: 'weighted_hanging_knee_raise_oblique_crunch',\n 22: 'hip_crossover',\n 23: 'weighted_hip_crossover',\n 24: 'hollow_rock',\n 25: 'weighted_hollow_rock',\n 26: 'incline_reverse_crunch',\n 27: 'weighted_incline_reverse_crunch',\n 28: 'kneeling_cable_crunch',\n 29: 'kneeling_cross_crunch',\n 30: 'weighted_kneeling_cross_crunch',\n 31: 'kneeling_oblique_cable_crunch',\n 32: 'knees_to_elbow',\n 33: 'leg_extensions',\n 34: 'weighted_leg_extensions',\n 35: 'leg_levers',\n 36: 'mcgill_curl_up',\n 37: 'weighted_mcgill_curl_up',\n 38: 'modified_pilates_roll_up_with_ball',\n 39: 'weighted_modified_pilates_roll_up_with_ball',\n 40: 'pilates_crunch',\n 41: 'weighted_pilates_crunch',\n 42: 'pilates_roll_up_with_ball',\n 43: 'weighted_pilates_roll_up_with_ball',\n 44: 'raised_legs_crunch',\n 45: 'weighted_raised_legs_crunch',\n 46: 'reverse_crunch',\n 47: 'weighted_reverse_crunch',\n 48: 'reverse_crunch_on_a_bench',\n 49: 'weighted_reverse_crunch_on_a_bench',\n 50: 'reverse_curl_and_lift',\n 51: 'weighted_reverse_curl_and_lift',\n 52: 'rotational_lift',\n 53: 'weighted_rotational_lift',\n 54: 'seated_alternating_reverse_crunch',\n 55: 'weighted_seated_alternating_reverse_crunch',\n 56: 'seated_leg_u',\n 57: 'weighted_seated_leg_u',\n 58: 'side_to_side_crunch_and_weave',\n 59: 'weighted_side_to_side_crunch_and_weave',\n 60: 'single_leg_reverse_crunch',\n 61: 'weighted_single_leg_reverse_crunch',\n 62: 'skater_crunch_cross',\n 63: 'weighted_skater_crunch_cross',\n 64: 'standing_cable_crunch',\n 65: 'standing_side_crunch',\n 66: 'step_climb',\n 67: 'weighted_step_climb',\n 68: 'swiss_ball_crunch',\n 69: 'swiss_ball_reverse_crunch',\n 70: 'weighted_swiss_ball_reverse_crunch',\n 71: 'swiss_ball_russian_twist',\n 72: 'weighted_swiss_ball_russian_twist',\n 73: 'swiss_ball_side_crunch',\n 74: 'weighted_swiss_ball_side_crunch',\n 75: 'thoracic_crunches_on_foam_roller',\n 76: 'weighted_thoracic_crunches_on_foam_roller',\n 77: 'triceps_crunch',\n 78: 'weighted_bicycle_crunch',\n 79: 'weighted_crunch',\n 80: 'weighted_swiss_ball_crunch',\n 81: 'toes_to_bar',\n 82: 'weighted_toes_to_bar',\n 83: 'crunch',\n 84: 'straight_leg_crunch_with_ball',\n },\n curl_exercise_name: {\n 0: 'alternating_dumbbell_biceps_curl',\n 1: 'alternating_dumbbell_biceps_curl_on_swiss_ball',\n 2: 'alternating_incline_dumbbell_biceps_curl',\n 3: 'barbell_biceps_curl',\n 4: 'barbell_reverse_wrist_curl',\n 5: 'barbell_wrist_curl',\n 6: 'behind_the_back_barbell_reverse_wrist_curl',\n 7: 'behind_the_back_one_arm_cable_curl',\n 8: 'cable_biceps_curl',\n 9: 'cable_hammer_curl',\n 10: 'cheating_barbell_biceps_curl',\n 11: 'close_grip_ez_bar_biceps_curl',\n 12: 'cross_body_dumbbell_hammer_curl',\n 13: 'dead_hang_biceps_curl',\n 14: 'decline_hammer_curl',\n 15: 'dumbbell_biceps_curl_with_static_hold',\n 16: 'dumbbell_hammer_curl',\n 17: 'dumbbell_reverse_wrist_curl',\n 18: 'dumbbell_wrist_curl',\n 19: 'ez_bar_preacher_curl',\n 20: 'forward_bend_biceps_curl',\n 21: 'hammer_curl_to_press',\n 22: 'incline_dumbbell_biceps_curl',\n 23: 'incline_offset_thumb_dumbbell_curl',\n 24: 'kettlebell_biceps_curl',\n 25: 'lying_concentration_cable_curl',\n 26: 'one_arm_preacher_curl',\n 27: 'plate_pinch_curl',\n 28: 'preacher_curl_with_cable',\n 29: 'reverse_ez_bar_curl',\n 30: 'reverse_grip_wrist_curl',\n 31: 'reverse_grip_barbell_biceps_curl',\n 32: 'seated_alternating_dumbbell_biceps_curl',\n 33: 'seated_dumbbell_biceps_curl',\n 34: 'seated_reverse_dumbbell_curl',\n 35: 'split_stance_offset_pinky_dumbbell_curl',\n 36: 'standing_alternating_dumbbell_curls',\n 37: 'standing_dumbbell_biceps_curl',\n 38: 'standing_ez_bar_biceps_curl',\n 39: 'static_curl',\n 40: 'swiss_ball_dumbbell_overhead_triceps_extension',\n 41: 'swiss_ball_ez_bar_preacher_curl',\n 42: 'twisting_standing_dumbbell_biceps_curl',\n 43: 'wide_grip_ez_bar_biceps_curl',\n },\n deadlift_exercise_name: {\n 0: 'barbell_deadlift',\n 1: 'barbell_straight_leg_deadlift',\n 2: 'dumbbell_deadlift',\n 3: 'dumbbell_single_leg_deadlift_to_row',\n 4: 'dumbbell_straight_leg_deadlift',\n 5: 'kettlebell_floor_to_shelf',\n 6: 'one_arm_one_leg_deadlift',\n 7: 'rack_pull',\n 8: 'rotational_dumbbell_straight_leg_deadlift',\n 9: 'single_arm_deadlift',\n 10: 'single_leg_barbell_deadlift',\n 11: 'single_leg_barbell_straight_leg_deadlift',\n 12: 'single_leg_deadlift_with_barbell',\n 13: 'single_leg_rdl_circuit',\n 14: 'single_leg_romanian_deadlift_with_dumbbell',\n 15: 'sumo_deadlift',\n 16: 'sumo_deadlift_high_pull',\n 17: 'trap_bar_deadlift',\n 18: 'wide_grip_barbell_deadlift',\n },\n flye_exercise_name: {\n 0: 'cable_crossover',\n 1: 'decline_dumbbell_flye',\n 2: 'dumbbell_flye',\n 3: 'incline_dumbbell_flye',\n 4: 'kettlebell_flye',\n 5: 'kneeling_rear_flye',\n 6: 'single_arm_standing_cable_reverse_flye',\n 7: 'swiss_ball_dumbbell_flye',\n 8: 'arm_rotations',\n 9: 'hug_a_tree',\n },\n hip_raise_exercise_name: {\n 0: 'barbell_hip_thrust_on_floor',\n 1: 'barbell_hip_thrust_with_bench',\n 2: 'bent_knee_swiss_ball_reverse_hip_raise',\n 3: 'weighted_bent_knee_swiss_ball_reverse_hip_raise',\n 4: 'bridge_with_leg_extension',\n 5: 'weighted_bridge_with_leg_extension',\n 6: 'clam_bridge',\n 7: 'front_kick_tabletop',\n 8: 'weighted_front_kick_tabletop',\n 9: 'hip_extension_and_cross',\n 10: 'weighted_hip_extension_and_cross',\n 11: 'hip_raise',\n 12: 'weighted_hip_raise',\n 13: 'hip_raise_with_feet_on_swiss_ball',\n 14: 'weighted_hip_raise_with_feet_on_swiss_ball',\n 15: 'hip_raise_with_head_on_bosu_ball',\n 16: 'weighted_hip_raise_with_head_on_bosu_ball',\n 17: 'hip_raise_with_head_on_swiss_ball',\n 18: 'weighted_hip_raise_with_head_on_swiss_ball',\n 19: 'hip_raise_with_knee_squeeze',\n 20: 'weighted_hip_raise_with_knee_squeeze',\n 21: 'incline_rear_leg_extension',\n 22: 'weighted_incline_rear_leg_extension',\n 23: 'kettlebell_swing',\n 24: 'marching_hip_raise',\n 25: 'weighted_marching_hip_raise',\n 26: 'marching_hip_raise_with_feet_on_a_swiss_ball',\n 27: 'weighted_marching_hip_raise_with_feet_on_a_swiss_ball',\n 28: 'reverse_hip_raise',\n 29: 'weighted_reverse_hip_raise',\n 30: 'single_leg_hip_raise',\n 31: 'weighted_single_leg_hip_raise',\n 32: 'single_leg_hip_raise_with_foot_on_bench',\n 33: 'weighted_single_leg_hip_raise_with_foot_on_bench',\n 34: 'single_leg_hip_raise_with_foot_on_bosu_ball',\n 35: 'weighted_single_leg_hip_raise_with_foot_on_bosu_ball',\n 36: 'single_leg_hip_raise_with_foot_on_foam_roller',\n 37: 'weighted_single_leg_hip_raise_with_foot_on_foam_roller',\n 38: 'single_leg_hip_raise_with_foot_on_medicine_ball',\n 39: 'weighted_single_leg_hip_raise_with_foot_on_medicine_ball',\n 40: 'single_leg_hip_raise_with_head_on_bosu_ball',\n 41: 'weighted_single_leg_hip_raise_with_head_on_bosu_ball',\n 42: 'weighted_clam_bridge',\n 43: 'single_leg_swiss_ball_hip_raise_and_leg_curl',\n 44: 'clams',\n 45: 'inner_thigh_circles',\n 46: 'inner_thigh_side_lift',\n 47: 'leg_circles',\n 48: 'leg_lift',\n 49: 'leg_lift_in_external_rotation',\n },\n hip_stability_exercise_name: {\n 0: 'band_side_lying_leg_raise',\n 1: 'dead_bug',\n 2: 'weighted_dead_bug',\n 3: 'external_hip_raise',\n 4: 'weighted_external_hip_raise',\n 5: 'fire_hydrant_kicks',\n 6: 'weighted_fire_hydrant_kicks',\n 7: 'hip_circles',\n 8: 'weighted_hip_circles',\n 9: 'inner_thigh_lift',\n 10: 'weighted_inner_thigh_lift',\n 11: 'lateral_walks_with_band_at_ankles',\n 12: 'pretzel_side_kick',\n 13: 'weighted_pretzel_side_kick',\n 14: 'prone_hip_internal_rotation',\n 15: 'weighted_prone_hip_internal_rotation',\n 16: 'quadruped',\n 17: 'quadruped_hip_extension',\n 18: 'weighted_quadruped_hip_extension',\n 19: 'quadruped_with_leg_lift',\n 20: 'weighted_quadruped_with_leg_lift',\n 21: 'side_lying_leg_raise',\n 22: 'weighted_side_lying_leg_raise',\n 23: 'sliding_hip_adduction',\n 24: 'weighted_sliding_hip_adduction',\n 25: 'standing_adduction',\n 26: 'weighted_standing_adduction',\n 27: 'standing_cable_hip_abduction',\n 28: 'standing_hip_abduction',\n 29: 'weighted_standing_hip_abduction',\n 30: 'standing_rear_leg_raise',\n 31: 'weighted_standing_rear_leg_raise',\n 32: 'supine_hip_internal_rotation',\n 33: 'weighted_supine_hip_internal_rotation',\n },\n hip_swing_excercise_name: {\n 0: 'single_arm_kettlebell_swing',\n 1: 'single_arm_dumbbell_swing',\n 2: 'step_out_swing',\n },\n hyperextension_exercise_name: {\n 0: 'back_extension_with_opposite_arm_and_leg_reach',\n 1: 'weighted_back_extension_with_opposite_arm_and_leg_reach',\n 2: 'base_rotations',\n 3: 'weighted_base_rotations',\n 4: 'bent_knee_reverse_hyperextension',\n 5: 'weighted_bent_knee_reverse_hyperextension',\n 6: 'hollow_hold_and_roll',\n 7: 'weighted_hollow_hold_and_roll',\n 8: 'kicks',\n 9: 'weighted_kicks',\n 10: 'knee_raises',\n 11: 'weighted_knee_raises',\n 12: 'kneeling_superman',\n 13: 'weighted_kneeling_superman',\n 14: 'lat_pull_down_with_row',\n 15: 'medicine_ball_deadlift_to_reach',\n 16: 'one_arm_one_leg_row',\n 17: 'one_arm_row_with_band',\n 18: 'overhead_lunge_with_medicine_ball',\n 19: 'plank_knee_tucks',\n 20: 'weighted_plank_knee_tucks',\n 21: 'side_step',\n 22: 'weighted_side_step',\n 23: 'single_leg_back_extension',\n 24: 'weighted_single_leg_back_extension',\n 25: 'spine_extension',\n 26: 'weighted_spine_extension',\n 27: 'static_back_extension',\n 28: 'weighted_static_back_extension',\n 29: 'superman_from_floor',\n 30: 'weighted_superman_from_floor',\n 31: 'swiss_ball_back_extension',\n 32: 'weighted_swiss_ball_back_extension',\n 33: 'swiss_ball_hyperextension',\n 34: 'weighted_swiss_ball_hyperextension',\n 35: 'swiss_ball_opposite_arm_and_leg_lift',\n 36: 'weighted_swiss_ball_opposite_arm_and_leg_lift',\n 37: 'superman_on_swiss_ball',\n 38: 'cobra',\n 39: 'supine_floor_barre',\n },\n lateral_raise_exercise_name: {\n 0: '45_degree_cable_external_rotation',\n 1: 'alternating_lateral_raise_with_static_hold',\n 2: 'bar_muscle_up',\n 3: 'bent_over_lateral_raise',\n 4: 'cable_diagonal_raise',\n 5: 'cable_front_raise',\n 6: 'calorie_row',\n 7: 'combo_shoulder_raise',\n 8: 'dumbbell_diagonal_raise',\n 9: 'dumbbell_v_raise',\n 10: 'front_raise',\n 11: 'leaning_dumbbell_lateral_raise',\n 12: 'lying_dumbbell_raise',\n 13: 'muscle_up',\n 14: 'one_arm_cable_lateral_raise',\n 15: 'overhand_grip_rear_lateral_raise',\n 16: 'plate_raises',\n 17: 'ring_dip',\n 18: 'weighted_ring_dip',\n 19: 'ring_muscle_up',\n 20: 'weighted_ring_muscle_up',\n 21: 'rope_climb',\n 22: 'weighted_rope_climb',\n 23: 'scaption',\n 24: 'seated_lateral_raise',\n 25: 'seated_rear_lateral_raise',\n 26: 'side_lying_lateral_raise',\n 27: 'standing_lift',\n 28: 'suspended_row',\n 29: 'underhand_grip_rear_lateral_raise',\n 30: 'wall_slide',\n 31: 'weighted_wall_slide',\n 32: 'arm_circles',\n 33: 'shaving_the_head',\n },\n leg_curl_exercise_name: {\n 0: 'leg_curl',\n 1: 'weighted_leg_curl',\n 2: 'good_morning',\n 3: 'seated_barbell_good_morning',\n 4: 'single_leg_barbell_good_morning',\n 5: 'single_leg_sliding_leg_curl',\n 6: 'sliding_leg_curl',\n 7: 'split_barbell_good_morning',\n 8: 'split_stance_extension',\n 9: 'staggered_stance_good_morning',\n 10: 'swiss_ball_hip_raise_and_leg_curl',\n 11: 'zercher_good_morning',\n },\n leg_raise_exercise_name: {\n 0: 'hanging_knee_raise',\n 1: 'hanging_leg_raise',\n 2: 'weighted_hanging_leg_raise',\n 3: 'hanging_single_leg_raise',\n 4: 'weighted_hanging_single_leg_raise',\n 5: 'kettlebell_leg_raises',\n 6: 'leg_lowering_drill',\n 7: 'weighted_leg_lowering_drill',\n 8: 'lying_straight_leg_raise',\n 9: 'weighted_lying_straight_leg_raise',\n 10: 'medicine_ball_leg_drops',\n 11: 'quadruped_leg_raise',\n 12: 'weighted_quadruped_leg_raise',\n 13: 'reverse_leg_raise',\n 14: 'weighted_reverse_leg_raise',\n 15: 'reverse_leg_raise_on_swiss_ball',\n 16: 'weighted_reverse_leg_raise_on_swiss_ball',\n 17: 'single_leg_lowering_drill',\n 18: 'weighted_single_leg_lowering_drill',\n 19: 'weighted_hanging_knee_raise',\n 20: 'lateral_stepover',\n 21: 'weighted_lateral_stepover',\n },\n lunge_exercise_name: {\n 0: 'overhead_lunge',\n 1: 'lunge_matrix',\n 2: 'weighted_lunge_matrix',\n 3: 'alternating_barbell_forward_lunge',\n 4: 'alternating_dumbbell_lunge_with_reach',\n 5: 'back_foot_elevated_dumbbell_split_squat',\n 6: 'barbell_box_lunge',\n 7: 'barbell_bulgarian_split_squat',\n 8: 'barbell_crossover_lunge',\n 9: 'barbell_front_split_squat',\n 10: 'barbell_lunge',\n 11: 'barbell_reverse_lunge',\n 12: 'barbell_side_lunge',\n 13: 'barbell_split_squat',\n 14: 'core_control_rear_lunge',\n 15: 'diagonal_lunge',\n 16: 'drop_lunge',\n 17: 'dumbbell_box_lunge',\n 18: 'dumbbell_bulgarian_split_squat',\n 19: 'dumbbell_crossover_lunge',\n 20: 'dumbbell_diagonal_lunge',\n 21: 'dumbbell_lunge',\n 22: 'dumbbell_lunge_and_rotation',\n 23: 'dumbbell_overhead_bulgarian_split_squat',\n 24: 'dumbbell_reverse_lunge_to_high_knee_and_press',\n 25: 'dumbbell_side_lunge',\n 26: 'elevated_front_foot_barbell_split_squat',\n 27: 'front_foot_elevated_dumbbell_split_squat',\n 28: 'gunslinger_lunge',\n 29: 'lawnmower_lunge',\n 30: 'low_lunge_with_isometric_adduction',\n 31: 'low_side_to_side_lunge',\n 32: 'lunge',\n 33: 'weighted_lunge',\n 34: 'lunge_with_arm_reach',\n 35: 'lunge_with_diagonal_reach',\n 36: 'lunge_with_side_bend',\n 37: 'offset_dumbbell_lunge',\n 38: 'offset_dumbbell_reverse_lunge',\n 39: 'overhead_bulgarian_split_squat',\n 40: 'overhead_dumbbell_reverse_lunge',\n 41: 'overhead_dumbbell_split_squat',\n 42: 'overhead_lunge_with_rotation',\n 43: 'reverse_barbell_box_lunge',\n 44: 'reverse_box_lunge',\n 45: 'reverse_dumbbell_box_lunge',\n 46: 'reverse_dumbbell_crossover_lunge',\n 47: 'reverse_dumbbell_diagonal_lunge',\n 48: 'reverse_lunge_with_reach_back',\n 49: 'weighted_reverse_lunge_with_reach_back',\n 50: 'reverse_lunge_with_twist_and_overhead_reach',\n 51: 'weighted_reverse_lunge_with_twist_and_overhead_reach',\n 52: 'reverse_sliding_box_lunge',\n 53: 'weighted_reverse_sliding_box_lunge',\n 54: 'reverse_sliding_lunge',\n 55: 'weighted_reverse_sliding_lunge',\n 56: 'runners_lunge_to_balance',\n 57: 'weighted_runners_lunge_to_balance',\n 58: 'shifting_side_lunge',\n 59: 'side_and_crossover_lunge',\n 60: 'weighted_side_and_crossover_lunge',\n 61: 'side_lunge',\n 62: 'weighted_side_lunge',\n 63: 'side_lunge_and_press',\n 64: 'side_lunge_jump_off',\n 65: 'side_lunge_sweep',\n 66: 'weighted_side_lunge_sweep',\n 67: 'side_lunge_to_crossover_tap',\n 68: 'weighted_side_lunge_to_crossover_tap',\n 69: 'side_to_side_lunge_chops',\n 70: 'weighted_side_to_side_lunge_chops',\n 71: 'siff_jump_lunge',\n 72: 'weighted_siff_jump_lunge',\n 73: 'single_arm_reverse_lunge_and_press',\n 74: 'sliding_lateral_lunge',\n 75: 'weighted_sliding_lateral_lunge',\n 76: 'walking_barbell_lunge',\n 77: 'walking_dumbbell_lunge',\n 78: 'walking_lunge',\n 79: 'weighted_walking_lunge',\n 80: 'wide_grip_overhead_barbell_split_squat',\n },\n olympic_lift_exercise_name: {\n 0: 'barbell_hang_power_clean',\n 1: 'barbell_hang_squat_clean',\n 2: 'barbell_power_clean',\n 3: 'barbell_power_snatch',\n 4: 'barbell_squat_clean',\n 5: 'clean_and_jerk',\n 6: 'barbell_hang_power_snatch',\n 7: 'barbell_hang_pull',\n 8: 'barbell_high_pull',\n 9: 'barbell_snatch',\n 10: 'barbell_split_jerk',\n 11: 'clean',\n 12: 'dumbbell_clean',\n 13: 'dumbbell_hang_pull',\n 14: 'one_hand_dumbbell_split_snatch',\n 15: 'push_jerk',\n 16: 'single_arm_dumbbell_snatch',\n 17: 'single_arm_hang_snatch',\n 18: 'single_arm_kettlebell_snatch',\n 19: 'split_jerk',\n 20: 'squat_clean_and_jerk',\n },\n plank_exercise_name: {\n 0: '45_degree_plank',\n 1: 'weighted_45_degree_plank',\n 2: '90_degree_static_hold',\n 3: 'weighted_90_degree_static_hold',\n 4: 'bear_crawl',\n 5: 'weighted_bear_crawl',\n 6: 'cross_body_mountain_climber',\n 7: 'weighted_cross_body_mountain_climber',\n 8: 'elbow_plank_pike_jacks',\n 9: 'weighted_elbow_plank_pike_jacks',\n 10: 'elevated_feet_plank',\n 11: 'weighted_elevated_feet_plank',\n 12: 'elevator_abs',\n 13: 'weighted_elevator_abs',\n 14: 'extended_plank',\n 15: 'weighted_extended_plank',\n 16: 'full_plank_passe_twist',\n 17: 'weighted_full_plank_passe_twist',\n 18: 'inching_elbow_plank',\n 19: 'weighted_inching_elbow_plank',\n 20: 'inchworm_to_side_plank',\n 21: 'weighted_inchworm_to_side_plank',\n 22: 'kneeling_plank',\n 23: 'weighted_kneeling_plank',\n 24: 'kneeling_side_plank_with_leg_lift',\n 25: 'weighted_kneeling_side_plank_with_leg_lift',\n 26: 'lateral_roll',\n 27: 'weighted_lateral_roll',\n 28: 'lying_reverse_plank',\n 29: 'weighted_lying_reverse_plank',\n 30: 'medicine_ball_mountain_climber',\n 31: 'weighted_medicine_ball_mountain_climber',\n 32: 'modified_mountain_climber_and_extension',\n 33: 'weighted_modified_mountain_climber_and_extension',\n 34: 'mountain_climber',\n 35: 'weighted_mountain_climber',\n 36: 'mountain_climber_on_sliding_discs',\n 37: 'weighted_mountain_climber_on_sliding_discs',\n 38: 'mountain_climber_with_feet_on_bosu_ball',\n 39: 'weighted_mountain_climber_with_feet_on_bosu_ball',\n 40: 'mountain_climber_with_hands_on_bench',\n 41: 'mountain_climber_with_hands_on_swiss_ball',\n 42: 'weighted_mountain_climber_with_hands_on_swiss_ball',\n 43: 'plank',\n 44: 'plank_jacks_with_feet_on_sliding_discs',\n 45: 'weighted_plank_jacks_with_feet_on_sliding_discs',\n 46: 'plank_knee_twist',\n 47: 'weighted_plank_knee_twist',\n 48: 'plank_pike_jumps',\n 49: 'weighted_plank_pike_jumps',\n 50: 'plank_pikes',\n 51: 'weighted_plank_pikes',\n 52: 'plank_to_stand_up',\n 53: 'weighted_plank_to_stand_up',\n 54: 'plank_with_arm_raise',\n 55: 'weighted_plank_with_arm_raise',\n 56: 'plank_with_knee_to_elbow',\n 57: 'weighted_plank_with_knee_to_elbow',\n 58: 'plank_with_oblique_crunch',\n 59: 'weighted_plank_with_oblique_crunch',\n 60: 'plyometric_side_plank',\n 61: 'weighted_plyometric_side_plank',\n 62: 'rolling_side_plank',\n 63: 'weighted_rolling_side_plank',\n 64: 'side_kick_plank',\n 65: 'weighted_side_kick_plank',\n 66: 'side_plank',\n 67: 'weighted_side_plank',\n 68: 'side_plank_and_row',\n 69: 'weighted_side_plank_and_row',\n 70: 'side_plank_lift',\n 71: 'weighted_side_plank_lift',\n 72: 'side_plank_with_elbow_on_bosu_ball',\n 73: 'weighted_side_plank_with_elbow_on_bosu_ball',\n 74: 'side_plank_with_feet_on_bench',\n 75: 'weighted_side_plank_with_feet_on_bench',\n 76: 'side_plank_with_knee_circle',\n 77: 'weighted_side_plank_with_knee_circle',\n 78: 'side_plank_with_knee_tuck',\n 79: 'weighted_side_plank_with_knee_tuck',\n 80: 'side_plank_with_leg_lift',\n 81: 'weighted_side_plank_with_leg_lift',\n 82: 'side_plank_with_reach_under',\n 83: 'weighted_side_plank_with_reach_under',\n 84: 'single_leg_elevated_feet_plank',\n 85: 'weighted_single_leg_elevated_feet_plank',\n 86: 'single_leg_flex_and_extend',\n 87: 'weighted_single_leg_flex_and_extend',\n 88: 'single_leg_side_plank',\n 89: 'weighted_single_leg_side_plank',\n 90: 'spiderman_plank',\n 91: 'weighted_spiderman_plank',\n 92: 'straight_arm_plank',\n 93: 'weighted_straight_arm_plank',\n 94: 'straight_arm_plank_with_shoulder_touch',\n 95: 'weighted_straight_arm_plank_with_shoulder_touch',\n 96: 'swiss_ball_plank',\n 97: 'weighted_swiss_ball_plank',\n 98: 'swiss_ball_plank_leg_lift',\n 99: 'weighted_swiss_ball_plank_leg_lift',\n 100: 'swiss_ball_plank_leg_lift_and_hold',\n 101: 'swiss_ball_plank_with_feet_on_bench',\n 102: 'weighted_swiss_ball_plank_with_feet_on_bench',\n 103: 'swiss_ball_prone_jackknife',\n 104: 'weighted_swiss_ball_prone_jackknife',\n 105: 'swiss_ball_side_plank',\n 106: 'weighted_swiss_ball_side_plank',\n 107: 'three_way_plank',\n 108: 'weighted_three_way_plank',\n 109: 'towel_plank_and_knee_in',\n 110: 'weighted_towel_plank_and_knee_in',\n 111: 't_stabilization',\n 112: 'weighted_t_stabilization',\n 113: 'turkish_get_up_to_side_plank',\n 114: 'weighted_turkish_get_up_to_side_plank',\n 115: 'two_point_plank',\n 116: 'weighted_two_point_plank',\n 117: 'weighted_plank',\n 118: 'wide_stance_plank_with_diagonal_arm_lift',\n 119: 'weighted_wide_stance_plank_with_diagonal_arm_lift',\n 120: 'wide_stance_plank_with_diagonal_leg_lift',\n 121: 'weighted_wide_stance_plank_with_diagonal_leg_lift',\n 122: 'wide_stance_plank_with_leg_lift',\n 123: 'weighted_wide_stance_plank_with_leg_lift',\n 124: 'wide_stance_plank_with_opposite_arm_and_leg_lift',\n 125: 'weighted_mountain_climber_with_hands_on_bench',\n 126: 'weighted_swiss_ball_plank_leg_lift_and_hold',\n 127: 'weighted_wide_stance_plank_with_opposite_arm_and_leg_lift',\n 128: 'plank_with_feet_on_swiss_ball',\n 129: 'side_plank_to_plank_with_reach_under',\n 130: 'bridge_with_glute_lower_lift',\n 131: 'bridge_one_leg_bridge',\n 132: 'plank_with_arm_variations',\n 133: 'plank_with_leg_lift',\n 134: 'reverse_plank_with_leg_pull',\n },\n plyo_exercise_name: {\n 0: 'alternating_jump_lunge',\n 1: 'weighted_alternating_jump_lunge',\n 2: 'barbell_jump_squat',\n 3: 'body_weight_jump_squat',\n 4: 'weighted_jump_squat',\n 5: 'cross_knee_strike',\n 6: 'weighted_cross_knee_strike',\n 7: 'depth_jump',\n 8: 'weighted_depth_jump',\n 9: 'dumbbell_jump_squat',\n 10: 'dumbbell_split_jump',\n 11: 'front_knee_strike',\n 12: 'weighted_front_knee_strike',\n 13: 'high_box_jump',\n 14: 'weighted_high_box_jump',\n 15: 'isometric_explosive_body_weight_jump_squat',\n 16: 'weighted_isometric_explosive_jump_squat',\n 17: 'lateral_leap_and_hop',\n 18: 'weighted_lateral_leap_and_hop',\n 19: 'lateral_plyo_squats',\n 20: 'weighted_lateral_plyo_squats',\n 21: 'lateral_slide',\n 22: 'weighted_lateral_slide',\n 23: 'medicine_ball_overhead_throws',\n 24: 'medicine_ball_side_throw',\n 25: 'medicine_ball_slam',\n 26: 'side_to_side_medicine_ball_throws',\n 27: 'side_to_side_shuffle_jump',\n 28: 'weighted_side_to_side_shuffle_jump',\n 29: 'squat_jump_onto_box',\n 30: 'weighted_squat_jump_onto_box',\n 31: 'squat_jumps_in_and_out',\n 32: 'weighted_squat_jumps_in_and_out',\n },\n pull_up_exercise_name: {\n 0: 'banded_pull_ups',\n 1: '30_degree_lat_pulldown',\n 2: 'band_assisted_chin_up',\n 3: 'close_grip_chin_up',\n 4: 'weighted_close_grip_chin_up',\n 5: 'close_grip_lat_pulldown',\n 6: 'crossover_chin_up',\n 7: 'weighted_crossover_chin_up',\n 8: 'ez_bar_pullover',\n 9: 'hanging_hurdle',\n 10: 'weighted_hanging_hurdle',\n 11: 'kneeling_lat_pulldown',\n 12: 'kneeling_underhand_grip_lat_pulldown',\n 13: 'lat_pulldown',\n 14: 'mixed_grip_chin_up',\n 15: 'weighted_mixed_grip_chin_up',\n 16: 'mixed_grip_pull_up',\n 17: 'weighted_mixed_grip_pull_up',\n 18: 'reverse_grip_pulldown',\n 19: 'standing_cable_pullover',\n 20: 'straight_arm_pulldown',\n 21: 'swiss_ball_ez_bar_pullover',\n 22: 'towel_pull_up',\n 23: 'weighted_towel_pull_up',\n 24: 'weighted_pull_up',\n 25: 'wide_grip_lat_pulldown',\n 26: 'wide_grip_pull_up',\n 27: 'weighted_wide_grip_pull_up',\n 28: 'burpee_pull_up',\n 29: 'weighted_burpee_pull_up',\n 30: 'jumping_pull_ups',\n 31: 'weighted_jumping_pull_ups',\n 32: 'kipping_pull_up',\n 33: 'weighted_kipping_pull_up',\n 34: 'l_pull_up',\n 35: 'weighted_l_pull_up',\n 36: 'suspended_chin_up',\n 37: 'weighted_suspended_chin_up',\n 38: 'pull_up',\n },\n push_up_exercise_name: {\n 0: 'chest_press_with_band',\n 1: 'alternating_staggered_push_up',\n 2: 'weighted_alternating_staggered_push_up',\n 3: 'alternating_hands_medicine_ball_push_up',\n 4: 'weighted_alternating_hands_medicine_ball_push_up',\n 5: 'bosu_ball_push_up',\n 6: 'weighted_bosu_ball_push_up',\n 7: 'clapping_push_up',\n 8: 'weighted_clapping_push_up',\n 9: 'close_grip_medicine_ball_push_up',\n 10: 'weighted_close_grip_medicine_ball_push_up',\n 11: 'close_hands_push_up',\n 12: 'weighted_close_hands_push_up',\n 13: 'decline_push_up',\n 14: 'weighted_decline_push_up',\n 15: 'diamond_push_up',\n 16: 'weighted_diamond_push_up',\n 17: 'explosive_crossover_push_up',\n 18: 'weighted_explosive_crossover_push_up',\n 19: 'explosive_push_up',\n 20: 'weighted_explosive_push_up',\n 21: 'feet_elevated_side_to_side_push_up',\n 22: 'weighted_feet_elevated_side_to_side_push_up',\n 23: 'hand_release_push_up',\n 24: 'weighted_hand_release_push_up',\n 25: 'handstand_push_up',\n 26: 'weighted_handstand_push_up',\n 27: 'incline_push_up',\n 28: 'weighted_incline_push_up',\n 29: 'isometric_explosive_push_up',\n 30: 'weighted_isometric_explosive_push_up',\n 31: 'judo_push_up',\n 32: 'weighted_judo_push_up',\n 33: 'kneeling_push_up',\n 34: 'weighted_kneeling_push_up',\n 35: 'medicine_ball_chest_pass',\n 36: 'medicine_ball_push_up',\n 37: 'weighted_medicine_ball_push_up',\n 38: 'one_arm_push_up',\n 39: 'weighted_one_arm_push_up',\n 40: 'weighted_push_up',\n 41: 'push_up_and_row',\n 42: 'weighted_push_up_and_row',\n 43: 'push_up_plus',\n 44: 'weighted_push_up_plus',\n 45: 'push_up_with_feet_on_swiss_ball',\n 46: 'weighted_push_up_with_feet_on_swiss_ball',\n 47: 'push_up_with_one_hand_on_medicine_ball',\n 48: 'weighted_push_up_with_one_hand_on_medicine_ball',\n 49: 'shoulder_push_up',\n 50: 'weighted_shoulder_push_up',\n 51: 'single_arm_medicine_ball_push_up',\n 52: 'weighted_single_arm_medicine_ball_push_up',\n 53: 'spiderman_push_up',\n 54: 'weighted_spiderman_push_up',\n 55: 'stacked_feet_push_up',\n 56: 'weighted_stacked_feet_push_up',\n 57: 'staggered_hands_push_up',\n 58: 'weighted_staggered_hands_push_up',\n 59: 'suspended_push_up',\n 60: 'weighted_suspended_push_up',\n 61: 'swiss_ball_push_up',\n 62: 'weighted_swiss_ball_push_up',\n 63: 'swiss_ball_push_up_plus',\n 64: 'weighted_swiss_ball_push_up_plus',\n 65: 't_push_up',\n 66: 'weighted_t_push_up',\n 67: 'triple_stop_push_up',\n 68: 'weighted_triple_stop_push_up',\n 69: 'wide_hands_push_up',\n 70: 'weighted_wide_hands_push_up',\n 71: 'parallette_handstand_push_up',\n 72: 'weighted_parallette_handstand_push_up',\n 73: 'ring_handstand_push_up',\n 74: 'weighted_ring_handstand_push_up',\n 75: 'ring_push_up',\n 76: 'weighted_ring_push_up',\n 77: 'push_up',\n 78: 'pilates_pushup',\n },\n row_exercise_name: {\n 0: 'barbell_straight_leg_deadlift_to_row',\n 1: 'cable_row_standing',\n 2: 'dumbbell_row',\n 3: 'elevated_feet_inverted_row',\n 4: 'weighted_elevated_feet_inverted_row',\n 5: 'face_pull',\n 6: 'face_pull_with_external_rotation',\n 7: 'inverted_row_with_feet_on_swiss_ball',\n 8: 'weighted_inverted_row_with_feet_on_swiss_ball',\n 9: 'kettlebell_row',\n 10: 'modified_inverted_row',\n 11: 'weighted_modified_inverted_row',\n 12: 'neutral_grip_alternating_dumbbell_row',\n 13: 'one_arm_bent_over_row',\n 14: 'one_legged_dumbbell_row',\n 15: 'renegade_row',\n 16: 'reverse_grip_barbell_row',\n 17: 'rope_handle_cable_row',\n 18: 'seated_cable_row',\n 19: 'seated_dumbbell_row',\n 20: 'single_arm_cable_row',\n 21: 'single_arm_cable_row_and_rotation',\n 22: 'single_arm_inverted_row',\n 23: 'weighted_single_arm_inverted_row',\n 24: 'single_arm_neutral_grip_dumbbell_row',\n 25: 'single_arm_neutral_grip_dumbbell_row_and_rotation',\n 26: 'suspended_inverted_row',\n 27: 'weighted_suspended_inverted_row',\n 28: 't_bar_row',\n 29: 'towel_grip_inverted_row',\n 30: 'weighted_towel_grip_inverted_row',\n 31: 'underhand_grip_cable_row',\n 32: 'v_grip_cable_row',\n 33: 'wide_grip_seated_cable_row',\n },\n shoulder_press_exercise_name: {\n 0: 'alternating_dumbbell_shoulder_press',\n 1: 'arnold_press',\n 2: 'barbell_front_squat_to_push_press',\n 3: 'barbell_push_press',\n 4: 'barbell_shoulder_press',\n 5: 'dead_curl_press',\n 6: 'dumbbell_alternating_shoulder_press_and_twist',\n 7: 'dumbbell_hammer_curl_to_lunge_to_press',\n 8: 'dumbbell_push_press',\n 9: 'floor_inverted_shoulder_press',\n 10: 'weighted_floor_inverted_shoulder_press',\n 11: 'inverted_shoulder_press',\n 12: 'weighted_inverted_shoulder_press',\n 13: 'one_arm_push_press',\n 14: 'overhead_barbell_press',\n 15: 'overhead_dumbbell_press',\n 16: 'seated_barbell_shoulder_press',\n 17: 'seated_dumbbell_shoulder_press',\n 18: 'single_arm_dumbbell_shoulder_press',\n 19: 'single_arm_step_up_and_press',\n 20: 'smith_machine_overhead_press',\n 21: 'split_stance_hammer_curl_to_press',\n 22: 'swiss_ball_dumbbell_shoulder_press',\n 23: 'weight_plate_front_raise',\n },\n shoulder_stability_exercise_name: {\n 0: '90_degree_cable_external_rotation',\n 1: 'band_external_rotation',\n 2: 'band_internal_rotation',\n 3: 'bent_arm_lateral_raise_and_external_rotation',\n 4: 'cable_external_rotation',\n 5: 'dumbbell_face_pull_with_external_rotation',\n 6: 'floor_i_raise',\n 7: 'weighted_floor_i_raise',\n 8: 'floor_t_raise',\n 9: 'weighted_floor_t_raise',\n 10: 'floor_y_raise',\n 11: 'weighted_floor_y_raise',\n 12: 'incline_i_raise',\n 13: 'weighted_incline_i_raise',\n 14: 'incline_l_raise',\n 15: 'weighted_incline_l_raise',\n 16: 'incline_t_raise',\n 17: 'weighted_incline_t_raise',\n 18: 'incline_w_raise',\n 19: 'weighted_incline_w_raise',\n 20: 'incline_y_raise',\n 21: 'weighted_incline_y_raise',\n 22: 'lying_external_rotation',\n 23: 'seated_dumbbell_external_rotation',\n 24: 'standing_l_raise',\n 25: 'swiss_ball_i_raise',\n 26: 'weighted_swiss_ball_i_raise',\n 27: 'swiss_ball_t_raise',\n 28: 'weighted_swiss_ball_t_raise',\n 29: 'swiss_ball_w_raise',\n 30: 'weighted_swiss_ball_w_raise',\n 31: 'swiss_ball_y_raise',\n 32: 'weighted_swiss_ball_y_raise',\n },\n shrug_exercise_name: {\n 0: 'barbell_jump_shrug',\n 1: 'barbell_shrug',\n 2: 'barbell_upright_row',\n 3: 'behind_the_back_smith_machine_shrug',\n 4: 'dumbbell_jump_shrug',\n 5: 'dumbbell_shrug',\n 6: 'dumbbell_upright_row',\n 7: 'incline_dumbbell_shrug',\n 8: 'overhead_barbell_shrug',\n 9: 'overhead_dumbbell_shrug',\n 10: 'scaption_and_shrug',\n 11: 'scapular_retraction',\n 12: 'serratus_chair_shrug',\n 13: 'weighted_serratus_chair_shrug',\n 14: 'serratus_shrug',\n 15: 'weighted_serratus_shrug',\n 16: 'wide_grip_jump_shrug',\n },\n sit_up_exercise_name: {\n 0: 'alternating_sit_up',\n 1: 'weighted_alternating_sit_up',\n 2: 'bent_knee_v_up',\n 3: 'weighted_bent_knee_v_up',\n 4: 'butterfly_sit_up',\n 5: 'weighted_butterfly_situp',\n 6: 'cross_punch_roll_up',\n 7: 'weighted_cross_punch_roll_up',\n 8: 'crossed_arms_sit_up',\n 9: 'weighted_crossed_arms_sit_up',\n 10: 'get_up_sit_up',\n 11: 'weighted_get_up_sit_up',\n 12: 'hovering_sit_up',\n 13: 'weighted_hovering_sit_up',\n 14: 'kettlebell_sit_up',\n 15: 'medicine_ball_alternating_v_up',\n 16: 'medicine_ball_sit_up',\n 17: 'medicine_ball_v_up',\n 18: 'modified_sit_up',\n 19: 'negative_sit_up',\n 20: 'one_arm_full_sit_up',\n 21: 'reclining_circle',\n 22: 'weighted_reclining_circle',\n 23: 'reverse_curl_up',\n 24: 'weighted_reverse_curl_up',\n 25: 'single_leg_swiss_ball_jackknife',\n 26: 'weighted_single_leg_swiss_ball_jackknife',\n 27: 'the_teaser',\n 28: 'the_teaser_weighted',\n 29: 'three_part_roll_down',\n 30: 'weighted_three_part_roll_down',\n 31: 'v_up',\n 32: 'weighted_v_up',\n 33: 'weighted_russian_twist_on_swiss_ball',\n 34: 'weighted_sit_up',\n 35: 'x_abs',\n 36: 'weighted_x_abs',\n 37: 'sit_up',\n },\n squat_exercise_name: {\n 0: 'leg_press',\n 1: 'back_squat_with_body_bar',\n 2: 'back_squats',\n 3: 'weighted_back_squats',\n 4: 'balancing_squat',\n 5: 'weighted_balancing_squat',\n 6: 'barbell_back_squat',\n 7: 'barbell_box_squat',\n 8: 'barbell_front_squat',\n 9: 'barbell_hack_squat',\n 10: 'barbell_hang_squat_snatch',\n 11: 'barbell_lateral_step_up',\n 12: 'barbell_quarter_squat',\n 13: 'barbell_siff_squat',\n 14: 'barbell_squat_snatch',\n 15: 'barbell_squat_with_heels_raised',\n 16: 'barbell_stepover',\n 17: 'barbell_step_up',\n 18: 'bench_squat_with_rotational_chop',\n 19: 'weighted_bench_squat_with_rotational_chop',\n 20: 'body_weight_wall_squat',\n 21: 'weighted_wall_squat',\n 22: 'box_step_squat',\n 23: 'weighted_box_step_squat',\n 24: 'braced_squat',\n 25: 'crossed_arm_barbell_front_squat',\n 26: 'crossover_dumbbell_step_up',\n 27: 'dumbbell_front_squat',\n 28: 'dumbbell_split_squat',\n 29: 'dumbbell_squat',\n 30: 'dumbbell_squat_clean',\n 31: 'dumbbell_stepover',\n 32: 'dumbbell_step_up',\n 33: 'elevated_single_leg_squat',\n 34: 'weighted_elevated_single_leg_squat',\n 35: 'figure_four_squats',\n 36: 'weighted_figure_four_squats',\n 37: 'goblet_squat',\n 38: 'kettlebell_squat',\n 39: 'kettlebell_swing_overhead',\n 40: 'kettlebell_swing_with_flip_to_squat',\n 41: 'lateral_dumbbell_step_up',\n 42: 'one_legged_squat',\n 43: 'overhead_dumbbell_squat',\n 44: 'overhead_squat',\n 45: 'partial_single_leg_squat',\n 46: 'weighted_partial_single_leg_squat',\n 47: 'pistol_squat',\n 48: 'weighted_pistol_squat',\n 49: 'plie_slides',\n 50: 'weighted_plie_slides',\n 51: 'plie_squat',\n 52: 'weighted_plie_squat',\n 53: 'prisoner_squat',\n 54: 'weighted_prisoner_squat',\n 55: 'single_leg_bench_get_up',\n 56: 'weighted_single_leg_bench_get_up',\n 57: 'single_leg_bench_squat',\n 58: 'weighted_single_leg_bench_squat',\n 59: 'single_leg_squat_on_swiss_ball',\n 60: 'weighted_single_leg_squat_on_swiss_ball',\n 61: 'squat',\n 62: 'weighted_squat',\n 63: 'squats_with_band',\n 64: 'staggered_squat',\n 65: 'weighted_staggered_squat',\n 66: 'step_up',\n 67: 'weighted_step_up',\n 68: 'suitcase_squats',\n 69: 'sumo_squat',\n 70: 'sumo_squat_slide_in',\n 71: 'weighted_sumo_squat_slide_in',\n 72: 'sumo_squat_to_high_pull',\n 73: 'sumo_squat_to_stand',\n 74: 'weighted_sumo_squat_to_stand',\n 75: 'sumo_squat_with_rotation',\n 76: 'weighted_sumo_squat_with_rotation',\n 77: 'swiss_ball_body_weight_wall_squat',\n 78: 'weighted_swiss_ball_wall_squat',\n 79: 'thrusters',\n 80: 'uneven_squat',\n 81: 'weighted_uneven_squat',\n 82: 'waist_slimming_squat',\n 83: 'wall_ball',\n 84: 'wide_stance_barbell_squat',\n 85: 'wide_stance_goblet_squat',\n 86: 'zercher_squat',\n 87: 'kbs_overhead',\n 88: 'squat_and_side_kick',\n 89: 'squat_jumps_in_n_out',\n 90: 'pilates_plie_squats_parallel_turned_out_flat_and_heels',\n 91: 'releve_straight_leg_and_knee_bent_with_one_leg_variation',\n },\n total_body_exercise_name: {\n 0: 'burpee',\n 1: 'weighted_burpee',\n 2: 'burpee_box_jump',\n 3: 'weighted_burpee_box_jump',\n 4: 'high_pull_burpee',\n 5: 'man_makers',\n 6: 'one_arm_burpee',\n 7: 'squat_thrusts',\n 8: 'weighted_squat_thrusts',\n 9: 'squat_plank_push_up',\n 10: 'weighted_squat_plank_push_up',\n 11: 'standing_t_rotation_balance',\n 12: 'weighted_standing_t_rotation_balance',\n },\n triceps_extension_exercise_name: {\n 0: 'bench_dip',\n 1: 'weighted_bench_dip',\n 2: 'body_weight_dip',\n 3: 'cable_kickback',\n 4: 'cable_lying_triceps_extension',\n 5: 'cable_overhead_triceps_extension',\n 6: 'dumbbell_kickback',\n 7: 'dumbbell_lying_triceps_extension',\n 8: 'ez_bar_overhead_triceps_extension',\n 9: 'incline_dip',\n 10: 'weighted_incline_dip',\n 11: 'incline_ez_bar_lying_triceps_extension',\n 12: 'lying_dumbbell_pullover_to_extension',\n 13: 'lying_ez_bar_triceps_extension',\n 14: 'lying_triceps_extension_to_close_grip_bench_press',\n 15: 'overhead_dumbbell_triceps_extension',\n 16: 'reclining_triceps_press',\n 17: 'reverse_grip_pressdown',\n 18: 'reverse_grip_triceps_pressdown',\n 19: 'rope_pressdown',\n 20: 'seated_barbell_overhead_triceps_extension',\n 21: 'seated_dumbbell_overhead_triceps_extension',\n 22: 'seated_ez_bar_overhead_triceps_extension',\n 23: 'seated_single_arm_overhead_dumbbell_extension',\n 24: 'single_arm_dumbbell_overhead_triceps_extension',\n 25: 'single_dumbbell_seated_overhead_triceps_extension',\n 26: 'single_leg_bench_dip_and_kick',\n 27: 'weighted_single_leg_bench_dip_and_kick',\n 28: 'single_leg_dip',\n 29: 'weighted_single_leg_dip',\n 30: 'static_lying_triceps_extension',\n 31: 'suspended_dip',\n 32: 'weighted_suspended_dip',\n 33: 'swiss_ball_dumbbell_lying_triceps_extension',\n 34: 'swiss_ball_ez_bar_lying_triceps_extension',\n 35: 'swiss_ball_ez_bar_overhead_triceps_extension',\n 36: 'tabletop_dip',\n 37: 'weighted_tabletop_dip',\n 38: 'triceps_extension_on_floor',\n 39: 'triceps_pressdown',\n 40: 'weighted_dip',\n },\n warm_up_exercise_name: {\n 0: 'quadruped_rocking',\n 1: 'neck_tilts',\n 2: 'ankle_circles',\n 3: 'ankle_dorsiflexion_with_band',\n 4: 'ankle_internal_rotation',\n 5: 'arm_circles',\n 6: 'bent_over_reach_to_sky',\n 7: 'cat_camel',\n 8: 'elbow_to_foot_lunge',\n 9: 'forward_and_backward_leg_swings',\n 10: 'groiners',\n 11: 'inverted_hamstring_stretch',\n 12: 'lateral_duck_under',\n 13: 'neck_rotations',\n 14: 'opposite_arm_and_leg_balance',\n 15: 'reach_roll_and_lift',\n 16: 'scorpion',\n 17: 'shoulder_circles',\n 18: 'side_to_side_leg_swings',\n 19: 'sleeper_stretch',\n 20: 'slide_out',\n 21: 'swiss_ball_hip_crossover',\n 22: 'swiss_ball_reach_roll_and_lift',\n 23: 'swiss_ball_windshield_wipers',\n 24: 'thoracic_rotation',\n 25: 'walking_high_kicks',\n 26: 'walking_high_knees',\n 27: 'walking_knee_hugs',\n 28: 'walking_leg_cradles',\n 29: 'walkout',\n 30: 'walkout_from_push_up_position',\n },\n run_exercise_name: {\n 0: 'run',\n 1: 'walk',\n 2: 'jog',\n 3: 'sprint',\n },\n water_type: {\n 0: 'fresh',\n 1: 'salt',\n 2: 'en13319',\n 3: 'custom',\n },\n tissue_model_type: {\n 0: 'zhl_16c',\n },\n dive_gas_status: {\n 0: 'disabled',\n 1: 'enabled',\n 2: 'backup_only',\n },\n dive_alarm_type: {\n 0: 'depth',\n 1: 'time',\n },\n dive_backlight_mode: {\n 0: 'at_depth',\n 1: 'always_on',\n },\n favero_product: {\n 10: 'assioma_uno',\n 12: 'assioma_duo',\n },\n },\n};\n", "import { FIT } from './fit.js';\nfunction getFieldObject(fieldNum, messageNum) {\n const message = FIT.messages[messageNum];\n if (!message) {\n return {};\n }\n return message[fieldNum] || {};\n}\nfunction getMessageName(messageNum) {\n const message = FIT.messages[messageNum];\n return message ? message.name : '';\n}\nexport function getFitMessage(messageNum) {\n return {\n name: getMessageName(messageNum),\n getAttributes: (fieldNum) => getFieldObject(fieldNum, messageNum),\n };\n}\n// TODO\nexport function getFitMessageBaseType(inp) {\n return inp;\n}\n", "export function mapDataIntoLap(inputLaps, lapKey, data) {\n const laps = [...inputLaps];\n let index = 0;\n for (let i = 0; i < laps.length; i++) {\n const nextLap = laps[i + 1];\n const tempData = [];\n const nextLapStartTime = nextLap\n ? new Date(nextLap.start_time).getTime()\n : null;\n for (let j = index; j < data.length; j++) {\n const row = data[j];\n if (nextLap && nextLapStartTime) {\n const timestamp = new Date(row.timestamp || row.start_time).getTime();\n if (nextLapStartTime > timestamp) {\n tempData.push(row);\n }\n else if (nextLapStartTime <= timestamp) {\n index = j;\n break;\n }\n }\n else {\n tempData.push(row);\n }\n }\n if (!laps[i][lapKey]) {\n laps[i][lapKey] = tempData;\n }\n }\n return laps;\n}\nexport function mapDataIntoSession(inputSessions, laps) {\n const sessions = [...inputSessions];\n let lapIndex = 0;\n for (let i = 0; i < sessions.length; i++) {\n const nextSession = sessions[i + 1];\n const tempLaps = [];\n const nextSessionStartTime = nextSession\n ? new Date(nextSession.start_time).getTime()\n : null;\n for (let j = lapIndex; j < laps.length; j++) {\n const lap = laps[j];\n if (nextSession && nextSessionStartTime) {\n const lapStartTime = new Date(lap.start_time).getTime();\n if (nextSessionStartTime > lapStartTime) {\n tempLaps.push(lap);\n }\n else if (nextSessionStartTime <= lapStartTime) {\n lapIndex = j;\n break;\n }\n }\n else {\n tempLaps.push(lap);\n }\n }\n if (!sessions[i].laps) {\n sessions[i].laps = tempLaps;\n }\n }\n return sessions;\n}\n", "import { calculateCRC, getArrayBuffer, readRecord } from './binary.js';\nimport { mapDataIntoLap, mapDataIntoSession } from './helper.js';\nexport default class FitParser {\n constructor(options = {}) {\n this.options = {\n force: options.force != null ? options.force : true,\n speedUnit: options.speedUnit || 'm/s',\n lengthUnit: options.lengthUnit || 'm',\n temperatureUnit: options.temperatureUnit || 'celsius',\n elapsedRecordField: options.elapsedRecordField || false,\n pressureUnit: options.pressureUnit || 'bar',\n mode: options.mode || 'list',\n };\n }\n parseAsync(content) {\n return new Promise((resolve, reject) => {\n this.parse(content, (error, data) => {\n if (error) {\n reject(error);\n }\n else if (data) {\n resolve(data);\n }\n });\n });\n }\n parse(content, callback) {\n var _a;\n const blob = new Uint8Array(getArrayBuffer(content));\n if (blob.length < 12) {\n callback('File to small to be a FIT file', undefined);\n if (!this.options.force) {\n return;\n }\n }\n const headerLength = blob[0];\n if (headerLength !== 14 && headerLength !== 12) {\n callback('Incorrect header size', undefined);\n if (!this.options.force) {\n return;\n }\n }\n let fileTypeString = '';\n for (let i = 8; i < 12; i++) {\n fileTypeString += String.fromCharCode(blob[i]);\n }\n if (fileTypeString !== '.FIT') {\n callback('Missing \\'.FIT\\' in header', undefined);\n if (!this.options.force) {\n return;\n }\n }\n if (headerLength === 14) {\n const crcHeader = blob[12] + (blob[13] << 8);\n const crcHeaderCalc = calculateCRC(blob, 0, 12);\n if (crcHeader !== crcHeaderCalc) {\n // callback('Header CRC mismatch', {});\n // TODO: fix Header CRC check\n if (!this.options.force) {\n return;\n }\n }\n }\n const protocolVersion = blob[1];\n const profileVersion = blob[2] + (blob[3] << 8);\n const dataLength = blob[4] + (blob[5] << 8) + (blob[6] << 16) + (blob[7] << 24);\n const crcStart = dataLength + headerLength;\n const crcFile = blob[crcStart] + (blob[crcStart + 1] << 8);\n const crcFileCalc = calculateCRC(blob, headerLength === 12 ? 0 : headerLength, crcStart);\n if (crcFile !== crcFileCalc) {\n // callback('File CRC mismatch', {});\n // TODO: fix File CRC check\n if (!this.options.force) {\n return;\n }\n }\n const fitObj = {\n profileVersion,\n protocolVersion,\n };\n let sessions = [];\n let laps = [];\n const records = [];\n const events = [];\n const hr_zone = [];\n const power_zone = [];\n const hrv = [];\n const device_infos = [];\n const applications = [];\n const fieldDescriptions = [];\n const dive_gases = [];\n const course_points = [];\n const sports = [];\n const monitors = [];\n const stress = [];\n const definitions = [];\n const file_ids = [];\n const monitor_info = [];\n const lengths = [];\n const tank_updates = [];\n const tank_summaries = [];\n const jumps = [];\n const time_in_zone = [];\n const activity_metrics = [];\n let loopIndex = headerLength;\n const messageTypes = [];\n const developerFields = [];\n const isModeCascade = this.options.mode === 'cascade';\n const isCascadeNeeded = isModeCascade || this.options.mode === 'both';\n let startDate;\n let lastStopTimestamp;\n let pausedTime = 0;\n while (loopIndex < crcStart) {\n const { nextIndex, messageType, message } = readRecord(blob, messageTypes, developerFields, loopIndex, this.options, startDate, pausedTime);\n loopIndex = nextIndex;\n switch (messageType) {\n case 'lap':\n laps.push(message);\n break;\n case 'session':\n sessions.push(message);\n break;\n case 'event':\n if (message.event === 'timer') {\n if (message.event_type === 'stop_all') {\n lastStopTimestamp = message.timestamp;\n }\n else if (message.event_type === 'start' && lastStopTimestamp) {\n pausedTime += (message.timestamp - lastStopTimestamp) / 1000;\n }\n }\n events.push(message);\n break;\n case 'length':\n lengths.push(message);\n break;\n case 'hrv':\n hrv.push(message);\n break;\n case 'hr_zone':\n hr_zone.push(message);\n break;\n case 'power_zone':\n power_zone.push(message);\n break;\n case 'record':\n if (!startDate) {\n startDate = message.timestamp;\n message.elapsed_time = 0;\n message.timer_time = 0;\n }\n records.push(message);\n break;\n case 'field_description':\n fieldDescriptions.push(message);\n break;\n case 'device_info':\n device_infos.push(message);\n break;\n case 'developer_data_id':\n applications.push(message);\n break;\n case 'dive_gas':\n dive_gases.push(message);\n break;\n case 'course_point':\n course_points.push(message);\n break;\n case 'sport':\n sports.push(message);\n break;\n case 'file_id':\n if (message) {\n file_ids.push(message);\n }\n break;\n case 'definition':\n if (message) {\n definitions.push(message);\n }\n break;\n case 'monitoring':\n monitors.push(message);\n break;\n case 'monitoring_info':\n monitor_info.push(message);\n break;\n case 'stress_level':\n stress.push(message);\n break;\n case 'software':\n fitObj.software = message;\n break;\n case 'tank_update':\n tank_updates.push(message);\n break;\n case 'tank_summary':\n tank_summaries.push(message);\n break;\n case 'jump':\n jumps.push(message);\n break;\n case 'time_in_zone':\n time_in_zone.push(message);\n break;\n case 'activity_metrics':\n activity_metrics.push(message);\n break;\n default:\n if (messageType !== '') {\n fitObj[messageType] = message;\n }\n break;\n }\n }\n fitObj.hr_zone = hr_zone;\n fitObj.power_zone = power_zone;\n fitObj.dive_gases = dive_gases;\n fitObj.course_points = course_points;\n fitObj.sports = sports;\n fitObj.monitors = monitors;\n fitObj.stress = stress;\n fitObj.file_ids = file_ids;\n fitObj.monitor_info = monitor_info;\n fitObj.definitions = definitions;\n fitObj.tank_updates = tank_updates;\n fitObj.tank_summaries = tank_summaries;\n fitObj.jumps = jumps;\n fitObj.time_in_zone = time_in_zone;\n fitObj.activity_metrics = activity_metrics;\n if (isCascadeNeeded) {\n laps = mapDataIntoLap(laps, 'records', records);\n laps = mapDataIntoLap(laps, 'lengths', lengths);\n sessions = mapDataIntoSession(sessions, laps);\n fitObj.activity = Object.assign(Object.assign({}, ((_a = fitObj.activity) !== null && _a !== void 0 ? _a : {})), { // ugly but we assume the activity was parsed correctly with all other members correctly\n sessions,\n events,\n hrv,\n device_infos, developer_data_ids: applications, field_descriptions: fieldDescriptions, sports });\n }\n if (!isModeCascade) {\n fitObj.sessions = sessions;\n fitObj.laps = laps;\n fitObj.lengths = lengths;\n fitObj.records = records;\n fitObj.events = events;\n fitObj.device_infos = device_infos;\n fitObj.developer_data_ids = applications;\n fitObj.field_descriptions = fieldDescriptions;\n fitObj.hrv = hrv;\n }\n callback(undefined, fitObj);\n }\n}\n", "// Copyright (c) 2026, Camillo Bruni.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport FitParser from 'fit-file-parser';\nexport default FitParser;\n"], + "mappings": "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AO,QACX,EACA,GAAI,CACA,MAAO,aACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,QACX,EACA,GAAI,CACA,MAAO,iBACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,KACX,EACA,GAAI,CACA,MAAO,iBACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,KACX,EACA,GAAI,CACA,MAAO,2BACP,KAAM,SACN,MAAO,GACP,OAAQ,EACR,MAAO,IACX,EACA,GAAI,CACA,MAAO,0BACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,SACX,EACA,GAAI,CACA,MAAO,kBACP,KAAM,SACN,MAAO,GACP,OAAQ,EACR,MAAO,IACX,EACA,GAAI,CACA,MAAO,yBACP,KAAM,QACN,MAAO,IACP,OAAQ,EACR,MAAO,KACX,EACA,GAAI,CACA,MAAO,yBACP,KAAM,QACN,MAAO,IACP,OAAQ,EACR,MAAO,KACX,EACA,GAAI,CACA,MAAO,0BACP,KAAM,QACN,MAAO,IACP,OAAQ,EACR,MAAO,QACX,EACA,GAAI,CACA,MAAO,4BACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,MACX,EACA,GAAI,CACA,MAAO,4BACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,MACX,EACA,GAAI,CACA,MAAO,4BACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,MACX,EACA,GAAI,CACA,MAAO,mCACP,KAAM,SACN,MAAO,GACP,OAAQ,EACR,MAAO,GACX,EACA,GAAI,CACA,MAAO,mCACP,KAAM,SACN,MAAO,GACP,OAAQ,EACR,MAAO,GACX,EACA,IAAK,CACD,MAAO,mCACP,KAAM,SACN,MAAO,GACP,OAAQ,EACR,MAAO,GACX,EACA,IAAK,CACD,MAAO,gCACP,KAAM,QACN,MAAO,EACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,iCACP,KAAM,QACN,MAAO,EACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,4BACP,KAAM,QACN,MAAO,EACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,6BACP,KAAM,QACN,MAAO,EACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,gCACP,KAAM,QACN,MAAO,EACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,cACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,IAAK,CACD,MAAO,gBACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,GACX,EACA,IAAK,CACD,MAAO,cACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,IAAK,CACD,MAAO,eACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,IACX,EACA,IAAK,CACD,MAAO,gBACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,IACX,EACA,IAAK,CACD,MAAO,uBACP,KAAM,QACN,MAAO,SACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,4BACP,KAAM,QACN,MAAO,SACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,wBACP,KAAM,QACN,MAAO,SACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,6BACP,KAAM,QACN,MAAO,SACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,qBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,OACX,EACA,IAAK,CACD,MAAO,qBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,OACX,EACA,IAAK,CACD,MAAO,uBACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,KACX,EACA,IAAK,CACD,MAAO,uBACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,KACX,EACA,IAAK,CACD,MAAO,qBACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,KACX,EACA,IAAK,CACD,MAAO,qBACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,KACX,EACA,IAAK,CACD,MAAO,wBACP,KAAM,SACN,MAAO,EACP,OAAQ,KACR,MAAO,GACX,EACA,IAAK,CACD,MAAO,wBACP,KAAM,SACN,MAAO,EACP,OAAQ,KACR,MAAO,GACX,EACA,IAAK,CACD,MAAO,wBACP,KAAM,SACN,MAAO,EACP,OAAQ,KACR,MAAO,GACX,EACA,IAAK,CACD,MAAO,sBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,OACX,EACA,IAAK,CACD,MAAO,sBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,OACX,EACA,IAAK,CACD,MAAO,0BACP,KAAM,QACN,MAAO,EACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,qBACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,0BACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,kBACP,KAAM,SACN,MAAO,GACP,OAAQ,EACR,MAAO,IACX,EACA,IAAK,CACD,MAAO,kCACP,KAAM,QACN,MAAO,GACP,OAAQ,EACR,MAAO,EACX,EACA,IAAK,CACD,MAAO,UACP,KAAM,SACN,MAAO,EACP,OAAQ,EACR,MAAO,KACX,EACA,IAAK,CACD,MAAO,eACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,IAAK,CACD,MAAO,cACP,KAAM,QACN,MAAO,GACP,OAAQ,EACR,MAAO,EACX,EACA,IAAK,CACD,MAAO,qBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,IAAK,CACD,MAAO,qBACP,KAAM,SACN,MAAO,EACP,OAAQ,EACR,MAAO,EACX,EACA,IAAK,CACD,MAAO,gCACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,aACX,EACA,IAAK,CACD,MAAO,kBACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,GACX,EACA,IAAK,CACD,MAAO,gCACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,aACX,EACA,IAAK,CACD,MAAO,iBACP,KAAM,SACN,MAAO,EACP,OAAQ,EACR,MAAO,IACX,EACA,IAAK,CACD,MAAO,gCACP,KAAM,SACN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AQ,KACR,MAAO,GACX,EACA,IAAK,CACD,MAAO,sBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,OACX,EACA,IAAK,CACD,MAAO,sBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,OACX,EACA,IAAK,CACD,MAAO,0BACP,KAAM,QACN,MAAO,EACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,qBACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,0BACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,SACX,EACA,IAAK,CACD,MAAO,kBACP,KAAM,SACN,MAAO,GACP,OAAQ,EACR,MAAO,IACX,EACA,IAAK,CACD,MAAO,UACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,KACX,CACJ,EACA,GAAI,CACA,KAAM,SACN,IAAK,CACD,MAAO,YACP,KAAM,YACN,MAAO,KACP,OAAQ,EACR,MAAO,GACX,EACA,IAAK,CACD,MAAO,OACP,KAAM,UACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,IAAK,CACD,MAAO,OACP,KAAM,UACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,EAAG,CACC,MAAO,eACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,aACX,EACA,EAAG,CACC,MAAO,gBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,aACX,EACA,EAAG,CACC,MAAO,WACP,KAAM,SACN,MAAO,EACP,OAAQ,KACR,MAAO,GACX,EACA,EAAG,CACC,MAAO,aACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,KACX,EACA,EAAG,CACC,MAAO,UACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,KACX,EACA,EAAG,CACC,MAAO,WACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,GACX,EACA,EAAG,CACC,MAAO,QACP,KAAM,SACN,MAAO,IACP,OAAQ,EACR,MAAO,KACX,EACA,EAAG,CACC,MAAO,QACP,KAAM,SACN,MAAO,KACP,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CACC,MAAO,gBACP,KAAM,gBACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,EAAG,CACC,MAAO,mBACP,KAAM,mBACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,EAAG,CACC,MAAO,iBACP,KAAM,iBACN,MAAO,KACP,OAAQ,EACR,MAAO,GACX,EACA,EAAG,CACC,MAAO,aACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,GACX,EACA,EAAG,CACC,MAAO,WACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,QACX,EACA,GAAI,CACA,MAAO,gBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,kBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,cACP,KAAM,UACN,MAAO,KACP,OAAQ,EACR,MAAO,GACX,EACA,GAAI,CACA,MAAO,kBACP,KAAM,UACN,MAAO,KACP,OAAQ,EACR,MAAO,GACX,EACA,GAAI,CACA,MAAO,kBACP,KAAM,UACN,MAAO,KACP,OAAQ,EACR,MAAO,GACX,EACA,GAAI,CACA,MAAO,gBACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,kBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,MACX,EACA,GAAI,CACA,MAAO,kCACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,iBACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,cACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,aACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,KACX,EACA,GAAI,CACA,MAAO,YACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,eACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,WACP,K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AAO,SACX,EACA,EAAG,CACC,MAAO,eACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,SACX,EACA,EAAG,CACC,MAAO,WACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,SACX,EACA,EAAG,CACC,MAAO,sBACP,KAAM,OACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,eACP,KAAM,UACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,cACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,0BACP,KAAM,OACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,uBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,iBACP,KAAM,sBACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,uBACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,oBACP,KAAM,oBACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,mBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,GACX,EACA,GAAI,CACA,MAAO,mBACP,KAAM,SACN,MAAO,KACP,OAAQ,EACR,MAAO,GACX,EACA,GAAI,CACA,MAAO,yBACP,KAAM,cACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,GAAI,CACA,MAAO,oBACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,CACJ,EACA,IAAK,CACD,KAAM,WACN,IAAK,CACD,MAAO,gBACP,KAAM,gBACN,MAAO,KACP,OAAQ,EACR,MAAO,EACX,EACA,EAAG,CACC,MAAO,iBACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,SACX,EACA,EAAG,CACC,MAAO,iBACP,KAAM,QACN,MAAO,KACP,OAAQ,EACR,MAAO,SACX,EACA,EAAG,CACC,MAAO,SACP,KAAM,kBACN,MAAO,KACP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IAAK,eACL,IAAK,iBACL,IAAK,iBACL,IAAK,kBACL,IAAK,iBACL,IAAK,QACL,IAAK,MACL,IAAK,eACL,IAAK,aACL,IAAK,kBACL,IAAK,WACL,IAAK,YACL,IAAK,WACL,IAAK,QACL,IAAK,UACL,IAAK,YACL,KAAM,eACV,EACA,eAAgB,CACZ,EAAG,WACH,EAAG,OACH,EAAG,QACH,EAAG,QACH,EAAG,QACH,EAAG,SACH,EAAG,YACH,EAAG,SACH,EAAG,iCACH,EAAG,MACH,GAAI,MACJ,GAAI,QACJ,GAAI,iCACJ,GAAI,+BACJ,IAAK,cACL,IAAK,cACL,IAAK,cACL,IAAK,eACL,IAAK,QACL,IAAK,OACL,IAAK,cACL,IAAK,OACL,KAAM,YACN,KAAM,UACN,KAAM,UACN,KAAM,QACN,KAAM,UACN,KAAM,iBACN,KAAM,gBACN,KAAM,QACN,KAAM,cACN,KAAM,UACN,KAAM,UACN,KAAM,iBACN,KAAM,gBACN,KAAM,QACN,KAAM,QACN,KAAM,cACN,KAAM,YACN,KAAM,YACN,KAAM,gBACN,KAAM,gBACN,KAAM,cACN,KAAM,gBACN,KAAM,OACN,KAAM,aACN,KAAM,MACN,KAAM,OACN,KAAM,gBACN,KAAM,OACN,KAAM,gBACN,KAAM,QACN,KAAM,iBACN,KAAM,UACN,KAAM,UACN,KAAM,QACN,KAAM,gBACN,KAAM,QACN,KAAM,QACN,KAAM,gBACN,KAAM,aACN,KAAM,gBACN,KAAM,aACN,KAAM,eACN,KAAM,gBACN,KAAM,UACN,KAAM,UACN,KAAM,UACN,KAAM,eACN,KAAM,gBACN,KAAM,iBACN,KAAM,WACN,KAAM,WACN,KAAM,cACN,KAAM,UACN,KAAM,OACN,KAAM,cACN,KAAM,gBACN,KAAM,cACN,KAAM,cACN,KAAM,cACN,KAAM,cACN,KAAM,cACN,KAAM,aACN,KAAM,SACN,KAAM,OACN,KAAM,SACN,KAAM,kBACN,KAAM,iBACN,KAAM,aACN,KAAM,UACN,KAAM,iBACN,KAAM,eACN,KAAM,eACN,KAAM,WACN,KAAM,iBACN,KAAM,iBACN,KAAM,gBACN,KAA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AG,MACH,EAAG,KACH,EAAG,OACH,EAAG,QACH,GAAI,aACR,EACA,sBAAuB,CACnB,EAAG,gBACH,EAAG,aACH,EAAG,YACP,EACA,uBAAwB,CACpB,EAAG,UACH,EAAG,WACP,EACA,YAAa,CACT,EAAG,MACH,EAAG,UACH,EAAG,YACH,EAAG,uBACH,EAAG,OACH,EAAG,OACP,EACA,oBAAqB,CACjB,EAAG,OACH,EAAG,WACH,EAAG,YACH,EAAG,mBACH,EAAG,mBACP,EACA,kBAAmB,CACf,EAAG,OACH,EAAG,YACH,EAAG,iBACH,EAAG,eACH,EAAG,iBACH,EAAG,cACP,EACA,eAAgB,CACZ,EAAG,UACH,EAAG,SACH,EAAG,aACH,EAAG,UACP,EACA,yBAA0B,CACtB,EAAG,cACH,EAAG,SACH,EAAG,MACP,EACA,wBAAyB,CACrB,EAAG,UACH,EAAG,cACH,EAAG,QACP,EACA,oBAAqB,CACjB,EAAG,SACH,EAAG,WACH,EAAG,uBACH,EAAG,wBACP,EACA,iBAAkB,CACd,EAAG,0BACH,EAAG,wBACH,EAAG,yBACH,EAAG,oBACP,EACA,kBAAmB,CACf,EAAG,cACH,EAAG,cACH,EAAG,YACH,EAAG,cACH,EAAG,4BACH,EAAG,4BACH,EAAG,0BACH,EAAG,oBACH,EAAG,kCACH,GAAI,cACJ,GAAI,4BACJ,GAAI,eACJ,GAAI,4BACR,EACA,YAAa,CACT,EAAG,gBACH,EAAG,YACH,EAAG,UACH,EAAG,WACP,EACA,+BAAgC,CAC5B,EAAG,OACH,EAAG,aACH,EAAG,kBACH,EAAG,OACP,EACA,kBAAmB,CACf,EAAG,2BACH,EAAG,kBACH,EAAG,kBACH,EAAG,oBACP,EACA,wBAAyB,CACrB,EAAG,uBACH,EAAG,wBACH,EAAG,yBACH,EAAG,wBACP,EACA,eAAgB,CACZ,EAAG,SACH,EAAG,WACH,EAAG,WACH,EAAG,OACP,EACA,kBAAmB,CACf,EAAG,EACH,EAAG,4BACH,EAAG,cACH,EAAG,aACH,EAAG,2BACH,GAAI,0BACJ,GAAI,kBACJ,GAAI,UACJ,IAAK,cACL,IAAK,SAC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", + "names": ["require_base64_js", "__commonJSMin", "exports", "byteLength", "toByteArray", "fromByteArray", "lookup", "revLookup", "Arr", "code", "i", "len", "getLens", "b64", "validLen", "placeHoldersLen", "lens", "_byteLength", "tmp", "arr", "curByte", "tripletToBase64", "num", "encodeChunk", "uint8", "start", "end", "output", "extraBytes", "parts", "maxChunkLength", "len2", "require_ieee754", "__commonJSMin", "exports", "buffer", "offset", "isLE", "mLen", "nBytes", "e", "m", "eLen", "eMax", "eBias", "nBits", "i", "d", "s", "value", "c", "rt", "require_buffer", "__commonJSMin", "exports", "base64", "ieee754", "customInspectSymbol", "Buffer", "SlowBuffer", "K_MAX_LENGTH", "typedArraySupport", "arr", "proto", "createBuffer", "length", "buf", "arg", "encodingOrOffset", "allocUnsafe", "from", "value", "fromString", "fromArrayView", "isInstance", "fromArrayBuffer", "valueOf", "b", "fromObject", "assertSize", "size", "alloc", "fill", "encoding", "checked", "string", "byteLength", "actual", "fromArrayLike", "array", "i", "arrayView", "copy", "byteOffset", "obj", "len", "numberIsNaN", "a", "x", "y", "list", "buffer", "pos", "mustMatch", "loweredCase", "utf8ToBytes", "base64ToBytes", "slowToString", "start", "end", "hexSlice", "utf8Slice", "asciiSlice", "latin1Slice", "base64Slice", "utf16leSlice", "swap", "n", "m", "str", "max", "target", "thisStart", "thisEnd", "thisCopy", "targetCopy", "bidirectionalIndexOf", "val", "dir", "arrayIndexOf", "indexSize", "arrLength", "valLength", "read", "foundIndex", "found", "j", "hexWrite", "offset", "remaining", "strLen", "parsed", "utf8Write", "blitBuffer", "asciiWrite", "asciiToBytes", "base64Write", "ucs2Write", "utf16leToBytes", "res", "firstByte", "codePoint", "bytesPerSequence", "secondByte", "thirdByte", "fourthByte", "tempCodePoint", "decodeCodePointsArray", "MAX_ARGUMENTS_LENGTH", "codePoints", "ret", "out", "hexSliceLookupTable", "bytes", "newBuf", "checkOffset", "ext", "noAssert", "mul", "defineBigIntMethod", "validateNumber", "first", "last", "boundsError", "lo", "hi", "checkInt", "min", "maxBytes", "wrtBigUInt64LE", "checkIntBI", "wrtBigUInt64BE", "limit", "sub", "checkIEEE754", "writeFloat", "littleEndian", "writeDouble", "targetStart", "code", "errors", "E", "sym", "getMessage", "Base", "name", "range", "input", "msg", "received", "addNumericalSeparator", "checkBounds", "type", "INVALID_BASE64_RE", "base64clean", "units", "leadSurrogate", "byteArray", "c", "src", "dst", "alphabet", "table", "i16", "fn", "BufferBigIntNotDefined", "import_buffer", "psiInOneBar", "FIT", "getFieldObject", "fieldNum", "messageNum", "message", "FIT", "getMessageName", "getFitMessage", "CompressedLocalMsgNumMask", "CompressedHeaderMask", "GarminTimeOffset", "monitoring_timestamp", "addEndian", "littleEndian", "bytes", "result", "i", "readData", "blob", "fDef", "startIndex", "options", "array8", "temp", "buffer", "dataView", "array32", "array16", "e", "val", "formatByType", "data", "type", "scale", "offset", "FIT", "baseType", "dataItem", "isInvalidValue", "values", "key", "mapped", "convertTo", "unitsList", "unitName", "unit", "applyOptions", "field", "fields", "isLocal", "isBLE", "isANT", "n1", "n2", "n3", "n4", "readRecord", "messageTypes", "developerFields", "startDate", "pausedTime", "recordHeader", "localMessageType", "hasDeveloperData", "lEnd", "numberOfFields", "numberOfDeveloperDataFields", "mTypeDef", "message", "getFitMessage", "fDefIndex", "fieldNum", "size", "devDataIndex", "devDef", "nextIndex", "nextIndexWithDeveloperData", "messageType", "messageSize", "readDataFromIndex", "rawFields", "getArrayBuffer", "ab", "view", "calculateCRC", "start", "end", "crcTable", "crc", "byteVal", "tmp", "mapDataIntoLap", "inputLaps", "lapKey", "data", "laps", "index", "i", "nextLap", "tempData", "nextLapStartTime", "j", "row", "timestamp", "mapDataIntoSession", "inputSessions", "sessions", "lapIndex", "nextSession", "tempLaps", "nextSessionStartTime", "lap", "lapStartTime", "FitParser", "options", "content", "resolve", "reject", "error", "data", "callback", "_a", "blob", "getArrayBuffer", "headerLength", "fileTypeString", "i", "crcHeader", "crcHeaderCalc", "calculateCRC", "protocolVersion", "profileVersion", "crcStart", "crcFile", "crcFileCalc", "fitObj", "sessions", "laps", "records", "events", "hr_zone", "power_zone", "hrv", "device_infos", "applications", "fieldDescriptions", "dive_gases", "course_points", "sports", "monitors", "stress", "definitions", "file_ids", "monitor_info", "lengths", "tank_updates", "tank_summaries", "jumps", "time_in_zone", "activity_metrics", "loopIndex", "messageTypes", "developerFields", "isModeCascade", "isCascadeNeeded", "startDate", "lastStopTimestamp", "pausedTime", "nextIndex", "messageType", "message", "readRecord", "mapDataIntoLap", "mapDataIntoSession", "vendor_fit_default", "FitParser"] +} diff --git a/suites-experimental/tools-gps-tracks-angular/dist/index.html b/suites-experimental/tools-gps-tracks-angular/dist/index.html new file mode 100644 index 000000000..a9431bfde --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/index.html @@ -0,0 +1,40 @@ + + + + + + Weg — GPS Analysis (Angular) + + + + + + + + + + + + +
+
+
+ + + + diff --git a/suites-experimental/tools-gps-tracks-angular/dist/material_symbols_rounded.woff2 b/suites-experimental/tools-gps-tracks-angular/dist/material_symbols_rounded.woff2 new file mode 100644 index 000000000..3dbcf04e5 Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/dist/material_symbols_rounded.woff2 differ diff --git a/suites-experimental/tools-gps-tracks-angular/dist/resources.txt b/suites-experimental/tools-gps-tracks-angular/dist/resources.txt new file mode 100644 index 000000000..8a82377a6 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/resources.txt @@ -0,0 +1,20 @@ +LICENSE +benchmark-override.mjs +benchmark-override.mjs.map +fit-file-parser.mjs +fit-file-parser.mjs.map +index.html +material_symbols_rounded.woff2 +styles.css +styles.css.map +test-data/activity_1_alps_stage.gpx.gz +test-data/activity_2_forest_mtb.gpx.gz +test-data/activity_3_road_race.tcx.gz +test-data/activity_4_intervals.tcx.gz +test-data/activity_5_grand_tour.fit.gz +test-data/activity_6_weekend_ride.fit.gz +test-data/manifest.json +tools-gps-tracks-angular.mjs +tools-gps-tracks-angular.mjs.map +uplot.mjs +uplot.mjs.map diff --git a/suites-experimental/tools-gps-tracks-angular/dist/styles.css b/suites-experimental/tools-gps-tracks-angular/dist/styles.css new file mode 100644 index 000000000..5bef53178 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/styles.css @@ -0,0 +1,2 @@ +.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}@font-face{font-family:Material Symbols Rounded;font-style:normal;font-weight:100 700;src:url("./material_symbols_rounded.woff2") format("woff2")}:root{--bg: #0e0e10;--surface: #18181b;--surface2: #222226;--border: #2e2e34;--border2: #3a3a42;--text: #e8e8ec;--text-muted: #888896;--text-dim: #555564;--theme-color: #3b82f6;--accent: var(--theme-color);--accent-hover: color-mix(in srgb, var(--theme-color) 80%, white);--danger: #ef4444;--sidebar-w: 230px;--fs-s: 10px;--fs-m: 12px;--fs-l: 14px;--is-s: 16px;--is-m: 20px;--handle-color: #3b82f6}.font-s{font-size:10px}.font-m{font-size:12px}.font-l{font-size:14px}*{box-sizing:border-box}body,html{margin:0;padding:0;width:100%;height:100%;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,sans-serif;font-size:var(--fs-m)}body{opacity:1}body.loading-fonts{opacity:0}button{font-family:inherit;cursor:pointer;font-size:var(--fs-m)}.material-symbols-rounded{font-family:Material Symbols Rounded;font-weight:400;font-style:normal;font-size:var(--is-m);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}#app{display:flex;width:100vw;height:100vh;overflow:hidden}app-graphs-tab,app-insights-tab,app-details-tab,app-combined-tab,app-evolution-tab,app-courses-tab{display:contents}.hidden{display:none!important}#global-loader{position:fixed;inset:0;background:#000000b3;z-index:10000;display:flex;align-items:center;justify-content:center}.loader-box{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:0;display:flex;flex-direction:row;align-items:stretch;color:var(--text);font-weight:700;box-shadow:0 4px 20px #00000080;max-width:450px;width:90%;overflow:hidden;position:relative}#loader-close{position:absolute;top:12px;right:12px;background:none;border:none;color:var(--text-muted);cursor:pointer;padding:4px;border-radius:50%;display:flex;align-items:center;justify-content:center}#loader-close:hover{background:var(--surface2);color:var(--text)}.loader-icon-wrap{background:color-mix(in srgb,var(--accent) 10%,transparent);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;border-right:1px solid var(--border);gap:8px}.loader-icon-wrap>span{font-size:var(--fs-l);color:var(--accent)}#loader-warning-count{font-size:var(--fs-m);color:#f59e0b;font-weight:700;display:none;align-items:center;gap:4px}.loader-content{padding:24px;flex:1;display:flex;flex-direction:column;gap:12px;justify-content:center}#loader-text{font-size:var(--fs-l);font-weight:700;color:var(--text)}#loader-filename{font-size:var(--fs-m);color:var(--text-muted);font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:300px}#loader-progress-wrap{width:300px;height:4px;background:var(--surface2);border-radius:2px;margin-top:4px;overflow:hidden}#loader-subtext{font-size:var(--fs-m);color:var(--text-muted);font-weight:400;display:flex;align-items:center;justify-content:space-between;width:300px;margin-top:0}.progress-index{text-align:left}.progress-total{text-align:right}#loader-progress-bar{width:0%;height:100%;background:var(--accent)}#sidebar{width:var(--sidebar-w);flex-shrink:0;display:flex;flex-direction:column;background:var(--surface);border-right:1px solid var(--border);z-index:10}#sidebar-header{padding:16px 12px;border-bottom:1px solid var(--border)}.logo{display:flex;align-items:center;gap:10px}.logo-icon{color:var(--accent);font-size:var(--fs-l)}.logo-title{font-weight:800;font-size:var(--fs-l);letter-spacing:-.5px}.logo-sub{font-size:var(--fs-s);text-transform:uppercase;color:var(--text-dim);font-weight:700;letter-spacing:1px;margin-top:-2px}#drop-zone{margin:12px;padding:20px 12px;border:2px dashed var(--border2);border-radius:12px;display:flex;flex-direction:column;align-items:center;text-align:center;position:relative}#drop-zone.drop-active{border-color:var(--accent);background:color-mix(in srgb,var(--theme-color) 5%,transparent)}.drop-icon{font-size:var(--is-m);color:var(--text-muted);margin-bottom:4px}.drop-primary{font-size:var(--fs-m);font-weight:600;color:var(--text)}.drop-formats{display:flex;justify-content:center;gap:6px;margin-top:8px}.drop-formats .badge{background:var(--surface2);color:var(--text-dim);font-size:var(--fs-s);padding:2px 6px}.drop-browse-container{margin-top:12px;font-size:var(--fs-s);color:var(--text-muted);display:flex;align-items:center;justify-content:center;gap:2px}.drop-browse{color:var(--accent);font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:4px}.drop-browse .material-symbols-rounded{font-size:var(--fs-l)}.drop-browse:hover{color:var(--accent-hover)}.drop-separator{margin:0 6px;color:var(--border2);vertical-align:middle}#track-list-header{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 8px}.section-label{font-size:var(--fs-s);font-weight:700;text-transform:uppercase;color:var(--text-dim);letter-spacing:.5px}.header-actions{display:flex;gap:0}#track-controls,#sort-controls{padding:8px 12px;display:flex;flex-direction:column;gap:8px;border-bottom:1px solid var(--border)}.search-bar{display:flex;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:2px 4px;align-items:center}.search-icon{font-size:var(--is-s);color:var(--text-dim);margin-left:4px}.search-bar input{flex:1;background:transparent;border:none;padding:4px 6px;color:var(--text);font-size:var(--fs-m)}.search-bar input:focus{outline:none}.icon-btn.mini{width:20px;height:20px;color:var(--text-dim)}.icon-btn.mini .material-symbols-rounded{font-size:var(--is-s)}.icon-btn.mini.active{color:var(--accent)}.sort-ctrl{display:flex;align-items:center;gap:8px}.sort-ctrl label{font-size:var(--fs-s);color:var(--text-dim);text-transform:uppercase;font-weight:600}.sort-select-btn{display:flex;align-items:center;gap:6px;background:var(--surface2);border:1px solid var(--border);padding:4px 8px;border-radius:6px;flex:1;height:24px;box-sizing:border-box;font-size:var(--fs-s);color:var(--text-muted)}.sort-select-btn:hover{border-color:var(--accent);color:var(--text)}.sort-select-btn .material-symbols-rounded{font-size:var(--is-s)}.sort-select-btn .arrow{font-size:var(--fs-l);margin-left:auto;opacity:.5}#filter-panel{padding:12px;background:var(--surface2);border-bottom:1px solid var(--border);display:flex;flex-direction:column;gap:12px}#filter-panel.hidden{display:none}.filter-group{display:flex;flex-direction:column;gap:4px}.filter-group label{font-size:var(--fs-s);font-weight:600;text-transform:uppercase;color:var(--text-dim);display:flex;align-items:center;gap:6px}.filter-group label .material-symbols-rounded{font-size:var(--is-s);opacity:.7}.filter-metrics-grid{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.mini-pill{width:28px;height:28px;display:flex;align-items:center;justify-content:center;background:var(--surface);border:1px solid var(--border);border-radius:6px;color:var(--text-dim);cursor:pointer}.mini-pill:hover{border-color:var(--text-muted);color:var(--text-muted)}.mini-pill.active{background:var(--accent);border-color:var(--accent);color:#fff}.mini-pill .material-symbols-rounded{font-size:var(--is-s)}.filter-row{display:flex;align-items:center;gap:6px}.filter-row input{flex:1;background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:4px 6px;color:var(--text);font-size:var(--fs-s)}.filter-row span{font-size:var(--fs-s);color:var(--text-dim)}#filter-panel input:focus{border-color:var(--accent);outline:none}.filter-footer{display:flex;justify-content:flex-end;margin-top:4px}#track-list{flex:1;overflow-y:auto;padding:4px 0;scrollbar-width:none}#track-list::-webkit-scrollbar{width:0;height:0;display:none}#track-list::-webkit-scrollbar-thumb{background:var(--border2);border-radius:2px}#track-list-empty{padding:40px 20px;text-align:center;color:var(--text-dim);font-size:var(--fs-m)}.track-item{display:flex;align-items:center;padding:6px 8px;gap:0;cursor:pointer;border-left:3px solid transparent}.track-item:hover{background:#ffffff08}.track-item.selected{background:color-mix(in srgb,var(--theme-color) 8%,transparent);border-left-color:var(--accent)}.track-color{width:3px;border-radius:1px;flex-shrink:0;margin-right:8px;align-self:stretch}.track-info{flex:1;min-width:0;margin-right:2px}.track-name{font-size:var(--fs-m);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:1px}.track-meta{font-size:var(--fs-s);color:var(--text-dim);display:flex;gap:6px;align-items:center}.track-item .icon-btn.mini{width:22px;height:22px;padding:0;margin:0}.badge{font-size:var(--fs-s);background:var(--surface2);padding:1px 4px;border-radius:3px;font-weight:700;color:var(--text-muted)}.track-tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px;overflow:hidden;max-height:32px}.track-tag{font-size:var(--fs-s);font-weight:700;color:var(--text-dim);background:#ffffff08;border:1px solid var(--border);padding:1px 5px;border-radius:3px;white-space:nowrap}.track-item.selected .track-tag{border-color:#ffffff1a;color:var(--text-muted)}#sidebar-resizer{width:4px;cursor:col-resize;background:transparent;flex-shrink:0;z-index:1000;margin-left:-2px;margin-right:-2px;user-select:none}#sidebar-resizer:hover,#sidebar-resizer.dragging{background:var(--handle-color)}body.dragging-sidebar{user-select:none;cursor:col-resize!important}#main{flex:1;display:flex;flex-direction:column;min-width:0}#map-container{flex:1;position:relative;min-height:100px}#map-container.editing-mode{border:4px solid var(--accent);box-shadow:0 0 15px var(--accent);z-index:1000}#map{width:100%;height:100%;background:var(--bg)}#map-controls{position:absolute;top:12px;left:12px;z-index:1000;display:flex;align-items:center;gap:8px}#basemap-switcher{display:flex;background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:2px;height:24px;box-sizing:border-box;box-shadow:0 4px 12px #0000004d;align-items:center;gap:0}#selected-extra-map{font-size:var(--fs-s);font-weight:700;color:var(--accent);padding:0 6px;max-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}#selected-extra-map.hidden{display:none}#btn-extra-layers{border:none!important;border-left:1px solid var(--border)!important;border-radius:0!important;margin-left:0!important;padding-left:6px!important;padding-right:0!important;width:auto!important;height:100%!important;background:transparent!important}#extra-layers-menu{position:absolute;top:40px;right:0;background:var(--surface);border:1px solid var(--border);border-radius:8px;box-shadow:0 4px 20px #00000080;max-height:300px;overflow-y:auto;width:200px;z-index:1000;padding:4px}#extra-layers-menu.hidden{display:none}.extra-layers-header{font-size:var(--fs-s);font-weight:700;color:var(--text-dim);text-transform:uppercase;padding:6px 8px;border-bottom:1px solid var(--border);margin-bottom:4px}.extra-layers-search{padding:4px 8px;border-bottom:1px solid var(--border);margin-bottom:4px}#extra-layers-search-input{width:100%;background:var(--surface2);border:1px solid var(--border);border-radius:4px;color:var(--text);font-size:var(--fs-s);padding:4px 8px;outline:none}#extra-layers-search-input:focus{border-color:var(--accent)}.extra-layers-license{font-size:var(--fs-s);color:var(--text-dim);padding:4px 8px;border-bottom:1px solid var(--border);margin-bottom:4px}.extra-layers-license a{color:var(--accent);text-decoration:none}.extra-layers-license a:hover{text-decoration:underline}.extra-layer-row{margin-bottom:2px}.extra-layer-item{display:block;width:100%;text-align:left;background:transparent;border:none;color:var(--text-muted);padding:4px 10px 2px;font-size:var(--fs-s);font-weight:600;border-radius:4px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.extra-layer-item:hover{background:var(--surface2);color:var(--text)}.extra-layer-attribution{font-size:var(--fs-s);color:var(--text-dim);padding:0 10px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#map-loader{background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:0 10px;height:24px;box-sizing:border-box;display:flex;align-items:center;gap:8px;font-size:var(--fs-s);font-weight:600;color:var(--text-muted);box-shadow:0 4px 12px #0000004d}.spinner-sm{width:12px;height:12px;border:2px solid var(--surface2);border-top-color:var(--accent);border-radius:50%}.bm-btn{background:transparent;border:none;color:var(--text-muted);padding:2px 6px;font-size:var(--fs-s);font-weight:600;border-radius:6px}.bm-btn:hover{color:var(--text)}.bm-btn.active{background:var(--surface2);color:var(--accent)}.map-cursor-dot{pointer-events:none}.dot-inner{width:12px;height:12px;background:#fff;border:2px solid #000;border-radius:50%;box-shadow:0 0 0 2px #ffffff80}#map-cursor-info{position:absolute;top:12px;right:12px;z-index:1000;background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:8px 12px;font-size:var(--fs-s);color:var(--text);box-shadow:0 4px 12px #0000004d;display:none;pointer-events:none}#resize-handle{height:6px;background:var(--bg);border-top:1px solid var(--border);border-bottom:1px solid var(--border);cursor:ns-resize;display:flex;align-items:center;justify-content:center;flex-shrink:0;z-index:100}#resize-handle:hover{background:var(--handle-color)}.handle-grip{width:32px;height:2px;background:var(--border2);border-radius:1px}#chart-panel{display:flex;flex-direction:column;background:var(--surface);overflow:hidden;flex:1;width:100%;height:100%;min-height:0}#tab-nav{display:flex;padding:0 12px;border-bottom:1px solid var(--border);gap:4px}.tab-btn{background:transparent;border:none;border-bottom:2px solid transparent;color:var(--text-dim);padding:10px 12px;font-size:var(--fs-m);font-weight:700;display:flex;align-items:center;gap:6px}.tab-btn:hover{color:var(--text-muted)}.tab-btn.active{color:var(--accent);border-bottom-color:var(--accent)}.tab-btn .material-symbols-rounded{font-size:var(--is-s)}.tab-content{display:none;flex:1;min-height:0}.tab-content.active{display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:none}.tab-content.active::-webkit-scrollbar{width:0;height:0}.tab-content.active::-webkit-scrollbar-track{background:transparent}.tab-content.active::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.tab-content.active::-webkit-scrollbar-thumb:hover{background:var(--text-dim)}#chart-toolbar{display:flex;align-items:center;padding:6px 12px;gap:12px;border-bottom:1px solid var(--border);background:var(--bg);min-height:40px;position:sticky;top:0;z-index:100}.icon-btn{background:transparent;border:1px solid transparent;color:var(--text-muted);width:24px;height:24px;border-radius:6px;display:flex;align-items:center;justify-content:center}.icon-btn.hidden{display:none}.icon-btn:hover{background:var(--surface2);color:var(--text)}.icon-btn.active{background:var(--surface2);color:var(--accent)}.icon-btn.danger:hover{background:#ef44441f;color:var(--danger)}.icon-btn .material-symbols-rounded{font-size:var(--fs-l)}#btn-metric-menu{flex:0 0 auto}#metric-pills{display:flex;gap:6px;flex:1;overflow:hidden}.metric-pill:not(.active){display:none}.metric-pill.overflow-hidden{display:none!important}#pill-overflow{color:var(--text-muted);font-weight:700;padding:0 4px;align-self:flex-end}.metric-pill{height:24px;padding:0 8px;border-radius:12px;border:1px solid var(--border);background:var(--surface2);color:var(--text-muted);font-size:var(--fs-s);font-weight:500;display:flex;align-items:center;gap:4px;white-space:nowrap}.metric-pill .material-symbols-rounded{font-size:var(--fs-m)}.metric-pill.active{background:color-mix(in srgb,var(--pill-color) 15%,var(--surface2));border-color:var(--pill-color);color:var(--pill-color)}.metric-pill.disabled{opacity:.3;filter:grayscale(1);cursor:default}#chart-options{display:flex;align-items:center;gap:0;margin-left:auto}.seg-ctrl{display:flex;background:var(--surface2);border:1px solid var(--border);border-radius:6px;padding:2px;height:24px;box-sizing:border-box}.seg-btn{background:transparent;border:none;color:var(--text-dim);padding:0 8px;font-size:var(--fs-s);font-weight:700;border-radius:4px;display:flex;align-items:center;gap:6px;height:100%}.seg-btn .material-symbols-rounded{font-size:var(--fs-m)}.seg-btn.active{background:var(--bg);color:var(--text);box-shadow:0 1px 3px #0003}#chart-stats{padding:4px 14px;border-bottom:1px solid var(--border);background:var(--surface2)}#chart-stats.hidden{display:none}#chart-stats-wrap{display:flex;flex-direction:column;gap:2px}.stats-row{display:flex;align-items:center;gap:16px}.stats-row-label{width:45px;font-size:var(--fs-s);font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:var(--text-muted);white-space:nowrap}.chart-row-stats-container{display:flex;flex:1;align-items:center;justify-content:space-between}.chart-row-right-actions{width:130px;display:none;align-items:center;justify-content:flex-end;flex-shrink:0}.with-histogram .chart-row-right-actions{display:flex}.chart-stats-total,.chart-stats-selection{display:flex;gap:10px;font-size:var(--fs-s);color:var(--text-dim);align-items:center;white-space:nowrap;font-weight:500}.chart-stats-selection{margin-left:auto;position:relative}.chart-stats-selection:after{content:"";position:absolute;bottom:-6px;left:0;right:0;height:2px;background-color:var(--sel-color);pointer-events:none}.all-chip{background:var(--surface2);color:var(--text-muted);font-weight:500;padding:2px;border-radius:4px;font-size:var(--fs-m);margin-right:4px;cursor:pointer;border:1px solid var(--border);display:flex;align-items:center;justify-content:center}.all-chip:hover{background:var(--border);color:var(--text)}.sel-tag{background:var(--surface2);color:var(--text-muted);font-weight:500;padding:2px;border-radius:4px;font-size:var(--fs-m);margin-right:4px;display:flex;align-items:center;justify-content:center;border:1px solid var(--border)}.mm-item{display:flex;align-items:center;gap:2px;white-space:nowrap}.mm-icon{font-size:var(--fs-m);color:var(--text-dim)}.uplot{color:var(--text-muted)!important}.u-title,.u-legend{display:none}.chart-row .u-select{background:color-mix(in srgb,var(--chart-color, #3b82f6) 12%,transparent)!important;border:1px solid color-mix(in srgb,var(--chart-color, #3b82f6) 35%,transparent)!important}.u-cursor-x{border-left:1px dashed rgba(255,255,255,.55)!important}.u-cursor-y{display:none!important}.sel-fill{position:absolute;top:0;background:color-mix(in srgb,var(--theme-color) 8%,transparent);border-left:1px solid color-mix(in srgb,var(--theme-color) 30%,transparent);border-right:1px solid rgba(148,163,184,.4);pointer-events:none}.sel-handle{position:absolute;top:50%;transform:translate(-50%,-50%);width:8px;height:24px;background:#ffffffd9;border:1px solid rgba(0,0,0,.3);border-radius:4px;cursor:ew-resize;pointer-events:auto;display:flex;align-items:center;justify-content:center;z-index:10}.sel-handle:after{content:"";width:2px;height:10px;border-left:1px solid rgba(0,0,0,.4);border-right:1px solid rgba(0,0,0,.4)}.sel-handle:hover{background:#fff;transform:translate(-50%,-50%) scale(1.1)}.sel-graph-marker{position:absolute;transform:translate(-50%,-50%);pointer-events:none;z-index:11;background:none!important}.sel-line{position:absolute;top:0;height:100%;width:0;border-left-width:1.5px;border-left-style:solid;pointer-events:none}.sel-line-label{position:absolute;top:4px;font-size:var(--fs-s);font-weight:700;background:#0e0e10eb;color:#fff;padding:2px 5px;border-radius:4px;pointer-events:none;white-space:nowrap;z-index:10;border:1px solid var(--border)}#charts-container{flex:1;overflow-y:auto;overflow-x:hidden;padding:6px 0 4px;scrollbar-width:none}#charts-container::-webkit-scrollbar{width:0;height:0}#charts-container::-webkit-scrollbar-thumb{background:var(--border2);border-radius:2px}.fixed-x-label{position:absolute;bottom:4px;font-size:var(--fs-s);font-family:system-ui,sans-serif;color:#555564;z-index:10;pointer-events:none}.fixed-x-max{right:0;text-align:right}.chart-row-body{display:flex;flex-direction:row;padding:0 14px;min-width:0;overflow:hidden}.chart-row-body>div:first-child{flex:1;min-width:0}.hist-col{width:130px;flex-shrink:0;border-left:1px solid var(--border);margin-left:20px;margin-right:0;display:none;align-items:center;justify-content:center;cursor:crosshair}.hist-col.visible{display:flex}.hist-canvas{display:block}#hist-line{position:fixed;height:0;border-top:1px dashed rgba(255,255,255,.25);pointer-events:none;display:none;z-index:10000}#hist-tooltip{position:fixed;background:var(--surface);border:1px solid var(--border2);border-radius:5px;padding:8px 10px;pointer-events:none;display:none;z-index:10001;box-shadow:0 4px 15px #00000080;font-size:var(--fs-s)}.hist-tt-header{font-weight:800;margin-bottom:6px;padding-left:8px;border-left:3px solid var(--accent);color:var(--text)}.hist-tt-grid{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:baseline}.hist-tt-label{font-size:var(--fs-s);color:var(--text-muted)}.hist-tt-value{font-size:var(--fs-s);color:var(--text);text-align:right;font-variant-numeric:tabular-nums}.hist-tt-pct{font-size:var(--fs-s);color:var(--text-dim);text-align:right;min-width:36px;font-variant-numeric:tabular-nums}.hist-tt-grid.sel-row{margin-top:2px;opacity:.9}.hist-tt-label.sel{color:var(--accent);font-weight:700}.chart-row{border-bottom:1px solid var(--border)}.chart-row:last-child{border-bottom:none}.chart-row-header{display:flex;align-items:center;gap:12px;padding:8px 14px 4px;min-height:28px}.progress-chart-row{display:flex;flex-direction:column}.progress-chart-row .chart-row-header{height:36px;box-sizing:border-box;padding-top:0;padding-bottom:0}.progress-chart-row .chart-row-actions{margin-left:auto}.progress-chart-row .chart-row-body{flex:1;padding:0}.chart-row-label-group{display:flex;align-items:center;gap:8px;flex-shrink:0;width:140px}.chart-row-actions{display:flex;align-items:center;gap:0}.chart-row-icon{font-size:var(--is-s);color:var(--chart-color)}.chart-row-label{font-size:var(--fs-m);font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:var(--text-muted);white-space:nowrap}.track-picker-popup{padding:8px;background:var(--surface);color:var(--text);border-radius:8px;min-width:160px}.picker-header{font-size:var(--fs-s);text-transform:uppercase;font-weight:700;color:var(--text-dim);margin-bottom:8px;padding-bottom:4px;border-bottom:1px solid var(--border)}.picker-list{display:flex;flex-direction:column;gap:2px}.picker-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:6px;cursor:pointer}.picker-item:hover{background:var(--surface2)}.picker-color{width:3px;height:14px;border-radius:1px}.picker-info{display:flex;flex-direction:column;min-width:0}.picker-name{font-size:var(--fs-s);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}.modal-backdrop{position:fixed;inset:0;background:#000000bf;backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:20000}.modal-content{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:24px;width:100%;max-width:320px;box-shadow:0 20px 40px #00000080;display:flex;flex-direction:column;gap:16px}.modal-title{font-size:var(--fs-l);font-weight:800;color:var(--text)}.modal-body{font-size:var(--fs-m);color:var(--text-muted);line-height:1.5}.modal-input-wrap{display:flex;flex-direction:column;gap:8px}.modal-input-label{font-size:var(--fs-s);font-weight:700;text-transform:uppercase;color:var(--text-dim)}.modal-input{background:var(--bg);border:1px solid var(--border2);border-radius:6px;padding:10px;color:var(--text);font-size:var(--fs-l);font-weight:800;text-align:center;letter-spacing:4px}.modal-input:focus{outline:none;border-color:var(--accent)}.modal-actions{display:flex;gap:12px;margin-top:8px}.modal-btn{flex:1;padding:10px;border-radius:6px;font-size:var(--fs-m);font-weight:700;border:1px solid transparent}.modal-btn.cancel{background:var(--surface2);color:var(--text);border-color:var(--border)}.modal-btn.cancel:hover{background:var(--border)}.modal-btn.confirm{background:var(--danger);color:#fff}.modal-btn.confirm:disabled{opacity:.3;cursor:not-allowed;filter:grayscale(1)}.modal-btn.confirm:not(:disabled):hover{filter:brightness(1.1)}.picker-meta{font-size:var(--fs-s);color:var(--text-dim);font-weight:700}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:var(--surface)!important;color:var(--text)!important;border:1px solid var(--border)!important;box-shadow:0 4px 12px #0006!important}.leaflet-popup-content{margin:0!important}.leaflet-popup-tip{border:none!important}.map-color-btn{margin-left:4px}.map-color-btn .material-symbols-rounded{font-size:var(--is-s)}.map-color-btn.active{color:var(--chart-color, var(--accent))}.smooth-btn.active{color:var(--accent)}.cur-y-val{position:absolute;left:0;top:0;pointer-events:none;font-size:var(--fs-s);font-weight:700;background:#0e0e10eb;padding:2px 6px;border-radius:4px;border:1px solid rgba(255,255,255,.1);z-index:2000;white-space:nowrap}.cur-y-val.pin{z-index:1000;opacity:.7}#details-view{width:100%;padding:24px;max-width:900px;margin:0 auto}#details-header{margin-bottom:32px}.details-title{font-size:var(--fs-l);font-weight:800;margin-bottom:4px}.details-subtitle{font-size:var(--fs-m);color:var(--text-muted)}.details-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px}.details-card{background:var(--surface2);border:1px solid var(--border);padding:16px;border-radius:12px;display:flex;flex-direction:column;gap:4px}.details-card .material-symbols-rounded{color:var(--accent);margin-bottom:4px;font-size:var(--is-m)}.details-card-label{font-size:var(--fs-s);font-weight:500;text-transform:uppercase;color:var(--text-dim);letter-spacing:.5px}.details-card-value{font-size:var(--fs-l);font-weight:500}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--text-dim);gap:12px;padding:40px 20px}.empty-icon{font-size:var(--fs-l);opacity:.2}.empty-text{font-size:var(--fs-m);font-weight:500}#chart-empty{height:100%}#details-empty{margin-top:40px}#toast-container{position:fixed;bottom:20px;left:50%;transform:translate(-50%);display:flex;flex-direction:column;gap:8px;z-index:9999}.toast{background:var(--surface2);color:var(--text);padding:10px 20px;border-radius:8px;font-size:var(--fs-m);font-weight:600;box-shadow:0 8px 24px #0006;border:1px solid var(--border2)}.toast.error{border-color:var(--danger)}.sort-menu-popup,.metric-menu-popup{position:fixed;z-index:10000;background:var(--surface2);border:1px solid var(--border);border-radius:8px;padding:6px;min-width:180px;box-shadow:0 8px 24px #00000080}.menu-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:6px;cursor:pointer;color:var(--text-muted)}.menu-item:hover{background:var(--surface);color:var(--text)}.menu-item.active{color:var(--text);font-weight:600}.menu-item .material-symbols-rounded{font-size:var(--is-s)}.menu-item .item-label{flex:1;font-size:var(--fs-m)}.menu-item .arrow,.menu-item .check{font-size:var(--is-s);color:var(--text-dim)}#insights-view{width:100%;padding:24px;max-width:1000px;margin:0 auto}.insights-grid{column-count:2;column-gap:24px}@media (max-width: 900px){.insights-grid{column-count:1}}.insight-card{display:inline-flex;width:100%;break-inside:avoid;margin-bottom:24px;background:var(--surface2);border:1px solid var(--border);padding:20px;border-radius:12px;flex-direction:column;gap:16px}.insight-title{font-size:var(--fs-m);font-weight:700;text-transform:uppercase;letter-spacing:.8px;display:flex;align-items:center;gap:8px;color:var(--text-muted)}.insight-title .material-symbols-rounded{font-size:var(--is-s)}.insight-chart-container{width:100%;height:250px}.power-curve-table{width:100%;border-collapse:collapse;font-size:var(--fs-m);margin-top:0}.power-curve-table th{text-align:left;color:var(--text-dim);padding:4px 8px;font-weight:600;border-bottom:1px solid var(--border)}.power-curve-table td{padding:6px 8px;border-bottom:1px solid var(--border)}.power-curve-table tr:last-child td{border-bottom:none}.progress-details summary{cursor:pointer;font-size:var(--fs-m);color:var(--text-dim);display:flex;align-items:center;gap:4px;list-style:none}.progress-details summary::-webkit-details-marker{display:none}.progress-details[open] summary .expand-icon{transform:rotate(90deg)}.progress-details summary .material-symbols-rounded{font-size:var(--fs-l)}.power-curve-val{font-weight:700;color:var(--text);text-align:right}.evolution-select-btn{background:none;border:none;cursor:pointer;color:var(--chart-color);padding:0;font-size:var(--fs-l);vertical-align:middle;margin-left:4px}.hr-settings-popup{display:flex;flex-direction:column}.hr-input-row{display:flex;justify-content:space-between;align-items:center;font-size:var(--fs-m);color:var(--text-muted);font-weight:600}.hr-zone-input{background:var(--surface);border:1px solid var(--border);border-radius:4px;color:var(--text);width:60px;padding:4px 8px;font-size:var(--fs-m);text-align:right;outline:none}.hr-zone-input:focus{border-color:var(--accent)}.save-btn{background:var(--accent);color:#fff;border:none;border-radius:6px;padding:8px;font-size:12px;font-weight:700;cursor:pointer}.save-btn:hover{background:var(--accent-hover)}.menu-item.active .arrow,.menu-item.active .check{color:var(--accent)}.evolution-toolbar{display:flex;align-items:center;justify-content:space-between;padding:6px 12px;border-bottom:1px solid var(--border);background:var(--bg);min-height:40px}.evolution-toolbar-left,.evolution-toolbar-right{display:flex;align-items:center;gap:12px}.evolution-toolbar .metric-pills{display:flex;gap:6px}.evolution-toolbar .metric-pill{cursor:pointer}.evolution-container{display:flex;flex-direction:column;gap:0px;padding:6px 0 4px}.evolution-card-group{display:flex;flex-direction:column;gap:10px;width:100%}.evolution-legend{display:flex;gap:16px;font-size:12px;color:var(--text-dim);margin-top:0;margin-bottom:0;justify-content:center}.evolution-legend-item{display:flex;align-items:center;gap:6px}.evolution-legend-line{width:16px;height:0;display:inline-block}.evolution-legend-line.solid{border-top:2px solid var(--chart-color)}.evolution-legend-line.dashed{border-top:2px dashed #888888}.evolution-tooltip-title{font-weight:700;margin-bottom:4px}.evolution-tooltip-row{display:flex;justify-content:space-between;gap:15px}.evolution-tooltip-label{color:#8a8a93}.evolution-tooltip-value{font-weight:700}.evolution-empty-text{color:var(--text-dim);font-size:12px;text-align:center;margin-top:20px}.evolution-chart-container{height:250px;flex:1}.distance-progress-card .card-content,.elevation-progress-card .card-content{display:flex;gap:20px}.chart-scroll-container{flex:1;overflow-x:auto;position:relative;background:var(--bg-dim);border-radius:8px;padding:10px;scrollbar-width:none}.chart-scroll-container::-webkit-scrollbar{width:0;height:0;display:none}.accumulated-table-container{width:250px;background:var(--bg-dim);border-radius:8px;padding:15px}.accumulated-table{width:100%;border-collapse:collapse;font-size:var(--fs-m)}.accumulated-table th,.accumulated-table td{padding:4px 8px;text-align:left;border-bottom:1px solid var(--border-color)}.accumulated-table th{color:var(--text-dim);font-weight:500;text-transform:uppercase;font-size:var(--fs-m);letter-spacing:.5px}.accumulated-table td:last-child{text-align:right;font-weight:500;font-family:monospace}.accumulated-table tr:last-child td{border-bottom:none}.chart-scroll-container::-webkit-scrollbar{height:4px}.chart-scroll-container::-webkit-scrollbar-thumb{background:var(--border2);border-radius:2px}.u-title,.u-legend{font-size:var(--fs-m)!important}.courses-container{padding:16px;display:flex;flex-direction:column;gap:16px}.courses-list{display:flex;flex-direction:column;gap:8px}.course-item{background:var(--surface2);border:1px solid var(--border);border-radius:8px;display:flex;flex-direction:column;cursor:pointer;overflow:hidden}.course-item:hover{background:var(--surface3);border-color:var(--border-high)}.course-item-header{padding:6px 12px;display:flex;align-items:center;gap:12px;width:100%}.course-name{font-weight:600;flex:1}.course-meta{color:var(--text-muted);font-size:var(--fs-s)}.course-actions{display:flex;gap:4px}.course-actions .icon-btn{opacity:.5}.course-item:hover .course-actions .icon-btn{opacity:1}.expand-icon{color:var(--text-muted)}.course-tracks{padding:8px 12px;border-top:1px solid var(--border);background:var(--surface1)}.course-tracks-title{font-size:var(--fs-xs);font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px}.course-tracks-table{width:100%;border-collapse:collapse;font-size:var(--fs-s);color:var(--text)}.course-tracks-table th,.course-tracks-table td{padding:6px 8px;text-align:right;border-bottom:1px solid var(--border-low)}.course-tracks-table th:first-child,.course-tracks-table td:first-child,.course-tracks-table th:nth-child(2),.course-tracks-table td:nth-child(2){text-align:left}.course-tracks-table td:not(:first-child){white-space:nowrap}.course-tracks-table th{font-weight:600;color:var(--text-muted);font-size:var(--fs-xs);text-transform:uppercase;letter-spacing:.5px;white-space:nowrap}.course-tracks-table tr:last-child td{border-bottom:none}.course-tracks-table th:first-child,.course-tracks-table td:first-child{width:100%}.course-track-row:hover{background:var(--surface2)}.course-track-row.selected{background:color-mix(in srgb,var(--theme-color) 8%,transparent)}.track-name-cell.clickable{color:var(--accent);cursor:pointer;font-weight:500}.track-name-cell.clickable:hover{text-decoration:underline}.metric-icon{font-size:16px;vertical-align:middle;margin-right:4px}.metric-icon.duration{color:var(--text-muted)}.metric-icon.speed{color:#4caf50}.metric-icon.power{color:#ff9800}.metric-icon.hr{color:#f44336}.course-point-marker{display:flex;align-items:center;justify-content:center} +/*# sourceMappingURL=styles.css.map */ diff --git a/suites-experimental/tools-gps-tracks-angular/dist/styles.css.map b/suites-experimental/tools-gps-tracks-angular/dist/styles.css.map new file mode 100644 index 000000000..c6e4bf37b --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/styles.css.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/css/uPlot.min.css", "../src/css/styles.css"], + "sourcesContent": [".uplot, .uplot *, .uplot *::before, .uplot *::after {box-sizing: border-box;}.uplot {font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";line-height: 1.5;width: min-content;}.u-title {text-align: center;font-size: 18px;font-weight: bold;}.u-wrap {position: relative;user-select: none;}.u-over, .u-under {position: absolute;}.u-under {overflow: hidden;}.uplot canvas {display: block;position: relative;width: 100%;height: 100%;}.u-axis {position: absolute;}.u-legend {font-size: 14px;margin: auto;text-align: center;}.u-inline {display: block;}.u-inline * {display: inline-block;}.u-inline tr {margin-right: 16px;}.u-legend th {font-weight: 600;}.u-legend th > * {vertical-align: middle;display: inline-block;}.u-legend .u-marker {width: 1em;height: 1em;margin-right: 4px;background-clip: padding-box !important;}.u-inline.u-live th::after {content: \":\";vertical-align: middle;}.u-inline:not(.u-live) .u-value {display: none;}.u-series > * {padding: 4px;}.u-series th {cursor: pointer;}.u-legend .u-off > * {opacity: 0.3;}.u-select {background: rgba(0,0,0,0.07);position: absolute;pointer-events: none;}.u-cursor-x, .u-cursor-y {position: absolute;left: 0;top: 0;pointer-events: none;will-change: transform;}.u-hz .u-cursor-x, .u-vt .u-cursor-y {height: 100%;border-right: 1px dashed #607D8B;}.u-hz .u-cursor-y, .u-vt .u-cursor-x {width: 100%;border-bottom: 1px dashed #607D8B;}.u-cursor-pt {position: absolute;top: 0;left: 0;border-radius: 50%;border: 0 solid;pointer-events: none;will-change: transform;/*this has to be !important since we set inline \"background\" shorthand */background-clip: padding-box !important;}.u-axis.u-off, .u-select.u-off, .u-cursor-x.u-off, .u-cursor-y.u-off, .u-cursor-pt.u-off {display: none;}", "/*\n * Copyright (c) 2026, Camillo Bruni.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n@import './uPlot.min.css';\n\n/* \u2500\u2500\u2500 Variables \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n@font-face {\n font-family: 'Material Symbols Rounded';\n font-style: normal;\n font-weight: 100 700;\n src: url('../../material_symbols_rounded.woff2') format('woff2');\n}\n\n:root {\n --bg: #0e0e10;\n --surface: #18181b;\n --surface2: #222226;\n --border: #2e2e34;\n --border2: #3a3a42;\n --text: #e8e8ec;\n --text-muted: #888896;\n --text-dim: #555564;\n --theme-color: #3b82f6;\n --accent: var(--theme-color);\n --accent-hover: color-mix(in srgb, var(--theme-color) 80%, white);\n --danger: #ef4444;\n --sidebar-w: 230px;\n\n /* Font Sizes */\n --fs-s: 10px;\n --fs-m: 12px;\n --fs-l: 14px; /* For titles only */\n\n /* Icon Sizes */\n --is-s: 16px;\n --is-m: 20px;\n\n --handle-color: #3b82f6;\n}\n\n/* Font Size Classes */\n.font-s {\n font-size: 10px;\n}\n.font-m {\n font-size: 12px;\n}\n.font-l {\n font-size: 14px;\n}\n\n* {\n box-sizing: border-box;\n}\n\nbody,\nhtml {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n background: var(--bg);\n color: var(--text);\n font-family:\n system-ui,\n -apple-system,\n sans-serif;\n font-size: var(--fs-m);\n}\n\nbody {\n opacity: 1;\n}\n\nbody.loading-fonts {\n opacity: 0;\n}\n\nbutton {\n font-family: inherit;\n cursor: pointer;\n font-size: var(--fs-m);\n}\n\n/* Material symbols config */\n.material-symbols-rounded {\n font-family: 'Material Symbols Rounded';\n font-weight: normal;\n font-style: normal;\n font-size: var(--is-m);\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-smoothing: antialiased;\n font-variation-settings:\n 'FILL' 0,\n 'wght' 400,\n 'GRAD' 0,\n 'opsz' 24;\n}\n\n/* \u2500\u2500\u2500 Layout \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n#app {\n display: flex;\n width: 100vw;\n height: 100vh;\n overflow: hidden;\n}\n\napp-graphs-tab,\napp-insights-tab,\napp-details-tab,\napp-combined-tab,\napp-evolution-tab,\napp-courses-tab {\n display: contents;\n}\n\n.hidden {\n display: none !important;\n}\n\n#global-loader {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.7);\n z-index: 10000;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n#import-warning {\n}\n\n.loader-box {\n background: var(--surface);\n border: 1px solid var(--border);\n border-radius: 12px;\n padding: 0;\n display: flex;\n flex-direction: row;\n align-items: stretch;\n color: var(--text);\n font-weight: 700;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);\n max-width: 450px;\n width: 90%;\n overflow: hidden;\n position: relative;\n}\n\n#loader-close {\n position: absolute;\n top: 12px;\n right: 12px;\n background: none;\n border: none;\n color: var(--text-muted);\n cursor: pointer;\n padding: 4px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n#loader-close:hover {\n background: var(--surface2);\n color: var(--text);\n}\n\n.loader-icon-wrap {\n background: color-mix(in srgb, var(--accent) 10%, transparent);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 24px;\n border-right: 1px solid var(--border);\n gap: 8px;\n}\n\n.loader-icon-wrap > span {\n font-size: var(--fs-l);\n color: var(--accent);\n}\n\n#loader-warning-count {\n font-size: var(--fs-m);\n color: #f59e0b;\n font-weight: 700;\n display: none;\n align-items: center;\n gap: 4px;\n}\n\n.loader-content {\n padding: 24px;\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 12px;\n justify-content: center;\n}\n\n#loader-text {\n font-size: var(--fs-l);\n font-weight: 700;\n color: var(--text);\n}\n\n#loader-filename {\n font-size: var(--fs-m);\n color: var(--text-muted);\n font-weight: 400;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 300px;\n}\n\n#loader-progress-wrap {\n width: 300px;\n height: 4px;\n background: var(--surface2);\n border-radius: 2px;\n margin-top: 4px;\n overflow: hidden;\n}\n\n#loader-subtext {\n font-size: var(--fs-m);\n color: var(--text-muted);\n font-weight: 400;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 300px;\n margin-top: 0;\n}\n\n.progress-index {\n text-align: left;\n}\n\n.progress-total {\n text-align: right;\n}\n\n#loader-progress-bar {\n width: 0%;\n height: 100%;\n background: var(--accent);\n}\n\n/* \u2500\u2500\u2500 Sidebar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n#sidebar {\n width: var(--sidebar-w);\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n background: var(--surface);\n border-right: 1px solid var(--border);\n z-index: 10;\n}\n\n#sidebar-header {\n padding: 16px 12px;\n border-bottom: 1px solid var(--border);\n}\n\n.logo {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n.logo-icon {\n color: var(--accent);\n font-size: var(--fs-l);\n}\n.logo-title {\n font-weight: 800;\n font-size: var(--fs-l);\n letter-spacing: -0.5px;\n}\n.logo-sub {\n font-size: var(--fs-s);\n text-transform: uppercase;\n color: var(--text-dim);\n font-weight: 700;\n letter-spacing: 1px;\n margin-top: -2px;\n}\n\n/* Drop zone */\n#drop-zone {\n margin: 12px;\n padding: 20px 12px;\n border: 2px dashed var(--border2);\n border-radius: 12px;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n position: relative;\n}\n#drop-zone.drop-active {\n border-color: var(--accent);\n background: color-mix(in srgb, var(--theme-color) 5%, transparent);\n}\n.drop-icon {\n font-size: var(--is-m);\n color: var(--text-muted);\n margin-bottom: 4px;\n}\n.drop-primary {\n font-size: var(--fs-m);\n font-weight: 600;\n color: var(--text);\n}\n.drop-formats {\n display: flex;\n justify-content: center;\n gap: 6px;\n margin-top: 8px;\n}\n.drop-formats .badge {\n background: var(--surface2);\n color: var(--text-dim);\n font-size: var(--fs-s);\n padding: 2px 6px;\n}\n\n.drop-browse-container {\n margin-top: 12px;\n font-size: var(--fs-s);\n color: var(--text-muted);\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 2px;\n}\n.drop-browse {\n color: var(--accent);\n font-weight: 600;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n.drop-browse .material-symbols-rounded {\n font-size: var(--fs-l);\n}\n.drop-browse:hover {\n color: var(--accent-hover);\n}\n.drop-separator {\n margin: 0 6px;\n color: var(--border2);\n vertical-align: middle;\n}\n\n/* Track list header */\n#track-list-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 12px 8px;\n}\n.section-label {\n font-size: var(--fs-s);\n font-weight: 700;\n text-transform: uppercase;\n color: var(--text-dim);\n letter-spacing: 0.5px;\n}\n\n.header-actions {\n display: flex;\n gap: 0;\n}\n\n#track-controls,\n#sort-controls {\n padding: 8px 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n border-bottom: 1px solid var(--border);\n}\n\n.search-bar {\n display: flex;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n padding: 2px 4px;\n align-items: center;\n}\n.search-icon {\n font-size: var(--is-s);\n color: var(--text-dim);\n margin-left: 4px;\n}\n.search-bar input {\n flex: 1;\n background: transparent;\n border: none;\n padding: 4px 6px;\n color: var(--text);\n font-size: var(--fs-m);\n}\n.search-bar input:focus {\n outline: none;\n}\n\n.icon-btn.mini {\n width: 20px;\n height: 20px;\n color: var(--text-dim);\n}\n.icon-btn.mini .material-symbols-rounded {\n font-size: var(--is-s);\n}\n.icon-btn.mini.active {\n color: var(--accent);\n}\n\n.sort-ctrl {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.sort-ctrl label {\n font-size: var(--fs-s);\n color: var(--text-dim);\n text-transform: uppercase;\n font-weight: 600;\n}\n\n.sort-select-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n background: var(--surface2);\n border: 1px solid var(--border);\n padding: 4px 8px;\n border-radius: 6px;\n flex: 1;\n height: 24px;\n box-sizing: border-box;\n font-size: var(--fs-s);\n color: var(--text-muted);\n}\n.sort-select-btn:hover {\n border-color: var(--accent);\n color: var(--text);\n}\n.sort-select-btn .material-symbols-rounded {\n font-size: var(--is-s);\n}\n.sort-select-btn .arrow {\n font-size: var(--fs-l);\n margin-left: auto;\n opacity: 0.5;\n}\n\n/* Filter panel */\n#filter-panel {\n padding: 12px;\n background: var(--surface2);\n border-bottom: 1px solid var(--border);\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n#filter-panel.hidden {\n display: none;\n}\n\n.filter-group {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.filter-group label {\n font-size: var(--fs-s);\n font-weight: 600;\n text-transform: uppercase;\n color: var(--text-dim);\n display: flex;\n align-items: center;\n gap: 6px;\n}\n.filter-group label .material-symbols-rounded {\n font-size: var(--is-s);\n opacity: 0.7;\n}\n\n.filter-metrics-grid {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n margin-top: 4px;\n}\n\n.mini-pill {\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--surface);\n border: 1px solid var(--border);\n border-radius: 6px;\n color: var(--text-dim);\n cursor: pointer;\n}\n.mini-pill:hover {\n border-color: var(--text-muted);\n color: var(--text-muted);\n}\n.mini-pill.active {\n background: var(--accent);\n border-color: var(--accent);\n color: white;\n}\n.mini-pill .material-symbols-rounded {\n font-size: var(--is-s);\n}\n\n.filter-row {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n.filter-row input {\n flex: 1;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 4px;\n padding: 4px 6px;\n color: var(--text);\n font-size: var(--fs-s);\n}\n.filter-row span {\n font-size: var(--fs-s);\n color: var(--text-dim);\n}\n#filter-panel input:focus {\n border-color: var(--accent);\n outline: none;\n}\n\n.filter-footer {\n display: flex;\n justify-content: flex-end;\n margin-top: 4px;\n}\n\n/* Track list */\n#track-list {\n flex: 1;\n overflow-y: auto;\n padding: 4px 0;\n scrollbar-width: none;\n}\n#track-list::-webkit-scrollbar {\n width: 0;\n height: 0;\n display: none;\n}\n#track-list::-webkit-scrollbar-thumb {\n background: var(--border2);\n border-radius: 2px;\n}\n\n#track-list-empty {\n padding: 40px 20px;\n text-align: center;\n color: var(--text-dim);\n font-size: var(--fs-m);\n}\n\n.track-item {\n display: flex;\n align-items: center;\n padding: 6px 8px;\n gap: 0;\n cursor: pointer;\n border-left: 3px solid transparent;\n}\n.track-item:hover {\n background: rgba(255, 255, 255, 0.03);\n}\n.track-item.selected {\n background: color-mix(in srgb, var(--theme-color) 8%, transparent);\n border-left-color: var(--accent);\n}\n\n.track-color {\n width: 3px;\n border-radius: 1px;\n flex-shrink: 0;\n margin-right: 8px;\n align-self: stretch;\n}\n.track-info {\n flex: 1;\n min-width: 0;\n margin-right: 2px;\n}\n.track-name {\n font-size: var(--fs-m);\n font-weight: 600;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 1px;\n}\n.track-meta {\n font-size: var(--fs-s);\n color: var(--text-dim);\n display: flex;\n gap: 6px;\n align-items: center;\n}\n\n.track-item .icon-btn.mini {\n width: 22px;\n height: 22px;\n padding: 0;\n margin: 0;\n}\n\n.badge {\n font-size: var(--fs-s);\n background: var(--surface2);\n padding: 1px 4px;\n border-radius: 3px;\n font-weight: 700;\n color: var(--text-muted);\n}\n\n.track-tags {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n margin-top: 6px;\n overflow: hidden;\n max-height: 32px;\n}\n\n.track-tag {\n font-size: var(--fs-s);\n font-weight: 700;\n color: var(--text-dim);\n background: rgba(255, 255, 255, 0.03);\n border: 1px solid var(--border);\n padding: 1px 5px;\n border-radius: 3px;\n white-space: nowrap;\n}\n\n.track-item.selected .track-tag {\n border-color: rgba(255, 255, 255, 0.1);\n color: var(--text-muted);\n}\n\n#sidebar-resizer {\n width: 4px;\n cursor: col-resize;\n background: transparent;\n flex-shrink: 0;\n z-index: 1000;\n margin-left: -2px;\n margin-right: -2px;\n user-select: none;\n}\n#sidebar-resizer:hover,\n#sidebar-resizer.dragging {\n background: var(--handle-color);\n}\n\nbody.dragging-sidebar {\n user-select: none;\n cursor: col-resize !important;\n}\n\n/* \u2500\u2500\u2500 Main \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n#main {\n flex: 1;\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n/* Map */\n#map-container {\n flex: 1;\n position: relative;\n min-height: 100px;\n}\n#map-container.editing-mode {\n border: 4px solid var(--accent);\n box-shadow: 0 0 15px var(--accent);\n z-index: 1000; /* Ensure glow is visible */\n}\n#map {\n width: 100%;\n height: 100%;\n background: var(--bg);\n}\n\n#map-controls {\n position: absolute;\n top: 12px;\n left: 12px;\n z-index: 1000;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n#basemap-switcher {\n display: flex;\n background: var(--surface);\n border: 1px solid var(--border);\n border-radius: 8px;\n padding: 2px;\n height: 24px;\n box-sizing: border-box;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n align-items: center;\n gap: 0;\n}\n\n#selected-extra-map {\n font-size: var(--fs-s);\n font-weight: 700;\n color: var(--accent);\n padding: 0 6px;\n max-width: 120px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n#selected-extra-map.hidden {\n display: none;\n}\n\n#btn-extra-layers {\n border: none !important;\n border-left: 1px solid var(--border) !important;\n border-radius: 0 !important;\n margin-left: 0 !important;\n padding-left: 6px !important;\n padding-right: 0 !important;\n width: auto !important;\n height: 100% !important;\n background: transparent !important;\n}\n\n#extra-layers-menu {\n position: absolute;\n top: 40px;\n right: 0;\n background: var(--surface);\n border: 1px solid var(--border);\n border-radius: 8px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);\n max-height: 300px;\n overflow-y: auto;\n width: 200px;\n z-index: 1000;\n padding: 4px;\n}\n#extra-layers-menu.hidden {\n display: none;\n}\n.extra-layers-header {\n font-size: var(--fs-s);\n font-weight: 700;\n color: var(--text-dim);\n text-transform: uppercase;\n padding: 6px 8px;\n border-bottom: 1px solid var(--border);\n margin-bottom: 4px;\n}\n.extra-layers-search {\n padding: 4px 8px;\n border-bottom: 1px solid var(--border);\n margin-bottom: 4px;\n}\n#extra-layers-search-input {\n width: 100%;\n background: var(--surface2);\n border: 1px solid var(--border);\n border-radius: 4px;\n color: var(--text);\n font-size: var(--fs-s);\n padding: 4px 8px;\n outline: none;\n}\n#extra-layers-search-input:focus {\n border-color: var(--accent);\n}\n.extra-layers-license {\n font-size: var(--fs-s);\n color: var(--text-dim);\n padding: 4px 8px;\n border-bottom: 1px solid var(--border);\n margin-bottom: 4px;\n}\n.extra-layers-license a {\n color: var(--accent);\n text-decoration: none;\n}\n.extra-layers-license a:hover {\n text-decoration: underline;\n}\n.extra-layer-row {\n margin-bottom: 2px;\n}\n.extra-layer-item {\n display: block;\n width: 100%;\n text-align: left;\n background: transparent;\n border: none;\n color: var(--text-muted);\n padding: 4px 10px 2px 10px;\n font-size: var(--fs-s);\n font-weight: 600;\n border-radius: 4px;\n cursor: pointer;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.extra-layer-item:hover {\n background: var(--surface2);\n color: var(--text);\n}\n.extra-layer-attribution {\n font-size: var(--fs-s);\n color: var(--text-dim);\n padding: 0 10px 4px 10px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n#map-loader {\n background: var(--surface);\n border: 1px solid var(--border);\n border-radius: 8px;\n padding: 0 10px;\n height: 24px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: var(--fs-s);\n font-weight: 600;\n color: var(--text-muted);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n}\n.spinner-sm {\n width: 12px;\n height: 12px;\n border: 2px solid var(--surface2);\n border-top-color: var(--accent);\n border-radius: 50%;\n}\n.bm-btn {\n background: transparent;\n border: none;\n color: var(--text-muted);\n padding: 2px 6px;\n font-size: var(--fs-s);\n font-weight: 600;\n border-radius: 6px;\n}\n.bm-btn:hover {\n color: var(--text);\n}\n.bm-btn.active {\n background: var(--surface2);\n color: var(--accent);\n}\n\n/* Map Cursor Dot */\n.map-cursor-dot {\n pointer-events: none;\n}\n.dot-inner {\n width: 12px;\n height: 12px;\n background: #fff;\n border: 2px solid #000;\n border-radius: 50%;\n box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);\n}\n\n/* Map cursor info popup */\n#map-cursor-info {\n position: absolute;\n top: 12px;\n right: 12px;\n z-index: 1000;\n background: var(--surface);\n border: 1px solid var(--border);\n border-radius: 8px;\n padding: 8px 12px;\n font-size: var(--fs-s);\n color: var(--text);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n display: none;\n pointer-events: none;\n}\n\n/* Resize handle */\n#resize-handle {\n height: 6px;\n background: var(--bg);\n border-top: 1px solid var(--border);\n border-bottom: 1px solid var(--border);\n cursor: ns-resize;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n z-index: 100;\n}\n#resize-handle:hover {\n background: var(--handle-color);\n}\n.handle-grip {\n width: 32px;\n height: 2px;\n background: var(--border2);\n border-radius: 1px;\n}\n\n/* \u2500\u2500\u2500 Chart Panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n#chart-panel {\n display: flex;\n flex-direction: column;\n background: var(--surface);\n overflow: hidden;\n flex: 1;\n width: 100%;\n height: 100%;\n min-height: 0;\n}\n\n#tab-nav {\n display: flex;\n padding: 0 12px;\n border-bottom: 1px solid var(--border);\n gap: 4px;\n}\n\n.tab-btn {\n background: transparent;\n border: none;\n border-bottom: 2px solid transparent;\n color: var(--text-dim);\n padding: 10px 12px;\n font-size: var(--fs-m);\n font-weight: 700;\n display: flex;\n align-items: center;\n gap: 6px;\n}\n.tab-btn:hover {\n color: var(--text-muted);\n}\n.tab-btn.active {\n color: var(--accent);\n border-bottom-color: var(--accent);\n}\n.tab-btn .material-symbols-rounded {\n font-size: var(--is-s);\n}\n\n.tab-content {\n display: none;\n flex: 1;\n min-height: 0;\n}\n.tab-content.active {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n scrollbar-width: none;\n}\n\n/* Custom scrollbar for active tab content */\n.tab-content.active::-webkit-scrollbar {\n width: 0;\n height: 0;\n}\n.tab-content.active::-webkit-scrollbar-track {\n background: transparent;\n}\n.tab-content.active::-webkit-scrollbar-thumb {\n background: var(--border);\n border-radius: 3px;\n}\n.tab-content.active::-webkit-scrollbar-thumb:hover {\n background: var(--text-dim);\n}\n\n#chart-toolbar {\n display: flex;\n align-items: center;\n padding: 6px 12px;\n gap: 12px;\n border-bottom: 1px solid var(--border);\n background: var(--bg);\n min-height: 40px;\n position: sticky;\n top: 0;\n z-index: 100;\n}\n\n.icon-btn {\n background: transparent;\n border: 1px solid transparent;\n color: var(--text-muted);\n width: 24px;\n height: 24px;\n border-radius: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.icon-btn.hidden {\n display: none;\n}\n.icon-btn:hover {\n background: var(--surface2);\n color: var(--text);\n}\n.icon-btn.active {\n background: var(--surface2);\n color: var(--accent);\n}\n.icon-btn.danger:hover {\n background: rgba(239, 68, 68, 0.12);\n color: var(--danger);\n}\n.icon-btn .material-symbols-rounded {\n font-size: var(--fs-l);\n}\n\n#btn-metric-menu {\n flex: 0 0 auto;\n}\n\n#metric-pills {\n display: flex;\n gap: 6px;\n flex: 1;\n overflow: hidden;\n}\n.metric-pill:not(.active) {\n display: none;\n}\n.metric-pill.overflow-hidden {\n display: none !important;\n}\n#pill-overflow {\n color: var(--text-muted);\n font-weight: bold;\n padding: 0 4px;\n align-self: flex-end;\n}\n.metric-pill {\n height: 24px;\n padding: 0 8px;\n border-radius: 12px;\n border: 1px solid var(--border);\n background: var(--surface2);\n color: var(--text-muted);\n font-size: var(--fs-s);\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 4px;\n white-space: nowrap;\n}\n.metric-pill .material-symbols-rounded {\n font-size: var(--fs-m);\n}\n.metric-pill.active {\n background: color-mix(in srgb, var(--pill-color) 15%, var(--surface2));\n border-color: var(--pill-color);\n color: var(--pill-color);\n}\n.metric-pill.disabled {\n opacity: 0.3;\n filter: grayscale(1);\n cursor: default;\n}\n\n#chart-options {\n display: flex;\n align-items: center;\n gap: 0;\n margin-left: auto;\n}\n\n.seg-ctrl {\n display: flex;\n background: var(--surface2);\n border: 1px solid var(--border);\n border-radius: 6px;\n padding: 2px;\n height: 24px;\n box-sizing: border-box;\n}\n.seg-btn {\n background: transparent;\n border: none;\n color: var(--text-dim);\n padding: 0 8px;\n font-size: var(--fs-s);\n font-weight: 700;\n border-radius: 4px;\n display: flex;\n align-items: center;\n gap: 6px;\n height: 100%;\n}\n.seg-btn .material-symbols-rounded {\n font-size: var(--fs-m);\n}\n.seg-btn.active {\n background: var(--bg);\n color: var(--text);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);\n}\n\n/* Stats Summary bar */\n#chart-stats {\n padding: 4px 14px;\n border-bottom: 1px solid var(--border);\n background: var(--surface2);\n}\n#chart-stats.hidden {\n display: none;\n}\n#chart-stats-wrap {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.stats-row {\n display: flex;\n align-items: center;\n gap: 16px;\n}\n.stats-row-label {\n width: 45px;\n font-size: var(--fs-s);\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.8px;\n color: var(--text-muted);\n white-space: nowrap;\n}\n\n.chart-row-stats-container {\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n}\n\n.chart-row-right-actions {\n width: 130px; /* HIST_W */\n display: none;\n align-items: center;\n justify-content: flex-end;\n flex-shrink: 0;\n}\n.with-histogram .chart-row-right-actions {\n display: flex;\n}\n.chart-stats-total,\n.chart-stats-selection {\n display: flex;\n gap: 10px;\n font-size: var(--fs-s);\n color: var(--text-dim);\n align-items: center;\n white-space: nowrap;\n font-weight: 500;\n}\n.chart-stats-selection {\n margin-left: auto;\n position: relative;\n}\n.chart-stats-selection::after {\n content: '';\n position: absolute;\n bottom: -6px;\n left: 0;\n right: 0;\n height: 2px;\n background-color: var(--sel-color);\n pointer-events: none;\n}\n.all-chip {\n background: var(--surface2);\n color: var(--text-muted);\n font-weight: 500;\n padding: 2px;\n border-radius: 4px;\n font-size: var(--fs-m);\n margin-right: 4px;\n cursor: pointer;\n border: 1px solid var(--border);\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.all-chip:hover {\n background: var(--border);\n color: var(--text);\n}\n.sel-tag {\n background: var(--surface2);\n color: var(--text-muted);\n font-weight: 500;\n padding: 2px;\n border-radius: 4px;\n font-size: var(--fs-m);\n margin-right: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--border);\n}\n\n.mm-item {\n display: flex;\n align-items: center;\n gap: 2px;\n white-space: nowrap;\n}\n.mm-icon {\n font-size: var(--fs-m);\n color: var(--text-dim);\n}\n\n/* \u2500\u2500 uPlot overrides \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.uplot {\n color: var(--text-muted) !important;\n}\n.u-title {\n display: none;\n}\n.u-legend {\n display: none;\n}\n\n/* Selection drag background \u2014 colour matches the chart's metric */\n.chart-row .u-select {\n background: color-mix(in srgb, var(--chart-color, #3b82f6) 12%, transparent) !important;\n border: 1px solid color-mix(in srgb, var(--chart-color, #3b82f6) 35%, transparent) !important;\n}\n\n/* Make the cursor crosshair dashed */\n.u-cursor-x {\n border-left: 1px dashed rgba(255, 255, 255, 0.55) !important;\n}\n.u-cursor-y {\n display: none !important;\n}\n\n/* \u2500\u2500 Selection fill \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.sel-fill {\n position: absolute;\n top: 0;\n background: color-mix(in srgb, var(--theme-color) 8%, transparent);\n border-left: 1px solid color-mix(in srgb, var(--theme-color) 30%, transparent);\n border-right: 1px solid rgba(148, 163, 184, 0.4);\n pointer-events: none;\n}\n\n/* \u2500\u2500 Selection handles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.sel-handle {\n position: absolute;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 8px;\n height: 24px;\n background: rgba(255, 255, 255, 0.85);\n border: 1px solid rgba(0, 0, 0, 0.3);\n border-radius: 4px;\n cursor: ew-resize;\n pointer-events: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10;\n}\n.sel-handle::after {\n content: '';\n width: 2px;\n height: 10px;\n border-left: 1px solid rgba(0, 0, 0, 0.4);\n border-right: 1px solid rgba(0, 0, 0, 0.4);\n}\n.sel-handle:hover {\n background: #fff;\n transform: translate(-50%, -50%) scale(1.1);\n}\n\n.sel-graph-marker {\n position: absolute;\n transform: translate(-50%, -50%);\n pointer-events: none;\n z-index: 11;\n background: none !important;\n}\n.sel-graph-marker .material-symbols-rounded {\n}\n\n/* \u2500\u2500 Per-chart selection lines \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.sel-line {\n position: absolute;\n top: 0;\n height: 100%;\n width: 0;\n border-left-width: 1.5px;\n border-left-style: solid;\n pointer-events: none;\n}\n\n/* Labels on the selection lines */\n.sel-line-label {\n position: absolute;\n top: 4px;\n font-size: var(--fs-s);\n font-weight: 700;\n background: rgba(14, 14, 16, 0.92);\n color: #fff;\n padding: 2px 5px;\n border-radius: 4px;\n pointer-events: none;\n white-space: nowrap;\n z-index: 10;\n border: 1px solid var(--border);\n}\n\n/* \u2500\u2500 Charts view elements \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n#charts-container {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 6px 0 4px;\n scrollbar-width: none;\n}\n#charts-container::-webkit-scrollbar {\n width: 0;\n height: 0;\n}\n#charts-container::-webkit-scrollbar-thumb {\n background: var(--border2);\n border-radius: 2px;\n}\n\n/* Fixed X Axis Labels */\n.fixed-x-label {\n position: absolute;\n bottom: 4px;\n font-size: var(--fs-s);\n font-family: system-ui, sans-serif;\n color: #555564;\n z-index: 10;\n pointer-events: none;\n}\n.fixed-x-max {\n right: 0;\n text-align: right;\n}\n\n/* Histogram column (inline, per chart row) */\n.chart-row-body {\n display: flex;\n flex-direction: row;\n padding: 0 14px;\n min-width: 0;\n overflow: hidden;\n}\n.chart-row-body > div:first-child {\n flex: 1;\n min-width: 0;\n}\n.hist-col {\n width: 130px;\n flex-shrink: 0;\n border-left: 1px solid var(--border);\n margin-left: 20px;\n margin-right: 0;\n display: none;\n align-items: center;\n justify-content: center;\n cursor: crosshair;\n}\n.hist-col.visible {\n display: flex;\n}\n.hist-canvas {\n display: block;\n}\n\n/* Histogram connector line */\n#hist-line {\n position: fixed;\n height: 0;\n border-top: 1px dashed rgba(255, 255, 255, 0.25);\n pointer-events: none;\n display: none;\n z-index: 10000;\n}\n\n/* Histogram tooltip */\n#hist-tooltip {\n position: fixed;\n background: var(--surface);\n border: 1px solid var(--border2);\n border-radius: 5px;\n padding: 8px 10px;\n pointer-events: none;\n display: none;\n z-index: 10001;\n box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);\n font-size: var(--fs-s);\n}\n.hist-tt-header {\n font-weight: 800;\n margin-bottom: 6px;\n padding-left: 8px;\n border-left: 3px solid var(--accent);\n color: var(--text);\n}\n.hist-tt-grid {\n display: grid;\n grid-template-columns: 1fr auto auto;\n gap: 10px;\n align-items: baseline;\n}\n.hist-tt-label {\n font-size: var(--fs-s);\n color: var(--text-muted);\n}\n.hist-tt-value {\n font-size: var(--fs-s);\n color: var(--text);\n text-align: right;\n font-variant-numeric: tabular-nums;\n}\n.hist-tt-pct {\n font-size: var(--fs-s);\n color: var(--text-dim);\n text-align: right;\n min-width: 36px;\n font-variant-numeric: tabular-nums;\n}\n.hist-tt-grid.sel-row {\n margin-top: 2px;\n opacity: 0.9;\n}\n.hist-tt-label.sel {\n color: var(--accent);\n font-weight: 700;\n}\n\n.chart-row {\n border-bottom: 1px solid var(--border);\n}\n.chart-row:last-child {\n border-bottom: none;\n}\n\n/* \u2500\u2500 Chart row header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.chart-row-header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px 14px 4px 14px;\n min-height: 28px;\n}\n\n.progress-chart-row {\n display: flex;\n flex-direction: column;\n}\n\n.progress-chart-row .chart-row-header {\n height: 36px;\n box-sizing: border-box;\n padding-top: 0;\n padding-bottom: 0;\n}\n\n.progress-chart-row .chart-row-actions {\n margin-left: auto;\n}\n\n.progress-chart-row .chart-row-body {\n flex: 1;\n padding: 0;\n}\n\n.chart-row-label-group {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-shrink: 0;\n width: 140px; /* Fixed width for alignment */\n}\n\n.chart-row-actions {\n display: flex;\n align-items: center;\n gap: 0;\n}\n\n.chart-row-icon {\n font-size: var(--is-s);\n color: var(--chart-color);\n}\n.chart-row-label {\n font-size: var(--fs-m);\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.8px;\n color: var(--text-muted);\n white-space: nowrap;\n}\n\n/* Track Picker Popup */\n.track-picker-popup {\n padding: 8px;\n background: var(--surface);\n color: var(--text);\n border-radius: 8px;\n min-width: 160px;\n}\n.picker-header {\n font-size: var(--fs-s);\n text-transform: uppercase;\n font-weight: 700;\n color: var(--text-dim);\n margin-bottom: 8px;\n padding-bottom: 4px;\n border-bottom: 1px solid var(--border);\n}\n.picker-list {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.picker-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n border-radius: 6px;\n cursor: pointer;\n}\n.picker-item:hover {\n background: var(--surface2);\n}\n.picker-color {\n width: 3px;\n height: 14px;\n border-radius: 1px;\n}\n.picker-info {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n.picker-name {\n font-size: var(--fs-s);\n font-weight: 600;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 180px;\n}\n/* Custom Modal / Dialog */\n.modal-backdrop {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.75);\n backdrop-filter: blur(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 20000;\n}\n.modal-content {\n background: var(--surface);\n border: 1px solid var(--border);\n border-radius: 12px;\n padding: 24px;\n width: 100%;\n max-width: 320px;\n box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n.modal-title {\n font-size: var(--fs-l);\n font-weight: 800;\n color: var(--text);\n}\n.modal-body {\n font-size: var(--fs-m);\n color: var(--text-muted);\n line-height: 1.5;\n}\n.modal-input-wrap {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.modal-input-label {\n font-size: var(--fs-s);\n font-weight: 700;\n text-transform: uppercase;\n color: var(--text-dim);\n}\n.modal-input {\n background: var(--bg);\n border: 1px solid var(--border2);\n border-radius: 6px;\n padding: 10px;\n color: var(--text);\n font-size: var(--fs-l);\n font-weight: 800;\n text-align: center;\n letter-spacing: 4px;\n}\n.modal-input:focus {\n outline: none;\n border-color: var(--accent);\n}\n.modal-actions {\n display: flex;\n gap: 12px;\n margin-top: 8px;\n}\n.modal-btn {\n flex: 1;\n padding: 10px;\n border-radius: 6px;\n font-size: var(--fs-m);\n font-weight: 700;\n border: 1px solid transparent;\n}\n.modal-btn.cancel {\n background: var(--surface2);\n color: var(--text);\n border-color: var(--border);\n}\n.modal-btn.cancel:hover {\n background: var(--border);\n}\n.modal-btn.confirm {\n background: var(--danger);\n color: #fff;\n}\n.modal-btn.confirm:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n filter: grayscale(1);\n}\n.modal-btn.confirm:not(:disabled):hover {\n filter: brightness(1.1);\n}\n\n.picker-meta {\n font-size: var(--fs-s);\n color: var(--text-dim);\n font-weight: 700;\n}\n\n/* Leaflet Popup Overrides */\n.leaflet-popup-content-wrapper,\n.leaflet-popup-tip {\n background: var(--surface) !important;\n color: var(--text) !important;\n border: 1px solid var(--border) !important;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;\n}\n.leaflet-popup-content {\n margin: 0 !important;\n}\n.leaflet-popup-tip {\n border: none !important;\n}\n.map-color-btn {\n margin-left: 4px;\n}\n.map-color-btn .material-symbols-rounded {\n font-size: var(--is-s);\n}\n.map-color-btn.active {\n color: var(--chart-color, var(--accent));\n}\n\n.smooth-btn.active {\n color: var(--accent);\n}\n.cur-y-val {\n position: absolute;\n left: 0;\n top: 0;\n pointer-events: none;\n font-size: var(--fs-s);\n font-weight: 700;\n background: rgba(14, 14, 16, 0.92);\n padding: 2px 6px;\n border-radius: 4px;\n border: 1px solid rgba(255, 255, 255, 0.1);\n z-index: 2000;\n white-space: nowrap;\n}\n.cur-y-val.pin {\n z-index: 1000;\n opacity: 0.7;\n}\n\n/* \u2500\u2500\u2500 Details View \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n#details-view {\n width: 100%;\n padding: 24px;\n max-width: 900px;\n margin: 0 auto;\n}\n\n#details-header {\n margin-bottom: 32px;\n}\n.details-title {\n font-size: var(--fs-l);\n font-weight: 800;\n margin-bottom: 4px;\n}\n.details-subtitle {\n font-size: var(--fs-m);\n color: var(--text-muted);\n}\n\n.details-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n gap: 16px;\n}\n.details-card {\n background: var(--surface2);\n border: 1px solid var(--border);\n padding: 16px;\n border-radius: 12px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.details-card .material-symbols-rounded {\n color: var(--accent);\n margin-bottom: 4px;\n font-size: var(--is-m);\n}\n.details-card-label {\n font-size: var(--fs-s);\n font-weight: 500;\n text-transform: uppercase;\n color: var(--text-dim);\n letter-spacing: 0.5px;\n}\n.details-card-value {\n font-size: var(--fs-l);\n font-weight: 500;\n}\n\n.empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: var(--text-dim);\n gap: 12px;\n padding: 40px 20px;\n}\n.empty-icon {\n font-size: var(--fs-l);\n opacity: 0.2;\n}\n.empty-text {\n font-size: var(--fs-m);\n font-weight: 500;\n}\n\n#chart-empty {\n height: 100%;\n}\n#details-empty {\n margin-top: 40px;\n}\n\n/* \u2500\u2500 Toast notifications \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n#toast-container {\n position: fixed;\n bottom: 20px;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 9999;\n}\n.toast {\n background: var(--surface2);\n color: var(--text);\n padding: 10px 20px;\n border-radius: 8px;\n font-size: var(--fs-m);\n font-weight: 600;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);\n border: 1px solid var(--border2);\n}\n.toast.error {\n border-color: var(--danger);\n}\n.toast.out {\n}\n\n/* \u2500\u2500 Sort menu popup \u2500\u2500 */\n.sort-menu-popup,\n.metric-menu-popup {\n position: fixed;\n z-index: 10000;\n background: var(--surface2);\n border: 1px solid var(--border);\n border-radius: 8px;\n padding: 6px;\n min-width: 180px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);\n}\n\n.menu-item {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n border-radius: 6px;\n cursor: pointer;\n color: var(--text-muted);\n}\n.menu-item:hover {\n background: var(--surface);\n color: var(--text);\n}\n.menu-item.active {\n color: var(--text);\n font-weight: 600;\n}\n.menu-item .material-symbols-rounded {\n font-size: var(--is-s);\n}\n.menu-item .item-label {\n flex: 1;\n font-size: var(--fs-m);\n}\n.menu-item .arrow,\n.menu-item .check {\n font-size: var(--is-s);\n color: var(--text-dim);\n}\n\n/* \u2500\u2500\u2500 Insights View \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n#insights-view {\n width: 100%;\n padding: 24px;\n max-width: 1000px;\n margin: 0 auto;\n}\n\n.insights-grid {\n column-count: 2;\n column-gap: 24px;\n}\n\n@media (max-width: 900px) {\n .insights-grid {\n column-count: 1;\n }\n}\n\n.insight-card {\n display: inline-flex;\n width: 100%;\n break-inside: avoid;\n margin-bottom: 24px;\n background: var(--surface2);\n border: 1px solid var(--border);\n padding: 20px;\n border-radius: 12px;\n flex-direction: column;\n gap: 16px;\n}\n\n.insight-title {\n font-size: var(--fs-m);\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.8px;\n display: flex;\n align-items: center;\n gap: 8px;\n color: var(--text-muted);\n}\n\n.insight-title .material-symbols-rounded {\n font-size: var(--is-s);\n}\n\n.insight-chart-container {\n width: 100%;\n height: 250px;\n}\n\n.power-curve-table {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--fs-m);\n margin-top: 0;\n}\n\n.power-curve-table th {\n text-align: left;\n color: var(--text-dim);\n padding: 4px 8px;\n font-weight: 600;\n border-bottom: 1px solid var(--border);\n}\n\n.power-curve-table td {\n padding: 6px 8px;\n border-bottom: 1px solid var(--border);\n}\n\n.power-curve-table tr:last-child td {\n border-bottom: none;\n}\n\n.progress-details summary {\n cursor: pointer;\n font-size: var(--fs-m);\n color: var(--text-dim);\n display: flex;\n align-items: center;\n gap: 4px;\n list-style: none;\n}\n\n.progress-details summary::-webkit-details-marker {\n display: none;\n}\n\n.progress-details[open] summary .expand-icon {\n transform: rotate(90deg);\n}\n\n.progress-details summary .material-symbols-rounded {\n font-size: var(--fs-l);\n}\n\n.progress-details summary .expand-icon {\n}\n\n.power-curve-val {\n font-weight: 700;\n color: var(--text);\n text-align: right;\n}\n\n.evolution-select-btn {\n background: none;\n border: none;\n cursor: pointer;\n color: var(--chart-color);\n padding: 0;\n font-size: var(--fs-l);\n vertical-align: middle;\n margin-left: 4px;\n}\n\n.hr-settings-popup {\n display: flex;\n flex-direction: column;\n}\n\n.hr-input-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: var(--fs-m);\n color: var(--text-muted);\n font-weight: 600;\n}\n\n.hr-zone-input {\n background: var(--surface);\n border: 1px solid var(--border);\n border-radius: 4px;\n color: var(--text);\n width: 60px;\n padding: 4px 8px;\n font-size: var(--fs-m);\n text-align: right;\n outline: none;\n}\n\n.hr-zone-input:focus {\n border-color: var(--accent);\n}\n\n.save-btn {\n background: var(--accent);\n color: #fff;\n border: none;\n border-radius: 6px;\n padding: 8px;\n font-size: 12px;\n font-weight: 700;\n cursor: pointer;\n}\n\n.save-btn:hover {\n background: var(--accent-hover);\n}\n\n.menu-item.active .arrow,\n.menu-item.active .check {\n color: var(--accent);\n}\n\n/* \u2500\u2500 Evolution View \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.evolution-toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 6px 12px;\n border-bottom: 1px solid var(--border);\n background: var(--bg);\n min-height: 40px;\n}\n\n.evolution-toolbar-left,\n.evolution-toolbar-right {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n\n.evolution-toolbar .metric-pills {\n display: flex;\n gap: 6px;\n}\n\n.evolution-toolbar .metric-pill {\n cursor: pointer;\n}\n\n.evolution-container {\n display: flex;\n flex-direction: column;\n gap: 0px;\n padding: 6px 0 4px;\n}\n\n.evolution-card-group {\n display: flex;\n flex-direction: column;\n gap: 10px;\n width: 100%;\n}\n\n.evolution-legend {\n display: flex;\n gap: 16px;\n font-size: 12px;\n color: var(--text-dim);\n margin-top: 0px;\n margin-bottom: 0px;\n justify-content: center;\n}\n\n.evolution-legend-item {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.evolution-legend-line {\n width: 16px;\n height: 0;\n display: inline-block;\n}\n\n.evolution-legend-line.solid {\n border-top: 2px solid var(--chart-color);\n}\n\n.evolution-legend-line.dashed {\n border-top: 2px dashed #888888;\n}\n\n.evolution-tooltip-title {\n font-weight: bold;\n margin-bottom: 4px;\n}\n\n.evolution-tooltip-row {\n display: flex;\n justify-content: space-between;\n gap: 15px;\n}\n\n.evolution-tooltip-label {\n color: #8a8a93;\n}\n\n.evolution-tooltip-value {\n font-weight: bold;\n}\n\n.evolution-empty-text {\n color: var(--text-dim);\n font-size: 12px;\n text-align: center;\n margin-top: 20px;\n}\n\n.evolution-chart-container {\n height: 250px;\n flex: 1;\n}\n\n.distance-progress-card .card-content,\n.elevation-progress-card .card-content {\n display: flex;\n gap: 20px;\n}\n\n.chart-scroll-container {\n flex: 1;\n overflow-x: auto;\n position: relative;\n background: var(--bg-dim);\n border-radius: 8px;\n padding: 10px;\n scrollbar-width: none;\n}\n.chart-scroll-container::-webkit-scrollbar {\n width: 0;\n height: 0;\n display: none;\n}\n\n.accumulated-table-container {\n width: 250px;\n background: var(--bg-dim);\n border-radius: 8px;\n padding: 15px;\n}\n\n.accumulated-table {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--fs-m);\n}\n\n.accumulated-table th,\n.accumulated-table td {\n padding: 4px 8px;\n text-align: left;\n border-bottom: 1px solid var(--border-color);\n}\n\n.accumulated-table th {\n color: var(--text-dim);\n font-weight: 500;\n text-transform: uppercase;\n font-size: var(--fs-m);\n letter-spacing: 0.5px;\n}\n\n.accumulated-table td:last-child {\n text-align: right;\n font-weight: 500;\n font-family: monospace;\n}\n\n.accumulated-table tr:last-child td {\n border-bottom: none;\n}\n\n.chart-scroll-container::-webkit-scrollbar {\n height: 4px;\n}\n\n.chart-scroll-container::-webkit-scrollbar-thumb {\n background: var(--border2);\n border-radius: 2px;\n}\n\n/* uPlot overrides to comply with font size restrictions */\n.u-title {\n font-size: var(--fs-m) !important;\n}\n.u-legend {\n font-size: var(--fs-m) !important;\n}\n\n/* Courses Tab */\n.courses-container {\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.courses-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.course-item {\n background: var(--surface2);\n border: 1px solid var(--border);\n border-radius: 8px;\n display: flex;\n flex-direction: column;\n cursor: pointer;\n overflow: hidden;\n}\n\n.course-item:hover {\n background: var(--surface3);\n border-color: var(--border-high);\n}\n\n.course-item-header {\n padding: 6px 12px;\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n}\n\n.course-name {\n font-weight: 600;\n flex: 1;\n}\n\n.course-meta {\n color: var(--text-muted);\n font-size: var(--fs-s);\n}\n\n.course-actions {\n display: flex;\n gap: 4px;\n}\n\n.course-actions .icon-btn {\n opacity: 0.5;\n}\n\n.course-item:hover .course-actions .icon-btn {\n opacity: 1;\n}\n\n.expand-icon {\n color: var(--text-muted);\n}\n\n.course-tracks {\n padding: 8px 12px;\n border-top: 1px solid var(--border);\n background: var(--surface1);\n}\n\n.course-tracks-title {\n font-size: var(--fs-xs);\n font-weight: 700;\n color: var(--text-muted);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n margin-bottom: 6px;\n}\n\n.course-tracks-table {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--fs-s);\n color: var(--text);\n}\n\n.course-tracks-table th,\n.course-tracks-table td {\n padding: 6px 8px;\n text-align: right;\n border-bottom: 1px solid var(--border-low);\n}\n\n.course-tracks-table th:first-child,\n.course-tracks-table td:first-child,\n.course-tracks-table th:nth-child(2),\n.course-tracks-table td:nth-child(2) {\n text-align: left;\n}\n\n.course-tracks-table td:not(:first-child) {\n white-space: nowrap;\n}\n\n.course-tracks-table th {\n font-weight: 600;\n color: var(--text-muted);\n font-size: var(--fs-xs);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n white-space: nowrap;\n}\n\n.course-tracks-table tr:last-child td {\n border-bottom: none;\n}\n\n.course-tracks-table th:first-child,\n.course-tracks-table td:first-child {\n width: 100%;\n}\n\n.course-track-row:hover {\n background: var(--surface2);\n}\n\n.course-track-row.selected {\n background: color-mix(in srgb, var(--theme-color) 8%, transparent);\n}\n\n.track-name-cell.clickable {\n color: var(--accent);\n cursor: pointer;\n font-weight: 500;\n}\n\n.track-name-cell.clickable:hover {\n text-decoration: underline;\n}\n\n.metric-icon {\n font-size: 16px;\n vertical-align: middle;\n margin-right: 4px;\n}\n\n.metric-icon.duration {\n color: var(--text-muted);\n}\n\n.metric-icon.speed {\n color: #4caf50;\n}\n\n.metric-icon.power {\n color: #ff9800;\n}\n\n.metric-icon.hr {\n color: #f44336;\n}\n\n.course-point-marker {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n"], + "mappings": "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", + "names": [] +} diff --git a/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_1_alps_stage.gpx.gz b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_1_alps_stage.gpx.gz new file mode 100644 index 000000000..cd3428df6 Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_1_alps_stage.gpx.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_2_forest_mtb.gpx.gz b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_2_forest_mtb.gpx.gz new file mode 100644 index 000000000..7958521ff Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_2_forest_mtb.gpx.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_3_road_race.tcx.gz b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_3_road_race.tcx.gz new file mode 100644 index 000000000..9060c68ff Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_3_road_race.tcx.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_4_intervals.tcx.gz b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_4_intervals.tcx.gz new file mode 100644 index 000000000..8357b7078 Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_4_intervals.tcx.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_5_grand_tour.fit.gz b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_5_grand_tour.fit.gz new file mode 100644 index 000000000..18c520009 Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_5_grand_tour.fit.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_6_weekend_ride.fit.gz b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_6_weekend_ride.fit.gz new file mode 100644 index 000000000..1a0b5fbed Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/dist/test-data/activity_6_weekend_ride.fit.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/dist/test-data/manifest.json b/suites-experimental/tools-gps-tracks-angular/dist/test-data/manifest.json new file mode 100644 index 000000000..52a312930 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/test-data/manifest.json @@ -0,0 +1,8 @@ +[ + "activity_1_alps_stage.gpx.gz", + "activity_2_forest_mtb.gpx.gz", + "activity_3_road_race.tcx.gz", + "activity_4_intervals.tcx.gz", + "activity_5_grand_tour.fit.gz", + "activity_6_weekend_ride.fit.gz" +] \ No newline at end of file diff --git a/suites-experimental/tools-gps-tracks-angular/dist/tools-gps-tracks-angular.mjs b/suites-experimental/tools-gps-tracks-angular/dist/tools-gps-tracks-angular.mjs new file mode 100644 index 000000000..b2da73555 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/tools-gps-tracks-angular.mjs @@ -0,0 +1,3128 @@ +var KC=Object.defineProperty;var Y9=Object.getOwnPropertyDescriptor;var X9=(n,e,t)=>e in n?KC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Q9=(n,e)=>{for(var t in e)KC(n,t,{get:e[t],enumerable:!0})};var Xn=(n,e,t,r)=>{for(var s=r>1?void 0:r?Y9(e,t):e,i=n.length-1,o;i>=0;i--)(o=n[i])&&(s=(r?o(e,t,s):o(s))||s);return r&&s&&KC(e,t,s),s};var l=(n,e,t)=>(X9(n,typeof e!="symbol"?e+"":e,t),t);var Eo=globalThis;function oi(n){return(Eo.__Zone_symbol_prefix||"__zone_symbol__")+n}function K9(){let n=Eo.performance;function e(S){n&&n.mark&&n.mark(S)}function t(S,x){n&&n.measure&&n.measure(S,x)}e("Zone");let A=class A{constructor(x,C){l(this,"_parent");l(this,"_name");l(this,"_properties");l(this,"_zoneDelegate");this._parent=x,this._name=C?C.name||"unnamed":"",this._properties=C&&C.properties||{},this._zoneDelegate=new i(this,this._parent&&this._parent._zoneDelegate,C)}static assertZonePatched(){if(Eo.Promise!==pe.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let x=A.current;for(;x.parent;)x=x.parent;return x}static get current(){return ee.zone}static get currentTask(){return we}static __load_patch(x,C,I=!1){if(pe.hasOwnProperty(x)){let F=Eo[oi("forceDuplicateZoneCheck")]===!0;if(!I&&F)throw Error("Already loaded patch: "+x)}else if(!Eo["__Zone_disable_"+x]){let F="Zone:"+x;e(F),pe[x]=C(Eo,A,$),t(F,F)}}get parent(){return this._parent}get name(){return this._name}get(x){let C=this.getZoneWith(x);if(C)return C._properties[x]}getZoneWith(x){let C=this;for(;C;){if(C._properties.hasOwnProperty(x))return C;C=C._parent}return null}fork(x){if(!x)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,x)}wrap(x,C){if(typeof x!="function")throw new Error("Expecting function got: "+x);let I=this._zoneDelegate.intercept(this,x,C),F=this;return function(){return F.runGuarded(I,this,arguments,C)}}run(x,C,I,F){ee={parent:ee,zone:this};try{return this._zoneDelegate.invoke(this,x,C,I,F)}finally{ee=ee.parent}}runGuarded(x,C=null,I,F){ee={parent:ee,zone:this};try{try{return this._zoneDelegate.invoke(this,x,C,I,F)}catch(J){if(this._zoneDelegate.handleError(this,J))throw J}}finally{ee=ee.parent}}runTask(x,C,I){if(x.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(x.zone||y).name+"; Execution: "+this.name+")");let F=x,{type:J,data:{isPeriodic:ie=!1,isRefreshable:ve=!1}={}}=x;if(x.state===b&&(J===xe||J===W))return;let oe=x.state!=V;oe&&F._transitionTo(V,_);let ke=we;we=F,ee={parent:ee,zone:this};try{J==W&&x.data&&!ie&&!ve&&(x.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,F,C,I)}catch(se){if(this._zoneDelegate.handleError(this,se))throw se}}finally{let se=x.state;if(se!==b&&se!==j)if(J==xe||ie||ve&&se===E)oe&&F._transitionTo(_,V,E);else{let B=F._zoneDelegates;this._updateTaskCount(F,-1),oe&&F._transitionTo(b,V,b),ve&&(F._zoneDelegates=B)}ee=ee.parent,we=ke}}scheduleTask(x){if(x.zone&&x.zone!==this){let I=this;for(;I;){if(I===x.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${x.zone.name}`);I=I.parent}}x._transitionTo(E,b);let C=[];x._zoneDelegates=C,x._zone=this;try{x=this._zoneDelegate.scheduleTask(this,x)}catch(I){throw x._transitionTo(j,E,b),this._zoneDelegate.handleError(this,I),I}return x._zoneDelegates===C&&this._updateTaskCount(x,1),x.state==E&&x._transitionTo(_,E),x}scheduleMicroTask(x,C,I,F){return this.scheduleTask(new o(G,x,C,I,F,void 0))}scheduleMacroTask(x,C,I,F,J){return this.scheduleTask(new o(W,x,C,I,F,J))}scheduleEventTask(x,C,I,F,J){return this.scheduleTask(new o(xe,x,C,I,F,J))}cancelTask(x){if(x.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(x.zone||y).name+"; Execution: "+this.name+")");if(!(x.state!==_&&x.state!==V)){x._transitionTo(M,_,V);try{this._zoneDelegate.cancelTask(this,x)}catch(C){throw x._transitionTo(j,M),this._zoneDelegate.handleError(this,C),C}return this._updateTaskCount(x,-1),x._transitionTo(b,M),x.runCount=-1,x}}_updateTaskCount(x,C){let I=x._zoneDelegates;C==-1&&(x._zoneDelegates=null);for(let F=0;FS.hasTask(C,I),onScheduleTask:(S,x,C,I)=>S.scheduleTask(C,I),onInvokeTask:(S,x,C,I,F,J)=>S.invokeTask(C,I,F,J),onCancelTask:(S,x,C,I)=>S.cancelTask(C,I)};class i{constructor(x,C,I){l(this,"_zone");l(this,"_taskCounts",{microTask:0,macroTask:0,eventTask:0});l(this,"_parentDelegate");l(this,"_forkDlgt");l(this,"_forkZS");l(this,"_forkCurrZone");l(this,"_interceptDlgt");l(this,"_interceptZS");l(this,"_interceptCurrZone");l(this,"_invokeDlgt");l(this,"_invokeZS");l(this,"_invokeCurrZone");l(this,"_handleErrorDlgt");l(this,"_handleErrorZS");l(this,"_handleErrorCurrZone");l(this,"_scheduleTaskDlgt");l(this,"_scheduleTaskZS");l(this,"_scheduleTaskCurrZone");l(this,"_invokeTaskDlgt");l(this,"_invokeTaskZS");l(this,"_invokeTaskCurrZone");l(this,"_cancelTaskDlgt");l(this,"_cancelTaskZS");l(this,"_cancelTaskCurrZone");l(this,"_hasTaskDlgt");l(this,"_hasTaskDlgtOwner");l(this,"_hasTaskZS");l(this,"_hasTaskCurrZone");this._zone=x,this._parentDelegate=C,this._forkZS=I&&(I&&I.onFork?I:C._forkZS),this._forkDlgt=I&&(I.onFork?C:C._forkDlgt),this._forkCurrZone=I&&(I.onFork?this._zone:C._forkCurrZone),this._interceptZS=I&&(I.onIntercept?I:C._interceptZS),this._interceptDlgt=I&&(I.onIntercept?C:C._interceptDlgt),this._interceptCurrZone=I&&(I.onIntercept?this._zone:C._interceptCurrZone),this._invokeZS=I&&(I.onInvoke?I:C._invokeZS),this._invokeDlgt=I&&(I.onInvoke?C:C._invokeDlgt),this._invokeCurrZone=I&&(I.onInvoke?this._zone:C._invokeCurrZone),this._handleErrorZS=I&&(I.onHandleError?I:C._handleErrorZS),this._handleErrorDlgt=I&&(I.onHandleError?C:C._handleErrorDlgt),this._handleErrorCurrZone=I&&(I.onHandleError?this._zone:C._handleErrorCurrZone),this._scheduleTaskZS=I&&(I.onScheduleTask?I:C._scheduleTaskZS),this._scheduleTaskDlgt=I&&(I.onScheduleTask?C:C._scheduleTaskDlgt),this._scheduleTaskCurrZone=I&&(I.onScheduleTask?this._zone:C._scheduleTaskCurrZone),this._invokeTaskZS=I&&(I.onInvokeTask?I:C._invokeTaskZS),this._invokeTaskDlgt=I&&(I.onInvokeTask?C:C._invokeTaskDlgt),this._invokeTaskCurrZone=I&&(I.onInvokeTask?this._zone:C._invokeTaskCurrZone),this._cancelTaskZS=I&&(I.onCancelTask?I:C._cancelTaskZS),this._cancelTaskDlgt=I&&(I.onCancelTask?C:C._cancelTaskDlgt),this._cancelTaskCurrZone=I&&(I.onCancelTask?this._zone:C._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;let F=I&&I.onHasTask,J=C&&C._hasTaskZS;(F||J)&&(this._hasTaskZS=F?I:s,this._hasTaskDlgt=C,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,I.onScheduleTask||(this._scheduleTaskZS=s,this._scheduleTaskDlgt=C,this._scheduleTaskCurrZone=this._zone),I.onInvokeTask||(this._invokeTaskZS=s,this._invokeTaskDlgt=C,this._invokeTaskCurrZone=this._zone),I.onCancelTask||(this._cancelTaskZS=s,this._cancelTaskDlgt=C,this._cancelTaskCurrZone=this._zone))}get zone(){return this._zone}fork(x,C){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,x,C):new r(x,C)}intercept(x,C,I){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,x,C,I):C}invoke(x,C,I,F,J){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,x,C,I,F,J):C.apply(I,F)}handleError(x,C){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,x,C):!0}scheduleTask(x,C){let I=C;if(this._scheduleTaskZS)this._hasTaskZS&&I._zoneDelegates.push(this._hasTaskDlgtOwner),I=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,x,C),I||(I=C);else if(C.scheduleFn)C.scheduleFn(C);else if(C.type==G)m(C);else throw new Error("Task is missing scheduleFn.");return I}invokeTask(x,C,I,F){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,x,C,I,F):C.callback.apply(I,F)}cancelTask(x,C){let I;if(this._cancelTaskZS)I=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,x,C);else{if(!C.cancelFn)throw Error("Task is not cancelable");I=C.cancelFn(C)}return I}hasTask(x,C){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,x,C)}catch(I){this.handleError(x,I)}}_updateTaskCount(x,C){let I=this._taskCounts,F=I[x],J=I[x]=F+C;if(J<0)throw new Error("More tasks executed then were scheduled.");if(F==0||J==0){let ie={microTask:I.microTask>0,macroTask:I.macroTask>0,eventTask:I.eventTask>0,change:x};this.hasTask(this._zone,ie)}}}class o{constructor(x,C,I,F,J,ie){l(this,"type");l(this,"source");l(this,"invoke");l(this,"callback");l(this,"data");l(this,"scheduleFn");l(this,"cancelFn");l(this,"_zone",null);l(this,"runCount",0);l(this,"_zoneDelegates",null);l(this,"_state","notScheduled");if(this.type=x,this.source=C,this.data=F,this.scheduleFn=J,this.cancelFn=ie,!I)throw new Error("callback is not defined");this.callback=I;let ve=this;x===xe&&F&&F.useG?this.invoke=o.invokeTask:this.invoke=function(){return o.invokeTask.call(Eo,ve,this,arguments)}}static invokeTask(x,C,I){x||(x=this),We++;try{return x.runCount++,x.zone.runTask(x,C,I)}finally{We==1&&g(),We--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(b,E)}_transitionTo(x,C,I){if(this._state===C||this._state===I)this._state=x,x==b&&(this._zoneDelegates=null);else throw new Error(`${this.type} '${this.source}': can not transition to '${x}', expecting state '${C}'${I?" or '"+I+"'":""}, was '${this._state}'.`)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}let a=oi("setTimeout"),c=oi("Promise"),u=oi("then"),d=[],p=!1,f;function h(S){if(f||Eo[c]&&(f=Eo[c].resolve(0)),f){let x=f[u];x||(x=f.then),x.call(f,S)}else Eo[a](S,0)}function m(S){We===0&&d.length===0&&h(g),S&&d.push(S)}function g(){if(!p){for(p=!0;d.length;){let S=d;d=[];for(let x=0;xee,onUnhandledError:P,microtaskDrainDone:P,scheduleMicroTask:m,showUncaughtError:()=>!r[oi("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:P,patchMethod:()=>P,bindArguments:()=>[],patchThen:()=>P,patchMacroTask:()=>P,patchEventPrototype:()=>P,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>P,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>P,wrapWithCurrentZone:()=>P,filterProperties:()=>[],attachOriginToPatched:()=>P,_redefineProperty:()=>P,patchCallbacks:()=>P,nativeScheduleMicroTask:h},ee={parent:null,zone:new r(null,null)},we=null,We=0;function P(){}return t("Zone","Zone"),r}function J9(){let n=globalThis,e=n[oi("forceDuplicateZoneCheck")]===!0;if(n.Zone&&(e||typeof n.Zone.__symbol__!="function"))throw new Error("Zone already loaded.");return n.Zone??(n.Zone=K9()),n.Zone}var lg=Object.getOwnPropertyDescriptor,rT=Object.defineProperty,sT=Object.getPrototypeOf,eq=Object.create,tq=Array.prototype.slice,iT="addEventListener",oT="removeEventListener",JC=oi(iT),eT=oi(oT),la="true",ca="false",cg=oi("");function aT(n,e){return Zone.current.wrap(n,e)}function lT(n,e,t,r,s){return Zone.current.scheduleMacroTask(n,e,t,r,s)}var fn=oi,t0=typeof window<"u",ug=t0?window:void 0,hr=t0&&ug||globalThis,nq="removeAttribute";function cT(n,e){for(let t=n.length-1;t>=0;t--)typeof n[t]=="function"&&(n[t]=aT(n[t],e+"_"+t));return n}function rq(n,e){let t=n.constructor.name;for(let r=0;r{let c=function(){return a.apply(this,cT(arguments,t+"."+s))};return da(c,a),c})(i)}}}function pP(n){return n?n.writable===!1?!1:!(typeof n.get=="function"&&typeof n.set>"u"):!0}var fP=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,n0=!("nw"in hr)&&typeof hr.process<"u"&&hr.process.toString()==="[object process]",uT=!n0&&!fP&&!!(t0&&ug.HTMLElement),hP=typeof hr.process<"u"&&hr.process.toString()==="[object process]"&&!fP&&!!(t0&&ug.HTMLElement),e0={},sq=fn("enable_beforeunload"),oP=function(n){if(n=n||hr.event,!n)return;let e=e0[n.type];e||(e=e0[n.type]=fn("ON_PROPERTY"+n.type));let t=this||n.target||hr,r=t[e],s;if(uT&&t===ug&&n.type==="error"){let i=n;s=r&&r.call(this,i.message,i.filename,i.lineno,i.colno,i.error),s===!0&&n.preventDefault()}else s=r&&r.apply(this,arguments),n.type==="beforeunload"&&hr[sq]&&typeof s=="string"?n.returnValue=s:s!=null&&!s&&n.preventDefault();return s};function aP(n,e,t){let r=lg(n,e);if(!r&&t&&lg(t,e)&&(r={enumerable:!0,configurable:!0}),!r||!r.configurable)return;let s=fn("on"+e+"patched");if(n.hasOwnProperty(s)&&n[s])return;delete r.writable,delete r.value;let i=r.get,o=r.set,a=e.slice(2),c=e0[a];c||(c=e0[a]=fn("ON_PROPERTY"+a)),r.set=function(u){let d=this;if(!d&&n===hr&&(d=hr),!d)return;typeof d[c]=="function"&&d.removeEventListener(a,oP),o?.call(d,null),d[c]=u,typeof u=="function"&&d.addEventListener(a,oP,!1)},r.get=function(){let u=this;if(!u&&n===hr&&(u=hr),!u)return null;let d=u[c];if(d)return d;if(i){let p=i.call(this);if(p)return r.set.call(this,p),typeof u[nq]=="function"&&u.removeAttribute(e),p}return null},rT(n,e,r),n[s]=!0}function mP(n,e,t){if(e)for(let r=0;rfunction(o,a){let c=t(o,a);return c.cbIdx>=0&&typeof a[c.cbIdx]=="function"?lT(c.name,a[c.cbIdx],c,s):i.apply(o,a)})}function da(n,e){n[fn("OriginalDelegate")]=e}var lP=!1,tT=!1;function oq(){if(lP)return tT;lP=!0;try{let n=ug.navigator.userAgent;(n.indexOf("MSIE ")!==-1||n.indexOf("Trident/")!==-1||n.indexOf("Edge/")!==-1)&&(tT=!0)}catch{}return tT}function cP(n){return typeof n=="function"}function uP(n){return typeof n=="number"}var aq={useG:!0},ai={},gP={},vP=new RegExp("^"+cg+"(\\w+)(true|false)$"),yP=fn("propagationStopped");function bP(n,e){let t=(e?e(n):n)+ca,r=(e?e(n):n)+la,s=cg+t,i=cg+r;ai[n]={},ai[n][ca]=s,ai[n][la]=i}function lq(n,e,t,r){let s=r&&r.add||iT,i=r&&r.rm||oT,o=r&&r.listeners||"eventListeners",a=r&&r.rmAll||"removeAllListeners",c=fn(s),u="."+s+":",d="prependListener",p="."+d+":",f=function(E,_,V){if(E.isRemoved)return;let M=E.callback;typeof M=="object"&&M.handleEvent&&(E.callback=W=>M.handleEvent(W),E.originalDelegate=M);let j;try{E.invoke(E,_,[V])}catch(W){j=W}let G=E.options;if(G&&typeof G=="object"&&G.once){let W=E.originalDelegate?E.originalDelegate:E.callback;_[i].call(_,V.type,W,G)}return j};function h(E,_,V){if(_=_||n.event,!_)return;let M=E||_.target||n,j=M[ai[_.type][V?la:ca]];if(j){let G=[];if(j.length===1){let W=f(j[0],M,_);W&&G.push(W)}else{let W=j.slice();for(let xe=0;xe{throw xe})}}}let m=function(E){return h(this,E,!1)},g=function(E){return h(this,E,!0)};function y(E,_){if(!E)return!1;let V=!0;_&&_.useG!==void 0&&(V=_.useG);let M=_&&_.vh,j=!0;_&&_.chkDup!==void 0&&(j=_.chkDup);let G=!1;_&&_.rt!==void 0&&(G=_.rt);let W=E;for(;W&&!W.hasOwnProperty(s);)W=sT(W);if(!W&&E[s]&&(W=E),!W||W[c])return!1;let xe=_&&_.eventNameToString,pe={},$=W[c]=W[s],ee=W[fn(i)]=W[i],we=W[fn(o)]=W[o],We=W[fn(a)]=W[a],P;_&&_.prepend&&(P=W[fn(_.prepend)]=W[_.prepend]);function A(L,U){return U?typeof L=="boolean"?{capture:L,passive:!0}:L?typeof L=="object"&&L.passive!==!1?{...L,passive:!0}:L:{passive:!0}:L}let S=function(L){if(!pe.isExisting)return $.call(pe.target,pe.eventName,pe.capture?g:m,pe.options)},x=function(L){if(!L.isRemoved){let U=ai[L.eventName],H;U&&(H=U[L.capture?la:ca]);let ae=H&&L.target[H];if(ae){for(let K=0;Kkn.zone.cancelTask(kn);L.call(de,"abort",fr,{once:!0}),kn.removeAbortListener=()=>de.removeEventListener("abort",fr)}if(pe.target=null,Ht&&(Ht.taskData=null),Zt&&(pe.options.once=!0),typeof kn.options!="boolean"&&(kn.options=Pt),kn.target=ue,kn.capture=He,kn.eventName=Ce,Je&&(kn.originalDelegate=Me),Ee?nt.unshift(kn):nt.push(kn),K)return ue}};return W[s]=z($,u,J,ie,G),P&&(W[d]=z(P,p,I,ie,G,!0)),W[i]=function(){let L=this||n,U=arguments[0];_&&_.transferEventName&&(U=_.transferEventName(U));let H=arguments[2],ae=H?typeof H=="boolean"?!0:H.capture:!1,K=arguments[1];if(!K)return ee.apply(this,arguments);if(M&&!M(ee,K,L,arguments))return;let Ee=ai[U],ue;Ee&&(ue=Ee[ae?la:ca]);let Ce=ue&&L[ue];if(Ce)for(let Me=0;Mefunction(s,i){s[yP]=!0,r&&r.apply(s,i)})}function uq(n,e){e.patchMethod(n,"queueMicrotask",t=>function(r,s){Zone.current.scheduleMicroTask("queueMicrotask",s[0])})}var Jb=fn("zoneTask");function sp(n,e,t,r){let s=null,i=null;e+=r,t+=r;let o={};function a(u){let d=u.data;d.args[0]=function(){return u.invoke.apply(this,arguments)};let p=s.apply(n,d.args);return uP(p)?d.handleId=p:(d.handle=p,d.isRefreshable=cP(p.refresh)),u}function c(u){let{handle:d,handleId:p}=u.data;return i.call(n,d??p)}s=ua(n,e,u=>function(d,p){if(cP(p[0])){let f={isRefreshable:!1,isPeriodic:r==="Interval",delay:r==="Timeout"||r==="Interval"?p[1]||0:void 0,args:p},h=p[0];p[0]=function(){try{return h.apply(this,arguments)}finally{let{handle:V,handleId:M,isPeriodic:j,isRefreshable:G}=f;!j&&!G&&(M?delete o[M]:V&&(V[Jb]=null))}};let m=lT(e,p[0],f,a,c);if(!m)return m;let{handleId:g,handle:y,isRefreshable:b,isPeriodic:E}=m.data;if(g)o[g]=m;else if(y&&(y[Jb]=m,b&&!E)){let _=y.refresh;y.refresh=function(){let{zone:V,state:M}=m;return M==="notScheduled"?(m._state="scheduled",V._updateTaskCount(m,1)):M==="running"&&(m._state="scheduling"),_.call(this)}}return y??g??m}else return u.apply(n,p)}),i=ua(n,t,u=>function(d,p){let f=p[0],h;uP(f)?(h=o[f],delete o[f]):(h=f?.[Jb],h?f[Jb]=null:h=f),h?.type?h.cancelFn&&h.zone.cancelTask(h):u.apply(n,p)})}function dq(n,e){let{isBrowser:t,isMix:r}=e.getGlobalObjects();if(!t&&!r||!n.customElements||!("customElements"in n))return;let s=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"];e.patchCallbacks(e,n.customElements,"customElements","define",s)}function pq(n,e){if(Zone[e.symbol("patchEventTarget")])return;let{eventNames:t,zoneSymbolEventNames:r,TRUE_STR:s,FALSE_STR:i,ZONE_SYMBOL_PREFIX:o}=e.getGlobalObjects();for(let c=0;ci.target===n);if(r.length===0)return e;let s=r[0].ignoreProperties;return e.filter(i=>s.indexOf(i)===-1)}function dP(n,e,t,r){if(!n)return;let s=EP(n,e,t);mP(n,s,r)}function nT(n){return Object.getOwnPropertyNames(n).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function hq(n,e){if(n0&&!hP||Zone[n.symbol("patchEvents")])return;let t=e.__Zone_ignore_on_properties,r=[];if(uT){let s=window;r=r.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);let i=[];dP(s,nT(s),t&&t.concat(i),sT(s))}r=r.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let s=0;s{let t=e[n.__symbol__("legacyPatch")];t&&t()}),n.__load_patch("timers",e=>{let t="set",r="clear";sp(e,t,r,"Timeout"),sp(e,t,r,"Interval"),sp(e,t,r,"Immediate")}),n.__load_patch("requestAnimationFrame",e=>{sp(e,"request","cancel","AnimationFrame"),sp(e,"mozRequest","mozCancel","AnimationFrame"),sp(e,"webkitRequest","webkitCancel","AnimationFrame")}),n.__load_patch("blocking",(e,t)=>{let r=["alert","prompt","confirm"];for(let s=0;sfunction(u,d){return t.current.run(o,e,d,c)})}}),n.__load_patch("EventTarget",(e,t,r)=>{fq(e,r),pq(e,r);let s=e.XMLHttpRequestEventTarget;s&&s.prototype&&r.patchEventTarget(e,r,[s.prototype])}),n.__load_patch("MutationObserver",(e,t,r)=>{ag("MutationObserver"),ag("WebKitMutationObserver")}),n.__load_patch("IntersectionObserver",(e,t,r)=>{ag("IntersectionObserver")}),n.__load_patch("FileReader",(e,t,r)=>{ag("FileReader")}),n.__load_patch("on_property",(e,t,r)=>{hq(r,e)}),n.__load_patch("customElements",(e,t,r)=>{dq(e,r)}),n.__load_patch("XHR",(e,t)=>{u(e);let r=fn("xhrTask"),s=fn("xhrSync"),i=fn("xhrListener"),o=fn("xhrScheduled"),a=fn("xhrURL"),c=fn("xhrErrorBeforeScheduled");function u(d){let p=d.XMLHttpRequest;if(!p)return;let f=p.prototype;function h($){return $[r]}let m=f[JC],g=f[eT];if(!m){let $=d.XMLHttpRequestEventTarget;if($){let ee=$.prototype;m=ee[JC],g=ee[eT]}}let y="readystatechange",b="scheduled";function E($){let ee=$.data,we=ee.target;we[o]=!1,we[c]=!1;let We=we[i];m||(m=we[JC],g=we[eT]),We&&g.call(we,y,We);let P=we[i]=()=>{if(we.readyState===we.DONE)if(!ee.aborted&&we[o]&&$.state===b){let S=we[t.__symbol__("loadfalse")];if(we.status!==0&&S&&S.length>0){let x=$.invoke;$.invoke=function(){let C=we[t.__symbol__("loadfalse")];for(let I=0;Ifunction($,ee){return $[s]=ee[2]==!1,$[a]=ee[1],M.apply($,ee)}),j="XMLHttpRequest.send",G=fn("fetchTaskAborting"),W=fn("fetchTaskScheduling"),xe=ua(f,"send",()=>function($,ee){if(t.current[W]===!0||$[s])return xe.apply($,ee);{let we={target:$,url:$[a],isPeriodic:!1,args:ee,aborted:!1},We=lT(j,_,we,E,V);$&&$[c]===!0&&!we.aborted&&We.state===b&&We.invoke()}}),pe=ua(f,"abort",()=>function($,ee){let we=h($);if(we&&typeof we.type=="string"){if(we.cancelFn==null||we.data&&we.data.aborted)return;we.zone.cancelTask(we)}else if(t.current[G]===!0)return pe.apply($,ee)})}}),n.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&rq(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),n.__load_patch("PromiseRejectionEvent",(e,t)=>{function r(s){return function(i){wP(e,s).forEach(a=>{let c=e.PromiseRejectionEvent;if(c){let u=new c(s,{promise:i.promise,reason:i.rejection});a.invoke(u)}})}}e.PromiseRejectionEvent&&(t[fn("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[fn("rejectionHandledHandler")]=r("rejectionhandled"))}),n.__load_patch("queueMicrotask",(e,t,r)=>{uq(e,r)})}function gq(n){n.__load_patch("ZoneAwarePromise",(e,t,r)=>{let s=Object.getOwnPropertyDescriptor,i=Object.defineProperty;function o(B){if(B&&B.toString===Object.prototype.toString){let z=B.constructor&&B.constructor.name;return(z||"")+": "+JSON.stringify(B)}return B?B.toString():Object.prototype.toString.call(B)}let a=r.symbol,c=[],u=e[a("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")]!==!1,d=a("Promise"),p=a("then"),f="__creationTrace__";r.onUnhandledError=B=>{if(r.showUncaughtError()){let z=B&&B.rejection;z?console.error("Unhandled Promise rejection:",z instanceof Error?z.message:z,"; Zone:",B.zone.name,"; Task:",B.task&&B.task.source,"; Value:",z,z instanceof Error?z.stack:void 0):console.error(B)}},r.microtaskDrainDone=()=>{for(;c.length;){let B=c.shift();try{B.zone.runGuarded(()=>{throw B.throwOriginal?B.rejection:B})}catch(z){m(z)}}};let h=a("unhandledPromiseRejectionHandler");function m(B){r.onUnhandledError(B);try{let z=t[h];typeof z=="function"&&z.call(this,B)}catch{}}function g(B){return B&&typeof B.then=="function"}function y(B){return B}function b(B){return ie.reject(B)}let E=a("state"),_=a("value"),V=a("finally"),M=a("parentPromiseValue"),j=a("parentPromiseState"),G="Promise.then",W=null,xe=!0,pe=!1,$=0;function ee(B,z){return L=>{try{A(B,z,L)}catch(U){A(B,!1,U)}}}let we=function(){let B=!1;return function(L){return function(){B||(B=!0,L.apply(null,arguments))}}},We="Promise resolved with itself",P=a("currentTaskTrace");function A(B,z,L){let U=we();if(B===L)throw new TypeError(We);if(B[E]===W){let H=null;try{(typeof L=="object"||typeof L=="function")&&(H=L&&L.then)}catch(ae){return U(()=>{A(B,!1,ae)})(),B}if(z!==pe&&L instanceof ie&&L.hasOwnProperty(E)&&L.hasOwnProperty(_)&&L[E]!==W)x(L),A(B,L[E],L[_]);else if(z!==pe&&typeof H=="function")try{H.call(L,U(ee(B,z)),U(ee(B,!1)))}catch(ae){U(()=>{A(B,!1,ae)})()}else{B[E]=z;let ae=B[_];if(B[_]=L,B[V]===V&&z===xe&&(B[E]=B[j],B[_]=B[M]),z===pe&&L instanceof Error){let K=t.currentTask&&t.currentTask.data&&t.currentTask.data[f];K&&i(L,P,{configurable:!0,enumerable:!1,writable:!0,value:K})}for(let K=0;K{try{let Ee=B[_],ue=!!L&&V===L[V];ue&&(L[M]=Ee,L[j]=ae);let Ce=z.run(K,void 0,ue&&K!==b&&K!==y?[]:[Ee]);A(L,!0,Ce)}catch(Ee){A(L,!1,Ee)}},L)}let I="function ZoneAwarePromise() { [native code] }",F=function(){},J=e.AggregateError;class ie{static toString(){return I}static resolve(z){return z instanceof ie?z:A(new this(null),xe,z)}static reject(z){return A(new this(null),pe,z)}static withResolvers(){let z={};return z.promise=new ie((L,U)=>{z.resolve=L,z.reject=U}),z}static any(z){if(!z||typeof z[Symbol.iterator]!="function")return Promise.reject(new J([],"All promises were rejected"));let L=[],U=0;try{for(let K of z)U++,L.push(ie.resolve(K))}catch{return Promise.reject(new J([],"All promises were rejected"))}if(U===0)return Promise.reject(new J([],"All promises were rejected"));let H=!1,ae=[];return new ie((K,Ee)=>{for(let ue=0;ue{H||(H=!0,K(Ce))},Ce=>{ae.push(Ce),U--,U===0&&(H=!0,Ee(new J(ae,"All promises were rejected")))})})}static race(z){let L,U,H=new this((Ee,ue)=>{L=Ee,U=ue});function ae(Ee){L(Ee)}function K(Ee){U(Ee)}for(let Ee of z)g(Ee)||(Ee=this.resolve(Ee)),Ee.then(ae,K);return H}static all(z){return ie.allWithCallback(z)}static allSettled(z){return(this&&this.prototype instanceof ie?this:ie).allWithCallback(z,{thenCallback:U=>({status:"fulfilled",value:U}),errorCallback:U=>({status:"rejected",reason:U})})}static allWithCallback(z,L){let U,H,ae=new this((Ce,Me)=>{U=Ce,H=Me}),K=2,Ee=0,ue=[];for(let Ce of z){g(Ce)||(Ce=this.resolve(Ce));let Me=Ee;try{Ce.then(Je=>{ue[Me]=L?L.thenCallback(Je):Je,K--,K===0&&U(ue)},Je=>{L?(ue[Me]=L.errorCallback(Je),K--,K===0&&U(ue)):H(Je)})}catch(Je){H(Je)}K++,Ee++}return K-=2,K===0&&U(ue),ae}constructor(z){let L=this;if(!(L instanceof ie))throw new Error("Must be an instanceof Promise.");L[E]=W,L[_]=[];try{let U=we();z&&z(U(ee(L,xe)),U(ee(L,pe)))}catch(U){A(L,!1,U)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return ie}then(z,L){let U=this.constructor?.[Symbol.species];(!U||typeof U!="function")&&(U=this.constructor||ie);let H=new U(F),ae=t.current;return this[E]==W?this[_].push(ae,H,z,L):C(this,ae,H,z,L),H}catch(z){return this.then(null,z)}finally(z){let L=this.constructor?.[Symbol.species];(!L||typeof L!="function")&&(L=ie);let U=new L(F);U[V]=V;let H=t.current;return this[E]==W?this[_].push(H,U,z,z):C(this,H,U,z,z),U}}ie.resolve=ie.resolve,ie.reject=ie.reject,ie.race=ie.race,ie.all=ie.all;let ve=e[d]=e.Promise;e.Promise=ie;let oe=a("thenPatched");function ke(B){let z=B.prototype,L=s(z,"then");if(L&&(L.writable===!1||!L.configurable))return;let U=z.then;z[p]=U,B.prototype.then=function(H,ae){return new ie((Ee,ue)=>{U.call(this,Ee,ue)}).then(H,ae)},B[oe]=!0}r.patchThen=ke;function se(B){return function(z,L){let U=B.apply(z,L);if(U instanceof ie)return U;let H=U.constructor;return H[oe]||ke(H),U}}return ve&&(ke(ve),ua(e,"fetch",B=>se(B))),Promise[t.__symbol__("uncaughtPromiseErrors")]=c,ie})}function vq(n){n.__load_patch("toString",e=>{let t=Function.prototype.toString,r=fn("OriginalDelegate"),s=fn("Promise"),i=fn("Error"),o=function(){if(typeof this=="function"){let d=this[r];if(d)return typeof d=="function"?t.call(d):Object.prototype.toString.call(d);if(this===Promise){let p=e[s];if(p)return t.call(p)}if(this===Error){let p=e[i];if(p)return t.call(p)}}return t.call(this)};o[r]=t,Function.prototype.toString=o;let a=Object.prototype.toString,c="[object Promise]";Object.prototype.toString=function(){return typeof Promise=="function"&&this instanceof Promise?c:a.call(this)}})}function yq(n,e,t,r,s){let i=Zone.__symbol__(r);if(e[i])return;let o=e[i]=e[r];e[r]=function(a,c,u){return c&&c.prototype&&s.forEach(function(d){let p=`${t}.${r}::`+d,f=c.prototype;try{if(f.hasOwnProperty(d)){let h=n.ObjectGetOwnPropertyDescriptor(f,d);h&&h.value?(h.value=n.wrapWithCurrentZone(h.value,p),n._redefineProperty(c.prototype,d,h)):f[d]&&(f[d]=n.wrapWithCurrentZone(f[d],p))}else f[d]&&(f[d]=n.wrapWithCurrentZone(f[d],p))}catch{}}),o.call(e,a,c,u)},n.attachOriginToPatched(e[r],o)}function bq(n){n.__load_patch("util",(e,t,r)=>{let s=nT(e);r.patchOnProperties=mP,r.patchMethod=ua,r.bindArguments=cT,r.patchMacroTask=iq;let i=t.__symbol__("BLACK_LISTED_EVENTS"),o=t.__symbol__("UNPATCHED_EVENTS");e[o]&&(e[i]=e[o]),e[i]&&(t[i]=t[o]=e[i]),r.patchEventPrototype=cq,r.patchEventTarget=lq,r.isIEOrEdge=oq,r.ObjectDefineProperty=rT,r.ObjectGetOwnPropertyDescriptor=lg,r.ObjectCreate=eq,r.ArraySlice=tq,r.patchClass=ag,r.wrapWithCurrentZone=aT,r.filterProperties=EP,r.attachOriginToPatched=da,r._redefineProperty=Object.defineProperty,r.patchCallbacks=yq,r.getGlobalObjects=()=>({globalSources:gP,zoneSymbolEventNames:ai,eventNames:s,isBrowser:uT,isMix:hP,isNode:n0,TRUE_STR:la,FALSE_STR:ca,ZONE_SYMBOL_PREFIX:cg,ADD_EVENT_LISTENER_STR:iT,REMOVE_EVENT_LISTENER_STR:oT})})}function wq(n){gq(n),vq(n),bq(n)}var xP=J9();wq(xP);mq(xP);var SP=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g"),Cp=class n{constructor(){l(this,"element",null);l(this,"classNames",[]);l(this,"attrs",[]);l(this,"notSelectors",[])}static parse(e){let t=[],r=(c,u)=>{u.notSelectors.length>0&&!u.element&&u.classNames.length==0&&u.attrs.length==0&&(u.element="*"),c.push(u)},s=new n,i,o=s,a=!1;for(SP.lastIndex=0;i=SP.exec(e);){if(i[1]){if(a)throw new Error("Nesting :not in a selector is not allowed");a=!0,o=new n,s.notSelectors.push(o)}let c=i[2];if(c){let d=i[3];d==="#"?o.addAttribute("id",c.slice(1)):d==="."?o.addClassName(c.slice(1)):o.setElement(c)}let u=i[4];if(u&&o.addAttribute(o.unescapeAttribute(u),i[6]),i[7]&&(a=!1,o=s),i[8]){if(a)throw new Error("Multiple selectors in :not are not supported");r(t,s),s=o=new n}}return r(t,s),t}unescapeAttribute(e){let t="",r=!1;for(let s=0;s0&&e.push("class",this.classNames.join(" ")),e.concat(this.attrs)}addAttribute(e,t=""){this.attrs.push(e,t&&t.toLowerCase()||"")}addClassName(e){this.classNames.push(e.toLowerCase())}toString(){let e=this.element||"";if(this.classNames&&this.classNames.forEach(t=>e+=`.${t}`),this.attrs)for(let t=0;te+=`:not(${t})`),e}},m0=class n{constructor(){l(this,"_elementMap",new Map);l(this,"_elementPartialMap",new Map);l(this,"_classMap",new Map);l(this,"_classPartialMap",new Map);l(this,"_attrValueMap",new Map);l(this,"_attrValuePartialMap",new Map);l(this,"_listContexts",[])}static createNotMatcher(e){let t=new n;return t.addSelectables(e,null),t}addSelectables(e,t){let r=null;e.length>1&&(r=new RT(e),this._listContexts.push(r));for(let s=0;s0&&(!this.listContext||!this.listContext.alreadyMatched)&&(r=!m0.createNotMatcher(this.notSelectors).match(e,null)),r&&t&&(!this.listContext||!this.listContext.alreadyMatched)&&(this.listContext&&(this.listContext.alreadyMatched=!0),t(this.selector,this.cbContext)),r}},Vt;(function(n){n[n.NONE=0]="NONE",n[n.HTML=1]="HTML",n[n.STYLE=2]="STYLE",n[n.SCRIPT=3]="SCRIPT",n[n.URL=4]="URL",n[n.RESOURCE_URL=5]="RESOURCE_URL",n[n.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING"})(Vt||(Vt={}));var p0,CP="svg",Eq="math";function xq(){return p0||(p0={},cl(Vt.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),cl(Vt.STYLE,void 0,[["*",["style"]]]),cl(Vt.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),cl(Vt.URL,Eq,[["annotation",["href","xlink:href"]],["annotation-xml",["href","xlink:href"]],["maction",["href","xlink:href"]],["malignmark",["href","xlink:href"]],["math",["href","xlink:href"]],["mroot",["href","xlink:href"]],["msqrt",["href","xlink:href"]],["merror",["href","xlink:href"]],["mfrac",["href","xlink:href"]],["mglyph",["href","xlink:href"]],["msub",["href","xlink:href"]],["msup",["href","xlink:href"]],["msubsup",["href","xlink:href"]],["mmultiscripts",["href","xlink:href"]],["mprescripts",["href","xlink:href"]],["mi",["href","xlink:href"]],["mn",["href","xlink:href"]],["mo",["href","xlink:href"]],["mpadded",["href","xlink:href"]],["mphantom",["href","xlink:href"]],["mrow",["href","xlink:href"]],["ms",["href","xlink:href"]],["mspace",["href","xlink:href"]],["mstyle",["href","xlink:href"]],["mtable",["href","xlink:href"]],["mtd",["href","xlink:href"]],["mtr",["href","xlink:href"]],["mtext",["href","xlink:href"]],["mover",["href","xlink:href"]],["munder",["href","xlink:href"]],["munderover",["href","xlink:href"]],["semantics",["href","xlink:href"]],["none",["href","xlink:href"]]]),cl(Vt.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),cl(Vt.URL,CP,[["a",["href","xlink:href"]]]),cl(Vt.ATTRIBUTE_NO_BINDING,CP,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),cl(Vt.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]]])),p0}function cl(n,e,t){for(let[r,s]of t){let i=e&&r!=="*"&&r!=="unknown"?`:${e}:${r}`:r;i=i.toLowerCase();for(let o of s)p0[`${i}|${o.toLowerCase()}`]=n}}var gl;(function(n){n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom"})(gl||(gl={}));var g0;(function(n){n[n.OnPush=0]="OnPush",n[n.Default=1]="Default"})(g0||(g0={}));var fp;(function(n){n[n.None=0]="None",n[n.SignalBased=1]="SignalBased",n[n.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(fp||(fp={}));var TP={name:"custom-elements"},DP={name:"no-errors-schema"};var IP;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Ignore=2]="Ignore"})(IP||(IP={}));function Sq(n){let e=n.classNames&&n.classNames.length?[8,...n.classNames]:[];return[n.element&&n.element!=="*"?n.element:"",...n.attrs,...e]}function Cq(n){let e=n.classNames&&n.classNames.length?[8,...n.classNames]:[];return n.element?[5,n.element,...n.attrs,...e]:n.attrs.length?[3,...n.attrs,...e]:n.classNames&&n.classNames.length?[9,...n.classNames]:[]}function Tq(n){let e=Sq(n),t=n.notSelectors&&n.notSelectors.length?n.notSelectors.map(r=>Cq(r)):[];return e.concat(...t)}function sI(n){return n?Cp.parse(n).map(Tq):[]}var So;(function(n){n[n.Directive=0]="Directive",n[n.Component=1]="Component",n[n.Injectable=2]="Injectable",n[n.Pipe=3]="Pipe",n[n.NgModule=4]="NgModule"})(So||(So={}));var _P;(function(n){n[n.Directive=0]="Directive",n[n.Pipe=1]="Pipe",n[n.NgModule=2]="NgModule"})(_P||(_P={}));var kP;(function(n){n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom"})(kP||(kP={}));var v0;function Dq(n){return Aq(kq(n.nodes).join("")+`[${n.meaning}]`)}function Iq(n){return n.id||lF(n)}function lF(n){let e=new LT,t=n.nodes.map(r=>r.visit(e,null));return cF(t.join(""),n.meaning)}var y0=class{visitText(e,t){return e.value}visitContainer(e,t){return`[${e.children.map(r=>r.visit(this)).join(", ")}]`}visitIcu(e,t){let r=Object.keys(e.cases).map(s=>`${s} {${e.cases[s].visit(this)}}`);return`{${e.expression}, ${e.type}, ${r.join(", ")}}`}visitTagPlaceholder(e,t){return e.isVoid?``:`${e.children.map(r=>r.visit(this)).join(", ")}`}visitPlaceholder(e,t){return e.value?`${e.value}`:``}visitIcuPlaceholder(e,t){return`${e.value.visit(this)}`}visitBlockPlaceholder(e,t){return`${e.children.map(r=>r.visit(this)).join(", ")}`}},_q=new y0;function kq(n){return n.map(e=>e.visit(_q,null))}var LT=class extends y0{visitIcu(e){let t=Object.keys(e.cases).map(r=>`${r} {${e.cases[r].visit(this)}}`);return`{${e.type}, ${t.join(", ")}}`}};function Aq(n){v0??(v0=new TextEncoder);let e=[...v0.encode(n)],t=Pq(e,b0.Big),r=e.length*8,s=new Uint32Array(80),i=1732584193,o=4023233417,a=2562383102,c=271733878,u=3285377520;t[r>>5]|=128<<24-r%32,t[(r+64>>9<<4)+15]=r;for(let d=0;d>>0).toString(16).padStart(8,"0")}function Mq(n,e,t,r){return n<20?[e&t|~e&r,1518500249]:n<40?[e^t^r,1859775393]:n<60?[e&t|e&r|t&r,2400959708]:[e^t^r,3395469782]}function AP(n){v0??(v0=new TextEncoder);let e=v0.encode(n),t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=MP(t,e.length,0),s=MP(t,e.length,102072);return r==0&&(s==0||s==1)&&(r=r^319790063,s=s^-1801410264),BigInt.asUintN(32,BigInt(r))<>BigInt(63)&BigInt(1),t+=AP(e)),BigInt.asUintN(63,t).toString()}function MP(n,e,t){let r=2654435769,s=2654435769,i=0,o=e-12;for(;i<=o;i+=12){r+=n.getUint32(i,!0),s+=n.getUint32(i+4,!0),t+=n.getUint32(i+8,!0);let c=NP(r,s,t);r=c[0],s=c[1],t=c[2]}let a=e-i;return t+=e,a>=4?(r+=n.getUint32(i,!0),i+=4,a>=8?(s+=n.getUint32(i,!0),i+=4,a>=9&&(t+=n.getUint8(i++)<<8),a>=10&&(t+=n.getUint8(i++)<<16),a===11&&(t+=n.getUint8(i++)<<24)):(a>=5&&(s+=n.getUint8(i++)),a>=6&&(s+=n.getUint8(i++)<<8),a===7&&(s+=n.getUint8(i++)<<16))):(a>=1&&(r+=n.getUint8(i++)),a>=2&&(r+=n.getUint8(i++)<<8),a===3&&(r+=n.getUint8(i++)<<16)),NP(r,s,t)[2]}function NP(n,e,t){return n-=e,n-=t,n^=t>>>13,e-=t,e-=n,e^=n<<8,t-=n,t-=e,t^=e>>>13,n-=e,n-=t,n^=t>>>12,e-=t,e-=n,e^=n<<16,t-=n,t-=e,t^=e>>>5,n-=e,n-=t,n^=t>>>3,e-=t,e-=n,e^=n<<10,t-=n,t-=e,t^=e>>>15,[n,e,t]}var b0;(function(n){n[n.Little=0]="Little",n[n.Big=1]="Big"})(b0||(b0={}));function ip(n,e){return Nq(n,e)[1]}function Nq(n,e){let t=(n&65535)+(e&65535),r=(n>>>16)+(e>>>16)+(t>>>16);return[r>>>16,r<<16|t&65535]}function dT(n,e){return n<>>32-e}function Pq(n,e){let t=n.length+3>>>2,r=[];for(let s=0;s=n.length?0:n[e]}function Rq(n,e,t){let r=0;if(t===b0.Big)for(let s=0;s<4;s++)r+=PP(n,e+s)<<24-8*s;else for(let s=0;s<4;s++)r+=PP(n,e+s)<<8*s;return r}var OT;(function(n){n[n.None=0]="None",n[n.Const=1]="Const"})(OT||(OT={}));var w0=class{constructor(e=OT.None){l(this,"modifiers");this.modifiers=e}hasModifier(e){return(this.modifiers&e)!==0}},Do;(function(n){n[n.Dynamic=0]="Dynamic",n[n.Bool=1]="Bool",n[n.String=2]="String",n[n.Int=3]="Int",n[n.Number=4]="Number",n[n.Function=5]="Function",n[n.Inferred=6]="Inferred",n[n.None=7]="None"})(Do||(Do={}));var Io=class extends w0{constructor(t,r){super(r);l(this,"name");this.name=t}visitType(t,r){return t.visitBuiltinType(this,r)}},gi=class extends w0{constructor(t,r,s=null){super(r);l(this,"value");l(this,"typeParams");this.value=t,this.typeParams=s}visitType(t,r){return t.visitExpressionType(this,r)}};var yv=new Io(Do.Dynamic),hi=new Io(Do.Inferred),Fq=new Io(Do.Bool),Zfe=new Io(Do.Int),iI=new Io(Do.Number),oI=new Io(Do.String),Yfe=new Io(Do.Function),_o=new Io(Do.None),Tp;(function(n){n[n.Minus=0]="Minus",n[n.Plus=1]="Plus"})(Tp||(Tp={}));var Ge;(function(n){n[n.Equals=0]="Equals",n[n.NotEquals=1]="NotEquals",n[n.Identical=2]="Identical",n[n.NotIdentical=3]="NotIdentical",n[n.Minus=4]="Minus",n[n.Plus=5]="Plus",n[n.Divide=6]="Divide",n[n.Multiply=7]="Multiply",n[n.Modulo=8]="Modulo",n[n.And=9]="And",n[n.Or=10]="Or",n[n.BitwiseOr=11]="BitwiseOr",n[n.BitwiseAnd=12]="BitwiseAnd",n[n.Lower=13]="Lower",n[n.LowerEquals=14]="LowerEquals",n[n.Bigger=15]="Bigger",n[n.BiggerEquals=16]="BiggerEquals",n[n.NullishCoalesce=17]="NullishCoalesce"})(Ge||(Ge={}));function Lq(n,e){return n==null||e==null?n==e:n.isEquivalent(e)}function uF(n,e,t){let r=n.length;if(r!==e.length)return!1;for(let s=0;st.isEquivalent(r))}var sn=class{constructor(e,t){l(this,"type");l(this,"sourceSpan");this.type=e||null,this.sourceSpan=t||null}prop(e,t){return new zs(this,e,null,t)}key(e,t,r){return new xa(this,e,t,r)}callFn(e,t,r){return new Cs(this,e,null,t,r)}instantiate(e,t,r){return new Mg(this,e,t,r)}conditional(e,t=null,r){return new Ea(this,e,t,null,r)}equals(e,t){return new Xt(Ge.Equals,this,e,null,t)}notEquals(e,t){return new Xt(Ge.NotEquals,this,e,null,t)}identical(e,t){return new Xt(Ge.Identical,this,e,null,t)}notIdentical(e,t){return new Xt(Ge.NotIdentical,this,e,null,t)}minus(e,t){return new Xt(Ge.Minus,this,e,null,t)}plus(e,t){return new Xt(Ge.Plus,this,e,null,t)}divide(e,t){return new Xt(Ge.Divide,this,e,null,t)}multiply(e,t){return new Xt(Ge.Multiply,this,e,null,t)}modulo(e,t){return new Xt(Ge.Modulo,this,e,null,t)}and(e,t){return new Xt(Ge.And,this,e,null,t)}bitwiseOr(e,t,r=!0){return new Xt(Ge.BitwiseOr,this,e,null,t,r)}bitwiseAnd(e,t,r=!0){return new Xt(Ge.BitwiseAnd,this,e,null,t,r)}or(e,t){return new Xt(Ge.Or,this,e,null,t)}lower(e,t){return new Xt(Ge.Lower,this,e,null,t)}lowerEquals(e,t){return new Xt(Ge.LowerEquals,this,e,null,t)}bigger(e,t){return new Xt(Ge.Bigger,this,e,null,t)}biggerEquals(e,t){return new Xt(Ge.BiggerEquals,this,e,null,t)}isBlank(e){return this.equals(Hq,e)}nullishCoalesce(e,t){return new Xt(Ge.NullishCoalesce,this,e,null,t)}toStmt(){return new bi(this,null)}},yi=class n extends sn{constructor(t,r,s){super(r,s);l(this,"name");this.name=t}isEquivalent(t){return t instanceof n&&this.name===t.name}isConstant(){return!1}visitExpression(t,r){return t.visitReadVarExpr(this,r)}clone(){return new n(this.name,this.type,this.sourceSpan)}set(t){return new E0(this.name,t,null,this.sourceSpan)}},Dp=class n extends sn{constructor(t,r,s){super(r,s);l(this,"expr");this.expr=t}visitExpression(t,r){return t.visitTypeofExpr(this,r)}isEquivalent(t){return t instanceof n&&t.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr.clone())}},Ft=class n extends sn{constructor(t,r,s){super(r,s);l(this,"node");this.node=t}isEquivalent(t){return t instanceof n&&this.node===t.node}isConstant(){return!1}visitExpression(t,r){return t.visitWrappedNodeExpr(this,r)}clone(){return new n(this.node,this.type,this.sourceSpan)}},E0=class n extends sn{constructor(t,r,s,i){super(s||r.type,i);l(this,"name");l(this,"value");this.name=t,this.value=r}isEquivalent(t){return t instanceof n&&this.name===t.name&&this.value.isEquivalent(t.value)}isConstant(){return!1}visitExpression(t,r){return t.visitWriteVarExpr(this,r)}clone(){return new n(this.name,this.value.clone(),this.type,this.sourceSpan)}toDeclStmt(t,r){return new Jr(this.name,this.value,t,r,this.sourceSpan)}toConstDecl(){return this.toDeclStmt(hi,_r.Final)}},Ag=class n extends sn{constructor(t,r,s,i,o){super(i||s.type,o);l(this,"receiver");l(this,"index");l(this,"value");this.receiver=t,this.index=r,this.value=s}isEquivalent(t){return t instanceof n&&this.receiver.isEquivalent(t.receiver)&&this.index.isEquivalent(t.index)&&this.value.isEquivalent(t.value)}isConstant(){return!1}visitExpression(t,r){return t.visitWriteKeyExpr(this,r)}clone(){return new n(this.receiver.clone(),this.index.clone(),this.value.clone(),this.type,this.sourceSpan)}},Ip=class n extends sn{constructor(t,r,s,i,o){super(i||s.type,o);l(this,"receiver");l(this,"name");l(this,"value");this.receiver=t,this.name=r,this.value=s}isEquivalent(t){return t instanceof n&&this.receiver.isEquivalent(t.receiver)&&this.name===t.name&&this.value.isEquivalent(t.value)}isConstant(){return!1}visitExpression(t,r){return t.visitWritePropExpr(this,r)}clone(){return new n(this.receiver.clone(),this.name,this.value.clone(),this.type,this.sourceSpan)}},Cs=class n extends sn{constructor(t,r,s,i,o=!1){super(s,i);l(this,"fn");l(this,"args");l(this,"pure");this.fn=t,this.args=r,this.pure=o}get receiver(){return this.fn}isEquivalent(t){return t instanceof n&&this.fn.isEquivalent(t.fn)&&Ws(this.args,t.args)&&this.pure===t.pure}isConstant(){return!1}visitExpression(t,r){return t.visitInvokeFunctionExpr(this,r)}clone(){return new n(this.fn.clone(),this.args.map(t=>t.clone()),this.type,this.sourceSpan,this.pure)}},x0=class n extends sn{constructor(t,r,s,i){super(s,i);l(this,"tag");l(this,"template");this.tag=t,this.template=r}isEquivalent(t){return t instanceof n&&this.tag.isEquivalent(t.tag)&&this.template.isEquivalent(t.template)}isConstant(){return!1}visitExpression(t,r){return t.visitTaggedTemplateLiteralExpr(this,r)}clone(){return new n(this.tag.clone(),this.template.clone(),this.type,this.sourceSpan)}},Mg=class n extends sn{constructor(t,r,s,i){super(s,i);l(this,"classExpr");l(this,"args");this.classExpr=t,this.args=r}isEquivalent(t){return t instanceof n&&this.classExpr.isEquivalent(t.classExpr)&&Ws(this.args,t.args)}isConstant(){return!1}visitExpression(t,r){return t.visitInstantiateExpr(this,r)}clone(){return new n(this.classExpr.clone(),this.args.map(t=>t.clone()),this.type,this.sourceSpan)}},Hr=class n extends sn{constructor(t,r,s){super(r,s);l(this,"value");this.value=t}isEquivalent(t){return t instanceof n&&this.value===t.value}isConstant(){return!0}visitExpression(t,r){return t.visitLiteralExpr(this,r)}clone(){return new n(this.value,this.type,this.sourceSpan)}},Ng=class n extends sn{constructor(t,r,s){super(null,s);l(this,"elements");l(this,"expressions");this.elements=t,this.expressions=r}isEquivalent(t){return t instanceof n&&uF(this.elements,t.elements,(r,s)=>r.text===s.text)&&Ws(this.expressions,t.expressions)}isConstant(){return!1}visitExpression(t,r){return t.visitTemplateLiteralExpr(this,r)}clone(){return new n(this.elements.map(t=>t.clone()),this.expressions.map(t=>t.clone()))}},S0=class n extends sn{constructor(t,r,s){super(oI,r);l(this,"text");l(this,"rawText");this.text=t,this.rawText=s??BT(f0(t))}visitExpression(t,r){return t.visitTemplateLiteralElementExpr(this,r)}isEquivalent(t){return t instanceof n&&t.text===this.text&&t.rawText===this.rawText}isConstant(){return!0}clone(){return new n(this.text,this.sourceSpan,this.rawText)}},kc=class{constructor(e,t){l(this,"text");l(this,"sourceSpan");this.text=e,this.sourceSpan=t}},wp=class{constructor(e,t,r){l(this,"text");l(this,"sourceSpan");l(this,"associatedMessage");this.text=e,this.sourceSpan=t,this.associatedMessage=r}},Oq="|",RP="@@",Bq="\u241F",C0=class n extends sn{constructor(t,r,s,i,o){super(oI,o);l(this,"metaBlock");l(this,"messageParts");l(this,"placeHolderNames");l(this,"expressions");this.metaBlock=t,this.messageParts=r,this.placeHolderNames=s,this.expressions=i}isEquivalent(t){return!1}isConstant(){return!1}visitExpression(t,r){return t.visitLocalizedString(this,r)}clone(){return new n(this.metaBlock,this.messageParts,this.placeHolderNames,this.expressions.map(t=>t.clone()),this.sourceSpan)}serializeI18nHead(){let t=this.metaBlock.description||"";return this.metaBlock.meaning&&(t=`${this.metaBlock.meaning}${Oq}${t}`),this.metaBlock.customId&&(t=`${t}${RP}${this.metaBlock.customId}`),this.metaBlock.legacyIds&&this.metaBlock.legacyIds.forEach(r=>{t=`${t}${Bq}${r}`}),FP(t,this.messageParts[0].text,this.getMessagePartSourceSpan(0))}getMessagePartSourceSpan(t){return this.messageParts[t]?.sourceSpan??this.sourceSpan}getPlaceholderSourceSpan(t){return this.placeHolderNames[t]?.sourceSpan??this.expressions[t]?.sourceSpan??this.sourceSpan}serializeI18nTemplatePart(t){let r=this.placeHolderNames[t-1],s=this.messageParts[t],i=r.text;return r.associatedMessage?.legacyIds.length===0&&(i+=`${RP}${cF(r.associatedMessage.messageString,r.associatedMessage.meaning)}`),FP(i,s.text,this.getMessagePartSourceSpan(t))}},f0=n=>n.replace(/\\/g,"\\\\"),Vq=n=>n.replace(/^:/,"\\:"),$q=n=>n.replace(/:/g,"\\:"),BT=n=>n.replace(/`/g,"\\`").replace(/\${/g,"$\\{");function FP(n,e,t){return n===""?{cooked:e,raw:BT(Vq(f0(e))),range:t}:{cooked:`:${n}:${e}`,raw:BT(`:${$q(f0(n))}:${f0(e)}`),range:t}}var Fc=class n extends sn{constructor(t,r,s=null,i){super(r,i);l(this,"value");l(this,"typeParams");this.value=t,this.typeParams=s}isEquivalent(t){return t instanceof n&&this.value.name===t.value.name&&this.value.moduleName===t.value.moduleName}isConstant(){return!1}visitExpression(t,r){return t.visitExternalExpr(this,r)}clone(){return new n(this.value,this.type,this.typeParams,this.sourceSpan)}};var Ea=class n extends sn{constructor(t,r,s=null,i,o){super(i||r.type,o);l(this,"condition");l(this,"falseCase");l(this,"trueCase");this.condition=t,this.falseCase=s,this.trueCase=r}isEquivalent(t){return t instanceof n&&this.condition.isEquivalent(t.condition)&&this.trueCase.isEquivalent(t.trueCase)&&Lq(this.falseCase,t.falseCase)}isConstant(){return!1}visitExpression(t,r){return t.visitConditionalExpr(this,r)}clone(){return new n(this.condition.clone(),this.trueCase.clone(),this.falseCase?.clone(),this.type,this.sourceSpan)}};var Pg=class n extends sn{constructor(t,r){super(Fq,r);l(this,"condition");this.condition=t}isEquivalent(t){return t instanceof n&&this.condition.isEquivalent(t.condition)}isConstant(){return!1}visitExpression(t,r){return t.visitNotExpr(this,r)}clone(){return new n(this.condition.clone(),this.sourceSpan)}},kr=class n{constructor(e,t=null){l(this,"name");l(this,"type");this.name=e,this.type=t}isEquivalent(e){return this.name===e.name}clone(){return new n(this.name,this.type)}},wl=class n extends sn{constructor(t,r,s,i,o){super(s,i);l(this,"params");l(this,"statements");l(this,"name");this.params=t,this.statements=r,this.name=o}isEquivalent(t){return(t instanceof n||t instanceof Fg)&&Ws(this.params,t.params)&&Ws(this.statements,t.statements)}isConstant(){return!1}visitExpression(t,r){return t.visitFunctionExpr(this,r)}toDeclStmt(t,r){return new Fg(t,this.params,this.statements,this.type,r,this.sourceSpan)}clone(){return new n(this.params.map(t=>t.clone()),this.statements,this.type,this.sourceSpan,this.name)}},Lc=class n extends sn{constructor(t,r,s,i){super(s,i);l(this,"params");l(this,"body");this.params=t,this.body=r}isEquivalent(t){return!(t instanceof n)||!Ws(this.params,t.params)?!1:this.body instanceof sn&&t.body instanceof sn?this.body.isEquivalent(t.body):Array.isArray(this.body)&&Array.isArray(t.body)?Ws(this.body,t.body):!1}isConstant(){return!1}visitExpression(t,r){return t.visitArrowFunctionExpr(this,r)}clone(){return new n(this.params.map(t=>t.clone()),Array.isArray(this.body)?this.body:this.body.clone(),this.type,this.sourceSpan)}toDeclStmt(t,r){return new Jr(t,this,hi,r,this.sourceSpan)}},_p=class n extends sn{constructor(t,r,s,i,o=!0){super(s||iI,i);l(this,"operator");l(this,"expr");l(this,"parens");this.operator=t,this.expr=r,this.parens=o}isEquivalent(t){return t instanceof n&&this.operator===t.operator&&this.expr.isEquivalent(t.expr)}isConstant(){return!1}visitExpression(t,r){return t.visitUnaryOperatorExpr(this,r)}clone(){return new n(this.operator,this.expr.clone(),this.type,this.sourceSpan,this.parens)}},Xt=class n extends sn{constructor(t,r,s,i,o,a=!0){super(i||r.type,o);l(this,"operator");l(this,"rhs");l(this,"parens");l(this,"lhs");this.operator=t,this.rhs=s,this.parens=a,this.lhs=r}isEquivalent(t){return t instanceof n&&this.operator===t.operator&&this.lhs.isEquivalent(t.lhs)&&this.rhs.isEquivalent(t.rhs)}isConstant(){return!1}visitExpression(t,r){return t.visitBinaryOperatorExpr(this,r)}clone(){return new n(this.operator,this.lhs.clone(),this.rhs.clone(),this.type,this.sourceSpan,this.parens)}},zs=class n extends sn{constructor(t,r,s,i){super(s,i);l(this,"receiver");l(this,"name");this.receiver=t,this.name=r}get index(){return this.name}isEquivalent(t){return t instanceof n&&this.receiver.isEquivalent(t.receiver)&&this.name===t.name}isConstant(){return!1}visitExpression(t,r){return t.visitReadPropExpr(this,r)}set(t){return new Ip(this.receiver,this.name,t,null,this.sourceSpan)}clone(){return new n(this.receiver.clone(),this.name,this.type,this.sourceSpan)}},xa=class n extends sn{constructor(t,r,s,i){super(s,i);l(this,"receiver");l(this,"index");this.receiver=t,this.index=r}isEquivalent(t){return t instanceof n&&this.receiver.isEquivalent(t.receiver)&&this.index.isEquivalent(t.index)}isConstant(){return!1}visitExpression(t,r){return t.visitReadKeyExpr(this,r)}set(t){return new Ag(this.receiver,this.index,t,null,this.sourceSpan)}clone(){return new n(this.receiver.clone(),this.index.clone(),this.type,this.sourceSpan)}},Hi=class n extends sn{constructor(t,r,s){super(r,s);l(this,"entries");this.entries=t}isConstant(){return this.entries.every(t=>t.isConstant())}isEquivalent(t){return t instanceof n&&Ws(this.entries,t.entries)}visitExpression(t,r){return t.visitLiteralArrayExpr(this,r)}clone(){return new n(this.entries.map(t=>t.clone()),this.type,this.sourceSpan)}},kp=class n{constructor(e,t,r){l(this,"key");l(this,"value");l(this,"quoted");this.key=e,this.value=t,this.quoted=r}isEquivalent(e){return this.key===e.key&&this.value.isEquivalent(e.value)}clone(){return new n(this.key,this.value.clone(),this.quoted)}},ko=class n extends sn{constructor(t,r,s){super(r,s);l(this,"entries");l(this,"valueType",null);this.entries=t,r&&(this.valueType=r.valueType)}isEquivalent(t){return t instanceof n&&Ws(this.entries,t.entries)}isConstant(){return this.entries.every(t=>t.value.isConstant())}visitExpression(t,r){return t.visitLiteralMapExpr(this,r)}clone(){let t=this.entries.map(r=>r.clone());return new n(t,this.type,this.sourceSpan)}};var Rg=new Hr(null,null,null),Hq=new Hr(null,hi,null),_r;(function(n){n[n.None=0]="None",n[n.Final=1]="Final",n[n.Private=2]="Private",n[n.Exported=4]="Exported",n[n.Static=8]="Static"})(_r||(_r={}));var VT=class{constructor(e,t,r){l(this,"text");l(this,"multiline");l(this,"trailingNewline");this.text=e,this.multiline=t,this.trailingNewline=r}toString(){return this.multiline?` ${this.text} `:this.text}},T0=class extends VT{constructor(t){super("",!0,!0);l(this,"tags");this.tags=t}toString(){return zq(this.tags)}},Oc=class{constructor(e=_r.None,t=null,r){l(this,"modifiers");l(this,"sourceSpan");l(this,"leadingComments");this.modifiers=e,this.sourceSpan=t,this.leadingComments=r}hasModifier(e){return(this.modifiers&e)!==0}addLeadingComment(e){this.leadingComments=this.leadingComments??[],this.leadingComments.push(e)}},Jr=class n extends Oc{constructor(t,r,s,i,o,a){super(i,o,a);l(this,"name");l(this,"value");l(this,"type");this.name=t,this.value=r,this.type=s||r&&r.type||null}isEquivalent(t){return t instanceof n&&this.name===t.name&&(this.value?!!t.value&&this.value.isEquivalent(t.value):!t.value)}visitStatement(t,r){return t.visitDeclareVarStmt(this,r)}},Fg=class n extends Oc{constructor(t,r,s,i,o,a,c){super(o,a,c);l(this,"name");l(this,"params");l(this,"statements");l(this,"type");this.name=t,this.params=r,this.statements=s,this.type=i||null}isEquivalent(t){return t instanceof n&&Ws(this.params,t.params)&&Ws(this.statements,t.statements)}visitStatement(t,r){return t.visitDeclareFunctionStmt(this,r)}},bi=class n extends Oc{constructor(t,r,s){super(_r.None,r,s);l(this,"expr");this.expr=t}isEquivalent(t){return t instanceof n&&this.expr.isEquivalent(t.expr)}visitStatement(t,r){return t.visitExpressionStmt(this,r)}},Qr=class n extends Oc{constructor(t,r=null,s){super(_r.None,r,s);l(this,"value");this.value=t}isEquivalent(t){return t instanceof n&&this.value.isEquivalent(t.value)}visitStatement(t,r){return t.visitReturnStmt(this,r)}},D0=class n extends Oc{constructor(t,r,s=[],i,o){super(_r.None,i,o);l(this,"condition");l(this,"trueCase");l(this,"falseCase");this.condition=t,this.trueCase=r,this.falseCase=s}isEquivalent(t){return t instanceof n&&this.condition.isEquivalent(t.condition)&&Ws(this.trueCase,t.trueCase)&&Ws(this.falseCase,t.falseCase)}visitStatement(t,r){return t.visitIfStmt(this,r)}};function jq(n=[]){return new T0(n)}function kt(n,e,t){return new yi(n,e,t)}function Ze(n,e=null,t){return new Fc(n,null,e,t)}function $r(n,e,t){return new gi(n,e,t)}function bv(n){return new Dp(n)}function tn(n,e,t){return new Hi(n,e,t)}function cs(n,e=null){return new ko(n.map(t=>new kp(t.key,t.value,t.quoted)),e,null)}function Uq(n,e){return new Pg(n,e)}function xl(n,e,t,r,s){return new wl(n,e,t,r,s)}function ji(n,e,t,r){return new Lc(n,e,t,r)}function Lw(n,e,t,r,s){return new D0(n,e,t,r,s)}function qq(n,e,t,r){return new x0(n,e,t,r)}function Y(n,e,t){return new Hr(n,e,t)}function Wq(n,e,t,r,s){return new C0(n,e,t,r,s)}function LP(n){let e="";if(n.tagName&&(e+=` @${n.tagName}`),n.text){if(n.text.match(/\/\*|\*\//))throw new Error('JSDoc text cannot contain "/*" and "*/"');e+=" "+n.text.replace(/@/g,"\\@")}return e}function zq(n){if(n.length===0)return"";if(n.length===1&&n[0].tagName&&!n[0].text)return`*${LP(n[0])} `;let e=`* +`;for(let t of n)e+=" *",e+=LP(t).replace(/\n/g,` + * `),e+=` +`;return e+=" ",e}var Gq="_c",OP=kt(""),Zq={},Yq=50,I0=class n extends sn{constructor(t){super(t.type);l(this,"resolved");l(this,"original");l(this,"shared",!1);this.resolved=t,this.original=t}visitExpression(t,r){return r===Zq?this.original.visitExpression(t,r):this.resolved.visitExpression(t,r)}isEquivalent(t){return t instanceof n&&this.resolved.isEquivalent(t.resolved)}isConstant(){return!0}clone(){throw new Error("Not supported.")}fixup(t){this.resolved=t,this.shared=!0}},_0=class{constructor(e=!1){l(this,"isClosureCompilerEnabled");l(this,"statements",[]);l(this,"literals",new Map);l(this,"literalFactories",new Map);l(this,"sharedConstants",new Map);l(this,"_claimedNames",new Map);l(this,"nextNameIndex",0);this.isClosureCompilerEnabled=e}getConstLiteral(e,t){if(e instanceof Hr&&!BP(e)||e instanceof I0)return e;let r=Ep.INSTANCE.keyOf(e),s=this.literals.get(r),i=!1;if(s||(s=new I0(e),this.literals.set(r,s),i=!0),!i&&!s.shared||i&&t){let o=this.freshName(),a,c;this.isClosureCompilerEnabled&&BP(e)?(a=kt(o).set(new wl([],[new Qr(e)])),c=kt(o).callFn([])):(a=kt(o).set(e),c=kt(o)),this.statements.push(a.toDeclStmt(hi,_r.Final)),s.fixup(c)}return s}getSharedConstant(e,t){let r=e.keyOf(t);if(!this.sharedConstants.has(r)){let s=this.freshName();this.sharedConstants.set(r,kt(s)),this.statements.push(e.toSharedConstantDeclaration(s,t))}return this.sharedConstants.get(r)}getLiteralFactory(e){if(e instanceof Hi){let t=e.entries.map(s=>s.isConstant()?s:OP),r=Ep.INSTANCE.keyOf(tn(t));return this._getLiteralFactory(r,e.entries,s=>tn(s))}else{let t=cs(e.entries.map(s=>({key:s.key,value:s.value.isConstant()?s.value:OP,quoted:s.quoted}))),r=Ep.INSTANCE.keyOf(t);return this._getLiteralFactory(r,e.entries.map(s=>s.value),s=>cs(s.map((i,o)=>({key:e.entries[o].key,value:i,quoted:e.entries[o].quoted}))))}}getSharedFunctionReference(e,t,r=!0){let s=e instanceof Lc;for(let o of this.statements)if(s&&o instanceof Jr&&o.value?.isEquivalent(e)||!s&&o instanceof Fg&&e instanceof wl&&e.isEquivalent(o))return kt(o.name);let i=r?this.uniqueName(t):t;return this.statements.push(e instanceof wl?e.toDeclStmt(i,_r.Final):new Jr(i,e,hi,_r.Final,e.sourceSpan)),kt(i)}_getLiteralFactory(e,t,r){let s=this.literalFactories.get(e),i=t.filter(o=>!o.isConstant());if(!s){let o=t.map((d,p)=>d.isConstant()?this.getConstLiteral(d,!0):kt(`a${p}`)),a=o.filter(Xq).map(d=>new kr(d.name,yv)),c=ji(a,r(o),hi),u=this.freshName();this.statements.push(kt(u).set(c).toDeclStmt(hi,_r.Final)),s=kt(u),this.literalFactories.set(e,s)}return{literalFactory:s,literalFactoryArguments:i}}uniqueName(e,t=!0){let r=this._claimedNames.get(e)??0,s=r===0&&!t?`${e}`:`${e}${r}`;return this._claimedNames.set(e,r+1),s}freshName(){return this.uniqueName(Gq)}},Pw=class Pw{keyOf(e){if(e instanceof Hr&&typeof e.value=="string")return`"${e.value}"`;if(e instanceof Hr)return String(e.value);if(e instanceof Hi){let t=[];for(let r of e.entries)t.push(this.keyOf(r));return`[${t.join(",")}]`}else if(e instanceof ko){let t=[];for(let r of e.entries){let s=r.key;r.quoted&&(s=`"${s}"`),t.push(s+":"+this.keyOf(r.value))}return`{${t.join(",")}}`}else{if(e instanceof Fc)return`import("${e.value.moduleName}", ${e.value.name})`;if(e instanceof yi)return`read(${e.name})`;if(e instanceof Dp)return`typeof(${this.keyOf(e.expr)})`;throw new Error(`${this.constructor.name} does not handle expressions of type ${e.constructor.name}`)}}};l(Pw,"INSTANCE",new Pw);var Ep=Pw;function Xq(n){return n instanceof yi}function BP(n){return n instanceof Hr&&typeof n.value=="string"&&n.value.length>=Yq}var N="@angular/core",v=class{};l(v,"NEW_METHOD","factory"),l(v,"TRANSFORM_METHOD","transform"),l(v,"PATCH_DEPS","patchedDeps"),l(v,"core",{name:null,moduleName:N}),l(v,"namespaceHTML",{name:"\u0275\u0275namespaceHTML",moduleName:N}),l(v,"namespaceMathML",{name:"\u0275\u0275namespaceMathML",moduleName:N}),l(v,"namespaceSVG",{name:"\u0275\u0275namespaceSVG",moduleName:N}),l(v,"element",{name:"\u0275\u0275element",moduleName:N}),l(v,"elementStart",{name:"\u0275\u0275elementStart",moduleName:N}),l(v,"elementEnd",{name:"\u0275\u0275elementEnd",moduleName:N}),l(v,"advance",{name:"\u0275\u0275advance",moduleName:N}),l(v,"syntheticHostProperty",{name:"\u0275\u0275syntheticHostProperty",moduleName:N}),l(v,"syntheticHostListener",{name:"\u0275\u0275syntheticHostListener",moduleName:N}),l(v,"attribute",{name:"\u0275\u0275attribute",moduleName:N}),l(v,"attributeInterpolate1",{name:"\u0275\u0275attributeInterpolate1",moduleName:N}),l(v,"attributeInterpolate2",{name:"\u0275\u0275attributeInterpolate2",moduleName:N}),l(v,"attributeInterpolate3",{name:"\u0275\u0275attributeInterpolate3",moduleName:N}),l(v,"attributeInterpolate4",{name:"\u0275\u0275attributeInterpolate4",moduleName:N}),l(v,"attributeInterpolate5",{name:"\u0275\u0275attributeInterpolate5",moduleName:N}),l(v,"attributeInterpolate6",{name:"\u0275\u0275attributeInterpolate6",moduleName:N}),l(v,"attributeInterpolate7",{name:"\u0275\u0275attributeInterpolate7",moduleName:N}),l(v,"attributeInterpolate8",{name:"\u0275\u0275attributeInterpolate8",moduleName:N}),l(v,"attributeInterpolateV",{name:"\u0275\u0275attributeInterpolateV",moduleName:N}),l(v,"classProp",{name:"\u0275\u0275classProp",moduleName:N}),l(v,"elementContainerStart",{name:"\u0275\u0275elementContainerStart",moduleName:N}),l(v,"elementContainerEnd",{name:"\u0275\u0275elementContainerEnd",moduleName:N}),l(v,"elementContainer",{name:"\u0275\u0275elementContainer",moduleName:N}),l(v,"styleMap",{name:"\u0275\u0275styleMap",moduleName:N}),l(v,"styleMapInterpolate1",{name:"\u0275\u0275styleMapInterpolate1",moduleName:N}),l(v,"styleMapInterpolate2",{name:"\u0275\u0275styleMapInterpolate2",moduleName:N}),l(v,"styleMapInterpolate3",{name:"\u0275\u0275styleMapInterpolate3",moduleName:N}),l(v,"styleMapInterpolate4",{name:"\u0275\u0275styleMapInterpolate4",moduleName:N}),l(v,"styleMapInterpolate5",{name:"\u0275\u0275styleMapInterpolate5",moduleName:N}),l(v,"styleMapInterpolate6",{name:"\u0275\u0275styleMapInterpolate6",moduleName:N}),l(v,"styleMapInterpolate7",{name:"\u0275\u0275styleMapInterpolate7",moduleName:N}),l(v,"styleMapInterpolate8",{name:"\u0275\u0275styleMapInterpolate8",moduleName:N}),l(v,"styleMapInterpolateV",{name:"\u0275\u0275styleMapInterpolateV",moduleName:N}),l(v,"classMap",{name:"\u0275\u0275classMap",moduleName:N}),l(v,"classMapInterpolate1",{name:"\u0275\u0275classMapInterpolate1",moduleName:N}),l(v,"classMapInterpolate2",{name:"\u0275\u0275classMapInterpolate2",moduleName:N}),l(v,"classMapInterpolate3",{name:"\u0275\u0275classMapInterpolate3",moduleName:N}),l(v,"classMapInterpolate4",{name:"\u0275\u0275classMapInterpolate4",moduleName:N}),l(v,"classMapInterpolate5",{name:"\u0275\u0275classMapInterpolate5",moduleName:N}),l(v,"classMapInterpolate6",{name:"\u0275\u0275classMapInterpolate6",moduleName:N}),l(v,"classMapInterpolate7",{name:"\u0275\u0275classMapInterpolate7",moduleName:N}),l(v,"classMapInterpolate8",{name:"\u0275\u0275classMapInterpolate8",moduleName:N}),l(v,"classMapInterpolateV",{name:"\u0275\u0275classMapInterpolateV",moduleName:N}),l(v,"styleProp",{name:"\u0275\u0275styleProp",moduleName:N}),l(v,"stylePropInterpolate1",{name:"\u0275\u0275stylePropInterpolate1",moduleName:N}),l(v,"stylePropInterpolate2",{name:"\u0275\u0275stylePropInterpolate2",moduleName:N}),l(v,"stylePropInterpolate3",{name:"\u0275\u0275stylePropInterpolate3",moduleName:N}),l(v,"stylePropInterpolate4",{name:"\u0275\u0275stylePropInterpolate4",moduleName:N}),l(v,"stylePropInterpolate5",{name:"\u0275\u0275stylePropInterpolate5",moduleName:N}),l(v,"stylePropInterpolate6",{name:"\u0275\u0275stylePropInterpolate6",moduleName:N}),l(v,"stylePropInterpolate7",{name:"\u0275\u0275stylePropInterpolate7",moduleName:N}),l(v,"stylePropInterpolate8",{name:"\u0275\u0275stylePropInterpolate8",moduleName:N}),l(v,"stylePropInterpolateV",{name:"\u0275\u0275stylePropInterpolateV",moduleName:N}),l(v,"nextContext",{name:"\u0275\u0275nextContext",moduleName:N}),l(v,"resetView",{name:"\u0275\u0275resetView",moduleName:N}),l(v,"templateCreate",{name:"\u0275\u0275template",moduleName:N}),l(v,"defer",{name:"\u0275\u0275defer",moduleName:N}),l(v,"deferWhen",{name:"\u0275\u0275deferWhen",moduleName:N}),l(v,"deferOnIdle",{name:"\u0275\u0275deferOnIdle",moduleName:N}),l(v,"deferOnImmediate",{name:"\u0275\u0275deferOnImmediate",moduleName:N}),l(v,"deferOnTimer",{name:"\u0275\u0275deferOnTimer",moduleName:N}),l(v,"deferOnHover",{name:"\u0275\u0275deferOnHover",moduleName:N}),l(v,"deferOnInteraction",{name:"\u0275\u0275deferOnInteraction",moduleName:N}),l(v,"deferOnViewport",{name:"\u0275\u0275deferOnViewport",moduleName:N}),l(v,"deferPrefetchWhen",{name:"\u0275\u0275deferPrefetchWhen",moduleName:N}),l(v,"deferPrefetchOnIdle",{name:"\u0275\u0275deferPrefetchOnIdle",moduleName:N}),l(v,"deferPrefetchOnImmediate",{name:"\u0275\u0275deferPrefetchOnImmediate",moduleName:N}),l(v,"deferPrefetchOnTimer",{name:"\u0275\u0275deferPrefetchOnTimer",moduleName:N}),l(v,"deferPrefetchOnHover",{name:"\u0275\u0275deferPrefetchOnHover",moduleName:N}),l(v,"deferPrefetchOnInteraction",{name:"\u0275\u0275deferPrefetchOnInteraction",moduleName:N}),l(v,"deferPrefetchOnViewport",{name:"\u0275\u0275deferPrefetchOnViewport",moduleName:N}),l(v,"deferHydrateWhen",{name:"\u0275\u0275deferHydrateWhen",moduleName:N}),l(v,"deferHydrateNever",{name:"\u0275\u0275deferHydrateNever",moduleName:N}),l(v,"deferHydrateOnIdle",{name:"\u0275\u0275deferHydrateOnIdle",moduleName:N}),l(v,"deferHydrateOnImmediate",{name:"\u0275\u0275deferHydrateOnImmediate",moduleName:N}),l(v,"deferHydrateOnTimer",{name:"\u0275\u0275deferHydrateOnTimer",moduleName:N}),l(v,"deferHydrateOnHover",{name:"\u0275\u0275deferHydrateOnHover",moduleName:N}),l(v,"deferHydrateOnInteraction",{name:"\u0275\u0275deferHydrateOnInteraction",moduleName:N}),l(v,"deferHydrateOnViewport",{name:"\u0275\u0275deferHydrateOnViewport",moduleName:N}),l(v,"deferEnableTimerScheduling",{name:"\u0275\u0275deferEnableTimerScheduling",moduleName:N}),l(v,"conditional",{name:"\u0275\u0275conditional",moduleName:N}),l(v,"repeater",{name:"\u0275\u0275repeater",moduleName:N}),l(v,"repeaterCreate",{name:"\u0275\u0275repeaterCreate",moduleName:N}),l(v,"repeaterTrackByIndex",{name:"\u0275\u0275repeaterTrackByIndex",moduleName:N}),l(v,"repeaterTrackByIdentity",{name:"\u0275\u0275repeaterTrackByIdentity",moduleName:N}),l(v,"componentInstance",{name:"\u0275\u0275componentInstance",moduleName:N}),l(v,"text",{name:"\u0275\u0275text",moduleName:N}),l(v,"enableBindings",{name:"\u0275\u0275enableBindings",moduleName:N}),l(v,"disableBindings",{name:"\u0275\u0275disableBindings",moduleName:N}),l(v,"getCurrentView",{name:"\u0275\u0275getCurrentView",moduleName:N}),l(v,"textInterpolate",{name:"\u0275\u0275textInterpolate",moduleName:N}),l(v,"textInterpolate1",{name:"\u0275\u0275textInterpolate1",moduleName:N}),l(v,"textInterpolate2",{name:"\u0275\u0275textInterpolate2",moduleName:N}),l(v,"textInterpolate3",{name:"\u0275\u0275textInterpolate3",moduleName:N}),l(v,"textInterpolate4",{name:"\u0275\u0275textInterpolate4",moduleName:N}),l(v,"textInterpolate5",{name:"\u0275\u0275textInterpolate5",moduleName:N}),l(v,"textInterpolate6",{name:"\u0275\u0275textInterpolate6",moduleName:N}),l(v,"textInterpolate7",{name:"\u0275\u0275textInterpolate7",moduleName:N}),l(v,"textInterpolate8",{name:"\u0275\u0275textInterpolate8",moduleName:N}),l(v,"textInterpolateV",{name:"\u0275\u0275textInterpolateV",moduleName:N}),l(v,"restoreView",{name:"\u0275\u0275restoreView",moduleName:N}),l(v,"pureFunction0",{name:"\u0275\u0275pureFunction0",moduleName:N}),l(v,"pureFunction1",{name:"\u0275\u0275pureFunction1",moduleName:N}),l(v,"pureFunction2",{name:"\u0275\u0275pureFunction2",moduleName:N}),l(v,"pureFunction3",{name:"\u0275\u0275pureFunction3",moduleName:N}),l(v,"pureFunction4",{name:"\u0275\u0275pureFunction4",moduleName:N}),l(v,"pureFunction5",{name:"\u0275\u0275pureFunction5",moduleName:N}),l(v,"pureFunction6",{name:"\u0275\u0275pureFunction6",moduleName:N}),l(v,"pureFunction7",{name:"\u0275\u0275pureFunction7",moduleName:N}),l(v,"pureFunction8",{name:"\u0275\u0275pureFunction8",moduleName:N}),l(v,"pureFunctionV",{name:"\u0275\u0275pureFunctionV",moduleName:N}),l(v,"pipeBind1",{name:"\u0275\u0275pipeBind1",moduleName:N}),l(v,"pipeBind2",{name:"\u0275\u0275pipeBind2",moduleName:N}),l(v,"pipeBind3",{name:"\u0275\u0275pipeBind3",moduleName:N}),l(v,"pipeBind4",{name:"\u0275\u0275pipeBind4",moduleName:N}),l(v,"pipeBindV",{name:"\u0275\u0275pipeBindV",moduleName:N}),l(v,"hostProperty",{name:"\u0275\u0275hostProperty",moduleName:N}),l(v,"property",{name:"\u0275\u0275property",moduleName:N}),l(v,"propertyInterpolate",{name:"\u0275\u0275propertyInterpolate",moduleName:N}),l(v,"propertyInterpolate1",{name:"\u0275\u0275propertyInterpolate1",moduleName:N}),l(v,"propertyInterpolate2",{name:"\u0275\u0275propertyInterpolate2",moduleName:N}),l(v,"propertyInterpolate3",{name:"\u0275\u0275propertyInterpolate3",moduleName:N}),l(v,"propertyInterpolate4",{name:"\u0275\u0275propertyInterpolate4",moduleName:N}),l(v,"propertyInterpolate5",{name:"\u0275\u0275propertyInterpolate5",moduleName:N}),l(v,"propertyInterpolate6",{name:"\u0275\u0275propertyInterpolate6",moduleName:N}),l(v,"propertyInterpolate7",{name:"\u0275\u0275propertyInterpolate7",moduleName:N}),l(v,"propertyInterpolate8",{name:"\u0275\u0275propertyInterpolate8",moduleName:N}),l(v,"propertyInterpolateV",{name:"\u0275\u0275propertyInterpolateV",moduleName:N}),l(v,"i18n",{name:"\u0275\u0275i18n",moduleName:N}),l(v,"i18nAttributes",{name:"\u0275\u0275i18nAttributes",moduleName:N}),l(v,"i18nExp",{name:"\u0275\u0275i18nExp",moduleName:N}),l(v,"i18nStart",{name:"\u0275\u0275i18nStart",moduleName:N}),l(v,"i18nEnd",{name:"\u0275\u0275i18nEnd",moduleName:N}),l(v,"i18nApply",{name:"\u0275\u0275i18nApply",moduleName:N}),l(v,"i18nPostprocess",{name:"\u0275\u0275i18nPostprocess",moduleName:N}),l(v,"pipe",{name:"\u0275\u0275pipe",moduleName:N}),l(v,"projection",{name:"\u0275\u0275projection",moduleName:N}),l(v,"projectionDef",{name:"\u0275\u0275projectionDef",moduleName:N}),l(v,"reference",{name:"\u0275\u0275reference",moduleName:N}),l(v,"inject",{name:"\u0275\u0275inject",moduleName:N}),l(v,"injectAttribute",{name:"\u0275\u0275injectAttribute",moduleName:N}),l(v,"directiveInject",{name:"\u0275\u0275directiveInject",moduleName:N}),l(v,"invalidFactory",{name:"\u0275\u0275invalidFactory",moduleName:N}),l(v,"invalidFactoryDep",{name:"\u0275\u0275invalidFactoryDep",moduleName:N}),l(v,"templateRefExtractor",{name:"\u0275\u0275templateRefExtractor",moduleName:N}),l(v,"forwardRef",{name:"forwardRef",moduleName:N}),l(v,"resolveForwardRef",{name:"resolveForwardRef",moduleName:N}),l(v,"replaceMetadata",{name:"\u0275\u0275replaceMetadata",moduleName:N}),l(v,"getReplaceMetadataURL",{name:"\u0275\u0275getReplaceMetadataURL",moduleName:N}),l(v,"\u0275\u0275defineInjectable",{name:"\u0275\u0275defineInjectable",moduleName:N}),l(v,"declareInjectable",{name:"\u0275\u0275ngDeclareInjectable",moduleName:N}),l(v,"InjectableDeclaration",{name:"\u0275\u0275InjectableDeclaration",moduleName:N}),l(v,"resolveWindow",{name:"\u0275\u0275resolveWindow",moduleName:N}),l(v,"resolveDocument",{name:"\u0275\u0275resolveDocument",moduleName:N}),l(v,"resolveBody",{name:"\u0275\u0275resolveBody",moduleName:N}),l(v,"getComponentDepsFactory",{name:"\u0275\u0275getComponentDepsFactory",moduleName:N}),l(v,"defineComponent",{name:"\u0275\u0275defineComponent",moduleName:N}),l(v,"declareComponent",{name:"\u0275\u0275ngDeclareComponent",moduleName:N}),l(v,"setComponentScope",{name:"\u0275\u0275setComponentScope",moduleName:N}),l(v,"ChangeDetectionStrategy",{name:"ChangeDetectionStrategy",moduleName:N}),l(v,"ViewEncapsulation",{name:"ViewEncapsulation",moduleName:N}),l(v,"ComponentDeclaration",{name:"\u0275\u0275ComponentDeclaration",moduleName:N}),l(v,"FactoryDeclaration",{name:"\u0275\u0275FactoryDeclaration",moduleName:N}),l(v,"declareFactory",{name:"\u0275\u0275ngDeclareFactory",moduleName:N}),l(v,"FactoryTarget",{name:"\u0275\u0275FactoryTarget",moduleName:N}),l(v,"defineDirective",{name:"\u0275\u0275defineDirective",moduleName:N}),l(v,"declareDirective",{name:"\u0275\u0275ngDeclareDirective",moduleName:N}),l(v,"DirectiveDeclaration",{name:"\u0275\u0275DirectiveDeclaration",moduleName:N}),l(v,"InjectorDef",{name:"\u0275\u0275InjectorDef",moduleName:N}),l(v,"InjectorDeclaration",{name:"\u0275\u0275InjectorDeclaration",moduleName:N}),l(v,"defineInjector",{name:"\u0275\u0275defineInjector",moduleName:N}),l(v,"declareInjector",{name:"\u0275\u0275ngDeclareInjector",moduleName:N}),l(v,"NgModuleDeclaration",{name:"\u0275\u0275NgModuleDeclaration",moduleName:N}),l(v,"ModuleWithProviders",{name:"ModuleWithProviders",moduleName:N}),l(v,"defineNgModule",{name:"\u0275\u0275defineNgModule",moduleName:N}),l(v,"declareNgModule",{name:"\u0275\u0275ngDeclareNgModule",moduleName:N}),l(v,"setNgModuleScope",{name:"\u0275\u0275setNgModuleScope",moduleName:N}),l(v,"registerNgModuleType",{name:"\u0275\u0275registerNgModuleType",moduleName:N}),l(v,"PipeDeclaration",{name:"\u0275\u0275PipeDeclaration",moduleName:N}),l(v,"definePipe",{name:"\u0275\u0275definePipe",moduleName:N}),l(v,"declarePipe",{name:"\u0275\u0275ngDeclarePipe",moduleName:N}),l(v,"declareClassMetadata",{name:"\u0275\u0275ngDeclareClassMetadata",moduleName:N}),l(v,"declareClassMetadataAsync",{name:"\u0275\u0275ngDeclareClassMetadataAsync",moduleName:N}),l(v,"setClassMetadata",{name:"\u0275setClassMetadata",moduleName:N}),l(v,"setClassMetadataAsync",{name:"\u0275setClassMetadataAsync",moduleName:N}),l(v,"setClassDebugInfo",{name:"\u0275setClassDebugInfo",moduleName:N}),l(v,"queryRefresh",{name:"\u0275\u0275queryRefresh",moduleName:N}),l(v,"viewQuery",{name:"\u0275\u0275viewQuery",moduleName:N}),l(v,"loadQuery",{name:"\u0275\u0275loadQuery",moduleName:N}),l(v,"contentQuery",{name:"\u0275\u0275contentQuery",moduleName:N}),l(v,"viewQuerySignal",{name:"\u0275\u0275viewQuerySignal",moduleName:N}),l(v,"contentQuerySignal",{name:"\u0275\u0275contentQuerySignal",moduleName:N}),l(v,"queryAdvance",{name:"\u0275\u0275queryAdvance",moduleName:N}),l(v,"twoWayProperty",{name:"\u0275\u0275twoWayProperty",moduleName:N}),l(v,"twoWayBindingSet",{name:"\u0275\u0275twoWayBindingSet",moduleName:N}),l(v,"twoWayListener",{name:"\u0275\u0275twoWayListener",moduleName:N}),l(v,"declareLet",{name:"\u0275\u0275declareLet",moduleName:N}),l(v,"storeLet",{name:"\u0275\u0275storeLet",moduleName:N}),l(v,"readContextLet",{name:"\u0275\u0275readContextLet",moduleName:N}),l(v,"attachSourceLocations",{name:"\u0275\u0275attachSourceLocations",moduleName:N}),l(v,"NgOnChangesFeature",{name:"\u0275\u0275NgOnChangesFeature",moduleName:N}),l(v,"InheritDefinitionFeature",{name:"\u0275\u0275InheritDefinitionFeature",moduleName:N}),l(v,"CopyDefinitionFeature",{name:"\u0275\u0275CopyDefinitionFeature",moduleName:N}),l(v,"ProvidersFeature",{name:"\u0275\u0275ProvidersFeature",moduleName:N}),l(v,"HostDirectivesFeature",{name:"\u0275\u0275HostDirectivesFeature",moduleName:N}),l(v,"ExternalStylesFeature",{name:"\u0275\u0275ExternalStylesFeature",moduleName:N}),l(v,"listener",{name:"\u0275\u0275listener",moduleName:N}),l(v,"getInheritedFactory",{name:"\u0275\u0275getInheritedFactory",moduleName:N}),l(v,"sanitizeHtml",{name:"\u0275\u0275sanitizeHtml",moduleName:N}),l(v,"sanitizeStyle",{name:"\u0275\u0275sanitizeStyle",moduleName:N}),l(v,"validateAttribute",{name:"\u0275\u0275validateAttribute",moduleName:N}),l(v,"sanitizeResourceUrl",{name:"\u0275\u0275sanitizeResourceUrl",moduleName:N}),l(v,"sanitizeScript",{name:"\u0275\u0275sanitizeScript",moduleName:N}),l(v,"sanitizeUrl",{name:"\u0275\u0275sanitizeUrl",moduleName:N}),l(v,"sanitizeUrlOrResourceUrl",{name:"\u0275\u0275sanitizeUrlOrResourceUrl",moduleName:N}),l(v,"trustConstantHtml",{name:"\u0275\u0275trustConstantHtml",moduleName:N}),l(v,"trustConstantResourceUrl",{name:"\u0275\u0275trustConstantResourceUrl",moduleName:N}),l(v,"InputSignalBrandWriteType",{name:"\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE",moduleName:N}),l(v,"UnwrapDirectiveSignalInputs",{name:"\u0275UnwrapDirectiveSignalInputs",moduleName:N}),l(v,"unwrapWritableSignal",{name:"\u0275unwrapWritableSignal",moduleName:N});var Qq=/-+([a-z0-9])/g;function Kq(n){return n.replace(Qq,(...e)=>e[1].toUpperCase())}function Jq(n,e){return dF(n,":",e)}function eW(n,e){return dF(n,".",e)}function dF(n,e,t){let r=n.indexOf(e);return r==-1?t:[n.slice(0,r).trim(),n.slice(r+1).trim()]}function tW(n){let e=[];for(let t=0;t=55296&&r<=56319&&n.length>t+1){let s=n.charCodeAt(t+1);s>=56320&&s<=57343&&(t++,r=(r-55296<<10)+s-56320+65536)}r<=127?e.push(r):r<=2047?e.push(r>>6&31|192,r&63|128):r<=65535?e.push(r>>12|224,r>>6&63|128,r&63|128):r<=2097151&&e.push(r>>18&7|240,r>>12&63|128,r>>6&63|128,r&63|128)}return e}function pF(n){if(typeof n=="string")return n;if(Array.isArray(n))return`[${n.map(pF).join(", ")}]`;if(n==null)return""+n;let e=n.overriddenName||n.name;if(e)return`${e}`;if(!n.toString)return"object";let t=n.toString();if(t==null)return""+t;let r=t.indexOf(` +`);return r>=0?t.slice(0,r):t}var $T=class{constructor(e){l(this,"full");l(this,"major");l(this,"minor");l(this,"patch");this.full=e;let t=e.split(".");this.major=t[0],this.minor=t[1],this.patch=t.slice(2).join(".")}},Eg=globalThis,nW=/^([1-9]|1[0-8])\./;function fF(n){return n.startsWith("0.")?!0:!nW.test(n)}var rW=3,sW="# sourceMappingURL=data:application/json;base64,",HT=class{constructor(e=null){l(this,"file");l(this,"sourcesContent",new Map);l(this,"lines",[]);l(this,"lastCol0",0);l(this,"hasMappings",!1);this.file=e}addSource(e,t=null){return this.sourcesContent.has(e)||this.sourcesContent.set(e,t),this}addLine(){return this.lines.push([]),this.lastCol0=0,this}addMapping(e,t,r,s){if(!this.currentLine)throw new Error("A line must be added before mappings can be added");if(t!=null&&!this.sourcesContent.has(t))throw new Error(`Unknown source file "${t}"`);if(e==null)throw new Error("The column in the generated code must be provided");if(e{e.set(u,d),t.push(u),r.push(this.sourcesContent.get(u)||null)});let s="",i=0,o=0,a=0,c=0;return this.lines.forEach(u=>{i=0,s+=u.map(d=>{let p=r0(d.col0-i);return i=d.col0,d.sourceUrl!=null&&(p+=r0(e.get(d.sourceUrl)-o),o=e.get(d.sourceUrl),p+=r0(d.sourceLine0-a),a=d.sourceLine0,p+=r0(d.sourceCol0-c),c=d.sourceCol0),p}).join(","),s+=";"}),s=s.slice(0,-1),{file:this.file||"",version:rW,sourceRoot:"",sources:t,sourcesContent:r,mappings:s}}toJsComment(){return this.hasMappings?"//"+sW+iW(JSON.stringify(this,null,0)):""}};function iW(n){let e="",t=tW(n);for(let r=0;r>2),e+=yg((s&3)<<4|(i===null?0:i>>4)),e+=i===null?"=":yg((i&15)<<2|(o===null?0:o>>6)),e+=i===null||o===null?"=":yg(o&63)}return e}function r0(n){n=n<0?(-n<<1)+1:n<<1;let e="";do{let t=n&31;n=n>>5,n>0&&(t=t|32),e+=yg(t)}while(n>0);return e}var oW="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function yg(n){if(n<0||n>=64)throw new Error("Can only encode value in the range [0, 63]");return oW[n]}var aW=/'|\\|\n|\r|\$/g,lW=/^[$A-Z_][0-9A-Z_$]*$/i,jT=" ",k0=class{constructor(e){l(this,"indent");l(this,"partsLength",0);l(this,"parts",[]);l(this,"srcSpans",[]);this.indent=e}},UT=class n{constructor(e){l(this,"_indent");l(this,"_lines");this._indent=e,this._lines=[new k0(e)]}static createRoot(){return new n(0)}get _currentLine(){return this._lines[this._lines.length-1]}println(e,t=""){this.print(e||null,t,!0)}lineIsEmpty(){return this._currentLine.parts.length===0}lineLength(){return this._currentLine.indent*jT.length+this._currentLine.partsLength}print(e,t,r=!1){t.length>0&&(this._currentLine.parts.push(t),this._currentLine.partsLength+=t.length,this._currentLine.srcSpans.push(e&&e.sourceSpan||null)),r&&this._lines.push(new k0(this._indent))}removeEmptyLastLine(){this.lineIsEmpty()&&this._lines.pop()}incIndent(){this._indent++,this.lineIsEmpty()&&(this._currentLine.indent=this._indent)}decIndent(){this._indent--,this.lineIsEmpty()&&(this._currentLine.indent=this._indent)}toSource(){return this.sourceLines.map(e=>e.parts.length>0?VP(e.indent)+e.parts.join(""):"").join(` +`)}toSourceMapGenerator(e,t=0){let r=new HT(e),s=!1,i=()=>{s||(r.addSource(e," ").addMapping(0,e,0,0),s=!0)};for(let o=0;o{r.addLine();let c=o.srcSpans,u=o.parts,d=o.indent*jT.length,p=0;for(;ps)return r.srcSpans[i];s-=o.length}}return null}get sourceLines(){return this._lines.length&&this._lines[this._lines.length-1].parts.length===0?this._lines.slice(0,-1):this._lines}},qT=class{constructor(e){l(this,"_escapeDollarInStrings");this._escapeDollarInStrings=e}printLeadingComments(e,t){if(e.leadingComments!==void 0)for(let r of e.leadingComments)r instanceof T0?t.print(e,`/*${r.toString()}*/`,r.trailingNewline):r.multiline?t.print(e,`/* ${r.text} */`,r.trailingNewline):r.text.split(` +`).forEach(s=>{t.println(e,`// ${s}`)})}visitExpressionStmt(e,t){return this.printLeadingComments(e,t),e.expr.visitExpression(this,t),t.println(e,";"),null}visitReturnStmt(e,t){return this.printLeadingComments(e,t),t.print(e,"return "),e.value.visitExpression(this,t),t.println(e,";"),null}visitIfStmt(e,t){this.printLeadingComments(e,t),t.print(e,"if ("),e.condition.visitExpression(this,t),t.print(e,") {");let r=e.falseCase!=null&&e.falseCase.length>0;return e.trueCase.length<=1&&!r?(t.print(e," "),this.visitAllStatements(e.trueCase,t),t.removeEmptyLastLine(),t.print(e," ")):(t.println(),t.incIndent(),this.visitAllStatements(e.trueCase,t),t.decIndent(),r&&(t.println(e,"} else {"),t.incIndent(),this.visitAllStatements(e.falseCase,t),t.decIndent())),t.println(e,"}"),null}visitWriteVarExpr(e,t){let r=t.lineIsEmpty();return r||t.print(e,"("),t.print(e,`${e.name} = `),e.value.visitExpression(this,t),r||t.print(e,")"),null}visitWriteKeyExpr(e,t){let r=t.lineIsEmpty();return r||t.print(e,"("),e.receiver.visitExpression(this,t),t.print(e,"["),e.index.visitExpression(this,t),t.print(e,"] = "),e.value.visitExpression(this,t),r||t.print(e,")"),null}visitWritePropExpr(e,t){let r=t.lineIsEmpty();return r||t.print(e,"("),e.receiver.visitExpression(this,t),t.print(e,`.${e.name} = `),e.value.visitExpression(this,t),r||t.print(e,")"),null}visitInvokeFunctionExpr(e,t){let r=e.fn instanceof Lc;return r&&t.print(e.fn,"("),e.fn.visitExpression(this,t),r&&t.print(e.fn,")"),t.print(e,"("),this.visitAllExpressions(e.args,t,","),t.print(e,")"),null}visitTaggedTemplateLiteralExpr(e,t){return e.tag.visitExpression(this,t),e.template.visitExpression(this,t),null}visitTemplateLiteralExpr(e,t){t.print(e,"`");for(let r=0;r{t.print(e,`${Tc(r.key,this._escapeDollarInStrings,r.quoted)}:`),r.value.visitExpression(this,t)},e.entries,t,","),t.print(e,"}"),null}visitCommaExpr(e,t){return t.print(e,"("),this.visitAllExpressions(e.parts,t,","),t.print(e,")"),null}visitAllExpressions(e,t,r){this.visitAllObjects(s=>s.visitExpression(this,t),e,t,r)}visitAllObjects(e,t,r,s){let i=!1;for(let o=0;o0&&(r.lineLength()>80?(r.print(null,s,!0),i||(r.incIndent(),r.incIndent(),i=!0)):r.print(null,s,!1)),e(t[o]);i&&(r.decIndent(),r.decIndent())}visitAllStatements(e,t){e.forEach(r=>r.visitStatement(this,t))}};function Tc(n,e,t=!0){if(n==null)return null;let r=n.replace(aW,(...i)=>i[0]=="$"?e?"\\$":"$":i[0]==` +`?"\\n":i[0]=="\r"?"\\r":`\\${i[0]}`);return t||!lW.test(r)?`'${r}'`:r}function VP(n){let e="";for(let t=0;tr.value));return e?ji([],t):t}function aI(n,e){return{expression:n,forwardRef:e}}function pW({expression:n,forwardRef:e}){switch(e){case 0:case 1:return n;case 2:return fW(n)}}function fW(n){return Ze(v.forwardRef).callFn([ji([],n)])}var Lg;(function(n){n[n.Class=0]="Class",n[n.Function=1]="Function"})(Lg||(Lg={}));function Sc(n){let e=kt("__ngFactoryType__"),t=null,r=HP(n)?e:new Xt(Ge.Or,e,n.type.value),s=null;n.deps!==null?n.deps!=="invalid"&&(s=new Mg(r,$P(n.deps,n.target))):(t=kt(`\u0275${n.name}_BaseFactory`),s=t.callFn([r]));let i=[],o=null;function a(u){let d=kt("__ngConditionalFactory__");i.push(d.set(Rg).toDeclStmt());let p=s!==null?d.set(s).toStmt():Ze(v.invalidFactory).callFn([]).toStmt();return i.push(Lw(e,[p],[d.set(u).toStmt()])),d}if(HP(n)){let u=$P(n.delegateDeps,n.target),d=new(n.delegateType===Lg.Class?Mg:Cs)(n.delegate,u);o=a(d)}else yW(n)?o=a(n.expression):o=s;if(o===null)i.push(Ze(v.invalidFactory).callFn([]).toStmt());else if(t!==null){let u=Ze(v.getInheritedFactory).callFn([n.type.value]),d=new Xt(Ge.Or,t,t.set(u));i.push(new Qr(d.callFn([r])))}else i.push(new Qr(o));let c=xl([new kr(e.name,yv)],i,hi,void 0,`${n.name}_Factory`);return t!==null&&(c=ji([],[new Jr(t.name),new Qr(c)]).callFn([],void 0,!0)),{expression:c,statements:[],type:hW(n)}}function hW(n){let e=n.deps!==null&&n.deps!=="invalid"?gW(n.deps):_o;return $r(Ze(v.FactoryDeclaration,[Ow(n.type.type,n.typeArgumentCount),e]))}function $P(n,e){return n.map((t,r)=>mW(t,e,r))}function mW(n,e,t){if(n.token===null)return Ze(v.invalidFactoryDep).callFn([Y(t)]);if(n.attributeNameType===null){let r=0|(n.self?2:0)|(n.skipSelf?4:0)|(n.host?1:0)|(n.optional?8:0)|(e===So.Pipe?16:0),s=r!==0||n.optional?Y(r):null,i=[n.token];s&&i.push(s);let o=bW(e);return Ze(o).callFn(i)}else return Ze(v.injectAttribute).callFn([n.token])}function gW(n){let e=!1,t=n.map(r=>{let s=vW(r);return s!==null?(e=!0,s):Y(null)});return e?$r(tn(t)):_o}function vW(n){let e=[];return n.attributeNameType!==null&&e.push({key:"attribute",value:n.attributeNameType,quoted:!1}),n.optional&&e.push({key:"optional",value:Y(!0),quoted:!1}),n.host&&e.push({key:"host",value:Y(!0),quoted:!1}),n.self&&e.push({key:"self",value:Y(!0),quoted:!1}),n.skipSelf&&e.push({key:"skipSelf",value:Y(!0),quoted:!1}),e.length>0?cs(e):null}function HP(n){return n.delegateType!==void 0}function yW(n){return n.expression!==void 0}function bW(n){switch(n){case So.Component:case So.Directive:case So.Pipe:return v.directiveInject;case So.NgModule:case So.Injectable:default:return v.inject}}var Og=class{constructor(e,t,r,s){l(this,"input");l(this,"errLocation");l(this,"ctxLocation");l(this,"message");this.input=t,this.errLocation=r,this.ctxLocation=s,this.message=`Parser Error: ${e} ${r} [${t}] in ${s}`}},Bc=class{constructor(e,t){l(this,"start");l(this,"end");this.start=e,this.end=t}toAbsolute(e){return new js(e+this.start,e+this.end)}},On=class{constructor(e,t){l(this,"span");l(this,"sourceSpan");this.span=e,this.sourceSpan=t}toString(){return"AST"}},Ap=class extends On{constructor(t,r,s){super(t,r);l(this,"nameSpan");this.nameSpan=s}},ws=class extends On{visit(e,t=null){}},vi=class extends On{visit(e,t=null){return e.visitImplicitReceiver(this,t)}},Vc=class extends vi{visit(e,t=null){return e.visitThisReceiver?.(this,t)}},Mp=class extends On{constructor(t,r,s){super(t,r);l(this,"expressions");this.expressions=s}visit(t,r=null){return t.visitChain(this,r)}},A0=class extends On{constructor(t,r,s,i,o){super(t,r);l(this,"condition");l(this,"trueExp");l(this,"falseExp");this.condition=s,this.trueExp=i,this.falseExp=o}visit(t,r=null){return t.visitConditional(this,r)}},$c=class extends Ap{constructor(t,r,s,i,o){super(t,r,s);l(this,"receiver");l(this,"name");this.receiver=i,this.name=o}visit(t,r=null){return t.visitPropertyRead(this,r)}},M0=class extends Ap{constructor(t,r,s,i,o,a){super(t,r,s);l(this,"receiver");l(this,"name");l(this,"value");this.receiver=i,this.name=o,this.value=a}visit(t,r=null){return t.visitPropertyWrite(this,r)}},N0=class extends Ap{constructor(t,r,s,i,o){super(t,r,s);l(this,"receiver");l(this,"name");this.receiver=i,this.name=o}visit(t,r=null){return t.visitSafePropertyRead(this,r)}},Bg=class extends On{constructor(t,r,s,i){super(t,r);l(this,"receiver");l(this,"key");this.receiver=s,this.key=i}visit(t,r=null){return t.visitKeyedRead(this,r)}},P0=class extends On{constructor(t,r,s,i){super(t,r);l(this,"receiver");l(this,"key");this.receiver=s,this.key=i}visit(t,r=null){return t.visitSafeKeyedRead(this,r)}},R0=class extends On{constructor(t,r,s,i,o){super(t,r);l(this,"receiver");l(this,"key");l(this,"value");this.receiver=s,this.key=i,this.value=o}visit(t,r=null){return t.visitKeyedWrite(this,r)}},F0=class extends Ap{constructor(t,r,s,i,o,a){super(t,r,a);l(this,"exp");l(this,"name");l(this,"args");this.exp=s,this.name=i,this.args=o}visit(t,r=null){return t.visitPipe(this,r)}},ui=class extends On{constructor(t,r,s){super(t,r);l(this,"value");this.value=s}visit(t,r=null){return t.visitLiteralPrimitive(this,r)}},L0=class extends On{constructor(t,r,s){super(t,r);l(this,"expressions");this.expressions=s}visit(t,r=null){return t.visitLiteralArray(this,r)}},O0=class extends On{constructor(t,r,s,i){super(t,r);l(this,"keys");l(this,"values");this.keys=s,this.values=i}visit(t,r=null){return t.visitLiteralMap(this,r)}},wv=class extends On{constructor(t,r,s,i){super(t,r);l(this,"strings");l(this,"expressions");this.strings=s,this.expressions=i}visit(t,r=null){return t.visitInterpolation(this,r)}},Oi=class extends On{constructor(t,r,s,i,o){super(t,r);l(this,"operation");l(this,"left");l(this,"right");this.operation=s,this.left=i,this.right=o}visit(t,r=null){return t.visitBinary(this,r)}},Vg=class n extends Oi{constructor(t,r,s,i,o,a,c){super(t,r,o,a,c);l(this,"operator");l(this,"expr");l(this,"left",null);l(this,"right",null);l(this,"operation",null);this.operator=s,this.expr=i}static createMinus(t,r,s){return new n(t,r,"-",s,"-",new ui(t,r,0),s)}static createPlus(t,r,s){return new n(t,r,"+",s,"-",s,new ui(t,r,0))}visit(t,r=null){return t.visitUnary!==void 0?t.visitUnary(this,r):t.visitBinary(this,r)}},B0=class extends On{constructor(t,r,s){super(t,r);l(this,"expression");this.expression=s}visit(t,r=null){return t.visitPrefixNot(this,r)}},V0=class extends On{constructor(t,r,s){super(t,r);l(this,"expression");this.expression=s}visit(t,r=null){return t.visitTypeofExpression(this,r)}},$g=class extends On{constructor(t,r,s){super(t,r);l(this,"expression");this.expression=s}visit(t,r=null){return t.visitNonNullAssert(this,r)}},Hg=class extends On{constructor(t,r,s,i,o){super(t,r);l(this,"receiver");l(this,"args");l(this,"argumentSpan");this.receiver=s,this.args=i,this.argumentSpan=o}visit(t,r=null){return t.visitCall(this,r)}},$0=class extends On{constructor(t,r,s,i,o){super(t,r);l(this,"receiver");l(this,"args");l(this,"argumentSpan");this.receiver=s,this.args=i,this.argumentSpan=o}visit(t,r=null){return t.visitSafeCall(this,r)}},jg=class extends On{constructor(t,r,s,i){super(t,r);l(this,"elements");l(this,"expressions");this.elements=s,this.expressions=i}visit(t,r){return t.visitTemplateLiteral(this,r)}},H0=class extends On{constructor(t,r,s){super(t,r);l(this,"text");this.text=s}visit(t,r){return t.visitTemplateLiteralElement(this,r)}},js=class{constructor(e,t){l(this,"start");l(this,"end");this.start=e,this.end=t}},pi=class extends On{constructor(t,r,s,i,o){super(new Bc(0,r===null?0:r.length),new js(i,r===null?i:i+r.length));l(this,"ast");l(this,"source");l(this,"location");l(this,"errors");this.ast=t,this.source=r,this.location=s,this.errors=o}visit(t,r=null){return t.visitASTWithSource?t.visitASTWithSource(this,r):this.ast.visit(t,r)}toString(){return`${this.source} in ${this.location}`}},Ug=class{constructor(e,t,r){l(this,"sourceSpan");l(this,"key");l(this,"value");this.sourceSpan=e,this.key=t,this.value=r}},WT=class{constructor(e,t,r){l(this,"sourceSpan");l(this,"key");l(this,"value");this.sourceSpan=e,this.key=t,this.value=r}},j0=class{visit(e,t){e.visit(this,t)}visitUnary(e,t){this.visit(e.expr,t)}visitBinary(e,t){this.visit(e.left,t),this.visit(e.right,t)}visitChain(e,t){this.visitAll(e.expressions,t)}visitConditional(e,t){this.visit(e.condition,t),this.visit(e.trueExp,t),this.visit(e.falseExp,t)}visitPipe(e,t){this.visit(e.exp,t),this.visitAll(e.args,t)}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){this.visitAll(e.expressions,t)}visitKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitKeyedWrite(e,t){this.visit(e.receiver,t),this.visit(e.key,t),this.visit(e.value,t)}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitLiteralPrimitive(e,t){}visitPrefixNot(e,t){this.visit(e.expression,t)}visitTypeofExpression(e,t){this.visit(e.expression,t)}visitNonNullAssert(e,t){this.visit(e.expression,t)}visitPropertyRead(e,t){this.visit(e.receiver,t)}visitPropertyWrite(e,t){this.visit(e.receiver,t),this.visit(e.value,t)}visitSafePropertyRead(e,t){this.visit(e.receiver,t)}visitSafeKeyedRead(e,t){this.visit(e.receiver,t),this.visit(e.key,t)}visitCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitSafeCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitTemplateLiteral(e,t){for(let r=0;rs!==null);pT(t,r)}visitTriggers(t,r,s){pT(s,t.map(i=>r[i]))}},Z0=class extends wi{constructor(t,r,s,i,o,a,c){super(c,i,o,a);l(this,"expression");l(this,"cases");l(this,"unknownBlocks");this.expression=t,this.cases=r,this.unknownBlocks=s}visit(t){return t.visitSwitchBlock(this)}},Gg=class extends wi{constructor(t,r,s,i,o,a,c){super(a,s,i,o);l(this,"expression");l(this,"children");l(this,"i18n");this.expression=t,this.children=r,this.i18n=c}visit(t){return t.visitSwitchBlockCase(this)}},Rp=class extends wi{constructor(t,r,s,i,o,a,c,u,d,p,f,h,m){super(h,u,p,f);l(this,"item");l(this,"expression");l(this,"trackBy");l(this,"trackKeywordSpan");l(this,"contextVariables");l(this,"children");l(this,"empty");l(this,"mainBlockSpan");l(this,"i18n");this.item=t,this.expression=r,this.trackBy=s,this.trackKeywordSpan=i,this.contextVariables=o,this.children=a,this.empty=c,this.mainBlockSpan=d,this.i18n=m}visit(t){return t.visitForLoopBlock(this)}},Zg=class extends wi{constructor(t,r,s,i,o,a){super(o,r,s,i);l(this,"children");l(this,"i18n");this.children=t,this.i18n=a}visit(t){return t.visitForLoopBlockEmpty(this)}},Y0=class extends wi{constructor(t,r,s,i,o){super(o,r,s,i);l(this,"branches");this.branches=t}visit(t){return t.visitIfBlock(this)}},Ac=class extends wi{constructor(t,r,s,i,o,a,c,u){super(c,i,o,a);l(this,"expression");l(this,"children");l(this,"expressionAlias");l(this,"i18n");this.expression=t,this.children=r,this.expressionAlias=s,this.i18n=u}visit(t){return t.visitIfBlockBranch(this)}},X0=class{constructor(e,t,r){l(this,"name");l(this,"sourceSpan");l(this,"nameSpan");this.name=e,this.sourceSpan=t,this.nameSpan=r}visit(e){return e.visitUnknownBlock(this)}},lI=class{constructor(e,t,r,s,i){l(this,"name");l(this,"value");l(this,"sourceSpan");l(this,"nameSpan");l(this,"valueSpan");this.name=e,this.value=t,this.sourceSpan=r,this.nameSpan=s,this.valueSpan=i}visit(e){return e.visitLetDeclaration(this)}},qs=class{constructor(e,t,r,s,i,o,a,c,u,d,p,f){l(this,"tagName");l(this,"attributes");l(this,"inputs");l(this,"outputs");l(this,"templateAttrs");l(this,"children");l(this,"references");l(this,"variables");l(this,"sourceSpan");l(this,"startSourceSpan");l(this,"endSourceSpan");l(this,"i18n");this.tagName=e,this.attributes=t,this.inputs=r,this.outputs=s,this.templateAttrs=i,this.children=o,this.references=a,this.variables=c,this.sourceSpan=u,this.startSourceSpan=d,this.endSourceSpan=p,this.i18n=f}visit(e){return e.visitTemplate(this)}},Fp=class{constructor(e,t,r,s,i){l(this,"selector");l(this,"attributes");l(this,"children");l(this,"sourceSpan");l(this,"i18n");l(this,"name","ng-content");this.selector=e,this.attributes=t,this.children=r,this.sourceSpan=s,this.i18n=i}visit(e){return e.visitContent(this)}},Sl=class{constructor(e,t,r,s,i){l(this,"name");l(this,"value");l(this,"sourceSpan");l(this,"keySpan");l(this,"valueSpan");this.name=e,this.value=t,this.sourceSpan=r,this.keySpan=s,this.valueSpan=i}visit(e){return e.visitVariable(this)}},Yg=class{constructor(e,t,r,s,i){l(this,"name");l(this,"value");l(this,"sourceSpan");l(this,"keySpan");l(this,"valueSpan");this.name=e,this.value=t,this.sourceSpan=r,this.keySpan=s,this.valueSpan=i}visit(e){return e.visitReference(this)}},hF=class{constructor(e,t,r,s){l(this,"vars");l(this,"placeholders");l(this,"sourceSpan");l(this,"i18n");this.vars=e,this.placeholders=t,this.sourceSpan=r,this.i18n=s}visit(e){return e.visitIcu(this)}};function pT(n,e){let t=[];if(n.visit)for(let r of e)n.visit(r)||r.visit(n);else for(let r of e){let s=r.visit(n);s&&t.push(s)}return t}var ls=class{constructor(e,t,r,s,i,o){l(this,"nodes");l(this,"placeholders");l(this,"placeholderToMessage");l(this,"meaning");l(this,"description");l(this,"customId");l(this,"sources");l(this,"id");l(this,"legacyIds",[]);l(this,"messageString");this.nodes=e,this.placeholders=t,this.placeholderToMessage=r,this.meaning=s,this.description=i,this.customId=o,this.id=this.customId,this.messageString=EW(this.nodes),e.length?this.sources=[{filePath:e[0].sourceSpan.start.file.url,startLine:e[0].sourceSpan.start.line+1,startCol:e[0].sourceSpan.start.col+1,endLine:e[e.length-1].sourceSpan.end.line+1,endCol:e[0].sourceSpan.start.col+1}]:this.sources=[]}},pg=class{constructor(e,t){l(this,"value");l(this,"sourceSpan");this.value=e,this.sourceSpan=t}visit(e,t){return e.visitText(this,t)}},ya=class{constructor(e,t){l(this,"children");l(this,"sourceSpan");this.children=e,this.sourceSpan=t}visit(e,t){return e.visitContainer(this,t)}},Q0=class{constructor(e,t,r,s,i){l(this,"expression");l(this,"type");l(this,"cases");l(this,"sourceSpan");l(this,"expressionPlaceholder");this.expression=e,this.type=t,this.cases=r,this.sourceSpan=s,this.expressionPlaceholder=i}visit(e,t){return e.visitIcu(this,t)}},Cl=class{constructor(e,t,r,s,i,o,a,c,u){l(this,"tag");l(this,"attrs");l(this,"startName");l(this,"closeName");l(this,"children");l(this,"isVoid");l(this,"sourceSpan");l(this,"startSourceSpan");l(this,"endSourceSpan");this.tag=e,this.attrs=t,this.startName=r,this.closeName=s,this.children=i,this.isVoid=o,this.sourceSpan=a,this.startSourceSpan=c,this.endSourceSpan=u}visit(e,t){return e.visitTagPlaceholder(this,t)}},Xg=class{constructor(e,t,r){l(this,"value");l(this,"name");l(this,"sourceSpan");this.value=e,this.name=t,this.sourceSpan=r}visit(e,t){return e.visitPlaceholder(this,t)}},Lp=class{constructor(e,t,r){l(this,"value");l(this,"name");l(this,"sourceSpan");l(this,"previousMessage");this.value=e,this.name=t,this.sourceSpan=r}visit(e,t){return e.visitIcuPlaceholder(this,t)}},Tl=class{constructor(e,t,r,s,i,o,a,c){l(this,"name");l(this,"parameters");l(this,"startName");l(this,"closeName");l(this,"children");l(this,"sourceSpan");l(this,"startSourceSpan");l(this,"endSourceSpan");this.name=e,this.parameters=t,this.startName=r,this.closeName=s,this.children=i,this.sourceSpan=o,this.startSourceSpan=a,this.endSourceSpan=c}visit(e,t){return e.visitBlockPlaceholder(this,t)}};function EW(n){let e=new rD;return n.map(r=>r.visit(e)).join("")}var rD=class{visitText(e){return e.value}visitContainer(e){return e.children.map(t=>t.visit(this)).join("")}visitIcu(e){let t=Object.keys(e.cases).map(r=>`${r} {${e.cases[r].visit(this)}}`);return`{${e.expressionPlaceholder}, ${e.type}, ${t.join(" ")}}`}visitTagPlaceholder(e){let t=e.children.map(r=>r.visit(this)).join("");return`{$${e.startName}}${t}{$${e.closeName}}`}visitPlaceholder(e){return`{$${e.name}}`}visitIcuPlaceholder(e){return`{$${e.name}}`}visitBlockPlaceholder(e){let t=e.children.map(r=>r.visit(this)).join("");return`{$${e.startName}}${t}{$${e.closeName}}`}};var xW=class{visitTag(e){let t=this._serializeAttributes(e.attrs);if(e.children.length==0)return`<${e.name}${t}/>`;let r=e.children.map(s=>s.visit(this));return`<${e.name}${t}>${r.join("")}`}visitText(e){return e.value}visitDeclaration(e){return``}_serializeAttributes(e){let t=Object.keys(e).map(r=>`${r}="${e[r]}"`).join(" ");return t.length>0?" "+t:""}visitDoctype(e){return``}},ihe=new xW;function SW(n){return n.toUpperCase().replace(/[^A-Z0-9_]/g,"_")}var mF="i18n",sD="i18n-",CW="VAR_";function gF(n){return n===mF||n.startsWith(sD)}function TW(n){return n.attrs.some(e=>gF(e.name))}function vF(n){return n.nodes[0]}function cI(n={},e){let t={};return n&&Object.keys(n).length&&Object.keys(n).forEach(r=>t[Ev(r,e)]=n[r]),t}function Ev(n,e=!0){let t=SW(n);if(!e)return t;let r=t.split("_");if(r.length===1)return n.toLowerCase();let s;/^\d+$/.test(r[r.length-1])&&(s=r.pop());let i=r.shift().toLowerCase();return r.length&&(i+=r.map(o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()).join("")),s?`${i}_${s}`:i}var DW=/[-.]/,uI="_t",Qg="ctx",dI="rf";function yF(n,e){let t=null;return()=>(t||(n(new Jr(uI,void 0,yv)),t=kt(e)),t)}function hp(n){return Array.isArray(n)?tn(n.map(hp)):Y(n,hi)}function UP(n,e){let t=Object.getOwnPropertyNames(n);return t.length===0?null:cs(t.map(r=>{let s=n[r],i,o,a,c;if(typeof s=="string")i=r,a=r,o=s,c=hp(o);else{a=r,i=s.classPropertyName,o=s.bindingPropertyName;let u=o!==i,d=s.transformFunction!==null,p=fp.None;if(s.isSignal&&(p|=fp.SignalBased),d&&(p|=fp.HasDecoratorInputTransform),e&&(u||d||p!==fp.None)){let f=[Y(p),hp(o)];(u||d)&&(f.push(hp(i)),d&&f.push(s.transformFunction)),c=tn(f)}else c=hp(o)}return{key:a,quoted:DW.test(a),value:c}}))}var Dl=class{constructor(){l(this,"values",[])}set(e,t){if(t){let r=this.values.find(s=>s.key===e);r?r.value=t:this.values.push({key:e,value:t,quoted:!1})}}toLiteralMap(){return cs(this.values)}};function IW(n){let e=n instanceof Ao?n.name:"ng-template",t=_W(n),r=new Cp,s=Kr(e)[1];return r.setElement(s),Object.getOwnPropertyNames(t).forEach(i=>{let o=Kr(i)[1],a=t[i];r.addAttribute(o,a),i.toLowerCase()==="class"&&a.trim().split(/\s+/).forEach(u=>r.addClassName(u))}),r}function _W(n){let e={};return n instanceof qs&&n.tagName!=="ng-template"?n.templateAttrs.forEach(t=>e[t.name]=""):(n.attributes.forEach(t=>{gF(t.name)||(e[t.name]=t.value)}),n.inputs.forEach(t=>{(t.type===En.Property||t.type===En.TwoWay)&&(e[t.name]="")}),n.outputs.forEach(t=>{e[t.name]=""})),e}function qP(n,e){let t=null,r={name:n.name,type:n.type,typeArgumentCount:n.typeArgumentCount,deps:[],target:So.Injectable};if(n.useClass!==void 0){let a=n.useClass.expression.isEquivalent(n.type.value),c;n.deps!==void 0&&(c=n.deps),c!==void 0?t=Sc({...r,delegate:n.useClass.expression,delegateDeps:c,delegateType:Lg.Class}):a?t=Sc(r):t={statements:[],expression:WP(n.type.value,n.useClass.expression,e)}}else n.useFactory!==void 0?n.deps!==void 0?t=Sc({...r,delegate:n.useFactory,delegateDeps:n.deps||[],delegateType:Lg.Function}):t={statements:[],expression:ji([],n.useFactory.callFn([]))}:n.useValue!==void 0?t=Sc({...r,expression:n.useValue.expression}):n.useExisting!==void 0?t=Sc({...r,expression:Ze(v.inject).callFn([n.useExisting.expression])}):t={statements:[],expression:WP(n.type.value,n.type.value,e)};let s=n.type.value,i=new Dl;return i.set("token",s),i.set("factory",t.expression),n.providedIn.expression.value!==null&&i.set("providedIn",pW(n.providedIn)),{expression:Ze(v.\u0275\u0275defineInjectable).callFn([i.toLiteralMap()],void 0,!0),type:kW(n),statements:t.statements}}function kW(n){return new gi(Ze(v.InjectableDeclaration,[Ow(n.type.type,n.typeArgumentCount)]))}function WP(n,e,t){if(n.node===e.node)return e.prop("\u0275fac");if(!t)return zP(e);let r=Ze(v.resolveForwardRef).callFn([e]);return zP(r)}function zP(n){let e=new kr("__ngFactoryType__",yv);return ji([e],n.prop("\u0275fac").callFn([kt(e.name)]))}var AW=[/@/,/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];function MW(n,e){if(e!=null&&!(Array.isArray(e)&&e.length==2))throw new Error(`Expected '${n}' to be an array, [start, end].`);if(e!=null){let t=e[0],r=e[1];AW.forEach(s=>{if(s.test(t)||s.test(r))throw new Error(`['${t}', '${r}'] contains unusable interpolation symbol.`)})}}var K0=class n{constructor(e,t){l(this,"start");l(this,"end");this.start=e,this.end=t}static fromArray(e){return e?(MW("interpolation",e),new n(e[0],e[1])):Co}},Co=new K0("{{","}}"),NW=new Set(["switch"]),Br=0,PW=8,pI=9,Mc=10,bF=11,wF=12,fI=13,EF=32,iD=33,Kg=34,xF=35,Vw=36,RW=37,J0=38,Jg=39,ba=40,$i=41,FW=42,SF=43,mi=44,ew=45,up=46,fa=47,vl=58,$s=59,mp=60,_c=61,hl=62,GP=63,hI=48,LW=55,CF=57,zp=65,OW=69,BW=70,VW=88,$w=90,xp=91,Sp=92,gp=93,$W=94,xv=95,jc=97,HW=98,jW=101,mI=102,TF=110,DF=114,IF=116,_F=117,kF=118,AF=120,Sv=122,Vi=123,ZP=124,Es=125,MF=160,fT=64,oD=96;function ev(n){return n>=pI&&n<=EF||n==MF}function xo(n){return hI<=n&&n<=CF}function tv(n){return n>=jc&&n<=Sv||n>=zp&&n<=$w}function UW(n){return n>=jc&&n<=mI||n>=zp&&n<=BW||xo(n)}function gI(n){return n===Mc||n===fI}function YP(n){return hI<=n&&n<=LW}function Sg(n){return n===Jg||n===Kg||n===oD}var nv=class n{constructor(e,t,r,s){l(this,"file");l(this,"offset");l(this,"line");l(this,"col");this.file=e,this.offset=t,this.line=r,this.col=s}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){let t=this.file.content,r=t.length,s=this.offset,i=this.line,o=this.col;for(;s>0&&e<0;)if(s--,e++,t.charCodeAt(s)==Mc){i--;let c=t.substring(0,s-1).lastIndexOf(String.fromCharCode(Mc));o=c>0?s-c:s}else o--;for(;s0;){let a=t.charCodeAt(s);s++,e--,a==Mc?(i++,o=0):o++}return new n(this.file,s,i,o)}getContext(e,t){let r=this.file.content,s=this.offset;if(s!=null){s>r.length-1&&(s=r.length-1);let i=s,o=0,a=0;for(;o0&&(s--,o++,!(r[s]==` +`&&++a==t)););for(o=0,a=0;o]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};function qW(n,e,t){let r=`in ${n} ${e} in ${t}`,s=new tw("",r);return new bt(new nv(s,-1,-1,-1),new nv(s,-1,-1,-1))}var WW=0;function zW(n){if(!n||!n.reference)return null;let e=n.reference;if(e.__anonymousType)return e.__anonymousType;if(e.__forward_ref__)return"__forward_ref__";let t=pF(e);return t.indexOf("(")>=0?(t=`anonymous_${WW++}`,e.__anonymousType=t):t=Cg(t),t}function Cg(n){return n.replace(/\W/g,"_")}var XP='(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})',aD=class extends qT{constructor(){super(!1)}visitWrappedNodeExpr(e,t){throw new Error("Cannot emit a WrappedNodeExpr in Javascript.")}visitDeclareVarStmt(e,t){return t.print(e,`var ${e.name}`),e.value&&(t.print(e," = "),e.value.visitExpression(this,t)),t.println(e,";"),null}visitTaggedTemplateLiteralExpr(e,t){let r=e.template.elements;return e.tag.visitExpression(this,t),t.print(e,`(${XP}(`),t.print(e,`[${r.map(s=>Tc(s.text,!1)).join(", ")}], `),t.print(e,`[${r.map(s=>Tc(s.rawText,!1)).join(", ")}])`),e.template.expressions.forEach(s=>{t.print(e,", "),s.visitExpression(this,t)}),t.print(e,")"),null}visitTemplateLiteralExpr(e,t){t.print(e,"`");for(let r=0;r"),Array.isArray(e.body))t.println(e,"{"),t.incIndent(),this.visitAllStatements(e.body,t),t.decIndent(),t.print(e,"}");else{let r=e.body instanceof ko;r&&t.print(e,"("),e.body.visitExpression(this,t),r&&t.print(e,")")}return null}visitDeclareFunctionStmt(e,t){return t.print(e,`function ${e.name}(`),this._visitParams(e.params,t),t.println(e,") {"),t.incIndent(),this.visitAllStatements(e.statements,t),t.decIndent(),t.println(e,"}"),null}visitLocalizedString(e,t){t.print(e,`$localize(${XP}(`);let r=[e.serializeI18nHead()];for(let s=1;sTc(s.cooked,!1)).join(", ")}], `),t.print(e,`[${r.map(s=>Tc(s.raw,!1)).join(", ")}])`),e.expressions.forEach(s=>{t.print(e,", "),s.visitExpression(this,t)}),t.print(e,")"),null}_visitParams(e,t){this.visitAllObjects(r=>t.print(null,r.name),e,t,",")}},s0;function GW(){if(s0===void 0){let n=Eg.trustedTypes;if(s0=null,n)try{s0=n.createPolicy("angular#unsafe-jit",{createScript:e=>e})}catch{}}return s0}function ZW(n){return GW()?.createScript(n)||n}function QP(...n){if(!Eg.trustedTypes)return new Function(...n);let e=n.slice(0,-1).join(","),t=n[n.length-1],r=`(function anonymous(${e} +) { ${t} +})`,s=Eg.eval(ZW(r));return s.bind===void 0?new Function(...n):(s.toString=()=>r,s.bind(Eg))}var lD=class{evaluateStatements(e,t,r,s){let i=new cD(r),o=UT.createRoot();return t.length>0&&!YW(t[0])&&(t=[Y("use strict").toStmt(),...t]),i.visitAllStatements(t,o),i.createReturnStmt(o),this.evaluateCode(e,o,i.getArgs(),s)}evaluateCode(e,t,r,s){let i=`"use strict";${t.toSource()} +//# sourceURL=${e}`,o=[],a=[];for(let u in r)a.push(r[u]),o.push(u);if(s){let u=QP(...o.concat("return null;")).toString(),d=u.slice(0,u.indexOf("return null;")).split(` +`).length-1;i+=` +${t.toSourceMapGenerator(e,d).toJsComment()}`}let c=QP(...o.concat(i));return this.executeFunction(c,a)}executeFunction(e,t){return e(...t)}},cD=class extends aD{constructor(t){super();l(this,"refResolver");l(this,"_evalArgNames",[]);l(this,"_evalArgValues",[]);l(this,"_evalExportedVars",[]);this.refResolver=t}createReturnStmt(t){new Qr(new ko(this._evalExportedVars.map(s=>new kp(s,kt(s),!1)))).visitStatement(this,t)}getArgs(){let t={};for(let r=0;r0&&e.set("imports",tn(n.imports));let t=Ze(v.defineInjector).callFn([e.toLiteralMap()],void 0,!0),r=XW(n);return{expression:t,type:r,statements:[]}}function XW(n){return new gi(Ze(v.InjectorDeclaration,[new gi(n.type.type)]))}var uD=class{constructor(e){l(this,"context");this.context=e}resolveExternalReference(e){if(e.moduleName!=="@angular/core")throw new Error(`Cannot resolve external reference to ${e.moduleName}, only references to @angular/core are supported.`);if(!this.context.hasOwnProperty(e.name))throw new Error(`No value provided for @angular/core symbol '${e.name}'.`);return this.context[e.name]}},rv;(function(n){n[n.Inline=0]="Inline",n[n.SideEffect=1]="SideEffect",n[n.Omit=2]="Omit"})(rv||(rv={}));var ga;(function(n){n[n.Global=0]="Global",n[n.Local=1]="Local"})(ga||(ga={}));function QW(n){let e=[],t=new Dl;if(t.set("type",n.type.value),n.kind===ga.Global&&n.bootstrap.length>0&&t.set("bootstrap",Dc(n.bootstrap,n.containsForwardDecls)),n.selectorScopeMode===rv.Inline)n.declarations.length>0&&t.set("declarations",Dc(n.declarations,n.containsForwardDecls)),n.imports.length>0&&t.set("imports",Dc(n.imports,n.containsForwardDecls)),n.exports.length>0&&t.set("exports",Dc(n.exports,n.containsForwardDecls));else if(n.selectorScopeMode===rv.SideEffect){let i=ez(n);i!==null&&e.push(i)}n.schemas!==null&&n.schemas.length>0&&t.set("schemas",tn(n.schemas.map(i=>i.value))),n.id!==null&&(t.set("id",n.id),e.push(Ze(v.registerNgModuleType).callFn([n.type.value,n.id]).toStmt()));let r=Ze(v.defineNgModule).callFn([t.toLiteralMap()],void 0,!0),s=JW(n);return{expression:r,type:s,statements:e}}function KW(n){let e=new Dl;return e.set("type",new Ft(n.type)),n.bootstrap!==void 0&&e.set("bootstrap",new Ft(n.bootstrap)),n.declarations!==void 0&&e.set("declarations",new Ft(n.declarations)),n.imports!==void 0&&e.set("imports",new Ft(n.imports)),n.exports!==void 0&&e.set("exports",new Ft(n.exports)),n.schemas!==void 0&&e.set("schemas",new Ft(n.schemas)),n.id!==void 0&&e.set("id",new Ft(n.id)),Ze(v.defineNgModule).callFn([e.toLiteralMap()])}function JW(n){if(n.kind===ga.Local)return new gi(n.type.value);let{type:e,declarations:t,exports:r,imports:s,includeImportTypes:i,publicDeclarationTypes:o}=n;return new gi(Ze(v.NgModuleDeclaration,[new gi(e.type),o===null?hT(t):tz(o),i?hT(s):_o,hT(r)]))}function ez(n){let e=new Dl;if(n.kind===ga.Global?n.declarations.length>0&&e.set("declarations",Dc(n.declarations,n.containsForwardDecls)):n.declarationsExpression&&e.set("declarations",n.declarationsExpression),n.kind===ga.Global?n.imports.length>0&&e.set("imports",Dc(n.imports,n.containsForwardDecls)):n.importsExpression&&e.set("imports",n.importsExpression),n.kind===ga.Global?n.exports.length>0&&e.set("exports",Dc(n.exports,n.containsForwardDecls)):n.exportsExpression&&e.set("exports",n.exportsExpression),n.kind===ga.Local&&n.bootstrapExpression&&e.set("bootstrap",n.bootstrapExpression),Object.keys(e.values).length===0)return null;let t=new Cs(Ze(v.setNgModuleScope),[n.type.value,e.toLiteralMap()]),r=uW(t),s=new wl([],[r.toStmt()]);return new Cs(s,[]).toStmt()}function hT(n){let e=n.map(t=>bv(t.type));return n.length>0?$r(tn(e)):_o}function tz(n){let e=n.map(t=>bv(t));return n.length>0?$r(tn(e)):_o}function JP(n){let e=[];e.push({key:"name",value:Y(n.pipeName),quoted:!1}),e.push({key:"type",value:n.type.value,quoted:!1}),e.push({key:"pure",value:Y(n.pure),quoted:!1}),n.isStandalone===!1&&e.push({key:"standalone",value:Y(!1),quoted:!1});let t=Ze(v.definePipe).callFn([cs(e)],void 0,!0),r=nz(n);return{expression:t,type:r,statements:[]}}function nz(n){return new gi(Ze(v.PipeDeclaration,[Ow(n.type.type,n.typeArgumentCount),new gi(new Hr(n.pipeName)),new gi(new Hr(n.isStandalone))]))}var sv;(function(n){n[n.Directive=0]="Directive",n[n.Pipe=1]="Pipe",n[n.NgModule=2]="NgModule"})(sv||(sv={}));var rz=new Set(["inherit","initial","revert","unset","alternate","alternate-reverse","normal","reverse","backwards","both","forwards","none","paused","running","ease","ease-in","ease-in-out","ease-out","linear","step-start","step-end","end","jump-both","jump-end","jump-none","jump-start","start"]),sz=["@media","@supports","@document","@layer","@container","@scope","@starting-style"],dD=class{constructor(){l(this,"_animationDeclarationKeyframesRe",/(^|\s+|,)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g);l(this,"_safeSelector");l(this,"_shouldScopeIndicator")}shimCssText(e,t,r=""){let s=[];e=e.replace(vz,a=>{if(a.match(yz))s.push(a);else{let c=a.match(gz);s.push((c?.join("")??"")+` +`)}return vI}),e=this._insertDirectives(e);let i=this._scopeCssText(e,t,r),o=0;return i.replace(bz,()=>s[o++])}_insertDirectives(e){return e=this._insertPolyfillDirectivesInCssText(e),this._insertPolyfillRulesInCssText(e)}_scopeKeyframesRelatedCss(e,t){let r=new Set,s=i0(e,i=>this._scopeLocalKeyframeDeclarations(i,t,r));return i0(s,i=>this._scopeAnimationRule(i,t,r))}_scopeLocalKeyframeDeclarations(e,t,r){return{...e,selector:e.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/,(s,i,o,a,c)=>(r.add(nR(a,o)),`${i}${o}${t}_${a}${o}${c}`))}}_scopeAnimationKeyframe(e,t,r){return e.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/,(s,i,o,a,c)=>(a=`${r.has(nR(a,o))?t+"_":""}${a}`,`${i}${o}${a}${o}${c}`))}_scopeAnimationRule(e,t,r){let s=e.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation\s*:\s*),*([^;]+)/g,(i,o,a)=>o+a.replace(this._animationDeclarationKeyframesRe,(c,u,d="",p,f)=>p?`${u}${this._scopeAnimationKeyframe(`${d}${p}${d}`,t,r)}`:rz.has(f)?c:`${u}${this._scopeAnimationKeyframe(f,t,r)}`));return s=s.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g,(i,o,a)=>`${o}${a.split(",").map(c=>this._scopeAnimationKeyframe(c,t,r)).join(",")}`),{...e,content:s}}_insertPolyfillDirectivesInCssText(e){return e.replace(oz,function(...t){return t[2]+"{"})}_insertPolyfillRulesInCssText(e){return e.replace(az,(...t)=>{let r=t[0].replace(t[1],"").replace(t[2],"");return t[4]+r})}_scopeCssText(e,t,r){let s=this._extractUnscopedRulesFromCssText(e);return e=this._insertPolyfillHostInCssText(e),e=this._convertColonHost(e),e=this._convertColonHostContext(e),e=this._convertShadowDOMSelectors(e),t&&(e=this._scopeKeyframesRelatedCss(e,t),e=this._scopeSelectors(e,t,r)),e=e+` +`+s,e.trim()}_extractUnscopedRulesFromCssText(e){let t="",r;for(eR.lastIndex=0;(r=eR.exec(e))!==null;){let s=r[0].replace(r[2],"").replace(r[1],r[4]);t+=s+` + +`}return t}_convertColonHost(e){return e.replace(lz,(t,r,s)=>{if(r){let i=[],o=r.split(",").map(a=>a.trim());for(let a of o){if(!a)break;let c=ml+a.replace(nw,"")+s;i.push(c)}return i.join(",")}else return ml+s})}_convertColonHostContext(e){let t=e.length,r=0,s=0,i="";for(let o=0;o{let s=[[]],i;for(;i=uz.exec(t);){let o=(i[1]??"").trim().split(",").map(c=>c.trim()).filter(c=>c!==""),a=s.length;Az(s,o.length);for(let c=0;ckz(o,t,r)).join(", ")})}_convertShadowDOMSelectors(e){return pz.reduce((t,r)=>t.replace(r," "),e)}_scopeSelectors(e,t,r){return i0(e,s=>{let i=s.selector,o=s.content;return s.selector[0]!=="@"?i=this._scopeSelector({selector:i,scopeSelector:t,hostSelector:r,isParentSelector:!0}):sz.some(a=>s.selector.startsWith(a))?o=this._scopeSelectors(s.content,t,r):(s.selector.startsWith("@font-face")||s.selector.startsWith("@page"))&&(o=this._stripScopingSelectors(s.content)),new iv(i,o)})}_stripScopingSelectors(e){return i0(e,t=>{let r=t.selector.replace(tR," ").replace(mT," ");return new iv(r,t.content)})}_scopeSelector({selector:e,scopeSelector:t,hostSelector:r,isParentSelector:s=!1}){let i=/ ?,(?!(?:[^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\))) ?/;return e.split(i).map(o=>o.split(tR)).map(o=>{let[a,...c]=o;return[(d=>this._selectorNeedsScoping(d,t)?this._applySelectorScope({selector:d,scopeSelector:t,hostSelector:r,isParentSelector:s}):d)(a),...c].join(" ")}).join(", ")}_selectorNeedsScoping(e,t){return!this._makeScopeMatcher(t).test(e)}_makeScopeMatcher(e){let t=/\[/g,r=/\]/g;return e=e.replace(t,"\\[").replace(r,"\\]"),new RegExp("^("+e+")"+fz,"m")}_applySimpleSelectorScope(e,t,r){if(vp.lastIndex=0,vp.test(e)){let s=`[${r}]`,i=e;for(;i.match(mT);)i=i.replace(mT,(o,a)=>a.replace(/([^:\)]*)(:*)(.*)/,(c,u,d,p)=>u+s+d+p));return i.replace(vp,s)}return t+" "+e}_applySelectorScope({selector:e,scopeSelector:t,hostSelector:r,isParentSelector:s}){let i=/\[is=([^\]]*)\]/g;t=t.replace(i,(g,...y)=>y[0]);let o=`[${t}]`,a=g=>{let y=g.trim();if(!y)return g;if(g.includes(ml)){if(y=this._applySimpleSelectorScope(g,t,r),!g.match(dz)){let[b,E,_,V]=y.match(/([^:]*)(:*)([\s\S]*)/);y=E+o+_+V}}else{let b=g.replace(vp,"");if(b.length>0){let E=b.match(/([^:]*)(:*)([\s\S]*)/);E&&(y=E[1]+o+E[2]+E[3])}}return y},c=g=>{let y="",b=[],E;for(;(E=fg.exec(g))!==null;){let _=1,V=fg.lastIndex;for(;V{let[V]=_.match(fg)??[],M=_.slice(V?.length,-1);M.includes(ml)&&(this._shouldScopeIndicator=!0);let j=this._scopeSelector({selector:M,scopeSelector:t,hostSelector:r});return`${V}${j})`}).join(""):(this._shouldScopeIndicator=this._shouldScopeIndicator||g.includes(ml),y=this._shouldScopeIndicator?a(g):g),y};s&&(this._safeSelector=new pD(e),e=this._safeSelector.content());let u="",d=0,p,f=/( |>|\+|~(?!=))(?!([^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\)))\s*/g,h=e.includes(ml);for((s||this._shouldScopeIndicator)&&(this._shouldScopeIndicator=!h);(p=f.exec(e))!==null;){let g=p[1],y=e.slice(d,p.index);if(y.match(/__esc-ph-(\d+)__/)&&e[p.index+1]?.match(/[a-fA-F\d]/))continue;let b=c(y);u+=`${b} ${g} `,d=f.lastIndex}let m=e.substring(d);return u+=c(m),this._safeSelector.restore(u)}_insertPolyfillHostInCssText(e){return e.replace(mz,NF).replace(hz,nw)}},pD=class{constructor(e){l(this,"placeholders",[]);l(this,"index",0);l(this,"_content");e=this._escapeRegexMatches(e,/(\[[^\]]*\])/g),e=e.replace(/(\\.)/g,(t,r)=>{let s=`__esc-ph-${this.index}__`;return this.placeholders.push(r),this.index++,s}),this._content=e.replace(/(:nth-[-\w]+)(\([^)]+\))/g,(t,r,s)=>{let i=`__ph-${this.index}__`;return this.placeholders.push(s),this.index++,r+i})}restore(e){return e.replace(/__(?:ph|esc-ph)-(\d+)__/g,(t,r)=>this.placeholders[+r])}content(){return this._content}_escapeRegexMatches(e,t){return e.replace(t,(r,s)=>{let i=`__ph-${this.index}__`;return this.placeholders.push(s),this.index++,i})}},iz="(:(where|is)\\()?",fg=/:(where|is)\(/gi,oz=/polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim,az=/(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim,eR=/(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim,nw="-shadowcsshost",NF="-shadowcsscontext",PF="(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))",lz=new RegExp(nw+PF+"?([^,{]*)","gim"),RF=NF+PF+"?([^{]*)",cz=new RegExp(`${iz}(${RF})`,"gim"),uz=new RegExp(RF,"im"),ml=nw+"-no-combinator",dz=new RegExp(`${ml}(?![^(]*\\))`,"g"),mT=/-shadowcsshost-no-combinator([^\s,]*)/,pz=[/::shadow/g,/::content/g,/\/shadow-deep\//g,/\/shadow\//g],tR=/(?:>>>)|(?:\/deep\/)|(?:::ng-deep)/g,fz="([>\\s~+[.,{:][\\s\\S]*)?$",vp=/-shadowcsshost/gim,hz=/:host/gim,mz=/:host-context/gim,gz=/\r?\n/g,vz=/\/\*[\s\S]*?\*\//g,yz=/\/\*\s*#\s*source(Mapping)?URL=/g,vI="%COMMENT%",bz=new RegExp(vI,"g"),gT="%BLOCK%",wz=new RegExp(`(\\s*(?:${vI}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g"),Ez=new Map([["{","}"]]),FF="%COMMA_IN_PLACEHOLDER%",LF="%SEMI_IN_PLACEHOLDER%",OF="%COLON_IN_PLACEHOLDER%",xz=new RegExp(FF,"g"),Sz=new RegExp(LF,"g"),Cz=new RegExp(OF,"g"),iv=class{constructor(e,t){l(this,"selector");l(this,"content");this.selector=e,this.content=t}};function i0(n,e){let t=Iz(n),r=Tz(t,Ez,gT),s=0,i=r.escapedString.replace(wz,(...o)=>{let a=o[2],c="",u=o[4],d="";u&&u.startsWith("{"+gT)&&(c=r.blocks[s++],u=u.substring(gT.length+1),d="{");let p=e(new iv(a,c));return`${o[1]}${p.selector}${o[3]}${d}${p.content}${u}`});return _z(i)}var fD=class{constructor(e,t){l(this,"escapedString");l(this,"blocks");this.escapedString=e,this.blocks=t}};function Tz(n,e,t){let r=[],s=[],i=0,o=0,a=-1,c,u;for(let d=0;d0;){let o=i.length,a=n.pop();for(let c=0;cs?`${t}${o}${e}`:`${t}${o}${r}${e}, ${t}${o} ${r}${e}`).join(",")}function Az(n,e){let t=n.length;for(let r=1;rr.isEquivalent(this.args[s]))}isConstant(){return!1}transformInternalExpressions(t,r){this.body!==null?this.body=Be(this.body,t,r|Qt.InChildOperation):this.fn!==null&&(this.fn=Be(this.fn,t,r));for(let s=0;sr.clone()));return t.fn=this.fn?.clone()??null,t.varOffset=this.varOffset,t}};DJ=Gp,IJ=Hw;var Wc=Fw,Bp=class n extends mn{constructor(t){super();l(this,"index");l(this,"kind",Ye.PureFunctionParameterExpr);this.index=t}visitExpression(){}isEquivalent(t){return t instanceof n&&t.index===this.index}isConstant(){return!0}transformInternalExpressions(){}clone(){return new n(this.index)}},_J,kJ,_I=class _I extends mn{constructor(t,r,s,i){super();l(this,"target");l(this,"targetSlot");l(this,"name");l(this,"args");l(this,"kind",Ye.PipeBinding);l(this,_J,!0);l(this,kJ,!0);l(this,"varOffset",null);this.target=t,this.targetSlot=r,this.name=s,this.args=i}visitExpression(t,r){for(let s of this.args)s.visitExpression(t,r)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(t,r){for(let s=0;sr.clone()));return t.varOffset=this.varOffset,t}};_J=Gp,kJ=Hw;var Vp=_I,AJ,MJ,kI=class kI extends mn{constructor(t,r,s,i,o){super();l(this,"target");l(this,"targetSlot");l(this,"name");l(this,"args");l(this,"numArgs");l(this,"kind",Ye.PipeBindingVariadic);l(this,AJ,!0);l(this,MJ,!0);l(this,"varOffset",null);this.target=t,this.targetSlot=r,this.name=s,this.args=i,this.numArgs=o}visitExpression(t,r){this.args.visitExpression(t,r)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(t,r){this.args=Be(this.args,t,r)}clone(){let t=new kI(this.target,this.targetSlot,this.name,this.args.clone(),this.numArgs);return t.varOffset=this.varOffset,t}};AJ=Gp,MJ=Hw;var lw=kI,$p=class n extends mn{constructor(t,r){super();l(this,"receiver");l(this,"name");l(this,"kind",Ye.SafePropertyRead);this.receiver=t,this.name=r}get index(){return this.name}visitExpression(t,r){this.receiver.visitExpression(t,r)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(t,r){this.receiver=Be(this.receiver,t,r)}clone(){return new n(this.receiver.clone(),this.name)}},Hp=class n extends mn{constructor(t,r,s){super(s);l(this,"receiver");l(this,"index");l(this,"kind",Ye.SafeKeyedRead);this.receiver=t,this.index=r}visitExpression(t,r){this.receiver.visitExpression(t,r),this.index.visitExpression(t,r)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(t,r){this.receiver=Be(this.receiver,t,r),this.index=Be(this.index,t,r)}clone(){return new n(this.receiver.clone(),this.index.clone(),this.sourceSpan)}},zc=class n extends mn{constructor(t,r){super();l(this,"receiver");l(this,"args");l(this,"kind",Ye.SafeInvokeFunction);this.receiver=t,this.args=r}visitExpression(t,r){this.receiver.visitExpression(t,r);for(let s of this.args)s.visitExpression(t,r)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(t,r){this.receiver=Be(this.receiver,t,r);for(let s=0;st.clone()))}},jp=class n extends mn{constructor(t,r){super();l(this,"guard");l(this,"expr");l(this,"kind",Ye.SafeTernaryExpr);this.guard=t,this.expr=r}visitExpression(t,r){this.guard.visitExpression(t,r),this.expr.visitExpression(t,r)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(t,r){this.guard=Be(this.guard,t,r),this.expr=Be(this.expr,t,r)}clone(){return new n(this.guard.clone(),this.expr.clone())}},lv=class n extends mn{constructor(){super(...arguments);l(this,"kind",Ye.EmptyExpr)}visitExpression(t,r){}isEquivalent(t){return t instanceof n}isConstant(){return!0}clone(){return new n}transformInternalExpressions(){}},qi=class n extends mn{constructor(t,r){super();l(this,"expr");l(this,"xref");l(this,"kind",Ye.AssignTemporaryExpr);l(this,"name",null);this.expr=t,this.xref=r}visitExpression(t,r){this.expr.visitExpression(t,r)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(t,r){this.expr=Be(this.expr,t,r)}clone(){let t=new n(this.expr.clone(),this.xref);return t.name=this.name,t}},Ca=class n extends mn{constructor(t){super();l(this,"xref");l(this,"kind",Ye.ReadTemporaryExpr);l(this,"name",null);this.xref=t}visitExpression(t,r){}isEquivalent(){return this.xref===this.xref}isConstant(){return!1}transformInternalExpressions(t,r){}clone(){let t=new n(this.xref);return t.name=this.name,t}},cw=class n extends mn{constructor(t){super();l(this,"slot");l(this,"kind",Ye.SlotLiteralExpr);this.slot=t}visitExpression(t,r){}isEquivalent(t){return t instanceof n&&t.slot===this.slot}isConstant(){return!0}clone(){return new n(this.slot)}transformInternalExpressions(){}},uw=class n extends mn{constructor(t,r,s,i=null){super();l(this,"expr");l(this,"target");l(this,"targetSlot");l(this,"alias");l(this,"kind",Ye.ConditionalCase);this.expr=t,this.target=r,this.targetSlot=s,this.alias=i}visitExpression(t,r){this.expr!==null&&this.expr.visitExpression(t,r)}isEquivalent(t){return t instanceof n&&t.expr===this.expr}isConstant(){return!0}clone(){return new n(this.expr,this.target,this.targetSlot)}transformInternalExpressions(t,r){this.expr!==null&&(this.expr=Be(this.expr,t,r))}},cv=class n extends mn{constructor(t){super();l(this,"expr");l(this,"kind",Ye.ConstCollected);this.expr=t}transformInternalExpressions(t,r){this.expr=t(this.expr,r)}visitExpression(t,r){this.expr.visitExpression(t,r)}isEquivalent(t){return t instanceof n?this.expr.isEquivalent(t.expr):!1}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr)}};function es(n,e){ur(n,(t,r)=>(e(t,r),t),Qt.None)}var Qt;(function(n){n[n.None=0]="None",n[n.InChildOperation=1]="InChildOperation"})(Qt||(Qt={}));function yT(n,e,t){for(let r=0;rBe(r,e,t));else if(n instanceof Lc)if(Array.isArray(n.body))for(let r=0;rs==="")&&(t.expression=t.expression.expressions[0])}function wG(n){for(let e of n.units)for(let t of e.ops()){if(t.kind!==w.Conditional)continue;let r,s=t.conditions.findIndex(o=>o.expr===null);if(s>=0){let o=t.conditions.splice(s,1)[0].targetSlot;r=new cw(o)}else r=Y(-1);let i=t.test==null?null:new qi(t.test,n.allocateXrefId());for(let o=t.conditions.length-1;o>=0;o--){let a=t.conditions[o];if(a.expr!==null){if(i!==null){let c=o===0?i:new Ca(i.xref);a.expr=new Xt(Ge.Identical,c,a.expr)}else if(a.alias!==null){let c=n.allocateXrefId();a.expr=new qi(a.expr,c),t.contextValue=new Ca(c)}r=new Ea(a.expr,new cw(a.targetSlot),r)}}t.processed=r,t.conditions=[]}}var EG=new Map([["&&",Ge.And],[">",Ge.Bigger],[">=",Ge.BiggerEquals],["|",Ge.BitwiseOr],["&",Ge.BitwiseAnd],["/",Ge.Divide],["==",Ge.Equals],["===",Ge.Identical],["<",Ge.Lower],["<=",Ge.LowerEquals],["-",Ge.Minus],["%",Ge.Modulo],["*",Ge.Multiply],["!=",Ge.NotEquals],["!==",Ge.NotIdentical],["??",Ge.NullishCoalesce],["||",Ge.Or],["+",Ge.Plus]]);function ZF(n){let e=new Map([["svg",rr.SVG],["math",rr.Math]]);return n===null?rr.HTML:e.get(n)??rr.HTML}function xG(n){let e=new Map([["svg",rr.SVG],["math",rr.Math]]);for(let[t,r]of e.entries())if(r===n)return t;return null}function SG(n,e){return e===rr.HTML?n:`:${xG(e)}:${n}`}function Up(n){return Array.isArray(n)?tn(n.map(Up)):Y(n)}function CG(n){let e=new Map;for(let t of n.units)for(let r of t.create)if(r.kind===w.ExtractedAttribute){let s=e.get(r.target)||new yD(n.compatibility);e.set(r.target,s),s.add(r.bindingKind,r.name,r.expression,r.namespace,r.trustedValueFn),ge.remove(r)}if(n instanceof uv)for(let t of n.units)for(let r of t.create)if(r.kind==w.Projection){let s=e.get(r.xref);if(s!==void 0){let i=bD(s);i.entries.length>0&&(r.attributes=i)}}else Gc(r)&&(r.attributes=iR(n,e,r.xref),r.kind===w.RepeaterCreate&&r.emptyView!==null&&(r.emptyAttributes=iR(n,e,r.emptyView)));else if(n instanceof hw)for(let[t,r]of e.entries()){if(t!==n.root.xref)throw new Error("An attribute would be const collected into the host binding's template function, but is not associated with the root xref.");let s=bD(r);s.entries.length>0&&(n.root.attributes=s)}}function iR(n,e,t){let r=e.get(t);if(r!==void 0){let s=bD(r);if(s.entries.length>0)return n.addConst(s)}return null}var op=Object.freeze([]),yD=class{constructor(e){l(this,"compatibility");l(this,"known",new Map);l(this,"byKind",new Map);l(this,"propertyBindings",null);l(this,"projectAs",null);this.compatibility=e}get attributes(){return this.byKind.get(Qe.Attribute)??op}get classes(){return this.byKind.get(Qe.ClassName)??op}get styles(){return this.byKind.get(Qe.StyleProperty)??op}get bindings(){return this.propertyBindings??op}get template(){return this.byKind.get(Qe.Template)??op}get i18n(){return this.byKind.get(Qe.I18n)??op}isKnown(e,t){let r=this.known.get(e)??new Set;return this.known.set(e,r),r.has(t)?!0:(r.add(t),!1)}add(e,t,r,s,i){if(!(this.compatibility===Ts.TemplateDefinitionBuilder&&(e===Qe.Attribute||e===Qe.ClassName||e===Qe.StyleProperty))&&this.isKnown(e,t))return;if(t==="ngProjectAs"){if(r===null||!(r instanceof Hr)||r.value==null||typeof r.value?.toString()!="string")throw Error("ngProjectAs must have a string literal value");this.projectAs=r.value.toString()}let a=this.arrayFor(e);if(a.push(...TG(s,t)),e===Qe.Attribute||e===Qe.StyleProperty){if(r===null)throw Error("Attribute, i18n attribute, & style element attributes must have a value");i!==null&&HF(r)?a.push(qq(i,new Ng([new S0(r.value)],[]),void 0,r.sourceSpan)):a.push(r)}}arrayFor(e){return e===Qe.Property||e===Qe.TwoWayProperty?(this.propertyBindings??(this.propertyBindings=[]),this.propertyBindings):(this.byKind.has(e)||this.byKind.set(e,[]),this.byKind.get(e))}};function TG(n,e){let t=Y(e);return n?[Y(0),Y(n),t]:[t]}function bD({attributes:n,bindings:e,classes:t,i18n:r,projectAs:s,styles:i,template:o}){let a=[...n];if(s!==null){let c=sI(s)[0];a.push(Y(5),Up(c))}return t.length>0&&a.push(Y(1),...t),i.length>0&&a.push(Y(2),...i),e.length>0&&a.push(Y(3),...e),o.length>0&&a.push(Y(4),...o),r.length>0&&a.push(Y(6),...r),tn(a)}function DG(n){let e=new Map;for(let t of n.units){for(let r of t.create)r.kind===w.I18nAttributes&&e.set(r.target,r);for(let r of t.update)switch(r.kind){case w.Property:case w.Attribute:if(r.i18nContext===null||!(r.expression instanceof nr))continue;let s=e.get(r.target);if(s===void 0)throw new Error("AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction");if(s.target!==r.target)throw new Error("AssertionError: Expected i18nAttributes target element to match binding target element");let i=[];for(let o=0;ojG(r,{job:n}),Qt.None),ur(t,UG,Qt.None)}function li(n){return n instanceof _p?li(n.expr):n instanceof Xt?li(n.lhs)||li(n.rhs):n instanceof Ea?n.falseCase&&li(n.falseCase)?!0:li(n.condition)||li(n.trueCase):n instanceof Pg?li(n.condition):n instanceof qi?li(n.expr):n instanceof zs?li(n.receiver):n instanceof xa?li(n.receiver)||li(n.index):n instanceof Cs||n instanceof Hi||n instanceof ko||n instanceof zc||n instanceof Vp}function OG(n){let e=new Set;return Be(n,t=>(t instanceof qi&&e.add(t.xref),t),Qt.None),e}function BG(n,e,t){return Be(n,r=>{if(r instanceof qi&&e.has(r.xref)){let s=new Ca(r.xref);return t.job.compatibility===Ts.TemplateDefinitionBuilder?new qi(s,s.xref):s}return r},Qt.None),n}function ap(n,e,t){let r;if(li(n)){let s=t.job.allocateXrefId();r=[new qi(n,s),new Ca(s)]}else r=[n,n.clone()],BG(r[1],OG(r[0]),t);return new jp(r[0],e(r[1]))}function VG(n){return n instanceof $p||n instanceof Hp||n instanceof zc}function $G(n){return n instanceof zs||n instanceof xa||n instanceof Cs}function YF(n){return VG(n)||$G(n)}function HG(n){if(YF(n)&&n.receiver instanceof jp){let e=n.receiver;for(;e.expr instanceof jp;)e=e.expr;return e}return null}function jG(n,e){if(!YF(n))return n;let t=HG(n);if(t){if(n instanceof Cs)return t.expr=t.expr.callFn(n.args),n.receiver;if(n instanceof zs)return t.expr=t.expr.prop(n.name),n.receiver;if(n instanceof xa)return t.expr=t.expr.key(n.index),n.receiver;if(n instanceof zc)return t.expr=ap(t.expr,r=>r.callFn(n.args),e),n.receiver;if(n instanceof $p)return t.expr=ap(t.expr,r=>r.prop(n.name),e),n.receiver;if(n instanceof Hp)return t.expr=ap(t.expr,r=>r.key(n.index),e),n.receiver}else{if(n instanceof zc)return ap(n.receiver,r=>r.callFn(n.args),e);if(n instanceof $p)return ap(n.receiver,r=>r.prop(n.name),e);if(n instanceof Hp)return ap(n.receiver,r=>r.key(n.index),e)}return n}function UG(n){return n instanceof jp?new Ea(new Xt(Ge.Equals,n.guard,Rg),Rg,n.expr):n}var oR="\uFFFD",qG="#",WG="*",zG="/",GG=":",ZG="[",YG="]",XG="|";function QG(n){let e=new Map,t=new Map,r=new Map;for(let i of n.units)for(let o of i.create)switch(o.kind){case w.I18nContext:let a=KG(n,o);i.create.push(a),e.set(o.xref,a),r.set(o.xref,o);break;case w.I18nStart:t.set(o.xref,o);break}let s=null;for(let i of n.units)for(let o of i.create)switch(o.kind){case w.IcuStart:s=o,ge.remove(o);let a=r.get(o.context);if(a.contextKind!==bl.Icu)continue;let c=t.get(a.i18nBlock);if(c.context===a.xref)continue;let u=t.get(c.root),d=e.get(u.context);if(d===void 0)throw Error("AssertionError: ICU sub-message should belong to a root message.");let p=e.get(a.xref);p.messagePlaceholder=o.messagePlaceholder,d.subMessages.push(p.xref);break;case w.IcuEnd:s=null,ge.remove(o);break;case w.IcuPlaceholder:if(s===null||s.context==null)throw Error("AssertionError: Unexpected ICU placeholder outside of i18n context");e.get(s.context).postprocessingParams.set(o.name,Y(JG(o))),ge.remove(o);break}}function KG(n,e,t){let r=aR(e.params),s=aR(e.postprocessingParams),i=[...e.params.values()].some(o=>o.length>1);return tG(n.allocateXrefId(),e.xref,e.i18nBlock,e.message,null,r,s,i)}function JG(n){if(n.strings.length!==n.expressionPlaceholders.length+1)throw Error(`AssertionError: Invalid ICU placeholder with ${n.strings.length} strings and ${n.expressionPlaceholders.length} expressions`);let e=n.expressionPlaceholders.map(yp);return n.strings.flatMap((t,r)=>[t,e[r]||""]).join("")}function aR(n){let e=new Map;for(let[t,r]of n){let s=e7(r);s!==null&&e.set(t,Y(s))}return e}function e7(n){if(n.length===0)return null;let e=n.map(t=>yp(t));return e.length===1?e[0]:`${ZG}${e.join(XG)}${YG}`}function yp(n){if(n.flags&hn.ElementTag&&n.flags&hn.TemplateTag){if(typeof n.value!="object")throw Error("AssertionError: Expected i18n param value to have an element and template slot");let s=yp({...n,value:n.value.element,flags:n.flags&~hn.TemplateTag}),i=yp({...n,value:n.value.template,flags:n.flags&~hn.ElementTag});return n.flags&hn.OpenTag&&n.flags&hn.CloseTag?`${i}${s}${i}`:n.flags&hn.CloseTag?`${s}${i}`:`${i}${s}`}if(n.flags&hn.OpenTag&&n.flags&hn.CloseTag)return`${yp({...n,flags:n.flags&~hn.CloseTag})}${yp({...n,flags:n.flags&~hn.OpenTag})}`;if(n.flags===hn.None)return`${n.value}`;let e="",t="";n.flags&hn.ElementTag?e=qG:n.flags&hn.TemplateTag&&(e=WG),e!==""&&(t=n.flags&hn.CloseTag?zG:"");let r=n.subTemplateIndex===null?"":`${GG}${n.subTemplateIndex}`;return`${oR}${t}${e}${n.value}${r}${oR}`}function t7(n){for(let e of n.units){let t=new Map;for(let s of e.create){if(Zp(s)){if(s.handle.slot===null)throw new Error("AssertionError: expected slots to have been allocated before generating advance() calls")}else continue;t.set(s.xref,s.handle.slot)}let r=0;for(let s of e.update){let i=null;if(rw(s)?i=s:es(s,a=>{i===null&&rw(a)&&(i=a)}),i===null)continue;if(!t.has(i.target))throw new Error(`AssertionError: reference to unknown slot for target ${i.target}`);let o=t.get(i.target);if(r!==o){let a=o-r;if(a<0)throw new Error("AssertionError: slot counter should never need to move backwards");ge.insertBefore(Vz(a,i.sourceSpan),s),r=o}}}}function n7(n){let e=n.compatibility===Ts.TemplateDefinitionBuilder,t=[],r=0;for(let s of n.units)for(let i of s.create)i.kind===w.Projection&&(t.push(i.selector),i.projectionSlotIndex=r++);if(t.length>0){let s=null;if(t.length>1||t[0]!=="*"){let i=t.map(o=>o==="*"?o:sI(o));s=n.pool.getConstLiteral(Up(i),e)}n.contentSelectors=n.pool.getConstLiteral(Up(t),e),n.root.create.prepend([Qz(s)])}}function r7(n){bg(n.root,null)}function bg(n,e){let t=s7(n,e);for(let r of n.create)switch(r.kind){case w.Template:bg(n.job.views.get(r.xref),t);break;case w.Projection:r.fallbackView!==null&&bg(n.job.views.get(r.fallbackView),t);break;case w.RepeaterCreate:bg(n.job.views.get(r.xref),t),r.emptyView&&bg(n.job.views.get(r.emptyView),t),r.trackByOps!==null&&r.trackByOps.prepend(h0(n,t,!1));break;case w.Listener:case w.TwoWayListener:r.handlerOps.prepend(h0(n,t,!0));break}n.update.prepend(h0(n,t,!1))}function s7(n,e){let t={view:n.xref,viewContextVariable:{kind:yr.Context,name:null,view:n.xref},contextVariables:new Map,aliases:n.aliases,references:[],letDeclarations:[],parent:e};for(let r of n.contextVariables.keys())t.contextVariables.set(r,{kind:yr.Identifier,name:null,identifier:r,local:!1});for(let r of n.create)switch(r.kind){case w.ElementStart:case w.Template:if(!Array.isArray(r.localRefs))throw new Error("AssertionError: expected localRefs to be an array");for(let s=0;sr instanceof cv?Y(n.addConst(r.expr)):r,Qt.None)}var lR="style.",cR="class.",o7="style!",uR="class!",dR="!important";function a7(n){for(let e of n.root.update)if(e.kind===w.Binding&&e.bindingKind===Qe.Property)if(e.name.endsWith(dR)&&(e.name=e.name.substring(0,e.name.length-dR.length)),e.name.startsWith(lR)){e.bindingKind=Qe.StyleProperty,e.name=e.name.substring(lR.length),l7(e.name)||(e.name=c7(e.name));let{property:t,suffix:r}=wT(e.name);e.name=t,e.unit=r}else e.name.startsWith(o7)?(e.bindingKind=Qe.StyleProperty,e.name="style"):e.name.startsWith(cR)?(e.bindingKind=Qe.ClassName,e.name=wT(e.name.substring(cR.length)).property):e.name.startsWith(uR)&&(e.bindingKind=Qe.ClassName,e.name=wT(e.name.substring(uR.length)).property)}function l7(n){return n.startsWith("--")}function c7(n){return n.replace(/[a-z][A-Z]/g,e=>e.charAt(0)+"-"+e.charAt(1)).toLowerCase()}function wT(n){let e=n.indexOf("!important");e!==-1&&(n=e>0?n.substring(0,e):"");let t=null,r=n,s=n.lastIndexOf(".");return s>0&&(t=n.slice(s+1),r=n.substring(0,s)),{property:r,suffix:t}}function wD(n,e=!1){return cs(Object.keys(n).map(t=>({key:t,quoted:e,value:n[t]})))}var ED=class{visitText(e){return e.value}visitContainer(e){return e.children.map(t=>t.visit(this)).join("")}visitIcu(e){let t=Object.keys(e.cases).map(s=>`${s} {${e.cases[s].visit(this)}}`);return`{${e.expressionPlaceholder}, ${e.type}, ${t.join(" ")}}`}visitTagPlaceholder(e){return e.isVoid?this.formatPh(e.startName):`${this.formatPh(e.startName)}${e.children.map(t=>t.visit(this)).join("")}${this.formatPh(e.closeName)}`}visitPlaceholder(e){return this.formatPh(e.name)}visitBlockPlaceholder(e){return`${this.formatPh(e.startName)}${e.children.map(t=>t.visit(this)).join("")}${this.formatPh(e.closeName)}`}visitIcuPlaceholder(e,t){return this.formatPh(e.name)}formatPh(e){return`{${Ev(e,!1)}}`}},u7=new ED;function XF(n){return n.visit(u7)}var Il=class{constructor(e,t){l(this,"sourceSpan");l(this,"i18n");this.sourceSpan=e,this.i18n=t}},Zc=class extends Il{constructor(t,r,s,i){super(r,i);l(this,"value");l(this,"tokens");this.value=t,this.tokens=s}visit(t,r){return t.visitText(this,r)}},Nc=class extends Il{constructor(t,r,s,i,o,a){super(i,a);l(this,"switchValue");l(this,"type");l(this,"cases");l(this,"switchValueSourceSpan");this.switchValue=t,this.type=r,this.cases=s,this.switchValueSourceSpan=o}visit(t,r){return t.visitExpansion(this,r)}},mw=class{constructor(e,t,r,s,i){l(this,"value");l(this,"expression");l(this,"sourceSpan");l(this,"valueSourceSpan");l(this,"expSourceSpan");this.value=e,this.expression=t,this.sourceSpan=r,this.valueSourceSpan=s,this.expSourceSpan=i}visit(e,t){return e.visitExpansionCase(this,t)}},xD=class extends Il{constructor(t,r,s,i,o,a,c){super(s,c);l(this,"name");l(this,"value");l(this,"keySpan");l(this,"valueSpan");l(this,"valueTokens");this.name=t,this.value=r,this.keySpan=i,this.valueSpan=o,this.valueTokens=a}visit(t,r){return t.visitAttribute(this,r)}},ci=class extends Il{constructor(t,r,s,i,o,a=null,c){super(i,c);l(this,"name");l(this,"attrs");l(this,"children");l(this,"startSourceSpan");l(this,"endSourceSpan");this.name=t,this.attrs=r,this.children=s,this.startSourceSpan=o,this.endSourceSpan=a}visit(t,r){return t.visitElement(this,r)}},dv=class{constructor(e,t){l(this,"value");l(this,"sourceSpan");this.value=e,this.sourceSpan=t}visit(e,t){return e.visitComment(this,t)}},di=class extends Il{constructor(t,r,s,i,o,a,c=null,u){super(i,u);l(this,"name");l(this,"parameters");l(this,"children");l(this,"nameSpan");l(this,"startSourceSpan");l(this,"endSourceSpan");this.name=t,this.parameters=r,this.children=s,this.nameSpan=o,this.startSourceSpan=a,this.endSourceSpan=c}visit(t,r){return t.visitBlock(this,r)}},gw=class{constructor(e,t){l(this,"expression");l(this,"sourceSpan");this.expression=e,this.sourceSpan=t}visit(e,t){return e.visitBlockParameter(this,t)}},vw=class{constructor(e,t,r,s,i){l(this,"name");l(this,"value");l(this,"sourceSpan");l(this,"nameSpan");l(this,"valueSpan");this.name=e,this.value=t,this.sourceSpan=r,this.nameSpan=s,this.valueSpan=i}visit(e,t){return e.visitLetDeclaration(this,t)}};function jn(n,e,t=null){let r=[],s=n.visit?i=>n.visit(i,t)||i.visit(n,t):i=>i.visit(n,t);return e.forEach(i=>{let o=s(i);o&&r.push(o)}),r}var pv={AElig:"\xC6",AMP:"&",amp:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",af:"\u2061",Aring:"\xC5",angst:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",colone:"\u2254",coloneq:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",setminus:"\u2216",setmn:"\u2216",smallsetminus:"\u2216",ssetmn:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",doublebarwedge:"\u2306",Bcy:"\u0411",Because:"\u2235",becaus:"\u2235",because:"\u2235",Bernoullis:"\u212C",Bscr:"\u212C",bernou:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",breve:"\u02D8",Bumpeq:"\u224E",HumpDownHump:"\u224E",bump:"\u224E",CHcy:"\u0427",COPY:"\xA9",copy:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",DD:"\u2145",Cayleys:"\u212D",Cfr:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",cedil:"\xB8",CenterDot:"\xB7",centerdot:"\xB7",middot:"\xB7",Chi:"\u03A7",CircleDot:"\u2299",odot:"\u2299",CircleMinus:"\u2296",ominus:"\u2296",CirclePlus:"\u2295",oplus:"\u2295",CircleTimes:"\u2297",otimes:"\u2297",ClockwiseContourIntegral:"\u2232",cwconint:"\u2232",CloseCurlyDoubleQuote:"\u201D",rdquo:"\u201D",rdquor:"\u201D",CloseCurlyQuote:"\u2019",rsquo:"\u2019",rsquor:"\u2019",Colon:"\u2237",Proportion:"\u2237",Colone:"\u2A74",Congruent:"\u2261",equiv:"\u2261",Conint:"\u222F",DoubleContourIntegral:"\u222F",ContourIntegral:"\u222E",conint:"\u222E",oint:"\u222E",Copf:"\u2102",complexes:"\u2102",Coproduct:"\u2210",coprod:"\u2210",CounterClockwiseContourIntegral:"\u2233",awconint:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",asympeq:"\u224D",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",ddagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",DoubleLeftTee:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",nabla:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",acute:"\xB4",DiacriticalDot:"\u02D9",dot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",dblac:"\u02DD",DiacriticalGrave:"`",grave:"`",DiacriticalTilde:"\u02DC",tilde:"\u02DC",Diamond:"\u22C4",diam:"\u22C4",diamond:"\u22C4",DifferentialD:"\u2146",dd:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DoubleDot:"\xA8",die:"\xA8",uml:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",doteq:"\u2250",esdot:"\u2250",DoubleDownArrow:"\u21D3",Downarrow:"\u21D3",dArr:"\u21D3",DoubleLeftArrow:"\u21D0",Leftarrow:"\u21D0",lArr:"\u21D0",DoubleLeftRightArrow:"\u21D4",Leftrightarrow:"\u21D4",hArr:"\u21D4",iff:"\u21D4",DoubleLongLeftArrow:"\u27F8",Longleftarrow:"\u27F8",xlArr:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",Longleftrightarrow:"\u27FA",xhArr:"\u27FA",DoubleLongRightArrow:"\u27F9",Longrightarrow:"\u27F9",xrArr:"\u27F9",DoubleRightArrow:"\u21D2",Implies:"\u21D2",Rightarrow:"\u21D2",rArr:"\u21D2",DoubleRightTee:"\u22A8",vDash:"\u22A8",DoubleUpArrow:"\u21D1",Uparrow:"\u21D1",uArr:"\u21D1",DoubleUpDownArrow:"\u21D5",Updownarrow:"\u21D5",vArr:"\u21D5",DoubleVerticalBar:"\u2225",par:"\u2225",parallel:"\u2225",shortparallel:"\u2225",spar:"\u2225",DownArrow:"\u2193",ShortDownArrow:"\u2193",darr:"\u2193",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",duarr:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",leftharpoondown:"\u21BD",lhard:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",rhard:"\u21C1",rightharpoondown:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",top:"\u22A4",DownTeeArrow:"\u21A7",mapstodown:"\u21A7",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",in:"\u2208",isin:"\u2208",isinv:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",eqsim:"\u2242",esim:"\u2242",Equilibrium:"\u21CC",rightleftharpoons:"\u21CC",rlhar:"\u21CC",Escr:"\u2130",expectation:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",exist:"\u2203",ExponentialE:"\u2147",ee:"\u2147",exponentiale:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",blacksquare:"\u25AA",squarf:"\u25AA",squf:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",forall:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",gt:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",ggg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",ge:"\u2265",geq:"\u2265",GreaterEqualLess:"\u22DB",gel:"\u22DB",gtreqless:"\u22DB",GreaterFullEqual:"\u2267",gE:"\u2267",geqq:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",gl:"\u2277",gtrless:"\u2277",GreaterSlantEqual:"\u2A7E",geqslant:"\u2A7E",ges:"\u2A7E",GreaterTilde:"\u2273",gsim:"\u2273",gtrsim:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",NestedGreaterGreater:"\u226B",gg:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",caron:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",Poincareplane:"\u210C",HilbertSpace:"\u210B",Hscr:"\u210B",hamilt:"\u210B",Hopf:"\u210D",quaternions:"\u210D",HorizontalLine:"\u2500",boxh:"\u2500",Hstrok:"\u0126",HumpEqual:"\u224F",bumpe:"\u224F",bumpeq:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Im:"\u2111",image:"\u2111",imagpart:"\u2111",Igrave:"\xCC",Imacr:"\u012A",ImaginaryI:"\u2148",ii:"\u2148",Int:"\u222C",Integral:"\u222B",int:"\u222B",Intersection:"\u22C2",bigcap:"\u22C2",xcap:"\u22C2",InvisibleComma:"\u2063",ic:"\u2063",InvisibleTimes:"\u2062",it:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",imagline:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",lt:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Lscr:"\u2112",lagran:"\u2112",Larr:"\u219E",twoheadleftarrow:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",lang:"\u27E8",langle:"\u27E8",LeftArrow:"\u2190",ShortLeftArrow:"\u2190",larr:"\u2190",leftarrow:"\u2190",slarr:"\u2190",LeftArrowBar:"\u21E4",larrb:"\u21E4",LeftArrowRightArrow:"\u21C6",leftrightarrows:"\u21C6",lrarr:"\u21C6",LeftCeiling:"\u2308",lceil:"\u2308",LeftDoubleBracket:"\u27E6",lobrk:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",dharl:"\u21C3",downharpoonleft:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",lfloor:"\u230A",LeftRightArrow:"\u2194",harr:"\u2194",leftrightarrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",dashv:"\u22A3",LeftTeeArrow:"\u21A4",mapstoleft:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",vartriangleleft:"\u22B2",vltri:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",ltrie:"\u22B4",trianglelefteq:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",uharl:"\u21BF",upharpoonleft:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",leftharpoonup:"\u21BC",lharu:"\u21BC",LeftVectorBar:"\u2952",LessEqualGreater:"\u22DA",leg:"\u22DA",lesseqgtr:"\u22DA",LessFullEqual:"\u2266",lE:"\u2266",leqq:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",lg:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",leqslant:"\u2A7D",les:"\u2A7D",LessTilde:"\u2272",lesssim:"\u2272",lsim:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",lAarr:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",longleftarrow:"\u27F5",xlarr:"\u27F5",LongLeftRightArrow:"\u27F7",longleftrightarrow:"\u27F7",xharr:"\u27F7",LongRightArrow:"\u27F6",longrightarrow:"\u27F6",xrarr:"\u27F6",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",swarr:"\u2199",swarrow:"\u2199",LowerRightArrow:"\u2198",searr:"\u2198",searrow:"\u2198",Lsh:"\u21B0",lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",NestedLessLess:"\u226A",ll:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mscr:"\u2133",phmmat:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",mnplus:"\u2213",mp:"\u2213",Mopf:"\u{1D544}",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",ZeroWidthSpace:"\u200B",NewLine:` +`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nbsp:"\xA0",Nopf:"\u2115",naturals:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",nequiv:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",npar:"\u2226",nparallel:"\u2226",nshortparallel:"\u2226",nspar:"\u2226",NotElement:"\u2209",notin:"\u2209",notinva:"\u2209",NotEqual:"\u2260",ne:"\u2260",NotEqualTilde:"\u2242\u0338",nesim:"\u2242\u0338",NotExists:"\u2204",nexist:"\u2204",nexists:"\u2204",NotGreater:"\u226F",ngt:"\u226F",ngtr:"\u226F",NotGreaterEqual:"\u2271",nge:"\u2271",ngeq:"\u2271",NotGreaterFullEqual:"\u2267\u0338",ngE:"\u2267\u0338",ngeqq:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",nGtv:"\u226B\u0338",NotGreaterLess:"\u2279",ntgl:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",NotGreaterTilde:"\u2275",ngsim:"\u2275",NotHumpDownHump:"\u224E\u0338",nbump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",nbumpe:"\u224F\u0338",NotLeftTriangle:"\u22EA",nltri:"\u22EA",ntriangleleft:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",nltrie:"\u22EC",ntrianglelefteq:"\u22EC",NotLess:"\u226E",nless:"\u226E",nlt:"\u226E",NotLessEqual:"\u2270",nle:"\u2270",nleq:"\u2270",NotLessGreater:"\u2278",ntlg:"\u2278",NotLessLess:"\u226A\u0338",nLtv:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",NotLessTilde:"\u2274",nlsim:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",npr:"\u2280",nprec:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",npre:"\u2AAF\u0338",npreceq:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",nprcue:"\u22E0",NotReverseElement:"\u220C",notni:"\u220C",notniva:"\u220C",NotRightTriangle:"\u22EB",nrtri:"\u22EB",ntriangleright:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",nrtrie:"\u22ED",ntrianglerighteq:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",nsqsube:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",nsqsupe:"\u22E3",NotSubset:"\u2282\u20D2",nsubset:"\u2282\u20D2",vnsub:"\u2282\u20D2",NotSubsetEqual:"\u2288",nsube:"\u2288",nsubseteq:"\u2288",NotSucceeds:"\u2281",nsc:"\u2281",nsucc:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",nsce:"\u2AB0\u0338",nsucceq:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",nsccue:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",nsupset:"\u2283\u20D2",vnsup:"\u2283\u20D2",NotSupersetEqual:"\u2289",nsupe:"\u2289",nsupseteq:"\u2289",NotTilde:"\u2241",nsim:"\u2241",NotTildeEqual:"\u2244",nsime:"\u2244",nsimeq:"\u2244",NotTildeFullEqual:"\u2247",ncong:"\u2247",NotTildeTilde:"\u2249",nap:"\u2249",napprox:"\u2249",NotVerticalBar:"\u2224",nmid:"\u2224",nshortmid:"\u2224",nsmid:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",ohm:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",ldquo:"\u201C",OpenCurlyQuote:"\u2018",lsquo:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",oline:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",tbrk:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",part:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",plusmn:"\xB1",pm:"\xB1",Popf:"\u2119",primes:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",pr:"\u227A",prec:"\u227A",PrecedesEqual:"\u2AAF",pre:"\u2AAF",preceq:"\u2AAF",PrecedesSlantEqual:"\u227C",prcue:"\u227C",preccurlyeq:"\u227C",PrecedesTilde:"\u227E",precsim:"\u227E",prsim:"\u227E",Prime:"\u2033",Product:"\u220F",prod:"\u220F",Proportional:"\u221D",prop:"\u221D",propto:"\u221D",varpropto:"\u221D",vprop:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',quot:'"',Qfr:"\u{1D514}",Qopf:"\u211A",rationals:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",drbkarow:"\u2910",REG:"\xAE",circledR:"\xAE",reg:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",twoheadrightarrow:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",Rfr:"\u211C",real:"\u211C",realpart:"\u211C",ReverseElement:"\u220B",SuchThat:"\u220B",ni:"\u220B",niv:"\u220B",ReverseEquilibrium:"\u21CB",leftrightharpoons:"\u21CB",lrhar:"\u21CB",ReverseUpEquilibrium:"\u296F",duhar:"\u296F",Rho:"\u03A1",RightAngleBracket:"\u27E9",rang:"\u27E9",rangle:"\u27E9",RightArrow:"\u2192",ShortRightArrow:"\u2192",rarr:"\u2192",rightarrow:"\u2192",srarr:"\u2192",RightArrowBar:"\u21E5",rarrb:"\u21E5",RightArrowLeftArrow:"\u21C4",rightleftarrows:"\u21C4",rlarr:"\u21C4",RightCeiling:"\u2309",rceil:"\u2309",RightDoubleBracket:"\u27E7",robrk:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",dharr:"\u21C2",downharpoonright:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rfloor:"\u230B",RightTee:"\u22A2",vdash:"\u22A2",RightTeeArrow:"\u21A6",map:"\u21A6",mapsto:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",vartriangleright:"\u22B3",vrtri:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",rtrie:"\u22B5",trianglerighteq:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",uharr:"\u21BE",upharpoonright:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",rharu:"\u21C0",rightharpoonup:"\u21C0",RightVectorBar:"\u2953",Ropf:"\u211D",reals:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",rAarr:"\u21DB",Rscr:"\u211B",realine:"\u211B",Rsh:"\u21B1",rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortUpArrow:"\u2191",UpArrow:"\u2191",uarr:"\u2191",uparrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",compfn:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",radic:"\u221A",Square:"\u25A1",squ:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",sqcap:"\u2293",SquareSubset:"\u228F",sqsub:"\u228F",sqsubset:"\u228F",SquareSubsetEqual:"\u2291",sqsube:"\u2291",sqsubseteq:"\u2291",SquareSuperset:"\u2290",sqsup:"\u2290",sqsupset:"\u2290",SquareSupersetEqual:"\u2292",sqsupe:"\u2292",sqsupseteq:"\u2292",SquareUnion:"\u2294",sqcup:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",sstarf:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",sube:"\u2286",subseteq:"\u2286",Succeeds:"\u227B",sc:"\u227B",succ:"\u227B",SucceedsEqual:"\u2AB0",sce:"\u2AB0",succeq:"\u2AB0",SucceedsSlantEqual:"\u227D",sccue:"\u227D",succcurlyeq:"\u227D",SucceedsTilde:"\u227F",scsim:"\u227F",succsim:"\u227F",Sum:"\u2211",sum:"\u2211",Sup:"\u22D1",Supset:"\u22D1",Superset:"\u2283",sup:"\u2283",supset:"\u2283",SupersetEqual:"\u2287",supe:"\u2287",supseteq:"\u2287",THORN:"\xDE",TRADE:"\u2122",trade:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",there4:"\u2234",therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",thinsp:"\u2009",Tilde:"\u223C",sim:"\u223C",thicksim:"\u223C",thksim:"\u223C",TildeEqual:"\u2243",sime:"\u2243",simeq:"\u2243",TildeFullEqual:"\u2245",cong:"\u2245",TildeTilde:"\u2248",ap:"\u2248",approx:"\u2248",asymp:"\u2248",thickapprox:"\u2248",thkap:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",tdot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",lowbar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",bbrk:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",bigcup:"\u22C3",xcup:"\u22C3",UnionPlus:"\u228E",uplus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",udarr:"\u21C5",UpDownArrow:"\u2195",updownarrow:"\u2195",varr:"\u2195",UpEquilibrium:"\u296E",udhar:"\u296E",UpTee:"\u22A5",bot:"\u22A5",bottom:"\u22A5",perp:"\u22A5",UpTeeArrow:"\u21A5",mapstoup:"\u21A5",UpperLeftArrow:"\u2196",nwarr:"\u2196",nwarrow:"\u2196",UpperRightArrow:"\u2197",nearr:"\u2197",nearrow:"\u2197",Upsi:"\u03D2",upsih:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",bigvee:"\u22C1",xvee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",mid:"\u2223",shortmid:"\u2223",smid:"\u2223",VerticalLine:"|",verbar:"|",vert:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",wr:"\u2240",wreath:"\u2240",VeryThinSpace:"\u200A",hairsp:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",bigwedge:"\u22C0",xwedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",Zeta:"\u0396",Zfr:"\u2128",zeetrf:"\u2128",Zopf:"\u2124",integers:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",mstpos:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acy:"\u0430",aelig:"\xE6",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",and:"\u2227",wedge:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",angle:"\u2220",ange:"\u29A4",angmsd:"\u2221",measuredangle:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",approxeq:"\u224A",apid:"\u224B",apos:"'",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",midast:"*",atilde:"\xE3",auml:"\xE4",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",bcong:"\u224C",backepsilon:"\u03F6",bepsi:"\u03F6",backprime:"\u2035",bprime:"\u2035",backsim:"\u223D",bsim:"\u223D",backsimeq:"\u22CD",bsime:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrktbrk:"\u23B6",bcy:"\u0431",bdquo:"\u201E",ldquor:"\u201E",bemptyv:"\u29B0",beta:"\u03B2",beth:"\u2136",between:"\u226C",twixt:"\u226C",bfr:"\u{1D51F}",bigcirc:"\u25EF",xcirc:"\u25EF",bigodot:"\u2A00",xodot:"\u2A00",bigoplus:"\u2A01",xoplus:"\u2A01",bigotimes:"\u2A02",xotime:"\u2A02",bigsqcup:"\u2A06",xsqcup:"\u2A06",bigstar:"\u2605",starf:"\u2605",bigtriangledown:"\u25BD",xdtri:"\u25BD",bigtriangleup:"\u25B3",xutri:"\u25B3",biguplus:"\u2A04",xuplus:"\u2A04",bkarow:"\u290D",rbarr:"\u290D",blacklozenge:"\u29EB",lozf:"\u29EB",blacktriangle:"\u25B4",utrif:"\u25B4",blacktriangledown:"\u25BE",dtrif:"\u25BE",blacktriangleleft:"\u25C2",ltrif:"\u25C2",blacktriangleright:"\u25B8",rtrif:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",minusb:"\u229F",boxplus:"\u229E",plusb:"\u229E",boxtimes:"\u22A0",timesb:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bumpE:"\u2AAE",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cemptyv:"\u29B2",cent:"\xA2",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",cire:"\u2257",circlearrowleft:"\u21BA",olarr:"\u21BA",circlearrowright:"\u21BB",orarr:"\u21BB",circledS:"\u24C8",oS:"\u24C8",circledast:"\u229B",oast:"\u229B",circledcirc:"\u229A",ocir:"\u229A",circleddash:"\u229D",odash:"\u229D",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",comma:",",commat:"@",comp:"\u2201",complement:"\u2201",congdot:"\u2A6D",copf:"\u{1D554}",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",curlyeqprec:"\u22DE",cuesc:"\u22DF",curlyeqsucc:"\u22DF",cularr:"\u21B6",curvearrowleft:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curvearrowright:"\u21B7",curarrm:"\u293C",curlyvee:"\u22CE",cuvee:"\u22CE",curlywedge:"\u22CF",cuwed:"\u22CF",curren:"\xA4",cwint:"\u2231",cylcty:"\u232D",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",dash:"\u2010",hyphen:"\u2010",dbkarow:"\u290F",rBarr:"\u290F",dcaron:"\u010F",dcy:"\u0434",ddarr:"\u21CA",downdownarrows:"\u21CA",ddotseq:"\u2A77",eDDot:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",diamondsuit:"\u2666",diams:"\u2666",digamma:"\u03DD",gammad:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",llcorner:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",doteqdot:"\u2251",eDot:"\u2251",dotminus:"\u2238",minusd:"\u2238",dotplus:"\u2214",plusdo:"\u2214",dotsquare:"\u22A1",sdotb:"\u22A1",drcorn:"\u231F",lrcorner:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",triangledown:"\u25BF",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",eqcirc:"\u2256",ecirc:"\xEA",ecolon:"\u2255",eqcolon:"\u2255",ecy:"\u044D",edot:"\u0117",efDot:"\u2252",fallingdotseq:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",eqslantgtr:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",eqslantless:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",varnothing:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",straightepsilon:"\u03F5",varepsilon:"\u03F5",equals:"=",equest:"\u225F",questeq:"\u225F",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",risingdotseq:"\u2253",erarr:"\u2971",escr:"\u212F",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",fork:"\u22D4",pitchfork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",half:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",sfrown:"\u2322",fscr:"\u{1D4BB}",gEl:"\u2A8C",gtreqqless:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gap:"\u2A86",gtrapprox:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gimel:"\u2137",gjcy:"\u0453",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gneqq:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gnsim:"\u22E7",gopf:"\u{1D558}",gscr:"\u210A",gsime:"\u2A8E",gsiml:"\u2A90",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtrdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrarr:"\u2978",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hardcy:"\u044A",harrcir:"\u2948",harrw:"\u21AD",leftrightsquigarrow:"\u21AD",hbar:"\u210F",hslash:"\u210F",planck:"\u210F",plankv:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",mldr:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",searhk:"\u2925",hkswarow:"\u2926",swarhk:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",larrhk:"\u21A9",hookrightarrow:"\u21AA",rarrhk:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hstrok:"\u0127",hybull:"\u2043",iacute:"\xED",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",ifr:"\u{1D526}",igrave:"\xEC",iiiint:"\u2A0C",qint:"\u2A0C",iiint:"\u222D",tint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",imath:"\u0131",inodot:"\u0131",imof:"\u22B7",imped:"\u01B5",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",intcal:"\u22BA",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iquest:"\xBF",iscr:"\u{1D4BE}",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",varkappa:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAtail:"\u291B",lBarr:"\u290E",lEg:"\u2A8B",lesseqqgtr:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lambda:"\u03BB",langd:"\u2991",lap:"\u2A85",lessapprox:"\u2A85",laquo:"\xAB",larrbfs:"\u291F",larrfs:"\u291D",larrlp:"\u21AB",looparrowleft:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",leftarrowtail:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lcub:"{",lbrack:"[",lsqb:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lcy:"\u043B",ldca:"\u2936",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leq:"\u2264",leftleftarrows:"\u21C7",llarr:"\u21C7",leftthreetimes:"\u22CB",lthree:"\u22CB",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessdot:"\u22D6",ltdot:"\u22D6",lfisht:"\u297C",lfr:"\u{1D529}",lgE:"\u2A91",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lneqq:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",longmapsto:"\u27FC",xmap:"\u27FC",looparrowright:"\u21AC",rarrlp:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",loz:"\u25CA",lozenge:"\u25CA",lpar:"(",lparlt:"\u2993",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsime:"\u2A8D",lsimg:"\u2A8F",lsquor:"\u201A",sbquo:"\u201A",lstrok:"\u0142",ltcc:"\u2AA6",ltcir:"\u2A79",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",triangleleft:"\u25C3",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",strns:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",midcir:"\u2AF0",minus:"\u2212",minusdu:"\u2A2A",mlcp:"\u2ADB",models:"\u22A7",mopf:"\u{1D55E}",mscr:"\u{1D4C2}",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nLeftarrow:"\u21CD",nlArr:"\u21CD",nLeftrightarrow:"\u21CE",nhArr:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nRightarrow:"\u21CF",nrArr:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nacute:"\u0144",nang:"\u2220\u20D2",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",natur:"\u266E",natural:"\u266E",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",neArr:"\u21D7",nearhk:"\u2924",nedot:"\u2250\u0338",nesear:"\u2928",toea:"\u2928",nfr:"\u{1D52B}",nharr:"\u21AE",nleftrightarrow:"\u21AE",nhpar:"\u2AF2",nis:"\u22FC",nisd:"\u22FA",njcy:"\u045A",nlE:"\u2266\u0338",nleqq:"\u2266\u0338",nlarr:"\u219A",nleftarrow:"\u219A",nldr:"\u2025",nopf:"\u{1D55F}",not:"\xAC",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinvb:"\u22F7",notinvc:"\u22F6",notnivb:"\u22FE",notnivc:"\u22FD",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",nrarr:"\u219B",nrightarrow:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nscr:"\u{1D4C3}",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsubseteqq:"\u2AC5\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupseteqq:"\u2AC6\u0338",ntilde:"\xF1",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwnear:"\u2927",oacute:"\xF3",ocirc:"\xF4",ocy:"\u043E",odblac:"\u0151",odiv:"\u2A38",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",olcir:"\u29BE",olcross:"\u29BB",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",or:"\u2228",vee:"\u2228",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",oscr:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",para:"\xB6",parsim:"\u2AF3",parsl:"\u2AFD",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",straightphi:"\u03D5",varphi:"\u03D5",phone:"\u260E",pi:"\u03C0",piv:"\u03D6",varpi:"\u03D6",planckh:"\u210E",plus:"+",plusacir:"\u2A23",pluscir:"\u2A22",plusdu:"\u2A25",pluse:"\u2A72",plussim:"\u2A26",plustwo:"\u2A27",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",prE:"\u2AB3",prap:"\u2AB7",precapprox:"\u2AB7",precnapprox:"\u2AB9",prnap:"\u2AB9",precneqq:"\u2AB5",prnE:"\u2AB5",precnsim:"\u22E8",prnsim:"\u22E8",prime:"\u2032",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quatint:"\u2A16",quest:"?",rAtail:"\u291C",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",raemptyv:"\u29B3",rangd:"\u2992",range:"\u29A5",raquo:"\xBB",rarrap:"\u2975",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rightarrowtail:"\u21A3",rarrw:"\u219D",rightsquigarrow:"\u219D",ratail:"\u291A",ratio:"\u2236",rbbrk:"\u2773",rbrace:"}",rcub:"}",rbrack:"]",rsqb:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdsh:"\u21B3",rect:"\u25AD",rfisht:"\u297D",rfr:"\u{1D52F}",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",varrho:"\u03F1",rightrightarrows:"\u21C9",rrarr:"\u21C9",rightthreetimes:"\u22CC",rthree:"\u22CC",ring:"\u02DA",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rsaquo:"\u203A",rscr:"\u{1D4C7}",rtimes:"\u22CA",rtri:"\u25B9",triangleright:"\u25B9",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",scE:"\u2AB4",scap:"\u2AB8",succapprox:"\u2AB8",scaron:"\u0161",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",succneqq:"\u2AB6",scnap:"\u2ABA",succnapprox:"\u2ABA",scnsim:"\u22E9",succnsim:"\u22E9",scpolint:"\u2A13",scy:"\u0441",sdot:"\u22C5",sdote:"\u2A66",seArr:"\u21D8",sect:"\xA7",semi:";",seswar:"\u2929",tosa:"\u2929",sext:"\u2736",sfr:"\u{1D530}",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",varsigma:"\u03C2",simdot:"\u2A6A",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",smashp:"\u2A33",smeparsl:"\u29E4",smile:"\u2323",ssmile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",sqcaps:"\u2293\uFE00",sqcups:"\u2294\uFE00",sscr:"\u{1D4C8}",star:"\u2606",sub:"\u2282",subset:"\u2282",subE:"\u2AC5",subseteqq:"\u2AC5",subdot:"\u2ABD",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subsetneqq:"\u2ACB",subne:"\u228A",subsetneq:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supE:"\u2AC6",supseteqq:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supsetneqq:"\u2ACC",supne:"\u228B",supsetneq:"\u228B",supplus:"\u2AC0",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",telrec:"\u2315",tfr:"\u{1D531}",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",vartheta:"\u03D1",thorn:"\xFE",times:"\xD7",timesbar:"\u2A31",timesd:"\u2A30",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tprime:"\u2034",triangle:"\u25B5",utri:"\u25B5",triangleq:"\u225C",trie:"\u225C",tridot:"\u25EC",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",uHar:"\u2963",uacute:"\xFA",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udblac:"\u0171",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uogon:"\u0173",uopf:"\u{1D566}",upsi:"\u03C5",upsilon:"\u03C5",upuparrows:"\u21C8",uuarr:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",uuml:"\xFC",uwangle:"\u29A7",vBar:"\u2AE8",vBarv:"\u2AE9",vangrt:"\u299C",varsubsetneq:"\u228A\uFE00",vsubne:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",vsubnE:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",vsupne:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vsupnE:"\u2ACC\uFE00",vcy:"\u0432",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",vfr:"\u{1D533}",vopf:"\u{1D567}",vscr:"\u{1D4CB}",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedgeq:"\u2259",weierp:"\u2118",wp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wscr:"\u{1D4CC}",xfr:"\u{1D535}",xi:"\u03BE",xnis:"\u22FB",xopf:"\u{1D569}",xscr:"\u{1D4CD}",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"},QF="\uE500";pv.ngsp=QF;var Tg=class extends pt{constructor(t,r,s){super(s,t);l(this,"tokenType");this.tokenType=r}},SD=class{constructor(e,t,r){l(this,"tokens");l(this,"errors");l(this,"nonNormalizedIcuExpressions");this.tokens=e,this.errors=t,this.nonNormalizedIcuExpressions=r}};function d7(n,e,t,r={}){let s=new CD(new tw(n,e),t,r);return s.tokenize(),new SD(w7(s.tokens),s.errors,s.nonNormalizedIcuExpressions)}var p7=/\r\n?/g;function hg(n){return`Unexpected character "${n===Br?"EOF":String.fromCharCode(n)}"`}function pR(n){return`Unknown entity "${n}" - use the "&#;" or "&#x;" syntax`}function f7(n,e){return`Unable to parse entity "${e}" - ${n} character reference entities must end with ";"`}var yw;(function(n){n.HEX="hexadecimal",n.DEC="decimal"})(yw||(yw={}));var Dg=class{constructor(e){l(this,"error");this.error=e}},CD=class{constructor(e,t,r){l(this,"_getTagDefinition");l(this,"_cursor");l(this,"_tokenizeIcu");l(this,"_interpolationConfig");l(this,"_leadingTriviaCodePoints");l(this,"_currentTokenStart",null);l(this,"_currentTokenType",null);l(this,"_expansionCaseStack",[]);l(this,"_inInterpolation",!1);l(this,"_preserveLineEndings");l(this,"_i18nNormalizeLineEndingsInICUs");l(this,"_tokenizeBlocks");l(this,"_tokenizeLet");l(this,"tokens",[]);l(this,"errors",[]);l(this,"nonNormalizedIcuExpressions",[]);this._getTagDefinition=t,this._tokenizeIcu=r.tokenizeExpansionForms||!1,this._interpolationConfig=r.interpolationConfig||Co,this._leadingTriviaCodePoints=r.leadingTriviaChars&&r.leadingTriviaChars.map(i=>i.codePointAt(0)||0);let s=r.range||{endPos:e.content.length,startPos:0,startLine:0,startCol:0};this._cursor=r.escapedString?new TD(e,s):new bw(e,s),this._preserveLineEndings=r.preserveLineEndings||!1,this._i18nNormalizeLineEndingsInICUs=r.i18nNormalizeLineEndingsInICUs||!1,this._tokenizeBlocks=r.tokenizeBlocks??!0,this._tokenizeLet=r.tokenizeLet??!0;try{this._cursor.init()}catch(i){this.handleError(i)}}_processCarriageReturns(e){return this._preserveLineEndings?e:e.replace(p7,` +`)}tokenize(){for(;this._cursor.peek()!==Br;){let e=this._cursor.clone();try{this._attemptCharCode(mp)?this._attemptCharCode(iD)?this._attemptCharCode(xp)?this._consumeCdata(e):this._attemptCharCode(ew)?this._consumeComment(e):this._consumeDocType(e):this._attemptCharCode(fa)?this._consumeTagClose(e):this._consumeTagOpen(e):this._tokenizeLet&&this._cursor.peek()===fT&&!this._inInterpolation&&this._attemptStr("@let")?this._consumeLetDeclaration(e):this._tokenizeBlocks&&this._attemptCharCode(fT)?this._consumeBlockStart(e):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(Es)?this._consumeBlockEnd(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(t){this.handleError(t)}}this._beginToken(33),this._endToken([])}_getBlockName(){let e=!1,t=this._cursor.clone();return this._attemptCharCodeUntilFn(r=>ev(r)?!e:b7(r)?(e=!0,!1):!0),this._cursor.getChars(t).trim()}_consumeBlockStart(e){this._beginToken(24,e);let t=this._endToken([this._getBlockName()]);if(this._cursor.peek()===ba)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(mr),this._attemptCharCode($i))this._attemptCharCodeUntilFn(mr);else{t.type=28;return}this._attemptCharCode(Vi)?(this._beginToken(25),this._endToken([])):t.type=28}_consumeBlockEnd(e){this._beginToken(26,e),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(mR);this._cursor.peek()!==$i&&this._cursor.peek()!==Br;){this._beginToken(27);let e=this._cursor.clone(),t=null,r=0;for(;this._cursor.peek()!==$s&&this._cursor.peek()!==Br||t!==null;){let s=this._cursor.peek();if(s===Sp)this._cursor.advance();else if(s===t)t=null;else if(t===null&&Sg(s))t=s;else if(s===ba&&t===null)r++;else if(s===$i&&t===null){if(r===0)break;r>0&&r--}this._cursor.advance()}this._endToken([this._cursor.getChars(e)]),this._attemptCharCodeUntilFn(mR)}}_consumeLetDeclaration(e){if(this._beginToken(29,e),ev(this._cursor.peek()))this._attemptCharCodeUntilFn(mr);else{let s=this._endToken([this._cursor.getChars(e)]);s.type=32;return}let t=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(mr),!this._attemptCharCode(_c)){t.type=32;return}this._attemptCharCodeUntilFn(s=>mr(s)&&!gI(s)),this._consumeLetDeclarationValue(),this._cursor.peek()===$s?(this._beginToken(31),this._endToken([]),this._cursor.advance()):(t.type=32,t.sourceSpan=this._cursor.getSpan(e))}_getLetDeclarationName(){let e=this._cursor.clone(),t=!1;return this._attemptCharCodeUntilFn(r=>tv(r)||r===Vw||r===xv||t&&xo(r)?(t=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeLetDeclarationValue(){let e=this._cursor.clone();for(this._beginToken(30,e);this._cursor.peek()!==Br;){let t=this._cursor.peek();if(t===$s)break;Sg(t)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(r=>r===Sp?(this._cursor.advance(),!1):r===t)),this._cursor.advance()}this._endToken([this._cursor.getChars(e)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(v7(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===Es){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(e,t=this._cursor.clone()){this._currentTokenStart=t,this._currentTokenType=e}_endToken(e,t){if(this._currentTokenStart===null)throw new Tg("Programming error - attempted to end a token when there was no start to the token",this._currentTokenType,this._cursor.getSpan(t));if(this._currentTokenType===null)throw new Tg("Programming error - attempted to end a token which has no token type",null,this._cursor.getSpan(this._currentTokenStart));let r={type:this._currentTokenType,parts:e,sourceSpan:(t??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(r),this._currentTokenStart=null,this._currentTokenType=null,r}_createError(e,t){this._isInExpansionForm()&&(e+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let r=new Tg(e,this._currentTokenType,t);return this._currentTokenStart=null,this._currentTokenType=null,new Dg(r)}handleError(e){if(e instanceof fv&&(e=this._createError(e.msg,this._cursor.getSpan(e.cursor))),e instanceof Dg)this.errors.push(e.error);else throw e}_attemptCharCode(e){return this._cursor.peek()===e?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(e){return y7(this._cursor.peek(),e)?(this._cursor.advance(),!0):!1}_requireCharCode(e){let t=this._cursor.clone();if(!this._attemptCharCode(e))throw this._createError(hg(this._cursor.peek()),this._cursor.getSpan(t))}_attemptStr(e){let t=e.length;if(this._cursor.charsLeft()this._attemptStr("-->")),this._beginToken(11),this._requireStr("-->"),this._endToken([])}_consumeCdata(e){this._beginToken(12,e),this._requireStr("CDATA["),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(13),this._requireStr("]]>"),this._endToken([])}_consumeDocType(e){this._beginToken(18,e);let t=this._cursor.clone();this._attemptUntilChar(hl);let r=this._cursor.getChars(t);this._cursor.advance(),this._endToken([r])}_consumePrefixAndName(){let e=this._cursor.clone(),t="";for(;this._cursor.peek()!==vl&&!h7(this._cursor.peek());)this._cursor.advance();let r;this._cursor.peek()===vl?(t=this._cursor.getChars(e),this._cursor.advance(),r=this._cursor.clone()):r=e,this._requireCharCodeUntilFn(fR,t===""?0:1);let s=this._cursor.getChars(r);return[t,s]}_consumeTagOpen(e){let t,r,s;try{if(!tv(this._cursor.peek()))throw this._createError(hg(this._cursor.peek()),this._cursor.getSpan(e));for(s=this._consumeTagOpenStart(e),r=s.parts[0],t=s.parts[1],this._attemptCharCodeUntilFn(mr);this._cursor.peek()!==fa&&this._cursor.peek()!==hl&&this._cursor.peek()!==mp&&this._cursor.peek()!==Br;)this._consumeAttributeName(),this._attemptCharCodeUntilFn(mr),this._attemptCharCode(_c)&&(this._attemptCharCodeUntilFn(mr),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(mr);this._consumeTagOpenEnd()}catch(o){if(o instanceof Dg){s?s.type=4:(this._beginToken(5,e),this._endToken(["<"]));return}throw o}let i=this._getTagDefinition(t).getContentType(r);i===Bi.RAW_TEXT?this._consumeRawTextWithTagClose(r,t,!1):i===Bi.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(r,t,!0)}_consumeRawTextWithTagClose(e,t,r){this._consumeRawText(r,()=>!this._attemptCharCode(mp)||!this._attemptCharCode(fa)||(this._attemptCharCodeUntilFn(mr),!this._attemptStrCaseInsensitive(t))?!1:(this._attemptCharCodeUntilFn(mr),this._attemptCharCode(hl))),this._beginToken(3),this._requireCharCodeUntilFn(s=>s===hl,3),this._cursor.advance(),this._endToken([e,t])}_consumeTagOpenStart(e){this._beginToken(0,e);let t=this._consumePrefixAndName();return this._endToken(t)}_consumeAttributeName(){let e=this._cursor.peek();if(e===Jg||e===Kg)throw this._createError(hg(e),this._cursor.getSpan());this._beginToken(14);let t=this._consumePrefixAndName();this._endToken(t)}_consumeAttributeValue(){if(this._cursor.peek()===Jg||this._cursor.peek()===Kg){let e=this._cursor.peek();this._consumeQuote(e);let t=()=>this._cursor.peek()===e;this._consumeWithInterpolation(16,17,t,t),this._consumeQuote(e)}else{let e=()=>fR(this._cursor.peek());this._consumeWithInterpolation(16,17,e,e)}}_consumeQuote(e){this._beginToken(15),this._requireCharCode(e),this._endToken([String.fromCodePoint(e)])}_consumeTagOpenEnd(){let e=this._attemptCharCode(fa)?2:1;this._beginToken(e),this._requireCharCode(hl),this._endToken([])}_consumeTagClose(e){this._beginToken(3,e),this._attemptCharCodeUntilFn(mr);let t=this._consumePrefixAndName();this._attemptCharCodeUntilFn(mr),this._requireCharCode(hl),this._endToken(t)}_consumeExpansionFormStart(){this._beginToken(19),this._requireCharCode(Vi),this._endToken([]),this._expansionCaseStack.push(19),this._beginToken(7);let e=this._readUntil(mi),t=this._processCarriageReturns(e);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([t]);else{let s=this._endToken([e]);t!==e&&this.nonNormalizedIcuExpressions.push(s)}this._requireCharCode(mi),this._attemptCharCodeUntilFn(mr),this._beginToken(7);let r=this._readUntil(mi);this._endToken([r]),this._requireCharCode(mi),this._attemptCharCodeUntilFn(mr)}_consumeExpansionCaseStart(){this._beginToken(20);let e=this._readUntil(Vi).trim();this._endToken([e]),this._attemptCharCodeUntilFn(mr),this._beginToken(21),this._requireCharCode(Vi),this._endToken([]),this._attemptCharCodeUntilFn(mr),this._expansionCaseStack.push(21)}_consumeExpansionCaseEnd(){this._beginToken(22),this._requireCharCode(Es),this._endToken([]),this._attemptCharCodeUntilFn(mr),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(23),this._requireCharCode(Es),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(e,t,r,s){this._beginToken(e);let i=[];for(;!r();){let o=this._cursor.clone();this._interpolationConfig&&this._attemptStr(this._interpolationConfig.start)?(this._endToken([this._processCarriageReturns(i.join(""))],o),i.length=0,this._consumeInterpolation(t,o,s),this._beginToken(e)):this._cursor.peek()===J0?(this._endToken([this._processCarriageReturns(i.join(""))]),i.length=0,this._consumeEntity(e),this._beginToken(e)):i.push(this._readChar())}this._inInterpolation=!1,this._endToken([this._processCarriageReturns(i.join(""))])}_consumeInterpolation(e,t,r){let s=[];this._beginToken(e,t),s.push(this._interpolationConfig.start);let i=this._cursor.clone(),o=null,a=!1;for(;this._cursor.peek()!==Br&&(r===null||!r());){let c=this._cursor.clone();if(this._isTagStart()){this._cursor=c,s.push(this._getProcessedChars(i,c)),this._endToken(s);return}if(o===null)if(this._attemptStr(this._interpolationConfig.end)){s.push(this._getProcessedChars(i,c)),s.push(this._interpolationConfig.end),this._endToken(s);return}else this._attemptStr("//")&&(a=!0);let u=this._cursor.peek();this._cursor.advance(),u===Sp?this._cursor.advance():u===o?o=null:!a&&o===null&&Sg(u)&&(o=u)}s.push(this._getProcessedChars(i,this._cursor)),this._endToken(s)}_getProcessedChars(e,t){return this._processCarriageReturns(t.getChars(e))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===Br||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===Es&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._cursor.peek()===fT||this._cursor.peek()===Es))}_isTagStart(){if(this._cursor.peek()===mp){let e=this._cursor.clone();e.advance();let t=e.peek();if(jc<=t&&t<=Sv||zp<=t&&t<=$w||t===fa||t===iD)return!0}return!1}_readUntil(e){let t=this._cursor.clone();return this._attemptUntilChar(e),this._cursor.getChars(t)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===21}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===19}isExpansionFormStart(){if(this._cursor.peek()!==Vi)return!1;if(this._interpolationConfig){let e=this._cursor.clone(),t=this._attemptStr(this._interpolationConfig.start);return this._cursor=e,!t}return!0}};function mr(n){return!ev(n)||n===Br}function fR(n){return ev(n)||n===hl||n===mp||n===fa||n===Jg||n===Kg||n===_c||n===Br}function h7(n){return(nCF)}function m7(n){return n===$s||n===Br||!UW(n)}function g7(n){return n===$s||n===Br||!tv(n)}function v7(n){return n!==Es}function y7(n,e){return hR(n)===hR(e)}function hR(n){return n>=jc&&n<=Sv?n-jc+zp:n}function b7(n){return tv(n)||xo(n)||n===xv}function mR(n){return n!==$s&&mr(n)}function w7(n){let e=[],t;for(let r=0;r0&&t.indexOf(e.peek())!==-1;)r===e&&(e=e.clone()),e.advance();let s=this.locationFromCursor(e),i=this.locationFromCursor(this),o=r!==e?this.locationFromCursor(r):s;return new bt(s,i,o)}getChars(e){return this.input.substring(e.state.offset,this.state.offset)}charAt(e){return this.input.charCodeAt(e)}advanceState(e){if(e.offset>=this.end)throw this.state=e,new fv('Unexpected character "EOF"',this);let t=this.charAt(e.offset);t===Mc?(e.line++,e.column=0):gI(t)||e.column++,e.offset++,this.updatePeek(e)}updatePeek(e){e.peek=e.offset>=this.end?Br:this.charAt(e.offset)}locationFromCursor(e){return new nv(e.file,e.state.offset,e.state.line,e.state.column)}},TD=class n extends bw{constructor(t,r){var e=(...dhe)=>(super(...dhe),l(this,"internalState"),this);t instanceof n?(e(t),this.internalState={...t.internalState}):(e(t,r),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new n(this)}getChars(t){let r=t.clone(),s="";for(;r.internalState.offsetthis.internalState.peek;if(t()===Sp)if(this.internalState={...this.state},this.advanceState(this.internalState),t()===TF)this.state.peek=Mc;else if(t()===DF)this.state.peek=fI;else if(t()===kF)this.state.peek=bF;else if(t()===IF)this.state.peek=pI;else if(t()===HW)this.state.peek=PW;else if(t()===mI)this.state.peek=wF;else if(t()===_F)if(this.advanceState(this.internalState),t()===Vi){this.advanceState(this.internalState);let r=this.clone(),s=0;for(;t()!==Es;)this.advanceState(this.internalState),s++;this.state.peek=this.decodeHexDigits(r,s)}else{let r=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,4)}else if(t()===AF){this.advanceState(this.internalState);let r=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,2)}else if(YP(t())){let r="",s=0,i=this.clone();for(;YP(t())&&s<3;)i=this.clone(),r+=String.fromCodePoint(t()),this.advanceState(this.internalState),s++;this.state.peek=parseInt(r,8),this.internalState=i.internalState}else gI(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(t,r){let s=this.input.slice(t.internalState.offset,t.internalState.offset+r),i=parseInt(s,16);if(isNaN(i))throw t.state=t.internalState,new fv("Invalid hexadecimal escape sequence",t);return i}},fv=class{constructor(e,t){l(this,"msg");l(this,"cursor");this.msg=e,this.cursor=t}},Or=class n extends pt{constructor(t,r,s){super(r,s);l(this,"elementName");this.elementName=t}static create(t,r,s){return new n(t,r,s)}},ww=class{constructor(e,t){l(this,"rootNodes");l(this,"errors");this.rootNodes=e,this.errors=t}},E7=class{constructor(e){l(this,"getTagDefinition");this.getTagDefinition=e}parse(e,t,r){let s=d7(e,t,this.getTagDefinition,r),i=new DD(s.tokens,this.getTagDefinition);return i.build(),new ww(i.rootNodes,s.errors.concat(i.errors))}},DD=class n{constructor(e,t){l(this,"tokens");l(this,"getTagDefinition");l(this,"_index",-1);l(this,"_peek");l(this,"_containerStack",[]);l(this,"rootNodes",[]);l(this,"errors",[]);this.tokens=e,this.getTagDefinition=t,this._advance()}build(){for(;this._peek.type!==33;)this._peek.type===0||this._peek.type===4?this._consumeStartTag(this._advance()):this._peek.type===3?this._consumeEndTag(this._advance()):this._peek.type===12?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===10?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===5||this._peek.type===7||this._peek.type===6?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===19?this._consumeExpansion(this._advance()):this._peek.type===24?(this._closeVoidElement(),this._consumeBlockOpen(this._advance())):this._peek.type===26?(this._closeVoidElement(),this._consumeBlockClose(this._advance())):this._peek.type===28?(this._closeVoidElement(),this._consumeIncompleteBlock(this._advance())):this._peek.type===29?(this._closeVoidElement(),this._consumeLet(this._advance())):this._peek.type===32?(this._closeVoidElement(),this._consumeIncompleteLet(this._advance())):this._advance();for(let e of this._containerStack)e instanceof di&&this.errors.push(Or.create(e.name,e.sourceSpan,`Unclosed block "${e.name}"`))}_advance(){let e=this._peek;return this._index0)return this.errors=this.errors.concat(i.errors),null;let o=new bt(e.sourceSpan.start,s.sourceSpan.end,e.sourceSpan.fullStart),a=new bt(t.sourceSpan.start,s.sourceSpan.end,t.sourceSpan.fullStart);return new mw(e.parts[0],i.rootNodes,o,e.sourceSpan,a)}_collectExpansionExpTokens(e){let t=[],r=[21];for(;;){if((this._peek.type===19||this._peek.type===21)&&r.push(this._peek.type),this._peek.type===22)if(gR(r,21)){if(r.pop(),r.length===0)return t}else return this.errors.push(Or.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===23)if(gR(r,19))r.pop();else return this.errors.push(Or.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===33)return this.errors.push(Or.create(null,e.sourceSpan,"Invalid ICU message. Missing '}'.")),null;t.push(this._advance())}}_consumeText(e){let t=[e],r=e.sourceSpan,s=e.parts[0];if(s.length>0&&s[0]===` +`){let i=this._getContainer();i!=null&&i.children.length===0&&this.getTagDefinition(i.name).ignoreFirstLf&&(s=s.substring(1),t[0]={type:e.type,sourceSpan:e.sourceSpan,parts:[s]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)e=this._advance(),t.push(e),e.type===8?s+=e.parts.join("").replace(/&([^;]+);/g,vR):e.type===9?s+=e.parts[0]:s+=e.parts.join("");if(s.length>0){let i=e.sourceSpan;this._addToParent(new Zc(s,new bt(r.start,i.end,r.fullStart,r.details),t))}}_closeVoidElement(){let e=this._getContainer();e instanceof ci&&this.getTagDefinition(e.name).isVoid&&this._containerStack.pop()}_consumeStartTag(e){let[t,r]=e.parts,s=[];for(;this._peek.type===14;)s.push(this._consumeAttr(this._advance()));let i=this._getElementFullName(t,r,this._getClosestParentElement()),o=!1;if(this._peek.type===2){this._advance(),o=!0;let f=this.getTagDefinition(i);f.canSelfClose||ZT(i)!==null||f.isVoid||this.errors.push(Or.create(i,e.sourceSpan,`Only void, custom and foreign elements can be self closed "${e.parts[1]}"`))}else this._peek.type===1&&(this._advance(),o=!1);let a=this._peek.sourceSpan.fullStart,c=new bt(e.sourceSpan.start,a,e.sourceSpan.fullStart),u=new bt(e.sourceSpan.start,a,e.sourceSpan.fullStart),d=new ci(i,s,[],c,u,void 0),p=this._getContainer();this._pushContainer(d,p instanceof ci&&this.getTagDefinition(p.name).isClosedByChild(d.name)),o?this._popContainer(i,ci,c):e.type===4&&(this._popContainer(i,ci,null),this.errors.push(Or.create(i,c,`Opening tag "${i}" not terminated.`)))}_pushContainer(e,t){t&&this._containerStack.pop(),this._addToParent(e),this._containerStack.push(e)}_consumeEndTag(e){let t=this._getElementFullName(e.parts[0],e.parts[1],this._getClosestParentElement());if(this.getTagDefinition(t).isVoid)this.errors.push(Or.create(t,e.sourceSpan,`Void elements do not have end tags "${e.parts[1]}"`));else if(!this._popContainer(t,ci,e.sourceSpan)){let r=`Unexpected closing tag "${t}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(Or.create(t,e.sourceSpan,r))}}_popContainer(e,t,r){let s=!1;for(let i=this._containerStack.length-1;i>=0;i--){let o=this._containerStack[i];if((o.name===e||e===null)&&o instanceof t)return o.endSourceSpan=r,o.sourceSpan.end=r!==null?r.end:o.sourceSpan.end,this._containerStack.splice(i,this._containerStack.length-i),!s;(o instanceof di||o instanceof ci&&!this.getTagDefinition(o.name).closedByParent)&&(s=!0)}return!1}_consumeAttr(e){let t=YT(e.parts[0],e.parts[1]),r=e.sourceSpan.end;this._peek.type===15&&this._advance();let s="",i=[],o,a;if(this._peek.type===16)for(o=this._peek.sourceSpan,a=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let d=this._advance();i.push(d),d.type===17?s+=d.parts.join("").replace(/&([^;]+);/g,vR):d.type===9?s+=d.parts[0]:s+=d.parts.join(""),a=r=d.sourceSpan.end}this._peek.type===15&&(r=this._advance().sourceSpan.end);let u=o&&a&&new bt(o.start,a,o.fullStart);return new xD(t,s,new bt(e.sourceSpan.start,r,e.sourceSpan.fullStart),e.sourceSpan,u,i.length>0?i:void 0,void 0)}_consumeBlockOpen(e){let t=[];for(;this._peek.type===27;){let a=this._advance();t.push(new gw(a.parts[0],a.sourceSpan))}this._peek.type===25&&this._advance();let r=this._peek.sourceSpan.fullStart,s=new bt(e.sourceSpan.start,r,e.sourceSpan.fullStart),i=new bt(e.sourceSpan.start,r,e.sourceSpan.fullStart),o=new di(e.parts[0],t,[],s,e.sourceSpan,i);this._pushContainer(o,!1)}_consumeBlockClose(e){this._popContainer(null,di,e.sourceSpan)||this.errors.push(Or.create(null,e.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncompleteBlock(e){let t=[];for(;this._peek.type===27;){let a=this._advance();t.push(new gw(a.parts[0],a.sourceSpan))}let r=this._peek.sourceSpan.fullStart,s=new bt(e.sourceSpan.start,r,e.sourceSpan.fullStart),i=new bt(e.sourceSpan.start,r,e.sourceSpan.fullStart),o=new di(e.parts[0],t,[],s,e.sourceSpan,i);this._pushContainer(o,!1),this._popContainer(null,di,null),this.errors.push(Or.create(e.parts[0],s,`Incomplete block "${e.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(e){let t=e.parts[0],r,s;if(this._peek.type!==30){this.errors.push(Or.create(e.parts[0],e.sourceSpan,`Invalid @let declaration "${t}". Declaration must have a value.`));return}else r=this._advance();if(this._peek.type!==31){this.errors.push(Or.create(e.parts[0],e.sourceSpan,`Unterminated @let declaration "${t}". Declaration must be terminated with a semicolon.`));return}else s=this._advance();let i=s.sourceSpan.fullStart,o=new bt(e.sourceSpan.start,i,e.sourceSpan.fullStart),a=e.sourceSpan.toString().lastIndexOf(t),c=e.sourceSpan.start.moveBy(a),u=new bt(c,e.sourceSpan.end),d=new vw(t,r.parts[0],o,u,r.sourceSpan);this._addToParent(d)}_consumeIncompleteLet(e){let t=e.parts[0]??"",r=t?` "${t}"`:"";if(t.length>0){let s=e.sourceSpan.toString().lastIndexOf(t),i=e.sourceSpan.start.moveBy(s),o=new bt(i,e.sourceSpan.end),a=new bt(e.sourceSpan.start,e.sourceSpan.start.moveBy(0)),c=new vw(t,"",e.sourceSpan,o,a);this._addToParent(c)}this.errors.push(Or.create(e.parts[0],e.sourceSpan,`Incomplete @let declaration${r}. @let declarations must be written as \`@let = ;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestParentElement(){for(let e=this._containerStack.length-1;e>-1;e--)if(this._containerStack[e]instanceof ci)return this._containerStack[e];return null}_addToParent(e){let t=this._getContainer();t===null?this.rootNodes.push(e):t.children.push(e)}_getElementFullName(e,t,r){if(e===""&&(e=this.getTagDefinition(t).implicitNamespacePrefix||"",e===""&&r!=null)){let s=Kr(r.name)[1];this.getTagDefinition(s).preventNamespaceInheritance||(e=ZT(r.name))}return YT(e,t)}};function gR(n,e){return n.length>0&&n[n.length-1]===e}function vR(n,e){return pv[e]!==void 0?pv[e]||n:/^#x[a-f0-9]+$/i.test(e)?String.fromCodePoint(parseInt(e.slice(2),16)):/^#\d+$/.test(e)?String.fromCodePoint(parseInt(e.slice(1),10)):n}var KF="ngPreserveWhitespaces",x7=new Set(["pre","template","textarea","script","style"]),JF=` \f +\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,S7=new RegExp(`[^${JF}]`),C7=new RegExp(`[${JF}]{2,}`,"g");function T7(n){return n.some(e=>e.name===KF)}function eL(n){return n.replace(new RegExp(QF,"g")," ")}var Ew=class{constructor(e,t,r=!0){l(this,"preserveSignificantWhitespace");l(this,"originalNodeMap");l(this,"requireContext");l(this,"icuExpansionDepth",0);this.preserveSignificantWhitespace=e,this.originalNodeMap=t,this.requireContext=r}visitElement(e,t){if(x7.has(e.name)||T7(e.attrs)){let s=new ci(e.name,pp(this,e.attrs),e.children,e.sourceSpan,e.startSourceSpan,e.endSourceSpan,e.i18n);return this.originalNodeMap?.set(s,e),s}let r=new ci(e.name,e.attrs,pp(this,e.children),e.sourceSpan,e.startSourceSpan,e.endSourceSpan,e.i18n);return this.originalNodeMap?.set(r,e),r}visitAttribute(e,t){return e.name!==KF?e:null}visitText(e,t){let r=e.value.match(S7),s=t&&(t.prev instanceof Nc||t.next instanceof Nc);if(this.icuExpansionDepth>0&&this.preserveSignificantWhitespace)return e;if(r||s){let o=e.tokens.map(d=>d.type===5?k7(d):d);if(!this.preserveSignificantWhitespace&&o.length>0){let d=o[0];o.splice(0,1,D7(d,t));let p=o[o.length-1];o.splice(o.length-1,1,I7(p,t))}let a=nL(e.value),c=this.preserveSignificantWhitespace?a:_7(a,t),u=new Zc(c,e.sourceSpan,o,e.i18n);return this.originalNodeMap?.set(u,e),u}return null}visitComment(e,t){return e}visitExpansion(e,t){this.icuExpansionDepth++;let r;try{r=new Nc(e.switchValue,e.type,pp(this,e.cases),e.sourceSpan,e.switchValueSourceSpan,e.i18n)}finally{this.icuExpansionDepth--}return this.originalNodeMap?.set(r,e),r}visitExpansionCase(e,t){let r=new mw(e.value,pp(this,e.expression),e.sourceSpan,e.valueSourceSpan,e.expSourceSpan);return this.originalNodeMap?.set(r,e),r}visitBlock(e,t){let r=new di(e.name,e.parameters,pp(this,e.children),e.sourceSpan,e.nameSpan,e.startSourceSpan,e.endSourceSpan);return this.originalNodeMap?.set(r,e),r}visitBlockParameter(e,t){return e}visitLetDeclaration(e,t){return e}visit(e,t){if(this.requireContext&&!t)throw new Error("WhitespaceVisitor requires context. Visit via `visitAllWithSiblings` to get this context.");return!1}};function D7(n,e){return n.type!==5||!!e?.prev?n:tL(n,r=>r.trimStart())}function I7(n,e){return n.type!==5||!!e?.next?n:tL(n,r=>r.trimEnd())}function _7(n,e){let t=!e?.prev,r=!e?.next,s=t?n.trimStart():n;return r?s.trimEnd():s}function k7({type:n,parts:e,sourceSpan:t}){return{type:n,parts:[nL(e[0])],sourceSpan:t}}function tL({type:n,parts:e,sourceSpan:t},r){return{type:n,parts:[r(e[0])],sourceSpan:t}}function nL(n){return eL(n).replace(C7," ")}function pp(n,e){let t=[];return e.forEach((r,s)=>{let i={prev:e[s-1],next:e[s+1]},o=r.visit(n,i);o&&t.push(o)}),t}var Nt;(function(n){n[n.Character=0]="Character",n[n.Identifier=1]="Identifier",n[n.PrivateIdentifier=2]="PrivateIdentifier",n[n.Keyword=3]="Keyword",n[n.String=4]="String",n[n.Operator=5]="Operator",n[n.Number=6]="Number",n[n.Error=7]="Error"})(Nt||(Nt={}));var El;(function(n){n[n.Plain=0]="Plain",n[n.TemplateLiteralPart=1]="TemplateLiteralPart",n[n.TemplateLiteralEnd=2]="TemplateLiteralEnd"})(El||(El={}));var A7=["var","let","as","null","undefined","true","false","if","else","this","typeof"],hv=class{tokenize(e){return new ID(e).scan()}},Wi=class{constructor(e,t,r,s,i){l(this,"index");l(this,"end");l(this,"type");l(this,"numValue");l(this,"strValue");this.index=e,this.end=t,this.type=r,this.numValue=s,this.strValue=i}isCharacter(e){return this.type===Nt.Character&&this.numValue===e}isNumber(){return this.type===Nt.Number}isString(){return this.type===Nt.String}isOperator(e){return this.type===Nt.Operator&&this.strValue===e}isIdentifier(){return this.type===Nt.Identifier}isPrivateIdentifier(){return this.type===Nt.PrivateIdentifier}isKeyword(){return this.type===Nt.Keyword}isKeywordLet(){return this.type===Nt.Keyword&&this.strValue==="let"}isKeywordAs(){return this.type===Nt.Keyword&&this.strValue==="as"}isKeywordNull(){return this.type===Nt.Keyword&&this.strValue==="null"}isKeywordUndefined(){return this.type===Nt.Keyword&&this.strValue==="undefined"}isKeywordTrue(){return this.type===Nt.Keyword&&this.strValue==="true"}isKeywordFalse(){return this.type===Nt.Keyword&&this.strValue==="false"}isKeywordThis(){return this.type===Nt.Keyword&&this.strValue==="this"}isKeywordTypeof(){return this.type===Nt.Keyword&&this.strValue==="typeof"}isError(){return this.type===Nt.Error}toNumber(){return this.type===Nt.Number?this.numValue:-1}isTemplateLiteralPart(){return this.isString()&&this.kind===El.TemplateLiteralPart}isTemplateLiteralEnd(){return this.isString()&&this.kind===El.TemplateLiteralEnd}isTemplateLiteralInterpolationStart(){return this.isOperator("${")}isTemplateLiteralInterpolationEnd(){return this.isOperator("}")}toString(){switch(this.type){case Nt.Character:case Nt.Identifier:case Nt.Keyword:case Nt.Operator:case Nt.PrivateIdentifier:case Nt.String:case Nt.Error:return this.strValue;case Nt.Number:return this.numValue.toString();default:return null}}},Ig=class extends Wi{constructor(t,r,s,i){super(t,r,Nt.String,0,s);l(this,"kind");this.kind=i}};function o0(n,e,t){return new Wi(n,e,Nt.Character,t,String.fromCharCode(t))}function M7(n,e,t){return new Wi(n,e,Nt.Identifier,0,t)}function N7(n,e,t){return new Wi(n,e,Nt.PrivateIdentifier,0,t)}function P7(n,e,t){return new Wi(n,e,Nt.Keyword,0,t)}function mg(n,e,t){return new Wi(n,e,Nt.Operator,0,t)}function R7(n,e,t){return new Wi(n,e,Nt.Number,t,"")}function F7(n,e,t){return new Wi(n,e,Nt.Error,0,t)}var a0=new Wi(-1,-1,Nt.Character,0,""),ID=class{constructor(e){l(this,"input");l(this,"tokens",[]);l(this,"length");l(this,"peek",0);l(this,"index",-1);l(this,"braceStack",[]);this.input=e,this.length=e.length,this.advance()}scan(){let e=this.scanToken();for(;e!==null;)this.tokens.push(e),e=this.scanToken();return this.tokens}advance(){this.peek=++this.index>=this.length?Br:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,t=this.length,r=this.peek,s=this.index;for(;r<=EF;)if(++s>=t){r=Br;break}else r=e.charCodeAt(s);if(this.peek=r,this.index=s,s>=t)return null;if(yR(r))return this.scanIdentifier();if(xo(r))return this.scanNumber(s);let i=s;switch(r){case up:return this.advance(),xo(this.peek)?this.scanNumber(i):o0(i,this.index,up);case ba:case $i:case xp:case gp:case mi:case vl:case $s:return this.scanCharacter(i,r);case Vi:return this.scanOpenBrace(i,r);case Es:return this.scanCloseBrace(i,r);case Jg:case Kg:return this.scanString();case oD:return this.advance(),this.scanTemplateLiteralPart(i);case xF:return this.scanPrivateIdentifier();case SF:case ew:case FW:case fa:case RW:case $W:return this.scanOperator(i,String.fromCharCode(r));case GP:return this.scanQuestion(i);case mp:case hl:return this.scanComplexOperator(i,String.fromCharCode(r),_c,"=");case iD:case _c:return this.scanComplexOperator(i,String.fromCharCode(r),_c,"=",_c,"=");case J0:return this.scanComplexOperator(i,"&",J0,"&");case ZP:return this.scanComplexOperator(i,"|",ZP,"|");case MF:for(;ev(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(r)}]`,0)}scanCharacter(e,t){return this.advance(),o0(e,this.index,t)}scanOperator(e,t){return this.advance(),mg(e,this.index,t)}scanOpenBrace(e,t){return this.braceStack.push("expression"),this.advance(),o0(e,this.index,t)}scanCloseBrace(e,t){return this.advance(),this.braceStack.pop()==="interpolation"?(this.tokens.push(mg(e,this.index,"}")),this.scanTemplateLiteralPart(this.index)):o0(e,this.index,t)}scanComplexOperator(e,t,r,s,i,o){this.advance();let a=t;return this.peek==r&&(this.advance(),a+=s),i!=null&&this.peek==i&&(this.advance(),a+=o),mg(e,this.index,a)}scanIdentifier(){let e=this.index;for(this.advance();bR(this.peek);)this.advance();let t=this.input.substring(e,this.index);return A7.indexOf(t)>-1?P7(e,this.index,t):M7(e,this.index,t)}scanPrivateIdentifier(){let e=this.index;if(this.advance(),!yR(this.peek))return this.error("Invalid character [#]",-1);for(;bR(this.peek);)this.advance();let t=this.input.substring(e,this.index);return N7(e,this.index,t)}scanNumber(e){let t=this.index===e,r=!1;for(this.advance();;){if(!xo(this.peek))if(this.peek===xv){if(!xo(this.input.charCodeAt(this.index-1))||!xo(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);r=!0}else if(this.peek===up)t=!1;else if(L7(this.peek)){if(this.advance(),O7(this.peek)&&this.advance(),!xo(this.peek))return this.error("Invalid exponent",-1);t=!1}else break;this.advance()}let s=this.input.substring(e,this.index);r&&(s=s.replace(/_/g,""));let i=t?V7(s):parseFloat(s);return R7(e,this.index,i)}scanString(){let e=this.index,t=this.peek;this.advance();let r="",s=this.index,i=this.input;for(;this.peek!=t;)if(this.peek==Sp){let a=this.scanStringBackslash(r,s);if(typeof a!="string")return a;r=a,s=this.index}else{if(this.peek==Br)return this.error("Unterminated quote",0);this.advance()}let o=i.substring(s,this.index);return this.advance(),new Ig(e,this.index,r+o,El.Plain)}scanQuestion(e){this.advance();let t="?";return(this.peek===GP||this.peek===up)&&(t+=this.peek===up?".":"?",this.advance()),mg(e,this.index,t)}scanTemplateLiteralPart(e){let t="",r=this.index;for(;this.peek!==oD;)if(this.peek===Sp){let i=this.scanStringBackslash(t,r);if(typeof i!="string")return i;t=i,r=this.index}else if(this.peek===Vw){let i=this.index;if(this.advance(),this.peek===Vi)return this.braceStack.push("interpolation"),this.tokens.push(new Ig(e,i,t+this.input.substring(r,i),El.TemplateLiteralPart)),this.advance(),mg(i,this.index,this.input.substring(i,this.index))}else{if(this.peek===Br)return this.error("Unterminated template literal",0);this.advance()}let s=this.input.substring(r,this.index);return this.advance(),new Ig(e,this.index,t+s,El.TemplateLiteralEnd)}error(e,t){let r=this.index+t;return F7(r,this.index,`Lexer Error: ${e} at column ${r} in expression [${this.input}]`)}scanStringBackslash(e,t){e+=this.input.substring(t,this.index);let r;if(this.advance(),this.peek===_F){let s=this.input.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(s))r=parseInt(s,16);else return this.error(`Invalid unicode escape [\\u${s}]`,0);for(let i=0;i<5;i++)this.advance()}else r=B7(this.peek),this.advance();return e+=String.fromCharCode(r),e}};function yR(n){return jc<=n&&n<=Sv||zp<=n&&n<=$w||n==xv||n==Vw}function bR(n){return tv(n)||xo(n)||n==xv||n==Vw}function L7(n){return n==jW||n==OW}function O7(n){return n==ew||n==SF}function B7(n){switch(n){case TF:return Mc;case mI:return wF;case DF:return fI;case IF:return pI;case kF:return bF;default:return n}}function V7(n){let e=parseInt(n);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+n);return e}var _D=class{constructor(e,t,r){l(this,"strings");l(this,"expressions");l(this,"offsets");this.strings=e,this.expressions=t,this.offsets=r}},kD=class{constructor(e,t,r){l(this,"templateBindings");l(this,"warnings");l(this,"errors");this.templateBindings=e,this.warnings=t,this.errors=r}},xw=class{constructor(e){l(this,"_lexer");l(this,"errors",[]);this._lexer=e}parseAction(e,t,r,s=Co){this._checkNoInterpolation(e,t,s);let i=this._stripComments(e),o=this._lexer.tokenize(i),a=new Cc(e,t,r,o,1,this.errors,0).parseChain();return new pi(a,e,t,r,this.errors)}parseBinding(e,t,r,s=Co){let i=this._parseBindingAst(e,t,r,s);return new pi(i,e,t,r,this.errors)}checkSimpleExpression(e){let t=new AD;return e.visit(t),t.errors}parseSimpleBinding(e,t,r,s=Co){let i=this._parseBindingAst(e,t,r,s),o=this.checkSimpleExpression(i);return o.length>0&&this._reportError(`Host binding expression cannot contain ${o.join(" ")}`,e,t),new pi(i,e,t,r,this.errors)}_reportError(e,t,r,s){this.errors.push(new Og(e,t,r,s))}_parseBindingAst(e,t,r,s){this._checkNoInterpolation(e,t,s);let i=this._stripComments(e),o=this._lexer.tokenize(i);return new Cc(e,t,r,o,0,this.errors,0).parseChain()}parseTemplateBindings(e,t,r,s,i){let o=this._lexer.tokenize(t);return new Cc(t,r,i,o,0,this.errors,0).parseTemplateBindings({source:e,span:new js(s,s+e.length)})}parseInterpolation(e,t,r,s,i=Co){let{strings:o,expressions:a,offsets:c}=this.splitInterpolation(e,t,s,i);if(a.length===0)return null;let u=[];for(let d=0;dd.text),u,e,t,r)}parseInterpolationExpression(e,t,r){let s=this._stripComments(e),i=this._lexer.tokenize(s),o=new Cc(e,t,r,i,0,this.errors,0).parseChain(),a=["",""];return this.createInterpolationAst(a,[o],e,t,r)}createInterpolationAst(e,t,r,s,i){let o=new Bc(0,r.length),a=new wv(o,o.toAbsolute(i),e,t);return new pi(a,r,s,i,this.errors)}splitInterpolation(e,t,r,s=Co){let i=[],o=[],a=[],c=r?$7(r):null,u=0,d=!1,p=!1,{start:f,end:h}=s;for(;u-1)break;i>-1&&o>-1&&this._reportError(`Got interpolation (${r}${s}) where expression was expected`,e,`at column ${i} in`,t)}_getInterpolationEndIndex(e,t,r){for(let s of this._forEachUnquotedChar(e,r)){if(e.startsWith(t,s))return s;if(e.startsWith("//",s))return e.indexOf(t,s)}return-1}*_forEachUnquotedChar(e,t){let r=null,s=0;for(let i=t;i=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){return this.index>0?this.peek(-1).end+this.offset:this.tokens.length===0?this.input.length+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,t){let r=this.currentEndIndex;if(t!==void 0&&t>this.currentEndIndex&&(r=t),e>r){let s=r;r=e,e=s}return new Bc(e,r)}sourceSpan(e,t){let r=`${e}@${this.inputIndex}:${t}`;return this.sourceSpanCache.has(r)||this.sourceSpanCache.set(r,this.span(e,t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(r)}advance(){this.index++}withContext(e,t){this.context|=e;let r=t();return this.context^=e,r}consumeOptionalCharacter(e){return this.next.isCharacter(e)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error(`Missing expected ${String.fromCharCode(e)}`)}consumeOptionalOperator(e){return this.next.isOperator(e)?(this.advance(),!0):!1}expectOperator(e){this.consumeOptionalOperator(e)||this.error(`Missing expected operator ${e}`)}prettyPrintToken(e){return e===a0?"end of input":`token ${e}`}expectIdentifierOrKeyword(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier or keyword`),null):(this.advance(),e.toString())}expectIdentifierOrKeywordOrString(){let e=this.next;return!e.isIdentifier()&&!e.isKeyword()&&!e.isString()?(e.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(e,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(e)}, expected identifier, keyword, or string`),""):(this.advance(),e.toString())}parseChain(){let e=[],t=this.inputIndex;for(;this.index":case"<=":case">=":this.advance();let s=this.parseAdditive();t=new Oi(this.span(e),this.sourceSpan(e),r,t,s);continue}break}return t}parseAdditive(){let e=this.inputIndex,t=this.parseMultiplicative();for(;this.next.type==Nt.Operator;){let r=this.next.strValue;switch(r){case"+":case"-":this.advance();let s=this.parseMultiplicative();t=new Oi(this.span(e),this.sourceSpan(e),r,t,s);continue}break}return t}parseMultiplicative(){let e=this.inputIndex,t=this.parsePrefix();for(;this.next.type==Nt.Operator;){let r=this.next.strValue;switch(r){case"*":case"%":case"/":this.advance();let s=this.parsePrefix();t=new Oi(this.span(e),this.sourceSpan(e),r,t,s);continue}break}return t}parsePrefix(){if(this.next.type==Nt.Operator){let e=this.inputIndex,t=this.next.strValue,r;switch(t){case"+":return this.advance(),r=this.parsePrefix(),Vg.createPlus(this.span(e),this.sourceSpan(e),r);case"-":return this.advance(),r=this.parsePrefix(),Vg.createMinus(this.span(e),this.sourceSpan(e),r);case"!":return this.advance(),r=this.parsePrefix(),new B0(this.span(e),this.sourceSpan(e),r)}}else if(this.next.isKeywordTypeof()){this.advance();let e=this.inputIndex,t=this.parsePrefix();return new V0(this.span(e),this.sourceSpan(e),t)}return this.parseCallChain()}parseCallChain(){let e=this.inputIndex,t=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(up))t=this.parseAccessMember(t,e,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(ba)?t=this.parseCall(t,e,!0):t=this.consumeOptionalCharacter(xp)?this.parseKeyedReadOrWrite(t,e,!0):this.parseAccessMember(t,e,!0);else if(this.consumeOptionalCharacter(xp))t=this.parseKeyedReadOrWrite(t,e,!1);else if(this.consumeOptionalCharacter(ba))t=this.parseCall(t,e,!1);else if(this.consumeOptionalOperator("!"))t=new $g(this.span(e),this.sourceSpan(e),t);else return t}parsePrimary(){let e=this.inputIndex;if(this.consumeOptionalCharacter(ba)){this.rparensExpected++;let t=this.parsePipe();return this.rparensExpected--,this.expectCharacter($i),t}else{if(this.next.isKeywordNull())return this.advance(),new ui(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new ui(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new ui(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new ui(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new Vc(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(xp)){this.rbracketsExpected++;let t=this.parseExpressionList(gp);return this.rbracketsExpected--,this.expectCharacter(gp),new L0(this.span(e),this.sourceSpan(e),t)}else{if(this.next.isCharacter(Vi))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new vi(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){let t=this.next.toNumber();return this.advance(),new ui(this.span(e),this.sourceSpan(e),t)}else{if(this.next.isTemplateLiteralEnd())return this.parseNoInterpolationTemplateLiteral();if(this.next.isTemplateLiteralPart())return this.parseTemplateLiteral();if(this.next.isString()&&this.next.kind===El.Plain){let t=this.next.toString();return this.advance(),new ui(this.span(e),this.sourceSpan(e),t)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new ws(this.span(e),this.sourceSpan(e))):this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new ws(this.span(e),this.sourceSpan(e))):(this.error(`Unexpected token ${this.next}`),new ws(this.span(e),this.sourceSpan(e)))}}}}parseExpressionList(e){let t=[];do if(!this.next.isCharacter(e))t.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(mi));return t}parseLiteralMap(){let e=[],t=[],r=this.inputIndex;if(this.expectCharacter(Vi),!this.consumeOptionalCharacter(Es)){this.rbracesExpected++;do{let s=this.inputIndex,i=this.next.isString(),o=this.expectIdentifierOrKeywordOrString(),a={key:o,quoted:i};if(e.push(a),i)this.expectCharacter(vl),t.push(this.parsePipe());else if(this.consumeOptionalCharacter(vl))t.push(this.parsePipe());else{a.isShorthandInitialized=!0;let c=this.span(s),u=this.sourceSpan(s);t.push(new $c(c,u,u,new vi(c,u),o))}}while(this.consumeOptionalCharacter(mi)&&!this.next.isCharacter(Es));this.rbracesExpected--,this.expectCharacter(Es)}return new O0(this.span(r),this.sourceSpan(r),e,t)}parseAccessMember(e,t,r){let s=this.inputIndex,i=this.withContext(bp.Writable,()=>{let c=this.expectIdentifierOrKeyword()??"";return c.length===0&&this.error("Expected identifier for property access",e.span.end),c}),o=this.sourceSpan(s),a;if(r)this.consumeOptionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),a=new ws(this.span(t),this.sourceSpan(t))):a=new N0(this.span(t),this.sourceSpan(t),o,e,i);else if(this.consumeOptionalOperator("=")){if(!(this.parseFlags&1))return this.error("Bindings cannot contain assignments"),new ws(this.span(t),this.sourceSpan(t));let c=this.parseConditional();a=new M0(this.span(t),this.sourceSpan(t),o,e,i,c)}else a=new $c(this.span(t),this.sourceSpan(t),o,e,i);return a}parseCall(e,t,r){let s=this.inputIndex;this.rparensExpected++;let i=this.parseCallArguments(),o=this.span(s,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter($i),this.rparensExpected--;let a=this.span(t),c=this.sourceSpan(t);return r?new $0(a,c,e,i,o):new Hg(a,c,e,i,o)}parseCallArguments(){if(this.next.isCharacter($i))return[];let e=[];do e.push(this.parsePipe());while(this.consumeOptionalCharacter(mi));return e}expectTemplateBindingKey(){let e="",t=!1,r=this.currentAbsoluteOffset;do e+=this.expectIdentifierOrKeywordOrString(),t=this.consumeOptionalOperator("-"),t&&(e+="-");while(t);return{source:e,span:new js(r,r+e.length)}}parseTemplateBindings(e){let t=[];for(t.push(...this.parseDirectiveKeywordBindings(e));this.index{this.rbracketsExpected++;let s=this.parsePipe();if(s instanceof ws&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(gp),this.consumeOptionalOperator("="))if(r)this.error("The '?.' operator cannot be used in the assignment");else{let i=this.parseConditional();return new R0(this.span(t),this.sourceSpan(t),e,s,i)}else return r?new P0(this.span(t),this.sourceSpan(t),e,s):new Bg(this.span(t),this.sourceSpan(t),e,s);return new ws(this.span(t),this.sourceSpan(t))})}parseDirectiveKeywordBindings(e){let t=[];this.consumeOptionalCharacter(vl);let r=this.getDirectiveBoundTarget(),s=this.currentAbsoluteOffset,i=this.parseAsBinding(e);i||(this.consumeStatementTerminator(),s=this.currentAbsoluteOffset);let o=new js(e.span.start,s);return t.push(new WT(o,e,r)),i&&t.push(i),t}getDirectiveBoundTarget(){if(this.next===a0||this.peekKeywordAs()||this.peekKeywordLet())return null;let e=this.parsePipe(),{start:t,end:r}=e.span,s=this.input.substring(t,r);return new pi(e,s,this.location,this.absoluteOffset+t,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();let t=this.expectTemplateBindingKey();this.consumeStatementTerminator();let r=new js(e.span.start,this.currentAbsoluteOffset);return new Ug(r,t,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;let e=this.currentAbsoluteOffset;this.advance();let t=this.expectTemplateBindingKey(),r=null;this.consumeOptionalOperator("=")&&(r=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let s=new js(e,this.currentAbsoluteOffset);return new Ug(s,t,r)}parseNoInterpolationTemplateLiteral(){let e=this.next.strValue,t=this.inputIndex;this.advance();let r=this.span(t),s=this.sourceSpan(t);return new jg(r,s,[new H0(r,s,e)],[])}parseTemplateLiteral(){let e=this.inputIndex,t=[],r=[];for(;this.next!==a0;){let s=this.next;if(s.isTemplateLiteralPart()||s.isTemplateLiteralEnd()){let i=this.inputIndex;if(this.advance(),t.push(new H0(this.span(i),this.sourceSpan(i),s.strValue)),s.isTemplateLiteralEnd())break}else if(s.isTemplateLiteralInterpolationStart()){this.advance();let i=this.parsePipe();i instanceof ws?this.error("Template literal interpolation cannot be empty"):r.push(i)}else this.advance()}return new jg(this.span(e),this.sourceSpan(e),t,r)}consumeStatementTerminator(){this.consumeOptionalCharacter($s)||this.consumeOptionalCharacter(mi)}error(e,t=null){this.errors.push(new Og(e,this.input,this.locationText(t),this.location)),this.skip()}locationText(e=null){return e==null&&(e=this.index),ea+c.length,0);r+=o,t+=o}e.set(r,t),s++}return e}function H7(n){return n.visit(new MD)}var MD=class{visitUnary(e,t){return`${e.operator}${e.expr.visit(this,t)}`}visitBinary(e,t){return`${e.left.visit(this,t)} ${e.operation} ${e.right.visit(this,t)}`}visitChain(e,t){return e.expressions.map(r=>r.visit(this,t)).join("; ")}visitConditional(e,t){return`${e.condition.visit(this,t)} ? ${e.trueExp.visit(this,t)} : ${e.falseExp.visit(this,t)}`}visitThisReceiver(){return"this"}visitImplicitReceiver(){return""}visitInterpolation(e,t){return U7(e.strings,e.expressions.map(r=>r.visit(this,t))).join("")}visitKeyedRead(e,t){return`${e.receiver.visit(this,t)}[${e.key.visit(this,t)}]`}visitKeyedWrite(e,t){return`${e.receiver.visit(this,t)}[${e.key.visit(this,t)}] = ${e.value.visit(this,t)}`}visitLiteralArray(e,t){return`[${e.expressions.map(r=>r.visit(this,t)).join(", ")}]`}visitLiteralMap(e,t){return`{${j7(e.keys.map(r=>r.quoted?`'${r.key}'`:r.key),e.values.map(r=>r.visit(this,t))).map(([r,s])=>`${r}: ${s}`).join(", ")}}`}visitLiteralPrimitive(e){if(e.value===null)return"null";switch(typeof e.value){case"number":case"boolean":return e.value.toString();case"undefined":return"undefined";case"string":return`'${e.value.replace(/'/g,"\\'")}'`;default:throw new Error(`Unsupported primitive type: ${e.value}`)}}visitPipe(e,t){return`${e.exp.visit(this,t)} | ${e.name}`}visitPrefixNot(e,t){return`!${e.expression.visit(this,t)}`}visitNonNullAssert(e,t){return`${e.expression.visit(this,t)}!`}visitPropertyRead(e,t){return e.receiver instanceof vi?e.name:`${e.receiver.visit(this,t)}.${e.name}`}visitPropertyWrite(e,t){return e.receiver instanceof vi?`${e.name} = ${e.value.visit(this,t)}`:`${e.receiver.visit(this,t)}.${e.name} = ${e.value.visit(this,t)}`}visitSafePropertyRead(e,t){return`${e.receiver.visit(this,t)}?.${e.name}`}visitSafeKeyedRead(e,t){return`${e.receiver.visit(this,t)}?.[${e.key.visit(this,t)}]`}visitCall(e,t){return`${e.receiver.visit(this,t)}(${e.args.map(r=>r.visit(this,t)).join(", ")})`}visitSafeCall(e,t){return`${e.receiver.visit(this,t)}?.(${e.args.map(r=>r.visit(this,t)).join(", ")})`}visitTypeofExpression(e,t){return`typeof ${e.expression.visit(this,t)}`}visitASTWithSource(e,t){return e.ast.visit(this,t)}visitTemplateLiteral(e,t){let r="";for(let s=0;s[t,e[r]])}function U7(n,e){let t=[];for(let r=0;r(n.set(e,t),n),new Map),qp=class extends ND{constructor(){super();l(this,"_schema",new Map);l(this,"_eventSchema",new Map);Z7.forEach(t=>{let r=new Map,s=new Set,[i,o]=t.split("|"),a=o.split(","),[c,u]=i.split("^");c.split(",").forEach(p=>{this._schema.set(p.toLowerCase(),r),this._eventSchema.set(p.toLowerCase(),s)});let d=u&&this._schema.get(u.toLowerCase());if(d){for(let[p,f]of d)r.set(p,f);for(let p of this._eventSchema.get(u.toLowerCase()))s.add(p)}a.forEach(p=>{if(p.length>0)switch(p[0]){case"*":s.add(p.substring(1));break;case"!":r.set(p.substring(1),q7);break;case"#":r.set(p.substring(1),W7);break;case"%":r.set(p.substring(1),G7);break;default:r.set(p,z7)}})})}hasProperty(t,r,s){if(s.some(a=>a.name===DP.name))return!0;let i=gg(t);if(i.includes("-")){if(jP(i)||GT(i))return!1;if(s.some(a=>a.name===TP.name))return!0}return(this._schema.get(i)||this._schema.get("unknown")).has(r)}hasElement(t,r){if(r.some(i=>i.name===DP.name))return!0;let s=gg(t);return s.includes("-")&&(jP(s)||GT(s)||r.some(i=>i.name===TP.name))?!0:this._schema.has(s)}securityContext(t,r,s){s&&(r=this.getMappedPropName(r));let i=gg(t);r=r.toLowerCase();let o=xq();return o[i+"|"+r]??o["*|"+r]??Vt.NONE}getMappedPropName(t){return rL.get(t)??t}getDefaultComponentElementName(){return"ng-component"}validateProperty(t){return t.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event property '${t}' is disallowed for security reasons, please use (${t.slice(2)})=... +If '${t}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(t){return t.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${t}' is disallowed for security reasons, please use (${t.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(t){let r=gg(t),s=this._schema.get(r)||this._schema.get("unknown");return Array.from(s.keys()).map(i=>Y7.get(i)??i)}allKnownEventsOfElement(t){let r=gg(t);return Array.from(this._eventSchema.get(r)??[])}normalizeAnimationStyleProperty(t){return Kq(t)}normalizeAnimationStyleValue(t,r,s){let i="",o=s.toString().trim(),a=null;if(X7(t)&&s!==0&&s!=="0")if(typeof s=="number")i="px";else{let c=s.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&c[1].length==0&&(a=`Please provide a CSS unit value for ${r}:${s}`)}return{error:a,value:o+i}}};function X7(n){switch(n){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var _t=class{constructor({closedByChildren:e,implicitNamespacePrefix:t,contentType:r=Bi.PARSABLE_DATA,closedByParent:s=!1,isVoid:i=!1,ignoreFirstLf:o=!1,preventNamespaceInheritance:a=!1,canSelfClose:c=!1}={}){l(this,"closedByChildren",{});l(this,"contentType");l(this,"closedByParent",!1);l(this,"implicitNamespacePrefix");l(this,"isVoid");l(this,"ignoreFirstLf");l(this,"canSelfClose");l(this,"preventNamespaceInheritance");e&&e.length>0&&e.forEach(u=>this.closedByChildren[u]=!0),this.isVoid=i,this.closedByParent=s||i,this.implicitNamespacePrefix=t||null,this.contentType=r,this.ignoreFirstLf=o,this.preventNamespaceInheritance=a,this.canSelfClose=c??i}isClosedByChild(e){return this.isVoid||e.toLowerCase()in this.closedByChildren}getContentType(e){return typeof this.contentType=="object"?(e===void 0?void 0:this.contentType[e])??this.contentType.default:this.contentType}},wR,lp;function sL(n){return lp||(wR=new _t({canSelfClose:!0}),lp=Object.assign(Object.create(null),{base:new _t({isVoid:!0}),meta:new _t({isVoid:!0}),area:new _t({isVoid:!0}),embed:new _t({isVoid:!0}),link:new _t({isVoid:!0}),img:new _t({isVoid:!0}),input:new _t({isVoid:!0}),param:new _t({isVoid:!0}),hr:new _t({isVoid:!0}),br:new _t({isVoid:!0}),source:new _t({isVoid:!0}),track:new _t({isVoid:!0}),wbr:new _t({isVoid:!0}),p:new _t({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new _t({closedByChildren:["tbody","tfoot"]}),tbody:new _t({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new _t({closedByChildren:["tbody"],closedByParent:!0}),tr:new _t({closedByChildren:["tr"],closedByParent:!0}),td:new _t({closedByChildren:["td","th"],closedByParent:!0}),th:new _t({closedByChildren:["td","th"],closedByParent:!0}),col:new _t({isVoid:!0}),svg:new _t({implicitNamespacePrefix:"svg"}),foreignObject:new _t({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new _t({implicitNamespacePrefix:"math"}),li:new _t({closedByChildren:["li"],closedByParent:!0}),dt:new _t({closedByChildren:["dt","dd"]}),dd:new _t({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new _t({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new _t({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new _t({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new _t({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new _t({closedByChildren:["optgroup"],closedByParent:!0}),option:new _t({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new _t({ignoreFirstLf:!0}),listing:new _t({ignoreFirstLf:!0}),style:new _t({contentType:Bi.RAW_TEXT}),script:new _t({contentType:Bi.RAW_TEXT}),title:new _t({contentType:{default:Bi.ESCAPABLE_RAW_TEXT,svg:Bi.PARSABLE_DATA}}),textarea:new _t({contentType:Bi.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),new qp().allKnownElementNames().forEach(e=>{!lp[e]&&ZT(e)===null&&(lp[e]=new _t({canSelfClose:!1}))})),lp[n]??lp[n.toLowerCase()]??wR}var ER={A:"LINK",B:"BOLD_TEXT",BR:"LINE_BREAK",EM:"EMPHASISED_TEXT",H1:"HEADING_LEVEL1",H2:"HEADING_LEVEL2",H3:"HEADING_LEVEL3",H4:"HEADING_LEVEL4",H5:"HEADING_LEVEL5",H6:"HEADING_LEVEL6",HR:"HORIZONTAL_RULE",I:"ITALIC_TEXT",LI:"LIST_ITEM",LINK:"MEDIA_LINK",OL:"ORDERED_LIST",P:"PARAGRAPH",Q:"QUOTATION",S:"STRIKETHROUGH_TEXT",SMALL:"SMALL_TEXT",SUB:"SUBSTRIPT",SUP:"SUPERSCRIPT",TBODY:"TABLE_BODY",TD:"TABLE_CELL",TFOOT:"TABLE_FOOTER",TH:"TABLE_HEADER_CELL",THEAD:"TABLE_HEADER",TR:"TABLE_ROW",TT:"MONOSPACED_TEXT",U:"UNDERLINED_TEXT",UL:"UNORDERED_LIST"},PD=class{constructor(){l(this,"_placeHolderNameCounts",{});l(this,"_signatureToName",{})}getStartTagPlaceholderName(e,t,r){let s=this._hashTag(e,t,r);if(this._signatureToName[s])return this._signatureToName[s];let i=e.toUpperCase(),o=ER[i]||`TAG_${i}`,a=this._generateUniqueName(r?o:`START_${o}`);return this._signatureToName[s]=a,a}getCloseTagPlaceholderName(e){let t=this._hashClosingTag(e);if(this._signatureToName[t])return this._signatureToName[t];let r=e.toUpperCase(),s=ER[r]||`TAG_${r}`,i=this._generateUniqueName(`CLOSE_${s}`);return this._signatureToName[t]=i,i}getPlaceholderName(e,t){let r=e.toUpperCase(),s=`PH: ${r}=${t}`;if(this._signatureToName[s])return this._signatureToName[s];let i=this._generateUniqueName(r);return this._signatureToName[s]=i,i}getUniquePlaceholder(e){return this._generateUniqueName(e.toUpperCase())}getStartBlockPlaceholderName(e,t){let r=this._hashBlock(e,t);if(this._signatureToName[r])return this._signatureToName[r];let s=this._generateUniqueName(`START_BLOCK_${this._toSnakeCase(e)}`);return this._signatureToName[r]=s,s}getCloseBlockPlaceholderName(e){let t=this._hashClosingBlock(e);if(this._signatureToName[t])return this._signatureToName[t];let r=this._generateUniqueName(`CLOSE_BLOCK_${this._toSnakeCase(e)}`);return this._signatureToName[t]=r,r}_hashTag(e,t,r){let s=`<${e}`,i=Object.keys(t).sort().map(a=>` ${a}=${t[a]}`).join(""),o=r?"/>":`>`;return s+i+o}_hashClosingTag(e){return this._hashTag(`/${e}`,{},!1)}_hashBlock(e,t){let r=t.length===0?"":` (${t.sort().join("; ")})`;return`@${e}${r} {}`}_hashClosingBlock(e){return this._hashBlock(`close_${e}`,[])}_toSnakeCase(e){return e.toUpperCase().replace(/[^A-Z0-9]/g,"_")}_generateUniqueName(e){if(!this._placeHolderNameCounts.hasOwnProperty(e))return this._placeHolderNameCounts[e]=1,e;let r=this._placeHolderNameCounts[e];return this._placeHolderNameCounts[e]=r+1,`${e}_${r}`}},Q7=new xw(new hv);function K7(n,e,t,r){let s=new RD(Q7,n,e,t,r);return(i,o,a,c,u)=>s.toI18nMessage(i,o,a,c,u)}function J7(n,e){return e}var RD=class{constructor(e,t,r,s,i){l(this,"_expressionParser");l(this,"_interpolationConfig");l(this,"_containerBlocks");l(this,"_retainEmptyTokens");l(this,"_preserveExpressionWhitespace");this._expressionParser=e,this._interpolationConfig=t,this._containerBlocks=r,this._retainEmptyTokens=s,this._preserveExpressionWhitespace=i}toI18nMessage(e,t="",r="",s="",i){let o={isIcu:e.length==1&&e[0]instanceof Nc,icuDepth:0,placeholderRegistry:new PD,placeholderToContent:{},placeholderToMessage:{},visitNodeFn:i||J7},a=jn(this,e,o);return new ls(a,o.placeholderToContent,o.placeholderToMessage,t,r,s)}visitElement(e,t){let r=jn(this,e.children,t),s={};e.attrs.forEach(u=>{s[u.name]=u.value});let i=sL(e.name).isVoid,o=t.placeholderRegistry.getStartTagPlaceholderName(e.name,s,i);t.placeholderToContent[o]={text:e.startSourceSpan.toString(),sourceSpan:e.startSourceSpan};let a="";i||(a=t.placeholderRegistry.getCloseTagPlaceholderName(e.name),t.placeholderToContent[a]={text:``,sourceSpan:e.endSourceSpan??e.sourceSpan});let c=new Cl(e.name,s,o,a,r,i,e.sourceSpan,e.startSourceSpan,e.endSourceSpan);return t.visitNodeFn(e,c)}visitAttribute(e,t){let r=e.valueTokens===void 0||e.valueTokens.length===1?new pg(e.value,e.valueSpan||e.sourceSpan):this._visitTextWithInterpolation(e.valueTokens,e.valueSpan||e.sourceSpan,t,e.i18n);return t.visitNodeFn(e,r)}visitText(e,t){let r=e.tokens.length===1?new pg(e.value,e.sourceSpan):this._visitTextWithInterpolation(e.tokens,e.sourceSpan,t,e.i18n);return t.visitNodeFn(e,r)}visitComment(e,t){return null}visitExpansion(e,t){t.icuDepth++;let r={},s=new Q0(e.switchValue,e.type,r,e.sourceSpan);if(e.cases.forEach(a=>{r[a.value]=new ya(a.expression.map(c=>c.visit(this,t)),a.expSourceSpan)}),t.icuDepth--,t.isIcu||t.icuDepth>0){let a=t.placeholderRegistry.getUniquePlaceholder(`VAR_${e.type}`);return s.expressionPlaceholder=a,t.placeholderToContent[a]={text:e.switchValue,sourceSpan:e.switchValueSourceSpan},t.visitNodeFn(e,s)}let i=t.placeholderRegistry.getPlaceholderName("ICU",e.sourceSpan.toString());t.placeholderToMessage[i]=this.toI18nMessage([e],"","","",void 0);let o=new Lp(s,i,e.sourceSpan);return t.visitNodeFn(e,o)}visitExpansionCase(e,t){throw new Error("Unreachable code")}visitBlock(e,t){let r=jn(this,e.children,t);if(this._containerBlocks.has(e.name))return new ya(r,e.sourceSpan);let s=e.parameters.map(c=>c.expression),i=t.placeholderRegistry.getStartBlockPlaceholderName(e.name,s),o=t.placeholderRegistry.getCloseBlockPlaceholderName(e.name);t.placeholderToContent[i]={text:e.startSourceSpan.toString(),sourceSpan:e.startSourceSpan},t.placeholderToContent[o]={text:e.endSourceSpan?e.endSourceSpan.toString():"}",sourceSpan:e.endSourceSpan??e.sourceSpan};let a=new Tl(e.name,s,i,o,r,e.sourceSpan,e.startSourceSpan,e.endSourceSpan);return t.visitNodeFn(e,a)}visitBlockParameter(e,t){throw new Error("Unreachable code")}visitLetDeclaration(e,t){return null}_visitTextWithInterpolation(e,t,r,s){let i=[],o=!1;for(let a of e)switch(a.type){case 8:case 17:o=!0;let[c,u,d]=a.parts,p=sZ(u)||"INTERPOLATION",f=r.placeholderRegistry.getPlaceholderName(p,u);if(this._preserveExpressionWhitespace)r.placeholderToContent[f]={text:a.parts.join(""),sourceSpan:a.sourceSpan},i.push(new Xg(u,f,a.sourceSpan));else{let h=this.normalizeExpression(a);r.placeholderToContent[f]={text:`${c}${h}${d}`,sourceSpan:a.sourceSpan},i.push(new Xg(h,f,a.sourceSpan))}break;default:if(a.parts[0].length>0||this._retainEmptyTokens){let h=i[i.length-1];h instanceof pg?(h.value+=a.parts[0],h.sourceSpan=new bt(h.sourceSpan.start,a.sourceSpan.end,h.sourceSpan.fullStart,h.sourceSpan.details)):i.push(new pg(a.parts[0],a.sourceSpan))}else this._retainEmptyTokens&&i.push(new pg(a.parts[0],a.sourceSpan));break}return o?(eZ(i,s),new ya(i,t)):i[0]}normalizeExpression(e){let t=e.parts[1],r=this._expressionParser.parseBinding(t,e.sourceSpan.start.toString(),e.sourceSpan.start.offset,this._interpolationConfig);return H7(r)}};function eZ(n,e){if(e instanceof ls&&(tZ(e),e=e.nodes[0]),e instanceof ya){nZ(e.children,n);for(let t=0;t`"${t.sourceSpan.toString()}"`).join(` +`)} + +Second pass (${e.length} tokens): +${e.map(t=>`"${t.sourceSpan.toString()}"`).join(` +`)} + `.trim());if(n.some((t,r)=>e[r].constructor!==t.constructor))throw new Error("The types of the i18n message children changed between first and second pass.")}var rZ=/\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;function sZ(n){return n.split(rZ)[2]}var FD=class extends pt{constructor(e,t){super(e,t)}},xR=new Set(["iframe|srcdoc","*|innerhtml","*|outerhtml","embed|src","iframe|src","object|codebase","object|data"]);function iZ(n,e){return n=n.toLowerCase(),e=e.toLowerCase(),xR.has(n+"|"+e)||xR.has("*|"+e)}var oZ=n=>(e,t)=>{let r=n.get(e)??e;return r instanceof Il&&(t instanceof Lp&&r.i18n instanceof ls&&(t.previousMessage=r.i18n),r.i18n=t),t},Sw=class{constructor(e=Co,t=!1,r=!1,s=NW,i=!0,o=!i){l(this,"interpolationConfig");l(this,"keepI18nAttrs");l(this,"enableI18nLegacyMessageIdFormat");l(this,"containerBlocks");l(this,"preserveSignificantWhitespace");l(this,"retainEmptyTokens");l(this,"hasI18nMeta",!1);l(this,"_errors",[]);this.interpolationConfig=e,this.keepI18nAttrs=t,this.enableI18nLegacyMessageIdFormat=r,this.containerBlocks=s,this.preserveSignificantWhitespace=i,this.retainEmptyTokens=o}_generateI18nMessage(e,t="",r){let{meaning:s,description:i,customId:o}=this._parseMetadata(t),c=K7(this.interpolationConfig,this.containerBlocks,this.retainEmptyTokens,this.preserveSignificantWhitespace)(e,s,i,o,r);return this._setMessageId(c,t),this._setLegacyIds(c,t),c}visitAllWithErrors(e){let t=e.map(r=>r.visit(this,null));return new ww(t,this._errors)}visitElement(e){let t;if(TW(e)){this.hasI18nMeta=!0;let r=[],s={};for(let i of e.attrs)if(i.name===mF){let o=e.i18n||i.value,a=new Map,c=this.preserveSignificantWhitespace?e.children:pp(new Ew(!1,a),e.children);t=this._generateI18nMessage(c,o,oZ(a)),t.nodes.length===0&&(t=void 0),e.i18n=t}else if(i.name.startsWith(sD)){let o=i.name.slice(sD.length);iZ(e.name,o)?this._reportError(i,`Translating attribute '${o}' is disallowed for security reasons.`):s[o]=i.value}else r.push(i);if(Object.keys(s).length)for(let i of r){let o=s[i.name];o!==void 0&&i.value&&(i.i18n=this._generateI18nMessage([i],i.i18n||o))}this.keepI18nAttrs||(e.attrs=r)}return jn(this,e.children,t),e}visitExpansion(e,t){let r,s=e.i18n;if(this.hasI18nMeta=!0,s instanceof Lp){let i=s.name;r=this._generateI18nMessage([e],s);let o=vF(r);o.name=i,t!==null&&(t.placeholderToMessage[i]=r)}else r=this._generateI18nMessage([e],t||s);return e.i18n=r,e}visitText(e){return e}visitAttribute(e){return e}visitComment(e){return e}visitExpansionCase(e){return e}visitBlock(e,t){return jn(this,e.children,t),e}visitBlockParameter(e,t){return e}visitLetDeclaration(e,t){return e}_parseMetadata(e){return typeof e=="string"?cZ(e):e instanceof ls?e:{}}_setMessageId(e,t){e.id||(e.id=t instanceof ls&&t.id||Iq(e))}_setLegacyIds(e,t){if(this.enableI18nLegacyMessageIdFormat)e.legacyIds=[Dq(e),lF(e)];else if(typeof t!="string"){let r=t instanceof ls?t:t instanceof Lp?t.previousMessage:void 0;e.legacyIds=r?r.legacyIds:[]}}_reportError(e,t){this._errors.push(new FD(e.sourceSpan,t))}},aZ="|",lZ="@@";function cZ(n=""){let e,t,r;if(n=n.trim(),n){let s=n.indexOf(lZ),i=n.indexOf(aZ),o;[o,e]=s>-1?[n.slice(0,s),n.slice(s+2)]:[n,""],[t,r]=i>-1?[o.slice(0,i),o.slice(i+1)]:["",o]}return{customId:e,meaning:t,description:r}}function uZ(n){let e=[];return n.description?e.push({tagName:"desc",text:n.description}):e.push({tagName:"suppress",text:"{msgDescriptions}"}),n.meaning&&e.push({tagName:"meaning",text:n.meaning}),jq(e)}var dZ="goog.getMsg";function pZ(n,e,t,r){let s=hZ(e),i=[Y(s)];Object.keys(r).length&&(i.push(wD(cI(r,!0),!0)),i.push(wD({original_code:cs(Object.keys(r).map(c=>({key:Ev(c),quoted:!0,value:e.placeholders[c]?Y(e.placeholders[c].sourceSpan.toString()):Y(e.placeholderToMessage[c].nodes.map(u=>u.sourceSpan.toString()).join(""))})))})));let o=t.set(kt(dZ).callFn(i)).toConstDecl();o.addLeadingComment(uZ(e));let a=new bi(n.set(t));return[o,a]}var LD=class{formatPh(e){return`{$${Ev(e)}}`}visitText(e){return e.value}visitContainer(e){return e.children.map(t=>t.visit(this)).join("")}visitIcu(e){return XF(e)}visitTagPlaceholder(e){return e.isVoid?this.formatPh(e.startName):`${this.formatPh(e.startName)}${e.children.map(t=>t.visit(this)).join("")}${this.formatPh(e.closeName)}`}visitPlaceholder(e){return this.formatPh(e.name)}visitBlockPlaceholder(e){return`${this.formatPh(e.startName)}${e.children.map(t=>t.visit(this)).join("")}${this.formatPh(e.closeName)}`}visitIcuPlaceholder(e,t){return this.formatPh(e.name)}},fZ=new LD;function hZ(n){return n.nodes.map(e=>e.visit(fZ,null)).join("")}function mZ(n,e,t){let{messageParts:r,placeHolders:s}=gZ(e),i=vZ(e),o=s.map(u=>t[u.text]),a=Wq(e,r,s,o,i),c=n.set(a);return[new bi(c)]}var OD=class{constructor(e,t){l(this,"placeholderToMessage");l(this,"pieces");this.placeholderToMessage=e,this.pieces=t}visitText(e){if(this.pieces[this.pieces.length-1]instanceof kc)this.pieces[this.pieces.length-1].text+=e.value;else{let t=new bt(e.sourceSpan.fullStart,e.sourceSpan.end,e.sourceSpan.fullStart,e.sourceSpan.details);this.pieces.push(new kc(e.value,t))}}visitContainer(e){e.children.forEach(t=>t.visit(this))}visitIcu(e){this.pieces.push(new kc(XF(e),e.sourceSpan))}visitTagPlaceholder(e){this.pieces.push(this.createPlaceholderPiece(e.startName,e.startSourceSpan??e.sourceSpan)),e.isVoid||(e.children.forEach(t=>t.visit(this)),this.pieces.push(this.createPlaceholderPiece(e.closeName,e.endSourceSpan??e.sourceSpan)))}visitPlaceholder(e){this.pieces.push(this.createPlaceholderPiece(e.name,e.sourceSpan))}visitBlockPlaceholder(e){this.pieces.push(this.createPlaceholderPiece(e.startName,e.startSourceSpan??e.sourceSpan)),e.children.forEach(t=>t.visit(this)),this.pieces.push(this.createPlaceholderPiece(e.closeName,e.endSourceSpan??e.sourceSpan))}visitIcuPlaceholder(e){this.pieces.push(this.createPlaceholderPiece(e.name,e.sourceSpan,this.placeholderToMessage[e.name]))}createPlaceholderPiece(e,t,r){return new wp(Ev(e,!1),t,r)}};function gZ(n){let e=[],t=new OD(n.placeholderToMessage,e);return n.nodes.forEach(r=>r.visit(t)),yZ(e)}function vZ(n){let e=n.nodes[0],t=n.nodes[n.nodes.length-1];return new bt(e.sourceSpan.fullStart,t.sourceSpan.end,e.sourceSpan.fullStart,e.sourceSpan.details)}function yZ(n){let e=[],t=[];n[0]instanceof wp&&e.push(ET(n[0].sourceSpan.start));for(let r=0;r{let g=f.has(m.name);return f.add(m.name),!g});let h=p.flatMap(m=>{let g=o.get(m.context);if(g===void 0)throw new Error("AssertionError: Could not find i18n expression's value");return[Y(m.name),g]});d.i18nAttributesConfig=n.addConst(new Hi(h))}for(let c of n.units)for(let u of c.create)if(u.kind===w.I18nStart){let d=a.get(u.root);if(d===void 0)throw new Error("AssertionError: Could not find corresponding i18n block index for an i18n message op; was an i18n message incorrectly assumed to correspond to an attribute?");u.messageIndex=d}}function iL(n,e,t,r){let s=[],i=new Map;for(let u of r.subMessages){let d=t.get(u),{mainVar:p,statements:f}=iL(n,e,t,d);s.push(...f);let h=i.get(d.messagePlaceholder)??[];h.push(p),i.set(d.messagePlaceholder,h)}CZ(r,i),r.params=new Map([...r.params.entries()].sort());let o=kt(n.pool.uniqueName(bZ)),a=IZ(n.pool,r.message.id,e,n.i18nUseExternalIds),c;if(r.needsPostprocessing||r.postprocessingParams.size>0){let u=Object.fromEntries([...r.postprocessingParams.entries()].sort()),d=cI(u,!1),p=[];r.postprocessingParams.size>0&&p.push(wD(d,!0)),c=f=>Ze(v.i18nPostprocess).callFn([f,...p])}return s.push(...TZ(r.message,o,a,r.params,c)),{mainVar:o,statements:s}}function CZ(n,e){for(let[t,r]of e)r.length===1?n.params.set(t,r[0]):(n.params.set(t,Y(`${CR}${wZ}${t}${CR}`)),n.postprocessingParams.set(t,tn(r)))}function TZ(n,e,t,r,s){let i=Object.fromEntries(r),o=[xZ(e),Lw(DZ(),pZ(e,n,t,i),mZ(e,n,cI(i,!1)))];return s&&o.push(new bi(e.set(s(e)))),o}function DZ(){return bv(kt(SR)).notIdentical(Y("undefined",oI)).and(kt(SR))}function IZ(n,e,t,r){let s,i=t;if(r){let o=TR("EXTERNAL_"),a=n.uniqueName(i);s=`${o}${Cg(e)}$$${a}`}else{let o=TR(i);s=n.uniqueName(o)}return kt(s)}function _Z(n){for(let e of n.units){let t=null,r=null,s=new Map,i=new Map,o=new Map;for(let a of e.create)switch(a.kind){case w.I18nStart:if(a.context===null)throw Error("I18n op should have its context set.");t=a;break;case w.I18nEnd:t=null;break;case w.IcuStart:if(a.context===null)throw Error("Icu op should have its context set.");r=a;break;case w.IcuEnd:r=null;break;case w.Text:if(t!==null)if(s.set(a.xref,t),i.set(a.xref,r),a.icuPlaceholder!==null){let c=sG(n.allocateXrefId(),a.icuPlaceholder,[a.initialValue]);ge.replace(a,c),o.set(a.xref,c)}else ge.remove(a);break}for(let a of e.update)switch(a.kind){case w.InterpolateText:if(!s.has(a.target))continue;let c=s.get(a.target),u=i.get(a.target),d=o.get(a.target),p=u?u.context:c.context,f=u?Op.Postproccessing:Op.Creation,h=[];for(let m=0;m0){let r=AZ(t.localRefs);t.localRefs=n.addConst(r)}else t.localRefs=null;break}}function AZ(n){let e=[];for(let t of n)e.push(Y(t.name),Y(t.target));return tn(e)}function MZ(n){for(let e of n.units){let t=rr.HTML;for(let r of e.create)r.kind===w.ElementStart&&r.namespace!==t&&(ge.insertBefore(Xz(r.namespace),r),t=r.namespace)}}function NZ(n){let e=[],t=0,r=0,s=0,i=0,o=0,a=null;for(;t0&&r===0&&s===0){let u=n.substring(i,t-1).trim();e.push(a,u),o=t,i=0,a=null}break}if(a&&i){let c=n.slice(i).trim();e.push(a,c)}return e}function oL(n){return n.replace(/[a-z][A-Z]/g,e=>e.charAt(0)+"-"+e.charAt(1)).toLowerCase()}function PZ(n){let e=new Map;for(let t of n.units)for(let r of t.create)Gc(r)&&e.set(r.xref,r);for(let t of n.units)for(let r of t.create)if(r.kind===w.ExtractedAttribute&&r.bindingKind===Qe.Attribute&&HF(r.expression)){let s=e.get(r.target);if(s!==void 0&&s.kind===w.Template&&s.templateKind===Ss.Structural)continue;if(r.name==="style"){let i=NZ(r.expression.value);for(let o=0;o{if(!(!(o instanceof wa)||o.name!==null)){if(!s.has(o.xref))throw new Error(`Variable ${o.xref} not yet named`);o.name=s.get(o.xref)}})}function FZ(n,e,t){if(e.name===null)switch(e.kind){case yr.Context:e.name=`ctx_r${t.index++}`;break;case yr.Identifier:if(n.job.compatibility===Ts.TemplateDefinitionBuilder){let r=e.identifier==="ctx"?"i":"";e.name=`${e.identifier}_${r}r${++t.index}`}else e.name=`${e.identifier}_i${t.index++}`;break;default:e.name=`_r${++t.index}`;break}return e.name}function LZ(n){return n.startsWith("--")?n:oL(n)}function DR(n){let e=n.indexOf("!important");return e>-1?n.substring(0,e):n}function OZ(n){for(let e of n.units){for(let t of e.create)(t.kind===w.Listener||t.kind===w.TwoWayListener)&&IR(t.handlerOps);IR(e.update)}}function IR(n){for(let e of n){if(e.kind!==w.Statement||!(e.statement instanceof bi)||!(e.statement.expr instanceof iw))continue;let t=e.statement.expr.steps,r=!0;for(let s=e.next;s.kind!==w.ListEnd&&r;s=s.next)es(s,(i,o)=>{if(!No(i))return i;if(r&&!(o&Qt.InChildOperation))switch(i.kind){case Ye.NextContext:i.steps+=t,ge.remove(e),r=!1;break;case Ye.GetCurrentView:case Ye.Reference:case Ye.ContextLetReference:r=!1;break}})}}var BZ="ng-container";function VZ(n){for(let e of n.units){let t=new Set;for(let r of e.create)r.kind===w.ElementStart&&r.tag===BZ&&(r.kind=w.ContainerStart,t.add(r.xref)),r.kind===w.ElementEnd&&t.has(r.xref)&&(r.kind=w.ContainerEnd)}}function $Z(n,e){let t=n.get(e);if(t===void 0)throw new Error("All attributes should have an element-like target.");return t}function HZ(n){let e=new Map;for(let t of n.units)for(let r of t.create)Gc(r)&&e.set(r.xref,r);for(let t of n.units)for(let r of t.create)(r.kind===w.ElementStart||r.kind===w.ContainerStart)&&r.nonBindable&&ge.insertAfter(Zz(r.xref),r),(r.kind===w.ElementEnd||r.kind===w.ContainerEnd)&&$Z(e,r.xref).nonBindable&&ge.insertBefore(Yz(r.xref),r)}function jZ(n){for(let e of n.units)for(let t of e.ops())ur(t,r=>{if(!(r instanceof Xt)||r.operator!==Ge.NullishCoalesce)return r;let s=new qi(r.lhs.clone(),n.allocateXrefId()),i=new Ca(s.xref);return new Ea(new Xt(Ge.And,new Xt(Ge.NotIdentical,s,Rg),new Xt(Ge.NotIdentical,i,new Hr(void 0))),i.clone(),r.rhs)},Qt.None)}function ha(n){return e=>e.kind===n}function _g(n,e){return t=>t.kind===n&&e===t.expression instanceof nr}function UZ(n){return n.kind===w.Listener&&!(n.hostListener&&n.isAnimationListener)||n.kind===w.TwoWayListener}function qZ(n){return(n.kind===w.Property||n.kind===w.TwoWayProperty)&&!(n.expression instanceof nr)}var WZ=[{test:n=>n.kind===w.Listener&&n.hostListener&&n.isAnimationListener},{test:UZ}],zZ=[{test:ha(w.StyleMap),transform:Cw},{test:ha(w.ClassMap),transform:Cw},{test:ha(w.StyleProp)},{test:ha(w.ClassProp)},{test:_g(w.Attribute,!0)},{test:_g(w.Property,!0)},{test:qZ},{test:_g(w.Attribute,!1)}],GZ=[{test:_g(w.HostProperty,!0)},{test:_g(w.HostProperty,!1)},{test:ha(w.Attribute)},{test:ha(w.StyleMap),transform:Cw},{test:ha(w.ClassMap),transform:Cw},{test:ha(w.StyleProp)},{test:ha(w.ClassProp)}],_R=new Set([w.Listener,w.TwoWayListener,w.StyleMap,w.ClassMap,w.StyleProp,w.ClassProp,w.Property,w.TwoWayProperty,w.HostProperty,w.Attribute]);function ZZ(n){for(let e of n.units){kR(e.create,WZ);let t=e.job.kind===Fe.Host?GZ:zZ;kR(e.update,t)}}function kR(n,e){let t=[],r=null;for(let s of n){let i=rw(s)?s.target:null;(!_R.has(s.kind)||i!==r&&r!==null&&i!==null)&&(ge.insertBefore(AR(t,e),s),t=[],r=null),_R.has(s.kind)&&(t.push(s),ge.remove(s),r=i??r)}n.push(AR(t,e))}function AR(n,e){let t=Array.from(e,()=>new Array);for(let r of n){let s=e.findIndex(i=>i.test(r));t[s].push(r)}return t.flatMap((r,s)=>{let i=e[s].transform;return i?i(r):r})}function Cw(n){return n.slice(n.length-1)}function YZ(n){for(let e of n.units){let t=GF(e);for(let r of e.ops())switch(r.kind){case w.Binding:let s=QZ(t,r.target);XZ(r.name)&&s.kind===w.Projection&&ge.remove(r);break}}}function XZ(n){return n.toLowerCase()==="select"}function QZ(n,e){let t=n.get(e);if(t===void 0)throw new Error("All attributes should have an slottable target.");return t}function KZ(n){for(let e of n.units)JZ(e)}function JZ(n){for(let e of n.update)es(e,(t,r)=>{if(No(t)&&t.kind===Ye.PipeBinding){if(r&Qt.InChildOperation)throw new Error("AssertionError: pipe bindings should not appear in child expressions");if(n.job.compatibility){if(e.target==null)throw new Error("AssertionError: expected slot handle to be assigned for pipe creation");eY(n,e.target,t)}else n.create.push(qF(t.target,t.targetSlot,t.name))}})}function eY(n,e,t){for(let r=n.create.head.next;r.kind!==w.ListEnd;r=r.next){if(!Zp(r)||r.xref!==e)continue;for(;r.next.kind===w.Pipe;)r=r.next;let s=qF(t.target,t.targetSlot,t.name);ge.insertBefore(s,r.next);return}throw new Error(`AssertionError: unable to find insertion point for pipe ${t.name}`)}function tY(n){for(let e of n.units)for(let t of e.update)ur(t,r=>!(r instanceof Vp)||r.args.length<=4?r:new lw(r.target,r.targetSlot,r.name,tn(r.args),r.args.length),Qt.None)}function nY(n){aL(n.root,0)}function aL(n,e){let t=null;for(let r of n.create)switch(r.kind){case w.I18nStart:r.subTemplateIndex=e===0?null:e,t=r;break;case w.I18nEnd:t.subTemplateIndex===null&&(e=0),t=null;break;case w.Template:e=xT(n.job.views.get(r.xref),t,r.i18nPlaceholder,e);break;case w.RepeaterCreate:let s=n.job.views.get(r.xref);e=xT(s,t,r.i18nPlaceholder,e),r.emptyView!==null&&(e=xT(n.job.views.get(r.emptyView),t,r.emptyI18nPlaceholder,e));break}return e}function xT(n,e,t,r){if(t!==void 0){if(e===null)throw Error("Expected template with i18n placeholder to be in an i18n block.");r++,rY(n,e)}return aL(n,r)}function rY(n,e){if(n.create.head.next?.kind!==w.I18nStart){let t=n.job.allocateXrefId();ge.insertAfter(Uw(t,e.message,e.root,null),n.create.head),ge.insertBefore(qw(t,null),n.create.tail)}}function sY(n){for(let e of n.units)for(let t of e.ops())es(t,r=>{if(!(r instanceof Wc)||r.body===null)return;let s=new BD(r.args.length);r.fn=n.pool.getSharedConstant(s,r.body),r.body=null})}var BD=class extends Ep{constructor(t){super();l(this,"numArgs");this.numArgs=t}keyOf(t){return t instanceof Bp?`param(${t.index})`:super.keyOf(t)}toSharedConstantDeclaration(t,r){let s=[];for(let o=0;oo instanceof Bp?kt("a"+o.index):o,Qt.None);return new Jr(t,new Lc(s,i),void 0,_r.Final)}};function iY(n){for(let e of n.units)for(let t of e.update)ur(t,(r,s)=>s&Qt.InChildOperation?r:r instanceof Hi?oY(r):r instanceof ko?aY(r):r,Qt.None)}function oY(n){let e=[],t=[];for(let r of n.entries)if(r.isConstant())e.push(r);else{let s=t.length;t.push(r),e.push(new Bp(s))}return new Wc(tn(e),t)}function aY(n){let e=[],t=[];for(let r of n.entries)if(r.value.isConstant())e.push(r);else{let s=t.length;t.push(r.value),e.push(new kp(r.key,new Bp(s),r.quoted))}return new Wc(cs(e),t)}function lY(n,e,t,r,s){return Gw(v.element,n,e,t,r,s)}function cY(n,e,t,r,s){return Gw(v.elementStart,n,e,t,r,s)}function Gw(n,e,t,r,s,i){let o=[Y(e)];return t!==null&&o.push(Y(t)),s!==null?o.push(Y(r),Y(s)):r!==null&&o.push(Y(r)),Lt(n,o,i)}function uY(n){return Lt(v.elementEnd,[],n)}function dY(n,e,t,r){return Gw(v.elementContainerStart,n,null,e,t,r)}function pY(n,e,t,r){return Gw(v.elementContainer,n,null,e,t,r)}function fY(){return Lt(v.elementContainerEnd,[],null)}function hY(n,e,t,r,s,i,o,a){let c=[Y(n),e,Y(t),Y(r),Y(s),Y(i)];for(o!==null&&(c.push(Y(o)),c.push(Ze(v.templateRefExtractor)));c[c.length-1].isEquivalent(Rg);)c.pop();return Lt(v.templateCreate,c,a)}function mY(){return Lt(v.disableBindings,[],null)}function gY(){return Lt(v.enableBindings,[],null)}function vY(n,e,t,r,s){let i=[Y(n),e];return t!==null&&(i.push(Y(!1)),i.push(Ze(t))),Lt(r?v.syntheticHostListener:v.listener,i,s)}function MR(n,e){return Ze(v.twoWayBindingSet).callFn([n,e])}function yY(n,e,t){return Lt(v.twoWayListener,[Y(n),e],t)}function bY(n,e){return Lt(v.pipe,[Y(n),Y(e)],null)}function wY(){return Lt(v.namespaceHTML,[],null)}function EY(){return Lt(v.namespaceSVG,[],null)}function xY(){return Lt(v.namespaceMathML,[],null)}function SY(n,e){return Lt(v.advance,n>1?[Y(n)]:[],e)}function CY(n){return Ze(v.reference).callFn([Y(n)])}function TY(n){return Ze(v.nextContext).callFn(n===1?[]:[Y(n)])}function DY(){return Ze(v.getCurrentView).callFn([])}function IY(n){return Ze(v.restoreView).callFn([n])}function _Y(n){return Ze(v.resetView).callFn([n])}function kY(n,e,t){let r=[Y(n,null)];return e!==""&&r.push(Y(e)),Lt(v.text,r,t)}function AY(n,e,t,r,s,i,o,a,c,u,d){let p=[Y(n),Y(e),t??Y(null),Y(r),Y(s),Y(i),o??Y(null),a??Y(null),c?Ze(v.deferEnableTimerScheduling):Y(null),Y(d)],f;for(;(f=p[p.length-1])!==null&&f instanceof Hr&&f.value===null;)p.pop();return Lt(v.defer,p,u)}var MY=new Map([[un.Idle,{none:v.deferOnIdle,prefetch:v.deferPrefetchOnIdle,hydrate:v.deferHydrateOnIdle}],[un.Immediate,{none:v.deferOnImmediate,prefetch:v.deferPrefetchOnImmediate,hydrate:v.deferHydrateOnImmediate}],[un.Timer,{none:v.deferOnTimer,prefetch:v.deferPrefetchOnTimer,hydrate:v.deferHydrateOnTimer}],[un.Hover,{none:v.deferOnHover,prefetch:v.deferPrefetchOnHover,hydrate:v.deferHydrateOnHover}],[un.Interaction,{none:v.deferOnInteraction,prefetch:v.deferPrefetchOnInteraction,hydrate:v.deferHydrateOnInteraction}],[un.Viewport,{none:v.deferOnViewport,prefetch:v.deferPrefetchOnViewport,hydrate:v.deferHydrateOnViewport}],[un.Never,{none:v.deferHydrateNever,prefetch:v.deferHydrateNever,hydrate:v.deferHydrateNever}]]);function NY(n,e,t,r){let s=MY.get(n)?.[t];if(s===void 0)throw new Error(`Unable to determine instruction for trigger ${n}`);return Lt(s,e.map(i=>Y(i)),r)}function PY(n){return Lt(v.projectionDef,n?[n]:[],null)}function RY(n,e,t,r,s,i,o){let a=[Y(n)];return(e!==0||t!==null||r!==null)&&(a.push(Y(e)),t!==null&&a.push(t),r!==null&&(t===null&&a.push(Y(null)),a.push(kt(r),Y(s),Y(i)))),Lt(v.projection,a,o)}function FY(n,e,t,r){let s=[Y(n),Y(e)];return t!==null&&s.push(Y(t)),Lt(v.i18nStart,s,r)}function LY(n,e,t,r,s,i,o,a,c,u,d,p,f,h){let m=[Y(n),kt(e),Y(t),Y(r),Y(s),Y(i),o];return(a||c!==null)&&(m.push(Y(a)),c!==null&&(m.push(kt(c),Y(u),Y(d)),(p!==null||f!==null)&&m.push(Y(p)),f!==null&&m.push(Y(f)))),Lt(v.repeaterCreate,m,h)}function OY(n,e){return Lt(v.repeater,[n],e)}function BY(n,e,t){return n==="prefetch"?Lt(v.deferPrefetchWhen,[e],t):n==="hydrate"?Lt(v.deferHydrateWhen,[e],t):Lt(v.deferWhen,[e],t)}function VY(n,e){return Lt(v.declareLet,[Y(n)],e)}function $Y(n,e){return Ze(v.storeLet).callFn([n],e)}function HY(n){return Ze(v.readContextLet).callFn([Y(n)])}function jY(n,e,t,r){let s=[Y(n),Y(e)];return t&&s.push(Y(t)),Lt(v.i18n,s,r)}function UY(n){return Lt(v.i18nEnd,[],n)}function qY(n,e){let t=[Y(n),Y(e)];return Lt(v.i18nAttributes,t,null)}function WY(n,e,t,r){let s=[Y(n),e];return t!==null&&s.push(t),Lt(v.property,s,r)}function zY(n,e,t,r){let s=[Y(n),e];return t!==null&&s.push(t),Lt(v.twoWayProperty,s,r)}function GY(n,e,t,r){let s=[Y(n),e];return(t!==null||r!==null)&&s.push(t??Y(null)),r!==null&&s.push(Y(r)),Lt(v.attribute,s,null)}function ZY(n,e,t,r){let s=[Y(n),e];return t!==null&&s.push(Y(t)),Lt(v.styleProp,s,r)}function YY(n,e,t){return Lt(v.classProp,[Y(n),e],t)}function XY(n,e){return Lt(v.styleMap,[n],e)}function QY(n,e){return Lt(v.classMap,[n],e)}var NR=[v.pipeBind1,v.pipeBind2,v.pipeBind3,v.pipeBind4];function KY(n,e,t){if(t.length<1||t.length>NR.length)throw new Error("pipeBind() argument count out of bounds");let r=NR[t.length-1];return Ze(r).callFn([Y(n),Y(e),...t])}function JY(n,e,t){return Ze(v.pipeBindV).callFn([Y(n),Y(e),t])}function eX(n,e,t){let r=Yp(n,e);return Xp(fX,[],r,[],t)}function tX(n,e){return Lt(v.i18nExp,[n],e)}function nX(n,e){return Lt(v.i18nApply,[Y(n)],e)}function rX(n,e,t,r,s){let i=Yp(e,t),o=[];return r!==null&&o.push(r),Xp(hX,[Y(n)],i,o,s)}function sX(n,e,t,r,s){let i=Yp(e,t),o=[];return r!==null&&o.push(r),Xp(gX,[Y(n)],i,o,s)}function iX(n,e,t,r,s){let i=Yp(e,t),o=[];return r!==null&&o.push(Y(r)),Xp(mX,[Y(n)],i,o,s)}function oX(n,e,t){let r=Yp(n,e);return Xp(vX,[],r,[],t)}function aX(n,e,t){let r=Yp(n,e);return Xp(yX,[],r,[],t)}function lX(n,e,t,r){let s=[Y(n),e];return t!==null&&s.push(t),Lt(v.hostProperty,s,r)}function cX(n,e,t){return Lt(v.syntheticHostProperty,[Y(n),e],t)}function uX(n,e,t){return lL(bX,[Y(n),e],t,[],null)}function dX(n,e){return Lt(v.attachSourceLocations,[Y(n),e],null)}function Yp(n,e){if(n.length<1||e.length!==n.length-1)throw new Error("AssertionError: expected specific shape of args for strings/expressions in interpolation");let t=[];if(e.length===1&&n[0]===""&&n[1]==="")t.push(e[0]);else{let r;for(r=0;r{if(n%2===0)throw new Error("Expected odd number of arguments");return(n-1)/2}},hX={constant:[v.propertyInterpolate,v.propertyInterpolate1,v.propertyInterpolate2,v.propertyInterpolate3,v.propertyInterpolate4,v.propertyInterpolate5,v.propertyInterpolate6,v.propertyInterpolate7,v.propertyInterpolate8],variable:v.propertyInterpolateV,mapping:n=>{if(n%2===0)throw new Error("Expected odd number of arguments");return(n-1)/2}},mX={constant:[v.styleProp,v.stylePropInterpolate1,v.stylePropInterpolate2,v.stylePropInterpolate3,v.stylePropInterpolate4,v.stylePropInterpolate5,v.stylePropInterpolate6,v.stylePropInterpolate7,v.stylePropInterpolate8],variable:v.stylePropInterpolateV,mapping:n=>{if(n%2===0)throw new Error("Expected odd number of arguments");return(n-1)/2}},gX={constant:[v.attribute,v.attributeInterpolate1,v.attributeInterpolate2,v.attributeInterpolate3,v.attributeInterpolate4,v.attributeInterpolate5,v.attributeInterpolate6,v.attributeInterpolate7,v.attributeInterpolate8],variable:v.attributeInterpolateV,mapping:n=>{if(n%2===0)throw new Error("Expected odd number of arguments");return(n-1)/2}},vX={constant:[v.styleMap,v.styleMapInterpolate1,v.styleMapInterpolate2,v.styleMapInterpolate3,v.styleMapInterpolate4,v.styleMapInterpolate5,v.styleMapInterpolate6,v.styleMapInterpolate7,v.styleMapInterpolate8],variable:v.styleMapInterpolateV,mapping:n=>{if(n%2===0)throw new Error("Expected odd number of arguments");return(n-1)/2}},yX={constant:[v.classMap,v.classMapInterpolate1,v.classMapInterpolate2,v.classMapInterpolate3,v.classMapInterpolate4,v.classMapInterpolate5,v.classMapInterpolate6,v.classMapInterpolate7,v.classMapInterpolate8],variable:v.classMapInterpolateV,mapping:n=>{if(n%2===0)throw new Error("Expected odd number of arguments");return(n-1)/2}},bX={constant:[v.pureFunction0,v.pureFunction1,v.pureFunction2,v.pureFunction3,v.pureFunction4,v.pureFunction5,v.pureFunction6,v.pureFunction7,v.pureFunction8],variable:v.pureFunctionV,mapping:n=>n};function lL(n,e,t,r,s){let i=n.mapping(t.length);if(i{if(y.slot===null)throw new Error("No slot was assigned for source location");return tn([Y(y.slot),Y(b),Y(E),Y(_)])}));ge.replace(t,dX(t.templatePath,g));break;case w.Statement:break;default:throw new Error(`AssertionError: Unsupported reification of create op ${w[t.kind]}`)}}function wI(n,e){for(let t of e)switch(ur(t,cL,Qt.None),t.kind){case w.Advance:ge.replace(t,SY(t.delta,t.sourceSpan));break;case w.Property:t.expression instanceof nr?ge.replace(t,rX(t.name,t.expression.strings,t.expression.expressions,t.sanitizer,t.sourceSpan)):ge.replace(t,WY(t.name,t.expression,t.sanitizer,t.sourceSpan));break;case w.TwoWayProperty:ge.replace(t,zY(t.name,t.expression,t.sanitizer,t.sourceSpan));break;case w.StyleProp:t.expression instanceof nr?ge.replace(t,iX(t.name,t.expression.strings,t.expression.expressions,t.unit,t.sourceSpan)):ge.replace(t,ZY(t.name,t.expression,t.unit,t.sourceSpan));break;case w.ClassProp:ge.replace(t,YY(t.name,t.expression,t.sourceSpan));break;case w.StyleMap:t.expression instanceof nr?ge.replace(t,oX(t.expression.strings,t.expression.expressions,t.sourceSpan)):ge.replace(t,XY(t.expression,t.sourceSpan));break;case w.ClassMap:t.expression instanceof nr?ge.replace(t,aX(t.expression.strings,t.expression.expressions,t.sourceSpan)):ge.replace(t,QY(t.expression,t.sourceSpan));break;case w.I18nExpression:ge.replace(t,tX(t.expression,t.sourceSpan));break;case w.I18nApply:ge.replace(t,nX(t.handle.slot,t.sourceSpan));break;case w.InterpolateText:ge.replace(t,eX(t.interpolation.strings,t.interpolation.expressions,t.sourceSpan));break;case w.Attribute:t.expression instanceof nr?ge.replace(t,sX(t.name,t.expression.strings,t.expression.expressions,t.sanitizer,t.sourceSpan)):ge.replace(t,GY(t.name,t.expression,t.sanitizer,t.namespace));break;case w.HostProperty:if(t.expression instanceof nr)throw new Error("not yet handled");t.isAnimationTrigger?ge.replace(t,cX(t.name,t.expression,t.sourceSpan)):ge.replace(t,lX(t.name,t.expression,t.sanitizer,t.sourceSpan));break;case w.Variable:if(t.variable.name===null)throw new Error(`AssertionError: unnamed variable ${t.xref}`);ge.replace(t,Ui(new Jr(t.variable.name,t.initializer,void 0,_r.Final)));break;case w.Conditional:if(t.processed===null)throw new Error("Conditional test was not set.");ge.replace(t,pX(t.processed,t.contextValue,t.sourceSpan));break;case w.Repeater:ge.replace(t,OY(t.collection,t.sourceSpan));break;case w.DeferWhen:ge.replace(t,BY(t.modifier,t.expr,t.sourceSpan));break;case w.StoreLet:throw new Error(`AssertionError: unexpected storeLet ${t.declaredName}`);case w.Statement:break;default:throw new Error(`AssertionError: Unsupported reification of update op ${w[t.kind]}`)}}function cL(n){if(!No(n))return n;switch(n.kind){case Ye.NextContext:return TY(n.steps);case Ye.Reference:return CY(n.targetSlot.slot+1+n.offset);case Ye.LexicalRead:throw new Error(`AssertionError: unresolved LexicalRead of ${n.name}`);case Ye.TwoWayBindingSet:throw new Error("AssertionError: unresolved TwoWayBindingSet");case Ye.RestoreView:if(typeof n.view=="number")throw new Error("AssertionError: unresolved RestoreView");return IY(n.view);case Ye.ResetView:return _Y(n.expr);case Ye.GetCurrentView:return DY();case Ye.ReadVariable:if(n.name===null)throw new Error(`Read of unnamed variable ${n.xref}`);return kt(n.name);case Ye.ReadTemporaryExpr:if(n.name===null)throw new Error(`Read of unnamed temporary ${n.xref}`);return kt(n.name);case Ye.AssignTemporaryExpr:if(n.name===null)throw new Error(`Assign of unnamed temporary ${n.xref}`);return kt(n.name).set(n.expr);case Ye.PureFunctionExpr:if(n.fn===null)throw new Error("AssertionError: expected PureFunctions to have been extracted");return uX(n.varOffset,n.fn,n.args);case Ye.PureFunctionParameterExpr:throw new Error("AssertionError: expected PureFunctionParameterExpr to have been extracted");case Ye.PipeBinding:return KY(n.targetSlot.slot,n.varOffset,n.args);case Ye.PipeBindingVariadic:return JY(n.targetSlot.slot,n.varOffset,n.args);case Ye.SlotLiteralExpr:return Y(n.slot.slot);case Ye.ContextLetReference:return HY(n.targetSlot.slot);case Ye.StoreLet:return $Y(n.value,n.sourceSpan);case Ye.TrackContext:return kt("this");default:throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${Ye[n.kind]}`)}}function PR(n,e,t,r){wI(n,t);let s=[];for(let o of t){if(o.kind!==w.Statement)throw new Error(`AssertionError: expected reified statements, but found op ${w[o.kind]}`);s.push(o.statement)}let i=[];return r&&i.push(new kr("$event")),xl(i,s,void 0,void 0,e)}function SX(n,e){if(e.trackByFn!==null)return e.trackByFn;let t=[new kr("$index"),new kr("$item")],r;if(e.trackByOps===null)r=e.usesComponentInstance?xl(t,[new Qr(e.track)]):ji(t,e.track);else{wI(n,e.trackByOps);let s=[];for(let i of e.trackByOps){if(i.kind!==w.Statement)throw new Error(`AssertionError: expected reified statements, but found op ${w[i.kind]}`);s.push(i.statement)}r=e.usesComponentInstance||s.length!==1||!(s[0]instanceof Qr)?xl(t,s):ji(t,s[0].value)}return e.trackByFn=n.job.pool.getSharedFunctionReference(r,"_forTrack"),e.trackByFn}function CX(n){for(let e of n.units)for(let t of e.update)switch(t.kind){case w.Attribute:case w.Binding:case w.ClassProp:case w.ClassMap:case w.Property:case w.StyleProp:case w.StyleMap:t.expression instanceof lv&&ge.remove(t);break}}function TX(n){for(let e of n.units)for(let t of e.create)switch(t.kind){case w.I18nContext:ge.remove(t);break;case w.I18nStart:t.context=null;break}}function DX(n){for(let e of n.units){let t=new Set;for(let r of e.update)switch(r.kind){case w.I18nExpression:t.add(r.i18nOwner)}for(let r of e.create)switch(r.kind){case w.I18nAttributes:if(t.has(r.xref))continue;ge.remove(r)}}}function IX(n){for(let e of n.units)Tw(e,e.create),Tw(e,e.update)}function Tw(n,e){let t=new Map;t.set(n.xref,kt("ctx"));for(let r of e)switch(r.kind){case w.Variable:switch(r.variable.kind){case yr.Context:t.set(r.variable.view,new wa(r.xref));break}break;case w.Listener:case w.TwoWayListener:Tw(n,r.handlerOps);break;case w.RepeaterCreate:r.trackByOps!==null&&Tw(n,r.trackByOps);break}n===n.job.root&&t.set(n.xref,kt("ctx"));for(let r of e)ur(r,s=>{if(s instanceof Sa){if(!t.has(s.view))throw new Error(`No context found for reference to view ${s.view} from view ${n.xref}`);return t.get(s.view)}else return s},Qt.None)}function _X(n){for(let e of n.units)RR(e.create),RR(e.update)}function RR(n){for(let e of n)(e.kind===w.Listener||e.kind===w.TwoWayListener)&&ur(e,t=>t instanceof Vr&&t.name==="$event"?(e.kind===w.Listener&&(e.consumesDollarEvent=!0),new yi(t.name)):t,Qt.InChildOperation)}function kX(n){let e=new Map,t=new Map;for(let r of n.units)for(let s of r.create)switch(s.kind){case w.I18nContext:e.set(s.xref,s);break;case w.ElementStart:t.set(s.xref,s);break}fl(n,n.root,e,t)}function fl(n,e,t,r,s){let i=null,o=new Map;for(let a of e.create)switch(a.kind){case w.I18nStart:if(!a.context)throw Error("Could not find i18n context for i18n op");i={i18nBlock:a,i18nContext:t.get(a.context)};break;case w.I18nEnd:i=null;break;case w.ElementStart:if(a.i18nPlaceholder!==void 0){if(i===null)throw Error("i18n tag placeholder should only occur inside an i18n block");FR(a,i.i18nContext,i.i18nBlock,s),s&&a.i18nPlaceholder.closeName&&o.set(a.xref,s),s=void 0}break;case w.ElementEnd:let c=r.get(a.xref);if(c&&c.i18nPlaceholder!==void 0){if(i===null)throw Error("AssertionError: i18n tag placeholder should only occur inside an i18n block");LR(c,i.i18nContext,i.i18nBlock,o.get(a.xref)),o.delete(a.xref)}break;case w.Projection:if(a.i18nPlaceholder!==void 0){if(i===null)throw Error("i18n tag placeholder should only occur inside an i18n block");FR(a,i.i18nContext,i.i18nBlock,s),LR(a,i.i18nContext,i.i18nBlock,s),s=void 0}break;case w.Template:let u=n.views.get(a.xref);if(a.i18nPlaceholder===void 0)fl(n,u,t,r);else{if(i===null)throw Error("i18n tag placeholder should only occur inside an i18n block");a.templateKind===Ss.Structural?fl(n,u,t,r,a):(ST(n,u,a.handle.slot,a.i18nPlaceholder,i.i18nContext,i.i18nBlock,s),fl(n,u,t,r),CT(n,u,a.handle.slot,a.i18nPlaceholder,i.i18nContext,i.i18nBlock,s),s=void 0)}break;case w.RepeaterCreate:if(s!==void 0)throw Error("AssertionError: Unexpected structural directive associated with @for block");let d=a.handle.slot+1,p=n.views.get(a.xref);if(a.i18nPlaceholder===void 0)fl(n,p,t,r);else{if(i===null)throw Error("i18n tag placeholder should only occur inside an i18n block");ST(n,p,d,a.i18nPlaceholder,i.i18nContext,i.i18nBlock,s),fl(n,p,t,r),CT(n,p,d,a.i18nPlaceholder,i.i18nContext,i.i18nBlock,s),s=void 0}if(a.emptyView!==null){let f=a.handle.slot+2,h=n.views.get(a.emptyView);if(a.emptyI18nPlaceholder===void 0)fl(n,h,t,r);else{if(i===null)throw Error("i18n tag placeholder should only occur inside an i18n block");ST(n,h,f,a.emptyI18nPlaceholder,i.i18nContext,i.i18nBlock,s),fl(n,h,t,r),CT(n,h,f,a.emptyI18nPlaceholder,i.i18nContext,i.i18nBlock,s),s=void 0}}break}}function FR(n,e,t,r){let{startName:s,closeName:i}=n.i18nPlaceholder,o=hn.ElementTag|hn.OpenTag,a=n.handle.slot;r!==void 0&&(o|=hn.TemplateTag,a={element:a,template:r.handle.slot}),i||(o|=hn.CloseTag),Wp(e.params,s,a,t.subTemplateIndex,o)}function LR(n,e,t,r){let{closeName:s}=n.i18nPlaceholder;if(s){let i=hn.ElementTag|hn.CloseTag,o=n.handle.slot;r!==void 0&&(i|=hn.TemplateTag,o={element:o,template:r.handle.slot}),Wp(e.params,s,o,t.subTemplateIndex,i)}}function ST(n,e,t,r,s,i,o){let{startName:a,closeName:c}=r,u=hn.TemplateTag|hn.OpenTag;c||(u|=hn.CloseTag),o!==void 0&&Wp(s.params,a,o.handle.slot,i.subTemplateIndex,u),Wp(s.params,a,t,uL(n,i,e),u)}function CT(n,e,t,r,s,i,o){let{closeName:a}=r,c=hn.TemplateTag|hn.CloseTag;a&&(Wp(s.params,a,t,uL(n,i,e),c),o!==void 0&&Wp(s.params,a,o.handle.slot,i.subTemplateIndex,c))}function uL(n,e,t){for(let r of t.create)if(r.kind===w.I18nStart)return r.subTemplateIndex;return e.subTemplateIndex}function Wp(n,e,t,r,s){let i=n.get(e)??[];i.push({value:t,subTemplateIndex:r,flags:s}),n.set(e,i)}function AX(n){let e=new Map,t=new Map,r=new Map;for(let o of n.units)for(let a of o.create)switch(a.kind){case w.I18nStart:e.set(a.xref,a.subTemplateIndex);break;case w.I18nContext:t.set(a.xref,a);break;case w.IcuPlaceholder:r.set(a.xref,a);break}let s=new Map,i=o=>o.usage===Uc.I18nText?o.i18nOwner:o.context;for(let o of n.units)for(let a of o.update)if(a.kind===w.I18nExpression){let c=s.get(i(a))||0,u=e.get(a.i18nOwner)??null,d={value:c,subTemplateIndex:u,flags:hn.ExpressionIndex};MX(a,d,t,r),s.set(i(a),c+1)}}function MX(n,e,t,r){if(n.i18nPlaceholder!==null){let s=t.get(n.context),i=n.resolutionTime===Op.Creation?s.params:s.postprocessingParams,o=i.get(n.i18nPlaceholder)||[];o.push(e),i.set(n.i18nPlaceholder,o)}n.icuPlaceholder!==null&&r.get(n.icuPlaceholder)?.expressionPlaceholders.push(e)}function NX(n){let e=new Map;for(let t of n.units)for(let r of t.ops())if(r.kind===w.ElementStart||r.kind===w.Template){let s=r.tag??"";switch(r.namespace){case rr.SVG:s=`:${Ww}:${s}`;break;case rr.Math:s=`:${zw}:${s}`;break}e.set(r.xref,s)}for(let t of n.units)for(let r of t.create)if(r.kind===w.ExtractedAttribute&&r.i18nContext!==null&&r.expression!==null){let s=e.get(r.target)??"",i=r.expression;switch(r.securityContext){case Vt.HTML:i=Ze(v.sanitizeHtml).callFn([i]);break;case Vt.STYLE:i=Ze(v.sanitizeStyle).callFn([i]);break;case Vt.SCRIPT:i=Ze(v.sanitizeScript).callFn([i]);break;case Vt.URL:i=Ze(v.sanitizeUrl).callFn([i]);break;case Vt.RESOURCE_URL:i=Ze(v.sanitizeResourceUrl).callFn([i]);break;case Vt.ATTRIBUTE_NO_BINDING:i=Ze(v.validateAttribute).callFn([i,Y(s),Y(r.name)]);break}r.expression=i}}function PX(n){for(let e of n.units)Dw(e,e.create,null),Dw(e,e.update,null)}function Dw(n,e,t){let r=new Map,s=new Map;for(let i of e)switch(i.kind){case w.Variable:switch(i.variable.kind){case yr.Identifier:if(i.variable.local){if(s.has(i.variable.identifier))continue;s.set(i.variable.identifier,i.xref)}else if(r.has(i.variable.identifier))continue;r.set(i.variable.identifier,i.xref);break;case yr.Alias:if(r.has(i.variable.identifier))continue;r.set(i.variable.identifier,i.xref);break;case yr.SavedView:t={view:i.variable.view,variable:i.xref};break}break;case w.Listener:case w.TwoWayListener:Dw(n,i.handlerOps,t);break;case w.RepeaterCreate:i.trackByOps!==null&&Dw(n,i.trackByOps,t);break}for(let i of e)i.kind==w.Listener||i.kind===w.TwoWayListener||ur(i,o=>{if(o instanceof Vr)return s.has(o.name)?new wa(s.get(o.name)):r.has(o.name)?new wa(r.get(o.name)):new zs(new Sa(n.job.root.xref),o.name);if(o instanceof ow&&typeof o.view=="number"){if(t===null||t.view!==o.view)throw new Error(`AssertionError: no saved view ${o.view} from view ${n.xref}`);return o.view=new wa(t.variable),o}else return o},Qt.None);for(let i of e)es(i,o=>{if(o instanceof Vr)throw new Error(`AssertionError: no lexical reads should remain, but found read of ${o.name}`)})}var RX=new Map([[Vt.HTML,v.sanitizeHtml],[Vt.RESOURCE_URL,v.sanitizeResourceUrl],[Vt.SCRIPT,v.sanitizeScript],[Vt.STYLE,v.sanitizeStyle],[Vt.URL,v.sanitizeUrl],[Vt.ATTRIBUTE_NO_BINDING,v.validateAttribute]]),FX=new Map([[Vt.HTML,v.trustConstantHtml],[Vt.RESOURCE_URL,v.trustConstantResourceUrl]]);function LX(n){for(let e of n.units){if(n.kind!==Fe.Host){for(let t of e.create)if(t.kind===w.ExtractedAttribute){let r=FX.get(OR(t.securityContext))??null;t.trustedValueFn=r!==null?Ze(r):null}}for(let t of e.update)switch(t.kind){case w.Property:case w.Attribute:case w.HostProperty:let r=null;Array.isArray(t.securityContext)&&t.securityContext.length===2&&t.securityContext.includes(Vt.URL)&&t.securityContext.includes(Vt.RESOURCE_URL)?r=v.sanitizeUrlOrResourceUrl:r=RX.get(OR(t.securityContext))??null,t.sanitizer=r!==null?Ze(r):null;break}}}function OR(n){if(Array.isArray(n)){if(n.length>1)throw Error("AssertionError: Ambiguous security context");return n[0]||Vt.NONE}return n}function OX(n){for(let e of n.units)for(let t of e.create)t.kind===w.TwoWayListener&&ur(t,r=>{if(!(r instanceof aw))return r;let{target:s,value:i}=r;if(s instanceof zs||s instanceof xa)return MR(s,i).or(s.set(i));if(s instanceof wa)return MR(s,i);throw new Error("Unsupported expression in two-way action binding.")},Qt.InChildOperation)}function BX(n){for(let e of n.units){e.create.prepend([yl(e.job.allocateXrefId(),{kind:yr.SavedView,name:null,view:e.xref},new mD,Hs.None)]);for(let t of e.create){if(t.kind!==w.Listener&&t.kind!==w.TwoWayListener)continue;let r=e!==n.root;if(!r)for(let s of t.handlerOps)es(s,i=>{(i instanceof sw||i instanceof av)&&(r=!0)});r&&VX(e,t)}}}function VX(n,e){e.handlerOps.prepend([yl(n.job.allocateXrefId(),{kind:yr.Context,name:null,view:n.xref},new ow(n.xref),Hs.None)]);for(let t of e.handlerOps)t.kind===w.Statement&&t.statement instanceof Qr&&(t.statement.value=new gD(t.statement.value))}function $X(n){let e=new Map;for(let t of n.units){let r=0;for(let s of t.create)Zp(s)&&(s.handle.slot=r,e.set(s.xref,s.handle.slot),r+=s.numSlotsUsed);t.decls=r}for(let t of n.units)for(let r of t.ops())if(r.kind===w.Template||r.kind===w.RepeaterCreate){let s=n.views.get(r.xref);r.decls=s.decls}}function HX(n){for(let e of n.units)for(let t of e.update)if(t.kind===w.Binding)switch(t.bindingKind){case Qe.ClassName:if(t.expression instanceof nr)throw new Error("Unexpected interpolation in ClassName binding");ge.replace(t,Fz(t.target,t.name,t.expression,t.sourceSpan));break;case Qe.StyleProperty:ge.replace(t,Rz(t.target,t.name,t.expression,t.unit,t.sourceSpan));break;case Qe.Property:case Qe.Template:t.name==="style"?ge.replace(t,Lz(t.target,t.expression,t.sourceSpan)):t.name==="class"&&ge.replace(t,Oz(t.target,t.expression,t.sourceSpan));break}}function jX(n){for(let e of n.units)e.create.prepend(Iw(e.create)),e.update.prepend(Iw(e.update))}function Iw(n){let e=0,t=[];for(let r of n){let s=new Map;es(r,(u,d)=>{d&Qt.InChildOperation||u instanceof Ca&&s.set(u.xref,u)});let i=0,o=new Set,a=new Set,c=new Map;es(r,(u,d)=>{d&Qt.InChildOperation||(u instanceof qi?(o.has(u.xref)||(o.add(u.xref),c.set(u.xref,`tmp_${e}_${i++}`)),BR(c,u)):u instanceof Ca&&(s.get(u.xref)===u&&(a.add(u.xref),i--),BR(c,u)))}),t.push(...Array.from(new Set(c.values())).map(u=>Ui(new Jr(u)))),e++,r.kind===w.Listener||r.kind===w.TwoWayListener?r.handlerOps.prepend(Iw(r.handlerOps)):r.kind===w.RepeaterCreate&&r.trackByOps!==null&&r.trackByOps.prepend(Iw(r.trackByOps))}return t}function BR(n,e){let t=n.get(e.xref);if(t===void 0)throw new Error(`Found xref with unassigned name: ${e.xref}`);e.name=t}function UX(n){for(let e of n.units)for(let t of e.create)if(t.kind===w.RepeaterCreate)if(t.track instanceof yi&&t.track.name==="$index")t.trackByFn=Ze(v.repeaterTrackByIndex);else if(t.track instanceof yi&&t.track.name==="$item")t.trackByFn=Ze(v.repeaterTrackByIdentity);else if(qX(n.root.xref,t.track))t.usesComponentInstance=!0,t.track.receiver.receiver.view===e.xref?t.trackByFn=t.track.receiver:(t.trackByFn=Ze(v.componentInstance).callFn([]).prop(t.track.receiver.name),t.track=t.trackByFn);else{t.track=Be(t.track,s=>{if(s instanceof Vp||s instanceof lw)throw new Error("Illegal State: Pipes are not allowed in this context");return s instanceof Sa?(t.usesComponentInstance=!0,new hD(s.view)):s},Qt.None);let r=new ge;r.push(Ui(new Qr(t.track,t.track.sourceSpan))),t.trackByOps=r}}function qX(n,e){if(!(e instanceof Cs)||e.args.length===0||e.args.length>2||!(e.receiver instanceof zs&&e.receiver.receiver instanceof Sa)||e.receiver.receiver.view!==n)return!1;let[t,r]=e.args;return!(t instanceof yi)||t.name!=="$index"?!1:e.args.length===1?!0:!(!(r instanceof yi)||r.name!=="$item")}function WX(n){for(let e of n.units)for(let t of e.create)t.kind===w.RepeaterCreate&&(t.track=Be(t.track,r=>{if(r instanceof Vr){if(t.varNames.$index.has(r.name))return kt("$index");if(r.name===t.varNames.$implicit)return kt("$item")}return r},Qt.None))}function zX(n){for(let e of n.units){let t=0;for(let r of e.ops())vT(r)&&(t+=GX(r));for(let r of e.ops())es(r,s=>{No(s)&&(n.compatibility===Ts.TemplateDefinitionBuilder&&s instanceof Wc||(rR(s)&&(s.varOffset=t),vT(s)&&(t+=VR(s))))});if(n.compatibility===Ts.TemplateDefinitionBuilder)for(let r of e.ops())es(r,s=>{!No(s)||!(s instanceof Wc)||(rR(s)&&(s.varOffset=t),vT(s)&&(t+=VR(s)))});e.vars=t}if(n instanceof uv)for(let e of n.units)for(let t of e.create){if(t.kind!==w.Template&&t.kind!==w.RepeaterCreate)continue;let r=n.views.get(t.xref);t.vars=r.vars}}function GX(n){let e;switch(n.kind){case w.Property:case w.HostProperty:case w.Attribute:return e=1,n.expression instanceof nr&&!ZX(n.expression)&&(e+=n.expression.expressions.length),e;case w.TwoWayProperty:return 1;case w.StyleProp:case w.ClassProp:case w.StyleMap:case w.ClassMap:return e=2,n.expression instanceof nr&&(e+=n.expression.expressions.length),e;case w.InterpolateText:return n.interpolation.expressions.length;case w.I18nExpression:case w.Conditional:case w.DeferWhen:case w.StoreLet:return 1;case w.RepeaterCreate:return n.emptyView?1:0;default:throw new Error(`Unhandled op: ${w[n.kind]}`)}}function VR(n){switch(n.kind){case Ye.PureFunctionExpr:return 1+n.args.length;case Ye.PipeBinding:return 1+n.args.length;case Ye.PipeBindingVariadic:return 1+n.numArgs;case Ye.StoreLet:return 1;default:throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${n.constructor.name}`)}}function ZX(n){return!(n.expressions.length!==1||n.strings.length!==2||n.strings[0]!==""||n.strings[1]!=="")}function YX(n){for(let e of n.units){l0(e.create),l0(e.update);for(let t of e.create)t.kind===w.Listener||t.kind===w.TwoWayListener?l0(t.handlerOps):t.kind===w.RepeaterCreate&&t.trackByOps!==null&&l0(t.trackByOps);c0(e.create,n.compatibility),c0(e.update,n.compatibility);for(let t of e.create)t.kind===w.Listener||t.kind===w.TwoWayListener?c0(t.handlerOps,n.compatibility):t.kind===w.RepeaterCreate&&t.trackByOps!==null&&c0(t.trackByOps,n.compatibility)}}var cr;(function(n){n[n.None=0]="None",n[n.ViewContextRead=1]="ViewContextRead",n[n.ViewContextWrite=2]="ViewContextWrite",n[n.SideEffectful=4]="SideEffectful"})(cr||(cr={}));function l0(n){let e=new Map;for(let t of n)t.kind===w.Variable&&t.flags&Hs.AlwaysInline&&(es(t,r=>{if(No(r)&&EI(r)!==cr.None)throw new Error("AssertionError: A context-sensitive variable was marked AlwaysInline")}),e.set(t.xref,t)),ur(t,r=>r instanceof wa&&e.has(r.xref)?e.get(r.xref).initializer.clone():r,Qt.None);for(let t of e.values())ge.remove(t)}function c0(n,e){let t=new Map,r=new Map,s=new Set,i=new Map;for(let u of n){if(u.kind===w.Variable){if(t.has(u.xref)||r.has(u.xref))throw new Error(`Should not see two declarations of the same variable: ${u.xref}`);t.set(u.xref,u),r.set(u.xref,0)}i.set(u,XX(u)),QX(u,r,s)}let o=!1;for(let u of n.reversed()){let d=i.get(u);if(u.kind===w.Variable&&r.get(u.xref)===0){if(o&&d.fences&cr.ViewContextWrite||d.fences&cr.SideEffectful){let p=Ui(u.initializer.toStmt());i.set(p,d),ge.replace(u,p)}else KX(u,r),ge.remove(u);i.delete(u),t.delete(u.xref),r.delete(u.xref);continue}d.fences&cr.ViewContextRead&&(o=!0)}let a=[];for(let[u,d]of r){let f=!!(t.get(u).flags&Hs.AlwaysInline);d!==1||f||s.has(u)||a.push(u)}let c;for(;c=a.pop();){let u=t.get(c),d=i.get(u);if(!!(u.flags&Hs.AlwaysInline))throw new Error("AssertionError: Found an 'AlwaysInline' variable after the always inlining pass.");for(let f=u.next;f.kind!==w.ListEnd;f=f.next){let h=i.get(f);if(h.variablesUsed.has(c)){if(e===Ts.TemplateDefinitionBuilder&&!eQ(u,f))break;if(JX(c,u.initializer,f,d.fences)){h.variablesUsed.delete(c);for(let m of d.variablesUsed)h.variablesUsed.add(m);h.fences|=d.fences,t.delete(c),r.delete(c),i.delete(u),ge.remove(u)}break}if(!dL(h.fences,d.fences))break}}}function EI(n){switch(n.kind){case Ye.NextContext:return cr.ViewContextRead|cr.ViewContextWrite;case Ye.RestoreView:return cr.ViewContextRead|cr.ViewContextWrite|cr.SideEffectful;case Ye.StoreLet:return cr.SideEffectful;case Ye.Reference:case Ye.ContextLetReference:return cr.ViewContextRead;default:return cr.None}}function XX(n){let e=cr.None,t=new Set;return es(n,r=>{if(No(r))switch(r.kind){case Ye.ReadVariable:t.add(r.xref);break;default:e|=EI(r)}}),{fences:e,variablesUsed:t}}function QX(n,e,t){es(n,(r,s)=>{if(!No(r)||r.kind!==Ye.ReadVariable)return;let i=e.get(r.xref);i!==void 0&&(e.set(r.xref,i+1),s&Qt.InChildOperation&&t.add(r.xref))})}function KX(n,e){es(n,t=>{if(!No(t)||t.kind!==Ye.ReadVariable)return;let r=e.get(t.xref);if(r!==void 0){if(r===0)throw new Error(`Inaccurate variable count: ${t.xref} - found another read but count is already 0`);e.set(t.xref,r-1)}})}function dL(n,e){if(n&cr.ViewContextWrite){if(e&cr.ViewContextRead)return!1}else if(n&cr.ViewContextRead&&e&cr.ViewContextWrite)return!1;return!0}function JX(n,e,t,r){let s=!1,i=!0;return ur(t,(o,a)=>{if(!No(o)||s||!i)return o;if(a&Qt.InChildOperation&&r&cr.ViewContextRead)return o;switch(o.kind){case Ye.ReadVariable:if(o.xref===n)return s=!0,e;break;default:let c=EI(o);i=i&&dL(c,r);break}return o},Qt.None),s}function eQ(n,e){switch(n.variable.kind){case yr.Identifier:return n.initializer instanceof yi&&n.initializer.name==="ctx";case yr.Context:return e.kind===w.Variable;default:return!0}}function tQ(n){for(let e of n.units){let t=null,r=null;for(let s of e.create)switch(s.kind){case w.I18nStart:t=s;break;case w.I18nEnd:t=null;break;case w.IcuStart:t===null&&(r=n.allocateXrefId(),ge.insertBefore(Uw(r,s.message,void 0,null),s));break;case w.IcuEnd:r!==null&&(ge.insertAfter(qw(r,null),s),r=null);break}}}function nQ(n){let e=new Set;for(let t of n.units)for(let r of t.ops())es(r,s=>{s instanceof av&&e.add(s.target)});for(let t of n.units)for(let r of t.update)ur(r,s=>s instanceof ov&&!e.has(s.target)?s.value:s,Qt.None)}function rQ(n){for(let e of n.units)for(let t of e.update){if(t.kind!==w.Variable||t.variable.kind!==yr.Identifier||!(t.initializer instanceof ov))continue;let r=t.variable.identifier,s=t;for(;s&&s.kind!==w.ListEnd;)ur(s,i=>i instanceof Vr&&i.name===r?Y(void 0):i,Qt.None),s=s.prev}}function sQ(n){for(let e of n.units)for(let t of e.update){if(t.kind!==w.StoreLet)continue;let r={kind:yr.Identifier,name:null,identifier:t.declaredName,local:!0};ge.replace(t,yl(n.allocateXrefId(),r,new ov(t.target,t.value,t.sourceSpan),Hs.None))}}function iQ(n){if(!(!n.enableDebugLocations||n.relativeTemplatePath===null))for(let e of n.units){let t=[];for(let r of e.create)if(r.kind===w.ElementStart||r.kind===w.Element){let s=r.startSourceSpan.start;t.push({targetSlot:r.handle,offset:s.offset,line:s.line,column:s.col})}t.length>0&&e.create.push(iG(n.relativeTemplatePath,t))}}var oQ=[{kind:Fe.Tmpl,fn:YZ},{kind:Fe.Host,fn:a7},{kind:Fe.Tmpl,fn:MZ},{kind:Fe.Tmpl,fn:nY},{kind:Fe.Tmpl,fn:tQ},{kind:Fe.Both,fn:kG},{kind:Fe.Both,fn:HX},{kind:Fe.Both,fn:mG},{kind:Fe.Both,fn:pG},{kind:Fe.Tmpl,fn:_G},{kind:Fe.Both,fn:PZ},{kind:Fe.Tmpl,fn:CX},{kind:Fe.Both,fn:bG},{kind:Fe.Both,fn:ZZ},{kind:Fe.Tmpl,fn:wG},{kind:Fe.Tmpl,fn:KZ},{kind:Fe.Tmpl,fn:AG},{kind:Fe.Tmpl,fn:_Z},{kind:Fe.Tmpl,fn:DG},{kind:Fe.Tmpl,fn:DX},{kind:Fe.Tmpl,fn:dG},{kind:Fe.Tmpl,fn:cG},{kind:Fe.Tmpl,fn:tY},{kind:Fe.Both,fn:iY},{kind:Fe.Tmpl,fn:n7},{kind:Fe.Tmpl,fn:sQ},{kind:Fe.Tmpl,fn:r7},{kind:Fe.Tmpl,fn:BX},{kind:Fe.Both,fn:aG},{kind:Fe.Both,fn:_X},{kind:Fe.Tmpl,fn:WX},{kind:Fe.Tmpl,fn:rQ},{kind:Fe.Both,fn:PX},{kind:Fe.Tmpl,fn:MG},{kind:Fe.Tmpl,fn:OX},{kind:Fe.Tmpl,fn:UX},{kind:Fe.Both,fn:IX},{kind:Fe.Both,fn:LX},{kind:Fe.Tmpl,fn:kZ},{kind:Fe.Both,fn:jZ},{kind:Fe.Both,fn:LG},{kind:Fe.Both,fn:jX},{kind:Fe.Both,fn:YX},{kind:Fe.Both,fn:nQ},{kind:Fe.Tmpl,fn:$X},{kind:Fe.Tmpl,fn:kX},{kind:Fe.Tmpl,fn:AX},{kind:Fe.Tmpl,fn:QG},{kind:Fe.Tmpl,fn:SZ},{kind:Fe.Tmpl,fn:NX},{kind:Fe.Tmpl,fn:i7},{kind:Fe.Both,fn:CG},{kind:Fe.Tmpl,fn:TX},{kind:Fe.Both,fn:zX},{kind:Fe.Tmpl,fn:t7},{kind:Fe.Both,fn:RZ},{kind:Fe.Tmpl,fn:IG},{kind:Fe.Tmpl,fn:OZ},{kind:Fe.Tmpl,fn:VZ},{kind:Fe.Tmpl,fn:FG},{kind:Fe.Tmpl,fn:iQ},{kind:Fe.Tmpl,fn:HZ},{kind:Fe.Both,fn:sY},{kind:Fe.Both,fn:EX},{kind:Fe.Both,fn:yG}];function pL(n,e){for(let t of oQ)(t.kind===e||t.kind===Fe.Both)&&t.fn(n)}function aQ(n,e){let t=hL(n.root);return fL(n.root,e),t}function fL(n,e){for(let t of n.job.units){if(t.parent!==n.xref)continue;fL(t,e);let r=hL(t);e.statements.push(r.toDeclStmt(r.name))}}function hL(n){if(n.fnName===null)throw new Error(`AssertionError: view ${n.xref} is unnamed`);let e=[];for(let i of n.create){if(i.kind!==w.Statement)throw new Error(`AssertionError: expected all create ops to have been compiled, but got ${w[i.kind]}`);e.push(i.statement)}let t=[];for(let i of n.update){if(i.kind!==w.Statement)throw new Error(`AssertionError: expected all update ops to have been compiled, but got ${w[i.kind]}`);t.push(i.statement)}let r=_w(1,e),s=_w(2,t);return xl([new kr("rf"),new kr("ctx")],[...r,...s],void 0,void 0,n.fnName)}function _w(n,e){return e.length===0?[]:[Lw(new Xt(Ge.BitwiseAnd,kt("rf"),Y(n)),e)]}function lQ(n){if(n.root.fnName===null)throw new Error("AssertionError: host binding function is unnamed");let e=[];for(let i of n.root.create){if(i.kind!==w.Statement)throw new Error(`AssertionError: expected all create ops to have been compiled, but got ${w[i.kind]}`);e.push(i.statement)}let t=[];for(let i of n.root.update){if(i.kind!==w.Statement)throw new Error(`AssertionError: expected all update ops to have been compiled, but got ${w[i.kind]}`);t.push(i.statement)}if(e.length===0&&t.length===0)return null;let r=_w(1,e),s=_w(2,t);return xl([new kr("rf"),new kr("ctx")],[...r,...s],void 0,void 0,n.root.fnName)}var mL=Ts.TemplateDefinitionBuilder,Pc=new qp,Rc="ng-template";function VD(n){return n instanceof ls}function cQ(n){return VD(n)&&n.nodes.length===1&&n.nodes[0]instanceof Q0}function uQ(n,e,t,r,s,i,o,a,c){let u=new uv(n,t,mL,r,s,i,o,a,c);return Ta(u.root,e),u}function dQ(n,e,t){let r=new hw(n.componentName,t,mL);for(let s of n.properties??[]){let i=Qe.Property;s.name.startsWith("attr.")&&(s.name=s.name.substring(5),i=Qe.Attribute),s.isAnimation&&(i=Qe.Animation);let o=e.calcPossibleSecurityContexts(n.componentSelector,s.name,i===Qe.Attribute).filter(a=>a!==Vt.NONE);pQ(r,s,i,o)}for(let[s,i]of Object.entries(n.attributes)??[]){let o=e.calcPossibleSecurityContexts(n.componentSelector,s,!0).filter(a=>a!==Vt.NONE);fQ(r,s,i,o)}for(let s of n.events??[])hQ(r,s);return r}function pQ(n,e,t,r){let s,i=e.expression.ast;i instanceof wv?s=new nr(i.strings,i.expressions.map(o=>Et(o,n,e.sourceSpan)),[]):s=Et(i,n,e.sourceSpan),n.root.update.push(qc(n.root.xref,t,e.name,s,null,r,!1,!1,null,null,e.sourceSpan))}function fQ(n,e,t,r){let s=qc(n.root.xref,Qe.Attribute,e,t,null,r,!0,!1,null,null,t.sourceSpan);n.root.update.push(s)}function hQ(n,e){let[t,r]=e.type!==Us.Animation?[null,e.targetOrPhase]:[e.targetOrPhase,null],s=bI(n.root.xref,new Ds,e.name,null,xI(n.root,e.handler,e.handlerSpan),t,r,!0,e.sourceSpan);n.root.create.push(s)}function Ta(n,e){for(let t of e)if(t instanceof Ao)mQ(n,t);else if(t instanceof qs)gQ(n,t);else if(t instanceof Fp)vQ(n,t);else if(t instanceof Ic)gL(n,t,null);else if(t instanceof Np)vL(n,t,null);else if(t instanceof Y0)yQ(n,t);else if(t instanceof Z0)bQ(n,t);else if(t instanceof Hc)wQ(n,t);else if(t instanceof hF)xQ(n,t);else if(t instanceof Rp)SQ(n,t);else if(t instanceof lI)TQ(n,t);else throw new Error(`Unsupported template node: ${t.constructor.name}`)}function mQ(n,e){if(e.i18n!==void 0&&!(e.i18n instanceof ls||e.i18n instanceof Cl))throw Error(`Unhandled i18n metadata type for element: ${e.i18n.constructor.name}`);let t=n.job.allocateXrefId(),[r,s]=Kr(e.name),i=Wz(s,t,ZF(r),e.i18n instanceof Cl?e.i18n:void 0,e.startSourceSpan,e.sourceSpan);n.create.push(i),IQ(n,i,e),wL(i,e);let o=null;e.i18n instanceof ls&&(o=n.job.allocateXrefId(),n.create.push(Uw(o,e.i18n,void 0,e.startSourceSpan))),Ta(n,e.children);let a=Gz(t,e.endSourceSpan??e.startSourceSpan);n.create.push(a),o!==null&&ge.insertBefore(qw(o,e.endSourceSpan??e.startSourceSpan),a)}function gQ(n,e){if(e.i18n!==void 0&&!(e.i18n instanceof ls||e.i18n instanceof Cl))throw Error(`Unhandled i18n metadata type for template: ${e.i18n.constructor.name}`);let t=n.job.allocateView(n.xref),r=e.tagName,s="";e.tagName&&([s,r]=Kr(e.tagName));let i=e.i18n instanceof Cl?e.i18n:void 0,o=ZF(s),a=r===null?"":SG(r,o),c=DQ(e)?Ss.NgTemplate:Ss.Structural,u=jw(t.xref,c,r,a,o,i,e.startSourceSpan,e.sourceSpan);n.create.push(u),_Q(n,u,e,c),wL(u,e),Ta(t,e.children);for(let{name:d,value:p}of e.variables)t.contextVariables.set(d,p!==""?p:"$implicit");if(c===Ss.NgTemplate&&e.i18n instanceof ls){let d=n.job.allocateXrefId();ge.insertAfter(Uw(d,e.i18n,void 0,e.startSourceSpan),t.create.head),ge.insertBefore(qw(d,e.endSourceSpan??e.startSourceSpan),t.create.tail)}}function vQ(n,e){if(e.i18n!==void 0&&!(e.i18n instanceof Cl))throw Error(`Unhandled i18n metadata type for element: ${e.i18n.constructor.name}`);let t=null;e.children.some(i=>!(i instanceof Bw)&&(!(i instanceof Ic)||i.value.trim().length>0))&&(t=n.job.allocateView(n.xref),Ta(t,e.children));let r=n.job.allocateXrefId(),s=Kz(r,e.selector,e.i18n,t?.xref??null,e.sourceSpan);for(let i of e.attributes){let o=Pc.securityContext(e.name,i.name,!0);n.update.push(qc(s.xref,Qe.Attribute,i.name,Y(i.value),null,o,!0,!1,null,va(i.i18n),i.sourceSpan))}n.create.push(s)}function gL(n,e,t){n.create.push(jF(n.job.allocateXrefId(),e.value,t,e.sourceSpan))}function vL(n,e,t){let r=e.value;if(r instanceof pi&&(r=r.ast),!(r instanceof wv))throw new Error(`AssertionError: expected Interpolation for BoundText node, got ${r.constructor.name}`);if(e.i18n!==void 0&&!(e.i18n instanceof ya))throw Error(`Unhandled i18n metadata type for text interpolation: ${e.i18n?.constructor.name}`);let s=e.i18n instanceof ya?e.i18n.children.filter(a=>a instanceof Xg).map(a=>a.name):[];if(s.length>0&&s.length!==r.expressions.length)throw Error(`Unexpected number of i18n placeholders (${r.expressions.length}) for BoundText with ${r.expressions.length} expressions`);let i=n.job.allocateXrefId();n.create.push(jF(i,"",t,e.sourceSpan));let o=n.job.compatibility?null:e.sourceSpan;n.update.push(Mz(i,new nr(r.strings,r.expressions.map(a=>Et(a,n.job,o)),s),e.sourceSpan))}function yQ(n,e){let t=null,r=[];for(let s=0;sf.modifier==="none")||d.some(f=>f.modifier==="none")||u.push(pl(a,{kind:un.Idle},"none",null)),n.create.push(u),n.update.push(d)}function EQ(n){return Object.keys(n.hydrateTriggers).length>0?1:null}function TT(n,e,t,r,s,i){if(e.idle!==void 0){let o=pl(i,{kind:un.Idle},n,e.idle.sourceSpan);t.push(o)}if(e.immediate!==void 0){let o=pl(i,{kind:un.Immediate},n,e.immediate.sourceSpan);t.push(o)}if(e.timer!==void 0){let o=pl(i,{kind:un.Timer,delay:e.timer.delay},n,e.timer.sourceSpan);t.push(o)}if(e.hover!==void 0){let o=pl(i,{kind:un.Hover,targetName:e.hover.reference,targetXref:null,targetSlot:null,targetView:null,targetSlotViewSteps:null},n,e.hover.sourceSpan);t.push(o)}if(e.interaction!==void 0){let o=pl(i,{kind:un.Interaction,targetName:e.interaction.reference,targetXref:null,targetSlot:null,targetView:null,targetSlotViewSteps:null},n,e.interaction.sourceSpan);t.push(o)}if(e.viewport!==void 0){let o=pl(i,{kind:un.Viewport,targetName:e.viewport.reference,targetXref:null,targetSlot:null,targetView:null,targetSlotViewSteps:null},n,e.viewport.sourceSpan);t.push(o)}if(e.never!==void 0){let o=pl(i,{kind:un.Never},n,e.never.sourceSpan);t.push(o)}if(e.when!==void 0){if(e.when.value instanceof wv)throw new Error("Unexpected interpolation in defer block when trigger");let o=Hz(i,Et(e.when.value,s.job,e.when.sourceSpan),n,e.when.sourceSpan);r.push(o)}}function xQ(n,e){if(e.i18n instanceof ls&&cQ(e.i18n)){let t=n.job.allocateXrefId();n.create.push(nG(t,e.i18n,vF(e.i18n).name,null));for(let[r,s]of Object.entries({...e.vars,...e.placeholders}))s instanceof Np?vL(n,s,r):gL(n,s,r);n.create.push(rG(t))}else throw Error(`Unhandled i18n metadata type for ICU: ${e.i18n?.constructor.name}`)}function SQ(n,e){let t=n.job.allocateView(n.xref),r=`\u0275$index_${t.xref}`,s=`\u0275$count_${t.xref}`,i=new Set;t.contextVariables.set(e.item.name,e.item.value);for(let b of e.contextVariables)b.value==="$index"&&i.add(b.name),b.name==="$index"?t.contextVariables.set("$index",b.value).set(r,b.value):b.name==="$count"?t.contextVariables.set("$count",b.value).set(s,b.value):t.aliases.add({kind:yr.Alias,name:null,identifier:b.name,expression:CQ(b,r,s)});let o=gr(e.trackBy.span,e.sourceSpan),a=Et(e.trackBy,n.job,o);Ta(t,e.children);let c=null,u=null;e.empty!==null&&(c=n.job.allocateView(n.xref),Ta(c,e.empty.children),u=kw(n,c.xref,e.empty));let d={$index:i,$implicit:e.item.name};if(e.i18n!==void 0&&!(e.i18n instanceof Tl))throw Error("AssertionError: Unhandled i18n metadata type or @for");if(e.empty?.i18n!==void 0&&!(e.empty.i18n instanceof Tl))throw Error("AssertionError: Unhandled i18n metadata type or @empty");let p=e.i18n,f=e.empty?.i18n,h=kw(n,t.xref,e),m=zz(t.xref,c?.xref??null,h,a,d,u,p,f,e.startSourceSpan,e.sourceSpan);n.create.push(m);let g=Et(e.expression,n.job,gr(e.expression.span,e.sourceSpan)),y=$z(m.xref,m.handle,g,e.sourceSpan);n.update.push(y)}function CQ(n,e,t){switch(n.value){case"$index":return new Vr(e);case"$count":return new Vr(t);case"$first":return new Vr(e).identical(Y(0));case"$last":return new Vr(e).identical(new Vr(t).minus(Y(1)));case"$even":return new Vr(e).modulo(Y(2)).identical(Y(0));case"$odd":return new Vr(e).modulo(Y(2)).notIdentical(Y(0));default:throw new Error(`AssertionError: unknown @for loop variable ${n.value}`)}}function TQ(n,e){let t=n.job.allocateXrefId();n.create.push(eG(t,e.name,e.sourceSpan)),n.update.push(Uz(t,e.name,Et(e.value,n.job,e.valueSpan),e.sourceSpan))}function Et(n,e,t){if(n instanceof pi)return Et(n.ast,e,t);if(n instanceof $c)return n.receiver instanceof vi&&!(n.receiver instanceof Vc)?new Vr(n.name):new zs(Et(n.receiver,e,t),n.name,null,gr(n.span,t));if(n instanceof M0)return n.receiver instanceof vi?new Ip(new Sa(e.root.xref),n.name,Et(n.value,e,t),null,gr(n.span,t)):new Ip(Et(n.receiver,e,t),n.name,Et(n.value,e,t),void 0,gr(n.span,t));if(n instanceof R0)return new Ag(Et(n.receiver,e,t),Et(n.key,e,t),Et(n.value,e,t),void 0,gr(n.span,t));if(n instanceof Hg){if(n.receiver instanceof vi)throw new Error("Unexpected ImplicitReceiver");return new Cs(Et(n.receiver,e,t),n.args.map(r=>Et(r,e,t)),void 0,gr(n.span,t))}else{if(n instanceof ui)return Y(n.value,void 0,gr(n.span,t));if(n instanceof Vg)switch(n.operator){case"+":return new _p(Tp.Plus,Et(n.expr,e,t),void 0,gr(n.span,t));case"-":return new _p(Tp.Minus,Et(n.expr,e,t),void 0,gr(n.span,t));default:throw new Error(`AssertionError: unknown unary operator ${n.operator}`)}else if(n instanceof Oi){let r=EG.get(n.operation);if(r===void 0)throw new Error(`AssertionError: unknown binary operator ${n.operation}`);return new Xt(r,Et(n.left,e,t),Et(n.right,e,t),void 0,gr(n.span,t))}else{if(n instanceof Vc)return new Sa(e.root.xref);if(n instanceof Bg)return new xa(Et(n.receiver,e,t),Et(n.key,e,t),void 0,gr(n.span,t));if(n instanceof Mp)throw new Error("AssertionError: Chain in unknown context");if(n instanceof O0){let r=n.keys.map((s,i)=>{let o=n.values[i];return new kp(s.key,Et(o,e,t),s.quoted)});return new ko(r,void 0,gr(n.span,t))}else{if(n instanceof L0)return new Hi(n.expressions.map(r=>Et(r,e,t)));if(n instanceof A0)return new Ea(Et(n.condition,e,t),Et(n.trueExp,e,t),Et(n.falseExp,e,t),void 0,gr(n.span,t));if(n instanceof $g)return Et(n.expression,e,t);if(n instanceof F0)return new Vp(e.allocateXrefId(),new Ds,n.name,[Et(n.exp,e,t),...n.args.map(r=>Et(r,e,t))]);if(n instanceof P0)return new Hp(Et(n.receiver,e,t),Et(n.key,e,t),gr(n.span,t));if(n instanceof N0)return new $p(Et(n.receiver,e,t),n.name);if(n instanceof $0)return new zc(Et(n.receiver,e,t),n.args.map(r=>Et(r,e,t)));if(n instanceof ws)return new lv(gr(n.span,t));if(n instanceof B0)return Uq(Et(n.expression,e,t),gr(n.span,t));if(n instanceof V0)return bv(Et(n.expression,e,t));if(n instanceof jg)return new Ng(n.elements.map(r=>new S0(r.text,gr(r.span,t))),n.expressions.map(r=>Et(r,e,t)),gr(n.span,t));throw new Error(`Unhandled expression type "${n.constructor.name}" in file "${t?.start.file.url}"`)}}}}function $D(n,e,t,r){let s;return e instanceof wv?s=new nr(e.strings,e.expressions.map(i=>Et(i,n,null)),Object.keys(va(t)?.placeholders??{})):e instanceof On?s=Et(e,n,null):s=Y(e),s}var yL=new Map([[En.Property,Qe.Property],[En.TwoWay,Qe.TwoWayProperty],[En.Attribute,Qe.Attribute],[En.Class,Qe.ClassName],[En.Style,Qe.StyleProperty],[En.Animation,Qe.Animation]]);function DQ(n){return Kr(n.tagName??"")[1]===Rc}function va(n){if(n==null)return null;if(!(n instanceof ls))throw Error(`Expected i18n meta to be a Message, but got: ${n.constructor.name}`);return n}function IQ(n,e,t){let r=new Array,s=new Set;for(let i of t.attributes){let[o,a]=Kr(t.name),c=o;if(!o)switch(e.namespace){case rr.SVG:c=Ww;break;case rr.Math:c=zw;break}let u=Pc.securityContext(c?`:${c}:${a}`:a,i.name,!0);r.push(qc(e.xref,Qe.Attribute,i.name,$D(n.job,i.value,i.i18n),null,u,!0,!1,null,va(i.i18n),i.sourceSpan)),i.i18n&&s.add(i.name)}for(let i of t.inputs)s.has(i.name)&&console.error(`On component ${n.job.componentName}, the binding ${i.name} is both an i18n attribute and a property. You may want to remove the property binding. This will become a compilation error in future versions of Angular.`),r.push(qc(e.xref,yL.get(i.type),i.name,$D(n.job,mv(i.value),i.i18n),i.unit,i.securityContext,!1,!1,null,va(i.i18n)??null,i.sourceSpan));n.create.push(r.filter(i=>i?.kind===w.ExtractedAttribute)),n.update.push(r.filter(i=>i?.kind===w.Binding));for(let i of t.outputs){if(i.type===Us.Animation&&i.phase===null)throw Error("Animation listener should have a phase");i.type===Us.TwoWay?n.create.push(UF(e.xref,e.handle,i.name,e.tag,bL(n,i.handler,i.handlerSpan),i.sourceSpan)):n.create.push(bI(e.xref,e.handle,i.name,e.tag,xI(n,i.handler,i.handlerSpan),i.phase,i.target,!1,i.sourceSpan))}r.some(i=>i?.i18nMessage)!==null&&n.create.push(WF(n.job.allocateXrefId(),new Ds,e.xref))}function _Q(n,e,t,r){let s=new Array;for(let i of t.templateAttrs)if(i instanceof Pp){let o=Pc.securityContext(Rc,i.name,!0);s.push(d0(n,e.xref,En.Attribute,i.name,i.value,null,o,!0,r,va(i.i18n),i.sourceSpan))}else s.push(d0(n,e.xref,i.type,i.name,mv(i.value),i.unit,i.securityContext,!0,r,va(i.i18n),i.sourceSpan));for(let i of t.attributes){let o=Pc.securityContext(Rc,i.name,!0);s.push(d0(n,e.xref,En.Attribute,i.name,i.value,null,o,!1,r,va(i.i18n),i.sourceSpan))}for(let i of t.inputs)s.push(d0(n,e.xref,i.type,i.name,mv(i.value),i.unit,i.securityContext,!1,r,va(i.i18n),i.sourceSpan));n.create.push(s.filter(i=>i?.kind===w.ExtractedAttribute)),n.update.push(s.filter(i=>i?.kind===w.Binding));for(let i of t.outputs){if(i.type===Us.Animation&&i.phase===null)throw Error("Animation listener should have a phase");if(r===Ss.NgTemplate&&(i.type===Us.TwoWay?n.create.push(UF(e.xref,e.handle,i.name,e.tag,bL(n,i.handler,i.handlerSpan),i.sourceSpan)):n.create.push(bI(e.xref,e.handle,i.name,e.tag,xI(n,i.handler,i.handlerSpan),i.phase,i.target,!1,i.sourceSpan))),r===Ss.Structural&&i.type!==Us.Animation){let o=Pc.securityContext(Rc,i.name,!1);n.create.push(fi(e.xref,Qe.Property,null,i.name,null,null,null,o))}}s.some(i=>i?.i18nMessage)!==null&&n.create.push(WF(n.job.allocateXrefId(),new Ds,e.xref))}function d0(n,e,t,r,s,i,o,a,c,u,d){let p=typeof s=="string";if(c===Ss.Structural){if(!a)switch(t){case En.Property:case En.Class:case En.Style:return fi(e,Qe.Property,null,r,null,null,u,o);case En.TwoWay:return fi(e,Qe.TwoWayProperty,null,r,null,null,u,o)}if(!p&&(t===En.Attribute||t===En.Animation))return null}let f=yL.get(t);return c===Ss.NgTemplate&&(t===En.Class||t===En.Style||t===En.Attribute&&!p)&&(f=Qe.Property),qc(e,f,r,$D(n.job,s,u),i,o,p,a,c,u,d)}function xI(n,e,t){e=mv(e);let r=new Array,s=e instanceof Mp?e.expressions:[e];if(s.length===0)throw new Error("Expected listener to have non-empty expression list.");let i=s.map(a=>Et(a,n.job,t)),o=i.pop();return r.push(...i.map(a=>Ui(new bi(a,a.sourceSpan)))),r.push(Ui(new Qr(o,o.sourceSpan))),r}function bL(n,e,t){e=mv(e);let r=new Array;if(e instanceof Mp)if(e.expressions.length===1)e=e.expressions[0];else throw new Error("Expected two-way listener to have a single expression.");let s=Et(e,n.job,t),i=new Vr("$event"),o=new aw(s,i);return r.push(Ui(new bi(o))),r.push(Ui(new Qr(i))),r}function mv(n){return n instanceof pi?n.ast:n}function wL(n,e){kQ(n.localRefs);for(let{name:t,value:r}of e.references)n.localRefs.push({name:t,target:r})}function kQ(n){if(!Array.isArray(n))throw new Error("AssertionError: expected an array")}function gr(n,e){if(e===null)return null;let t=e.start.moveBy(n.start),r=e.start.moveBy(n.end),s=e.fullStart.moveBy(n.start);return new bt(t,r,s)}function kw(n,e,t){let r=null;for(let s of t.children)if(!(s instanceof Bw||s instanceof lI)){if(r!==null)return null;if(s instanceof Ao||s instanceof qs&&s.tagName!==null)r=s;else return null}if(r!==null){for(let i of r.attributes){let o=Pc.securityContext(Rc,i.name,!0);n.update.push(qc(e,Qe.Attribute,i.name,Y(i.value),null,o,!0,!1,null,va(i.i18n),i.sourceSpan))}for(let i of r.inputs)if(i.type!==En.Animation&&i.type!==En.Attribute){let o=Pc.securityContext(Rc,i.name,!0);n.create.push(fi(e,Qe.Property,null,i.name,null,null,null,o))}let s=r instanceof Ao?r.name:r.tagName;return s===Rc?null:s}return null}var AQ=!1;function MQ(){return AQ}function Aw(n,e){return Lw(kt(dI).bitwiseAnd(Y(n),null,!1),e)}function NQ(n){return(n.descendants?1:0)|(n.static?2:0)|(n.emitDistinctChangesOnly?4:0)}function PQ(n,e){if(Array.isArray(n.predicate)){let t=[];return n.predicate.forEach(r=>{let s=r.split(",").map(i=>Y(i.trim()));t.push(...s)}),e.getConstLiteral(tn(t),!0)}else switch(n.predicate.forwardRef){case 0:case 2:return n.predicate.expression;case 1:return Ze(v.resolveForwardRef).callFn([n.predicate.expression])}}function EL(n,e,t,r){let s=[];r!==void 0&&s.push(...r),n.isSignal&&s.push(new zs(kt(Qg),n.propertyName)),s.push(PQ(n,e),Y(NQ(n))),n.read&&s.push(n.read);let i=n.isSignal?t.signalBased:t.nonSignal;return Ze(i).callFn(s)}var SI=Symbol("queryAdvancePlaceholder");function xL(n){let e=[],t=0,r=()=>{t>0&&(e.unshift(Ze(v.queryAdvance).callFn(t===1?[]:[Y(t)]).toStmt()),t=0)};for(let s=n.length-1;s>=0;s--){let i=n[s];i===SI?t++:(r(),e.unshift(i))}return r(),e}function RQ(n,e,t){let r=[],s=[],i=yF(a=>s.push(a),uI);n.forEach(a=>{let c=EL(a,e,{signalBased:v.viewQuerySignal,nonSignal:v.viewQuery});if(r.push(c.toStmt()),a.isSignal){s.push(SI);return}let u=i(),d=Ze(v.loadQuery).callFn([]),p=Ze(v.queryRefresh).callFn([u.set(d)]),f=kt(Qg).prop(a.propertyName).set(a.first?u.prop("first"):u);s.push(p.and(f).toStmt())});let o=t?`${t}_Query`:null;return xl([new kr(dI,iI),new kr(Qg,null)],[Aw(1,r),Aw(2,xL(s))],hi,null,o)}function FQ(n,e,t){let r=[],s=[],i=yF(a=>s.push(a),uI);for(let a of n){if(r.push(EL(a,e,{nonSignal:v.contentQuery,signalBased:v.contentQuerySignal},[kt("dirIndex")]).toStmt()),a.isSignal){s.push(SI);continue}let c=i(),u=Ze(v.loadQuery).callFn([]),d=Ze(v.queryRefresh).callFn([c.set(u)]),p=kt(Qg).prop(a.propertyName).set(a.first?c.prop("first"):c);s.push(d.and(p).toStmt())}let o=t?`${t}_ContentQueries`:null;return xl([new kr(dI,iI),new kr(Qg,null),new kr("dirIndex",null)],[Aw(1,r),Aw(2,xL(s))],hi,null,o)}var HD=class extends E7{constructor(){super(sL)}parse(e,t,r){return super.parse(e,t,r)}},$R=".",LQ="attr",OQ="class",BQ="style",VQ="*",DT="animate-",jD=class{constructor(e,t,r,s){l(this,"_exprParser");l(this,"_interpolationConfig");l(this,"_schemaRegistry");l(this,"errors");this._exprParser=e,this._interpolationConfig=t,this._schemaRegistry=r,this.errors=s}get interpolationConfig(){return this._interpolationConfig}createBoundHostProperties(e,t){let r=[];for(let s of Object.keys(e)){let i=e[s];typeof i=="string"?this.parsePropertyBinding(s,i,!0,!1,t,t.start.offset,void 0,[],r,t):this._reportError(`Value of the host property binding "${s}" needs to be a string representing an expression but got "${i}" (${typeof i})`,t)}return r}createDirectiveHostEventAsts(e,t){let r=[];for(let s of Object.keys(e)){let i=e[s];typeof i=="string"?this.parseEvent(s,i,!1,t,t,[],r,t):this._reportError(`Value of the host listener "${s}" needs to be a string representing an expression but got "${i}" (${typeof i})`,t)}return r}parseInterpolation(e,t,r){let s=t.start.toString(),i=t.fullStart.offset;try{let o=this._exprParser.parseInterpolation(e,s,i,r,this._interpolationConfig);return o&&this._reportExpressionParserErrors(o.errors,t),o}catch(o){return this._reportError(`${o}`,t),this._exprParser.wrapLiteralPrimitive("ERROR",s,i)}}parseInterpolationExpression(e,t){let r=t.start.toString(),s=t.start.offset;try{let i=this._exprParser.parseInterpolationExpression(e,r,s);return i&&this._reportExpressionParserErrors(i.errors,t),i}catch(i){return this._reportError(`${i}`,t),this._exprParser.wrapLiteralPrimitive("ERROR",r,s)}}parseInlineTemplateBinding(e,t,r,s,i,o,a,c){let u=r.start.offset+VQ.length,d=this._parseTemplateBindings(e,t,r,u,s);for(let p of d){let f=ul(r,p.sourceSpan),h=p.key.source,m=ul(r,p.key.span);if(p instanceof Ug){let g=p.value?p.value.source:"$implicit",y=p.value?ul(r,p.value.span):void 0;a.push(new zT(h,g,f,m,y))}else if(p.value){let g=c?f:r,y=ul(r,p.value.ast.sourceSpan);this._parsePropertyAst(h,p.value,!1,g,m,y,i,o)}else i.push([h,""]),this.parseLiteralAttr(h,null,m,s,void 0,i,o,m)}}_parseTemplateBindings(e,t,r,s,i){let o=r.start.toString();try{let a=this._exprParser.parseTemplateBindings(e,t,o,s,i);return this._reportExpressionParserErrors(a.errors,r),a.warnings.forEach(c=>{this._reportError(c,r,ma.WARNING)}),a.templateBindings}catch(a){return this._reportError(`${a}`,r),[]}}parseLiteralAttr(e,t,r,s,i,o,a,c){IT(e)?(e=e.substring(1),c!==void 0&&(c=ul(c,new js(c.start.offset+1,c.end.offset))),t&&this._reportError('Assigning animation triggers via @prop="exp" attributes with an expression is invalid. Use property bindings (e.g. [@prop]="exp") or use an attribute without a value (e.g. @prop) instead.',r,ma.ERROR),this._parseAnimation(e,t,r,s,c,i,o,a)):a.push(new xg(e,this._exprParser.wrapLiteralPrimitive(t,"",s),pa.LITERAL_ATTR,r,c,i))}parsePropertyBinding(e,t,r,s,i,o,a,c,u,d){e.length===0&&this._reportError("Property name is missing in binding",i);let p=!1;e.startsWith(DT)?(p=!0,e=e.substring(DT.length),d!==void 0&&(d=ul(d,new js(d.start.offset+DT.length,d.end.offset)))):IT(e)&&(p=!0,e=e.substring(1),d!==void 0&&(d=ul(d,new js(d.start.offset+1,d.end.offset)))),p?this._parseAnimation(e,t,i,o,d,a,c,u):this._parsePropertyAst(e,this.parseBinding(t,r,a||i,o),s,i,d,a,c,u)}parsePropertyInterpolation(e,t,r,s,i,o,a,c){let u=this.parseInterpolation(t,s||r,c);return u?(this._parsePropertyAst(e,u,!1,r,a,s,i,o),!0):!1}_parsePropertyAst(e,t,r,s,i,o,a,c){a.push([e,t.source]),c.push(new xg(e,t,r?pa.TWO_WAY:pa.DEFAULT,s,i,o))}_parseAnimation(e,t,r,s,i,o,a,c){e.length===0&&this._reportError("Animation trigger is missing",r);let u=this.parseBinding(t||"undefined",!1,o||r,s);a.push([e,u.source]),c.push(new xg(e,u,pa.ANIMATION,r,i,o))}parseBinding(e,t,r,s){let i=(r&&r.start||"(unknown)").toString();try{let o=t?this._exprParser.parseSimpleBinding(e,i,s,this._interpolationConfig):this._exprParser.parseBinding(e,i,s,this._interpolationConfig);return o&&this._reportExpressionParserErrors(o.errors,r),o}catch(o){return this._reportError(`${o}`,r),this._exprParser.wrapLiteralPrimitive("ERROR",i,s)}}createBoundElementProperty(e,t,r=!1,s=!0){if(t.isAnimation)return new q0(t.name,En.Animation,Vt.NONE,t.expression,null,t.sourceSpan,t.keySpan,t.valueSpan);let i=null,o,a=null,c=t.name.split($R),u;if(c.length>1)if(c[0]==LQ){a=c.slice(1).join($R),r||this._validatePropertyOrAttributeName(a,t.sourceSpan,!0),u=_T(this._schemaRegistry,e,a,!0);let d=a.indexOf(":");if(d>-1){let p=a.substring(0,d),f=a.substring(d+1);a=YT(p,f)}o=En.Attribute}else c[0]==OQ?(a=c[1],o=En.Class,u=[Vt.NONE]):c[0]==BQ&&(i=c.length>2?c[2]:null,a=c[1],o=En.Style,u=[Vt.STYLE]);if(a===null){let d=this._schemaRegistry.getMappedPropName(t.name);a=s?d:t.name,u=_T(this._schemaRegistry,e,d,!1),o=t.type===pa.TWO_WAY?En.TwoWay:En.Property,r||this._validatePropertyOrAttributeName(d,t.sourceSpan,!1)}return new q0(a,o,u[0],t.expression,i,t.sourceSpan,t.keySpan,t.valueSpan)}parseEvent(e,t,r,s,i,o,a,c){e.length===0&&this._reportError("Event name is missing in binding",s),IT(e)?(e=e.slice(1),c!==void 0&&(c=ul(c,new js(c.start.offset+1,c.end.offset))),this._parseAnimationEvent(e,t,s,i,a,c)):this._parseRegularEvent(e,t,r,s,i,o,a,c)}calcPossibleSecurityContexts(e,t,r){let s=this._schemaRegistry.getMappedPropName(t);return _T(this._schemaRegistry,e,s,r)}_parseAnimationEvent(e,t,r,s,i,o){let a=eW(e,[e,""]),c=a[0],u=a[1].toLowerCase(),d=this._parseAction(t,s);i.push(new U0(c,u,Us.Animation,d,r,s,o)),c.length===0&&this._reportError("Animation event name is missing in binding",r),u?u!=="start"&&u!=="done"&&this._reportError(`The provided animation output phase value "${u}" for "@${c}" is not supported (use start or done)`,r):this._reportError(`The animation trigger output event (@${c}) is missing its phase value name (start or done are currently supported)`,r)}_parseRegularEvent(e,t,r,s,i,o,a,c){let[u,d]=Jq(e,[null,e]),p=this.errors.length,f=this._parseAction(t,i),h=this.errors.length===p;o.push([e,f.source]),r&&h&&!this._isAllowedAssignmentEvent(f)&&this._reportError("Unsupported expression in a two-way binding",s),a.push(new U0(d,u,r?Us.TwoWay:Us.Regular,f,s,i,c))}_parseAction(e,t){let r=(t&&t.start||"(unknown").toString(),s=t&&t.start?t.start.offset:0;try{let i=this._exprParser.parseAction(e,r,s,this._interpolationConfig);return i&&this._reportExpressionParserErrors(i.errors,t),!i||i.ast instanceof ws?(this._reportError("Empty expressions are not allowed",t),this._exprParser.wrapLiteralPrimitive("ERROR",r,s)):i}catch(i){return this._reportError(`${i}`,t),this._exprParser.wrapLiteralPrimitive("ERROR",r,s)}}_reportError(e,t,r=ma.ERROR,s){this.errors.push(new pt(t,e,r,s))}_reportExpressionParserErrors(e,t){for(let r of e)this._reportError(r.message,t,void 0,r)}_validatePropertyOrAttributeName(e,t,r){let s=r?this._schemaRegistry.validateAttribute(e):this._schemaRegistry.validateProperty(e);s.error&&this._reportError(s.msg,t,ma.ERROR)}_isAllowedAssignmentEvent(e){return e instanceof pi?this._isAllowedAssignmentEvent(e.ast):e instanceof $g?this._isAllowedAssignmentEvent(e.expression):e instanceof Hg&&e.args.length===1&&e.receiver instanceof $c&&e.receiver.name==="$any"&&e.receiver.receiver instanceof vi&&!(e.receiver.receiver instanceof Vc)?this._isAllowedAssignmentEvent(e.args[0]):e instanceof $c||e instanceof Bg}};function IT(n){return n[0]=="@"}function _T(n,e,t,r){let s,[i,o]=e?Kr(e,!1):[null,e],a=u=>{let[d,p]=Kr(u,!1),f=d??i,h=f?`:${f}:${p}`:p;return n.securityContext(h,t,r)},c=n.allKnownElementNames();return o===null?s=c.map(a):(s=[],Cp.parse(o).forEach(u=>{let d=u.element?[u.element]:c;if(u.element&&!n.hasElement(u.element,[])){let h=`:${Ww}:${u.element}`,m=`:${zw}:${u.element}`;n.hasElement(h,[])?d=[h]:n.hasElement(m,[])&&(d=[m])}let p=new Set(u.notSelectors.filter(h=>h.isElementSelector()).map(h=>h.element?.toLowerCase())),f=d.filter(h=>{let m=h.toLowerCase();return!p.has(m)&&!p.has(Kr(m)[1])});s.push(...f.map(a))})),s.length===0?[Vt.NONE]:Array.from(new Set(s)).sort()}function ul(n,e){let t=e.start-n.start.offset,r=e.end-n.end.offset;return new bt(n.start.moveBy(t),n.end.moveBy(r),n.fullStart.moveBy(t),n.details)}function $Q(n){if(n==null||n.length===0||n[0]=="/")return!1;let e=n.match(HQ);return e===null||e[1]=="package"||e[1]=="asset"}var HQ=/^([^:/?#]+):/,jQ="select",UQ="link",qQ="rel",WQ="href",zQ="stylesheet",GQ="style",ZQ=new Set([":svg:script","script"]),YQ="ngNonBindable",XQ="ngProjectAs";function SL(n){let e=null,t=null,r=null,s=!1,i="";for(let c of n.attrs){let u=c.name.toLowerCase();u==jQ?e=c.value:u==WQ?t=c.value:u==qQ?r=c.value:c.name==YQ?s=!0:c.name==XQ&&c.value.length>0&&(i=c.value)}e||(e="*");let o=n.name.toLowerCase(),a=xs.OTHER;return GT(o)?a=xs.NG_CONTENT:GQ===o?a=xs.STYLE:ZQ.has(o)?a=xs.SCRIPT:o==UQ&&r==zQ&&(a=xs.STYLESHEET),new UD(a,e,t,s,i)}var xs;(function(n){n[n.NG_CONTENT=0]="NG_CONTENT",n[n.STYLE=1]="STYLE",n[n.STYLESHEET=2]="STYLESHEET",n[n.SCRIPT=3]="SCRIPT",n[n.OTHER=4]="OTHER"})(xs||(xs={}));var UD=class{constructor(e,t,r,s,i){l(this,"type");l(this,"selectAttr");l(this,"hrefAttr");l(this,"nonBindable");l(this,"projectAs");this.type=e,this.selectAttr=t,this.hrefAttr=r,this.nonBindable=s,this.projectAs=i}},QQ=/^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/,KQ=/^track\s+([\S\s]*)/,JQ=/^(as\s+)(.*)/,CI=/^else[^\S\r\n]+if/,eK=/^let\s+([\S\s]*)/,tK=/^[$A-Z_][0-9A-Z_$]*$/i,HR=/(\s*)(\S+)(\s*)/,kg=new Set(["$index","$first","$last","$even","$odd","$count"]);function jR(n){return n==="empty"}function UR(n){return n==="else"||CI.test(n)}function nK(n,e,t,r){let s=aK(e),i=[],o=qR(n,s,r);o!==null&&i.push(new Ac(o.expression,jn(t,n.children,n.children),o.expressionAlias,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.nameSpan,n.i18n));for(let p of e)if(CI.test(p.name)){let f=qR(p,s,r);if(f!==null){let h=jn(t,p.children,p.children);i.push(new Ac(f.expression,h,f.expressionAlias,p.sourceSpan,p.startSourceSpan,p.endSourceSpan,p.nameSpan,p.i18n))}}else if(p.name==="else"){let f=jn(t,p.children,p.children);i.push(new Ac(null,f,null,p.sourceSpan,p.startSourceSpan,p.endSourceSpan,p.nameSpan,p.i18n))}let a=i.length>0?i[0].startSourceSpan:n.startSourceSpan,c=i.length>0?i[i.length-1].endSourceSpan:n.endSourceSpan,u=n.sourceSpan,d=i[i.length-1];return d!==void 0&&(u=new bt(a.start,d.sourceSpan.end)),{node:new Y0(i,u,n.startSourceSpan,c,n.nameSpan),errors:s}}function rK(n,e,t,r){let s=[],i=iK(n,s,r),o=null,a=null;for(let c of e)c.name==="empty"?a!==null?s.push(new pt(c.sourceSpan,"@for loop can only have one @empty block")):c.parameters.length>0?s.push(new pt(c.sourceSpan,"@empty block cannot have parameters")):a=new Zg(jn(t,c.children,c.children),c.sourceSpan,c.startSourceSpan,c.endSourceSpan,c.nameSpan,c.i18n):s.push(new pt(c.sourceSpan,`Unrecognized @for loop block "${c.name}"`));if(i!==null)if(i.trackBy===null)s.push(new pt(n.startSourceSpan,'@for loop must have a "track" expression'));else{let c=a?.endSourceSpan??n.endSourceSpan,u=new bt(n.sourceSpan.start,c?.end??n.sourceSpan.end);o=new Rp(i.itemName,i.expression,i.trackBy.expression,i.trackBy.keywordSpan,i.context,jn(t,n.children,n.children),a,u,n.sourceSpan,n.startSourceSpan,c,n.nameSpan,n.i18n)}return{node:o,errors:s}}function sK(n,e,t){let r=lK(n),s=n.parameters.length>0?gv(n.parameters[0],t):t.parseBinding("",!1,n.sourceSpan,0),i=[],o=[],a=null;for(let c of n.children){if(!(c instanceof di))continue;if((c.name!=="case"||c.parameters.length===0)&&c.name!=="default"){o.push(new X0(c.name,c.sourceSpan,c.nameSpan));continue}let u=c.name==="case"?gv(c.parameters[0],t):null,d=new Gg(u,jn(e,c.children,c.children),c.sourceSpan,c.startSourceSpan,c.endSourceSpan,c.nameSpan,c.i18n);u===null?a=d:i.push(d)}return a!==null&&i.push(a),{node:new Z0(s,i,o,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.nameSpan),errors:r}}function iK(n,e,t){if(n.parameters.length===0)return e.push(new pt(n.startSourceSpan,"@for loop does not have an expression")),null;let[r,...s]=n.parameters,i=cK(r,e)?.match(QQ);if(!i||i[2].trim().length===0)return e.push(new pt(r.sourceSpan,'Cannot parse expression. @for loop expression must match the pattern " of "')),null;let[,o,a]=i;kg.has(o)&&e.push(new pt(r.sourceSpan,`@for loop item name cannot be one of ${Array.from(kg).join(", ")}.`));let c=r.expression.split(" ")[0],u=new bt(r.sourceSpan.start,r.sourceSpan.start.moveBy(c.length)),d={itemName:new Sl(o,"$implicit",u,u),trackBy:null,expression:gv(r,t,a),context:Array.from(kg,p=>{let f=new bt(n.startSourceSpan.end,n.startSourceSpan.end);return new Sl(p,p,f,f)})};for(let p of s){let f=p.expression.match(eK);if(f!==null){let m=new bt(p.sourceSpan.start.moveBy(f[0].length-f[1].length),p.sourceSpan.end);oK(p.sourceSpan,f[1],m,o,d.context,e);continue}let h=p.expression.match(KQ);if(h!==null){if(d.trackBy!==null)e.push(new pt(p.sourceSpan,'@for loop can only have one "track" expression'));else{let m=gv(p,t,h[1]);m.ast instanceof ws&&e.push(new pt(n.startSourceSpan,'@for loop must have a "track" expression'));let g=new bt(p.sourceSpan.start,p.sourceSpan.start.moveBy(5));d.trackBy={expression:m,keywordSpan:g}}continue}e.push(new pt(p.sourceSpan,`Unrecognized @for loop parameter "${p.expression}"`))}return d}function oK(n,e,t,r,s,i){let o=e.split(","),a=t.start;for(let c of o){let u=c.split("="),d=u.length===2?u[0].trim():"",p=u.length===2?u[1].trim():"";if(d.length===0||p.length===0)i.push(new pt(n,'Invalid @for loop "let" parameter. Parameter should match the pattern " = "'));else if(!kg.has(p))i.push(new pt(n,`Unknown "let" parameter variable "${p}". The allowed variables are: ${Array.from(kg).join(", ")}`));else if(d===r)i.push(new pt(n,`Invalid @for loop "let" parameter. Variable cannot be called "${r}"`));else if(s.some(f=>f.name===d))i.push(new pt(n,`Duplicate "let" parameter variable "${p}"`));else{let[,f,h]=u[0].match(HR)??[],m=f!==void 0&&u.length===2?new bt(a.moveBy(f.length),a.moveBy(f.length+h.length)):t,g;if(u.length===2){let[,b,E]=u[1].match(HR)??[];g=b!==void 0?new bt(a.moveBy(u[0].length+1+b.length),a.moveBy(u[0].length+1+b.length+E.length)):void 0}let y=new bt(m.start,g?.end??m.end);s.push(new Sl(d,p,y,m,g))}a=a.moveBy(c.length+1)}}function aK(n){let e=[],t=!1;for(let r=0;r1&&r0&&e.push(new pt(s.startSourceSpan,"@else block cannot have parameters")),t=!0):CI.test(s.name)||e.push(new pt(s.startSourceSpan,`Unrecognized conditional block @${s.name}`))}return e}function lK(n){let e=[],t=!1;if(n.parameters.length!==1)return e.push(new pt(n.startSourceSpan,"@switch block must have exactly one parameter")),e;for(let r of n.children)if(!(r instanceof dv||r instanceof Zc&&r.value.trim().length===0)){if(!(r instanceof di)||r.name!=="case"&&r.name!=="default"){e.push(new pt(r.sourceSpan,"@switch block can only contain @case and @default blocks"));continue}r.name==="default"?(t?e.push(new pt(r.startSourceSpan,"@switch block can only have one @default block")):r.parameters.length>0&&e.push(new pt(r.startSourceSpan,"@default block cannot have parameters")),t=!0):r.name==="case"&&r.parameters.length!==1&&e.push(new pt(r.startSourceSpan,"@case block must have exactly one parameter"))}return e}function gv(n,e,t){let r,s;return typeof t=="string"?(r=Math.max(0,n.expression.lastIndexOf(t)),s=r+t.length):(r=0,s=n.expression.length),e.parseBinding(n.expression.slice(r,s),!1,n.sourceSpan,n.sourceSpan.start.offset+r)}function qR(n,e,t){if(n.parameters.length===0)return e.push(new pt(n.startSourceSpan,"Conditional block does not have an expression")),null;let r=gv(n.parameters[0],t),s=null;for(let i=1;i-1;a--){let c=t[a];if(c===")"){if(o=a,s--,s===0)break}else{if(r.test(c))continue;break}}return s!==0?(e.push(new pt(n.sourceSpan,"Unclosed parentheses in expression")),null):t.slice(i,o)}var uK=/^\d+\.?\d*(ms|s)?$/,dK=/^\s$/,WR=new Map([[Vi,Es],[xp,gp],[ba,$i]]),as;(function(n){n.IDLE="idle",n.TIMER="timer",n.INTERACTION="interaction",n.IMMEDIATE="immediate",n.HOVER="hover",n.VIEWPORT="viewport",n.NEVER="never"})(as||(as={}));function pK({expression:n,sourceSpan:e},t,r){let s=n.indexOf("never"),i=new bt(e.start.moveBy(s),e.start.moveBy(s+5)),o=TI(n,e),a=DI(n,e);s===-1?r.push(new pt(e,'Could not find "never" keyword in expression')):II("never",t,r,new JT(i,e,o,null,a))}function kT({expression:n,sourceSpan:e},t,r,s){let i=n.indexOf("when"),o=new bt(e.start.moveBy(i),e.start.moveBy(i+4)),a=TI(n,e),c=DI(n,e);if(i===-1)s.push(new pt(e,'Could not find "when" keyword in expression'));else{let u=vv(n,i+1),d=t.parseBinding(n.slice(u),!1,e,e.start.offset+u);II("when",r,s,new KT(d,e,a,o,c))}}function AT({expression:n,sourceSpan:e},t,r,s){let i=n.indexOf("on"),o=new bt(e.start.moveBy(i),e.start.moveBy(i+2)),a=TI(n,e),c=DI(n,e);if(i===-1)r.push(new pt(e,'Could not find "on" keyword in expression'));else{let u=vv(n,i+1);new qD(n,u,e,t,r,n.startsWith("hydrate")?wK:bK,s,a,o,c).parse()}}function TI(n,e){return n.startsWith("prefetch")?new bt(e.start,e.start.moveBy(8)):null}function DI(n,e){return n.startsWith("hydrate")?new bt(e.start,e.start.moveBy(7)):null}var qD=class{constructor(e,t,r,s,i,o,a,c,u,d){l(this,"expression");l(this,"start");l(this,"span");l(this,"triggers");l(this,"errors");l(this,"validator");l(this,"placeholder");l(this,"prefetchSpan");l(this,"onSourceSpan");l(this,"hydrateSpan");l(this,"index",0);l(this,"tokens");this.expression=e,this.start=t,this.span=r,this.triggers=s,this.errors=i,this.validator=o,this.placeholder=a,this.prefetchSpan=c,this.onSourceSpan=u,this.hydrateSpan=d,this.tokens=new hv().tokenize(e.slice(t))}parse(){for(;this.tokens.length>0&&this.index0&&s.isCharacter(t[t.length-1])&&t.pop(),t.length===0&&s.isCharacter(mi)&&r.length>0){e.push(r),r="",this.advance();continue}r+=this.tokenText(),this.advance()}return(!this.token().isCharacter($i)||t.length>0)&&this.error(this.token(),"Unexpected end of expression"),this.index0)throw new Error(`"${as.IDLE}" trigger cannot have parameters`);return new eD(e,t,r,s,i)}function hK(n,e,t,r,s,i){if(n.length!==1)throw new Error(`"${as.TIMER}" trigger must have exactly one parameter`);let o=Mw(n[0]);if(o===null)throw new Error(`Could not parse time value of trigger "${as.TIMER}"`);return new nD(o,e,t,r,s,i)}function mK(n,e,t,r,s,i){if(n.length>0)throw new Error(`"${as.IMMEDIATE}" trigger cannot have parameters`);return new tD(e,t,r,s,i)}function gK(n,e,t,r,s,i,o,a){return a(as.HOVER,n,o),new W0(n[0]??null,e,t,r,s,i)}function vK(n,e,t,r,s,i,o,a){return a(as.INTERACTION,n,o),new z0(n[0]??null,e,t,r,s,i)}function yK(n,e,t,r,s,i,o,a){return a(as.VIEWPORT,n,o),new G0(n[0]??null,e,t,r,s,i)}function bK(n,e,t){if(e.length>1)throw new Error(`"${n}" trigger can only have zero or one parameters`);if(e.length===0){if(t===null)throw new Error(`"${n}" trigger with no parameters can only be placed on an @defer that has a @placeholder block`);if(t.children.length!==1||!(t.children[0]instanceof Ao))throw new Error(`"${n}" trigger with no parameters can only be placed on an @defer that has a @placeholder block with exactly one root element node`)}}function wK(n,e){if(e.length>0)throw new Error(`Hydration trigger "${n}" cannot have parameters`)}function vv(n,e=0){let t=!1;for(let r=e;r0){let g=e[e.length-1];p=g.endSourceSpan,f=g.sourceSpan.end}let h=new bt(n.sourceSpan.start,f);return{node:new Hc(jn(t,n.children,n.children),c,u,d,i,o,a,n.nameSpan,h,n.sourceSpan,n.startSourceSpan,p,n.i18n),errors:s}}function AK(n,e,t){let r=null,s=null,i=null;for(let o of n)try{if(!WD(o.name)){e.push(new pt(o.startSourceSpan,`Unrecognized block "@${o.name}"`));break}switch(o.name){case"placeholder":r!==null?e.push(new pt(o.startSourceSpan,"@defer block can only have one @placeholder block")):r=MK(o,t);break;case"loading":s!==null?e.push(new pt(o.startSourceSpan,"@defer block can only have one @loading block")):s=NK(o,t);break;case"error":i!==null?e.push(new pt(o.startSourceSpan,"@defer block can only have one @error block")):i=PK(o,t);break}}catch(a){e.push(new pt(o.startSourceSpan,a.message))}return{placeholder:r,loading:s,error:i}}function MK(n,e){let t=null;for(let r of n.parameters)if(CL.test(r.expression)){if(t!=null)throw new Error('@placeholder block can only have one "minimum" parameter');let s=Mw(r.expression.slice(vv(r.expression)));if(s===null)throw new Error('Could not parse time value of parameter "minimum"');t=s}else throw new Error(`Unrecognized parameter in @placeholder block: "${r.expression}"`);return new qg(jn(e,n.children,n.children),t,n.nameSpan,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.i18n)}function NK(n,e){let t=null,r=null;for(let s of n.parameters)if(DK.test(s.expression)){if(t!=null)throw new Error('@loading block can only have one "after" parameter');let i=Mw(s.expression.slice(vv(s.expression)));if(i===null)throw new Error('Could not parse time value of parameter "after"');t=i}else if(CL.test(s.expression)){if(r!=null)throw new Error('@loading block can only have one "minimum" parameter');let i=Mw(s.expression.slice(vv(s.expression)));if(i===null)throw new Error('Could not parse time value of parameter "minimum"');r=i}else throw new Error(`Unrecognized parameter in @loading block: "${s.expression}"`);return new Wg(jn(e,n.children,n.children),t,r,n.nameSpan,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.i18n)}function PK(n,e){if(n.parameters.length>0)throw new Error("@error block cannot have parameters");return new zg(jn(e,n.children,n.children),n.nameSpan,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.i18n)}function RK(n,e,t,r){let s={},i={},o={};for(let a of n.parameters)IK.test(a.expression)?kT(a,e,s,t):_K.test(a.expression)?AT(a,s,t,r):EK.test(a.expression)?kT(a,e,i,t):xK.test(a.expression)?AT(a,i,t,r):SK.test(a.expression)?kT(a,e,o,t):CK.test(a.expression)?AT(a,o,t,r):TK.test(a.expression)?pK(a,o,t):t.push(new pt(a.sourceSpan,"Unrecognized trigger"));return o.never&&Object.keys(o).length>1&&t.push(new pt(n.startSourceSpan,"Cannot specify additional `hydrate` triggers if `hydrate never` is present")),{triggers:s,prefetchTriggers:i,hydrateTriggers:o}}var FK=/^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/,zR=1,GR=2,ZR=3,YR=4,XR=5,LK=6,vg=7,dl={BANANA_BOX:{start:"[(",end:")]"},PROPERTY:{start:"[",end:"]"},EVENT:{start:"(",end:")"}},QR="*";function OK(n,e,t){let r=new zD(e,t),s=jn(r,n,n),i=e.errors.concat(r.errors),o={nodes:s,errors:i,styleUrls:r.styleUrls,styles:r.styles,ngContentSelectors:r.ngContentSelectors};return t.collectCommentNodes&&(o.commentNodes=r.commentNodes),o}var zD=class{constructor(e,t){l(this,"bindingParser");l(this,"options");l(this,"errors",[]);l(this,"styles",[]);l(this,"styleUrls",[]);l(this,"ngContentSelectors",[]);l(this,"commentNodes",[]);l(this,"inI18nBlock",!1);l(this,"processedNodes",new Set);this.bindingParser=e,this.options=t}visitElement(e){let t=VD(e.i18n);t&&(this.inI18nBlock&&this.reportError("Cannot mark an element as translatable inside of a translatable section. Please remove the nested i18n marker.",e.sourceSpan),this.inI18nBlock=!0);let r=SL(e);if(r.type===xs.SCRIPT)return null;if(r.type===xs.STYLE){let y=VK(e);return y!==null&&this.styles.push(y),null}else if(r.type===xs.STYLESHEET&&$Q(r.hrefAttr))return this.styleUrls.push(r.hrefAttr),null;let s=wW(e.name),i=[],o=[],a=[],c=[],u=[],d={},p=[],f=[],h=!1;for(let y of e.attrs){let b=!1,E=KR(y.name),_=!1;if(y.i18n&&(d[y.name]=y.i18n),E.startsWith(QR)){h&&this.reportError("Can't have multiple template bindings on one element. Use only one attribute prefixed with *",y.sourceSpan),_=!0,h=!0;let V=y.value,M=E.substring(QR.length),j=[],G=y.valueSpan?y.valueSpan.start.offset:y.sourceSpan.start.offset+y.name.length;this.bindingParser.parseInlineTemplateBinding(M,V,y.sourceSpan,G,[],p,j,!0),f.push(...j.map(W=>new Sl(W.name,W.value,W.sourceSpan,W.keySpan,W.valueSpan)))}else b=this.parseAttribute(s,y,[],i,o,a,c);!b&&!_&&u.push(this.visitAttribute(y))}let m;r.nonBindable?m=jn(BK,e.children).flat(1/0):m=jn(this,e.children,e.children);let g;if(r.type===xs.NG_CONTENT){let y=r.selectAttr,b=e.attrs.map(E=>this.visitAttribute(E));g=new Fp(y,b,m,e.sourceSpan,e.i18n),this.ngContentSelectors.push(y)}else if(s){let y=this.extractAttributes(e.name,i,d);g=new qs(e.name,u,y.bound,o,[],m,c,a,e.sourceSpan,e.startSourceSpan,e.endSourceSpan,e.i18n)}else{let y=this.extractAttributes(e.name,i,d);g=new Ao(e.name,u,y.bound,o,m,c,e.sourceSpan,e.startSourceSpan,e.endSourceSpan,e.i18n)}if(h){let y=this.extractAttributes("ng-template",p,d),b=[];y.literal.forEach(M=>b.push(M)),y.bound.forEach(M=>b.push(M));let E=g instanceof Ao?{attributes:g.attributes,inputs:g.inputs,outputs:g.outputs}:{attributes:[],inputs:[],outputs:[]},_=s&&t?void 0:e.i18n,V=g instanceof qs?null:g.name;g=new qs(V,E.attributes,E.inputs,E.outputs,b,[g],[],f,e.sourceSpan,e.startSourceSpan,e.endSourceSpan,_)}return t&&(this.inI18nBlock=!1),g}visitAttribute(e){return new Pp(e.name,e.value,e.sourceSpan,e.keySpan,e.valueSpan,e.i18n)}visitText(e){return this.processedNodes.has(e)?null:this._visitTextWithInterpolation(e.value,e.sourceSpan,e.tokens,e.i18n)}visitExpansion(e){if(!e.i18n)return null;if(!VD(e.i18n))throw new Error(`Invalid type "${e.i18n.constructor}" for "i18n" property of ${e.sourceSpan.toString()}. Expected a "Message"`);let t=e.i18n,r={},s={};return Object.keys(t.placeholders).forEach(i=>{let o=t.placeholders[i];if(i.startsWith(CW)){let a=i.trim(),c=this.bindingParser.parseInterpolationExpression(o.text,o.sourceSpan);r[a]=new Np(c,o.sourceSpan)}else s[i]=this._visitTextWithInterpolation(o.text,o.sourceSpan,null)}),new hF(r,s,e.sourceSpan,t)}visitExpansionCase(e){return null}visitComment(e){return this.options.collectCommentNodes&&this.commentNodes.push(new Bw(e.value||"",e.sourceSpan)),null}visitLetDeclaration(e,t){let r=this.bindingParser.parseBinding(e.value,!1,e.valueSpan,e.valueSpan.start.offset);return r.errors.length===0&&r.ast instanceof ws&&this.reportError("@let declaration value cannot be empty",e.valueSpan),new lI(e.name,r,e.sourceSpan,e.nameSpan,e.valueSpan)}visitBlockParameter(){return null}visitBlock(e,t){let r=Array.isArray(t)?t.indexOf(e):-1;if(r===-1)throw new Error("Visitor invoked incorrectly. Expecting visitBlock to be invoked siblings array as its context");if(this.processedNodes.has(e))return null;let s=null;switch(e.name){case"defer":s=kK(e,this.findConnectedBlocks(r,t,WD),this,this.bindingParser);break;case"switch":s=sK(e,this,this.bindingParser);break;case"for":s=rK(e,this.findConnectedBlocks(r,t,jR),this,this.bindingParser);break;case"if":s=nK(e,this.findConnectedBlocks(r,t,UR),this,this.bindingParser);break;default:let i;WD(e.name)?(i=`@${e.name} block can only be used after an @defer block.`,this.processedNodes.add(e)):jR(e.name)?(i=`@${e.name} block can only be used after an @for block.`,this.processedNodes.add(e)):UR(e.name)?(i=`@${e.name} block can only be used after an @if or @else if block.`,this.processedNodes.add(e)):i=`Unrecognized block @${e.name}.`,s={node:new X0(e.name,e.sourceSpan,e.nameSpan),errors:[new pt(e.sourceSpan,i)]};break}return this.errors.push(...s.errors),s.node}findConnectedBlocks(e,t,r){let s=[];for(let i=e+1;i{let a=r[o.name];if(o.isLiteral)i.push(new Pp(o.name,o.expression.source||"",o.sourceSpan,o.keySpan,o.valueSpan,a));else{let c=this.bindingParser.createBoundElementProperty(e,o,!0,!1);s.push(XT.fromBoundElementProperty(c,a))}}),{bound:s,literal:i}}parseAttribute(e,t,r,s,i,o,a){let c=KR(t.name),u=t.value,d=t.sourceSpan,p=t.valueSpan?t.valueSpan.start.offset:d.start.offset;function f(b,E,_){let V=t.name.length-c.length,M=b.start.moveBy(E.length+V),j=M.moveBy(_.length);return new bt(M,j,M,_)}let h=c.match(FK);if(h){if(h[zR]!=null){let b=h[vg],E=f(d,h[zR],b);this.bindingParser.parsePropertyBinding(b,u,!1,!1,d,p,t.valueSpan,r,s,E)}else if(h[GR])if(e){let b=h[vg],E=f(d,h[GR],b);this.parseVariable(b,u,d,E,t.valueSpan,o)}else this.reportError('"let-" is only supported on ng-template elements.',d);else if(h[ZR]){let b=h[vg],E=f(d,h[ZR],b);this.parseReference(b,u,d,E,t.valueSpan,a)}else if(h[YR]){let b=[],E=h[vg],_=f(d,h[YR],E);this.bindingParser.parseEvent(E,u,!1,d,t.valueSpan||d,r,b,_),MT(b,i)}else if(h[XR]){let b=h[vg],E=f(d,h[XR],b);this.bindingParser.parsePropertyBinding(b,u,!1,!0,d,p,t.valueSpan,r,s,E),this.parseAssignmentEvent(b,u,d,t.valueSpan,r,i,E)}else if(h[LK]){let b=f(d,"",c);this.bindingParser.parseLiteralAttr(c,u,d,p,t.valueSpan,r,s,b)}return!0}let m=null;if(c.startsWith(dl.BANANA_BOX.start)?m=dl.BANANA_BOX:c.startsWith(dl.PROPERTY.start)?m=dl.PROPERTY:c.startsWith(dl.EVENT.start)&&(m=dl.EVENT),m!==null&&c.endsWith(m.end)&&c.length>m.start.length+m.end.length){let b=c.substring(m.start.length,c.length-m.end.length),E=f(d,m.start,b);if(m.start===dl.BANANA_BOX.start)this.bindingParser.parsePropertyBinding(b,u,!1,!0,d,p,t.valueSpan,r,s,E),this.parseAssignmentEvent(b,u,d,t.valueSpan,r,i,E);else if(m.start===dl.PROPERTY.start)this.bindingParser.parsePropertyBinding(b,u,!1,!1,d,p,t.valueSpan,r,s,E);else{let _=[];this.bindingParser.parseEvent(b,u,!1,d,t.valueSpan||d,r,_,E),MT(_,i)}return!0}let g=f(d,"",c);return this.bindingParser.parsePropertyInterpolation(c,u,d,t.valueSpan,r,s,g,t.valueTokens??null)}_visitTextWithInterpolation(e,t,r,s){let i=eL(e),o=this.bindingParser.parseInterpolation(i,t,r);return o?new Np(o,t,s):new Ic(i,t)}parseVariable(e,t,r,s,i,o){e.indexOf("-")>-1?this.reportError('"-" is not allowed in variable names',r):e.length===0&&this.reportError("Variable does not have a name",r),o.push(new Sl(e,t,r,s,i))}parseReference(e,t,r,s,i,o){e.indexOf("-")>-1?this.reportError('"-" is not allowed in reference names',r):e.length===0?this.reportError("Reference does not have a name",r):o.some(a=>a.name===e)&&this.reportError(`Reference "#${e}" is defined more than once`,r),o.push(new Yg(e,t,r,s,i))}parseAssignmentEvent(e,t,r,s,i,o,a){let c=[];this.bindingParser.parseEvent(`${e}Change`,t,!0,r,s||r,i,c,a),MT(c,o)}reportError(e,t,r=ma.ERROR){this.errors.push(new pt(t,e,r))}},GD=class{visitElement(e){let t=SL(e);if(t.type===xs.SCRIPT||t.type===xs.STYLE||t.type===xs.STYLESHEET)return null;let r=jn(this,e.children,null);return new Ao(e.name,jn(this,e.attrs),[],[],r,[],e.sourceSpan,e.startSourceSpan,e.endSourceSpan)}visitComment(e){return null}visitAttribute(e){return new Pp(e.name,e.value,e.sourceSpan,e.keySpan,e.valueSpan,e.i18n)}visitText(e){return new Ic(e.value,e.sourceSpan)}visitExpansion(e){return null}visitExpansionCase(e){return null}visitBlock(e,t){let r=[new Ic(e.startSourceSpan.toString(),e.startSourceSpan),...jn(this,e.children)];return e.endSourceSpan!==null&&r.push(new Ic(e.endSourceSpan.toString(),e.endSourceSpan)),r}visitBlockParameter(e,t){return null}visitLetDeclaration(e,t){return new Ic(`@let ${e.name} = ${e.value};`,e.sourceSpan)}},BK=new GD;function KR(n){return/^data-/i.test(n)?n.substring(5):n}function MT(n,e){e.push(...n.map(t=>QT.fromParsedEvent(t)))}function VK(n){return n.children.length!==1||!(n.children[0]instanceof Zc)?null:n.children[0].value}var $K=[" ",` +`,"\r"," "];function HK(n,e,t={}){let{interpolationConfig:r,preserveWhitespaces:s,enableI18nLegacyMessageIdFormat:i}=t,o=Nw(r),c=new HD().parse(n,e,{leadingTriviaChars:$K,...t,tokenizeExpansionForms:!0,tokenizeBlocks:t.enableBlockSyntax??!0,tokenizeLet:t.enableLetSyntax??!0});if(!t.alwaysAttemptHtmlToR3AstConversion&&c.errors&&c.errors.length>0){let V={interpolationConfig:r,preserveWhitespaces:s,errors:c.errors,nodes:[],styleUrls:[],styles:[],ngContentSelectors:[]};return t.collectCommentNodes&&(V.commentNodes=[]),V}let u=c.rootNodes,d=!(t.preserveSignificantWhitespace??!0),p=new Sw(r,!s,i,void 0,t.preserveSignificantWhitespace,d),f=p.visitAllWithErrors(u);if(!t.alwaysAttemptHtmlToR3AstConversion&&f.errors&&f.errors.length>0){let V={interpolationConfig:r,preserveWhitespaces:s,errors:f.errors,nodes:[],styleUrls:[],styles:[],ngContentSelectors:[]};return t.collectCommentNodes&&(V.commentNodes=[]),V}u=f.rootNodes,s||(u=jn(new Ew(!0,void 0,!1),u),p.hasI18nMeta&&(u=jn(new Sw(r,!1,void 0,void 0,!0,d),u)));let{nodes:h,errors:m,styleUrls:g,styles:y,ngContentSelectors:b,commentNodes:E}=OK(u,o,{collectCommentNodes:!!t.collectCommentNodes});m.push(...c.errors,...f.errors);let _={interpolationConfig:r,preserveWhitespaces:s,errors:m.length>0?m:null,nodes:h,styleUrls:g,styles:y,ngContentSelectors:b};return t.collectCommentNodes&&(_.commentNodes=E),_}var jK=new qp;function Nw(n=Co){return new jD(new xw(new hv),n,jK,[])}var TL="%COMP%",UK=`_nghost-${TL}`,qK=`_ngcontent-${TL}`;function DL(n,e,t){let r=new Dl,s=sI(n.selector);return r.set("type",n.type.value),s.length>0&&r.set("selectors",hp(s)),n.queries.length>0&&r.set("contentQueries",FQ(n.queries,e,n.name)),n.viewQueries.length&&r.set("viewQuery",RQ(n.viewQueries,e,n.name)),r.set("hostBindings",KK(n.host,n.typeSourceSpan,t,e,n.selector||"",n.name,r)),r.set("inputs",UP(n.inputs,!0)),r.set("outputs",UP(n.outputs)),n.exportAs!==null&&r.set("exportAs",tn(n.exportAs.map(i=>Y(i)))),n.isStandalone===!1&&r.set("standalone",Y(!1)),n.isSignal&&r.set("signals",Y(!0)),r}function IL(n,e){let t=[],r=e.providers,s=e.viewProviders;if(r||s){let i=[r||new Hi([])];s&&i.push(s),t.push(Ze(v.ProvidersFeature).callFn(i))}if(e.hostDirectives?.length&&t.push(Ze(v.HostDirectivesFeature).callFn([rJ(e.hostDirectives)])),e.usesInheritance&&t.push(Ze(v.InheritDefinitionFeature)),e.fullInheritance&&t.push(Ze(v.CopyDefinitionFeature)),e.lifecycle.usesOnChanges&&t.push(Ze(v.NgOnChangesFeature)),"externalStyles"in e&&e.externalStyles?.length){let i=e.externalStyles.map(o=>Y(o));t.push(Ze(v.ExternalStylesFeature).callFn([tn(i)]))}t.length&&n.set("features",tn(t))}function WK(n,e,t){let r=DL(n,e,t);IL(r,n);let s=Ze(v.defineDirective).callFn([r.toLiteralMap()],void 0,!0),i=QK(n);return{expression:s,type:i,statements:[]}}function zK(n,e,t){let r=DL(n,e,t);IL(r,n);let s=n.selector&&Cp.parse(n.selector),i=s&&s[0];if(i){let h=i.getAttrs();h.length&&r.set("attrs",e.getConstLiteral(tn(h.map(m=>m!=null?Y(m):Y(void 0))),!0))}let o=n.name,a=null;if(n.defer.mode===1&&n.defer.dependenciesFn!==null){let h=`${o}_DeferFn`;e.statements.push(new Jr(h,n.defer.dependenciesFn,void 0,_r.Final)),a=kt(h)}let c=uQ(n.name,n.template.nodes,e,n.relativeContextFilePath,n.i18nUseExternalIds,n.defer,a,n.relativeTemplatePath,MQ());pL(c,Fe.Tmpl);let u=aQ(c,e);if(c.contentSelectors!==null&&r.set("ngContentSelectors",c.contentSelectors),r.set("decls",Y(c.root.decls)),r.set("vars",Y(c.root.vars)),c.consts.length>0&&(c.constsInitializers.length>0?r.set("consts",ji([],[...c.constsInitializers,new Qr(tn(c.consts))])):r.set("consts",tn(c.consts))),r.set("template",u),n.declarationListEmitMode!==3&&n.declarations.length>0)r.set("dependencies",ZK(tn(n.declarations.map(h=>h.type)),n.declarationListEmitMode));else if(n.declarationListEmitMode===3){let h=[n.type.value];n.rawImports&&h.push(n.rawImports),r.set("dependencies",Ze(v.getComponentDepsFactory).callFn(h))}n.encapsulation===null&&(n.encapsulation=gl.Emulated);let d=!!n.externalStyles?.length;if(n.styles&&n.styles.length){let m=(n.encapsulation==gl.Emulated?nJ(n.styles,qK,UK):n.styles).reduce((g,y)=>(y.trim().length>0&&g.push(e.getConstLiteral(Y(y))),g),[]);m.length>0&&(d=!0,r.set("styles",tn(m)))}!d&&n.encapsulation===gl.Emulated&&(n.encapsulation=gl.None),n.encapsulation!==gl.Emulated&&r.set("encapsulation",Y(n.encapsulation)),n.animations!==null&&r.set("data",cs([{key:"animation",value:n.animations,quoted:!1}])),n.changeDetection!==null&&(typeof n.changeDetection=="number"&&n.changeDetection!==g0.Default?r.set("changeDetection",Y(n.changeDetection)):typeof n.changeDetection=="object"&&r.set("changeDetection",n.changeDetection));let p=Ze(v.defineComponent).callFn([r.toLiteralMap()],void 0,!0),f=GK(n);return{expression:p,type:f,statements:[]}}function GK(n){let e=_L(n);return e.push(YD(n.template.ngContentSelectors)),e.push($r(Y(n.isStandalone))),e.push(kL(n)),n.isSignal&&e.push($r(Y(n.isSignal))),$r(Ze(v.ComponentDeclaration,e))}function ZK(n,e){switch(e){case 0:return n;case 1:return ji([],n);case 2:let t=n.prop("map").callFn([Ze(v.resolveForwardRef)]);return ji([],t);case 3:throw new Error("Unsupported with an array of pre-resolved dependencies")}}function YK(n){return $r(Y(n))}function ZD(n){let e=Object.keys(n).map(t=>{let r=Array.isArray(n[t])?n[t][0]:n[t];return{key:t,value:Y(r),quoted:!0}});return cs(e)}function YD(n){return n.length>0?$r(tn(n.map(e=>Y(e)))):_o}function _L(n){let e=n.selector!==null?n.selector.replace(/\n/g,""):null;return[Ow(n.type.type,n.typeArgumentCount),e!==null?YK(e):_o,n.exportAs!==null?YD(n.exportAs):_o,$r(XK(n)),$r(ZD(n.outputs)),YD(n.queries.map(t=>t.propertyName))]}function XK(n){return cs(Object.keys(n.inputs).map(e=>{let t=n.inputs[e],r=[{key:"alias",value:Y(t.bindingPropertyName),quoted:!0},{key:"required",value:Y(t.required),quoted:!0}];return t.isSignal&&r.push({key:"isSignal",value:Y(t.isSignal),quoted:!0}),{key:e,value:cs(r),quoted:!0}}))}function QK(n){let e=_L(n);return e.push(_o),e.push($r(Y(n.isStandalone))),e.push(kL(n)),n.isSignal&&e.push($r(Y(n.isSignal))),$r(Ze(v.DirectiveDeclaration,e))}function KK(n,e,t,r,s,i,o){let a=t.createBoundHostProperties(n.properties,e),c=t.createDirectiveHostEventAsts(n.listeners,e);n.specialAttributes.styleAttr&&(n.attributes.style=Y(n.specialAttributes.styleAttr)),n.specialAttributes.classAttr&&(n.attributes.class=Y(n.specialAttributes.classAttr));let u=dQ({componentName:i,componentSelector:s,properties:a,events:c,attributes:n.attributes},t,r);pL(u,Fe.Host),o.set("hostAttrs",u.root.attributes);let d=u.root.vars;return d!==null&&d>0&&o.set("hostVars",Y(d)),lQ(u)}var JK=/^(?:\[([^\]]+)\])|(?:\(([^\)]+)\))$/;function eJ(n){let e={},t={},r={},s={};for(let i of Object.keys(n)){let o=n[i],a=i.match(JK);if(a===null)switch(i){case"class":if(typeof o!="string")throw new Error("Class binding must be string");s.classAttr=o;break;case"style":if(typeof o!="string")throw new Error("Style binding must be string");s.styleAttr=o;break;default:typeof o=="string"?e[i]=Y(o):e[i]=o}else if(a[1]!=null){if(typeof o!="string")throw new Error("Property binding must be string");r[a[1]]=o}else if(a[2]!=null){if(typeof o!="string")throw new Error("Event binding must be string");t[a[2]]=o}}return{attributes:e,listeners:t,properties:r,specialAttributes:s}}function tJ(n,e){let t=Nw();return t.createDirectiveHostEventAsts(n.listeners,e),t.createBoundHostProperties(n.properties,e),t.errors}function nJ(n,e,t){let r=new dD;return n.map(s=>r.shimCssText(s,e,t))}function kL(n){return n.hostDirectives?.length?$r(tn(n.hostDirectives.map(e=>cs([{key:"directive",value:bv(e.directive.type),quoted:!1},{key:"inputs",value:ZD(e.inputs||{}),quoted:!1},{key:"outputs",value:ZD(e.outputs||{}),quoted:!1}])))):_o}function rJ(n){let e=[],t=!1;for(let r of n){if(!r.inputs&&!r.outputs)e.push(r.directive.type);else{let s=[{key:"directive",value:r.directive.type,quoted:!1}];if(r.inputs){let i=JR(r.inputs);i&&s.push({key:"inputs",value:i,quoted:!1})}if(r.outputs){let i=JR(r.outputs);i&&s.push({key:"outputs",value:i,quoted:!1})}e.push(cs(s))}r.isForwardReference&&(t=!0)}return t?new wl([],[new Qr(tn(e))]):tn(e)}function JR(n){let e=[];for(let t in n)n.hasOwnProperty(t)&&e.push(Y(t),Y(n[t]));return e.length>0?tn(e):null}var XD=class{constructor(e){l(this,"directiveMatcher");this.directiveMatcher=e}bind(e){if(!e.template)throw new Error("Empty bound targets are not supported");let t=new Map,r=[],s=new Map,i=new Map,o=new Map,a=new Map,c=new Map,u=new Map,d=new Set,p=new Set,f=[];if(e.template){let h=QD.apply(e.template);sJ(h,o),KD.apply(e.template,this.directiveMatcher,t,r,s,i),JD.applyWithScope(e.template,h,a,c,u,d,p,f)}return new eI(e,t,r,s,i,a,c,u,o,d,p,f)}},QD=class n{constructor(e,t){l(this,"parentScope");l(this,"rootNode");l(this,"namedEntities",new Map);l(this,"elementsInScope",new Set);l(this,"childScopes",new Map);l(this,"isDeferred");this.parentScope=e,this.rootNode=t,this.isDeferred=e!==null&&e.isDeferred?!0:t instanceof Hc}static newRootScope(){return new n(null,null)}static apply(e){let t=n.newRootScope();return t.ingest(e),t}ingest(e){e instanceof qs?(e.variables.forEach(t=>this.visitVariable(t)),e.children.forEach(t=>t.visit(this))):e instanceof Ac?(e.expressionAlias!==null&&this.visitVariable(e.expressionAlias),e.children.forEach(t=>t.visit(this))):e instanceof Rp?(this.visitVariable(e.item),e.contextVariables.forEach(t=>this.visitVariable(t)),e.children.forEach(t=>t.visit(this))):e instanceof Gg||e instanceof Zg||e instanceof Hc||e instanceof zg||e instanceof qg||e instanceof Wg||e instanceof Fp?e.children.forEach(t=>t.visit(this)):e.forEach(t=>t.visit(this))}visitElement(e){e.references.forEach(t=>this.visitReference(t)),e.children.forEach(t=>t.visit(this)),this.elementsInScope.add(e)}visitTemplate(e){e.references.forEach(t=>this.visitReference(t)),this.ingestScopedNode(e)}visitVariable(e){this.maybeDeclare(e)}visitReference(e){this.maybeDeclare(e)}visitDeferredBlock(e){this.ingestScopedNode(e),e.placeholder?.visit(this),e.loading?.visit(this),e.error?.visit(this)}visitDeferredBlockPlaceholder(e){this.ingestScopedNode(e)}visitDeferredBlockError(e){this.ingestScopedNode(e)}visitDeferredBlockLoading(e){this.ingestScopedNode(e)}visitSwitchBlock(e){e.cases.forEach(t=>t.visit(this))}visitSwitchBlockCase(e){this.ingestScopedNode(e)}visitForLoopBlock(e){this.ingestScopedNode(e),e.empty?.visit(this)}visitForLoopBlockEmpty(e){this.ingestScopedNode(e)}visitIfBlock(e){e.branches.forEach(t=>t.visit(this))}visitIfBlockBranch(e){this.ingestScopedNode(e)}visitContent(e){this.ingestScopedNode(e)}visitLetDeclaration(e){this.maybeDeclare(e)}visitBoundAttribute(e){}visitBoundEvent(e){}visitBoundText(e){}visitText(e){}visitTextAttribute(e){}visitIcu(e){}visitDeferredTrigger(e){}visitUnknownBlock(e){}maybeDeclare(e){this.namedEntities.has(e.name)||this.namedEntities.set(e.name,e)}lookup(e){return this.namedEntities.has(e)?this.namedEntities.get(e):this.parentScope!==null?this.parentScope.lookup(e):null}getChildScope(e){let t=this.childScopes.get(e);if(t===void 0)throw new Error(`Assertion error: child scope for ${e} not found`);return t}ingestScopedNode(e){let t=new n(this,e);t.ingest(e),this.childScopes.set(e,t)}},KD=class n{constructor(e,t,r,s,i){l(this,"matcher");l(this,"directives");l(this,"eagerDirectives");l(this,"bindings");l(this,"references");l(this,"isInDeferBlock",!1);this.matcher=e,this.directives=t,this.eagerDirectives=r,this.bindings=s,this.references=i}static apply(e,t,r,s,i,o){new n(t,r,s,i,o).ingest(e)}ingest(e){e.forEach(t=>t.visit(this))}visitElement(e){this.visitElementOrTemplate(e)}visitTemplate(e){this.visitElementOrTemplate(e)}visitElementOrTemplate(e){let t=IW(e),r=[];this.matcher.match(t,(i,o)=>r.push(...o)),r.length>0&&(this.directives.set(e,r),this.isInDeferBlock||this.eagerDirectives.push(...r)),e.references.forEach(i=>{let o=null;if(i.value.trim()==="")o=r.find(a=>a.isComponent)||null;else if(o=r.find(a=>a.exportAs!==null&&a.exportAs.some(c=>c===i.value))||null,o===null)return;o!==null?this.references.set(i,{directive:o,node:e}):this.references.set(i,e)});let s=(i,o)=>{let a=r.find(u=>u[o].hasBindingPropertyName(i.name)),c=a!==void 0?a:e;this.bindings.set(i,c)};e.inputs.forEach(i=>s(i,"inputs")),e.attributes.forEach(i=>s(i,"inputs")),e instanceof qs&&e.templateAttrs.forEach(i=>s(i,"inputs")),e.outputs.forEach(i=>s(i,"outputs")),e.children.forEach(i=>i.visit(this))}visitDeferredBlock(e){let t=this.isInDeferBlock;this.isInDeferBlock=!0,e.children.forEach(r=>r.visit(this)),this.isInDeferBlock=t,e.placeholder?.visit(this),e.loading?.visit(this),e.error?.visit(this)}visitDeferredBlockPlaceholder(e){e.children.forEach(t=>t.visit(this))}visitDeferredBlockError(e){e.children.forEach(t=>t.visit(this))}visitDeferredBlockLoading(e){e.children.forEach(t=>t.visit(this))}visitSwitchBlock(e){e.cases.forEach(t=>t.visit(this))}visitSwitchBlockCase(e){e.children.forEach(t=>t.visit(this))}visitForLoopBlock(e){e.item.visit(this),e.contextVariables.forEach(t=>t.visit(this)),e.children.forEach(t=>t.visit(this)),e.empty?.visit(this)}visitForLoopBlockEmpty(e){e.children.forEach(t=>t.visit(this))}visitIfBlock(e){e.branches.forEach(t=>t.visit(this))}visitIfBlockBranch(e){e.expressionAlias?.visit(this),e.children.forEach(t=>t.visit(this))}visitContent(e){e.children.forEach(t=>t.visit(this))}visitVariable(e){}visitReference(e){}visitTextAttribute(e){}visitBoundAttribute(e){}visitBoundEvent(e){}visitBoundAttributeOrEvent(e){}visitText(e){}visitBoundText(e){}visitIcu(e){}visitDeferredTrigger(e){}visitUnknownBlock(e){}visitLetDeclaration(e){}},JD=class n extends j0{constructor(t,r,s,i,o,a,c,u,d){super();l(this,"bindings");l(this,"symbols");l(this,"usedPipes");l(this,"eagerPipes");l(this,"deferBlocks");l(this,"nestingLevel");l(this,"scope");l(this,"rootNode");l(this,"level");l(this,"visitNode");this.bindings=t,this.symbols=r,this.usedPipes=s,this.eagerPipes=i,this.deferBlocks=o,this.nestingLevel=a,this.scope=c,this.rootNode=u,this.level=d,this.visitNode=p=>p.visit(this)}visit(t,r){t instanceof On?t.visit(this,r):t.visit(this)}static applyWithScope(t,r,s,i,o,a,c,u){let d=t instanceof qs?t:null;new n(s,i,a,c,u,o,r,d,0).ingest(t)}ingest(t){if(t instanceof qs)t.variables.forEach(this.visitNode),t.children.forEach(this.visitNode),this.nestingLevel.set(t,this.level);else if(t instanceof Ac)t.expressionAlias!==null&&this.visitNode(t.expressionAlias),t.children.forEach(this.visitNode),this.nestingLevel.set(t,this.level);else if(t instanceof Rp)this.visitNode(t.item),t.contextVariables.forEach(r=>this.visitNode(r)),t.trackBy.visit(this),t.children.forEach(this.visitNode),this.nestingLevel.set(t,this.level);else if(t instanceof Hc){if(this.scope.rootNode!==t)throw new Error(`Assertion error: resolved incorrect scope for deferred block ${t}`);this.deferBlocks.push([t,this.scope]),t.children.forEach(r=>r.visit(this)),this.nestingLevel.set(t,this.level)}else t instanceof Gg||t instanceof Zg||t instanceof zg||t instanceof qg||t instanceof Wg||t instanceof Fp?(t.children.forEach(r=>r.visit(this)),this.nestingLevel.set(t,this.level)):t.forEach(this.visitNode)}visitElement(t){t.inputs.forEach(this.visitNode),t.outputs.forEach(this.visitNode),t.children.forEach(this.visitNode),t.references.forEach(this.visitNode)}visitTemplate(t){t.inputs.forEach(this.visitNode),t.outputs.forEach(this.visitNode),t.templateAttrs.forEach(this.visitNode),t.references.forEach(this.visitNode),this.ingestScopedNode(t)}visitVariable(t){this.rootNode!==null&&this.symbols.set(t,this.rootNode)}visitReference(t){this.rootNode!==null&&this.symbols.set(t,this.rootNode)}visitText(t){}visitTextAttribute(t){}visitUnknownBlock(t){}visitDeferredTrigger(){}visitIcu(t){Object.keys(t.vars).forEach(r=>t.vars[r].visit(this)),Object.keys(t.placeholders).forEach(r=>t.placeholders[r].visit(this))}visitBoundAttribute(t){t.value.visit(this)}visitBoundEvent(t){t.handler.visit(this)}visitDeferredBlock(t){this.ingestScopedNode(t),t.triggers.when?.value.visit(this),t.prefetchTriggers.when?.value.visit(this),t.hydrateTriggers.when?.value.visit(this),t.hydrateTriggers.never?.visit(this),t.placeholder&&this.visitNode(t.placeholder),t.loading&&this.visitNode(t.loading),t.error&&this.visitNode(t.error)}visitDeferredBlockPlaceholder(t){this.ingestScopedNode(t)}visitDeferredBlockError(t){this.ingestScopedNode(t)}visitDeferredBlockLoading(t){this.ingestScopedNode(t)}visitSwitchBlock(t){t.expression.visit(this),t.cases.forEach(this.visitNode)}visitSwitchBlockCase(t){t.expression?.visit(this),this.ingestScopedNode(t)}visitForLoopBlock(t){t.expression.visit(this),this.ingestScopedNode(t),t.empty?.visit(this)}visitForLoopBlockEmpty(t){this.ingestScopedNode(t)}visitIfBlock(t){t.branches.forEach(r=>r.visit(this))}visitIfBlockBranch(t){t.expression?.visit(this),this.ingestScopedNode(t)}visitContent(t){this.ingestScopedNode(t)}visitBoundText(t){t.value.visit(this)}visitLetDeclaration(t){t.value.visit(this),this.rootNode!==null&&this.symbols.set(t,this.rootNode)}visitPipe(t,r){return this.usedPipes.add(t.name),this.scope.isDeferred||this.eagerPipes.add(t.name),super.visitPipe(t,r)}visitPropertyRead(t,r){return this.maybeMap(t,t.name),super.visitPropertyRead(t,r)}visitSafePropertyRead(t,r){return this.maybeMap(t,t.name),super.visitSafePropertyRead(t,r)}visitPropertyWrite(t,r){return this.maybeMap(t,t.name),super.visitPropertyWrite(t,r)}ingestScopedNode(t){let r=this.scope.getChildScope(t);new n(this.bindings,this.symbols,this.usedPipes,this.eagerPipes,this.deferBlocks,this.nestingLevel,r,t,this.level+1).ingest(t)}maybeMap(t,r){if(!(t.receiver instanceof vi)||t.receiver instanceof Vc)return;let s=this.scope.lookup(r);s!==null&&this.bindings.set(t,s)}},eI=class{constructor(e,t,r,s,i,o,a,c,u,d,p,f){l(this,"target");l(this,"directives");l(this,"eagerDirectives");l(this,"bindings");l(this,"references");l(this,"exprTargets");l(this,"symbols");l(this,"nestingLevel");l(this,"scopedNodeEntities");l(this,"usedPipes");l(this,"eagerPipes");l(this,"deferredBlocks");l(this,"deferredScopes");this.target=e,this.directives=t,this.eagerDirectives=r,this.bindings=s,this.references=i,this.exprTargets=o,this.symbols=a,this.nestingLevel=c,this.scopedNodeEntities=u,this.usedPipes=d,this.eagerPipes=p,this.deferredBlocks=f.map(h=>h[0]),this.deferredScopes=new Map(f)}getEntitiesInScope(e){return this.scopedNodeEntities.get(e)??new Set}getDirectivesOfNode(e){return this.directives.get(e)||null}getReferenceTarget(e){return this.references.get(e)||null}getConsumerOfBinding(e){return this.bindings.get(e)||null}getExpressionTarget(e){return this.exprTargets.get(e)||null}getDefinitionNodeOfSymbol(e){return this.symbols.get(e)||null}getNestingLevel(e){return this.nestingLevel.get(e)||0}getUsedDirectives(){let e=new Set;return this.directives.forEach(t=>t.forEach(r=>e.add(r))),Array.from(e.values())}getEagerlyUsedDirectives(){let e=new Set(this.eagerDirectives);return Array.from(e.values())}getUsedPipes(){return Array.from(this.usedPipes)}getEagerlyUsedPipes(){return Array.from(this.eagerPipes)}getDeferBlocks(){return this.deferredBlocks}getDeferredTriggerTarget(e,t){if(!(t instanceof z0)&&!(t instanceof G0)&&!(t instanceof W0))return null;let r=t.reference;if(r===null){let i=null;if(e.placeholder!==null){for(let o of e.placeholder.children)if(!(o instanceof Bw)){if(i!==null)return null;o instanceof Ao&&(i=o)}}return i}let s=this.findEntityInScope(e,r);if(s instanceof Yg&&this.getDefinitionNodeOfSymbol(s)!==e){let i=this.getReferenceTarget(s);if(i!==null)return this.referenceTargetToElement(i)}if(e.placeholder!==null){let i=this.findEntityInScope(e.placeholder,r),o=i instanceof Yg?this.getReferenceTarget(i):null;if(o!==null)return this.referenceTargetToElement(o)}return null}isDeferred(e){for(let t of this.deferredBlocks){if(!this.deferredScopes.has(t))continue;let r=[this.deferredScopes.get(t)];for(;r.length>0;){let s=r.pop();if(s.elementsInScope.has(e))return!0;r.push(...s.childScopes.values())}}return!1}findEntityInScope(e,t){let r=this.getEntitiesInScope(e);for(let s of r)if(s.name===t)return s;return null}referenceTargetToElement(e){return e instanceof Ao?e:e instanceof qs?null:this.referenceTargetToElement(e.node)}};function sJ(n,e){let t=new Map;function r(i){if(t.has(i.rootNode))return t.get(i.rootNode);let o=i.namedEntities,a;return i.parentScope!==null?a=new Map([...r(i.parentScope),...o]):a=new Map(o),t.set(i.rootNode,a),a}let s=[n];for(;s.length>0;){let i=s.pop();for(let o of i.childScopes.values())s.push(o);r(i)}for(let[i,o]of t)e.set(i,new Set(o.values()))}var tI=class{},nI=class{constructor(e=new lD){l(this,"jitEvaluator");l(this,"FactoryTarget",So);l(this,"ResourceLoader",tI);l(this,"elementSchemaRegistry",new qp);this.jitEvaluator=e}compilePipe(e,t,r){let s={type:vr(r.type),typeArgumentCount:0,pipeName:r.pipeName,pure:r.pure,isStandalone:r.isStandalone},i=JP(s);return this.jitExpression(i.expression,e,t,[])}compilePipeDeclaration(e,t,r){let s=EJ(r),i=JP(s);return this.jitExpression(i.expression,e,t,[])}compileInjectable(e,t,r){let{expression:s,statements:i}=qP({name:r.name,type:vr(r.type),typeArgumentCount:r.typeArgumentCount,providedIn:iF(r.providedIn),useClass:cp(r,"useClass"),useFactory:sF(r,"useFactory"),useValue:cp(r,"useValue"),useExisting:cp(r,"useExisting"),deps:r.deps?.map(PL)},!0);return this.jitExpression(s,e,t,i)}compileInjectableDeclaration(e,t,r){let{expression:s,statements:i}=qP({name:r.type.name,type:vr(r.type),typeArgumentCount:0,providedIn:iF(r.providedIn),useClass:cp(r,"useClass"),useFactory:sF(r,"useFactory"),useValue:cp(r,"useValue"),useExisting:cp(r,"useExisting"),deps:r.deps?.map(oF)},!0);return this.jitExpression(s,e,t,i)}compileInjector(e,t,r){let s={type:vr(r.type),providers:r.providers&&r.providers.length>0?new Ft(r.providers):null,imports:r.imports.map(o=>new Ft(o))},i=KP(s);return this.jitExpression(i.expression,e,t,[])}compileInjectorDeclaration(e,t,r){let s=xJ(r),i=KP(s);return this.jitExpression(i.expression,e,t,[])}compileNgModule(e,t,r){let s={kind:ga.Global,type:vr(r.type),bootstrap:r.bootstrap.map(vr),declarations:r.declarations.map(vr),publicDeclarationTypes:null,imports:r.imports.map(vr),includeImportTypes:!0,exports:r.exports.map(vr),selectorScopeMode:rv.Inline,containsForwardDecls:!1,schemas:r.schemas?r.schemas.map(vr):null,id:r.id?new Ft(r.id):null},i=QW(s);return this.jitExpression(i.expression,e,t,[])}compileNgModuleDeclaration(e,t,r){let s=KW(r);return this.jitExpression(s,e,t,[])}compileDirective(e,t,r){let s=nF(r);return this.compileDirectiveFromMeta(e,t,s)}compileDirectiveDeclaration(e,t,r){let s=this.createParseSourceSpan("Directive",r.type.name,t),i=ML(r,s);return this.compileDirectiveFromMeta(e,t,i)}compileDirectiveFromMeta(e,t,r){let s=new _0,i=Nw(),o=WK(r,s,i);return this.jitExpression(o.expression,e,t,s.statements)}compileComponent(e,t,r){let{template:s,interpolation:i,defer:o}=NL(r.template,r.name,t,r.preserveWhitespaces,r.interpolation,void 0),a={...r,...nF(r),selector:r.selector||this.elementSchemaRegistry.getDefaultComponentElementName(),template:s,declarations:r.declarations.map(lJ),declarationListEmitMode:0,defer:o,styles:[...r.styles,...s.styles],encapsulation:r.encapsulation,interpolation:i,changeDetection:r.changeDetection??null,animations:r.animations!=null?new Ft(r.animations):null,viewProviders:r.viewProviders!=null?new Ft(r.viewProviders):null,relativeContextFilePath:"",i18nUseExternalIds:!0,relativeTemplatePath:null},c=`ng:///${r.name}.js`;return this.compileComponentFromMeta(e,c,a)}compileComponentDeclaration(e,t,r){let s=this.createParseSourceSpan("Component",r.type.name,t),i=aJ(r,s,t);return this.compileComponentFromMeta(e,t,i)}compileComponentFromMeta(e,t,r){let s=new _0,i=Nw(r.interpolation),o=zK(r,s,i);return this.jitExpression(o.expression,e,t,s.statements)}compileFactory(e,t,r){let s=Sc({name:r.name,type:vr(r.type),typeArgumentCount:r.typeArgumentCount,deps:dJ(r.deps),target:r.target});return this.jitExpression(s.expression,e,t,s.statements)}compileFactoryDeclaration(e,t,r){let s=Sc({name:r.type.name,type:vr(r.type),typeArgumentCount:0,deps:Array.isArray(r.deps)?r.deps.map(oF):r.deps,target:r.target});return this.jitExpression(s.expression,e,t,s.statements)}createParseSourceSpan(e,t,r){return qW(e,t,r)}jitExpression(e,t,r,s){let i=[...s,new Jr("$def",e,void 0,_r.Exported)];return this.jitEvaluator.evaluateStatements(r,i,new uD(t),!0).$def}};function eF(n){return{...n,isSignal:n.isSignal,predicate:AL(n.predicate),read:n.read?new Ft(n.read):null,static:n.static,emitDistinctChangesOnly:n.emitDistinctChangesOnly}}function tF(n){return{propertyName:n.propertyName,first:n.first??!1,predicate:AL(n.predicate),descendants:n.descendants??!1,read:n.read?new Ft(n.read):null,static:n.static??!1,emitDistinctChangesOnly:n.emitDistinctChangesOnly??!0,isSignal:!!n.isSignal}}function AL(n){return Array.isArray(n)?n:aI(new Ft(n),1)}function nF(n){let e=wJ(n.inputs||[]),t=PT(n.outputs||[]),r=n.propMetadata,s={},i={};for(let a in r)r.hasOwnProperty(a)&&r[a].forEach(c=>{gJ(c)?s[a]={bindingPropertyName:c.alias||a,classPropertyName:a,required:c.required||!1,isSignal:!!c.isSignal,transformFunction:c.transform!=null?new Ft(c.transform):null}:vJ(c)&&(i[a]=c.alias||a)});let o=n.hostDirectives?.length?n.hostDirectives.map(a=>typeof a=="function"?{directive:vr(a),inputs:null,outputs:null,isForwardReference:!1}:{directive:vr(a.directive),isForwardReference:!1,inputs:a.inputs?PT(a.inputs):null,outputs:a.outputs?PT(a.outputs):null}):null;return{...n,typeArgumentCount:0,typeSourceSpan:n.typeSourceSpan,type:vr(n.type),deps:null,host:{...fJ(n.propMetadata,n.typeSourceSpan,n.host)},inputs:{...e,...s},outputs:{...t,...i},queries:n.queries.map(eF),providers:n.providers!=null?new Ft(n.providers):null,viewQueries:n.viewQueries.map(eF),fullInheritance:!1,hostDirectives:o}}function ML(n,e){let t=n.hostDirectives?.length?n.hostDirectives.map(r=>({directive:vr(r.directive),isForwardReference:!1,inputs:r.inputs?rF(r.inputs):null,outputs:r.outputs?rF(r.outputs):null})):null;return{name:n.type.name,type:vr(n.type),typeSourceSpan:e,selector:n.selector??null,inputs:n.inputs?yJ(n.inputs):{},outputs:n.outputs??{},host:iJ(n.host),queries:(n.queries??[]).map(tF),viewQueries:(n.viewQueries??[]).map(tF),providers:n.providers!==void 0?new Ft(n.providers):null,exportAs:n.exportAs??null,usesInheritance:n.usesInheritance??!1,lifecycle:{usesOnChanges:n.usesOnChanges??!1},deps:null,typeArgumentCount:0,fullInheritance:!1,isStandalone:n.isStandalone??fF(n.version),isSignal:n.isSignal??!1,hostDirectives:t}}function iJ(n={}){return{attributes:oJ(n.attributes??{}),listeners:n.listeners??{},properties:n.properties??{},specialAttributes:{classAttr:n.classAttribute,styleAttr:n.styleAttribute}}}function rF(n){let e=null;for(let t=1;tNT(a,!0))),n.directives&&o.push(...n.directives.map(a=>NT(a))),n.pipes&&o.push(...cJ(n.pipes)));return{...ML(n,e),template:r,styles:n.styles??[],declarations:o,viewProviders:n.viewProviders!==void 0?new Ft(n.viewProviders):null,animations:n.animations!==void 0?new Ft(n.animations):null,defer:i,changeDetection:n.changeDetection??g0.Default,encapsulation:n.encapsulation??gl.Emulated,interpolation:s,declarationListEmitMode:2,relativeContextFilePath:"",i18nUseExternalIds:!0,relativeTemplatePath:null}}function lJ(n){return{...n,type:new Ft(n.type)}}function NT(n,e=null){return{kind:sv.Directive,isComponent:e||n.kind==="component",selector:n.selector,type:new Ft(n.type),inputs:n.inputs??[],outputs:n.outputs??[],exportAs:n.exportAs??null}}function cJ(n){return n?Object.keys(n).map(e=>({kind:sv.Pipe,name:e,type:new Ft(n[e])})):[]}function uJ(n){return{kind:sv.Pipe,name:n.name,type:new Ft(n.type)}}function NL(n,e,t,r,s,i){let o=s?K0.fromArray(s):Co,a=HK(n,t,{preserveWhitespaces:r,interpolationConfig:o});if(a.errors!==null){let d=a.errors.map(p=>p.toString()).join(", ");throw new Error(`Errors during JIT compilation of template for ${e}: ${d}`)}let u=new XD(new m0).bind({template:a.nodes});return{template:a,interpolation:o,defer:pJ(u,i)}}function cp(n,e){if(n.hasOwnProperty(e))return aI(new Ft(n[e]),0)}function sF(n,e){if(n.hasOwnProperty(e))return new Ft(n[e])}function iF(n){let e=typeof n=="function"?new Ft(n):new Hr(n??null);return aI(e,0)}function dJ(n){return n==null?null:n.map(PL)}function PL(n){let e=n.attribute!=null,t=n.token===null?null:new Ft(n.token),r=e?new Ft(n.attribute):t;return RL(r,e,n.host,n.optional,n.self,n.skipSelf)}function oF(n){let e=n.attribute??!1,t=n.token===null?null:new Ft(n.token);return RL(t,e,n.host??!1,n.optional??!1,n.self??!1,n.skipSelf??!1)}function RL(n,e,t,r,s,i){let o=e?Y("unknown"):null;return{token:n,attributeNameType:o,host:t,optional:r,self:s,skipSelf:i}}function pJ(n,e){let t=n.getDeferBlocks(),r=new Map;for(let s=0;si.msg).join(` +`));for(let i in n)n.hasOwnProperty(i)&&n[i].forEach(o=>{hJ(o)?r.properties[o.hostPropertyName||i]=cW("this",i):mJ(o)&&(r.listeners[o.eventName||i]=`${i}(${(o.args||[]).join(",")})`)});return r}function hJ(n){return n.ngMetadataName==="HostBinding"}function mJ(n){return n.ngMetadataName==="HostListener"}function gJ(n){return n.ngMetadataName==="Input"}function vJ(n){return n.ngMetadataName==="Output"}function yJ(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];return typeof r=="string"||Array.isArray(r)?e[t]=bJ(r):e[t]={bindingPropertyName:r.publicName,classPropertyName:t,transformFunction:r.transformFunction!==null?new Ft(r.transformFunction):null,required:r.isRequired,isSignal:r.isSignal},e},{})}function bJ(n){return typeof n=="string"?{bindingPropertyName:n,classPropertyName:n,transformFunction:null,required:!1,isSignal:!1}:{bindingPropertyName:n[0],classPropertyName:n[1],transformFunction:n[2]?new Ft(n[2]):null,required:!1,isSignal:!1}}function wJ(n){return n.reduce((e,t)=>{if(typeof t=="string"){let[r,s]=FL(t);e[s]={bindingPropertyName:r,classPropertyName:s,required:!1,isSignal:!1,transformFunction:null}}else e[t.name]={bindingPropertyName:t.alias||t.name,classPropertyName:t.name,required:t.required||!1,isSignal:!1,transformFunction:t.transform!=null?new Ft(t.transform):null};return e},{})}function PT(n){return n.reduce((e,t)=>{let[r,s]=FL(t);return e[s]=r,e},{})}function FL(n){let[e,t]=n.split(":",2).map(r=>r.trim());return[t??e,e]}function EJ(n){return{name:n.type.name,type:vr(n.type),typeArgumentCount:0,pipeName:n.name,deps:null,pure:n.pure??!0,isStandalone:n.isStandalone??fF(n.version)}}function xJ(n){return{name:n.type.name,type:vr(n.type),providers:n.providers!==void 0&&n.providers.length>0?new Ft(n.providers):null,imports:n.imports!==void 0?n.imports.map(e=>new Ft(e)):[]}}function SJ(n){let e=n.ng||(n.ng={});e.\u0275compilerFacade=new nI}var lhe=new $T("19.2.25");var aF;(function(n){n[n.Extract=0]="Extract",n[n.Merge=1]="Merge"})(aF||(aF={}));var rI=class{constructor(){l(this,"closedByParent",!1);l(this,"implicitNamespacePrefix",null);l(this,"isVoid",!1);l(this,"ignoreFirstLf",!1);l(this,"canSelfClose",!0);l(this,"preventNamespaceInheritance",!1)}requireExtraParent(e){return!1}isClosedByChild(e){return!1}getContentType(){return Bi.PARSABLE_DATA}},che=new rI;SJ(Eg);var k={};Q9(k,{ANIMATION_MODULE_TYPE:()=>Qne,APP_BOOTSTRAP_LISTENER:()=>Qy,APP_ID:()=>Zs,APP_INITIALIZER:()=>vA,AfterRenderPhase:()=>Vl,ApplicationInitStatus:()=>Sy,ApplicationModule:()=>Vu,ApplicationRef:()=>ns,Attribute:()=>hS,COMPILER_OPTIONS:()=>r4,CSP_NONCE:()=>Xf,CUSTOM_ELEMENTS_SCHEMA:()=>jre,ChangeDetectionStrategy:()=>py,ChangeDetectorRef:()=>bn,Compiler:()=>ik,CompilerFactory:()=>ok,Component:()=>ms,ComponentFactory:()=>nA,ComponentFactoryResolver:()=>Yy,ComponentRef:()=>SH,ContentChild:()=>uae,ContentChildren:()=>cae,DEFAULT_CURRENCY_CODE:()=>XS,DebugElement:()=>Bu,DebugEventListener:()=>dk,DebugNode:()=>_y,DefaultIterableDiffer:()=>Zx,DestroyRef:()=>As,Directive:()=>ht,ENVIRONMENT_INITIALIZER:()=>Ki,ElementRef:()=>en,EmbeddedViewRef:()=>uk,EnvironmentInjector:()=>$o,ErrorHandler:()=>Ks,EventEmitter:()=>jr,HOST_TAG_NAME:()=>w$,Host:()=>Ns,HostAttributeToken:()=>Q_,HostBinding:()=>sue,HostListener:()=>iue,INJECTOR:()=>Ak,Inject:()=>Ke,InjectFlags:()=>Ot,Injectable:()=>zt,InjectionToken:()=>$e,Injector:()=>In,Input:()=>ze,IterableDiffers:()=>Ql,KeyValueDiffers:()=>zo,LOCALE_ID:()=>ss,MissingTranslationStrategy:()=>ck,ModuleWithComponentFactories:()=>qx,NO_ERRORS_SCHEMA:()=>Ure,NgModule:()=>ao,NgModuleFactory:()=>XH,NgModuleRef:()=>Xl,NgProbeToken:()=>W1,NgZone:()=>ln,Optional:()=>st,Output:()=>mh,OutputEmitterRef:()=>ly,PACKAGE_ROOT_URL:()=>Xne,PLATFORM_ID:()=>Xo,PLATFORM_INITIALIZER:()=>Vy,PendingTasks:()=>oy,Pipe:()=>gs,PlatformRef:()=>Iy,Query:()=>Pu,QueryList:()=>vx,REQUEST:()=>xde,REQUEST_CONTEXT:()=>Cde,RESPONSE_INIT:()=>Sde,Renderer2:()=>Qn,RendererFactory2:()=>Nu,RendererStyleFlags2:()=>Ii,ResourceStatus:()=>Pn,Sanitizer:()=>kx,SecurityContext:()=>vn,Self:()=>$n,SimpleChange:()=>cx,SkipSelf:()=>La,TRANSLATIONS:()=>uue,TRANSLATIONS_FORMAT:()=>due,TemplateRef:()=>xr,Testability:()=>Fu,TestabilityRegistry:()=>Lu,TransferState:()=>Ra,Type:()=>NV,VERSION:()=>oue,Version:()=>Wo,ViewChild:()=>Ua,ViewChildren:()=>dae,ViewContainerRef:()=>Kn,ViewEncapsulation:()=>ps,ViewRef:()=>zx,afterNextRender:()=>m2,afterRender:()=>h2,afterRenderEffect:()=>_4,asNativeElements:()=>Tue,assertInInjectionContext:()=>$u,assertNotInReactiveContext:()=>tre,assertPlatform:()=>u4,booleanAttribute:()=>ei,computed:()=>Xi,contentChild:()=>iae,contentChildren:()=>oae,createComponent:()=>bde,createEnvironmentInjector:()=>uA,createNgModule:()=>FS,createNgModuleRef:()=>wae,createPlatform:()=>l4,createPlatformFactory:()=>QS,defineInjectable:()=>Gee,destroyPlatform:()=>vue,effect:()=>TM,enableProdMode:()=>Eue,forwardRef:()=>cn,getDebugNode:()=>ky,getModuleFactory:()=>xue,getNgModuleById:()=>Sue,getPlatform:()=>tb,importProvidersFrom:()=>_V,inject:()=>ye,input:()=>xne,isDevMode:()=>wue,isSignal:()=>I$,isStandalone:()=>ix,linkedSignal:()=>bk,makeEnvironmentProviders:()=>Ba,makeStateKey:()=>Kne,mergeApplicationConfig:()=>Ede,model:()=>lae,numberAttribute:()=>gh,output:()=>wne,platformCore:()=>xM,provideAppInitializer:()=>Xae,provideEnvironmentInitializer:()=>lte,provideExperimentalCheckNoChangesForDebug:()=>bue,provideExperimentalZonelessChangeDetection:()=>lue,providePlatformInitializer:()=>yue,provideZoneChangeDetection:()=>aue,reflectComponentType:()=>wde,resolveForwardRef:()=>nn,resource:()=>D4,runInInjectionContext:()=>Pk,setTestabilityGetter:()=>h5,signal:()=>Di,untracked:()=>Un,viewChild:()=>nae,viewChildren:()=>rae,\u0275AfterRenderManager:()=>Nf,\u0275CLIENT_RENDER_MODE_FLAG:()=>Jue,\u0275CONTAINER_HEADER_OFFSET:()=>qn,\u0275ChangeDetectionScheduler:()=>Ti,\u0275ChangeDetectionSchedulerImpl:()=>jf,\u0275ComponentFactory:()=>nA,\u0275Console:()=>Ox,\u0275DEFAULT_LOCALE_ID:()=>Ty,\u0275DEFER_BLOCK_CONFIG:()=>u5,\u0275DEFER_BLOCK_DEPENDENCY_INTERCEPTOR:()=>Uae,\u0275DEHYDRATED_BLOCK_REGISTRY:()=>Ha,\u0275DeferBlockBehavior:()=>xx,\u0275DeferBlockState:()=>Rn,\u0275ENABLE_ROOT_COMPONENT_BOOTSTRAP:()=>o4,\u0275EffectScheduler:()=>xy,\u0275HydrationStatus:()=>a1,\u0275IMAGE_CONFIG:()=>bS,\u0275IMAGE_CONFIG_DEFAULTS:()=>yS,\u0275INJECTOR_SCOPE:()=>Fy,\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE:()=>jee,\u0275INTERNAL_APPLICATION_ERROR_HANDLER:()=>T$,\u0275IS_HYDRATION_DOM_REUSE_ENABLED:()=>xu,\u0275IS_INCREMENTAL_HYDRATION_ENABLED:()=>f2,\u0275JSACTION_BLOCK_ELEMENT_MAP:()=>fy,\u0275JSACTION_EVENT_CONTRACT:()=>y2,\u0275LContext:()=>yx,\u0275LocaleDataIndex:()=>Sn,\u0275MicrotaskEffectScheduler:()=>Kx,\u0275NG_COMP_DEF:()=>qf,\u0275NG_DIR_DEF:()=>oS,\u0275NG_ELEMENT_ID:()=>bf,\u0275NG_INJ_DEF:()=>ex,\u0275NG_MOD_DEF:()=>Dk,\u0275NG_PIPE_DEF:()=>aS,\u0275NG_PROV_DEF:()=>ry,\u0275NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR:()=>YE,\u0275NO_CHANGE:()=>xt,\u0275NgModuleFactory:()=>Vf,\u0275NoopNgZone:()=>Mf,\u0275PERFORMANCE_MARK_PREFIX:()=>S4,\u0275PROVIDED_NG_ZONE:()=>i4,\u0275PendingTasksInternal:()=>Uo,\u0275R3Injector:()=>_f,\u0275ReflectionCapabilities:()=>ox,\u0275Render3ComponentFactory:()=>Yl,\u0275Render3ComponentRef:()=>Mx,\u0275Render3NgModuleRef:()=>Bf,\u0275ResourceImpl:()=>Jx,\u0275RuntimeError:()=>Pe,\u0275SIGNAL:()=>sr,\u0275SSR_CONTENT_INTEGRITY_MARKER:()=>r8,\u0275TESTABILITY:()=>VS,\u0275TESTABILITY_GETTER:()=>ih,\u0275TimerScheduler:()=>Lx,\u0275TracingAction:()=>hy,\u0275TracingService:()=>ro,\u0275USE_RUNTIME_DEPS_TRACKER_FOR_JIT:()=>Coe,\u0275ViewRef:()=>Rf,\u0275XSS_SECURITY_URL:()=>Sk,\u0275ZONELESS_ENABLED:()=>Zf,\u0275_sanitizeHtml:()=>xS,\u0275_sanitizeUrl:()=>Jf,\u0275allowSanitizationBypassAndThrow:()=>Ai,\u0275annotateForHydration:()=>Hue,\u0275bypassSanitizationTrustHtml:()=>T2,\u0275bypassSanitizationTrustResourceUrl:()=>k2,\u0275bypassSanitizationTrustScript:()=>I2,\u0275bypassSanitizationTrustStyle:()=>D2,\u0275bypassSanitizationTrustUrl:()=>_2,\u0275clearResolutionOfComponentResourcesQueue:()=>GH,\u0275compileComponent:()=>Gj,\u0275compileDirective:()=>bM,\u0275compileNgModule:()=>Wj,\u0275compileNgModuleDefs:()=>zj,\u0275compileNgModuleFactory:()=>s4,\u0275compilePipe:()=>n4,\u0275convertToBitFlags:()=>Ny,\u0275createInjector:()=>X_,\u0275createOrReusePlatformInjector:()=>d4,\u0275defaultIterableDiffers:()=>Nue,\u0275defaultKeyValueDiffers:()=>Pue,\u0275depsTracker:()=>Lf,\u0275detectChangesInViewIfRequired:()=>y5,\u0275devModeEqual:()=>o5,\u0275disableProfiling:()=>rde,\u0275enableProfiling:()=>nde,\u0275findLocaleData:()=>Gr,\u0275flushModuleScopingQueueAsMuchAsPossible:()=>Uj,\u0275formatRuntimeError:()=>Go,\u0275generateStandaloneInDeclarationsError:()=>Wce,\u0275getAsyncClassMetadataFn:()=>Gae,\u0275getClosestComponentName:()=>hde,\u0275getComponentDef:()=>Bn,\u0275getDebugNode:()=>ky,\u0275getDeferBlocks:()=>q1,\u0275getDirectives:()=>jne,\u0275getDocument:()=>qo,\u0275getHostElement:()=>qne,\u0275getInjectableDef:()=>My,\u0275getLContext:()=>Ms,\u0275getLocaleCurrencyCode:()=>E3,\u0275getLocalePluralCase:()=>zS,\u0275getOutputDestroyRef:()=>bne,\u0275getSanitizationBypassType:()=>g8,\u0275getUnknownElementStrictMode:()=>Wre,\u0275getUnknownPropertyStrictMode:()=>Gre,\u0275global:()=>or,\u0275injectChangeDetectorRef:()=>h4,\u0275internalCreateApplication:()=>SM,\u0275internalProvideZoneChangeDetection:()=>YS,\u0275isBoundToModule:()=>g5,\u0275isComponentDefPendingResolution:()=>fae,\u0275isEnvironmentProviders:()=>Tk,\u0275isInjectable:()=>Zee,\u0275isNgModule:()=>ou,\u0275isPromise:()=>Wu,\u0275isSubscribable:()=>$S,\u0275isViewDirty:()=>gie,\u0275markForRefresh:()=>vie,\u0275microtaskEffect:()=>ide,\u0275noSideEffects:()=>Zo,\u0275patchComponentDefWithScope:()=>vM,\u0275performanceMarkFeature:()=>rs,\u0275publishExternalGlobalUtil:()=>Zae,\u0275readHydrationInfo:()=>_re,\u0275registerLocaleData:()=>w3,\u0275renderDeferBlockState:()=>Aa,\u0275resetCompiledComponents:()=>Zce,\u0275resetJitOptions:()=>Uce,\u0275resolveComponentResources:()=>WH,\u0275restoreComponentResolutionQueue:()=>hae,\u0275setAllowDuplicateNgModuleIdsForTest:()=>bae,\u0275setAlternateWeakRefImpl:()=>BI,\u0275setClassDebugInfo:()=>$j,\u0275setClassMetadata:()=>mA,\u0275setClassMetadataAsync:()=>f5,\u0275setCurrentInjector:()=>Ro,\u0275setDocument:()=>a2,\u0275setInjectorProfilerContext:()=>Qee,\u0275setLocaleId:()=>T3,\u0275setUnknownElementStrictMode:()=>qre,\u0275setUnknownPropertyStrictMode:()=>zre,\u0275startMeasuring:()=>ede,\u0275stopMeasuring:()=>tde,\u0275store:()=>uS,\u0275stringify:()=>Ur,\u0275transitiveScopesFor:()=>yM,\u0275triggerResourceLoading:()=>HS,\u0275truncateMiddle:()=>qee,\u0275unregisterLocaleData:()=>$le,\u0275unwrapSafeValue:()=>zr,\u0275unwrapWritableSignal:()=>Cne,\u0275withDomHydration:()=>w4,\u0275withEventReplay:()=>CM,\u0275withI18nSupport:()=>E4,\u0275withIncrementalHydration:()=>x4,\u0275\u0275CopyDefinitionFeature:()=>r5,\u0275\u0275ExternalStylesFeature:()=>hj,\u0275\u0275FactoryTarget:()=>Se,\u0275\u0275HostDirectivesFeature:()=>s5,\u0275\u0275InheritDefinitionFeature:()=>pA,\u0275\u0275NgOnChangesFeature:()=>LV,\u0275\u0275ProvidersFeature:()=>fj,\u0275\u0275advance:()=>F8,\u0275\u0275attachSourceLocations:()=>dj,\u0275\u0275attribute:()=>yA,\u0275\u0275attributeInterpolate1:()=>bA,\u0275\u0275attributeInterpolate2:()=>wA,\u0275\u0275attributeInterpolate3:()=>EA,\u0275\u0275attributeInterpolate4:()=>xA,\u0275\u0275attributeInterpolate5:()=>SA,\u0275\u0275attributeInterpolate6:()=>CA,\u0275\u0275attributeInterpolate7:()=>TA,\u0275\u0275attributeInterpolate8:()=>DA,\u0275\u0275attributeInterpolateV:()=>IA,\u0275\u0275classMap:()=>X5,\u0275\u0275classMapInterpolate1:()=>n3,\u0275\u0275classMapInterpolate2:()=>r3,\u0275\u0275classMapInterpolate3:()=>s3,\u0275\u0275classMapInterpolate4:()=>i3,\u0275\u0275classMapInterpolate5:()=>o3,\u0275\u0275classMapInterpolate6:()=>a3,\u0275\u0275classMapInterpolate7:()=>l3,\u0275\u0275classMapInterpolate8:()=>c3,\u0275\u0275classMapInterpolateV:()=>u3,\u0275\u0275classProp:()=>AA,\u0275\u0275componentInstance:()=>d3,\u0275\u0275conditional:()=>p3,\u0275\u0275contentQuery:()=>j3,\u0275\u0275contentQuerySignal:()=>z3,\u0275\u0275declareLet:()=>gM,\u0275\u0275defer:()=>S5,\u0275\u0275deferEnableTimerScheduling:()=>p5,\u0275\u0275deferHydrateNever:()=>I5,\u0275\u0275deferHydrateOnHover:()=>V5,\u0275\u0275deferHydrateOnIdle:()=>A5,\u0275\u0275deferHydrateOnImmediate:()=>P5,\u0275\u0275deferHydrateOnInteraction:()=>j5,\u0275\u0275deferHydrateOnTimer:()=>L5,\u0275\u0275deferHydrateOnViewport:()=>W5,\u0275\u0275deferHydrateWhen:()=>D5,\u0275\u0275deferOnHover:()=>O5,\u0275\u0275deferOnIdle:()=>_5,\u0275\u0275deferOnImmediate:()=>M5,\u0275\u0275deferOnInteraction:()=>$5,\u0275\u0275deferOnTimer:()=>R5,\u0275\u0275deferOnViewport:()=>U5,\u0275\u0275deferPrefetchOnHover:()=>B5,\u0275\u0275deferPrefetchOnIdle:()=>k5,\u0275\u0275deferPrefetchOnImmediate:()=>N5,\u0275\u0275deferPrefetchOnInteraction:()=>H5,\u0275\u0275deferPrefetchOnTimer:()=>F5,\u0275\u0275deferPrefetchOnViewport:()=>q5,\u0275\u0275deferPrefetchWhen:()=>T5,\u0275\u0275deferWhen:()=>C5,\u0275\u0275defineComponent:()=>QH,\u0275\u0275defineDirective:()=>KH,\u0275\u0275defineInjectable:()=>rn,\u0275\u0275defineInjector:()=>iS,\u0275\u0275defineNgModule:()=>dA,\u0275\u0275definePipe:()=>JH,\u0275\u0275directiveInject:()=>rh,\u0275\u0275disableBindings:()=>UV,\u0275\u0275element:()=>MA,\u0275\u0275elementContainer:()=>NA,\u0275\u0275elementContainerEnd:()=>WS,\u0275\u0275elementContainerStart:()=>qS,\u0275\u0275elementEnd:()=>US,\u0275\u0275elementStart:()=>jS,\u0275\u0275enableBindings:()=>jV,\u0275\u0275getComponentDepsFactory:()=>Vj,\u0275\u0275getCurrentView:()=>b3,\u0275\u0275getInheritedFactory:()=>g$,\u0275\u0275getReplaceMetadataURL:()=>Hj,\u0275\u0275hostProperty:()=>PA,\u0275\u0275i18n:()=>F3,\u0275\u0275i18nApply:()=>O3,\u0275\u0275i18nAttributes:()=>L3,\u0275\u0275i18nEnd:()=>LA,\u0275\u0275i18nExp:()=>OA,\u0275\u0275i18nPostprocess:()=>B3,\u0275\u0275i18nStart:()=>FA,\u0275\u0275inject:()=>Mr,\u0275\u0275injectAttribute:()=>fS,\u0275\u0275invalidFactory:()=>CH,\u0275\u0275invalidFactoryDep:()=>_k,\u0275\u0275listener:()=>BA,\u0275\u0275loadQuery:()=>W3,\u0275\u0275namespaceHTML:()=>s$,\u0275\u0275namespaceMathML:()=>r$,\u0275\u0275namespaceSVG:()=>n$,\u0275\u0275nextContext:()=>V3,\u0275\u0275ngDeclareClassMetadata:()=>De,\u0275\u0275ngDeclareClassMetadataAsync:()=>mde,\u0275\u0275ngDeclareComponent:()=>gde,\u0275\u0275ngDeclareDirective:()=>vt,\u0275\u0275ngDeclareFactory:()=>Ie,\u0275\u0275ngDeclareInjectable:()=>Kt,\u0275\u0275ngDeclareInjector:()=>lo,\u0275\u0275ngDeclareNgModule:()=>co,\u0275\u0275ngDeclarePipe:()=>vs,\u0275\u0275pipe:()=>Nj,\u0275\u0275pipeBind1:()=>Pj,\u0275\u0275pipeBind2:()=>Rj,\u0275\u0275pipeBind3:()=>Fj,\u0275\u0275pipeBind4:()=>Lj,\u0275\u0275pipeBindV:()=>Oj,\u0275\u0275projection:()=>H3,\u0275\u0275projectionDef:()=>$3,\u0275\u0275property:()=>_A,\u0275\u0275propertyInterpolate:()=>HA,\u0275\u0275propertyInterpolate1:()=>GS,\u0275\u0275propertyInterpolate2:()=>jA,\u0275\u0275propertyInterpolate3:()=>UA,\u0275\u0275propertyInterpolate4:()=>qA,\u0275\u0275propertyInterpolate5:()=>WA,\u0275\u0275propertyInterpolate6:()=>zA,\u0275\u0275propertyInterpolate7:()=>GA,\u0275\u0275propertyInterpolate8:()=>ZA,\u0275\u0275propertyInterpolateV:()=>YA,\u0275\u0275pureFunction0:()=>vj,\u0275\u0275pureFunction1:()=>yj,\u0275\u0275pureFunction2:()=>bj,\u0275\u0275pureFunction3:()=>wj,\u0275\u0275pureFunction4:()=>Ej,\u0275\u0275pureFunction5:()=>xj,\u0275\u0275pureFunction6:()=>Sj,\u0275\u0275pureFunction7:()=>Cj,\u0275\u0275pureFunction8:()=>Tj,\u0275\u0275pureFunctionV:()=>Dj,\u0275\u0275queryAdvance:()=>Z3,\u0275\u0275queryRefresh:()=>q3,\u0275\u0275readContextLet:()=>uj,\u0275\u0275reference:()=>Y3,\u0275\u0275registerNgModuleType:()=>cA,\u0275\u0275repeater:()=>g3,\u0275\u0275repeaterCreate:()=>m3,\u0275\u0275repeaterTrackByIdentity:()=>h3,\u0275\u0275repeaterTrackByIndex:()=>f3,\u0275\u0275replaceMetadata:()=>jj,\u0275\u0275resetView:()=>WV,\u0275\u0275resolveBody:()=>O2,\u0275\u0275resolveDocument:()=>M8,\u0275\u0275resolveWindow:()=>A8,\u0275\u0275restoreView:()=>qV,\u0275\u0275sanitizeHtml:()=>N2,\u0275\u0275sanitizeResourceUrl:()=>CS,\u0275\u0275sanitizeScript:()=>F2,\u0275\u0275sanitizeStyle:()=>P2,\u0275\u0275sanitizeUrl:()=>R2,\u0275\u0275sanitizeUrlOrResourceUrl:()=>k8,\u0275\u0275setComponentScope:()=>mj,\u0275\u0275setNgModuleScope:()=>gj,\u0275\u0275storeLet:()=>cj,\u0275\u0275styleMap:()=>so,\u0275\u0275styleMapInterpolate1:()=>X3,\u0275\u0275styleMapInterpolate2:()=>Q3,\u0275\u0275styleMapInterpolate3:()=>K3,\u0275\u0275styleMapInterpolate4:()=>J3,\u0275\u0275styleMapInterpolate5:()=>ej,\u0275\u0275styleMapInterpolate6:()=>tj,\u0275\u0275styleMapInterpolate7:()=>nj,\u0275\u0275styleMapInterpolate8:()=>rj,\u0275\u0275styleMapInterpolateV:()=>sj,\u0275\u0275styleProp:()=>kA,\u0275\u0275stylePropInterpolate1:()=>XA,\u0275\u0275stylePropInterpolate2:()=>QA,\u0275\u0275stylePropInterpolate3:()=>KA,\u0275\u0275stylePropInterpolate4:()=>JA,\u0275\u0275stylePropInterpolate5:()=>eM,\u0275\u0275stylePropInterpolate6:()=>tM,\u0275\u0275stylePropInterpolate7:()=>nM,\u0275\u0275stylePropInterpolate8:()=>rM,\u0275\u0275stylePropInterpolateV:()=>sM,\u0275\u0275syntheticHostListener:()=>VA,\u0275\u0275syntheticHostProperty:()=>RA,\u0275\u0275template:()=>hA,\u0275\u0275templateRefExtractor:()=>Bj,\u0275\u0275text:()=>ij,\u0275\u0275textInterpolate:()=>iM,\u0275\u0275textInterpolate1:()=>ZS,\u0275\u0275textInterpolate2:()=>oM,\u0275\u0275textInterpolate3:()=>aM,\u0275\u0275textInterpolate4:()=>lM,\u0275\u0275textInterpolate5:()=>cM,\u0275\u0275textInterpolate6:()=>uM,\u0275\u0275textInterpolate7:()=>dM,\u0275\u0275textInterpolate8:()=>pM,\u0275\u0275textInterpolateV:()=>fM,\u0275\u0275trustConstantHtml:()=>I8,\u0275\u0275trustConstantResourceUrl:()=>_8,\u0275\u0275twoWayBindingSet:()=>aj,\u0275\u0275twoWayListener:()=>mM,\u0275\u0275twoWayProperty:()=>hM,\u0275\u0275validateAttribute:()=>L2,\u0275\u0275viewQuery:()=>U3,\u0275\u0275viewQuerySignal:()=>G3});function Zw(n,e){return Object.is(n,e)}var br=null,Cv=!1,AI=1,sr=Symbol("SIGNAL");function gt(n){let e=br;return br=n,e}function Yw(){return br}function LL(){return Cv}var Da={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function kl(n){if(Cv)throw new Error("");if(br===null)return;br.consumerOnSignalRead(n);let e=br.nextProducerIndex++;if(Qw(br),en.nextProducerIndex;)n.producerNode.pop(),n.producerLastReadVersion.pop(),n.producerIndexOfThis.pop()}}function Xc(n){Qw(n);for(let e=0;e0}function Qw(n){n.producerNode??(n.producerNode=[]),n.producerIndexOfThis??(n.producerIndexOfThis=[]),n.producerLastReadVersion??(n.producerLastReadVersion=[])}function VL(n){n.liveConsumerNode??(n.liveConsumerNode=[]),n.liveConsumerIndexOfThis??(n.liveConsumerIndexOfThis=[])}function $L(n){return n.producerNode!==void 0}function Kw(n,e){let t=Object.create(NJ);t.computation=n,e!==void 0&&(t.equal=e);let r=()=>{if(Kp(t),kl(t),t.value===_l)throw t.error;return t.value};return r[sr]=t,r}var Yc=Symbol("UNSET"),Qp=Symbol("COMPUTING"),_l=Symbol("ERRORED"),NJ={...Da,value:Yc,dirty:!0,error:null,equal:Zw,kind:"computed",producerMustRecompute(n){return n.value===Yc||n.value===Qp},producerRecomputeValue(n){if(n.value===Qp)throw new Error("Detected cycle in computations.");let e=n.value;n.value=Qp;let t=Ia(n),r,s=!1;try{r=n.computation(),gt(null),s=e!==Yc&&e!==_l&&r!==_l&&n.equal(e,r)}catch(i){r=_l,n.error=i}finally{Al(n,t)}if(s){n.value=e;return}n.value=r,n.version++}};function PJ(){throw new Error}var HL=PJ;function jL(n){HL(n)}function RI(n){HL=n}var RJ=null;function FI(n,e){let t=Object.create(Iv);t.value=n,e!==void 0&&(t.equal=e);let r=()=>(kl(t),t.value);return r[sr]=t,r}function Kc(n,e){NI()||jL(n),n.equal(n.value,e)||(n.value=e,FJ(n))}function Jw(n,e){NI()||jL(n),Kc(n,e(n.value))}var Iv={...Da,equal:Zw,value:void 0,kind:"signal"};function FJ(n){n.version++,OL(),MI(n),RJ?.()}function eE(n,e,t){let r=Object.create(LJ);r.source=n,r.computation=e,t!=null&&(r.equal=t);let i=()=>{if(Kp(r),kl(r),r.value===_l)throw r.error;return r.value};return i[sr]=r,i}function LI(n,e){Kp(n),Kc(n,e),Tv(n)}function OI(n,e){Kp(n),Jw(n,e),Tv(n)}var LJ={...Da,value:Yc,dirty:!0,error:null,equal:Zw,kind:"linkedSignal",producerMustRecompute(n){return n.value===Yc||n.value===Qp},producerRecomputeValue(n){if(n.value===Qp)throw new Error("Detected cycle in computations.");let e=n.value;n.value=Qp;let t=Ia(n),r;try{let s=n.source(),i=e===Yc||e===_l?void 0:{source:n.sourceValue,value:e};r=n.computation(s,i),n.sourceValue=s}catch(s){r=_l,n.error=s}finally{Al(n,t)}if(e!==Yc&&r!==_l&&n.equal(e,r)){n.value=e;return}n.value=r,n.version++}};function BI(n){}function VI(n){let e=gt(null);try{return n()}finally{gt(e)}}var $I;function _v(){return $I}function Ro(n){let e=$I;return $I=n,e}var tE=Symbol("NotFound");function UL(n,e,t){let r=Object.create(OJ);t&&(r.consumerAllowSignalWrites=!0),r.fn=n,r.schedule=e;let s=c=>{r.cleanupFn=c};function i(c){return c.fn===null&&c.schedule===null}function o(c){i(c)||(Qc(c),c.cleanupFn(),c.fn=null,c.schedule=null,c.cleanupFn=HI)}let a=()=>{if(r.fn===null)return;if(LL())throw new Error("Schedulers cannot synchronously execute watches while scheduling.");if(r.dirty=!1,r.hasRun&&!Xc(r))return;r.hasRun=!0;let c=Ia(r);try{r.cleanupFn(),r.cleanupFn=HI,r.fn(s)}finally{Al(r,c)}};return r.ref={notify:()=>PI(r),run:a,cleanup:()=>r.cleanupFn(),destroy:()=>o(r),[sr]:r},r.ref}var HI=()=>{},OJ={...Da,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!1,consumerMarkedDirty:n=>{n.schedule!==null&&n.schedule(n.ref)},hasRun:!1,cleanupFn:HI};var jI=function(n,e){return jI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])},jI(n,e)};function Fo(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");jI(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function qL(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(p){o(p)}}function c(d){try{u(r.throw(d))}catch(p){o(p)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(n,e||[])).next())})}function nE(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(r=1,s&&(i=u[0]&2?s.return:u[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,u[1])).done)return i;switch(s=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ml(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return i}function Nl(n,e,t){if(t||arguments.length===2)for(var r=0,s=e.length,i;r1||c(h,g)})},m&&(s[h]=m(s[h])))}function c(h,m){try{u(r[h](m))}catch(g){f(i[0][3],g)}}function u(h){h.value instanceof Jc?Promise.resolve(h.value.v).then(d,p):f(i[0][2],h)}function d(h){c("next",h)}function p(h){c("throw",h)}function f(h,m){h(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function zL(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof _a=="function"?_a(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(i){t[i]=n[i]&&function(o){return new Promise(function(a,c){o=n[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}function gn(n){return typeof n=="function"}function rE(n){var e=function(r){Error.call(r),r.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var sE=rE(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription: +`+t.map(function(r,s){return s+1+") "+r.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=t}});function kv(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var zi=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,r,s,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=_a(o),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(g){e={error:g}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var d=this.initialTeardown;if(gn(d))try{d()}catch(g){i=g instanceof sE?g.errors:[g]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var f=_a(p),h=f.next();!h.done;h=f.next()){var m=h.value;try{GL(m)}catch(g){i=i??[],g instanceof sE?i=Nl(Nl([],Ml(i)),Ml(g.errors)):i.push(g)}}}catch(g){r={error:g}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(r)throw r.error}}}if(i)throw new sE(i)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)GL(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&kv(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&kv(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}();var UI=zi.EMPTY;function iE(n){return n instanceof zi||n&&"closed"in n&&gn(n.remove)&&gn(n.add)&&gn(n.unsubscribe)}function GL(n){gn(n)?n():n.unsubscribe()}var Gi={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Jp={setTimeout:function(n,e){for(var t=[],r=2;r0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var r=this,s=this,i=s.hasError,o=s.isStopped,a=s.observers;return i||o?UI:(this.currentObservers=null,a.push(t),new zi(function(){r.currentObservers=null,kv(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var r=this,s=r.hasError,i=r.thrownError,o=r.isStopped;s?t.error(i):o&&t.complete()},e.prototype.asObservable=function(){var t=new Ar;return t.source=this,t},e.create=function(t,r){return new nO(t,r)},e}(Ar);var nO=function(n){Fo(e,n);function e(t,r){var s=n.call(this)||this;return s.destination=t,s.source=r,s}return e.prototype.next=function(t){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.next)===null||s===void 0||s.call(r,t)},e.prototype.error=function(t){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.error)===null||s===void 0||s.call(r,t)},e.prototype.complete=function(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)},e.prototype._subscribe=function(t){var r,s;return(s=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&s!==void 0?s:UI},e}(_s);var ZI=function(n){Fo(e,n);function e(t){var r=n.call(this)||this;return r._value=t,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var r=n.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},e.prototype.getValue=function(){var t=this,r=t.hasError,s=t.thrownError,i=t._value;if(r)throw s;return this._throwIfClosed(),i},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e}(_s);function zJ(n){return n[n.length-1]}function rO(n){return gn(zJ(n))?n.pop():void 0}var cE=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function uE(n){return gn(n?.then)}function dE(n){return gn(n[tf])}function pE(n){return Symbol.asyncIterator&&gn(n?.[Symbol.asyncIterator])}function fE(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function GJ(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var hE=GJ();function mE(n){return gn(n?.[hE])}function gE(n){return WL(this,arguments,function(){var t,r,s,i;return nE(this,function(o){switch(o.label){case 0:t=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Jc(t.read())];case 3:return r=o.sent(),s=r.value,i=r.done,i?[4,Jc(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Jc(s)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function vE(n){return gn(n?.getReader)}function Pl(n){if(n instanceof Ar)return n;if(n!=null){if(dE(n))return ZJ(n);if(cE(n))return YJ(n);if(uE(n))return XJ(n);if(pE(n))return sO(n);if(mE(n))return QJ(n);if(vE(n))return KJ(n)}throw fE(n)}function ZJ(n){return new Ar(function(e){var t=n[tf]();if(gn(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function YJ(n){return new Ar(function(e){for(var t=0;tyO.indexOf(n)>=0,pee=dee.concat(yO),bO=n=>pee.indexOf(n)>=0;function fee(n){return n===it.MOUSEENTER?it.MOUSEOVER:n===it.MOUSELEAVE?it.MOUSEOUT:n===it.POINTERENTER?it.POINTEROVER:n===it.POINTERLEAVE?it.POINTEROUT:n}function hee(n,e,t,r){let s=!1;_E(e)&&(s=!0);let i=typeof r=="boolean"?{capture:s,passive:r}:s;return n.addEventListener(e,t,i),{eventType:e,handler:t,capture:s,passive:r}}function mee(n,e){if(n.removeEventListener){let t=typeof e.passive=="boolean"?{capture:e.capture}:e.capture;n.removeEventListener(e.eventType,e.handler,t)}else n.detachEvent&&n.detachEvent(`on${e.eventType}`,e.handler)}function gee(n){n.preventDefault?n.preventDefault():n.returnValue=!1}var mO=typeof navigator<"u"&&/Macintosh/.test(navigator.userAgent);function vee(n){return n.which===2||n.which==null&&n.button===4}function yee(n){return mO&&n.metaKey||!mO&&n.ctrlKey||vee(n)||n.shiftKey}function bee(n,e,t){let r=n.relatedTarget;return(n.type===it.MOUSEOVER&&e===it.MOUSEENTER||n.type===it.MOUSEOUT&&e===it.MOUSELEAVE||n.type===it.POINTEROVER&&e===it.POINTERENTER||n.type===it.POINTEROUT&&e===it.POINTERLEAVE)&&(!r||r!==t&&!t.contains(r))}function wee(n,e){let t={};for(let r in n){if(r==="srcElement"||r==="target")continue;let s=r,i=n[s];typeof i!="function"&&(t[s]=i)}return n.type===it.MOUSEOVER?t.type=it.MOUSEENTER:n.type===it.MOUSEOUT?t.type=it.MOUSELEAVE:n.type===it.POINTEROVER?t.type=it.POINTERENTER:t.type=it.POINTERLEAVE,t.target=t.srcElement=e,t.bubbles=!1,t._originalEvent=n,t}var Eee=typeof navigator<"u"&&/iPhone|iPad|iPod/.test(navigator.userAgent),CE=class{constructor(e){l(this,"element");l(this,"handlerInfos",[]);this.element=e}addEventListener(e,t,r){Eee&&(this.element.style.cursor="pointer"),this.handlerInfos.push(hee(this.element,e,t(this.element),r))}cleanUp(){for(let e=0;e{this.eventReplayScheduled=!1,this.eventReplayer(this.replayEventInfoWrappers)}))}};function Mee(n,e){return n.tagName==="A"&&(e.getEventType()===it.CLICK||e.getEventType()===it.CLICKMOD)}var kO=Symbol.for("propagationStopped"),s_={REPLAY:101};var Nee="`preventDefault` called during event replay.";var Pee="`composedPath` called during event replay.",TE=class{constructor(e,t=!0){l(this,"dispatchDelegate");l(this,"clickModSupport");l(this,"actionResolver");l(this,"dispatcher");this.dispatchDelegate=e,this.clickModSupport=t,this.actionResolver=new JI({clickModSupport:t}),this.dispatcher=new t_(r=>{this.dispatchToDelegate(r)},{actionResolver:this.actionResolver})}dispatch(e){this.dispatcher.dispatch(e)}dispatchToDelegate(e){for(e.getIsReplay()&&Lee(e),Ree(e);e.getAction();){if(Oee(e),_E(e.getEventType())&&e.getAction().element!==e.getTargetElement()||(this.dispatchDelegate(e.getEvent(),e.getAction().name),Fee(e)))return;this.actionResolver.resolveParentAction(e.eventInfo)}}};function Ree(n){let e=n.getEvent(),t=n.getEvent().stopPropagation.bind(e),r=()=>{e[kO]=!0,t()};nu(e,"stopPropagation",r),nu(e,"stopImmediatePropagation",r)}function Fee(n){return!!n.getEvent()[kO]}function Lee(n){let e=n.getEvent(),t=n.getTargetElement(),r=e.preventDefault.bind(e);nu(e,"target",t),nu(e,"eventPhase",s_.REPLAY),nu(e,"preventDefault",()=>{throw r(),new Error(Nee+"")}),nu(e,"composedPath",()=>{throw new Error(Pee+"")})}function Oee(n){let e=n.getEvent(),t=n.getAction()?.element;t&&nu(e,"currentTarget",t,{configurable:!0})}function nu(n,e,t,{configurable:r=!1}={}){Object.defineProperty(n,e,{value:t,configurable:r})}function AO(n,e){n.ecrd(t=>{e.dispatch(t)},e_.I_AM_THE_JSACTION_FRAMEWORK)}function Bee(n){return n?.q??[]}function Vee(n){n&&(gO(n.c,n.et,n.h),gO(n.c,n.etc,n.h,!0))}function gO(n,e,t,r){for(let s=0;s=0)return;let s=(o,a,c)=>{this.handleEvent(o,a,c)};this.eventHandlers[e]=s;let i=fee(t||e);if(i!==e){let o=this.browserEventTypeToExtraEventTypes[i]||[];o.push(e),this.browserEventTypeToExtraEventTypes[i]=o}this.containerManager.addEventListener(i,o=>a=>{s(e,a,o)},r)}replayEarlyEvents(e=window._ejsa){e&&(this.replayEarlyEventInfos(e.q),Vee(e),delete window._ejsa)}replayEarlyEventInfos(e){for(let t=0;t{let i=Ck(e);function o(...a){if(this instanceof o)return i.call(this,...a),this;let c=new o(...a);return function(d){return s&&s(d,...a),(d.hasOwnProperty(lf)?d[lf]:Object.defineProperty(d,lf,{value:[]})[lf]).push(c),d}}return t&&(o.prototype=Object.create(t.prototype)),o.prototype.ngMetadataName=n,o.annotationCls=o,o})}function Ck(n){return function(...t){if(n){let r=n(...t);for(let s in r)this[s]=r[s]}}}function Uf(n,e,t){return Zo(()=>{let r=Ck(e);function s(...i){if(this instanceof s)return r.apply(this,i),this;let o=new s(...i);return a.annotation=o,a;function a(c,u,d){let p=c.hasOwnProperty(cf)?c[cf]:Object.defineProperty(c,cf,{value:[]})[cf];for(;p.length<=d;)p.push(null);return(p[d]=p[d]||[]).push(o),c}}return s.prototype.ngMetadataName=n,s.annotationCls=s,s})}function Kl(n,e,t,r){return Zo(()=>{let s=Ck(e);function i(...o){if(this instanceof i)return s.apply(this,o),this;let a=new i(...o);function c(u,d){if(u===void 0)throw new Error("Standard Angular field decorators are not supported in JIT mode.");let p=u.constructor,f=p.hasOwnProperty(uf)?p[uf]:Object.defineProperty(p,uf,{value:{}})[uf];f[d]=f.hasOwnProperty(d)&&f[d]||[],f[d].unshift(a)}return c}return t&&(i.prototype=Object.create(t.prototype)),i.prototype.ngMetadataName=n,i.annotationCls=i,i})}var or=globalThis;function xn(n){for(let e in n)if(n[e]===xn)return e;throw Error("Could not find renamed property on target object.")}function Uee(n,e){for(let t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function Ur(n){if(typeof n=="string")return n;if(Array.isArray(n))return`[${n.map(Ur).join(", ")}]`;if(n==null)return""+n;let e=n.overriddenName||n.name;if(e)return`${e}`;let t=n.toString();if(t==null)return""+t;let r=t.indexOf(` +`);return r>=0?t.slice(0,r):t}function O_(n,e){return n?e?`${n} ${e}`:n:e||""}function qee(n,e=100){if(!n||e<1||n.length<=e)return n;if(e==1)return n.substring(0,1)+"...";let t=Math.round(e/2);return n.substring(0,t)+"..."+n.substring(n.length-t)}var Wee=xn({__forward_ref__:xn});function cn(n){return n.__forward_ref__=cn,n.toString=function(){return Ur(this())},n}function nn(n){return sS(n)?n():n}function sS(n){return typeof n=="function"&&n.hasOwnProperty(Wee)&&n.__forward_ref__===cn}function zee(n,e,t){n!=e&&wV(t,n,e,"==")}function wV(n,e,t,r){throw new Error(`ASSERTION ERROR: ${n}`+(r==null?"":` [Expected=> ${t} ${r} ${e} <=Actual]`))}function rn(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}var Gee=rn;function iS(n){return{providers:n.providers||[],imports:n.imports||[]}}function My(n){return NO(n,ry)||NO(n,EV)}function Zee(n){return My(n)!==null}function NO(n,e){return n.hasOwnProperty(e)?n[e]:null}function Yee(n){let e=n&&(n[ry]||n[EV]);return e||null}function PO(n){return n&&(n.hasOwnProperty(ex)||n.hasOwnProperty(Xee))?n[ex]:null}var ry=xn({\u0275prov:xn}),ex=xn({\u0275inj:xn}),EV=xn({ngInjectableDef:xn}),Xee=xn({ngInjectorDef:xn}),$e=class{constructor(e,t){l(this,"_desc");l(this,"ngMetadataName","InjectionToken");l(this,"\u0275prov");this._desc=e,this.\u0275prov=void 0,typeof t=="number"?this.__NG_ELEMENT_ID__=t:t!==void 0&&(this.\u0275prov=rn({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}},RO;function Qee(n){wV("setInjectorProfilerContext should never be called in production mode");let e=RO;return RO=n,e}function Tk(n){return n&&!!n.\u0275providers}var qf=xn({\u0275cmp:xn}),oS=xn({\u0275dir:xn}),aS=xn({\u0275pipe:xn}),Dk=xn({\u0275mod:xn}),Ma=xn({\u0275fac:xn}),bf=xn({__NG_ELEMENT_ID__:xn}),FO=xn({__NG_ENV_ID__:xn});function Dt(n){return typeof n=="string"?n:n==null?"":String(n)}function Ei(n){return typeof n=="function"?n.name||n.toString():typeof n=="object"&&n!=null&&typeof n.type=="function"?n.type.name||n.type.toString():Dt(n)}function xV(n,e){throw new Pe(-200,n)}function Ik(n,e){throw new Pe(-201,!1)}var Ot;(function(n){n[n.Default=0]="Default",n[n.Host=1]="Host",n[n.Self=2]="Self",n[n.SkipSelf=4]="SkipSelf",n[n.Optional=8]="Optional"})(Ot||(Ot={}));var B_;function SV(){return B_}function ks(n){let e=B_;return B_=n,e}function CV(n,e,t){let r=My(n);if(r&&r.providedIn=="root")return r.value===void 0?r.value=r.factory():r.value;if(t&Ot.Optional)return null;if(e!==void 0)return e;Ik(n,"Injector")}var Kee={},Cu=Kee,V_="__NG_DI_FLAG__",tx=class{constructor(e){l(this,"injector");this.injector=e}retrieve(e,t){let r=t;return this.injector.get(e,r.optional?tE:Cu,r)}},nx="ngTempTokenPath",Jee="ngTokenPath",ete=/\n/gm,tte="\u0275",LO="__source";function nte(n,e=Ot.Default){if(_v()===void 0)throw new Pe(-203,!1);if(_v()===null)return CV(n,void 0,e);{let t=_v(),r;return t instanceof tx?r=t.injector:r=t,r.get(n,e&Ot.Optional?null:void 0,e)}}function Mr(n,e=Ot.Default){return(SV()||nte)(nn(n),e)}function _k(n){throw new Pe(202,!1)}function ye(n,e=Ot.Default){return Mr(n,Ny(e))}function Ny(n){return typeof n>"u"||typeof n=="number"?n:0|(n.optional&&8)|(n.host&&1)|(n.self&&2)|(n.skipSelf&&4)}function $_(n){let e=[];for(let t=0;t ");else if(typeof e=="object"){let i=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];i.push(o+":"+(typeof a=="string"?JSON.stringify(a):Ur(a)))}s=`{${i.join(", ")}}`}return`${t}${r?"("+r+")":""}[${s}]: ${n.replace(ete,` + `)}`}var Ke=Py(Uf("Inject",n=>({token:n})),-1),st=Py(Uf("Optional"),8),$n=Py(Uf("Self"),2),La=Py(Uf("SkipSelf"),4),Ns=Py(Uf("Host"),1);function Du(n,e){let t=n.hasOwnProperty(Ma);return t?n[Ma]:null}function ote(n,e,t){if(n.length!==e.length)return!1;for(let r=0;rArray.isArray(t)?kk(t,e):e(t))}function TV(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function rx(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function $E(n,e){let t=[];for(let r=0;re;){let i=s-2;n[s]=n[i],s--}n[e]=t,n[e+1]=r}}function Js(n,e,t){let r=Ry(n,e);return r>=0?n[r|1]=t:(r=~r,DV(n,r,e,t)),r}function o_(n,e){let t=Ry(n,e);if(t>=0)return n[t|1]}function Ry(n,e){return ate(n,e,1)}function ate(n,e,t){let r=0,s=n.length>>t;for(;s!==r;){let i=r+(s-r>>1),o=n[i<e?s=i:r=i+1}return~(s<{t.push(o)};return kk(e,o=>{let a=o;H_(a,i,[],r)&&(s||(s=[]),s.push(a))}),s!==void 0&&kV(s,i),t}function kV(n,e){for(let t=0;t{e(i,r)})}}function H_(n,e,t,r){if(n=nn(n),!n)return!1;let s=null,i=PO(n),o=!i&&Bn(n);if(!i&&!o){let c=n.ngModule;if(i=PO(c),i)s=c;else return!1}else{if(o&&!o.standalone)return!1;s=n}let a=r.has(s);if(o){if(a)return!1;if(r.add(s),o.dependencies){let c=typeof o.dependencies=="function"?o.dependencies():o.dependencies;for(let u of c)H_(u,e,t,r)}}else if(i){if(i.imports!=null&&!a){r.add(s);let u;try{kk(i.imports,d=>{H_(d,e,t,r)&&(u||(u=[]),u.push(d))})}finally{}u!==void 0&&kV(u,e)}if(!a){let u=Du(s)||(()=>new s);e({provide:s,useFactory:u,deps:on},s),e({provide:IV,useValue:s,multi:!0},s),e({provide:Ki,useValue:()=>Mr(s),multi:!0},s)}let c=i.providers;if(c!=null&&!a){let u=n;Nk(c,d=>{e(d,u)})}}else return!1;return s!==n&&n.providers!==void 0}function Nk(n,e){for(let t of n)Tk(t)&&(t=t.\u0275providers),Array.isArray(t)?Nk(t,e):e(t)}var cte=xn({provide:String,useValue:xn});function AV(n){return n!==null&&typeof n=="object"&&cte in n}function ute(n){return!!(n&&n.useExisting)}function dte(n){return!!(n&&n.useFactory)}function If(n){return typeof n=="function"}function pte(n){return!!n.useClass}var Fy=new $e(""),HE={},BO={},a_;function lS(){return a_===void 0&&(a_=new sx),a_}var $o=class{},_f=class extends $o{constructor(t,r,s,i){super();l(this,"parent");l(this,"source");l(this,"scopes");l(this,"records",new Map);l(this,"_ngOnDestroyHooks",new Set);l(this,"_onDestroyHooks",[]);l(this,"_destroyed",!1);l(this,"injectorDefTypes");this.parent=r,this.source=s,this.scopes=i,U_(t,a=>this.processProvider(a)),this.records.set(Ak,df(void 0,this)),i.has("environment")&&this.records.set($o,df(void 0,this));let o=this.records.get(Fy);o!=null&&typeof o.value=="string"&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(IV,on,Ot.Self))}get destroyed(){return this._destroyed}retrieve(t,r){let s=r;return this.get(t,s.optional?tE:Cu,s)}destroy(){Rv(this),this._destroyed=!0;let t=gt(null);try{for(let s of this._ngOnDestroyHooks)s.ngOnDestroy();let r=this._onDestroyHooks;this._onDestroyHooks=[];for(let s of r)s()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),gt(t)}}onDestroy(t){return Rv(this),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){Rv(this);let r=Ro(this),s=ks(void 0),i;try{return t()}finally{Ro(r),ks(s)}}get(t,r=Cu,s=Ot.Default){if(Rv(this),t.hasOwnProperty(FO))return t[FO](this);s=Ny(s);let i,o=Ro(this),a=ks(void 0);try{if(!(s&Ot.SkipSelf)){let u=this.records.get(t);if(u===void 0){let d=vte(t)&&My(t);d&&this.injectableDefInScope(d)?u=df(j_(t),HE):u=null,this.records.set(t,u)}if(u!=null)return this.hydrate(t,u,s)}let c=s&Ot.Self?lS():this.parent;return r=s&Ot.Optional&&r===Cu?null:r,c.get(t,r)}catch(c){if(c.name==="NullInjectorError"){if((c[nx]=c[nx]||[]).unshift(Ur(t)),o)throw c;return ste(c,t,"R3InjectorError",this.source)}else throw c}finally{ks(a),Ro(o)}}resolveInjectorInitializers(){let t=gt(null),r=Ro(this),s=ks(void 0),i;try{let o=this.get(Ki,on,Ot.Self);for(let a of o)a()}finally{Ro(r),ks(s),gt(t)}}toString(){let t=[],r=this.records;for(let s of r.keys())t.push(Ur(s));return`R3Injector[${t.join(", ")}]`}processProvider(t){t=nn(t);let r=If(t)?t:nn(t&&t.provide),s=hte(t);if(!If(t)&&t.multi===!0){let i=this.records.get(r);i||(i=df(void 0,HE,!0),i.factory=()=>$_(i.multi),this.records.set(r,i)),r=t,i.multi.push(t)}this.records.set(r,s)}hydrate(t,r,s){let i=gt(null);try{return r.value===BO?xV(Ur(t)):r.value===HE&&(r.value=BO,r.value=r.factory(void 0,s)),typeof r.value=="object"&&r.value&>e(r.value)&&this._ngOnDestroyHooks.add(r.value),r.value}finally{gt(i)}}injectableDefInScope(t){if(!t.providedIn)return!1;let r=nn(t.providedIn);return typeof r=="string"?r==="any"||this.scopes.has(r):this.injectorDefTypes.has(r)}removeOnDestroy(t){let r=this._onDestroyHooks.indexOf(t);r!==-1&&this._onDestroyHooks.splice(r,1)}};function j_(n){let e=My(n),t=e!==null?e.factory:Du(n);if(t!==null)return t;if(n instanceof $e)throw new Pe(204,!1);if(n instanceof Function)return fte(n);throw new Pe(204,!1)}function fte(n){if(n.length>0)throw new Pe(204,!1);let t=Yee(n);return t!==null?()=>t.factory(n):()=>new n}function hte(n){if(AV(n))return df(void 0,n.useValue);{let e=MV(n);return df(e,HE)}}function MV(n,e,t){let r;if(If(n)){let s=nn(n);return Du(s)||j_(s)}else if(AV(n))r=()=>nn(n.useValue);else if(dte(n))r=()=>n.useFactory(...$_(n.deps||[]));else if(ute(n))r=(s,i)=>Mr(nn(n.useExisting),i!==void 0&&i&Ot.Optional?Ot.Optional:void 0);else{let s=nn(n&&(n.useClass||n.provide));if(mte(n))r=()=>new s(...$_(n.deps));else return Du(s)||j_(s)}return r}function Rv(n){if(n.destroyed)throw new Pe(205,!1)}function df(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function mte(n){return!!n.deps}function gte(n){return n!==null&&typeof n=="object"&&typeof n.ngOnDestroy=="function"}function vte(n){return typeof n=="function"||typeof n=="object"&&n instanceof $e}function U_(n,e){for(let t of n)Array.isArray(t)?U_(t,e):t&&Tk(t)?U_(t.\u0275providers,e):e(t)}function Pk(n,e){let t;n instanceof _f?(Rv(n),t=n):t=new tx(n);let r,s=Ro(t),i=ks(void 0);try{return e()}finally{Ro(s),ks(i)}}function Rk(){return SV()!==void 0||_v()!=null}function $u(n){if(!Rk())throw new Pe(-203,!1)}var Se;(function(n){n[n.Directive=0]="Directive",n[n.Component=1]="Component",n[n.Injectable=2]="Injectable",n[n.Pipe=3]="Pipe",n[n.NgModule=4]="NgModule"})(Se||(Se={}));var VO;(function(n){n[n.Directive=0]="Directive",n[n.Pipe=1]="Pipe",n[n.NgModule=2]="NgModule"})(VO||(VO={}));var $O;(function(n){n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom"})($O||($O={}));function Er(n){let e=or.ng;if(e&&e.\u0275compilerFacade)return e.\u0275compilerFacade;throw new Error("JIT compiler unavailable")}var HO={\u0275\u0275defineInjectable:rn,\u0275\u0275defineInjector:iS,\u0275\u0275inject:Mr,\u0275\u0275invalidFactoryDep:_k,resolveForwardRef:nn},NV=Function;function Fv(n){return typeof n=="function"}var yte=/^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*(arguments|(?:[^()]+\(\[\],)?[^()]+\(arguments\).*)\)/,bte=/^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/,wte=/^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/,Ete=/^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{[^}]*super\(\.\.\.arguments\)/;function xte(n){return yte.test(n)||Ete.test(n)||bte.test(n)&&!wte.test(n)}var ox=class{constructor(e){l(this,"_reflect");this._reflect=e||or.Reflect}factory(e){return(...t)=>new e(...t)}_zipTypesAndAnnotations(e,t){let r;typeof e>"u"?r=$E(t.length):r=$E(e.length);for(let s=0;s"u"?r[s]=[]:e[s]&&e[s]!=Object?r[s]=[e[s]]:r[s]=[],t&&t[s]!=null&&(r[s]=r[s].concat(t[s]));return r}_ownParameters(e,t){let r=e.toString();if(xte(r))return null;if(e.parameters&&e.parameters!==t.parameters)return e.parameters;let s=e.ctorParameters;if(s&&s!==t.ctorParameters){let a=typeof s=="function"?s():s,c=a.map(d=>d&&d.type),u=a.map(d=>d&&l_(d.decorators));return this._zipTypesAndAnnotations(c,u)}let i=e.hasOwnProperty(cf)&&e[cf],o=this._reflect&&this._reflect.getOwnMetadata&&this._reflect.getOwnMetadata("design:paramtypes",e);return o||i?this._zipTypesAndAnnotations(o,i):$E(e.length)}parameters(e){if(!Fv(e))return[];let t=kE(e),r=this._ownParameters(e,t);return!r&&t!==Object&&(r=this.parameters(t)),r||[]}_ownAnnotations(e,t){if(e.annotations&&e.annotations!==t.annotations){let r=e.annotations;return typeof r=="function"&&r.annotations&&(r=r.annotations),r}return e.decorators&&e.decorators!==t.decorators?l_(e.decorators):e.hasOwnProperty(lf)?e[lf]:null}annotations(e){if(!Fv(e))return[];let t=kE(e),r=this._ownAnnotations(e,t)||[];return(t!==Object?this.annotations(t):[]).concat(r)}_ownPropMetadata(e,t){if(e.propMetadata&&e.propMetadata!==t.propMetadata){let r=e.propMetadata;return typeof r=="function"&&r.propMetadata&&(r=r.propMetadata),r}if(e.propDecorators&&e.propDecorators!==t.propDecorators){let r=e.propDecorators,s={};return Object.keys(r).forEach(i=>{s[i]=l_(r[i])}),s}return e.hasOwnProperty(uf)?e[uf]:null}propMetadata(e){if(!Fv(e))return{};let t=kE(e),r={};if(t!==Object){let i=this.propMetadata(t);Object.keys(i).forEach(o=>{r[o]=i[o]})}let s=this._ownPropMetadata(e,t);return s&&Object.keys(s).forEach(i=>{let o=[];r.hasOwnProperty(i)&&o.push(...r[i]),o.push(...s[i]),r[i]=o}),r}ownPropMetadata(e){return Fv(e)?this._ownPropMetadata(e,kE(e))||{}:{}}hasLifecycleHook(e,t){return e instanceof NV&&t in e.prototype}};function l_(n){return n?n.map(e=>{let r=e.type.annotationCls,s=e.args?e.args:[];return new r(...s)}):[]}function kE(n){let e=n.prototype?Object.getPrototypeOf(n.prototype):null;return(e?e.constructor:null)||Object}var Vn=0,_e=1,ct=2,Wn=3,ts=4,qr=5,ds=6,$l=7,Fn=8,dr=9,Ho=10,dt=11,Iu=12,ax=13,Wf=14,Sr=15,_u=16,pf=17,Yi=18,Ly=19,PV=20,Hl=21,wf=22,ka=23,Si=24,jl=25,Xe=26,Fk=1,Ji=6,jo=7,lx=8,kf=9,qn=10;function Nr(n){return Array.isArray(n)&&typeof n[Fk]=="object"}function Pr(n){return Array.isArray(n)&&n[Fk]===!0}function Lk(n){return(n.flags&4)!==0}function no(n){return n.componentOffset>-1}function cS(n){return(n.flags&1)===1}function Ys(n){return!!n.template}function zl(n){return(n[ct]&512)!==0}function RV(n){return(n.type&16)===16}function Ste(n){return(n[ct]&32)===32}function Na(n){return(n[ct]&256)===256}var cx=class{constructor(e,t,r){l(this,"previousValue");l(this,"currentValue");l(this,"firstChange");this.previousValue=e,this.currentValue=t,this.firstChange=r}isFirstChange(){return this.firstChange}};function FV(n,e,t,r){e!==null?e.applyValueToInputSignal(e,r):n[t]=r}var LV=(()=>{let n=()=>OV;return n.ngInherit=!0,n})();function OV(n){return n.type.prototype.ngOnChanges&&(n.setInput=Tte),Cte}function Cte(){let n=VV(this),e=n?.current;if(e){let t=n.previous;if(t===Qi)n.previous=e;else for(let r in e)t[r]=e[r];n.current=null,this.ngOnChanges(e)}}function Tte(n,e,t,r,s){let i=this.declaredInputs[r],o=VV(n)||Dte(n,{previous:Qi,current:null}),a=o.current||(o.current={}),c=o.previous,u=c[i];a[i]=new cx(u&&u.currentValue,t,c===Qi),FV(n,e,s,t)}var BV="__ngSimpleChanges__";function VV(n){return n[BV]||null}function Dte(n,e){return n[BV]=e}var jO=null;var yn=function(n,e=null,t){jO?.(n,e,t)},Ok="svg",Bk="math";function an(n){for(;Array.isArray(n);)n=n[Vn];return n}function Vk(n){for(;Array.isArray(n);){if(typeof n[Fk]=="object")return n;n=n[Vn]}return null}function zf(n,e){return an(e[n])}function Xs(n,e){return an(e[n.index])}function Ite(n,e){let t=n===null?-1:n.index;return t!==-1?an(e[t]):null}function Hu(n,e){return n.data[e]}function ju(n,e){return n[e]}function uS(n,e,t,r){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=r}function Qs(n,e){let t=e[n];return Nr(t)?t:t[Vn]}function _te(n){return(n[ct]&4)===4}function $k(n){return(n[ct]&128)===128}function kte(n){return Pr(n[Wn])}function Ci(n,e){return e==null?null:n[e]}function $V(n){n[pf]=0}function Hk(n){n[ct]&1024||(n[ct]|=1024,$k(n)&&Gf(n))}function HV(n,e){for(;n>0;)e=e[Wf],n--;return e}function Oy(n){return!!(n[ct]&9216||n[Si]?.dirty)}function q_(n){n[Ho].changeDetectionScheduler?.notify(8),n[ct]&64&&(n[ct]|=1024),Oy(n)&&Gf(n)}function Gf(n){n[Ho].changeDetectionScheduler?.notify(0);let e=Gl(n);for(;e!==null&&!(e[ct]&8192||(e[ct]|=8192,!$k(e)));)e=Gl(e)}function dS(n,e){if(Na(n))throw new Pe(911,!1);n[Hl]===null&&(n[Hl]=[]),n[Hl].push(e)}function jk(n,e){if(n[Hl]===null)return;let t=n[Hl].indexOf(e);t!==-1&&n[Hl].splice(t,1)}function Gl(n){let e=n[Wn];return Pr(e)?e[Wn]:e}function Uk(n){return n[$l]??(n[$l]=[])}function qk(n){return n.cleanup??(n.cleanup=[])}function Ate(n,e,t,r){let s=Uk(e);s.push(t),n.firstCreatePass&&qk(n).push(r,s.length-1)}var wt={lFrame:JV(null),bindingsEnabled:!0,skipHydrationRootTNode:null},UO;(function(n){n[n.Off=0]="Off",n[n.Exhaustive=1]="Exhaustive",n[n.OnlyDirtyViews=2]="OnlyDirtyViews"})(UO||(UO={}));var W_=!1;function Mte(){return wt.lFrame.elementDepthCount}function Nte(){wt.lFrame.elementDepthCount++}function Pte(){wt.lFrame.elementDepthCount--}function Wk(){return wt.bindingsEnabled}function Uu(){return wt.skipHydrationRootTNode!==null}function Rte(n){return wt.skipHydrationRootTNode===n}function jV(){wt.bindingsEnabled=!0}function Fte(n){wt.skipHydrationRootTNode=n}function UV(){wt.bindingsEnabled=!1}function Lte(){wt.skipHydrationRootTNode=null}function re(){return wt.lFrame.lView}function ft(){return wt.lFrame.tView}function qV(n){return wt.lFrame.contextLView=n,n[Fn]}function WV(n){return wt.lFrame.contextLView=null,n}function $t(){let n=zV();for(;n!==null&&n.type===64;)n=n.parent;return n}function zV(){return wt.lFrame.currentTNode}function sy(){let n=wt.lFrame,e=n.currentTNode;return n.isParent?e:e.parent}function eo(n,e){let t=wt.lFrame;t.currentTNode=n,t.isParent=e}function zk(){return wt.lFrame.isParent}function Gk(){wt.lFrame.isParent=!1}function GV(){return wt.lFrame.contextLView}function ZV(){return W_}function ux(n){let e=W_;return W_=n,e}function fs(){let n=wt.lFrame,e=n.bindingRootIndex;return e===-1&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function Va(){return wt.lFrame.bindingIndex}function YV(n){return wt.lFrame.bindingIndex=n}function ki(){return wt.lFrame.bindingIndex++}function $a(n){let e=wt.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function Ote(){return wt.lFrame.inI18n}function XV(n){wt.lFrame.inI18n=n}function Bte(n,e){let t=wt.lFrame;t.bindingIndex=t.bindingRootIndex=n,z_(e)}function Vte(){return wt.lFrame.currentDirectiveIndex}function z_(n){wt.lFrame.currentDirectiveIndex=n}function Zk(n){let e=wt.lFrame.currentDirectiveIndex;return e===-1?null:n[e]}function Yk(){return wt.lFrame.currentQueryIndex}function pS(n){wt.lFrame.currentQueryIndex=n}function $te(n){let e=n[_e];return e.type===2?e.declTNode:e.type===1?n[qr]:null}function QV(n,e,t){if(t&Ot.SkipSelf){let s=e,i=n;for(;s=s.parent,s===null&&!(t&Ot.Host);)if(s=$te(i),s===null||(i=i[Wf],s.type&10))break;if(s===null)return!1;e=s,n=i}let r=wt.lFrame=KV();return r.currentTNode=e,r.lView=n,!0}function Xk(n){let e=KV(),t=n[_e];wt.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function KV(){let n=wt.lFrame,e=n===null?null:n.child;return e===null?JV(n):e}function JV(n){let e={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:n,child:null,inI18n:!1};return n!==null&&(n.child=e),e}function e$(){let n=wt.lFrame;return wt.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}var t$=e$;function Qk(){let n=e$();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Hte(n){return(wt.lFrame.contextLView=HV(n,wt.lFrame.contextLView))[Fn]}function Cr(){return wt.lFrame.selectedIndex}function Pa(n){wt.lFrame.selectedIndex=n}function Dn(){let n=wt.lFrame;return Hu(n.tView,n.selectedIndex)}function n$(){wt.lFrame.currentNamespace=Ok}function r$(){wt.lFrame.currentNamespace=Bk}function s$(){jte()}function jte(){wt.lFrame.currentNamespace=null}function Kk(){return wt.lFrame.currentNamespace}var i$=!0;function By(){return i$}function Yo(n){i$=n}function Ute(n,e,t){let{ngOnChanges:r,ngOnInit:s,ngDoCheck:i}=e.type.prototype;if(r){let o=OV(e);(t.preOrderHooks??(t.preOrderHooks=[])).push(n,o),(t.preOrderCheckHooks??(t.preOrderCheckHooks=[])).push(n,o)}s&&(t.preOrderHooks??(t.preOrderHooks=[])).push(0-n,s),i&&((t.preOrderHooks??(t.preOrderHooks=[])).push(n,i),(t.preOrderCheckHooks??(t.preOrderCheckHooks=[])).push(n,i))}function Jk(n,e){for(let t=e.directiveStart,r=e.directiveEnd;t=r)break}else e[c]<0&&(n[pf]+=65536),(a>14>16&&(n[ct]&3)===e&&(n[ct]+=16384,qO(a,i)):qO(a,i)}var Ef=-1,ku=class{constructor(e,t,r){l(this,"factory");l(this,"injectImpl");l(this,"resolving",!1);l(this,"canSeeViewProviders");l(this,"multi");l(this,"componentProviders");l(this,"index");l(this,"providerFactory");this.factory=e,this.canSeeViewProviders=t,this.injectImpl=r}};function e2(n){return n!=null&&typeof n=="object"&&(n.insertBeforeIndex===null||typeof n.insertBeforeIndex=="number"||Array.isArray(n.insertBeforeIndex))}function Wte(n){return!!(n.type&128)}function zte(n){return(n.flags&8)!==0}function Gte(n){return(n.flags&16)!==0}function Zte(n,e,t){let r=0;for(;re){o=i-1;break}}}for(;i>16}function px(n,e){let t=Xte(n),r=e;for(;t>0;)r=r[Wf],t--;return r}var G_=!0;function fx(n){let e=G_;return G_=n,e}var Qte=256,c$=Qte-1,u$=5,Kte=0,Vo={};function Jte(n,e,t){let r;typeof t=="string"?r=t.charCodeAt(0)||0:t.hasOwnProperty(bf)&&(r=t[bf]),r==null&&(r=t[bf]=Kte++);let s=r&c$,i=1<>u$)]|=i}function hx(n,e){let t=d$(n,e);if(t!==-1)return t;let r=e[_e];r.firstCreatePass&&(n.injectorIndex=e.length,u_(r.data,n),u_(e,null),u_(r.blueprint,null));let s=t2(n,e),i=n.injectorIndex;if(l$(s)){let o=dx(s),a=px(s,e),c=a[_e].data;for(let u=0;u<8;u++)e[i+u]=a[o+u]|c[o+u]}return e[i+8]=s,i}function u_(n,e){n.push(0,0,0,0,0,0,0,0,e)}function d$(n,e){return n.injectorIndex===-1||n.parent&&n.parent.injectorIndex===n.injectorIndex||e[n.injectorIndex+8]===null?-1:n.injectorIndex}function t2(n,e){if(n.parent&&n.parent.injectorIndex!==-1)return n.parent.injectorIndex;let t=0,r=null,s=e;for(;s!==null;){if(r=v$(s),r===null)return Ef;if(t++,s=s[Wf],r.injectorIndex!==-1)return r.injectorIndex|t<<16}return Ef}function Z_(n,e,t){Jte(n,e,t)}function ene(n,e){if(e==="class")return n.classes;if(e==="style")return n.styles;let t=n.attrs;if(t){let r=t.length,s=0;for(;s>20,p=r?a:a+d,f=s?a+d:u;for(let h=p;h=c&&m.type===t)return h}if(s){let h=o[c];if(h&&Ys(h)&&h.type===t)return c}return null}function iy(n,e,t,r,s){let i=n[t],o=e.data;if(i instanceof ku){let a=i;a.resolving&&xV(Ei(o[t]));let c=fx(a.canSeeViewProviders);a.resolving=!0;let u,d=a.injectImpl?ks(a.injectImpl):null,p=QV(n,r,Ot.Default);try{i=n[t]=a.factory(void 0,s,o,n,r),e.firstCreatePass&&t>=r.directiveStart&&Ute(t,o[t],e)}finally{d!==null&&ks(d),fx(c),a.resolving=!1,t$()}}return i}function nne(n){if(typeof n=="string")return n.charCodeAt(0)||0;let e=n.hasOwnProperty(bf)?n[bf]:void 0;return typeof e=="number"?e>=0?e&c$:rne:e}function zO(n,e,t){let r=1<>u$)]&r)}function GO(n,e){return!(n&Ot.Self)&&!(n&Ot.Host&&e)}var Ul=class{constructor(e,t){l(this,"_tNode");l(this,"_lView");this._tNode=e,this._lView=t}get(e,t,r){return h$(this._tNode,this._lView,e,Ny(r),t)}};function rne(){return new Ul($t(),re())}function g$(n){return Zo(()=>{let e=n.prototype.constructor,t=e[Ma]||Y_(e),r=Object.prototype,s=Object.getPrototypeOf(n.prototype).constructor;for(;s&&s!==r;){let i=s[Ma]||Y_(s);if(i&&i!==t)return i;s=Object.getPrototypeOf(s)}return i=>new i})}function Y_(n){return sS(n)?()=>{let e=Y_(nn(n));return e&&e()}:Du(n)}function sne(n,e,t,r,s){let i=n,o=e;for(;i!==null&&o!==null&&o[ct]&2048&&!zl(o);){let a=m$(i,o,t,r|Ot.Self,Vo);if(a!==Vo)return a;let c=i.parent;if(!c){let u=o[PV];if(u){let d=u.get(t,Vo,r);if(d!==Vo)return d}c=v$(o),o=o[Wf]}i=c}return s}function v$(n){let e=n[_e],t=e.type;return t===2?e.declTNode:t===1?n[qr]:null}function fS(n){return ene($t(),n)}var hS=Uf("Attribute",n=>({attributeName:n,__NG_ELEMENT_ID__:()=>fS(n)})),ZO=null;function n2(){return ZO=ZO||new ox}function mS(n){return y$(n2().parameters(n))}function y$(n){return n.map(e=>ine(e))}function ine(n){let e={token:null,attribute:null,host:!1,optional:!1,self:!1,skipSelf:!1};if(Array.isArray(n)&&n.length>0)for(let t=0;t(t===null&&(t=Er({usage:0,kind:"injectable",type:n}).compileInjectable(HO,`ng:///${n.name}/\u0275prov.js`,une(n,e))),t)}),n.hasOwnProperty(Ma)||Object.defineProperty(n,Ma,{get:()=>{if(r===null){let s=Er({usage:0,kind:"injectable",type:n});r=s.compileFactory(HO,`ng:///${n.name}/\u0275fac.js`,{name:n.name,type:n,typeArgumentCount:0,deps:mS(n),target:s.FactoryTarget.Injectable})}return r},configurable:!0})}var ane=xn({provide:String,useValue:xn});function YO(n){return n.useClass!==void 0}function lne(n){return ane in n}function XO(n){return n.useFactory!==void 0}function cne(n){return n.useExisting!==void 0}function une(n,e){let t=e||{providedIn:null},r={name:n.name,type:n,typeArgumentCount:0,providedIn:t.providedIn};return(YO(t)||XO(t))&&t.deps!==void 0&&(r.deps=y$(t.deps)),YO(t)?r.useClass=t.useClass:lne(t)?r.useValue=t.useValue:XO(t)?r.useFactory=t.useFactory:cne(t)&&(r.useExisting=t.useExisting),r}var zt=Ay("Injectable",void 0,void 0,void 0,(n,e)=>one(n,e));function X_(n,e=null,t=null,r){let s=b$(n,e,t,r);return s.resolveInjectorInitializers(),s}function b$(n,e=null,t=null,r,s=new Set){let i=[t||on,_V(n)];return r=r||(typeof n=="object"?void 0:Ur(n)),new _f(i,e||lS(),r||null,s)}var lu=class lu{static create(e,t){if(Array.isArray(e))return X_({name:""},t,e,"");{let r=e.name??"";return X_({name:r},e.parent,e.providers,r)}}};l(lu,"THROW_IF_NOT_FOUND",Cu),l(lu,"NULL",new sx),l(lu,"\u0275prov",rn({token:lu,providedIn:"any",factory:()=>Mr(Ak)})),l(lu,"__NG_ELEMENT_ID__",-1);var In=lu;var Q_=class{constructor(e){l(this,"attributeName");l(this,"__NG_ELEMENT_ID__",()=>fS(this.attributeName));this.attributeName=e}toString(){return`HostAttributeToken ${this.attributeName}`}},w$=new $e("");w$.__NG_ELEMENT_ID__=n=>{let e=$t();if(e===null)throw new Pe(204,!1);if(e.type&2)return e.value;if(n&Ot.Optional)return null;throw new Pe(204,!1)};var E$=!1,As=class{};l(As,"__NG_ELEMENT_ID__",dne),l(As,"__NG_ENV_ID__",e=>e);var mx=class extends As{constructor(t){super();l(this,"_lView");this._lView=t}onDestroy(t){let r=this._lView;return Na(r)?(t(),()=>{}):(dS(r,t),()=>jk(r,t))}};function dne(){return new mx(re())}var Ti=class{},Zf=new $e("",{providedIn:"root",factory:()=>!1}),Ave=new $e("",{providedIn:"root",factory:()=>!1}),x$=new $e(""),r2=new $e(""),Gv=class Gv{constructor(){l(this,"taskId",0);l(this,"pendingTasks",new Set);l(this,"hasPendingTasks",new ZI(!1))}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);let e=this.taskId++;return this.pendingTasks.add(e),e}has(e){return this.pendingTasks.has(e)}remove(e){this.pendingTasks.delete(e),this.pendingTasks.size===0&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}};l(Gv,"\u0275prov",rn({token:Gv,providedIn:"root",factory:()=>new Gv}));var Uo=Gv,Zv=class Zv{constructor(){l(this,"internalPendingTasks",ye(Uo));l(this,"scheduler",ye(Ti))}add(){let e=this.internalPendingTasks.add();return()=>{this.internalPendingTasks.has(e)&&(this.scheduler.notify(11),this.internalPendingTasks.remove(e))}}async run(e){let t=this.add();try{return await e()}finally{t()}}};l(Zv,"\u0275prov",rn({token:Zv,providedIn:"root",factory:()=>new Zv}));var oy=Zv,K_=class extends _s{constructor(t=!1){super();l(this,"__isAsync");l(this,"destroyRef");l(this,"pendingTasks");this.__isAsync=t,Rk()&&(this.destroyRef=ye(As,{optional:!0})??void 0,this.pendingTasks=ye(Uo,{optional:!0})??void 0)}emit(t){let r=gt(null);try{super.next(t)}finally{gt(r)}}subscribe(t,r,s){let i=t,o=r||(()=>null),a=s;if(t&&typeof t=="object"){let u=t;i=u.next?.bind(u),o=u.error?.bind(u),a=u.complete?.bind(u)}this.__isAsync&&(o=this.wrapInTimeout(o),i&&(i=this.wrapInTimeout(i)),a&&(a=this.wrapInTimeout(a)));let c=super.subscribe({next:i,error:o,complete:a});return t instanceof zi&&t.add(c),c}wrapInTimeout(t){return r=>{let s=this.pendingTasks?.add();setTimeout(()=>{try{t(r)}finally{s!==void 0&&this.pendingTasks?.remove(s)}})}}},jr=K_;function ay(...n){}function S$(n){let e,t;function r(){n=ay;try{t!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{n(),r()}),typeof requestAnimationFrame=="function"&&(t=requestAnimationFrame(()=>{n(),r()})),()=>r()}function QO(n){return queueMicrotask(()=>n()),()=>{n=ay}}var s2="isAngularZone",gx=s2+"_ID",pne=0,ln=class n{constructor(e){l(this,"hasPendingMacrotasks",!1);l(this,"hasPendingMicrotasks",!1);l(this,"isStable",!0);l(this,"onUnstable",new jr(!1));l(this,"onMicrotaskEmpty",new jr(!1));l(this,"onStable",new jr(!1));l(this,"onError",new jr(!1));let{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:s=!1,scheduleInRootZone:i=E$}=e;if(typeof Zone>"u")throw new Pe(908,!1);Zone.assertZonePatched();let o=this;o._nesting=0,o._outer=o._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(o._inner=o._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(o._inner=o._inner.fork(Zone.longStackTraceZoneSpec)),o.shouldCoalesceEventChangeDetection=!s&&r,o.shouldCoalesceRunChangeDetection=s,o.callbackScheduled=!1,o.scheduleInRootZone=i,mne(o)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(s2)===!0}static assertInAngularZone(){if(!n.isInAngularZone())throw new Pe(909,!1)}static assertNotInAngularZone(){if(n.isInAngularZone())throw new Pe(909,!1)}run(e,t,r){return this._inner.run(e,t,r)}runTask(e,t,r,s){let i=this._inner,o=i.scheduleEventTask("NgZoneEvent: "+s,e,fne,ay,ay);try{return i.runTask(o,t,r)}finally{i.cancelTask(o)}}runGuarded(e,t,r){return this._inner.runGuarded(e,t,r)}runOutsideAngular(e){return this._outer.run(e)}},fne={};function i2(n){if(n._nesting==0&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function hne(n){if(n.isCheckStableRunning||n.callbackScheduled)return;n.callbackScheduled=!0;function e(){S$(()=>{n.callbackScheduled=!1,J_(n),n.isCheckStableRunning=!0,i2(n),n.isCheckStableRunning=!1})}n.scheduleInRootZone?Zone.root.run(()=>{e()}):n._outer.run(()=>{e()}),J_(n)}function mne(n){let e=()=>{hne(n)},t=pne++;n._inner=n._inner.fork({name:"angular",properties:{[s2]:!0,[gx]:t,[gx+t]:!0},onInvokeTask:(r,s,i,o,a,c)=>{if(gne(c))return r.invokeTask(i,o,a,c);try{return KO(n),r.invokeTask(i,o,a,c)}finally{(n.shouldCoalesceEventChangeDetection&&o.type==="eventTask"||n.shouldCoalesceRunChangeDetection)&&e(),JO(n)}},onInvoke:(r,s,i,o,a,c,u)=>{try{return KO(n),r.invoke(i,o,a,c,u)}finally{n.shouldCoalesceRunChangeDetection&&!n.callbackScheduled&&!vne(c)&&e(),JO(n)}},onHasTask:(r,s,i,o)=>{r.hasTask(i,o),s===i&&(o.change=="microTask"?(n._hasPendingMicrotasks=o.microTask,J_(n),i2(n)):o.change=="macroTask"&&(n.hasPendingMacrotasks=o.macroTask))},onHandleError:(r,s,i,o)=>(r.handleError(i,o),n.runOutsideAngular(()=>n.onError.emit(o)),!1)})}function J_(n){n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&n.callbackScheduled===!0?n.hasPendingMicrotasks=!0:n.hasPendingMicrotasks=!1}function KO(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function JO(n){n._nesting--,i2(n)}var Mf=class{constructor(){l(this,"hasPendingMicrotasks",!1);l(this,"hasPendingMacrotasks",!1);l(this,"isStable",!0);l(this,"onUnstable",new jr);l(this,"onMicrotaskEmpty",new jr);l(this,"onStable",new jr);l(this,"onError",new jr)}run(e,t,r){return e.apply(t,r)}runGuarded(e,t,r){return e.apply(t,r)}runOutsideAngular(e){return e()}runTask(e,t,r,s){return e.apply(t,r)}};function gne(n){return C$(n,"__ignore_ng_zone__")}function vne(n){return C$(n,"__scheduler_tick__")}function C$(n,e){return!Array.isArray(n)||n.length!==1?!1:n[0]?.data?.[e]===!0}function yne(n="zone.js",e){return n==="noop"?new Mf:n==="zone.js"?new ln(e):n}var Ks=class{constructor(){l(this,"_console",console)}handleError(e){this._console.error("ERROR",e)}},T$=new $e("",{providedIn:"root",factory:()=>{let n=ye(ln),e=ye(Ks);return t=>n.runOutsideAngular(()=>e.handleError(t))}}),ly=class{constructor(){l(this,"destroyed",!1);l(this,"listeners",null);l(this,"errorHandler",ye(Ks,{optional:!0}));l(this,"destroyRef",ye(As));this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new Pe(953,!1);return(this.listeners??(this.listeners=[])).push(e),{unsubscribe:()=>{let t=this.listeners?.indexOf(e);t!==void 0&&t!==-1&&this.listeners?.splice(t,1)}}}emit(e){if(this.destroyed){console.warn(Go(953,!1));return}if(this.listeners===null)return;let t=gt(null);try{for(let r of this.listeners)try{r(e)}catch(s){this.errorHandler?.handleError(s)}}finally{gt(t)}}};function bne(n){return n.destroyRef}function wne(n){return new ly}function eB(n,e){return bV(n,e)}function Ene(n){return bV(rS,n)}var xne=(eB.required=Ene,eB);function Sne(){return Yf($t(),re())}function Yf(n,e){return new en(Xs(n,e))}var en=class{constructor(e){l(this,"nativeElement");this.nativeElement=e}};l(en,"__NG_ELEMENT_ID__",Sne);function D$(n){return n instanceof en?n.nativeElement:n}function I$(n){return typeof n=="function"&&n[sr]!==void 0}function Cne(n){return null}function Di(n,e){let t=FI(n,e?.equal),r=t[sr];return t.set=s=>Kc(r,s),t.update=s=>Jw(r,s),t.asReadonly=gS.bind(t),t}function gS(){let n=this[sr];if(n.readonlyFn===void 0){let e=()=>this();e[sr]=n,n.readonlyFn=e}return n.readonlyFn}function _$(n){return I$(n)&&typeof n.set=="function"}function Tne(){return this._results[Symbol.iterator]()}var Tde,vx=class{constructor(e=!1){l(this,"_emitDistinctChangesOnly");l(this,"dirty",!0);l(this,"_onDirty");l(this,"_results",[]);l(this,"_changesDetected",!1);l(this,"_changes");l(this,"length",0);l(this,"first");l(this,"last");l(this,Tde,Tne);this._emitDistinctChangesOnly=e}get changes(){return this._changes??(this._changes=new _s)}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 r=Oo(e);(this._changesDetected=!ote(this._results,r,t))&&(this._results=r,this.length=r.length,this.last=r[this.length-1],this.first=r[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())}};Tde=Symbol.iterator;var cy="ngSkipHydration",Dne="ngskiphydration";function o2(n){let e=n.mergedAttrs;if(e===null)return!1;for(let t=0;t=0){let a=an(i[o]),c=tB(i,o,a);xi(a,c),e=c;break}}}}return e||null}function tB(n,e,t){return new yx(n[Ly],e,t)}var t1="__ngContext__";function xi(n,e){Nr(e)?(n[t1]=e[Ly],kne(e)):n[t1]=e}function WE(n){let e=n[t1];return typeof e=="number"?M$(e):e||null}function Mne(n){let e=WE(n);return e?Nr(e)?e:e.lView:null}function N$(n){return n&&n.constructor&&n.constructor.\u0275cmp}function Nne(n){return n&&n.constructor&&n.constructor.\u0275dir}function nB(n,e){let t=n[_e];for(let r=Xe;r=0?"dom":"output",g=typeof h=="boolean"?h:!1;n==p&&o.push({element:n,name:d,callback:f,useCapture:g,type:m})}}return o.sort(zne),o}function zne(n,e){return n.name==e.name?0:n.nameYne}),Yne="ng",Vy=new $e(""),Xo=new $e("",{providedIn:"platform",factory:()=>"unknown"}),Xne=new $e(""),Qne=new $e(""),Xf=new $e("",{providedIn:"root",factory:()=>qo().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null}),yS={breakpoints:[16,32,48,64,96,128,256,384,640,750,828,1080,1200,1920,2048,3840],placeholderResolution:30,disableImageSizeWarning:!1,disableImageLazyLoadWarning:!1},bS=new $e("",{providedIn:"root",factory:()=>yS});function Kne(n){return n}function Jne(){let n=new Ra;return(typeof ngServerMode>"u"||!ngServerMode)&&(n.store=ere(qo(),ye(Zs))),n}var eS=class eS{constructor(){l(this,"store",{});l(this,"onSerializeCallbacks",{})}get(e,t){return this.store[e]!==void 0?this.store[e]:t}set(e,t){this.store[e]=t}remove(e){delete this.store[e]}hasKey(e){return this.store.hasOwnProperty(e)}get isEmpty(){return Object.keys(this.store).length===0}onSerialize(e,t){this.onSerializeCallbacks[e]=t}toJson(){for(let e in this.onSerializeCallbacks)if(this.onSerializeCallbacks.hasOwnProperty(e))try{this.store[e]=this.onSerializeCallbacks[e]()}catch(t){console.warn("Exception in onSerialize callback: ",t)}return JSON.stringify(this.store).replace(/$$}),j$=new $e(""),p2=new $e(""),U$=!1,f2=new $e(""),fy=new $e("",{providedIn:"root",factory:()=>new Map}),hy;(function(n){n[n.CHANGE_DETECTION=0]="CHANGE_DETECTION",n[n.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER"})(hy||(hy={}));var ro=new $e(""),sB=new Set;function rs(n){sB.has(n)||(sB.add(n),performance?.mark?.("mark_feature_usage",{detail:{feature:n}}))}function tre(n,e){if(Yw()!==null)throw new Pe(-602,!1)}var Tu=class{constructor(e,t){l(this,"view");l(this,"node");this.view=e,this.node=t}};l(Tu,"__NG_ELEMENT_ID__",nre);function nre(){return new Tu(re(),$t())}var Vl;(function(n){n[n.EarlyRead=0]="EarlyRead",n[n.Write=1]="Write",n[n.MixedReadWrite=2]="MixedReadWrite",n[n.Read=3]="Read"})(Vl||(Vl={}));var Yv=class Yv{constructor(){l(this,"impl",null)}execute(){this.impl?.execute()}};l(Yv,"\u0275prov",rn({token:Yv,providedIn:"root",factory:()=>new Yv}));var Nf=Yv,q$=[Vl.EarlyRead,Vl.Write,Vl.MixedReadWrite,Vl.Read],Xv=class Xv{constructor(){l(this,"ngZone",ye(ln));l(this,"scheduler",ye(Ti));l(this,"errorHandler",ye(Ks,{optional:!0}));l(this,"sequences",new Set);l(this,"deferredRegistrations",new Set);l(this,"executing",!1);ye(ro,{optional:!0})}execute(){let e=this.sequences.size>0;e&&yn(16),this.executing=!0;for(let t of q$)for(let r of this.sequences)if(!(r.erroredOrDestroyed||!r.hooks[t]))try{r.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let s=r.hooks[t];return s(r.pipelinedValue)},r.snapshot))}catch(s){r.erroredOrDestroyed=!0,this.errorHandler?.handleError(s)}this.executing=!1;for(let t of this.sequences)t.afterRun(),t.once&&(this.sequences.delete(t),t.destroy());for(let t of this.deferredRegistrations)this.sequences.add(t);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),e&&yn(17)}register(e){let{view:t}=e;t!==void 0?((t[jl]??(t[jl]=[])).push(e),Gf(t),t[ct]|=8192):this.executing?this.deferredRegistrations.add(e):this.addSequence(e)}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(hy.AFTER_NEXT_RENDER,e):e()}};l(Xv,"\u0275prov",rn({token:Xv,providedIn:"root",factory:()=>new Xv}));var wx=Xv,Ex=class{constructor(e,t,r,s,i,o=null){l(this,"impl");l(this,"hooks");l(this,"view");l(this,"once");l(this,"snapshot");l(this,"erroredOrDestroyed",!1);l(this,"pipelinedValue");l(this,"unregisterOnDestroy");this.impl=e,this.hooks=t,this.view=r,this.once=s,this.snapshot=o,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?.[jl];e&&(this.view[jl]=e.filter(t=>t!==this))}};function h2(n,e){!e?.injector&&$u(h2);let t=e?.injector??ye(In);return typeof ngServerMode<"u"&&ngServerMode?g2:(rs("NgAfterRender"),W$(n,t,e,!1))}function m2(n,e){!e?.injector&&$u(m2);let t=e?.injector??ye(In);return typeof ngServerMode<"u"&&ngServerMode?g2:(rs("NgAfterNextRender"),W$(n,t,e,!0))}function rre(n,e){if(n instanceof Function){let t=[void 0,void 0,void 0,void 0];return t[e]=n,t}else return[n.earlyRead,n.write,n.mixedReadWrite,n.read]}function W$(n,e,t,r){let s=e.get(Nf);s.impl??(s.impl=e.get(wx));let i=e.get(ro,null,{optional:!0}),o=t?.phase??Vl.MixedReadWrite,a=t?.manualCleanup!==!0?e.get(As):null,c=e.get(Tu,null,{optional:!0}),u=new Ex(s.impl,rre(n,o),c?.view,r,a,i?.snapshot(null));return s.impl.register(u),u}var g2={destroy(){}},ir;(function(n){n[n.NOT_STARTED=0]="NOT_STARTED",n[n.IN_PROGRESS=1]="IN_PROGRESS",n[n.COMPLETE=2]="COMPLETE",n[n.FAILED=3]="FAILED"})(ir||(ir={}));var iB=0,sre=1,Rn;(function(n){n[n.Placeholder=0]="Placeholder",n[n.Loading=1]="Loading",n[n.Complete=2]="Complete",n[n.Error=3]="Error"})(Rn||(Rn={}));var Pf;(function(n){n[n.Initial=-1]="Initial"})(Pf||(Pf={}));var xf=0,Zl=1,Bv=2,AE=3,ire=4,ore=5,wS=6,are=7,Sf=8,lre=9,xx;(function(n){n[n.Manual=0]="Manual",n[n.Playthrough=1]="Playthrough"})(xx||(xx={}));function $y(n,e,t){let r=G$(n);e[r]===null&&(e[r]=[]),e[r].push(t)}function zE(n,e){let t=G$(n),r=e[t];if(r!==null){for(let s of r)s();e[t]=null}}function z$(n){zE(1,n),zE(0,n),zE(2,n)}function G$(n){let e=ire;return n===1?e=ore:n===2&&(e=lre),e}function Hy(n){return n+1}function Ps(n,e){let t=n[_e],r=Hy(e.index);return n[r]}function cre(n,e,t){let r=n[_e],s=Hy(e);n[s]=t}function Wr(n,e){let t=Hy(e.index);return n.data[t]}function ure(n,e,t){let r=Hy(e);n.data[r]=t}function dre(n,e,t){let r=e[_e],s=Wr(r,t);switch(n){case Rn.Complete:return s.primaryTmplIndex;case Rn.Loading:return s.loadingTmplIndex;case Rn.Error:return s.errorTmplIndex;case Rn.Placeholder:return s.placeholderTmplIndex;default:return null}}function s1(n,e){return e===Rn.Placeholder?n.placeholderBlockConfig?.[iB]??null:e===Rn.Loading?n.loadingBlockConfig?.[iB]??null:null}function Z$(n){return n.loadingBlockConfig?.[sre]??null}function oB(n,e){if(!n||n.length===0)return e;let t=new Set(n);for(let r of e)t.add(r);return n.length===t.size?n:Array.from(t)}function pre(n,e){let t=e.primaryTmplIndex+Xe;return Hu(n,t)}function Y$(n){return n!==null&&typeof n=="object"&&typeof n.primaryTmplIndex=="number"}function fre(n,e){let t=null,r=Hy(e.index);return Xe{for(let e of this.callbacks)e()})}};function X$(n,e){let t=p_.get(n);if(!t){t=new my,p_.set(n,t);for(let r of Cx)n.addEventListener(r,t.listener,Sx)}return t.callbacks.add(e),()=>{let{callbacks:r,listener:s}=t;if(r.delete(e),r.size===0){p_.delete(n);for(let i of Cx)n.removeEventListener(i,s,Sx)}}}function Q$(n,e){let t=d_.get(n);if(!t){t=new my,d_.set(n,t);for(let r of Tx)n.addEventListener(r,t.listener,Sx)}return t.callbacks.add(e),()=>{let{callbacks:r,listener:s}=t;if(r.delete(e),r.size===0){for(let i of Tx)n.removeEventListener(i,s,Sx);d_.delete(n)}}}function v2(n,e,t){let r=t.get(ln),s=sf.get(n);return of=of||r.runOutsideAngular(()=>new IntersectionObserver(i=>{for(let o of i)o.isIntersecting&&sf.has(o.target)&&r.run(sf.get(o.target).listener)})),s||(s=new my,r.runOutsideAngular(()=>of.observe(n)),sf.set(n,s),f_++),s.callbacks.add(e),()=>{sf.has(n)&&(s.callbacks.delete(e),s.callbacks.size===0&&(of?.unobserve(n),sf.delete(n),f_--),f_===0&&(of?.disconnect(),of=null))}}function hre(n,e,t){return t==null?n:t>=0?HV(t,n):n[e.index][qn]??null}function mre(n,e){return zf(Xe+e,n)}function Qf(n,e,t,r,s,i,o){let a=n[dr],c=a.get(ln),u;function d(){if(Na(n)){u.destroy();return}let p=Ps(n,e),f=p[Zl];if(f!==Pf.Initial&&f!==Rn.Placeholder){u.destroy();return}let h=hre(n,e,r);if(!h||(u.destroy(),Na(h)))return;let m=mre(h,t),g=s(m,()=>{c.run(()=>{n!==h&&jk(h,g),i()})},a);n!==h&&dS(h,g),$y(o,p,g)}u=h2({read:d},{injector:a})}var jy="ngb";function K$(n,e,t=null){if(e.length===0||n.nodeType!==Node.ELEMENT_NODE)return;let r=n.getAttribute(Mv.JSACTION),s=e.reduce((o,a)=>(r?.indexOf(a)??-1)===-1?o+a+":;":o,"");n.setAttribute(Mv.JSACTION,`${r??""}${s}`);let i=t??"";i!==""&&s.length>0&&n.setAttribute(jy,i)}var gre=(n,e,t)=>{let r=n,s=r.__jsaction_fns??new Map,i=s.get(e)??[];i.push(t),s.set(e,i),r.__jsaction_fns=s},J$=(n,e)=>{let t=n,r=t.getAttribute(jy)??"",s=e.get(r)??new Set;s.has(t)||s.add(t),e.set(r,s)};function vre(n,e){if(n.length>0){let t=[];for(let s of n)e.has(s)&&(t=[...t,...e.get(s)]);new Set(t).forEach(e8)}}var e8=n=>{n.removeAttribute(Mv.JSACTION),n.removeAttribute(jy),n.__jsaction_fns=void 0},y2=new $e("",{providedIn:"root",factory:()=>({})});function t8(n,e){let t=e?.__jsaction_fns?.get(n.type);if(!(!t||!e?.isConnected))for(let r of t)r(n)}var i1=new Map;function yre(n,e){return i1.set(n,e),()=>i1.delete(n)}var aB=!1,n8=(n,e,t,r)=>{};function bre(n,e,t,r){n8(n,e,t,r)}function wre(){aB||(n8=(n,e,t,r)=>{let s=n[dr].get(Zs);i1.get(s)?.(e,t,r)},aB=!0)}var Ha=new $e(""),Qv=class Qv{constructor(){l(this,"registry",new Map);l(this,"cleanupFns",new Map);l(this,"jsActionMap",ye(fy));l(this,"contract",ye(y2));l(this,"hydrating",new Map);l(this,"awaitingCallbacks",new Map)}add(e,t){if(this.registry.set(e,t),this.awaitingCallbacks.has(e)){let r=this.awaitingCallbacks.get(e);for(let s of r)s()}}get(e){return this.registry.get(e)??null}has(e){return this.registry.has(e)}cleanup(e){vre(e,this.jsActionMap);for(let t of e)this.registry.delete(t),this.jsActionMap.delete(t),this.invokeTriggerCleanupFns(t),this.hydrating.delete(t),this.awaitingCallbacks.delete(t);this.size===0&&this.contract.instance?.cleanUp()}get size(){return this.registry.size}addCleanupFn(e,t){let r=[];this.cleanupFns.has(e)&&(r=this.cleanupFns.get(e)),r.push(t),this.cleanupFns.set(e,r)}invokeTriggerCleanupFns(e){let t=this.cleanupFns.get(e)??[];for(let r of t)r();this.cleanupFns.delete(e)}awaitParentBlock(e,t){let r=this.awaitingCallbacks.get(e)??[];r.push(t),this.awaitingCallbacks.set(e,r)}};l(Qv,"\u0275prov",rn({token:Qv,providedIn:null,factory:()=>new Qv}));var o1=Qv,Ere="__nghData__",b2=Ere,xre="__nghDeferData__",w2=xre,Vv="ngh",r8="nghm",s8=()=>null;function Sre(n,e,t=!1){let r=n.getAttribute(Vv);if(r==null)return null;let[s,i]=r.split("|");if(r=t?i:s,!r)return null;let o=i?`|${i}`:"",a=t?s:o,c={};if(r!==""){let d=e.get(Ra,null,{optional:!0});d!==null&&(c=d.get(b2,[])[Number(r)])}let u={data:c,firstChild:n.firstChild??null};return t&&(u.firstChild=n,ES(u,0,n.nextSibling)),a?n.setAttribute(Vv,a):n.removeAttribute(Vv),u}function Cre(){s8=Sre}function i8(n,e,t=!1){return s8(n,e,t)}function o8(n){let e=n._lView;return e[_e].type===2?null:(zl(e)&&(e=e[Xe]),e)}function Tre(n){return n.textContent?.replace(/\s/gm,"")}function Dre(n){let e=qo(),t=e.createNodeIterator(n,NodeFilter.SHOW_COMMENT,{acceptNode(i){let o=Tre(i);return o==="ngetn"||o==="ngtns"?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),r,s=[];for(;r=t.nextNode();)s.push(r);for(let i of s)i.textContent==="ngetn"?i.replaceWith(e.createTextNode("")):i.remove()}var a1;(function(n){n.Hydrated="hydrated",n.Skipped="skipped",n.Mismatched="mismatched"})(a1||(a1={}));var Ire="__ngDebugHydrationInfo__";function _re(n){return n[Ire]??null}function ES(n,e,t){n.segmentHeads??(n.segmentHeads={}),n.segmentHeads[e]=t}function l1(n,e){return n.segmentHeads?.[e]??null}function E2(n){return n.get(f2,!1,{optional:!0})}function a8(n,e){let t=n.data,r=t[ff]?.[e]??null;return r===null&&t[Eu]?.[e]&&(r=x2(n,e)),r}function kre(n,e){return n.data[ff]?.[e]!==void 0}function l8(n,e){return n.data[Eu]?.[e]??null}function x2(n,e){let t=l8(n,e)??[],r=0;for(let s of t)r+=s[ql]*(s[hf]??1);return r}function c8(n){if(typeof n.disconnectedNodes>"u"){let e=n.data[iu];n.disconnectedNodes=e?new Set(e):null}return n.disconnectedNodes}function qu(n,e){if(typeof n.disconnectedNodes>"u"){let t=n.data[iu];n.disconnectedNodes=t?new Set(t):null}return!!c8(n)?.has(e)}function u8(n,e){let t=e,r=n.corruptedTextNodes;t.textContent===""?r.set(t,"ngetn"):t.nextSibling?.nodeType===Node.TEXT_NODE&&r.set(t,"ngtns")}function Are(n){let e=[];return n!==null&&(n.has(4)&&e.push(...Tx),n.has(3)&&e.push(...Cx)),e}function Mre(n,e){let t=e.get(Ha),s=e.get(Ra).get(w2,{}),i=!1,o=n,a=null,c=[];for(;!i&&o;){i=t.has(o);let u=t.hydrating.get(o);if(a===null&&u!=null){a=u.promise;break}c.unshift(o),o=s[o][V$]}return{parentBlockPromise:a,hydrationQueue:c}}function Nre(n){let e=n.body.querySelectorAll("[jsaction]"),t=new Set,r=[Tx.join(":;"),Cx.join(":;")].join("|");for(let s of e){let i=s.getAttribute("jsaction"),o=s.getAttribute("ngb");i?.match(r)&&o!==null&&t.add(s)}return t}function Pre(n,e){let t=Nre(n),r=e.get(fy);for(let s of t)J$(s,r)}var d8=()=>({});function Rre(n){let e=n.get(Ra,null,{optional:!0});return e!==null?e.get(w2,{}):{}}function Fre(){d8=Rre}function Lre(n){return d8(n)}function Ore(n){return typeof n=="object"&&n.trigger===5}function Bre(n){return n[d2]?.find(t=>Ore(t))?.delay??null}function h_(n,e){return n[d2]?.includes(e)??!1}function Vre(n){return{data:n,hydrate:{idle:h_(n,0),immediate:h_(n,1),timer:Bre(n),viewport:h_(n,2)}}}function $re(n){let e=Lre(n),t=new Map;for(let r in e)t.set(r,Vre(e[r]));return t}function m_(n){return!!n&&n.nodeType===Node.COMMENT_NODE&&n.textContent?.trim()===r8}function lB(n){for(;n&&n.nodeType===Node.TEXT_NODE;)n=n.previousSibling;return n}function Hre(n){for(let r of n.body.childNodes)if(m_(r))return;let e=lB(n.body.previousSibling);if(m_(e))return;let t=lB(n.head.lastChild);if(!m_(t))throw new Pe(-507,!1)}function p8(n,e){let t=n.contentQueries;if(t!==null){let r=gt(null);try{for(let s=0;sn,createScript:n=>n,createScriptURL:n=>n})}catch{}return ME}function Kf(n){return m8()?.createHTML(n)||n}function Zre(n){return m8()?.createScriptURL(n)||n}var NE;function C2(){if(NE===void 0&&(NE=null,or.trustedTypes))try{NE=or.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch{}return NE}function cB(n){return C2()?.createHTML(n)||n}function uB(n){return C2()?.createScript(n)||n}function dB(n){return C2()?.createScriptURL(n)||n}var Fa=class{constructor(e){l(this,"changingThisBreaksApplicationSecurity");this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Sk})`}},u1=class extends Fa{getTypeName(){return"HTML"}},d1=class extends Fa{getTypeName(){return"Style"}},p1=class extends Fa{getTypeName(){return"Script"}},f1=class extends Fa{getTypeName(){return"URL"}},h1=class extends Fa{getTypeName(){return"ResourceURL"}};function zr(n){return n instanceof Fa?n.changingThisBreaksApplicationSecurity:n}function Ai(n,e){let t=g8(n);if(t!=null&&t!==e){if(t==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${t} (see ${Sk})`)}return t===e}function g8(n){return n instanceof Fa&&n.getTypeName()||null}function T2(n){return new u1(n)}function D2(n){return new d1(n)}function I2(n){return new p1(n)}function _2(n){return new f1(n)}function k2(n){return new h1(n)}function v8(n){let e=new g1(n);return Yre()?new m1(e):e}var m1=class{constructor(e){l(this,"inertDocumentHelper");this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{let t=new window.DOMParser().parseFromString(Kf(e),"text/html").body;return t===null?this.inertDocumentHelper.getInertBodyElement(e):(t.firstChild?.remove(),t)}catch{return null}}},g1=class{constructor(e){l(this,"defaultDoc");l(this,"inertDocument");this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){let t=this.inertDocument.createElement("template");return t.innerHTML=Kf(e),t}};function Yre(){try{return!!new window.DOMParser().parseFromString(Kf(""),"text/html")}catch{return!1}}var Xre=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function Jf(n){return n=String(n),n.match(Xre)?n:"unsafe:"+n}function ja(n){let e={};for(let t of n.split(","))e[t]=!0;return e}function Uy(...n){let e={};for(let t of n)for(let r in t)t.hasOwnProperty(r)&&(e[r]=!0);return e}var y8=ja("area,br,col,hr,img,wbr"),b8=ja("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),w8=ja("rp,rt"),Qre=Uy(w8,b8),Kre=Uy(b8,ja("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Jre=Uy(w8,ja("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),v1=Uy(y8,Kre,Jre,Qre),E8=ja("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),ese=ja("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),tse=ja("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext"),y1=Uy(E8,ese,tse),nse=ja("script,style,template"),b1=class{constructor(){l(this,"sanitizedSomething",!1);l(this,"buf",[])}sanitizeChildren(e){let t=e.firstChild,r=!0,s=[];for(;t;){if(t.nodeType===Node.ELEMENT_NODE?r=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,r&&t.firstChild){s.push(t),t=ise(t);continue}for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let i=sse(t);if(i){t=i;break}t=s.pop()}}return this.buf.join("")}startElement(e){let t=pB(e).toLowerCase();if(!v1.hasOwnProperty(t))return this.sanitizedSomething=!0,!nse.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);let r=e.attributes;for(let s=0;s"),!0}endElement(e){let t=pB(e).toLowerCase();v1.hasOwnProperty(t)&&!y8.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(fB(e))}};function rse(n,e){return(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function sse(n){let e=n.nextSibling;if(e&&n!==e.previousSibling)throw x8(e);return e}function ise(n){let e=n.firstChild;if(e&&rse(n,e))throw x8(e);return e}function pB(n){let e=n.nodeName;return typeof e=="string"?e:"FORM"}function x8(n){return new Error(`Failed to sanitize html because the element is clobbered: ${n.outerHTML}`)}var ose=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ase=/([^\#-~ |!])/g;function fB(n){return n.replace(/&/g,"&").replace(ose,function(e){let t=e.charCodeAt(0),r=e.charCodeAt(1);return"&#"+((t-55296)*1024+(r-56320)+65536)+";"}).replace(ase,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}var PE;function xS(n,e){let t=null;try{PE=PE||v8(n);let r=e?String(e):"";t=PE.getInertBodyElement(r);let s=5,i=r;do{if(s===0)throw new Error("Failed to sanitize html because the input is unstable");s--,r=i,i=t.innerHTML,t=PE.getInertBodyElement(r)}while(r!==i);let a=new b1().sanitizeChildren(w1(t)||t);return Kf(a)}finally{if(t){let r=w1(t)||t;for(;r.firstChild;)r.firstChild.remove()}}}function w1(n){return"content"in n&&lse(n)?n.content:null}function lse(n){return n.nodeType===Node.ELEMENT_NODE&&n.nodeName==="TEMPLATE"}var cse=/^>|^->||--!>|)/g,dse="\u200B$1\u200B";function pse(n){return n.replace(cse,e=>e.replace(use,dse))}function A2(n,e){return n.createText(e)}function S8(n,e,t){n.setValue(e,t)}function M2(n,e){return n.createComment(pse(e))}function SS(n,e,t){return n.createElement(e,t)}function Au(n,e,t,r,s){n.insertBefore(e,t,r,s)}function C8(n,e,t){n.appendChild(e,t)}function hB(n,e,t,r,s){r!==null?Au(n,e,t,r,s):C8(n,e,t)}function qy(n,e,t){n.removeChild(null,e,t)}function T8(n){n.textContent=""}function fse(n,e,t){n.setAttribute(e,"style",t)}function hse(n,e,t){t===""?n.removeAttribute(e,"class"):n.setAttribute(e,"class",t)}function D8(n,e,t){let{mergedAttrs:r,classes:s,styles:i}=t;r!==null&&Zte(n,e,r),s!==null&&hse(n,e,s),i!==null&&fse(n,e,i)}function mse(n){let e=re();n.src="",n.srcdoc=Kf(""),qy(e[dt],n)}var vn;(function(n){n[n.NONE=0]="NONE",n[n.HTML=1]="HTML",n[n.STYLE=2]="STYLE",n[n.SCRIPT=3]="SCRIPT",n[n.URL=4]="URL",n[n.RESOURCE_URL=5]="RESOURCE_URL",n[n.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING"})(vn||(vn={}));var GE,mB="svg",gse="math";function vse(){return GE||(GE={},Fl(vn.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),Fl(vn.STYLE,void 0,[["*",["style"]]]),Fl(vn.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),Fl(vn.URL,gse,[["annotation",["href","xlink:href"]],["annotation-xml",["href","xlink:href"]],["maction",["href","xlink:href"]],["malignmark",["href","xlink:href"]],["math",["href","xlink:href"]],["mroot",["href","xlink:href"]],["msqrt",["href","xlink:href"]],["merror",["href","xlink:href"]],["mfrac",["href","xlink:href"]],["mglyph",["href","xlink:href"]],["msub",["href","xlink:href"]],["msup",["href","xlink:href"]],["msubsup",["href","xlink:href"]],["mmultiscripts",["href","xlink:href"]],["mprescripts",["href","xlink:href"]],["mi",["href","xlink:href"]],["mn",["href","xlink:href"]],["mo",["href","xlink:href"]],["mpadded",["href","xlink:href"]],["mphantom",["href","xlink:href"]],["mrow",["href","xlink:href"]],["ms",["href","xlink:href"]],["mspace",["href","xlink:href"]],["mstyle",["href","xlink:href"]],["mtable",["href","xlink:href"]],["mtd",["href","xlink:href"]],["mtr",["href","xlink:href"]],["mtext",["href","xlink:href"]],["mover",["href","xlink:href"]],["munder",["href","xlink:href"]],["munderover",["href","xlink:href"]],["semantics",["href","xlink:href"]],["none",["href","xlink:href"]]]),Fl(vn.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),Fl(vn.URL,mB,[["a",["href","xlink:href"]]]),Fl(vn.ATTRIBUTE_NO_BINDING,mB,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),Fl(vn.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]]])),GE}function Fl(n,e,t){for(let[r,s]of t){let i=e&&r!=="*"&&r!=="unknown"?`:${e}:${r}`:r;i=i.toLowerCase();for(let o of s)GE[`${i}|${o.toLowerCase()}`]=n}}function N2(n){let e=Wy();return e?cB(e.sanitize(vn.HTML,n)||""):Ai(n,"HTML")?cB(zr(n)):xS(qo(),Dt(n))}function P2(n){let e=Wy();return e?e.sanitize(vn.STYLE,n)||"":Ai(n,"Style")?zr(n):Dt(n)}function R2(n){let e=Wy();return e?e.sanitize(vn.URL,n)||"":Ai(n,"URL")?zr(n):Jf(Dt(n))}function CS(n){let e=Wy();if(e)return dB(e.sanitize(vn.RESOURCE_URL,n)||"");if(Ai(n,"ResourceURL"))return dB(zr(n));throw new Pe(904,!1)}function F2(n){let e=Wy();if(e)return uB(e.sanitize(vn.SCRIPT,n)||"");if(Ai(n,"Script"))return uB(zr(n));throw new Pe(905,!1)}function I8(n){return Kf(n[0])}function _8(n){return Zre(n[0])}var yse={embed:{src:!0},frame:{src:!0},iframe:{src:!0},media:{src:!0},base:{href:!0},link:{href:!0},object:{data:!0,codebase:!0}};function bse(n,e){return yse[n.toLowerCase()]?.[e.toLowerCase()]===!0?CS:R2}function k8(n,e,t){return bse(e,t)(n)}function wse(n){if(n.toLowerCase().startsWith("on"))throw new Pe(306,!1)}function Wy(){let n=re();return n&&n[Ho].sanitizer}var RE=new Set(["href","xlink:href"]),Ese={iframe:{sandbox:!0,allow:!0,allowfullscreen:!0,referrerpolicy:!0,csp:!0,fetchpriority:!0},":svg:animate":{attributename:!0,to:RE,values:RE,from:RE},":svg:set":{attributename:!0,to:RE},":svg:animatemotion":{attributename:!0},":svg:animatetransform":{attributename:!0}};function L2(n,e,t){let r=e.toLowerCase(),s=t.toLowerCase(),o=Cr()===-1?null:Dn();if(o&&o.type!==2)return n;let a=r[0]!==":"&&o?.namespace?`:${o.namespace}:${r}`:r,c=Ese[a]?.[s];if(!c)return n;let u=re();if(o&&r==="iframe"){let f=Xs(o,u);mse(f)}let d=e[0]===":"?e.split(":").pop():e;if(typeof c!="boolean"){if(!o)throw new Pe(-910,!1);let h=Xs(o,u).getAttribute("attributeName");if(h&&c.has(h.toLowerCase()))throw new Pe(-910,!1);return n}let p=!1;throw new Pe(-910,p)}function A8(n){return n.ownerDocument.defaultView}function M8(n){return n.ownerDocument}function O2(n){return n.ownerDocument.body}var xse="\uFFFD";function gf(n){return n instanceof Function?n():n}function Sse(n,e,t){let r=n.length;for(;;){let s=n.indexOf(e,t);if(s===-1)return s;if(s===0||n.charCodeAt(s-1)<=32){let i=e.length;if(s+i===r||n.charCodeAt(s+i)<=32)return s}t=s+1}}var N8="ng-template";function Cse(n,e,t,r){let s=0;if(r){for(;s-1){let i;for(;++si?p="":p=s[d+1].toLowerCase(),r&2&&u!==p){if(Zi(r))return!1;o=!0}}}}return Zi(r)||o}function Zi(n){return(n&1)===0}function Ise(n,e,t,r){if(e===null)return-1;let s=0;if(r||!t){let i=!1;for(;s-1)for(t++;t0?'="'+a+'"':"")+"]"}else r&8?s+="."+o:r&4&&(s+=" "+o);else s!==""&&!Zi(o)&&(e+=gB(i,s),s=""),r=o,i=i||!Zi(r);t++}return s!==""&&(e+=gB(i,s)),e}function Pse(n){return n.map(Nse).join(",")}function Rse(n){let e=[],t=[],r=1,s=2;for(;rXe&&L8(n,e,Xe,!1),yn(o?2:0,s),t(r,s)}finally{Pa(i),yn(o?3:1,s)}}function DS(n,e,t){Use(n,e,t),(t.flags&64)===64&&qse(n,e,t)}function j2(n,e,t=Xs){let r=e.localNames;if(r!==null){let s=e.index+1;for(let i=0;inull;function Vse(n){k$(n)?T8(n):Dre(n)}function $se(){B8=Vse}function Hse(n){return n==="class"?"className":n==="for"?"htmlFor":n==="formaction"?"formAction":n==="innerHtml"?"innerHTML":n==="readonly"?"readOnly":n==="tabindex"?"tabIndex":n}function Rs(n,e,t,r,s,i,o,a){if(!a&&z2(e,n,t,r,s)){no(e)&&jse(t,e.index);return}if(e.type&3){let c=Xs(e,t);r=Hse(r),s=o!=null?o(s,e.value||"",r):s,i.setProperty(c,r,s)}else e.type&12}function jse(n,e){let t=Qs(e,n);t[ct]&16||(t[ct]|=64)}function Use(n,e,t){let r=t.directiveStart,s=t.directiveEnd;no(t)&&Lse(e,t,n.data[r+t.componentOffset]),n.firstCreatePass||hx(t,e);let i=t.initialInputs;for(let o=r;o=0?r[a]():r[-a].unsubscribe(),o+=2}else{let a=r[t[o+1]];t[o].call(a)}r!==null&&(e[$l]=null);let s=e[Hl];if(s!==null){e[Hl]=null;for(let o=0;o{Gf(n.lView)},consumerOnSignalRead(){this.lView[Si]=this}};function lie(n){let e=n[Si]??Object.create(cie);return e.lView=n,e}var cie={...Da,consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:n=>{let e=Gl(n.lView);for(;e&&!Q8(e[_e]);)e=Gl(e);e&&Hk(e)},consumerOnSignalRead(){this.lView[Si]=this}};function Q8(n){return n.type!==2}function K8(n){if(n[ka]===null)return;let e=!0;for(;e;){let t=!1;for(let r of n[ka])r.dirty&&(t=!0,r.zone===null||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()));e=t&&!!(n[ct]&8192)}}var uie=100;function J8(n,e=!0,t=0){let s=n[Ho].rendererFactory,i=!1;i||s.begin?.();try{die(n,t)}catch(o){throw e&&W2(n,o),o}finally{i||s.end?.()}}function die(n,e){let t=ZV();try{ux(!0),T1(n,e);let r=0;for(;Oy(n);){if(r===uie)throw new Pe(103,!1);r++,T1(n,1)}}finally{ux(t)}}function eH(n,e,t,r){if(Na(e))return;let s=e[ct],i=!1,o=!1;Xk(e);let a=!0,c=null,u=null;i||(Q8(n)?(u=sie(e),c=Ia(u)):Yw()===null?(a=!1,u=lie(e),c=Ia(u)):e[Si]&&(Qc(e[Si]),e[Si]=null));try{$V(e),YV(n.bindingStartIndex),t!==null&&O8(n,e,t,2,r);let d=(s&3)===3;if(!i)if(d){let h=n.preOrderCheckHooks;h!==null&&jE(e,h,null)}else{let h=n.preOrderHooks;h!==null&&UE(e,h,0,null),c_(e,0)}if(o||pie(e),K8(e),tH(e,0),n.contentQueries!==null&&p8(n,e),!i)if(d){let h=n.contentCheckHooks;h!==null&&jE(e,h)}else{let h=n.contentHooks;h!==null&&UE(e,h,1),c_(e,1)}hie(n,e);let p=n.components;p!==null&&rH(e,p,0);let f=n.viewQuery;if(f!==null&&c1(2,f,r),!i)if(d){let h=n.viewCheckHooks;h!==null&&jE(e,h)}else{let h=n.viewHooks;h!==null&&UE(e,h,2),c_(e,2)}if(n.firstUpdatePass===!0&&(n.firstUpdatePass=!1),e[wf]){for(let h of e[wf])h();e[wf]=null}i||(Y8(e),e[ct]&=-73)}catch(d){throw i||Gf(e),d}finally{u!==null&&(Al(u,c),a&&oie(u)),Qk()}}function tH(n,e){for(let t=R$(n);t!==null;t=F$(t))for(let r=qn;r0&&(n[t-1][ts]=r[ts]);let i=rx(n,qn+e);$8(r[_e],r);let o=i[Yi];o!==null&&o.detachView(i[_e]),r[Wn]=null,r[ts]=null,r[ct]&=-129}return r}function mie(n,e,t,r){let s=qn+r,i=t.length;r>0&&(t[s-1][ts]=e),r-1&&(yy(e,r),rx(t,r))}this._attachedToViewContainer=!1}Gy(this._lView[_e],this._lView)}onDestroy(e){dS(this._lView,e)}markForCheck(){AS(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[ct]&=-129}reattach(){q_(this._lView),this._lView[ct]|=128}detectChanges(){this._lView[ct]|=1024,J8(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new Pe(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=zl(this._lView),t=this._lView[_u];t!==null&&!e&&Z2(t,this._lView),H8(this._lView[_e],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Pe(902,!1);this._appRef=e;let t=zl(this._lView),r=this._lView[_u];r!==null&&!t&&oH(r,this._lView),q_(this._lView)}};function gie(n){return Oy(n._lView)||!!(n._lView[ct]&64)}function vie(n){Hk(n._cdRefInjectingView||n._lView)}var xr=class{};l(xr,"__NG_ELEMENT_ID__",wie);var yie=xr,bie=class extends yie{constructor(t,r,s){super();l(this,"_declarationLView");l(this,"_declarationTContainer");l(this,"elementRef");this._declarationLView=t,this._declarationTContainer=r,this.elementRef=s}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,r){return this.createEmbeddedViewImpl(t,r)}createEmbeddedViewImpl(t,r,s){let i=eh(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:r,dehydratedView:s});return new Rf(i)}};function wie(){return MS($t(),re())}function MS(n,e){return n.type&4?new bie(e,n,Yf(n,e)):null}var D1="<-- AT THIS LOCATION";function Eie(n){switch(n){case 4:return"view container";case 2:return"element";case 8:return"ng-container";case 32:return"icu";case 64:return"i18n";case 16:return"projection";case 1:return"text";case 128:return"@let";default:return""}}function xie(n,e){let t=`During serialization, Angular was unable to find an element in the DOM: + +`,r=`${Iie(n,e,!1)} + +`,s=kie();throw new Pe(-502,t+r+s)}function Sie(n){let e="During serialization, Angular detected DOM nodes that were created outside of Angular context and provided as projectable nodes (likely via `ViewContainerRef.createComponent` or `createComponent` APIs). Hydration is not supported for such cases, consider refactoring the code to avoid this pattern or using `ngSkipHydration` on the host element of the component.\n\n",t=`${_ie(n)} + +`,r=e+t+Aie();return new Pe(-503,r)}function Cie(n){let e=[];if(n.attrs)for(let t=0;t${e}`;case 8:return"";case 4:return"";default:return`#node(${Eie(n.type)})`}}function ZE(n,e="\u2026"){let t=n;switch(t.nodeType){case Node.ELEMENT_NODE:let r=t.tagName.toLowerCase(),s=Die(t);return`<${r}${s?" "+s:""}>${e}`;case Node.TEXT_NODE:let i=t.textContent?Dx(t.textContent):"";return`#text${i?`(${i})`:""}`;case Node.COMMENT_NODE:return``;default:return`#node(${t.nodeType})`}}function Iie(n,e,t){let r=" ",s="";e.prev?(s+=r+`\u2026 +`,s+=r+v_(e.prev)+` +`):e.type&&e.type&12&&(s+=r+`\u2026 +`),t?(s+=r+v_(e)+` +`,s+=r+` ${D1} +`):s+=r+v_(e)+` ${D1} +`,s+=r+`\u2026 +`;let i=e.type?Y2(n[_e],e,n):null;return i&&(s=ZE(i,` +`+s)),s}function _ie(n){let e=" ",t="",r=n;return r.previousSibling&&(t+=e+`\u2026 +`,t+=e+ZE(r.previousSibling)+` +`),t+=e+ZE(r)+` ${D1} +`,n.nextSibling&&(t+=e+`\u2026 +`),n.parentNode&&(t=ZE(r.parentNode,` +`+t)),t}function kie(n){return`To fix this problem: + * check ${n?`the "${n}"`:"corresponding"} component for hydration-related issues + * check to see if your template has valid HTML structure + * or skip hydration by adding the \`ngSkipHydration\` attribute to its host node in a template + +`}function Aie(){return`Note: attributes are only displayed to better represent the DOM but have no effect on hydration mismatches. + +`}function Mie(n){return n.replace(/\s+/gm,"")}function Dx(n,e=50){return n?(n=Mie(n),n.length>e?`${n.substring(0,e-1)}\u2026`:n):""}function aH(n,e,t){let r=e.insertBeforeIndex,s=Array.isArray(r)?r[0]:r;return s===null?q8(n,e,t):an(t[s])}function lH(n,e,t,r,s){let i=e.insertBeforeIndex;if(Array.isArray(i)){let o=r,a=null;if(e.type&3||(a=o,o=s),o!==null&&e.componentOffset===-1)for(let c=1;c1)for(let t=n.length-2;t>=0;t--){let r=n[t];uH(r)||Rie(r,e)&&Fie(r)===null&&Lie(r,e.index)}}function uH(n){return!(n.type&64)}function Rie(n,e){return uH(e)||n.index>e.index}function Fie(n){let e=n.insertBeforeIndex;return Array.isArray(e)?e[0]:e}function Lie(n,e){let t=n.insertBeforeIndex;Array.isArray(t)?t[0]=e:(z8(aH,lH),n.insertBeforeIndex=e)}function $v(n,e){let t=n.data[e];return t===null||typeof t=="string"?null:t.hasOwnProperty("currentCaseLViewIndex")?t:t.value}function Oie(n,e,t){let r=n.data[e];r===null?n.data[e]=t:r.value=t}function Bie(n,e){let t=n.insertBeforeIndex;t===null?(z8(aH,lH),t=n.insertBeforeIndex=[null,e]):(zee(Array.isArray(t),!0,"Expecting array here"),t.push(e))}function Vie(n,e,t){let r=J2(n,t,64,null,null);return cH(e,r),r}function NS(n,e){let t=e[n.currentCaseLViewIndex];return t===null?t:t<0?~t:t}function $ie(n){return n>>>17}function Hie(n){return(n&131070)>>>1}function jie(n,e,t){return n|e<<17|t<<1}function dH(n){return n===-1}function eA(n,e,t){n.index=0;let r=NS(e,t);r!==null?n.removes=e.remove[r]:n.removes=on}function Ix(n){if(n.index0)return n.lView[e];{n.stack.push(n.index,n.removes);let t=~e,r=n.lView[_e].data[t];return eA(n,r,n.lView),Ix(n)}}else return n.stack.length===0?null:(n.removes=n.stack.pop(),n.index=n.stack.pop(),Ix(n))}function Uie(){let n={stack:[],index:-1};function e(t,r){for(n.lView=r;n.stack.length;)n.stack.pop();return eA(n,t.value,r),Ix.bind(null,n)}return e}function qie(n,e){let t={stack:[],index:-1,lView:e};return eA(t,n,e),Ix.bind(null,t)}var Wie=new RegExp(`^(\\d+)*(${c2}|${l2})*(.*)`);function zie(n,e){let t=[n];for(let r of e){let s=t.length-1;if(s>0&&t[s-1]===r){let i=t[s]||1;t[s]=i+1}else t.push(r,"")}return t.join("")}function Gie(n){let e=n.match(Wie),[t,r,s,i]=e,o=r?parseInt(r,10):s,a=[];for(let[c,u,d]of i.matchAll(/(f|n)(\d*)/g)){let p=parseInt(d,10)||1;a.push(u,p)}return[o,...a]}function Zie(n){return!n.prev&&n.parent?.type===8}function y_(n){return n.index-Xe}function by(n,e){return!(n.type&144)&&!!e[n.index]&&pH(an(e[n.index]))}function pH(n){return!!n&&!n.isConnected}function fH(n,e){let t=n.i18nNodes;if(t)return t.get(e)}function Yie(n,e,t){let s=n.data[mf]?.[t];return s?hH(s,e):null}function Zy(n,e,t,r){let s=y_(r),i=fH(n,s);if(i===void 0){let o=n.data[mf];if(o?.[s])i=hH(o[s],t);else if(e.firstChild===r)i=n.firstChild;else{let a=r.prev===null,c=r.prev??r.parent;if(Zie(r)){let u=y_(r.parent);i=l1(n,u)}else{let u=Xs(c,t);if(a)i=u.firstChild;else{let d=y_(c),p=l1(n,d);if(c.type===2&&p){let h=x2(n,d)+1;i=PS(h,p)}else i=u.nextSibling}}}}return i}function PS(n,e){let t=e;for(let r=0;r-1){let c=o.substring(a+i.length).trim();s.set(c,r)}}return s}function eoe(n){return n.textContent?.trimStart().startsWith("ngh=")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}var mH=!1,gH=()=>{};function vH(n){mH=n}function tA(){return mH}function toe(n,e,t,r){gH(n,e,t,r)}function noe(){gH=uoe}function roe(n){return n=n??ye(In),n.get(j$,!1)}function soe(n,e){let t=e.i18nChildren.get(n);return t===void 0&&(t=ioe(n),e.i18nChildren.set(n,t)),t}function ioe(n){let e=new Set;function t(r){switch(e.add(r.index),r.kind){case 1:case 2:{for(let s of r.children)t(s);break}case 3:{for(let s of r.cases)for(let i of s)t(i);break}}}for(let r=Xe;r{};function doe(n,e,t){yH(n,e,t)}function poe(){yH=foe}function foe(n,e,t){let r=n[ds]?.dehydratedIcuData;r&&r.get(e)?.case===t&&r.delete(e)}function hoe(n){let e=n[ds];if(e){let{i18nNodes:t,dehydratedIcuData:r}=e;if(t&&r){let s=n[dt];for(let i of r.values())moe(s,t,i)}e.i18nNodes=void 0,e.dehydratedIcuData=void 0}}function moe(n,e,t){for(let r of t.node.cases[t.case]){let s=e.get(r.index-Xe);s&&qy(n,s,!1)}}function bH(n){let e=n[Ji]??[],r=n[Wn][dt],s=[];for(let i of e)i.data[u2]!==void 0?s.push(i):wH(i,r);n[Ji]=s}function goe(n){let{lContainer:e}=n,t=e[Ji];if(t===null)return;let s=e[Wn][dt];for(let i of t)wH(i,s)}function wH(n,e){let t=0,r=n.firstChild;if(r){let s=n.data[ql];for(;t0&&(i.firstChild=n,n=PS(r[ql],n)),t.push(i)}return[n,t]}var xH=()=>null;function boe(n,e){let t=n[Ji];return!e||t===null||t.length===0?null:t[0].data[r1]===e?t.shift():(bH(n),null)}function woe(){xH=boe}function Ff(n,e){return xH(n,e)}var SH=class{},nA=class{},k1=class{resolveComponentFactory(e){throw Error(`No component factory found for ${Ur(e)}.`)}},L_,Yy=(L_=class{},l(L_,"NULL",new k1),L_),Nu=class{},Qn=class{constructor(){l(this,"destroyNode",null)}};l(Qn,"__NG_ELEMENT_ID__",()=>Eoe());function Eoe(){let n=re(),e=$t(),t=Qs(e.index,n);return(Nr(t)?t:n)[dt]}var tS=class tS{};l(tS,"\u0275prov",rn({token:tS,providedIn:"root",factory:()=>null}));var kx=tS;function rA(n){return n.ngModule!==void 0}function ou(n){return!!Wl(n)}function FE(n){return!!Oa(n)}function yB(n){return!!to(n)}function Hv(n){return!!Bn(n)}function xoe(n){return Bn(n)?"component":to(n)?"directive":Oa(n)?"pipe":"type"}function Soe(n,e){if(sS(n)&&(n=nn(n),!n))throw new Error(`Expected forwardRef function, imported from "${Ei(e)}", to return a standalone entity or NgModule but got "${Ei(n)||n}".`);if(Wl(n)==null){let t=Bn(n)||to(n)||Oa(n);if(t!=null){if(!t.standalone)throw new Error(`The "${Ei(n)}" ${xoe(n)}, imported from "${Ei(e)}", is not standalone. Did you forget to add the standalone: true flag?`)}else throw rA(n)?new Error(`A module with providers was imported from "${Ei(e)}". Modules with providers are not supported in standalone components imports.`):new Error(`The "${Ei(n)}" type, imported from "${Ei(e)}", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`)}}var Coe=!0,A1=class{constructor(){l(this,"ownerNgModule",new Map);l(this,"ngModulesWithSomeUnresolvedDecls",new Set);l(this,"ngModulesScopeCache",new Map);l(this,"standaloneComponentsScopeCache",new Map)}resolveNgModulesDecls(){if(this.ngModulesWithSomeUnresolvedDecls.size!==0){for(let e of this.ngModulesWithSomeUnresolvedDecls){let t=Wl(e);if(t?.declarations)for(let r of gf(t.declarations))Hv(r)&&this.ownerNgModule.set(r,e)}this.ngModulesWithSomeUnresolvedDecls.clear()}}getComponentDependencies(e,t){this.resolveNgModulesDecls();let r=Bn(e);if(r===null)throw new Error(`Attempting to get component dependencies for a type that is not a component: ${e}`);if(r.standalone){let s=this.getStandaloneComponentScope(e,t);return s.compilation.isPoisoned?{dependencies:[]}:{dependencies:[...s.compilation.directives,...s.compilation.pipes,...s.compilation.ngModules]}}else{if(!this.ownerNgModule.has(e))return{dependencies:[]};let s=this.getNgModuleScope(this.ownerNgModule.get(e));return s.compilation.isPoisoned?{dependencies:[]}:{dependencies:[...s.compilation.directives,...s.compilation.pipes]}}}registerNgModule(e,t){if(!ou(e))throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${e}`);this.ngModulesWithSomeUnresolvedDecls.add(e)}clearScopeCacheFor(e){this.ngModulesScopeCache.delete(e),this.standaloneComponentsScopeCache.delete(e)}getNgModuleScope(e){if(this.ngModulesScopeCache.has(e))return this.ngModulesScopeCache.get(e);let t=this.computeNgModuleScope(e);return this.ngModulesScopeCache.set(e,t),t}computeNgModuleScope(e){let t=Wl(e,!0),r={exported:{directives:new Set,pipes:new Set},compilation:{directives:new Set,pipes:new Set}};for(let s of gf(t.imports))if(ou(s)){let i=this.getNgModuleScope(s);Ll(i.exported.directives,r.compilation.directives),Ll(i.exported.pipes,r.compilation.pipes)}else if(ix(s))if(yB(s)||Hv(s))r.compilation.directives.add(s);else if(FE(s))r.compilation.pipes.add(s);else throw new Pe(980,"The standalone imported type is neither a component nor a directive nor a pipe");else{r.compilation.isPoisoned=!0;break}if(!r.compilation.isPoisoned)for(let s of gf(t.declarations)){if(ou(s)||ix(s)){r.compilation.isPoisoned=!0;break}FE(s)?r.compilation.pipes.add(s):r.compilation.directives.add(s)}for(let s of gf(t.exports))if(ou(s)){let i=this.getNgModuleScope(s);Ll(i.exported.directives,r.exported.directives),Ll(i.exported.pipes,r.exported.pipes),Ll(i.exported.directives,r.compilation.directives),Ll(i.exported.pipes,r.compilation.pipes)}else FE(s)?r.exported.pipes.add(s):r.exported.directives.add(s);return r}getStandaloneComponentScope(e,t){if(this.standaloneComponentsScopeCache.has(e))return this.standaloneComponentsScopeCache.get(e);let r=this.computeStandaloneComponentScope(e,t);return this.standaloneComponentsScopeCache.set(e,r),r}computeStandaloneComponentScope(e,t){let r={compilation:{directives:new Set([e]),pipes:new Set,ngModules:new Set}};for(let s of Oo(t??[])){let i=nn(s);try{Soe(i,e)}catch{return r.compilation.isPoisoned=!0,r}if(ou(i)){r.compilation.ngModules.add(i);let o=this.getNgModuleScope(i);if(o.exported.isPoisoned)return r.compilation.isPoisoned=!0,r;Ll(o.exported.directives,r.compilation.directives),Ll(o.exported.pipes,r.compilation.pipes)}else if(FE(i))r.compilation.pipes.add(i);else if(yB(i)||Hv(i))r.compilation.directives.add(i);else return r.compilation.isPoisoned=!0,r}return r}isOrphanComponent(e){let t=Bn(e);return!t||t.standalone?!1:(this.resolveNgModulesDecls(),!this.ownerNgModule.has(e))}};function Ll(n,e){for(let t of n)e.add(t)}var Lf=new A1,YE={},Cf=class{constructor(e,t){l(this,"injector");l(this,"parentInjector");this.injector=e,this.parentInjector=t}get(e,t,r){r=Ny(r);let s=this.injector.get(e,YE,r);return s!==YE||t===YE?s:this.parentInjector.get(e,t,r)}};function M1(n,e,t){let r=t?n.styles:null,s=t?n.classes:null,i=0;if(e!==null)for(let o=0;o0&&(t.directiveToIndex=new Map);for(let f=0;f0;){let t=n[--e];if(typeof t=="number"&&t<0)return t}return 0}function Roe(n,e,t){if(t){if(e.exportAs)for(let r=0;r{let[t,r,s]=n[e],i={propName:t,templateName:e,isSignal:(r&gy.SignalBased)!==0};return s&&(i.transform=s),i})}function Ooe(n){return Object.keys(n).map(e=>({propName:n[e],templateName:e}))}function Boe(n,e,t){let r=e instanceof $o?e:e?.injector;return r&&n.getStandaloneInjector!==null&&(r=n.getStandaloneInjector(r)||r),r?new Cf(t,r):t}function Voe(n){let e=n.get(Nu,null);if(e===null)throw new Pe(407,!1);let t=n.get(kx,null),r=n.get(Ti,null);return{rendererFactory:e,sanitizer:t,changeDetectionScheduler:r}}function $oe(n,e){let t=(n.selectors[0][0]||"div").toLowerCase();return SS(e,t,t==="svg"?Ok:t==="math"?Bk:null)}var Yl=class extends nA{constructor(t,r){super();l(this,"componentDef");l(this,"ngModule");l(this,"selector");l(this,"componentType");l(this,"ngContentSelectors");l(this,"isBoundToModule");l(this,"cachedInputs",null);l(this,"cachedOutputs",null);this.componentDef=t,this.ngModule=r,this.componentType=t.type,this.selector=Pse(t.selectors),this.ngContentSelectors=t.ngContentSelectors??[],this.isBoundToModule=!!r}get inputs(){return this.cachedInputs??(this.cachedInputs=Loe(this.componentDef.inputs)),this.cachedInputs}get outputs(){return this.cachedOutputs??(this.cachedOutputs=Ooe(this.componentDef.outputs)),this.cachedOutputs}create(t,r,s,i){yn(22);let o=gt(null);try{let a=this.componentDef,c=s?["ng-version","19.2.25"]:Rse(this.componentDef.selectors[0]),u=V2(0,null,null,1,0,null,null,null,null,[c],null),d=Boe(a,i||this.ngModule,t),p=Voe(d),f=p.rendererFactory.createRenderer(null,a),h=s?Ose(f,s,a.encapsulation,d):$oe(a,f),m=TS(null,u,null,512|$2(a),null,null,p,f,d,null,i8(h,d,!0));m[Xe]=h,Xk(m);let g=null;try{let y=DH(Xe,u,m,"#host",()=>[this.componentDef],!0,0);h&&(D8(f,h,y),xi(h,m)),DS(u,m,y),S2(u,y,m),IH(u,y),r!==void 0&&Hoe(y,this.ngContentSelectors,r),g=Qs(y.index,m),m[Fn]=g[Fn],IS(u,m,null)}catch(y){throw g!==null&&e1(g),e1(m),y}finally{yn(23),Qk()}return new Mx(this.componentType,m)}finally{gt(o)}}},Mx=class extends SH{constructor(t,r){super();l(this,"_rootLView");l(this,"instance");l(this,"hostView");l(this,"changeDetectorRef");l(this,"componentType");l(this,"location");l(this,"previousInputValues",null);l(this,"_tNode");this._rootLView=r,this._tNode=Hu(r[_e],Xe),this.location=Yf(this._tNode,r),this.instance=Qs(this._tNode.index,r)[Fn],this.hostView=this.changeDetectorRef=new Rf(r,void 0,!1),this.componentType=t}setInput(t,r){let s=this._tNode;if(this.previousInputValues??(this.previousInputValues=new Map),this.previousInputValues.has(t)&&Object.is(this.previousInputValues.get(t),r))return;let i=this._rootLView,o=z2(s,i[_e],i,t,r);this.previousInputValues.set(t,r);let a=Qs(s.index,i);AS(a,1)}get injector(){return new Ul(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}};function Hoe(n,e,t){let r=n.projection=[];for(let s=0;s0;)this.remove(this.length-1)}get(t){let r=xB(this._lContainer);return r!==null&&r[t]||null}get length(){return this._lContainer.length-qn}createEmbeddedView(t,r,s){let i,o;typeof s=="number"?i=s:s!=null&&(i=s.index,o=s.injector);let a=Ff(this._lContainer,t.ssrId),c=t.createEmbeddedViewImpl(r||{},o,a);return this.insertImpl(c,i,Mu(this._hostTNode,a)),c}createComponent(t,r,s,i,o){let a=t&&!Fv(t),c;if(a)c=r;else{let g=r||{};c=g.index,s=g.injector,i=g.projectableNodes,o=g.environmentInjector||g.ngModuleRef}let u=a?t:new Yl(Bn(t)),d=s||this.parentInjector;if(!o&&u.ngModule==null){let y=(a?d:this.parentInjector).get($o,null);y&&(o=y)}let p=Bn(u.componentType??{}),f=Ff(this._lContainer,p?.id??null),h=f?.firstChild??null,m=u.create(d,i,h,o);return this.insertImpl(m.hostView,c,Mu(this._hostTNode,f)),m}insert(t,r){return this.insertImpl(t,r,!0)}insertImpl(t,r,s){let i=t._lView;if(kte(i)){let c=this.indexOf(t);if(c!==-1)this.detach(c);else{let u=i[Wn],d=new _H(u,u[qr],u[Wn]);d.detach(d.indexOf(t))}}let o=this._adjustIndex(r),a=this._lContainer;return th(a,i,o,s),t.attachToViewContainerRef(),TV(E_(a),o,t),t}move(t,r){return this.insert(t,r)}indexOf(t){let r=xB(this._lContainer);return r!==null?r.indexOf(t):-1}remove(t){let r=this._adjustIndex(t,-1),s=yy(this._lContainer,r);s&&(rx(E_(this._lContainer),r),Gy(s[_e],s))}detach(t){let r=this._adjustIndex(t,-1),s=yy(this._lContainer,r);return s&&rx(E_(this._lContainer),r)!=null?new Rf(s):null}_adjustIndex(t,r=0){return t??this.length+r}};function xB(n){return n[lx]}function E_(n){return n[lx]||(n[lx]=[])}function kH(n,e){let t,r=e[n.index];return Pr(r)?t=r:(t=sH(r,e,null,n),e[n.index]=t,H2(e,t)),AH(t,e,n,r),new _H(t,n,e)}function qoe(n,e){let t=n[dt],r=t.createComment(""),s=Xs(e,n),i=t.parentNode(s);return Au(t,i,r,t.nextSibling(s),!1),r}var AH=NH,iA=()=>!1;function MH(n,e,t){return iA(n,e,t)}function NH(n,e,t,r){if(n[jo])return;let s;t.type&8?s=an(r):s=qoe(e,t),n[jo]=s}function Woe(n,e,t){if(n[jo]&&n[Ji])return!0;let r=t[ds],s=e.index-Xe;if(!r||dy(e)||qu(r,s))return!1;let o=l1(r,s),a=r.data[Eu]?.[s],[c,u]=yoe(o,a);return n[jo]=c,n[Ji]=u,!0}function zoe(n,e,t,r){iA(n,t,e)||NH(n,e,t,r)}function Goe(){AH=zoe,iA=Woe}var N1=class n{constructor(e){l(this,"queryList");l(this,"matches",null);this.queryList=e}clone(){return new n(this.queryList)}setDirty(){this.queryList.setDirty()}},P1=class n{constructor(e=[]){l(this,"queries");this.queries=e}createEmbeddedView(e){let t=e.queries;if(t!==null){let r=e.contentQueries!==null?e.contentQueries[0]:t.length,s=[];for(let i=0;i0)r.push(o[a/2]);else{let u=i[a+1],d=e[-c];for(let p=qn;pe.trim())}function OH(n,e,t){n.queries===null&&(n.queries=new R1),n.queries.track(new F1(e,t))}function Joe(n,e){let t=n.contentQueries||(n.contentQueries=[]),r=t.length?t[t.length-1]:-1;e!==r&&t.push(n.queries.length-1,e)}function aA(n,e){return n.queries.getByIndex(e)}function BH(n,e){let t=n[_e],r=aA(t,e);return r.crossesNgTemplate?L1(t,n,e,[]):PH(t,n,r,e)}function lA(n,e,t){let r,s=Kw(()=>{r._dirtyCounter();let i=eae(r,n);if(e&&i===void 0)throw new Pe(-951,!1);return i});return r=s[sr],r._dirtyCounter=Di(0),r._flatValue=void 0,s}function VH(n){return lA(!0,!1,n)}function $H(n){return lA(!0,!0,n)}function HH(n){return lA(!1,!1,n)}function jH(n,e){let t=n[sr];t._lView=re(),t._queryIndex=e,t._queryList=oA(t._lView,e),t._queryList.onDirty(()=>t._dirtyCounter.update(r=>r+1))}function eae(n,e){let t=n._lView,r=n._queryIndex;if(t===void 0||r===void 0||t[ct]&4)return e?void 0:on;let s=oA(t,r),i=BH(t,r);return s.reset(i,D$),e?s.first:s._changesDetected||n._flatValue===void 0?n._flatValue=s.toArray():n._flatValue}function SB(n,e){return VH(e)}function tae(n,e){return $H(e)}var nae=(SB.required=tae,SB);function rae(n,e){return HH(e)}function CB(n,e){return VH(e)}function sae(n,e){return $H(e)}var iae=(CB.required=sae,CB);function oae(n,e){return HH(e)}function UH(n,e){let t=Object.create(yV),r=new ly;t.value=n;function s(){return kl(t),TB(t.value),t.value}return s[sr]=t,s.asReadonly=gS.bind(s),s.set=i=>{t.equal(t.value,i)||(Kc(t,i),r.emit(i))},s.update=i=>{TB(t.value),s.set(i(t.value))},s.subscribe=r.subscribe.bind(r),s.destroyRef=r.destroyRef,s}function TB(n){if(n===rS)throw new Pe(952,!1)}function DB(n,e){return UH(n,e)}function aae(n){return UH(rS,n)}var lae=(DB.required=aae,DB),qH=!0,Pu=class{},cae=Kl("ContentChildren",(n,e={})=>({selector:n,first:!1,isViewQuery:!1,descendants:!1,emitDistinctChangesOnly:qH,...e}),Pu),uae=Kl("ContentChild",(n,e={})=>({selector:n,first:!0,isViewQuery:!1,descendants:!0,...e}),Pu),dae=Kl("ViewChildren",(n,e={})=>({selector:n,first:!1,isViewQuery:!0,descendants:!0,emitDistinctChangesOnly:qH,...e}),Pu),Ua=Kl("ViewChild",(n,e)=>({selector:n,first:!0,isViewQuery:!0,descendants:!0,...e}),Pu);function WH(n){let e=[],t=new Map;function r(s){let i=t.get(s);if(!i){let o=n(s);t.set(s,i=o.then(gae))}return i}return Of.forEach((s,i)=>{let o=[];s.templateUrl&&o.push(r(s.templateUrl).then(u=>{s.template=u}));let a=typeof s.styles=="string"?[s.styles]:s.styles||[];if(s.styles=a,s.styleUrl&&s.styleUrls?.length)throw new Error("@Component cannot define both `styleUrl` and `styleUrls`. Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple");if(s.styleUrls?.length){let u=s.styles.length,d=s.styleUrls;s.styleUrls.forEach((p,f)=>{a.push(""),o.push(r(p).then(h=>{a[u+f]=h,d.splice(d.indexOf(p),1),d.length==0&&(s.styleUrls=void 0)}))})}else s.styleUrl&&o.push(r(s.styleUrl).then(u=>{a.push(u),s.styleUrl=void 0}));let c=Promise.all(o).then(()=>vae(i));e.push(c)}),GH(),Promise.all(e).then(()=>{})}var Of=new Map,wy=new Set;function pae(n,e){zH(e)&&(Of.set(n,e),wy.add(n))}function fae(n){return wy.has(n)}function zH(n){return!!(n.templateUrl&&!n.hasOwnProperty("template")||n.styleUrls&&n.styleUrls.length||n.styleUrl)}function GH(){let n=Of;return Of=new Map,n}function hae(n){wy.clear(),n.forEach((e,t)=>wy.add(t)),Of=n}function mae(){return Of.size===0}function gae(n){return typeof n=="string"?n:n.text()}function vae(n){wy.delete(n)}var O1=new Map,ZH=!0;function yae(n,e,t){if(e&&e!==t&&ZH)throw new Error(`Duplicate module registered for ${n} - ${Ur(e)} vs ${Ur(e.name)}`)}function cA(n,e){let t=O1.get(e)||null;yae(e,t,n),O1.set(e,n)}function YH(n){return O1.get(n)}function bae(n){ZH=!n}var Xl=class{},XH=class{};function FS(n,e){return new Bf(n,e??null,[])}var wae=FS,Bf=class extends Xl{constructor(t,r,s,i=!0){super();l(this,"ngModuleType");l(this,"_parent");l(this,"_bootstrapComponents",[]);l(this,"_r3Injector");l(this,"instance");l(this,"destroyCbs",[]);l(this,"componentFactoryResolver",new Ax(this));this.ngModuleType=t,this._parent=r;let o=Wl(t);this._bootstrapComponents=gf(o.bootstrap),this._r3Injector=b$(t,r,[{provide:Xl,useValue:this},{provide:Yy,useValue:this.componentFactoryResolver},...s],Ur(t),new Set(["environment"])),i&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){let t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(r=>r()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}},Vf=class extends XH{constructor(t){super();l(this,"moduleType");this.moduleType=t}create(t){return new Bf(this.moduleType,t,[])}};function Eae(n,e,t){return new Bf(n,e,t,!1)}var Px=class extends Xl{constructor(t){super();l(this,"injector");l(this,"componentFactoryResolver",new Ax(this));l(this,"instance",null);let r=new _f([...t.providers,{provide:Xl,useValue:this},{provide:Yy,useValue:this.componentFactoryResolver}],t.parent||lS(),t.debugName,new Set(["environment"]));this.injector=r,t.runEnvironmentInitializers&&r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}};function uA(n,e,t=null){return new Px({providers:n,parent:e,debugName:t,runEnvironmentInitializers:!0}).injector}var Kv=class Kv{constructor(e){l(this,"_injector");l(this,"cachedInjectors",new Map);this._injector=e}getOrCreateStandaloneInjector(e){if(!e.standalone)return null;if(!this.cachedInjectors.has(e)){let t=Mk(!1,e.type),r=t.length>0?uA([t],this._injector,`Standalone[${e.type.name}]`):null;this.cachedInjectors.set(e,r)}return this.cachedInjectors.get(e)}ngOnDestroy(){try{for(let e of this.cachedInjectors.values())e!==null&&e.destroy()}finally{this.cachedInjectors.clear()}}};l(Kv,"\u0275prov",rn({token:Kv,providedIn:"environment",factory:()=>new Kv(Mr($o))}));var B1=Kv;function QH(n){return Zo(()=>{let e=e5(n),t={...e,decls:n.decls,vars:n.vars,template:n.template,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,onPush:n.changeDetection===py.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&n.dependencies||null,getStandaloneInjector:e.standalone?s=>s.get(B1).getOrCreateStandaloneInjector(t):null,getExternalStyles:null,signals:n.signals??!1,data:n.data||{},encapsulation:n.encapsulation||ps.Emulated,styles:n.styles||on,_:null,schemas:n.schemas||null,tView:null,id:""};e.standalone&&rs("NgStandalone"),t5(t);let r=n.dependencies;return t.directiveDefs=Rx(r,!1),t.pipeDefs=Rx(r,!0),t.id=Iae(t),t})}function xae(n){return Bn(n)||to(n)}function Sae(n){return n!==null}function dA(n){return Zo(()=>({type:n.type,bootstrap:n.bootstrap||on,declarations:n.declarations||on,imports:n.imports||on,exports:n.exports||on,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null}))}function Cae(n,e){if(n==null)return Qi;let t={};for(let r in n)if(n.hasOwnProperty(r)){let s=n[r],i,o,a,c;Array.isArray(s)?(a=s[0],i=s[1],o=s[2]??i,c=s[3]||null):(i=s,o=s,a=gy.None,c=null),t[i]=[r,a,c],e[i]=o}return t}function Tae(n){if(n==null)return Qi;let e={};for(let t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function KH(n){return Zo(()=>{let e=e5(n);return t5(e),e})}function JH(n){return{type:n.type,name:n.name,factory:null,pure:n.pure!==!1,standalone:n.standalone??!0,onDestroy:n.type.prototype.ngOnDestroy||null}}function e5(n){let e={};return{type:n.type,providersResolver:null,factory:null,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:e,inputConfig:n.inputs||Qi,exportAs:n.exportAs||null,standalone:n.standalone??!0,signals:n.signals===!0,selectors:n.selectors||on,viewQuery:n.viewQuery||null,features:n.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:Cae(n.inputs,e),outputs:Tae(n.outputs),debugInfo:null}}function t5(n){n.features?.forEach(e=>e(n))}function Rx(n,e){if(!n)return null;let t=e?Oa:xae;return()=>(typeof n=="function"?n():n).map(r=>t(r)).filter(Sae)}var Dae=new Map;function Iae(n){let e=0,t=typeof n.consts=="function"?"":n.consts,r=[n.selectors,n.ngContentSelectors,n.hostVars,n.hostAttrs,t,n.vars,n.decls,n.encapsulation,n.standalone,n.signals,n.exportAs,JSON.stringify(n.inputs),JSON.stringify(n.outputs),Object.getOwnPropertyNames(n.type.prototype),!!n.contentQueries,!!n.viewQuery];for(let i of r.join("|"))e=Math.imul(31,e)+i.charCodeAt(0)<<0;return e+=2147483648,"c"+e}function n5(n){return Object.getPrototypeOf(n.prototype).constructor}function pA(n){let e=n5(n.type),t=!0,r=[n];for(;e;){let s;if(Ys(n))s=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Pe(903,!1);s=e.\u0275dir}if(s){if(t){r.push(s);let o=n;o.inputs=x_(n.inputs),o.declaredInputs=x_(n.declaredInputs),o.outputs=x_(n.outputs);let a=s.hostBindings;a&&Nae(n,a);let c=s.viewQuery,u=s.contentQueries;if(c&&Aae(n,c),u&&Mae(n,u),_ae(n,s),Uee(n.outputs,s.outputs),Ys(s)&&s.data.animation){let d=n.data;d.animation=(d.animation||[]).concat(s.data.animation)}}let i=s.features;if(i)for(let o=0;o=0;r--){let s=n[r];s.hostVars=e+=s.hostVars,s.hostAttrs=Af(s.hostAttrs,t=Af(t,s.hostAttrs))}}function x_(n){return n===Qi?{}:n===on?[]:n}function Aae(n,e){let t=n.viewQuery;t?n.viewQuery=(r,s)=>{e(r,s),t(r,s)}:n.viewQuery=e}function Mae(n,e){let t=n.contentQueries;t?n.contentQueries=(r,s,i)=>{e(r,s,i),t(r,s,i)}:n.contentQueries=e}function Nae(n,e){let t=n.hostBindings;t?n.hostBindings=(r,s)=>{e(r,s),t(r,s)}:n.hostBindings=e}var Pae=["providersResolver"],Rae=["template","decls","consts","vars","onPush","ngContentSelectors","styles","encapsulation","schemas"];function r5(n){let e=n5(n.type),t;Ys(n)?t=e.\u0275cmp:t=e.\u0275dir;let r=n;for(let s of Pae)r[s]=t[s];if(Ys(t))for(let s of Rae)r[s]=t[s]}function s5(n){let e=t=>{let r=Array.isArray(n);t.hostDirectives===null?(t.findHostDirectiveDefs=i5,t.hostDirectives=r?n.map(V1):[n]):r?t.hostDirectives.unshift(...n.map(V1)):t.hostDirectives.unshift(n)};return e.ngInherit=!0,e}function i5(n,e,t){if(n.hostDirectives!==null)for(let r of n.hostDirectives)if(typeof r=="function"){let s=r();for(let i of s)IB(V1(i),e,t)}else IB(r,e,t)}function IB(n,e,t){let r=to(n.directive);Fae(r.declaredInputs,n.inputs),i5(r,e,t),t.set(r,n),e.push(r)}function V1(n){return typeof n=="function"?{directive:nn(n),inputs:Qi,outputs:Qi}:{directive:nn(n.directive),inputs:_B(n.inputs),outputs:_B(n.outputs)}}function _B(n){if(n===void 0||n.length===0)return Qi;let e={};for(let t=0;tt.remove(n);return t.add(n),r}var Hae=()=>typeof requestIdleCallback<"u"?requestIdleCallback:setTimeout,jae=()=>typeof requestIdleCallback<"u"?cancelIdleCallback:clearTimeout,Jv=class Jv{constructor(){l(this,"executingCallbacks",!1);l(this,"idleId",null);l(this,"current",new Set);l(this,"deferred",new Set);l(this,"ngZone",ye(ln));l(this,"requestIdleCallbackFn",Hae().bind(globalThis));l(this,"cancelIdleCallbackFn",jae().bind(globalThis))}add(e){(this.executingCallbacks?this.deferred:this.current).add(e),this.idleId===null&&this.scheduleIdleCallback()}remove(e){let{current:t,deferred:r}=this;t.delete(e),r.delete(e),t.size===0&&r.size===0&&this.cancelIdleCallback()}scheduleIdleCallback(){let e=()=>{this.cancelIdleCallback(),this.executingCallbacks=!0;for(let t of this.current)t();if(this.current.clear(),this.executingCallbacks=!1,this.deferred.size>0){for(let t of this.deferred)this.current.add(t);this.deferred.clear(),this.scheduleIdleCallback()}};this.idleId=this.requestIdleCallbackFn(()=>this.ngZone.run(e))}cancelIdleCallback(){this.idleId!==null&&(this.cancelIdleCallbackFn(this.idleId),this.idleId=null)}ngOnDestroy(){this.cancelIdleCallback(),this.current.clear(),this.deferred.clear()}};l(Jv,"\u0275prov",rn({token:Jv,providedIn:"root",factory:()=>new Jv}));var $1=Jv;function BS(n){return(e,t)=>c5(n,e,t)}function c5(n,e,t){let r=t.get(Lx),s=t.get(ln),i=()=>r.remove(e);return r.add(n,e,s),i}var ey=class ey{constructor(){l(this,"executingCallbacks",!1);l(this,"timeoutId",null);l(this,"invokeTimerAt",null);l(this,"current",[]);l(this,"deferred",[])}add(e,t,r){let s=this.executingCallbacks?this.deferred:this.current;this.addToQueue(s,Date.now()+e,t),this.scheduleTimer(r)}remove(e){let{current:t,deferred:r}=this;this.removeFromQueue(t,e)===-1&&this.removeFromQueue(r,e),t.length===0&&r.length===0&&this.clearTimeout()}addToQueue(e,t,r){let s=e.length;for(let i=0;it){s=i;break}DV(e,s,t,r)}removeFromQueue(e,t){let r=-1;for(let s=0;s-1&&OO(e,r,2),r}scheduleTimer(e){let t=()=>{this.clearTimeout(),this.executingCallbacks=!0;let s=[...this.current],i=Date.now();for(let a=0;a=0&&OO(this.current,0,o+1),this.executingCallbacks=!1,this.deferred.length>0){for(let a=0;a0){let s=Date.now(),i=this.current[0];if(this.timeoutId===null||this.invokeTimerAt&&this.invokeTimerAt-i>16){this.clearTimeout();let o=Math.max(i-s,16);this.invokeTimerAt=i,this.timeoutId=e.runOutsideAngular(()=>setTimeout(()=>e.run(t),o))}}}clearTimeout(){this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}ngOnDestroy(){this.clearTimeout(),this.current.length=0,this.deferred.length=0}};l(ey,"\u0275prov",rn({token:ey,providedIn:"root",factory:()=>new ey}));var Lx=ey,ty=class ty{constructor(){l(this,"cachedInjectors",new Map)}getOrCreateInjector(e,t,r,s){if(!this.cachedInjectors.has(e)){let i=r.length>0?uA(r,t,s):null;this.cachedInjectors.set(e,i)}return this.cachedInjectors.get(e)}ngOnDestroy(){try{for(let e of this.cachedInjectors.values())e!==null&&e.destroy()}finally{this.cachedInjectors.clear()}}};l(ty,"\u0275prov",rn({token:ty,providedIn:"environment",factory:()=>new ty}));var H1=ty,Uae=new $e("DEFER_BLOCK_DEPENDENCY_INTERCEPTOR"),u5=new $e("");function S_(n,e,t){return n.get(H1).getOrCreateInjector(e,n,t,"")}function qae(n,e,t){if(n instanceof Cf){let s=n.injector,i=n.parentInjector,o=S_(i,e,t);return new Cf(s,o)}let r=n.get($o);if(r!==n){let s=S_(r,e,t);return new Cf(n,s)}return S_(n,e,t)}function Aa(n,e,t,r=!1){let s=t[Wn],i=s[_e];if(Na(s))return;let o=Ps(s,e),a=o[Zl],c=o[are];if(!(c!==null&&n"u"||!ngServerMode)&&(Z$(u)!==null||s1(u,Rn.Loading)!==null||s1(u,Rn.Placeholder))?j1:d5;try{p(n,o,t,e,s)}catch(f){W2(s,f)}}}function Wae(n,e){let t=n[Ji]?.findIndex(s=>s.data[bx]===e[Zl])??-1;return{dehydratedView:t>-1?n[Ji][t]:null,dehydratedViewIx:t}}function d5(n,e,t,r,s){yn(20);let i=dre(n,s,r);if(i!==null){e[Zl]=n;let o=s[_e],a=i+Xe,c=Hu(o,a),u=0;K2(t,u);let d;if(n===Rn.Complete){let m=Wr(o,r),g=m.providers;g&&g.length>0&&(d=qae(s[dr],m,g))}let{dehydratedView:p,dehydratedViewIx:f}=Wae(t,e),h=eh(s,c,null,{injector:d,dehydratedView:p});if(th(t,h,u,Mu(c,p)),AS(h,2),f>-1&&t[Ji]?.splice(f,1),(n===Rn.Complete||n===Rn.Error)&&Array.isArray(e[Sf])){for(let m of e[Sf])m();e[Sf]=null}}yn(21)}function zae(n,e,t,r,s){let i=Date.now(),o=s[_e],a=Wr(o,r);if(e[Bv]===null||e[Bv]<=i){e[Bv]=null;let c=Z$(a),u=e[AE]!==null;if(n===Rn.Loading&&c!==null&&!u){e[xf]=n;let d=kB(c,e,r,t,s);e[AE]=d}else{n>Rn.Loading&&u&&(e[AE](),e[AE]=null,e[xf]=null),d5(n,e,t,r,s);let d=s1(a,n);d!==null&&(e[Bv]=i+d,kB(d,e,r,t,s))}}else e[xf]=n}function kB(n,e,t,r,s){return c5(n,()=>{let o=e[xf];e[Bv]=null,e[xf]=null,o!==null&&Aa(o,t,r)},s[dr])}function AB(n,e){return n{n.loadingState===ir.COMPLETE?Aa(Rn.Complete,e,t):n.loadingState===ir.FAILED&&Aa(Rn.Error,e,t)})}var j1=null;function p5(n,e,t,r){let s=n.consts;t!=null&&(e.placeholderBlockConfig=Ci(s,t)),r!=null&&(e.loadingBlockConfig=Ci(s,r)),j1===null&&(j1=zae)}var XE="__ngAsyncComponentMetadataFn__";function Gae(n){return n[XE]??null}function f5(n,e,t){let r=n;return r[XE]=()=>Promise.all(e()).then(s=>(t(...s),r[XE]=null,s)),r[XE]}function mA(n,e,t,r){return Zo(()=>{let s=n;e!==null&&(s.hasOwnProperty("decorators")&&s.decorators!==void 0?s.decorators.push(...e):s.decorators=e),t!==null&&(s.ctorParameters=t),r!==null&&(s.hasOwnProperty("propDecorators")&&s.propDecorators!==void 0?s.propDecorators={...s.propDecorators,...r}:s.propDecorators=r)})}var cu=class cu{log(e){console.log(e)}warn(e){console.warn(e)}};l(cu,"\u0275fac",function(t){return new(t||cu)}),l(cu,"\u0275prov",rn({token:cu,factory:cu.\u0275fac,providedIn:"platform"}));var Ox=cu,U1=class{constructor(){l(this,"resolverToTokenToDependencies",new WeakMap);l(this,"resolverToProviders",new WeakMap);l(this,"resolverToEffects",new WeakMap);l(this,"standaloneInjectorToComponent",new WeakMap)}reset(){this.resolverToTokenToDependencies=new WeakMap,this.resolverToProviders=new WeakMap,this.standaloneInjectorToComponent=new WeakMap}},Vve=new U1;function q1(n,e){let t=n[_e];for(let r=Xe;r"u"||!COMPILED){let t=or;t[LE]??(t[LE]={}),t[LE][n]=e}}var VS=new $e(""),ih=new $e(""),uu=class uu{constructor(e,t,r){l(this,"_ngZone");l(this,"registry");l(this,"_isZoneStable",!0);l(this,"_callbacks",[]);l(this,"_taskTrackingZone",null);l(this,"_destroyRef");this._ngZone=e,this.registry=t,Rk()&&(this._destroyRef=ye(As,{optional:!0})??void 0),gA||(h5(r),r.addToWindow(t)),this._watchAngularEvents(),e.run(()=>{this._taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){let e=this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),t=this._ngZone.runOutsideAngular(()=>this._ngZone.onStable.subscribe({next:()=>{ln.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}}));this._destroyRef?.onDestroy(()=>{e.unsubscribe(),t.unsubscribe()})}isStable(){return this._isZoneStable&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;this._callbacks.length!==0;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb()}});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(t=>t.updateCb&&t.updateCb(e)?(clearTimeout(t.timeoutId),!1):!0)}}getPendingTasks(){return this._taskTrackingZone?this._taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,t,r){let s=-1;t&&t>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(i=>i.timeoutId!==s),e()},t)),this._callbacks.push({doneCb:e,timeoutId:s,updateCb:r})}whenStable(e,t,r){if(r&&!this._taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(e,t,r),this._runCallbacksIfReady()}registerApplication(e){this.registry.registerApplication(e,this)}unregisterApplication(e){this.registry.unregisterApplication(e)}findProviders(e,t,r){return[]}};l(uu,"\u0275fac",function(t){return new(t||uu)(Mr(ln),Mr(Lu),Mr(ih))}),l(uu,"\u0275prov",rn({token:uu,factory:uu.\u0275fac}));var Fu=uu,du=class du{constructor(){l(this,"_applications",new Map)}registerApplication(e,t){this._applications.set(e,t)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,t=!0){return gA?.findTestabilityInTree(this,e,t)??null}};l(du,"\u0275fac",function(t){return new(t||du)}),l(du,"\u0275prov",rn({token:du,factory:du.\u0275fac,providedIn:"platform"}));var Lu=du;function h5(n){gA=n}var gA,nS=class nS{};l(nS,"\u0275prov",rn({token:nS,providedIn:"root",factory:()=>new Bx}));var xy=nS,Bx=class{constructor(){l(this,"queuedEffectCount",0);l(this,"queues",new Map)}schedule(e){this.enqueue(e)}remove(e){let t=e.zone,r=this.queues.get(t);r.has(e)&&(r.delete(e),this.queuedEffectCount--)}enqueue(e){let t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);let r=this.queues.get(t);r.has(e)||(this.queuedEffectCount++,r.add(e))}flush(){for(;this.queuedEffectCount>0;)for(let[e,t]of this.queues)e===null?this.flushQueue(t):e.run(()=>this.flushQueue(t))}flushQueue(e){for(let t of e)e.delete(t),this.queuedEffectCount--,t.run()}};function Wu(n){return!!n&&typeof n.then=="function"}function $S(n){return!!n&&typeof n.subscribe=="function"}var vA=new $e("");function Xae(n){return Ba([{provide:vA,multi:!0,useValue:n}])}var pu=class pu{constructor(){l(this,"resolve");l(this,"reject");l(this,"initialized",!1);l(this,"done",!1);l(this,"donePromise",new Promise((e,t)=>{this.resolve=e,this.reject=t}));l(this,"appInits",ye(vA,{optional:!0})??[]);l(this,"injector",ye(In))}runInitializers(){if(this.initialized)return;let e=[];for(let r of this.appInits){let s=Pk(this.injector,r);if(Wu(s))e.push(s);else if($S(s)){let i=new Promise((o,a)=>{s.subscribe({complete:o,error:a})});e.push(i)}}let t=()=>{this.done=!0,this.resolve()};Promise.all(e).then(()=>{t()}).catch(r=>{this.reject(r)}),e.length===0&&t(),this.initialized=!0}};l(pu,"\u0275fac",function(t){return new(t||pu)}),l(pu,"\u0275prov",rn({token:pu,factory:pu.\u0275fac,providedIn:"root"}));var Sy=pu,Qy=new $e("");function m5(){RI(()=>{throw new Pe(600,!1)})}function g5(n){return n.isBoundToModule}var W1=class{constructor(e,t){l(this,"name");l(this,"token");this.name=e,this.token=t}},Qae=10;function v5(n,e){return Array.isArray(e)?e.reduce(v5,n):{...n,...e}}var fu=class fu{constructor(){l(this,"_runningTick",!1);l(this,"_destroyed",!1);l(this,"_destroyListeners",[]);l(this,"_views",[]);l(this,"internalErrorHandler",ye(T$));l(this,"afterRenderManager",ye(Nf));l(this,"zonelessEnabled",ye(Zf));l(this,"rootEffectScheduler",ye(xy));l(this,"dirtyFlags",0);l(this,"tracingSnapshot",null);l(this,"externalTestViews",new Set);l(this,"afterTick",new _s);l(this,"componentTypes",[]);l(this,"components",[]);l(this,"isStable",ye(Uo).hasPendingTasks.pipe(tu(e=>!e)));l(this,"_injector",ye($o));l(this,"_rendererFactory",null);l(this,"tickImpl",()=>{if(this._runningTick)throw new Pe(101,!1);let e=gt(null);try{this._runningTick=!0,this.synchronize()}catch(t){this.internalErrorHandler(t)}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,gt(e),this.afterTick.next(),yn(13)}});ye(ro,{optional:!0})}get allViews(){return[...this.externalTestViews.keys(),...this._views]}get destroyed(){return this._destroyed}whenStable(){let e;return new Promise(t=>{e=this.isStable.subscribe({next:r=>{r&&t()}})}).finally(()=>{e.unsubscribe()})}get injector(){return this._injector}bootstrap(e,t){return this.bootstrapImpl(e,t)}bootstrapImpl(e,t,r=In.NULL){yn(10);let s=e instanceof nA;if(!this._injector.get(Sy).done){let f="";throw new Pe(405,f)}let o;s?o=e:o=this._injector.get(Yy).resolveComponentFactory(e),this.componentTypes.push(o.componentType);let a=g5(o)?void 0:this._injector.get(Xl),c=t||o.selector,u=o.create(r,[],c,a),d=u.location.nativeElement,p=u.injector.get(VS,null);return p?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),QE(this.components,u),p?.unregisterApplication(d)}),this._loadComponent(u),yn(11,u),u}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){yn(12),this.tracingSnapshot!==null?this.tracingSnapshot.run(hy.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Nu,null,{optional:!0}));let e=0;for(;this.dirtyFlags!==0&&e++Oy(e))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(e){let t=e;this._views.push(t),t.attachToAppRef(this)}detachView(e){let t=e;QE(this._views,t),t.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(Qy,[]).forEach(r=>r(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),()=>QE(this._destroyListeners,e)}destroy(){if(this._destroyed)throw new Pe(406,!1);let e=this._injector;e.destroy&&!e.destroyed&&e.destroy()}get viewCount(){return this._views.length}};l(fu,"\u0275fac",function(t){return new(t||fu)}),l(fu,"\u0275prov",rn({token:fu,factory:fu.\u0275fac,providedIn:"root"}));var ns=fu;function QE(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function y5(n,e,t,r){if(!t&&!Oy(n))return;J8(n,e,t&&!r?0:1)}function b5(n){let e=re(),t=$t();if(sh(e,t),!x5(0,e))return;let r=e[dr],s=Ps(e,t),i=n(()=>hs(0,e,t),r);$y(0,s,i)}function w5(n,e){if(typeof ngServerMode<"u"&&ngServerMode)return;let t=re(),r=t[dr],s=$t(),i=t[_e],o=Wr(i,s);if(o.loadingState===ir.NOT_STARTED){let a=Ps(t,s),u=n(()=>Ky(o,t,s),r);$y(1,a,u)}}function E5(n,e,t){if(typeof ngServerMode<"u"&&ngServerMode)return;let r=e[dr],s=Ps(e,t),i=s[wS],o=n(()=>ec(r,i),r);$y(2,s,o)}function Ky(n,e,t){HS(n,e,t)}function HS(n,e,t){let r=e[dr],s=e[_e];if(n.loadingState!==ir.NOT_STARTED)return n.loadingPromise??Promise.resolve();let i=Ps(e,t),o=pre(s,n);n.loadingState=ir.IN_PROGRESS,zE(1,i);let a=n.dependencyResolverFn,c=r.get(oy).add();return a?(n.loadingPromise=Promise.allSettled(a()).then(u=>{let d=!1,p=[],f=[];for(let h of u)if(h.status==="fulfilled"){let m=h.value,g=Bn(m)||to(m);if(g)p.push(g);else{let y=Oa(m);y&&f.push(y)}}else{d=!0;break}if(d){if(n.loadingState=ir.FAILED,n.errorTmplIndex===null){let h="",m=new Pe(-750,!1);W2(e,m)}}else{n.loadingState=ir.COMPLETE;let h=o.tView;if(p.length>0){h.directiveRegistry=oB(h.directiveRegistry,p);let m=p.map(y=>y.type),g=Mk(!1,...m);n.providers=g}f.length>0&&(h.pipeRegistry=oB(h.pipeRegistry,f))}}),n.loadingPromise.finally(()=>{n.loadingPromise=null,c()})):(n.loadingPromise=Promise.resolve().then(()=>{n.loadingPromise=null,n.loadingState=ir.COMPLETE,c()}),n.loadingPromise)}function x5(n,e){return!(n===0&&typeof ngServerMode<"u"&&ngServerMode||e[dr].get(u5,null,{optional:!0})?.behavior===xx.Manual)}function hs(n,e,t){let r=e[_e],s=e[t.index];if(!x5(n,e))return;let i=Ps(e,t),o=Wr(r,t);switch(z$(i),o.loadingState){case ir.NOT_STARTED:Aa(Rn.Loading,t,s),HS(o,e,t),o.loadingState===ir.IN_PROGRESS&&MB(o,t,s);break;case ir.IN_PROGRESS:Aa(Rn.Loading,t,s),MB(o,t,s);break;case ir.COMPLETE:Aa(Rn.Complete,t,s);break;case ir.FAILED:Aa(Rn.Error,t,s);break;default:}}async function ec(n,e,t){let r=n.get(Ha);if(r.hydrating.has(e))return;let{parentBlockPromise:i,hydrationQueue:o}=Mre(e,n);if(o.length===0)return;i!==null&&o.shift(),ele(r,o),i!==null&&await i;let a=o[0];r.has(a)?await NB(n,o,t):r.awaitParentBlock(a,async()=>await NB(n,o,t))}async function NB(n,e,t){let r=n.get(Ha),s=r.hydrating,i=n.get(Uo),o=i.add();for(let c=0;c-1?t.get(e[r]):null;s&&RS(s.lContainer)}function PB(n,e){let t=e.hydrating;for(let r in n)t.get(r)?.reject();e.cleanup(n)}function ele(n,e){for(let t of e)n.hydrating.set(t,Promise.withResolvers())}function tle(n){return new Promise(e=>m2(e,{injector:n}))}async function nle(n){let{tNode:e,lView:t}=n,r=Ps(t,e);return new Promise(s=>{rle(r,s),hs(2,t,e)})}function rle(n,e){Array.isArray(n[Sf])||(n[Sf]=[]),n[Sf].push(e)}function er(n,e,t){return n===0?RB(e,t):n===2?!RB(e,t):!(typeof ngServerMode<"u"&&ngServerMode)}function RB(n,e){let t=n[dr],r=Wr(n[_e],e),s=E2(t),i=r.flags!==null&&(r.flags&1)===1;if(typeof ngServerMode<"u"&&ngServerMode)return!s||!i;let a=Ps(n,e)[wS]!==null;return!(i&&a&&s)}function tc(n,e){let t=Wr(n,e);return t.hydrateTriggers??(t.hydrateTriggers=new Map)}function sle(n,e,t){let r=[],s=[],i=[],o=[];for(let[a,c]of e){let u=t.get(a);if(u!==void 0){let d=c.data[ql],p=u;for(let f=0;fec(n,t.blockName),n);r.addCleanupFn(t.blockName,i)}}function ole(n,e){if(e.length>0){let t=n.get(Ha);for(let r of e){let s=v2(r.el,()=>ec(n,r.blockName),n);t.addCleanupFn(r.blockName,s)}}}function ale(n,e){for(let t of e){let r=n.get(Ha),s=()=>ec(n,t.blockName),o=BS(t.delay)(s,n);r.addCleanupFn(t.blockName,o)}}function lle(n,e){for(let t of e)ec(n,t.blockName)}function S5(n,e,t,r,s,i,o,a,c,u){let d=re(),p=ft(),f=n+Xe,h=Ey(d,p,n,null,0,0),m=d[dr];if(p.firstCreatePass){rs("NgDefer");let M={primaryTmplIndex:e,loadingTmplIndex:r??null,placeholderTmplIndex:s??null,errorTmplIndex:i??null,placeholderBlockConfig:null,loadingBlockConfig:null,dependencyResolverFn:t??null,loadingState:ir.NOT_STARTED,loadingPromise:null,providers:null,hydrateTriggers:null,debug:null,flags:u??0};c?.(p,M,a,o),ure(p,f,M)}let g=d[f];MH(g,h,d);let y=null,b=null;if(g[Ji]?.length>0){let M=g[Ji][0].data;b=M[u2]??null,y=M[bx]}let E=[null,Pf.Initial,null,null,null,null,b,y,null,null];cre(d,f,E);let _=null;b!==null&&(_=m.get(Ha),_.add(b,{lView:d,tNode:h,lContainer:g}));let V=()=>{z$(E),b!==null&&_?.cleanup([b])};$y(0,E,()=>jk(d,V)),dS(d,V)}function C5(n){let e=re(),t=Dn();if(!er(0,e,t))return;let r=ki();if(Jn(e,r,n)){let s=gt(null);try{let i=!!n,a=Ps(e,t)[Zl];i===!1&&a===Pf.Initial?sh(e,t):i===!0&&(a===Pf.Initial||a===Rn.Placeholder)&&hs(0,e,t)}finally{gt(s)}}}function T5(n){let e=re(),t=Dn();if(!er(1,e,t))return;let r=ki();if(Jn(e,r,n)){let s=gt(null);try{let i=!!n,o=e[_e],a=Dn(),c=Wr(o,a);i===!0&&c.loadingState===ir.NOT_STARTED&&Ky(c,e,a)}finally{gt(s)}}}function D5(n){let e=re(),t=Dn();if(!er(2,e,t))return;let r=ki(),s=ft();if(tc(s,t).set(6,null),Jn(e,r,n))if(typeof ngServerMode<"u"&&ngServerMode)hs(2,e,t);else{let o=e[dr],a=gt(null);try{if(!!n===!0){let d=Ps(e,t)[wS];ec(o,d)}}finally{gt(a)}}}function I5(){let n=re(),e=$t();if(!er(2,n,e))return;tc(ft(),e).set(7,null),typeof ngServerMode<"u"&&ngServerMode&&hs(2,n,e)}function _5(){let n=re(),e=$t();er(0,n,e)&&b5(OS)}function k5(){let n=re(),e=$t();er(1,n,e)&&w5(OS)}function A5(){let n=re(),e=$t();if(!er(2,n,e))return;tc(ft(),e).set(0,null),typeof ngServerMode<"u"&&ngServerMode?hs(2,n,e):E5(OS,n,e)}function M5(){let n=re(),e=$t();if(!er(0,n,e))return;Wr(n[_e],e).loadingTmplIndex===null&&sh(n,e),hs(0,n,e)}function N5(){let n=re(),e=$t();if(!er(1,n,e))return;let t=n[_e],r=Wr(t,e);r.loadingState===ir.NOT_STARTED&&HS(r,n,e)}function P5(){let n=re(),e=$t();if(!er(2,n,e))return;if(tc(ft(),e).set(1,null),typeof ngServerMode<"u"&&ngServerMode)hs(2,n,e);else{let r=n[dr],i=Ps(n,e)[wS];ec(r,i)}}function R5(n){let e=re(),t=$t();er(0,e,t)&&b5(BS(n))}function F5(n){let e=re(),t=$t();er(1,e,t)&&w5(BS(n))}function L5(n){let e=re(),t=$t();if(!er(2,e,t))return;tc(ft(),t).set(5,{delay:n}),typeof ngServerMode<"u"&&ngServerMode?hs(2,e,t):E5(BS(n),e,t)}function O5(n,e){let t=re(),r=$t();er(0,t,r)&&(sh(t,r),typeof ngServerMode<"u"&&ngServerMode||Qf(t,r,n,e,Q$,()=>hs(0,t,r),0))}function B5(n,e){let t=re(),r=$t();if(!er(1,t,r))return;let s=t[_e],i=Wr(s,r);i.loadingState===ir.NOT_STARTED&&Qf(t,r,n,e,Q$,()=>Ky(i,t,r),1)}function V5(){let n=re(),e=$t();if(!er(2,n,e))return;tc(ft(),e).set(4,null),typeof ngServerMode<"u"&&ngServerMode&&hs(2,n,e)}function $5(n,e){let t=re(),r=$t();er(0,t,r)&&(sh(t,r),typeof ngServerMode<"u"&&ngServerMode||Qf(t,r,n,e,X$,()=>hs(0,t,r),0))}function H5(n,e){let t=re(),r=$t();if(!er(1,t,r))return;let s=t[_e],i=Wr(s,r);i.loadingState===ir.NOT_STARTED&&Qf(t,r,n,e,X$,()=>Ky(i,t,r),1)}function j5(){let n=re(),e=$t();if(!er(2,n,e))return;tc(ft(),e).set(3,null),typeof ngServerMode<"u"&&ngServerMode&&hs(2,n,e)}function U5(n,e){let t=re(),r=$t();er(0,t,r)&&(sh(t,r),typeof ngServerMode<"u"&&ngServerMode||Qf(t,r,n,e,v2,()=>hs(0,t,r),0))}function q5(n,e){let t=re(),r=$t();if(!er(1,t,r))return;let s=t[_e],i=Wr(s,r);i.loadingState===ir.NOT_STARTED&&Qf(t,r,n,e,v2,()=>Ky(i,t,r),1)}function W5(){let n=re(),e=$t();if(!er(2,n,e))return;tc(ft(),e).set(2,null),typeof ngServerMode<"u"&&ngServerMode&&hs(2,n,e)}function yA(n,e,t,r){let s=re(),i=ki();if(Jn(s,i,e)){let o=ft(),a=Dn();Qo(a,s,n,e,t,r)}return yA}function oh(n,e){let t=!1,r=Va();for(let i=1;i>17&32767}function cle(n){return(n&2)==2}function ule(n,e){return n&131071|e<<17}function z1(n){return n|2}function $f(n){return(n&131068)>>2}function C_(n,e){return n&-131069|e<<2}function dle(n){return(n&1)===1}function G1(n){return n|1}function ple(n,e,t,r,s,i){let o=i?e.classBindings:e.styleBindings,a=Ou(o),c=$f(o);n[r]=t;let u=!1,d;if(Array.isArray(t)){let p=t;d=p[1],(d===null||Ry(p,d)>0)&&(u=!0)}else d=t;if(s)if(c!==0){let f=Ou(n[a+1]);n[r+1]=OE(f,a),f!==0&&(n[f+1]=C_(n[f+1],r)),n[a+1]=ule(n[a+1],r)}else n[r+1]=OE(a,0),a!==0&&(n[a+1]=C_(n[a+1],r)),a=r;else n[r+1]=OE(c,0),a===0?a=r:n[c+1]=C_(n[c+1],r),c=r;u&&(n[r+1]=z1(n[r+1])),FB(n,d,r,!0),FB(n,d,r,!1),fle(e,d,n,r,i),o=OE(a,c),i?e.classBindings=o:e.styleBindings=o}function fle(n,e,t,r,s){let i=s?n.residualClasses:n.residualStyles;i!=null&&typeof e=="string"&&Ry(i,e)>=0&&(t[r+1]=G1(t[r+1]))}function FB(n,e,t,r){let s=n[t+1],i=e===null,o=r?Ou(s):$f(s),a=!1;for(;o!==0&&(a===!1||i);){let c=n[o],u=n[o+1];hle(c,e)&&(a=!0,n[o+1]=r?G1(u):z1(u)),o=r?Ou(u):$f(u)}a&&(n[t+1]=r?z1(s):G1(s))}function hle(n,e){return n===null||e==null||(Array.isArray(n)?n[1]:n)===e?!0:Array.isArray(n)&&typeof e=="string"?Ry(n,e)>=0:!1}var wr={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function z5(n){return n.substring(wr.key,wr.keyEnd)}function mle(n){return n.substring(wr.value,wr.valueEnd)}function gle(n){return Y5(n),G5(n,Hf(n,0,wr.textEnd))}function G5(n,e){let t=wr.textEnd;return t===e?-1:(e=wr.keyEnd=yle(n,wr.key=e,t),Hf(n,e,t))}function vle(n){return Y5(n),Z5(n,Hf(n,0,wr.textEnd))}function Z5(n,e){let t=wr.textEnd,r=wr.key=Hf(n,e,t);return t===r?-1:(r=wr.keyEnd=ble(n,r,t),r=LB(n,r,t,58),r=wr.value=Hf(n,r,t),r=wr.valueEnd=wle(n,r,t),LB(n,r,t,59))}function Y5(n){wr.key=0,wr.keyEnd=0,wr.value=0,wr.valueEnd=0,wr.textEnd=n.length}function Hf(n,e,t){for(;e32;)e++;return e}function ble(n,e,t){let r;for(;e=65&&(r&-33)<=90||r>=48&&r<=57);)e++;return e}function LB(n,e,t,r){return e=Hf(n,e,t),e32&&(a=o),i=s,s=r,r=c&-33}return a}function OB(n,e,t,r){let s=-1,i=t;for(;i=0;t=Z5(e,t))J5(n,z5(e),mle(e))}function X5(n){oo(Ile,Jo,n,!0)}function Jo(n,e){for(let t=gle(e);t>=0;t=G5(e,t))Js(n,z5(e),!0)}function io(n,e,t,r){let s=re(),i=ft(),o=$a(2);if(i.firstUpdatePass&&K5(i,n,o,r),e!==xt&&Jn(s,o,e)){let a=i.data[Cr()];e3(i,a,s,s[dt],n,s[o+1]=kle(e,t),r,o)}}function oo(n,e,t,r){let s=ft(),i=$a(2);s.firstUpdatePass&&K5(s,null,i,r);let o=re();if(t!==xt&&Jn(o,i,t)){let a=s.data[Cr()];if(t3(a,r)&&!Q5(s,i)){let c=r?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(t=O_(c,t||"")),Z1(s,a,o,t,r)}else _le(s,a,o,o[dt],o[i+1],o[i+1]=Dle(n,e,t),r,i)}}function Q5(n,e){return e>=n.expandoStartIndex}function K5(n,e,t,r){let s=n.data;if(s[t+1]===null){let i=s[Cr()],o=Q5(n,t);t3(i,r)&&e===null&&!o&&(e=!1),e=xle(s,i,e,r),ple(s,i,e,t,o,r)}}function xle(n,e,t,r){let s=Zk(n),i=r?e.residualClasses:e.residualStyles;if(s===null)(r?e.classBindings:e.styleBindings)===0&&(t=T_(null,n,e,t,r),t=Cy(t,e.attrs,r),i=null);else{let o=e.directiveStylingLast;if(o===-1||n[o]!==s)if(t=T_(s,n,e,t,r),i===null){let c=Sle(n,e,r);c!==void 0&&Array.isArray(c)&&(c=T_(null,n,e,c[1],r),c=Cy(c,e.attrs,r),Cle(n,e,r,c))}else i=Tle(n,e,r)}return i!==void 0&&(r?e.residualClasses=i:e.residualStyles=i),t}function Sle(n,e,t){let r=t?e.classBindings:e.styleBindings;if($f(r)!==0)return n[Ou(r)]}function Cle(n,e,t,r){let s=t?e.classBindings:e.styleBindings;n[Ou(s)]=r}function Tle(n,e,t){let r,s=e.directiveEnd;for(let i=1+e.directiveStylingLast;i0;){let c=n[s],u=Array.isArray(c),d=u?c[1]:c,p=d===null,f=t[s+1];f===xt&&(f=p?on:void 0);let h=p?o_(f,r):d===r?f:void 0;if(u&&!Vx(h)&&(h=o_(c,r)),Vx(h)&&(a=h,o))return a;let m=n[s+1];s=o?Ou(m):$f(m)}if(e!==null){let c=i?e.residualClasses:e.residualStyles;c!=null&&(a=o_(c,r))}return a}function Vx(n){return n!==void 0}function kle(n,e){return n==null||n===""||(typeof e=="string"?n=n+e:typeof n=="object"&&(n=Ur(zr(n)))),n}function t3(n,e){return(n.flags&(e?8:16))!==0}function n3(n,e,t){let r=re(),s=ah(r,n,e,t);oo(Js,Jo,s,!0)}function r3(n,e,t,r,s){let i=re(),o=lh(i,n,e,t,r,s);oo(Js,Jo,o,!0)}function s3(n,e,t,r,s,i,o){let a=re(),c=ch(a,n,e,t,r,s,i,o);oo(Js,Jo,c,!0)}function i3(n,e,t,r,s,i,o,a,c){let u=re(),d=uh(u,n,e,t,r,s,i,o,a,c);oo(Js,Jo,d,!0)}function o3(n,e,t,r,s,i,o,a,c,u,d){let p=re(),f=dh(p,n,e,t,r,s,i,o,a,c,u,d);oo(Js,Jo,f,!0)}function a3(n,e,t,r,s,i,o,a,c,u,d,p,f){let h=re(),m=ph(h,n,e,t,r,s,i,o,a,c,u,d,p,f);oo(Js,Jo,m,!0)}function l3(n,e,t,r,s,i,o,a,c,u,d,p,f,h,m){let g=re(),y=fh(g,n,e,t,r,s,i,o,a,c,u,d,p,f,h,m);oo(Js,Jo,y,!0)}function c3(n,e,t,r,s,i,o,a,c,u,d,p,f,h,m,g,y){let b=re(),E=hh(b,n,e,t,r,s,i,o,a,c,u,d,p,f,h,m,g,y);oo(Js,Jo,E,!0)}function u3(n){let e=re(),t=oh(e,n);oo(Js,Jo,t,!0)}function d3(){return re()[Sr][Fn]}var Y1=class{destroy(e){}updateValue(e,t){}swap(e,t){let r=Math.min(e,t),s=Math.max(e,t),i=this.detach(s);if(s-r>1){let o=this.detach(r);this.attach(r,i),this.attach(s,o)}else this.attach(r,i)}move(e,t){this.attach(t,this.detach(e))}};function D_(n,e,t,r,s){return n===t&&Object.is(e,r)?1:Object.is(s(n,e),s(t,r))?-1:0}function Ale(n,e,t){let r,s,i=0,o=n.length-1,a=void 0;if(Array.isArray(e)){let c=e.length-1;for(;i<=o&&i<=c;){let u=n.at(i),d=e[i],p=D_(i,u,i,d,t);if(p!==0){p<0&&n.updateValue(i,d),i++;continue}let f=n.at(o),h=e[c],m=D_(o,f,c,h,t);if(m!==0){m<0&&n.updateValue(o,h),o--,c--;continue}let g=t(i,u),y=t(o,f),b=t(i,d);if(Object.is(b,y)){let E=t(c,h);Object.is(E,g)?(n.swap(i,o),n.updateValue(o,h),c--,o--):n.move(o,i),n.updateValue(i,d),i++;continue}if(r??(r=new $x),s??(s=$B(n,i,o,t)),X1(n,r,i,b))n.updateValue(i,d),i++,o++;else if(s.has(b))r.set(g,n.detach(i)),o--;else{let E=n.create(i,e[i]);n.attach(i,E),i++,o++}}for(;i<=c;)VB(n,r,t,i,e[i]),i++}else if(e!=null){let c=e[Symbol.iterator](),u=c.next();for(;!u.done&&i<=o;){let d=n.at(i),p=u.value,f=D_(i,d,i,p,t);if(f!==0)f<0&&n.updateValue(i,p),i++,u=c.next();else{r??(r=new $x),s??(s=$B(n,i,o,t));let h=t(i,p);if(X1(n,r,i,h))n.updateValue(i,p),i++,o++,u=c.next();else if(!s.has(h))n.attach(i,n.create(i,p)),i++,o++,u=c.next();else{let m=t(i,d);r.set(m,n.detach(i)),o--}}}for(;!u.done;)VB(n,r,t,n.length,u.value),u=c.next()}for(;i<=o;)n.destroy(n.detach(o--));r?.forEach(c=>{n.destroy(c)})}function X1(n,e,t,r){return e!==void 0&&e.has(r)?(n.attach(t,e.get(r)),e.delete(r),!0):!1}function VB(n,e,t,r,s){if(X1(n,e,r,t(r,s)))n.updateValue(r,s);else{let i=n.create(r,s);n.attach(r,i)}}function $B(n,e,t,r){let s=new Set;for(let i=e;i<=t;i++)s.add(r(i,n.at(i)));return s}var $x=class{constructor(){l(this,"kvMap",new Map);l(this,"_vMap")}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 r=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let s=this._vMap;for(;s.has(r);)r=s.get(r);s.set(r,t)}else this.kvMap.set(e,t)}forEach(e){for(let[t,r]of this.kvMap)if(e(r,t),this._vMap!==void 0){let s=this._vMap;for(;s.has(r);)r=s.get(r),e(r,t)}}};function p3(n,e){rs("NgControlFlow");let t=re(),r=ki(),s=t[r]!==xt?t[r]:-1,i=s!==-1?Hx(t,Xe+s):void 0,o=0;if(Jn(t,r,n)){let a=gt(null);try{if(i!==void 0&&K2(i,o),n!==-1){let c=Xe+n,u=Hx(t,c),d=ek(t[_e],c),p=Ff(u,d.tView.ssrId),f=eh(t,d,e,{dehydratedView:p});th(u,f,o,Mu(d,p))}}finally{gt(a)}}else if(i!==void 0){let a=iH(i,o);a!==void 0&&(a[Fn]=e)}}var Q1=class{constructor(e,t,r){l(this,"lContainer");l(this,"$implicit");l(this,"$index");this.lContainer=e,this.$implicit=t,this.$index=r}get $count(){return this.lContainer.length-qn}};function f3(n){return n}function h3(n,e){return e}var K1=class{constructor(e,t,r){l(this,"hasEmptyBlock");l(this,"trackByFn");l(this,"liveCollection");this.hasEmptyBlock=e,this.trackByFn=t,this.liveCollection=r}};function m3(n,e,t,r,s,i,o,a,c,u,d,p,f){rs("NgControlFlow");let h=re(),m=ft(),g=c!==void 0,y=re(),b=a?o.bind(y[Sr][Fn]):o,E=new K1(g,b);y[Xe+n]=E,Ey(h,m,n+1,e,t,r,s,Ci(m.consts,i)),g&&Ey(h,m,n+2,c,u,d,p,Ci(m.consts,f))}var J1=class extends Y1{constructor(t,r,s){super();l(this,"lContainer");l(this,"hostLView");l(this,"templateTNode");l(this,"operationsCounter");l(this,"needsIndexUpdate",!1);this.lContainer=t,this.hostLView=r,this.templateTNode=s}get length(){return this.lContainer.length-qn}at(t){return this.getLView(t)[Fn].$implicit}attach(t,r){let s=r[ds];this.needsIndexUpdate||(this.needsIndexUpdate=t!==this.length),th(this.lContainer,r,t,Mu(this.templateTNode,s))}detach(t){return this.needsIndexUpdate||(this.needsIndexUpdate=t!==this.length-1),Mle(this.lContainer,t)}create(t,r){let s=Ff(this.lContainer,this.templateTNode.tView.ssrId),i=eh(this.hostLView,this.templateTNode,new Q1(this.lContainer,r,t),{dehydratedView:s});return this.operationsCounter?.recordCreate(),i}destroy(t){Gy(t[_e],t),this.operationsCounter?.recordDestroy()}updateValue(t,r){this.getLView(t)[Fn].$implicit=r}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let t=0;t(Yo(!0),SS(r,s,Kk()));function Ple(n,e,t,r,s,i){let o=e[ds],a=!o||Uu()||Jl(t)||qu(o,i);if(Yo(a),a)return SS(r,s,Kk());let c=Zy(o,n,e,t);return l8(o,i)&&ES(o,i,c.nextSibling),o&&(o2(t)||k$(c))&&no(t)&&(Fte(t),T8(c)),c}function Rle(){v3=Ple}function Fle(n,e,t,r,s){let i=e.consts,o=Ci(i,r),a=nh(e,n,8,"ng-container",o);o!==null&&M1(a,o,!0);let c=Ci(i,s);return Wk()&&sA(e,t,a,c,U2),a.mergedAttrs=Af(a.mergedAttrs,a.attrs),e.queries!==null&&e.queries.elementStart(e,a),a}function qS(n,e,t){let r=re(),s=ft(),i=n+Xe,o=s.firstCreatePass?Fle(i,s,r,e,t):s.data[i];eo(o,!0);let a=y3(s,r,o,n);return r[i]=a,By()&&_S(s,r,a,o),xi(a,r),cS(o)&&(DS(s,r,o),S2(s,o,r)),t!=null&&j2(r,o),qS}function WS(){let n=$t(),e=ft();return zk()?Gk():(n=n.parent,eo(n,!1)),e.firstCreatePass&&(Jk(e,n),Lk(n)&&e.queries.elementEnd(n)),WS}function NA(n,e,t){return qS(n,e,t),WS(),NA}var y3=(n,e,t,r)=>(Yo(!0),M2(e[dt],""));function Lle(n,e,t,r){let s,i=e[ds],o=!i||Uu()||qu(i,r)||Jl(t);if(Yo(o),o)return M2(e[dt],"");let a=Zy(i,n,e,t),c=a8(i,r);return ES(i,r,a),s=PS(c,a),s}function Ole(){y3=Lle}function b3(){return re()}function PA(n,e,t){let r=re(),s=ki();if(Jn(r,s,e)){let i=ft(),o=Dn();Rs(i,o,r,n,e,r[dt],t,!0)}return PA}function RA(n,e,t){let r=re(),s=ki();if(Jn(r,s,e)){let i=ft(),o=Dn(),a=Zk(i.data),c=V8(a,o,r);Rs(i,o,r,n,e,c,t,!0)}return RA}var su=void 0;function Ble(n){let e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return e===1&&t===0?1:5}var Vle=["en",[["a","p"],["AM","PM"],su],[["AM","PM"],su,su],[["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"]],su,[["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"]],su,[["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}",su,"{1} 'at' {0}",su],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",Ble],Tf={};function w3(n,e,t){typeof e!="string"&&(t=e,e=n[Sn.LocaleId]),e=e.toLowerCase().replace(/_/g,"-"),Tf[e]=n,t&&(Tf[e][Sn.ExtraData]=t)}function Gr(n){let e=Hle(n),t=HB(e);if(t)return t;let r=e.split("-")[0];if(t=HB(r),t)return t;if(r==="en")return Vle;throw new Pe(701,!1)}function E3(n){return Gr(n)[Sn.CurrencyCode]||null}function zS(n){return Gr(n)[Sn.PluralCase]}function HB(n){return n in Tf||(Tf[n]=or.ng&&or.ng.common&&or.ng.common.locales&&or.ng.common.locales[n]),Tf[n]}function $le(){Tf={}}var Sn;(function(n){n[n.LocaleId=0]="LocaleId",n[n.DayPeriodsFormat=1]="DayPeriodsFormat",n[n.DayPeriodsStandalone=2]="DayPeriodsStandalone",n[n.DaysFormat=3]="DaysFormat",n[n.DaysStandalone=4]="DaysStandalone",n[n.MonthsFormat=5]="MonthsFormat",n[n.MonthsStandalone=6]="MonthsStandalone",n[n.Eras=7]="Eras",n[n.FirstDayOfWeek=8]="FirstDayOfWeek",n[n.WeekendRange=9]="WeekendRange",n[n.DateFormat=10]="DateFormat",n[n.TimeFormat=11]="TimeFormat",n[n.DateTimeFormat=12]="DateTimeFormat",n[n.NumberSymbols=13]="NumberSymbols",n[n.NumberFormats=14]="NumberFormats",n[n.CurrencyCode=15]="CurrencyCode",n[n.CurrencySymbol=16]="CurrencySymbol",n[n.CurrencyName=17]="CurrencyName",n[n.Currencies=18]="Currencies",n[n.Directionality=19]="Directionality",n[n.PluralCase=20]="PluralCase",n[n.ExtraData=21]="ExtraData"})(Sn||(Sn={}));function Hle(n){return n.toLowerCase().replace(/_/g,"-")}var jle=["zero","one","two","few","many"];function Ule(n,e){let t=zS(e)(parseInt(n,10)),r=jle[t];return r!==void 0?r:"other"}var Ty="en-US",qle="USD",x3={marker:"element"},S3={marker:"ICU"},Bo;(function(n){n[n.SHIFT=2]="SHIFT",n[n.APPEND_EAGERLY=1]="APPEND_EAGERLY",n[n.COMMENT=2]="COMMENT"})(Bo||(Bo={}));var C3=Ty;function T3(n){typeof n=="string"&&(C3=n.toLowerCase().replace(/_/g,"-"))}function Wle(){return C3}var Dy=0,jv=0;function zle(n){n&&(Dy=Dy|1<0){let r=n.data[t],s=Array.isArray(r)?r:r.update,i=Va()-jv-1;_3(n,e,s,i,Dy)}Dy=0,jv=0}function D3(n,e,t){let r=n[dt];switch(t){case Node.COMMENT_NODE:return M2(r,e);case Node.TEXT_NODE:return A2(r,e);case Node.ELEMENT_NODE:return SS(r,e,null)}}var Uv=(n,e,t,r)=>(Yo(!0),D3(n,t,r));function Zle(n,e,t,r){let s=n[ds],i=e-Xe,o=!tA()||!s||Uu()||qu(s,i);return Yo(o),o?D3(n,t,r):fH(s,i)}function Yle(){Uv=Zle}function Xle(n,e,t,r){let s=n[dt];for(let i=0;i>>Bo.SHIFT,p=n[d],f=!1;p===null&&(p=n[d]=Uv(n,d,a,c?Node.COMMENT_NODE:Node.TEXT_NODE),f=By()),u&&t!==null&&f&&Au(s,t,p,r,!1)}}function I3(n,e,t,r){let s=t[dt],i=null,o;for(let a=0;a>>1,h=e[++a],m=e[++a];q2(s,zf(f,t),null,null,h,m,null);break;default:}else switch(c){case S3:let u=e[++a],d=e[++a];if(t[d]===null){let h=t[d]=Uv(t,d,u,Node.COMMENT_NODE);xi(h,t)}break;case x3:let p=e[++a],f=e[++a];if(t[f]===null){let h=t[f]=Uv(t,f,p,Node.ELEMENT_NODE);xi(h,t)}break;default:}}}function _3(n,e,t,r,s){for(let i=0;i>>2;switch(d&3){case 1:let f=t[++u],h=t[++u],m=n.data[p];if(typeof m=="string")q2(e[dt],e[p],null,m,f,c,h);else{let y=Cr();Pa(p);try{Rs(n,m,e,f,c,e[dt],h,!1)}finally{Pa(y)}}break;case 0:let g=e[p];g!==null&&S8(e[dt],g,c);break;case 2:Qle(n,$v(n,p),e,c);break;case 3:jB(n,$v(n,p),r,e);break}}}}else{let c=t[i+1];if(c>0&&(c&3)===3){let u=c>>>2,d=$v(n,u);e[d.currentCaseLViewIndex]<0&&jB(n,d,r,e)}}i+=a}}function jB(n,e,t,r){let s=r[e.currentCaseLViewIndex];if(s!==null){let i=Dy;s<0&&(s=r[e.currentCaseLViewIndex]=~s,i=-1),_3(n,r,e.update[s],t,i)}}function Qle(n,e,t,r){let s=Kle(e,r);if(NS(e,t)!==s&&(k3(n,e,t),t[e.currentCaseLViewIndex]=s===null?null:~s,s!==null)){let o=t[e.anchorIdx];o&&I3(n,e.create[s],t,o),doe(t,e.anchorIdx,s)}}function k3(n,e,t){let r=NS(e,t);if(r!==null){let s=e.remove[r];for(let i=0;i0){let a=zf(o,t);a!==null&&qy(t[dt],a)}else k3(n,$v(n,~o),t)}}}function Kle(n,e){let t=n.cases.indexOf(e);if(t===-1)switch(n.type){case 1:{let r=Ule(e,Wle());t=n.cases.indexOf(r),t===-1&&r!=="other"&&(t=n.cases.indexOf("other"));break}case 0:{t=n.cases.indexOf("other");break}}return t===-1?null:t}var jx=/�(\d+):?\d*�/gi,Jle=/({\s*�\d+:?\d*�\s*,\s*\S{6}\s*,[\s\S]*})/gi,ece=/�(\d+)�/,A3=/^\s*(�\d+:?\d*�)\s*,\s*(select|plural)\s*,/,qv="\uFFFD",tce=/�\/?\*(\d+:\d+)�/gi,nce=/�(\/?[#*]\d+):?\d*�/gi,rce=/\uE500/g;function sce(n){return n.replace(rce," ")}function ice(n,e,t,r,s,i){let o=sy(),a=[],c=[],u=[[]],d=[[]];s=cce(s,i);let p=sce(s).split(nce);for(let f=0;f`}}let m=[];d.push(m),a=dce(m,e,c,t,r,s,i.cases[p],f.join(""),h)|a}a&&hce(r,a,o),n.push({kind:3,index:o,cases:d,currentCaseLViewIndex:c.currentCaseLViewIndex})}function uce(n){let e=[],t=[],r=1,s=0;n=n.replace(A3,function(o,a,c){return c==="select"?r=0:r=1,s=parseInt(a.slice(1),10),""});let i=tk(n);for(let o=0;ot.length&&t.push(c)}return{type:r,mainBinding:s,cases:e,values:t}}function tk(n){if(!n)return[];let e=0,t=[],r=[],s=/[{}]/g;s.lastIndex=0;let i;for(;i=s.exec(n);){let a=i.index;if(i[0]=="}"){if(t.pop(),t.length==0){let c=n.substring(e,a);A3.test(c)?r.push(uce(c)):r.push(c),e=a+1}}else{if(t.length==0){let c=n.substring(e,a);r.push(c),e=a+1}t.push("{")}}let o=n.substring(e);return r.push(o),r}function dce(n,e,t,r,s,i,o,a,c){let u=[],d=[],p=[];t.cases.push(o),t.create.push(u),t.remove.push(d),t.update.push(p);let h=v8(qo()).getInertBodyElement(a),m=w1(h)||h;return m?R3(n,e,t,r,s,u,d,p,m,i,c,0):0}function R3(n,e,t,r,s,i,o,a,c,u,d,p){let f=0,h=c.firstChild;for(;h;){let m=zy(e,r,1,null);switch(h.nodeType){case Node.ELEMENT_NODE:let g=h,y=g.tagName.toLowerCase();if(v1.hasOwnProperty(y)){I_(i,x3,y,u,m),e.data[m]=y;let V=g.attributes;for(let j=0;j{let c=o||a,u=r[c]||[];if(u.length||(c.split("|").forEach(g=>{let y=g.match(Sce),b=y?parseInt(y[1],10):zB,E=xce.test(g);u.push([b,E,g])}),r[c]=u),!u.length)throw new Error(`i18n postprocess: unmatched placeholder - ${c}`);let d=s[s.length-1],p=0;for(let g=0;ge.hasOwnProperty(i)?`${s}${e[i]}${c}`:r),t=t.replace(wce,(r,s)=>e.hasOwnProperty(s)?e[s]:r),t=t.replace(Ece,(r,s)=>{if(e.hasOwnProperty(s)){let i=e[s];if(!i.length)throw new Error(`i18n postprocess: unmatched ICU - ${r} with key: ${s}`);return i.shift()}return r})),t}function FA(n,e,t=-1){let r=ft(),s=re(),i=Xe+n,o=Ci(r.consts,e),a=sy();if(r.firstCreatePass&&ice(r,a===null?0:a.index,s,i,o,t),r.type===2){let f=s[Sr];f[ct]|=32}else s[ct]|=32;let c=r.data[i],u=a===s[qr]?null:a,d=j8(r,u,s),p=a&&a.type&8?s[a.index]:null;toe(s,i,a,t),Xle(s,c.create,d,p),XV(!0)}function LA(){XV(!1)}function F3(n,e,t){FA(n,e,t),LA()}function L3(n,e){let t=ft(),r=Ci(t.consts,e);ace(t,n+Xe,r)}function OA(n){let e=re();return zle(Jn(e,ki(),n)),OA}function O3(n){Gle(ft(),re(),n+Xe)}function B3(n,e={}){return Cce(n,e)}function GB(n,e,t){return function r(s){if(s===Function)return t;let i=no(n)?Qs(n.index,e):e;AS(i,5);let o=e[Fn],a=ZB(e,o,t,s),c=r.__ngNextListenerFn__;for(;c;)a=ZB(e,o,c,s)&&a,c=c.__ngNextListenerFn__;return a}}function ZB(n,e,t,r){let s=gt(null);try{return yn(6,e,t),t(r)!==!1}catch(i){return Tce(n,i),!1}finally{yn(7,e,t),gt(s)}}function Tce(n,e){let t=n[dr],r=t?t.get(Ks,null):null;r&&r.handleError(e)}function YB(n,e,t,r,s,i){let o=e[t],a=e[_e],u=a.data[t].outputs[r],d=o[u],p=a.firstCreatePass?qk(a):null,f=Uk(e),h=d.subscribe(i),m=f.length;f.push(i,h),p&&p.push(s,n.index,m,-(m+1))}function BA(n,e,t,r){let s=re(),i=ft(),o=$t();return $A(i,s,s[dt],o,n,e,r),BA}function VA(n,e){let t=$t(),r=re(),s=ft(),i=Zk(s.data),o=V8(i,t,r);return $A(s,r,o,t,n,e),VA}function Dce(n,e,t,r){let s=n.cleanup;if(s!=null)for(let i=0;ic?a[c]:null}typeof o=="string"&&(i+=2)}return null}function $A(n,e,t,r,s,i,o){let a=cS(r),u=n.firstCreatePass?qk(n):null,d=Uk(e),p=!0;if(r.type&3||o){let f=Xs(r,e),h=o?o(f):f,m=d.length,g=o?b=>o(an(b[r.index])):r.index,y=null;if(!o&&a&&(y=Dce(n,e,s,r.index)),y!==null){let b=y.__ngLastListenerFn__||y;b.__ngNextListenerFn__=i,y.__ngLastListenerFn__=i,p=!1}else{i=GB(r,e,i),bre(e,h,s,i);let b=t.listen(h,s,i);d.push(i,b),u&&u.push(s,g,m,m+1)}}else i=GB(r,e,i);if(p){let f=r.outputs?.[s],h=r.hostDirectiveOutputs?.[s];if(h&&h.length)for(let m=0;m(Yo(!0),A2(e[dt],r));function kce(n,e,t,r,s){let i=e[ds],o=!i||Uu()||Jl(t)||qu(i,s);return Yo(o),o?A2(e[dt],r):Zy(i,n,e,t)}function Ace(){oj=kce}function iM(n){return ZS("",n,""),iM}function ZS(n,e,t){let r=re(),s=ah(r,n,e,t);return s!==xt&&qa(r,Cr(),s),ZS}function oM(n,e,t,r,s){let i=re(),o=lh(i,n,e,t,r,s);return o!==xt&&qa(i,Cr(),o),oM}function aM(n,e,t,r,s,i,o){let a=re(),c=ch(a,n,e,t,r,s,i,o);return c!==xt&&qa(a,Cr(),c),aM}function lM(n,e,t,r,s,i,o,a,c){let u=re(),d=uh(u,n,e,t,r,s,i,o,a,c);return d!==xt&&qa(u,Cr(),d),lM}function cM(n,e,t,r,s,i,o,a,c,u,d){let p=re(),f=dh(p,n,e,t,r,s,i,o,a,c,u,d);return f!==xt&&qa(p,Cr(),f),cM}function uM(n,e,t,r,s,i,o,a,c,u,d,p,f){let h=re(),m=ph(h,n,e,t,r,s,i,o,a,c,u,d,p,f);return m!==xt&&qa(h,Cr(),m),uM}function dM(n,e,t,r,s,i,o,a,c,u,d,p,f,h,m){let g=re(),y=fh(g,n,e,t,r,s,i,o,a,c,u,d,p,f,h,m);return y!==xt&&qa(g,Cr(),y),dM}function pM(n,e,t,r,s,i,o,a,c,u,d,p,f,h,m,g,y){let b=re(),E=hh(b,n,e,t,r,s,i,o,a,c,u,d,p,f,h,m,g,y);return E!==xt&&qa(b,Cr(),E),pM}function fM(n){let e=re(),t=oh(e,n);return t!==xt&&qa(e,Cr(),t),fM}function qa(n,e,t){let r=zf(e,n);S8(n[dt],r,t)}function hM(n,e,t){_$(e)&&(e=e());let r=re(),s=ki();if(Jn(r,s,e)){let i=ft(),o=Dn();Rs(i,o,r,n,e,r[dt],t,!1)}return hM}function aj(n,e){let t=_$(n);return t&&n.set(e),t}function mM(n,e){let t=re(),r=ft(),s=$t();return $A(r,t,t[dt],s,n,e),mM}var lj={};function gM(n){let e=ft(),t=re(),r=n+Xe,s=nh(e,r,128,null,null);return eo(s,!1),uS(e,t,r,lj),gM}function cj(n){rs("NgLet");let e=ft(),t=re(),r=Cr();return uS(e,t,r,n),n}function uj(n){let e=GV(),t=ju(e,Xe+n);if(t===lj)throw new Pe(314,!1);return t}function dj(n,e){let t=ft(),r=re(),s=r[dt],i="data-ng-source-location";for(let[o,a,c,u]of e){let d=Hu(t,o+Xe),p=zf(o+Xe,r);if(!p.hasAttribute(i)){let f=`${n}@o:${a},l:${c},c:${u}`;s.setAttribute(p,i,f)}}}function Mce(n,e,t){let r=ft();if(r.firstCreatePass){let s=Ys(n);rk(t,r.data,r.blueprint,s,!0),rk(e,r.data,r.blueprint,s,!1)}}function rk(n,e,t,r,s){if(n=nn(n),Array.isArray(n))for(let i=0;i>20;if(If(n)||!n.multi){let h=new ku(u,s,rh),m=k_(c,e,s?d:d+f,p);m===-1?(Z_(hx(a,o),i,c),__(i,n,e.length),e.push(c),a.directiveStart++,a.directiveEnd++,s&&(a.providerIndexes+=1048576),t.push(h),o.push(h)):(t[m]=h,o[m]=h)}else{let h=k_(c,e,d+f,p),m=k_(c,e,d,d+f),g=h>=0&&t[h],y=m>=0&&t[m];if(s&&!y||!s&&!g){Z_(hx(a,o),i,c);let b=Rce(s?Pce:Nce,t.length,s,r,u);!s&&y&&(t[m].providerFactory=b),__(i,n,e.length,0),e.push(c),a.directiveStart++,a.directiveEnd++,s&&(a.providerIndexes+=1048576),t.push(b),o.push(b)}else{let b=pj(t[s?m:h],u,!s&&r);__(i,n,h>-1?h:m,b)}!s&&r&&y&&t[m].componentProviders++}}}function __(n,e,t,r){let s=If(e),i=pte(e);if(s||i){let c=(i?nn(e.useClass):e).prototype.ngOnDestroy;if(c){let u=n.destroyHooks||(n.destroyHooks=[]);if(!s&&e.multi){let d=u.indexOf(t);d===-1?u.push(t,[r,c]):u[d+1].push(r,c)}else u.push(t,c)}}}function pj(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function k_(n,e,t,r){for(let s=t;s{t.providersResolver=(r,s)=>Mce(r,s?s(n):n,e)}}function hj(n){return e=>{n.length<1||(e.getExternalStyles=t=>n.map(s=>s+"?ngcomp"+(t?"="+encodeURIComponent(t):"")+"&e="+e.encapsulation))}}function mj(n,e,t){let r=n.\u0275cmp;r.directiveDefs=Rx(e,!1),r.pipeDefs=Rx(t,!0)}function gj(n,e){return Zo(()=>{let t=Wl(n,!0);t.declarations=BE(e.declarations||on),t.imports=BE(e.imports||on),t.exports=BE(e.exports||on),e.bootstrap&&(t.bootstrap=BE(e.bootstrap)),Lf.registerNgModule(n,e)})}function BE(n){if(typeof n=="function")return n;let e=Oo(n);return e.some(sS)?()=>e.map(nn).map(XB):e.map(XB)}function XB(n){return rA(n)?n.ngModule:n}function vj(n,e,t){let r=fs()+n,s=re();return s[r]===xt?Ko(s,r,t?e.call(t):e()):Xy(s,r)}function yj(n,e,t,r){return Ij(re(),fs(),n,e,t,r)}function bj(n,e,t,r,s){return _j(re(),fs(),n,e,t,r,s)}function wj(n,e,t,r,s,i){return kj(re(),fs(),n,e,t,r,s,i)}function Ej(n,e,t,r,s,i,o){return Aj(re(),fs(),n,e,t,r,s,i,o)}function xj(n,e,t,r,s,i,o,a){let c=fs()+n,u=re(),d=_i(u,c,t,r,s,i);return Jn(u,c+4,o)||d?Ko(u,c+5,a?e.call(a,t,r,s,i,o):e(t,r,s,i,o)):Xy(u,c+5)}function Sj(n,e,t,r,s,i,o,a,c){let u=fs()+n,d=re(),p=_i(d,u,t,r,s,i);return Ru(d,u+4,o,a)||p?Ko(d,u+6,c?e.call(c,t,r,s,i,o,a):e(t,r,s,i,o,a)):Xy(d,u+6)}function Cj(n,e,t,r,s,i,o,a,c,u){let d=fs()+n,p=re(),f=_i(p,d,t,r,s,i);return LS(p,d+4,o,a,c)||f?Ko(p,d+7,u?e.call(u,t,r,s,i,o,a,c):e(t,r,s,i,o,a,c)):Xy(p,d+7)}function Tj(n,e,t,r,s,i,o,a,c,u,d){let p=fs()+n,f=re(),h=_i(f,p,t,r,s,i);return _i(f,p+4,o,a,c,u)||h?Ko(f,p+8,d?e.call(d,t,r,s,i,o,a,c,u):e(t,r,s,i,o,a,c,u)):Xy(f,p+8)}function Dj(n,e,t,r){return Mj(re(),fs(),n,e,t,r)}function Jy(n,e){let t=n[e];return t===xt?void 0:t}function Ij(n,e,t,r,s,i){let o=e+t;return Jn(n,o,s)?Ko(n,o+1,i?r.call(i,s):r(s)):Jy(n,o+1)}function _j(n,e,t,r,s,i,o){let a=e+t;return Ru(n,a,s,i)?Ko(n,a+2,o?r.call(o,s,i):r(s,i)):Jy(n,a+2)}function kj(n,e,t,r,s,i,o,a){let c=e+t;return LS(n,c,s,i,o)?Ko(n,c+3,a?r.call(a,s,i,o):r(s,i,o)):Jy(n,c+3)}function Aj(n,e,t,r,s,i,o,a,c){let u=e+t;return _i(n,u,s,i,o,a)?Ko(n,u+4,c?r.call(c,s,i,o,a):r(s,i,o,a)):Jy(n,u+4)}function Mj(n,e,t,r,s,i){let o=e+t,a=!1;for(let c=0;c=0;t--){let r=e[t];if(n===r.name)return r}}function Pj(n,e,t){let r=n+Xe,s=re(),i=ju(s,r);return eb(s,r)?Ij(s,fs(),e,i.transform,t,i):i.transform(t)}function Rj(n,e,t,r){let s=n+Xe,i=re(),o=ju(i,s);return eb(i,s)?_j(i,fs(),e,o.transform,t,r,o):o.transform(t,r)}function Fj(n,e,t,r,s){let i=n+Xe,o=re(),a=ju(o,i);return eb(o,i)?kj(o,fs(),e,a.transform,t,r,s,a):a.transform(t,r,s)}function Lj(n,e,t,r,s,i){let o=n+Xe,a=re(),c=ju(a,o);return eb(a,o)?Aj(a,fs(),e,c.transform,t,r,s,i,c):c.transform(t,r,s,i)}function Oj(n,e,t){let r=n+Xe,s=re(),i=ju(s,r);return eb(s,r)?Mj(s,fs(),e,i.transform,t,i):i.transform.apply(i,t)}function eb(n,e){return n[_e].data[e].pure}function Bj(n,e){return MS(n,e)}function Vj(n,e){return()=>{try{return Lf.getComponentDependencies(n,e).dependencies}catch(t){throw console.error(`Computing dependencies in local compilation mode for the component "${n.name}" failed with the exception:`,t),t}}}function $j(n,e){let t=Bn(n);t!==null&&(t.debugInfo=e)}function Hj(n,e,t){let r=`./@ng/component?c=${n}&t=${encodeURIComponent(e)}`;return new URL(r,t).href}function jj(n,e,t,r,s=null,i=null){let o=Bn(n);e.apply(null,[n,t,...r]);let{newDef:a,oldDef:c}=Lce(o,Bn(n));if(n[qf]=a,c.tView){let u=Ane().values();for(let d of u)zl(d)&&d[Wn]===null&&KE(s,i,a,c,d)}}function Lce(n,e){let t={...n};return{newDef:Object.assign(n,e,{directiveDefs:t.directiveDefs,pipeDefs:t.pipeDefs,setInput:t.setInput,type:t.type}),oldDef:t}}function KE(n,e,t,r,s){let i=s[_e];if(i===r.tView){Bce(n,e,t,r,s);return}for(let o=Xe;o{if(r.encapsulation===ps.ShadowDom){let m=o.cloneNode(!1);o.replaceWith(m),o=m}let p=R8(t),f=TS(a,p,i,$2(t),o,c,null,null,null,null,null);Vce(a,s,f,c.index),Gy(s[_e],s);let h=s[Ho].rendererFactory;Oce(h,r),f[dt]=h.createRenderer(o,t),$8(s[_e],s),$ce(c),IS(p,f,i),eH(p,f,p.template,i)};u===null?QB(n,e,d):u.run(()=>QB(n,e,d))}function QB(n,e,t){try{t()}catch(r){let s=r;if(e!==null&&s.message){let i=s.message+(s.stack?` +`+s.stack:"");n?.hot?.send?.("angular:invalidate",{id:e,message:i,error:!0})}throw r}}function Vce(n,e,t,r){for(let s=Xe;s=0;n--){let{moduleType:e,ngModule:t}=Wv[n];t.declarations&&t.declarations.every(qj)&&(Wv.splice(n,1),Yce(e,t))}}finally{A_=!1}}}function qj(n){return Array.isArray(n)?n.every(qj):!!nn(n)}function Wj(n,e={}){zj(n,e),e.id!==void 0&&cA(n,e.id),qce(n,e)}function zj(n,e,t=!1){let r=Oo(e.declarations||on),s=null;Object.defineProperty(n,Dk,{configurable:!0,get:()=>(s===null&&(s=Er({usage:0,kind:"NgModule",type:n}).compileNgModule(us,`ng:///${n.name}/\u0275mod.js`,{type:n,bootstrap:Oo(e.bootstrap||on).map(nn),declarations:r.map(nn),imports:Oo(e.imports||on).map(nn).map(KB),exports:Oo(e.exports||on).map(nn).map(KB),schemas:e.schemas?Oo(e.schemas):null,id:e.id||null}),s.schemas||(s.schemas=[])),s)});let i=null;Object.defineProperty(n,Ma,{get:()=>{if(i===null){let a=Er({usage:0,kind:"NgModule",type:n});i=a.compileFactory(us,`ng:///${n.name}/\u0275fac.js`,{name:n.name,type:n,deps:mS(n),target:a.FactoryTarget.NgModule,typeArgumentCount:0})}return i},configurable:!1});let o=null;Object.defineProperty(n,ex,{get:()=>{if(o===null){let a={name:n.name,type:n,providers:e.providers||on,imports:[(e.imports||on).map(nn),(e.exports||on).map(nn)]};o=Er({usage:0,kind:"NgModule",type:n}).compileInjector(us,`ng:///${n.name}/\u0275inj.js`,a)}return o},configurable:!1})}function Wce(n,e){let t=`Unexpected "${Ei(n)}" found in the "declarations" array of the`,r=`"${Ei(n)}" is marked as standalone and can't be declared in any NgModule - did you intend to import it instead (by adding it to the "imports" array)?`;return`${t} ${e}, ${r}`}var zce=new WeakMap,Gce=new WeakMap;function Zce(){zce=new WeakMap,Gce=new WeakMap,Wv.length=0,Dae.clear()}function Yce(n,e){let t=Oo(e.declarations||on),r=yM(n);t.forEach(s=>{if(s=nn(s),s.hasOwnProperty(qf)){let o=Bn(s);vM(o,r)}else!s.hasOwnProperty(oS)&&!s.hasOwnProperty(aS)&&(s.ngSelectorScope=n)})}function vM(n,e){n.directiveDefs=()=>Array.from(e.compilation.directives).map(t=>t.hasOwnProperty(qf)?Bn(t):to(t)).filter(t=>!!t),n.pipeDefs=()=>Array.from(e.compilation.pipes).map(t=>Oa(t)),n.schemas=e.schemas,n.tView=null}function yM(n){if(ou(n)){let e=Lf.getNgModuleScope(n);return{schemas:Wl(n,!0).schemas||null,...e}}else if(ix(n)){if((Bn(n)||to(n))!==null)return{schemas:null,compilation:{directives:new Set,pipes:new Set},exported:{directives:new Set([n]),pipes:new Set}};if(Oa(n)!==null)return{schemas:null,compilation:{directives:new Set,pipes:new Set},exported:{directives:new Set,pipes:new Set([n])}}}throw new Error(`${n.name} does not have a module def (\u0275mod property)`)}function KB(n){return rA(n)?n.ngModule:n}var M_=0;function Gj(n,e){let t=null;pae(n,e),Yj(n,e),Object.defineProperty(n,qf,{get:()=>{if(t===null){let r=Er({usage:0,kind:"component",type:n});if(zH(e)){let u=[`Component '${n.name}' is not resolved:`];throw e.templateUrl&&u.push(` - templateUrl: ${e.templateUrl}`),e.styleUrls&&e.styleUrls.length&&u.push(` - styleUrls: ${JSON.stringify(e.styleUrls)}`),e.styleUrl&&u.push(` - styleUrl: ${e.styleUrl}`),u.push("Did you run and wait for 'resolveComponentResources()'?"),new Error(u.join(` +`))}let s=jce(),i=e.preserveWhitespaces;i===void 0&&(s!==null&&s.preserveWhitespaces!==void 0?i=s.preserveWhitespaces:i=!1);let o=e.encapsulation;o===void 0&&(s!==null&&s.defaultEncapsulation!==void 0?o=s.defaultEncapsulation:o=ps.Emulated);let a=e.templateUrl||`ng:///${n.name}/template.html`,c={...Xj(n,e),typeSourceSpan:r.createParseSourceSpan("Component",n.name,a),template:e.template||"",preserveWhitespaces:i,styles:typeof e.styles=="string"?[e.styles]:e.styles||on,animations:e.animations,declarations:[],changeDetection:e.changeDetection,encapsulation:o,interpolation:e.interpolation,viewProviders:e.viewProviders||null};M_++;try{if(c.usesInheritance&&Qj(n),t=r.compileComponent(us,a,c),c.isStandalone){let u=Oo(e.imports||on),{directiveDefs:d,pipeDefs:p}=Xce(n,u);t.directiveDefs=d,t.pipeDefs=p,t.dependencies=()=>u.map(nn)}}finally{M_--}if(M_===0&&Uj(),Qce(n)){let u=yM(n.ngSelectorScope);vM(t,u)}if(e.schemas)if(c.isStandalone)t.schemas=e.schemas;else throw new Error(`The 'schemas' was specified for the ${Ei(n)} but is only valid on a component that is standalone.`);else c.isStandalone&&(t.schemas=[])}return t},set:r=>{t=r},configurable:!1})}function Xce(n,e){return{directiveDefs:()=>Hv(n)?[...Lf.getStandaloneComponentScope(n,e).compilation.directives].map(i=>Bn(i)||to(i)).filter(i=>i!==null):[],pipeDefs:()=>Hv(n)?[...Lf.getStandaloneComponentScope(n,e).compilation.pipes].map(i=>Oa(i)).filter(i=>i!==null):[]}}function Qce(n){return n.ngSelectorScope!==void 0}function bM(n,e){let t=null;Yj(n,e||{}),Object.defineProperty(n,oS,{get:()=>{if(t===null){let r=Zj(n,e||{});t=Er({usage:0,kind:"directive",type:n}).compileDirective(us,r.sourceMapUrl,r.metadata)}return t},configurable:!1})}function Zj(n,e){let t=n&&n.name,r=`ng:///${t}/\u0275dir.js`,s=Er({usage:0,kind:"directive",type:n}),i=Xj(n,e);return i.typeSourceSpan=s.createParseSourceSpan("Directive",t,r),i.usesInheritance&&Qj(n),{metadata:i,sourceMapUrl:r}}function Yj(n,e){let t=null;Object.defineProperty(n,Ma,{get:()=>{if(t===null){let r=Zj(n,e),s=Er({usage:0,kind:"directive",type:n});t=s.compileFactory(us,`ng:///${n.name}/\u0275fac.js`,{name:r.metadata.name,type:r.metadata.type,typeArgumentCount:0,deps:mS(n),target:s.FactoryTarget.Directive})}return t},configurable:!1})}function Kce(n){return Object.getPrototypeOf(n.prototype)===Object.prototype}function Xj(n,e){let t=n2(),r=t.ownPropMetadata(n);return{name:n.name,type:n,selector:e.selector!==void 0?e.selector:null,host:e.host||Qi,propMetadata:r,inputs:e.inputs||on,outputs:e.outputs||on,queries:JB(n,r,Kj),lifecycle:{usesOnChanges:t.hasLifecycleHook(n,"ngOnChanges")},typeSourceSpan:null,usesInheritance:!Kce(n),exportAs:tue(e.exportAs),providers:e.providers||null,viewQueries:JB(n,r,Jj),isStandalone:e.standalone===void 0?!0:!!e.standalone,isSignal:!!e.signals,hostDirectives:e.hostDirectives?.map(s=>typeof s=="function"?{directive:s}:s)||null}}function Qj(n){let e=Object.prototype,t=Object.getPrototypeOf(n.prototype).constructor;for(;t&&t!==e;)!to(t)&&!Bn(t)&&rue(t)&&bM(t,null),t=Object.getPrototypeOf(t)}function Jce(n){return typeof n=="string"?t4(n):nn(n)}function eue(n,e){return{propertyName:n,predicate:Jce(e.selector),descendants:e.descendants,first:e.first,read:e.read?e.read:null,static:!!e.static,emitDistinctChangesOnly:!!e.emitDistinctChangesOnly,isSignal:!!e.isSignal}}function JB(n,e,t){let r=[];for(let s in e)if(e.hasOwnProperty(s)){let i=e[s];i.forEach(o=>{if(t(o)){if(!o.selector)throw new Error(`Can't construct a query for the property "${s}" of "${Ei(n)}" since the query selector wasn't defined.`);if(i.some(e4))throw new Error("Cannot combine @Input decorators with query decorators");r.push(eue(s,o))}})}return r}function tue(n){return n===void 0?null:t4(n)}function Kj(n){let e=n.ngMetadataName;return e==="ContentChild"||e==="ContentChildren"}function Jj(n){let e=n.ngMetadataName;return e==="ViewChild"||e==="ViewChildren"}function e4(n){return n.ngMetadataName==="Input"}function t4(n){return n.split(",").map(e=>e.trim())}var nue=["ngOnChanges","ngOnInit","ngOnDestroy","ngDoCheck","ngAfterViewInit","ngAfterViewChecked","ngAfterContentInit","ngAfterContentChecked"];function rue(n){let e=n2();if(nue.some(r=>e.hasLifecycleHook(n,r)))return!0;let t=e.propMetadata(n);for(let r in t){let s=t[r];for(let i=0;i{if(r===null){let s=eV(n,e),i=Er({usage:0,kind:"pipe",type:s.type});r=i.compileFactory(us,`ng:///${s.name}/\u0275fac.js`,{name:s.name,type:s.type,typeArgumentCount:0,deps:mS(n),target:i.FactoryTarget.Pipe})}return r},configurable:!1}),Object.defineProperty(n,aS,{get:()=>{if(t===null){let s=eV(n,e);t=Er({usage:0,kind:"pipe",type:s.type}).compilePipe(us,`ng:///${s.name}/\u0275pipe.js`,s)}return t},configurable:!1})}function eV(n,e){return{type:n,name:n.name,pipeName:e.name,pure:e.pure!==void 0?e.pure:!0,isStandalone:e.standalone===void 0?!0:!!e.standalone}}var ht=Ay("Directive",(n={})=>n,void 0,void 0,(n,e)=>bM(n,e)),ms=Ay("Component",(n={})=>({changeDetection:py.Default,...n}),ht,void 0,(n,e)=>Gj(n,e)),gs=Ay("Pipe",n=>({pure:!0,...n}),void 0,void 0,(n,e)=>n4(n,e)),ze=Kl("Input",n=>n?typeof n=="string"?{alias:n}:n:{}),mh=Kl("Output",n=>({alias:n})),sue=Kl("HostBinding",n=>({hostPropertyName:n})),iue=Kl("HostListener",(n,e)=>({eventName:n,args:e})),ao=Ay("NgModule",n=>n,void 0,void 0,(n,e)=>Wj(n,e)),Wo=class{constructor(e){l(this,"full");l(this,"major");l(this,"minor");l(this,"patch");this.full=e;let t=e.split(".");this.major=t[0],this.minor=t[1],this.patch=t.slice(2).join(".")}},oue=new Wo("19.2.25"),qx=class{constructor(e,t){l(this,"ngModuleFactory");l(this,"componentFactories");this.ngModuleFactory=e,this.componentFactories=t}},hu=class hu{compileModuleSync(e){return new Vf(e)}compileModuleAsync(e){return Promise.resolve(this.compileModuleSync(e))}compileModuleAndAllComponentsSync(e){let t=this.compileModuleSync(e),r=Wl(e),s=gf(r.declarations).reduce((i,o)=>{let a=Bn(o);return a&&i.push(new Yl(a)),i},[]);return new qx(t,s)}compileModuleAndAllComponentsAsync(e){return Promise.resolve(this.compileModuleAndAllComponentsSync(e))}clearCache(){}clearCacheFor(e){}getModuleId(e){}};l(hu,"\u0275fac",function(t){return new(t||hu)}),l(hu,"\u0275prov",rn({token:hu,factory:hu.\u0275fac,providedIn:"root"}));var ik=hu,r4=new $e(""),ok=class{};function s4(n,e,t){let r=new Vf(t);if(typeof ngJitMode<"u"&&!ngJitMode)return Promise.resolve(r);let s=n.get(r4,[]).concat(e);if(Hce({defaultEncapsulation:tV(s.map(u=>u.defaultEncapsulation)),preserveWhitespaces:tV(s.map(u=>u.preserveWhitespaces))}),mae())return Promise.resolve(r);let i=s.flatMap(u=>u.providers??[]);if(i.length===0)return Promise.resolve(r);let o=Er({usage:0,kind:"NgModule",type:t}),c=In.create({providers:i}).get(o.ResourceLoader);return WH(u=>Promise.resolve(c.get(u))).then(()=>r)}function tV(n){for(let e=n.length-1;e>=0;e--)if(n[e]!==void 0)return n[e]}var mu=class mu{constructor(){l(this,"zone",ye(ln));l(this,"changeDetectionScheduler",ye(Ti));l(this,"applicationRef",ye(ns));l(this,"_onMicrotaskEmptySubscription")}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}};l(mu,"\u0275fac",function(t){return new(t||mu)}),l(mu,"\u0275prov",rn({token:mu,factory:mu.\u0275fac,providedIn:"root"}));var ak=mu,i4=new $e("",{factory:()=>!1});function YS({ngZoneFactory:n,ignoreChangesOutsideZone:e,scheduleInRootZone:t}){return n??(n=()=>new ln({...wM(),scheduleInRootZone:t})),[{provide:ln,useFactory:n},{provide:Ki,multi:!0,useFactory:()=>{let r=ye(ak,{optional:!0});return()=>r.initialize()}},{provide:Ki,multi:!0,useFactory:()=>{let r=ye(lk);return()=>{r.initialize()}}},e===!0?{provide:x$,useValue:!0}:[],{provide:r2,useValue:t??E$}]}function aue(n){let e=n?.ignoreChangesOutsideZone,t=n?.scheduleInRootZone,r=YS({ngZoneFactory:()=>{let s=wM(n);return s.scheduleInRootZone=t,s.shouldCoalesceEventChangeDetection&&rs("NgZone_CoalesceEvent"),new ln(s)},ignoreChangesOutsideZone:e,scheduleInRootZone:t});return Ba([{provide:i4,useValue:!0},{provide:Zf,useValue:!1},r])}function wM(n){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:n?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:n?.runCoalescing??!1}}var gu=class gu{constructor(){l(this,"subscription",new zi);l(this,"initialized",!1);l(this,"zone",ye(ln));l(this,"pendingTasks",ye(Uo))}initialize(){if(this.initialized)return;this.initialized=!0;let e=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(e=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{ln.assertNotInAngularZone(),queueMicrotask(()=>{e!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(e),e=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{ln.assertInAngularZone(),e??(e=this.pendingTasks.add())}))}ngOnDestroy(){this.subscription.unsubscribe()}};l(gu,"\u0275fac",function(t){return new(t||gu)}),l(gu,"\u0275prov",rn({token:gu,factory:gu.\u0275fac,providedIn:"root"}));var lk=gu;var vu=class vu{constructor(){l(this,"appRef",ye(ns));l(this,"taskService",ye(Uo));l(this,"ngZone",ye(ln));l(this,"zonelessEnabled",ye(Zf));l(this,"tracing",ye(ro,{optional:!0}));l(this,"disableScheduling",ye(x$,{optional:!0})??!1);l(this,"zoneIsDefined",typeof Zone<"u"&&!!Zone.root.run);l(this,"schedulerTickApplyArgs",[{data:{__scheduler_tick__:!0}}]);l(this,"subscriptions",new zi);l(this,"angularZoneId",this.zoneIsDefined?this.ngZone._inner?.get(gx):null);l(this,"scheduleInRootZone",!this.zonelessEnabled&&this.zoneIsDefined&&(ye(r2,{optional:!0})??!1));l(this,"cancelScheduledCallback",null);l(this,"useMicrotaskScheduler",!1);l(this,"runningTick",!1);l(this,"pendingRenderTaskId",null);this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{this.runningTick||this.cleanup()})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()})),this.disableScheduling||(this.disableScheduling=!this.zonelessEnabled&&(this.ngZone instanceof Mf||!this.zoneIsDefined))}notify(e){if(!this.zonelessEnabled&&e===5)return;let t=!1;switch(e){case 0:{this.appRef.dirtyFlags|=2;break}case 3:case 2:case 4:case 5:case 1:{this.appRef.dirtyFlags|=4;break}case 6:{this.appRef.dirtyFlags|=2,t=!0;break}case 12:{this.appRef.dirtyFlags|=16,t=!0;break}case 13:{this.appRef.dirtyFlags|=2,t=!0;break}case 11:{t=!0;break}case 9:case 8:case 7:case 10:default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(t))return;let r=this.useMicrotaskScheduler?QO:S$;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>r(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>r(()=>this.tick()))}shouldScheduleTick(e){return!(this.disableScheduling&&!e||this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(gx+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(t){throw this.taskService.remove(e),t}finally{this.cleanup()}this.useMicrotaskScheduler=!0,QO(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(e)})}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)}}};l(vu,"\u0275fac",function(t){return new(t||vu)}),l(vu,"\u0275prov",rn({token:vu,factory:vu.\u0275fac,providedIn:"root"}));var jf=vu;function lue(){return rs("NgZoneless"),Ba([{provide:Ti,useExisting:jf},{provide:ln,useClass:Mf},{provide:Zf,useValue:!0},{provide:r2,useValue:!1},[]])}function cue(){return typeof ngI18nClosureMode<"u"&&ngI18nClosureMode&&typeof goog<"u"&&goog.LOCALE!=="en"?goog.LOCALE:typeof $localize<"u"&&$localize.locale||Ty}var ss=new $e("",{providedIn:"root",factory:()=>ye(ss,Ot.Optional|Ot.SkipSelf)||cue()}),XS=new $e("",{providedIn:"root",factory:()=>qle}),uue=new $e(""),due=new $e(""),ck;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Ignore=2]="Ignore"})(ck||(ck={}));var pue=200,nV=1200,yu=class yu{constructor(){l(this,"window",null);l(this,"observer",null);l(this,"options",ye(bS));l(this,"lcpImageUrl")}start(){if(typeof ngServerMode<"u"&&ngServerMode||typeof PerformanceObserver>"u"||this.options?.disableImageSizeWarning&&this.options?.disableImageLazyLoadWarning)return;this.observer=this.initPerformanceObserver();let e=qo(),t=e.defaultView;if(t){this.window=t;let r=()=>{setTimeout(this.scanImages.bind(this),pue)},s=()=>{e.readyState==="complete"?r():this.window?.addEventListener("load",r,{once:!0})};typeof Zone<"u"?Zone.root.run(()=>s()):s()}}ngOnDestroy(){this.observer?.disconnect()}initPerformanceObserver(){if(typeof PerformanceObserver>"u")return null;let e=new PerformanceObserver(t=>{let r=t.getEntries();if(r.length===0)return;let i=r[r.length-1].element?.src??"";i.startsWith("data:")||i.startsWith("blob:")||(this.lcpImageUrl=i)});return e.observe({type:"largest-contentful-paint",buffered:!0}),e}scanImages(){let e=qo().querySelectorAll("img"),t,r=!1;e.forEach(s=>{this.options?.disableImageSizeWarning||!s.getAttribute("ng-img")&&this.isOversized(s)&&hue(s.src),!this.options?.disableImageLazyLoadWarning&&this.lcpImageUrl&&s.src===this.lcpImageUrl&&(t=!0,(s.loading!=="lazy"||s.getAttribute("ng-img"))&&(r=!0))}),t&&!r&&this.lcpImageUrl&&!this.options?.disableImageLazyLoadWarning&&fue(this.lcpImageUrl)}isOversized(e){if(!this.window)return!1;let t=[".svg"],r=(e.src||"").toLowerCase();if(t.some(g=>r.endsWith(g)))return!1;let s=this.window.getComputedStyle(e),i=parseFloat(s.getPropertyValue("width")),o=parseFloat(s.getPropertyValue("height")),a=s.getPropertyValue("box-sizing");if(s.getPropertyValue("object-fit")==="cover")return!1;if(a==="border-box"){let g=s.getPropertyValue("padding-top"),y=s.getPropertyValue("padding-right"),b=s.getPropertyValue("padding-bottom"),E=s.getPropertyValue("padding-left");i-=parseFloat(y)+parseFloat(E),o-=parseFloat(g)+parseFloat(b)}let u=e.naturalWidth,d=e.naturalHeight,p=this.window.devicePixelRatio*i,f=this.window.devicePixelRatio*o,h=u-p>=nV,m=d-f>=nV;return h||m}};l(yu,"\u0275fac",function(t){return new(t||yu)}),l(yu,"\u0275prov",rn({token:yu,factory:yu.\u0275fac,providedIn:"root"}));var rV=yu;function fue(n){console.warn(Go(-913,`An image with src ${n} is the Largest Contentful Paint (LCP) element but was given a "loading" value of "lazy", which can negatively impact application loading performance. This warning can be addressed by changing the loading value of the LCP image to "eager", or by using the NgOptimizedImage directive's prioritization utilities. For more information about addressing or disabling this warning, see https://angular.dev/errors/NG0913`))}function hue(n){console.warn(Go(-913,`An image with src ${n} has intrinsic file dimensions much larger than its rendered size. This can negatively impact application loading performance. For more information about addressing or disabling this warning, see https://angular.dev/errors/NG0913`))}var Wx=new $e(""),o4=new $e("");function Pv(n){return!n.moduleRef}function a4(n){let e=Pv(n)?n.r3Injector:n.moduleRef.injector,t=e.get(ln);return t.run(()=>{Pv(n)?n.r3Injector.resolveInjectorInitializers():n.moduleRef.resolveInjectorInitializers();let r=e.get(Ks,null),s;if(t.runOutsideAngular(()=>{s=t.onError.subscribe({next:i=>{r.handleError(i)}})}),Pv(n)){let i=()=>e.destroy(),o=n.platformInjector.get(Wx);o.add(i),e.onDestroy(()=>{s.unsubscribe(),o.delete(i)})}else{let i=()=>n.moduleRef.destroy(),o=n.platformInjector.get(Wx);o.add(i),n.moduleRef.onDestroy(()=>{QE(n.allPlatformModules,n.moduleRef),s.unsubscribe(),o.delete(i)})}return gue(r,t,()=>{let i=e.get(Sy);return i.runInitializers(),i.donePromise.then(()=>{let o=e.get(ss,Ty);if(T3(o||Ty),!e.get(o4,!0))return Pv(n)?e.get(ns):(n.allPlatformModules.push(n.moduleRef),n.moduleRef);if(Pv(n)){let c=e.get(ns);return n.rootComponent!==void 0&&c.bootstrap(n.rootComponent),c}else return mue(n.moduleRef,n.allPlatformModules),n.moduleRef})})})}function mue(n,e){let t=n.injector.get(ns);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(r=>t.bootstrap(r));else if(n.instance.ngDoBootstrap)n.instance.ngDoBootstrap(t);else throw new Pe(-403,!1);e.push(n)}function gue(n,e,t){try{let r=t();return Wu(r)?r.catch(s=>{throw e.runOutsideAngular(()=>n.handleError(s)),s}):r}catch(r){throw e.runOutsideAngular(()=>n.handleError(r)),r}}var bu=class bu{constructor(e){l(this,"_injector");l(this,"_modules",[]);l(this,"_destroyListeners",[]);l(this,"_destroyed",!1);this._injector=e}bootstrapModuleFactory(e,t){let r=t?.scheduleInRootZone,s=()=>yne(t?.ngZone,{...wM({eventCoalescing:t?.ngZoneEventCoalescing,runCoalescing:t?.ngZoneRunCoalescing}),scheduleInRootZone:r}),i=t?.ignoreChangesOutsideZone,o=[YS({ngZoneFactory:s,ignoreChangesOutsideZone:i}),{provide:Ti,useExisting:jf}],a=Eae(e.moduleType,this.injector,o);return a4({moduleRef:a,allPlatformModules:this._modules,platformInjector:this.injector})}bootstrapModule(e,t=[]){let r=v5({},t);return s4(this.injector,r,e).then(s=>this.bootstrapModuleFactory(s,r))}onDestroy(e){this._destroyListeners.push(e)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Pe(404,!1);this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t());let e=this._injector.get(Wx,null);e&&(e.forEach(t=>t()),e.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}};l(bu,"\u0275fac",function(t){return new(t||bu)(Mr(In))}),l(bu,"\u0275prov",rn({token:bu,factory:bu.\u0275fac,providedIn:"platform"}));var Iy=bu,Df=null;function l4(n){if(tb())throw new Pe(400,!1);m5(),Df=typeof ngServerMode>"u"||!ngServerMode?n:null;let e=n.get(Iy);return p4(n),e}function QS(n,e,t=[]){let r=`Platform: ${e}`,s=new $e(r);return(i=[])=>{let o=tb();if(!o){let a=[...t,...i,{provide:s,useValue:!0}];o=n?.(a)??l4(c4(a,r))}return typeof ngServerMode<"u"&&ngServerMode?o:u4(s)}}function c4(n=[],e){return In.create({name:e,providers:[{provide:Fy,useValue:"platform"},{provide:Wx,useValue:new Set([()=>Df=null])},...n]})}function u4(n){let e=tb();if(!e)throw new Pe(401,!1);return e}function tb(){return typeof ngServerMode<"u"&&ngServerMode?null:Df?.get(Iy)??null}function vue(){tb()?.destroy()}function d4(n=[]){if(Df)return Df;let e=c4(n);return(typeof ngServerMode>"u"||!ngServerMode)&&(Df=e),m5(),p4(e),e}function yue(n){return Ba([{provide:Vy,useValue:n,multi:!0}])}function p4(n){let e=n.get(Vy,null);Pk(n,()=>{e?.forEach(t=>t())})}function bue(n){return Ba([])}function wue(){return!1}function Eue(){}function xue(n){let e=YH(n);if(!e)throw f4(n);return new Vf(e)}function Sue(n){let e=YH(n);if(!e)throw f4(n);return e}function f4(n){return new Error(`No module with ID ${n} loaded`)}var bn=class{};l(bn,"__NG_ELEMENT_ID__",h4);function h4(n){return Cue($t(),re(),(n&16)===16)}function Cue(n,e,t){if(no(n)&&!t){let r=Qs(n.index,e);return new Rf(r,r)}else if(n.type&175){let r=e[Sr];return new Rf(r,e)}return null}var zx=class extends bn{},uk=class extends zx{},dk=class{constructor(e,t){l(this,"name");l(this,"callback");this.name=e,this.callback=t}};function Tue(n){return n.map(e=>e.nativeElement)}var _y=class{constructor(e){l(this,"nativeNode");this.nativeNode=e}get parent(){let e=this.nativeNode.parentNode;return e?new Bu(e):null}get injector(){return $ne(this.nativeNode)}get componentInstance(){let e=this.nativeNode;return e&&(rB(e)||Vne(e))}get context(){return rB(this.nativeNode)||Bne(this.nativeNode)}get listeners(){return Wne(this.nativeNode).filter(e=>e.type==="dom")}get references(){return Une(this.nativeNode)}get providerTokens(){return Hne(this.nativeNode)}},Bu=class extends _y{constructor(e){super(e)}get nativeElement(){return this.nativeNode.nodeType==Node.ELEMENT_NODE?this.nativeNode:null}get name(){let e=Ms(this.nativeNode),t=e?e.lView:null;return t!==null?t[_e].data[e.nodeIndex].value:this.nativeNode.nodeName}get properties(){let e=Ms(this.nativeNode),t=e?e.lView:null;if(t===null)return{};let r=t[_e].data,s=r[e.nodeIndex],i={};return Due(this.nativeElement,i),_ue(i,s,t,r),i}get attributes(){let e={},t=this.nativeElement;if(!t)return e;let r=Ms(t),s=r?r.lView:null;if(s===null)return{};let i=s[_e].data[r.nodeIndex].attrs,o=[];if(i){let a=0;for(;ae[i]=!0),e}get childNodes(){let e=this.nativeNode.childNodes,t=[];for(let r=0;r{if(i.name===e){let o=i.callback;o.call(r,t),s.push(o)}}),typeof r.eventListeners=="function"&&r.eventListeners(e).forEach(i=>{if(i.toString().indexOf("__ngUnwrap__")!==-1){let o=i("__ngUnwrap__");return s.indexOf(o)===-1&&o.call(r,t)}})}};function Due(n,e){if(n){let t=Object.getPrototypeOf(n),r=Node.prototype;for(;t!==null&&t!==r;){let s=Object.getOwnPropertyDescriptors(t);for(let i in s)if(!i.startsWith("__")&&!i.startsWith("on")){let o=n[i];Iue(o)&&(e[i]=o)}t=Object.getPrototypeOf(t)}}}function Iue(n){return typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n===null}function sV(n,e,t,r){let s=Ms(n.nativeNode),i=s?s.lView:null;if(i!==null){let o=i[_e].data[s.nodeIndex];au(o,i,e,t,r,n.nativeNode)}else EM(n.nativeNode,e,t,r)}function au(n,e,t,r,s,i){let o=Ite(n,e);if(n.type&11){if(N_(o,t,r,s,i),no(n)){let c=Qs(n.index,e);c&&c[_e].firstChild&&au(c[_e].firstChild,c,t,r,s,i)}else n.child&&au(n.child,e,t,r,s,i),o&&EM(o,t,r,s);let a=e[n.index];Pr(a)&&iV(a,t,r,s,i)}else if(n.type&4){let a=e[n.index];N_(a[jo],t,r,s,i),iV(a,t,r,s,i)}else if(n.type&16){let a=e[Sr],u=a[qr].projection[n.projection];if(Array.isArray(u))for(let d of u)N_(d,t,r,s,i);else if(u){let d=a[Wn],p=d[_e].data[u.index];au(p,d,t,r,s,i)}}else n.child&&au(n.child,e,t,r,s,i);if(i!==o){let a=n.flags&2?n.projectionNext:n.next;a&&au(a,e,t,r,s,i)}}function iV(n,e,t,r,s){for(let i=qn;i1){let d=c[1];for(let p=1;pe,Zx=class{constructor(e){l(this,"length",0);l(this,"collection");l(this,"_linkedRecords",null);l(this,"_unlinkedRecords",null);l(this,"_previousItHead",null);l(this,"_itHead",null);l(this,"_itTail",null);l(this,"_additionsHead",null);l(this,"_additionsTail",null);l(this,"_movesHead",null);l(this,"_movesTail",null);l(this,"_removalsHead",null);l(this,"_removalsTail",null);l(this,"_identityChangesHead",null);l(this,"_identityChangesTail",null);l(this,"_trackByFn");this._trackByFn=e||kue}forEachItem(e){let t;for(t=this._itHead;t!==null;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,r=this._removalsHead,s=0,i=null;for(;t||r;){let o=!r||t&&t.currentIndex{o=this._trackByFn(s,a),t===null||!Object.is(t.trackById,o)?(t=this._mismatch(t,a,o,s),r=!0):(r&&(t=this._verifyReinsertion(t,a,o,s)),Object.is(t.item,a)||this._addIdentityChange(t,a)),t=t._next,s++}),this.length=s;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return this._additionsHead!==null||this._movesHead!==null||this._removalsHead!==null||this._identityChangesHead!==null}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;e!==null;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;e!==null;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,r,s){let i;return e===null?i=this._itTail:(i=e._prev,this._remove(e)),e=this._unlinkedRecords===null?null:this._unlinkedRecords.get(r,null),e!==null?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,i,s)):(e=this._linkedRecords===null?null:this._linkedRecords.get(r,s),e!==null?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,i,s)):e=this._addAfter(new pk(t,r),i,s)),e}_verifyReinsertion(e,t,r,s){let i=this._unlinkedRecords===null?null:this._unlinkedRecords.get(r,null);return i!==null?e=this._reinsertAfter(i,e._prev,s):e.currentIndex!=s&&(e.currentIndex=s,this._addToMoves(e,s)),e}_truncate(e){for(;e!==null;){let t=e._next;this._addToRemovals(this._unlink(e)),e=t}this._unlinkedRecords!==null&&this._unlinkedRecords.clear(),this._additionsTail!==null&&(this._additionsTail._nextAdded=null),this._movesTail!==null&&(this._movesTail._nextMoved=null),this._itTail!==null&&(this._itTail._next=null),this._removalsTail!==null&&(this._removalsTail._nextRemoved=null),this._identityChangesTail!==null&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,r){this._unlinkedRecords!==null&&this._unlinkedRecords.remove(e);let s=e._prevRemoved,i=e._nextRemoved;return s===null?this._removalsHead=i:s._nextRemoved=i,i===null?this._removalsTail=s:i._prevRemoved=s,this._insertAfter(e,t,r),this._addToMoves(e,r),e}_moveAfter(e,t,r){return this._unlink(e),this._insertAfter(e,t,r),this._addToMoves(e,r),e}_addAfter(e,t,r){return this._insertAfter(e,t,r),this._additionsTail===null?this._additionsTail=this._additionsHead=e:this._additionsTail=this._additionsTail._nextAdded=e,e}_insertAfter(e,t,r){let s=t===null?this._itHead:t._next;return e._next=s,e._prev=t,s===null?this._itTail=e:s._prev=e,t===null?this._itHead=e:t._next=e,this._linkedRecords===null&&(this._linkedRecords=new Yx),this._linkedRecords.put(e),e.currentIndex=r,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){this._linkedRecords!==null&&this._linkedRecords.remove(e);let t=e._prev,r=e._next;return t===null?this._itHead=r:t._next=r,r===null?this._itTail=t:r._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail===null?this._movesTail=this._movesHead=e:this._movesTail=this._movesTail._nextMoved=e),e}_addToRemovals(e){return this._unlinkedRecords===null&&(this._unlinkedRecords=new Yx),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,this._removalsTail===null?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail===null?this._identityChangesTail=this._identityChangesHead=e:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=e,e}},pk=class{constructor(e,t){l(this,"item");l(this,"trackById");l(this,"currentIndex",null);l(this,"previousIndex",null);l(this,"_nextPrevious",null);l(this,"_prev",null);l(this,"_next",null);l(this,"_prevDup",null);l(this,"_nextDup",null);l(this,"_prevRemoved",null);l(this,"_nextRemoved",null);l(this,"_nextAdded",null);l(this,"_nextMoved",null);l(this,"_nextIdentityChange",null);this.item=e,this.trackById=t}},fk=class{constructor(){l(this,"_head",null);l(this,"_tail",null)}add(e){this._head===null?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let r;for(r=this._head;r!==null;r=r._nextDup)if((t===null||t<=r.currentIndex)&&Object.is(r.trackById,e))return r;return null}remove(e){let t=e._prevDup,r=e._nextDup;return t===null?this._head=r:t._nextDup=r,r===null?this._tail=t:r._prevDup=t,this._head===null}},Yx=class{constructor(){l(this,"map",new Map)}put(e){let t=e.trackById,r=this.map.get(t);r||(r=new fk,this.map.set(t,r)),r.add(e)}get(e,t){let r=e,s=this.map.get(r);return s?s.get(e,t):null}remove(e){let t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return this.map.size===0}clear(){this.map.clear()}};function oV(n,e,t){let r=n.previousIndex;if(r===null)return r;let s=0;return t&&r{if(t&&t.key===s)this._maybeAddToChanges(t,r),this._appendAfter=t,t=t._next;else{let i=this._getOrCreateRecordForKey(s,r);t=this._insertBeforeOrAppend(t,i)}}),t){t._prev&&(t._prev._next=null),this._removalsHead=t;for(let r=t;r!==null;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(e,t){if(e){let r=e._prev;return t._next=e,t._prev=r,e._prev=t,r&&(r._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null}_getOrCreateRecordForKey(e,t){if(this._records.has(e)){let s=this._records.get(e);this._maybeAddToChanges(s,t);let i=s._prev,o=s._next;return i&&(i._next=o),o&&(o._prev=i),s._next=null,s._prev=null,s}let r=new mk(e);return this._records.set(e,r),r.currentValue=t,this._addToAdditions(r),r}_reset(){if(this.isDirty){let e;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;e!==null;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;e!=null;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(e,t){Object.is(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))}_addToAdditions(e){this._additionsHead===null?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)}_addToChanges(e){this._changesHead===null?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)}_forEach(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(r=>t(e[r],r))}},mk=class{constructor(e){l(this,"key");l(this,"previousValue",null);l(this,"currentValue",null);l(this,"_nextPrevious",null);l(this,"_next",null);l(this,"_prev",null);l(this,"_nextAdded",null);l(this,"_nextRemoved",null);l(this,"_nextChanged",null);this.key=e}};function aV(){return new Ql([new Gx])}var Ol=class Ol{constructor(e){l(this,"factories");this.factories=e}static create(e,t){if(t!=null){let r=t.factories.slice();e=e.concat(r)}return new Ol(e)}static extend(e){return{provide:Ol,useFactory:t=>Ol.create(e,t||aV()),deps:[[Ol,new La,new st]]}}find(e){let t=this.factories.find(r=>r.supports(e));if(t!=null)return t;throw new Pe(901,!1)}};l(Ol,"\u0275prov",rn({token:Ol,providedIn:"root",factory:aV}));var Ql=Ol;function lV(){return new zo([new Xx])}var Bl=class Bl{constructor(e){l(this,"factories");this.factories=e}static create(e,t){if(t){let r=t.factories.slice();e=e.concat(r)}return new Bl(e)}static extend(e){return{provide:Bl,useFactory:t=>Bl.create(e,t||lV()),deps:[[Bl,new La,new st]]}}find(e){let t=this.factories.find(r=>r.supports(e));if(t)return t;throw new Pe(901,!1)}};l(Bl,"\u0275prov",rn({token:Bl,providedIn:"root",factory:lV}));var zo=Bl,Aue=[new Xx],Mue=[new Gx],Nue=new Ql(Mue),Pue=new zo(Aue),xM=QS(null,"core",[]),wu=class wu{constructor(e){}};l(wu,"\u0275fac",function(t){return new(t||wu)(Mr(ns))}),l(wu,"\u0275mod",dA({type:wu})),l(wu,"\u0275inj",iS({}));var Vu=wu;function SM(n){let{rootComponent:e,appProviders:t,platformProviders:r,platformRef:s}=n;if(yn(8),typeof ngServerMode<"u"&&ngServerMode&&!s)throw new Pe(401,!1);try{let i=s?.injector??d4(r),o=[YS({}),{provide:Ti,useExisting:jf},...t||[]],a=new Px({providers:o,parent:i,debugName:"",runEnvironmentInitializers:!1});return a4({r3Injector:a.injector,platformInjector:i,rootComponent:e})}catch(i){return Promise.reject(i)}finally{yn(9)}}var VE=new WeakSet,cV="",JE=[];function uV(n){return n.get(p2,U$)}function CM(){let n=[{provide:p2,useFactory:()=>{let e=!0;if(typeof ngServerMode>"u"||!ngServerMode){let t=ye(Zs);e=!!window._ejsas?.[t]}return e&&rs("NgEventReplay"),e}}];return(typeof ngServerMode>"u"||!ngServerMode)&&n.push({provide:Ki,useValue:()=>{let e=ye(ns),{injector:t}=e;if(!VE.has(e)){let r=ye(fy);if(uV(t)){wre();let s=t.get(Zs),i=yre(s,(o,a,c)=>{o.nodeType===Node.ELEMENT_NODE&&(gre(o,a,c),J$(o,r))});e.onDestroy(i)}}},multi:!0},{provide:Qy,useFactory:()=>{let e=ye(ns),{injector:t}=e;return()=>{!uV(t)||VE.has(e)||(VE.add(e),e.onDestroy(()=>{if(VE.delete(e),typeof ngServerMode<"u"&&!ngServerMode){let r=t.get(Zs);i_(r)}}),e.whenStable().then(()=>{if(e.destroyed)return;let r=t.get(y2);Rue(r,t);let s=t.get(fy);s.get(cV)?.forEach(e8),s.delete(cV);let i=r.instance;E2(t)?e.onDestroy(()=>i.cleanUp()):i.cleanUp()}))}},multi:!0}),n}var Rue=(n,e)=>{let t=e.get(Zs),r=window._ejsas[t],s=n.instance=new DE(new CE(r.c));for(let a of r.et)s.addEvent(a);for(let a of r.etc)s.addEvent(a);let i=MO(t);s.replayEarlyEventInfos(i),i_(t);let o=new TE(a=>{Lue(e,a,a.currentTarget)});AO(s,o)};function Fue(n,e,t){let r=new Map,s=e[$l],i=n.cleanup;if(!i||!s)return r;for(let o=0;o=0)&&(r.has(d)?r.get(d).push(u):r.set(d,[u]))}return r}function Lue(n,e,t){let r=(t&&t.getAttribute(jy))??"";/d\d+/.test(r)?Oue(r,n,e,t):e.eventPhase===s_.REPLAY&&t8(e,t)}function Oue(n,e,t,r){JE.push({event:t,currentTarget:r}),ec(e,n,Bue)}function Bue(n){let e=[...JE],t=new Set(n);JE=[];for(let{event:r,currentTarget:s}of e){let i=s.getAttribute(jy);t.has(i)?t8(r,s):JE.push({event:r,currentTarget:s})}}var gk=class{constructor(){l(this,"views",[]);l(this,"indexByContent",new Map)}add(e){let t=JSON.stringify(e);if(!this.indexByContent.has(t)){let r=this.views.length;return this.views.push(e),this.indexByContent.set(t,r),r}return this.indexByContent.get(t)}getAll(){return this.views}},Vue=0;function m4(n){return n.ssrId||(n.ssrId=`t${Vue++}`),n.ssrId}function g4(n,e,t){let r=[];return vy(n,e,t,r),r.length}function $ue(n){let e=[];return Q2(n,e),e.length}function v4(n,e,t){let r=n[Vn];return r&&!r.hasAttribute(cy)?Qx(r,n,null,e):null}function y4(n,e,t){let r=Vk(n[Vn]),s=v4(r,e);if(s===null)return;let i=an(r[Vn]),o=n[Wn],a=Qx(i,o,null,e),c=r[dt],u=`${s}|${a}`;c.setAttribute(i,Vv,u)}function Hue(n,e){let t=n.injector,r=roe(t),s=E2(t),i=new gk,o=new Map,a=n._views,c=t.get(p2,U$),u={regular:new Set,capture:new Set},d=new Map;n.injector.get(Zs);for(let h of a){let m=o8(h);if(m!==null){let g={serializedViewCollection:i,corruptedTextNodes:o,isI18nHydrationEnabled:r,isIncrementalHydrationEnabled:s,i18nChildren:new Map,eventTypesToReplay:u,shouldReplayEvents:c,deferBlocks:d};Pr(m)?y4(m,g):v4(m,g),zue(o,e)}}let p=i.getAll(),f=t.get(Ra);if(f.set(b2,p),d.size>0){let h={};for(let[m,g]of d.entries())h[m]=g;f.set(w2,h)}return u}function jue(n,e,t,r,s){let i=[],o="";for(let a=qn;a0&&(_[d2]=V),r!==null&&(_[V$]=r),s.deferBlocks.set(b,_);let M=an(n);M!==void 0?M.nodeType===Node.COMMENT_NODE&&dV(M,b):dV(M,b),m||Zue(y,E,b,s),r=b,p[u2]=b}p[bx]=g[Zl]}m||Object.assign(p,b4(n[a],r,s))}let f=JSON.stringify(p);if(i.length>0&&f===o){let h=i[i.length-1];h[hf]??(h[hf]=1),h[hf]++}else o=f,i.push(p)}return i}function Uue(n){let e=new Set([0,1,2,5]),t=[];for(let[r,s]of n)e.has(r)&&(s===null?t.push(r):t.push({trigger:r,delay:s.delay}));return t}function zv(n,e,t,r){var i;let s=e.index-Xe;n[mf]??(n[mf]={}),(i=n[mf])[s]??(i[s]=Kie(e,t,r))}function R_(n,e){let t=typeof e=="number"?e:e.index-Xe;n[iu]??(n[iu]=[]),n[iu].includes(t)||n[iu].push(t)}function b4(n,e=null,t){let r={},s=n[_e],i=soe(s,t),o=t.shouldReplayEvents?Fue(s,n,t.eventTypesToReplay):null;for(let a=Xe;a0){let i=e.filter(o=>o.nodeType===Node.ELEMENT_NODE);for(let o of i)K$(o,s,t)}}var pV=!1,fV=!1,hV=!1;function Yue(){pV||(pV=!0,Cre(),Rle(),Ace(),Ole(),$ae(),Goe(),woe(),$se())}function Xue(){fV||(fV=!0,Yle(),noe(),poe())}function Que(){hV||(hV=!0,Fre())}function Kue(n){return n.whenStable()}var Jue="ngcm";function w4(){let n=[{provide:xu,useFactory:()=>{let e=!0;return(typeof ngServerMode>"u"||!ngServerMode)&&(e=!!ye(Ra,{optional:!0})?.get(b2,null)),e&&rs("NgHydration"),e}},{provide:Ki,useValue:()=>{vH(!1),!(typeof ngServerMode<"u"&&ngServerMode)&&ye(xu)&&(Hre(qo()),Yue())},multi:!0}];return(typeof ngServerMode>"u"||!ngServerMode)&&n.push({provide:H$,useFactory:()=>ye(xu)},{provide:Qy,useFactory:()=>{if(ye(xu)){let e=ye(ns);return()=>{Kue(e).then(()=>{e.destroyed||EH(e)})}}return()=>{}},multi:!0}),Ba(n)}function E4(){return[{provide:j$,useFactory:()=>ye(xu)},{provide:Ki,useValue:()=>{ye(xu)&&(Xue(),vH(!0),rs("NgI18nHydration"))},multi:!0}]}function x4(){let n=[CM(),{provide:f2,useValue:!0},{provide:Ha,useClass:o1},{provide:Ki,useValue:()=>{Que(),rs("NgIncrementalHydration")},multi:!0}];return(typeof ngServerMode>"u"||!ngServerMode)&&n.push({provide:Qy,useFactory:()=>{let e=ye(In),t=qo();return()=>{let r=$re(e),s=Jie(t,t.body);sle(e,r,s),Pre(t,e)}},multi:!0}),n}function ei(n){return typeof n=="boolean"?n:n!=null&&n!=="false"}function gh(n,e=NaN){return!isNaN(parseFloat(n))&&!isNaN(Number(n))?Number(n):e}var S4="\u{1F170}\uFE0F",KS=!1;function ede(n){if(!KS)return;let{startLabel:e}=C4(n);performance.mark(e)}function tde(n){if(!KS)return;let{startLabel:e,labelName:t,endLabel:r}=C4(n);performance.mark(r),performance.measure(t,e,r),performance.clearMarks(e),performance.clearMarks(r)}function C4(n){let e=`${S4}:${n}`;return{labelName:e,startLabel:`start:${e}`,endLabel:`end:${e}`}}var mV=!1;function nde(){if(!mV&&(typeof performance>"u"||!performance.mark||!performance.measure)){mV=!0,console.warn("Performance API is not supported on this platform");return}KS=!0}function rde(){KS=!1}function Un(n){return VI(n)}function Xi(n,e){return Kw(n,e?.equal)}var ny=class ny extends Bx{constructor(){super(...arguments);l(this,"pendingTasks",ye(Uo));l(this,"taskId",null)}schedule(t){super.schedule(t),this.taskId===null&&(this.taskId=this.pendingTasks.add(),queueMicrotask(()=>this.flush()))}flush(){try{super.flush()}finally{this.taskId!==null&&(this.pendingTasks.remove(this.taskId),this.taskId=null)}}};l(ny,"\u0275prov",rn({token:ny,providedIn:"root",factory:()=>new ny}));var Kx=ny,vk=class{constructor(e,t,r,s,i,o){l(this,"scheduler");l(this,"effectFn");l(this,"zone");l(this,"injector");l(this,"unregisterOnDestroy");l(this,"watcher");this.scheduler=e,this.effectFn=t,this.zone=r,this.injector=i,this.watcher=UL(a=>this.runEffect(a),()=>this.schedule(),o),this.unregisterOnDestroy=s?.onDestroy(()=>this.destroy())}runEffect(e){try{this.effectFn(e)}catch(t){this.injector.get(Ks,null,{optional:!0})?.handleError(t)}}run(){this.watcher.run()}schedule(){this.scheduler.schedule(this)}destroy(){this.watcher.destroy(),this.unregisterOnDestroy?.()}};function sde(){}function ide(n,e){var o;!e?.injector&&$u(sde);let t=e?.injector??ye(In),r=e?.manualCleanup!==!0?t.get(As):null,s=new vk(t.get(Kx),n,typeof Zone>"u"?null:Zone.current,r,t,e?.allowSignalWrites??!1),i=t.get(bn,null,{optional:!0});return!i||!(i._lView[ct]&8)?s.watcher.notify():((o=i._lView)[wf]??(o[wf]=[])).push(s.watcher.notify),s}var Dde,yk=class{constructor(e){l(this,Dde);this[sr]=e}destroy(){this[sr].destroy()}};Dde=sr;function TM(n,e){!e?.injector&&$u(TM);let t=e?.injector??ye(In),r=e?.manualCleanup!==!0?t.get(As):null,s,i=t.get(Tu,null,{optional:!0}),o=t.get(Ti);i!==null&&!e?.forceRoot?(s=lde(i.view,o,n),r instanceof mx&&r._lView===i.view&&(r=null)):s=cde(n,t.get(xy),o),s.injector=t,r!==null&&(s.onDestroyFn=r.onDestroy(()=>s.destroy()));let a=new yk(s);if(0)try{}finally{}return a}var T4={...Da,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,hasRun:!1,cleanupFns:void 0,zone:null,kind:"effect",onDestroyFn:ay,run(){if(this.dirty=!1,this.hasRun&&!Xc(this))return;this.hasRun=!0;let n=r=>(this.cleanupFns??(this.cleanupFns=[])).push(r),e=Ia(this),t=ux(!1);try{this.maybeCleanup(),this.fn(n)}finally{ux(t),Al(this,e)}},maybeCleanup(){if(this.cleanupFns?.length)try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[]}}},ode={...T4,consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){Qc(this),this.onDestroyFn(),this.maybeCleanup(),this.scheduler.remove(this)}},ade={...T4,consumerMarkedDirty(){this.view[ct]|=8192,Gf(this.view),this.notifier.notify(13)},destroy(){Qc(this),this.onDestroyFn(),this.maybeCleanup(),this.view[ka]?.delete(this)}};function lde(n,e,t){let r=Object.create(ade);return r.view=n,r.zone=typeof Zone<"u"?Zone.current:null,r.notifier=e,r.fn=t,n[ka]??(n[ka]=new Set),n[ka].add(r),r.consumerMarkedDirty(r),r}function cde(n,e,t){let r=Object.create(ode);return r.fn=n,r.scheduler=e,r.notifier=t,r.zone=typeof Zone<"u"?Zone.current:null,r.scheduler.schedule(r),r.notifier.notify(12),r}var Pn;(function(n){n[n.Idle=0]="Idle",n[n.Error=1]="Error",n[n.Loading=2]="Loading",n[n.Reloading=3]="Reloading",n[n.Resolved=4]="Resolved",n[n.Local=5]="Local"})(Pn||(Pn={}));var ude=n=>n;function bk(n,e){if(typeof n=="function"){let t=eE(n,ude,e?.equal);return gV(t)}else{let t=eE(n.source,n.computation,n.equal);return gV(t)}}function gV(n){let e=n[sr],t=n;return t.set=r=>LI(e,r),t.update=r=>OI(e,r),t.asReadonly=gS.bind(n),t}function D4(n){n?.injector||$u(D4);let e=n.request??(()=>null);return new Jx(e,pde(n),n.defaultValue,n.equal?dde(n.equal):void 0,n.injector??ye(In))}var wk=class{constructor(e){l(this,"value");l(this,"isLoading",Xi(()=>this.status()===Pn.Loading||this.status()===Pn.Reloading));this.value=e,this.value.set=this.set.bind(this),this.value.update=this.update.bind(this),this.value.asReadonly=gS}update(e){this.set(e(Un(this.value)))}hasValue(){return this.value()!==void 0}asReadonly(){return this}},Jx=class extends wk{constructor(t,r,s,i,o){super(Xi(()=>{let a=this.state().stream?.();return a&&Ek(a)?a.value:this.defaultValue},{equal:i}));l(this,"loaderFn");l(this,"defaultValue");l(this,"equal");l(this,"pendingTasks");l(this,"state");l(this,"extRequest");l(this,"effectRef");l(this,"pendingController");l(this,"resolvePendingTask");l(this,"destroyed",!1);l(this,"status",Xi(()=>vV(this.state())));l(this,"error",Xi(()=>{let t=this.state().stream?.();return t&&!Ek(t)?t.error:void 0}));this.loaderFn=r,this.defaultValue=s,this.equal=i,this.extRequest=bk({source:t,computation:a=>({request:a,reload:0})}),this.state=bk({source:this.extRequest,computation:(a,c)=>{let u=a.request===void 0?Pn.Idle:Pn.Loading;return c?{extRequest:a,status:u,previousStatus:vV(c.value),stream:c.value.extRequest.request===a.request?c.value.stream:void 0}:{extRequest:a,status:u,previousStatus:Pn.Idle,stream:void 0}}}),this.effectRef=TM(this.loadEffect.bind(this),{injector:o,manualCleanup:!0}),this.pendingTasks=o.get(oy),o.get(As).onDestroy(()=>this.destroy())}set(t){if(this.destroyed)return;let r=Un(this.value),s=Un(this.state);s.status===Pn.Local&&(this.equal?this.equal(r,t):r===t)||(this.state.set({extRequest:s.extRequest,status:Pn.Local,previousStatus:Pn.Local,stream:Di({value:t})}),this.abortInProgressLoad())}reload(){let{status:t}=Un(this.state);return t===Pn.Idle||t===Pn.Loading?!1:(this.extRequest.update(({request:r,reload:s})=>({request:r,reload:s+1})),!0)}destroy(){this.destroyed=!0,this.effectRef.destroy(),this.abortInProgressLoad(),this.state.set({extRequest:{request:void 0,reload:0},status:Pn.Idle,previousStatus:Pn.Idle,stream:void 0})}async loadEffect(){let t=this.extRequest(),{status:r,previousStatus:s}=Un(this.state);if(t.request===void 0)return;if(r!==Pn.Loading)return;this.abortInProgressLoad();let i=this.resolvePendingTask=this.pendingTasks.add(),{signal:o}=this.pendingController=new AbortController;try{let a=await Un(()=>this.loaderFn({request:t.request,abortSignal:o,previous:{status:s}}));if(o.aborted||Un(this.extRequest)!==t)return;this.state.set({extRequest:t,status:Pn.Resolved,previousStatus:Pn.Resolved,stream:a})}catch(a){if(o.aborted||Un(this.extRequest)!==t)return;this.state.set({extRequest:t,status:Pn.Resolved,previousStatus:Pn.Error,stream:Di({error:a})})}finally{i?.(),i=void 0}}abortInProgressLoad(){Un(()=>this.pendingController?.abort()),this.pendingController=void 0,this.resolvePendingTask?.(),this.resolvePendingTask=void 0}};function dde(n){return(e,t)=>e===void 0||t===void 0?e===t:n(e,t)}function pde(n){return fde(n)?n.stream:async e=>{try{return Di({value:await n.loader(e)})}catch(t){return Di({error:t})}}}function fde(n){return!!n.stream}function vV(n){switch(n.status){case Pn.Loading:return n.extRequest.reload===0?Pn.Loading:Pn.Reloading;case Pn.Resolved:return Ek(Un(n.stream))?Pn.Resolved:Pn.Error;default:return n.status}}function Ek(n){return n.error===void 0}function hde(n){let e=n;for(;e;){let t=Mne(e);if(t!==null)for(let r=Xe;r{let t=n.resolveMetadata(...e);mA(n.type,t.decorators,t.ctorParameters,t.propDecorators)})}function gde(n){return Er({usage:1,kind:"component",type:n.type}).compileComponentDeclaration(us,`ng:///${n.type.name}/\u0275cmp.js`,n)}function Ie(n){return Er({usage:1,kind:vde(n.target),type:n.type}).compileFactoryDeclaration(us,`ng:///${n.type.name}/\u0275fac.js`,n)}function vde(n){switch(n){case Se.Directive:return"directive";case Se.Component:return"component";case Se.Injectable:return"injectable";case Se.Pipe:return"pipe";case Se.NgModule:return"NgModule"}}function Kt(n){return Er({usage:1,kind:"injectable",type:n.type}).compileInjectableDeclaration(us,`ng:///${n.type.name}/\u0275prov.js`,n)}function lo(n){return Er({usage:1,kind:"NgModule",type:n.type}).compileInjectorDeclaration(us,`ng:///${n.type.name}/\u0275inj.js`,n)}function co(n){return Er({usage:1,kind:"NgModule",type:n.type}).compileNgModuleDeclaration(us,`ng:///${n.type.name}/\u0275mod.js`,n)}function vs(n){return Er({usage:1,kind:"pipe",type:n.type}).compilePipeDeclaration(us,`ng:///${n.type.name}/\u0275pipe.js`,n)}var F_=Symbol("NOT_SET"),I4=new Set,yde={...Iv,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,value:F_,cleanup:null,consumerMarkedDirty(){if(this.sequence.impl.executing){if(this.sequence.lastPhase===null||this.sequence.lastPhase(kl(d),d.value),d.signal[sr]=d,d.registerCleanupFn=p=>(d.cleanup??(d.cleanup=new Set)).add(p),this.nodes[c]=d,this.hooks[c]=p=>d.phaseFn(p)}}afterRun(){super.afterRun(),this.lastPhase=null}destroy(){super.destroy();for(let t of this.nodes)for(let r of t?.cleanup??I4)r()}};function _4(n,e){if(!e?.injector&&$u(_4),typeof ngServerMode<"u"&&ngServerMode)return g2;let t=e?.injector??ye(In),r=t.get(Ti),s=t.get(Nf),i=t.get(ro,null,{optional:!0});s.impl??(s.impl=t.get(wx));let o=n;typeof o=="function"&&(o={mixedReadWrite:n});let a=t.get(Tu,null,{optional:!0}),c=new xk(s.impl,[o.earlyRead,o.write,o.mixedReadWrite,o.read],a?.view,r,t.get(As),i?.snapshot(null));return s.impl.register(c),c}function bde(n,e){let t=Bn(n),r=e.elementInjector||lS();return new Yl(t).create(r,e.projectableNodes,e.hostElement,e.environmentInjector)}function wde(n){let e=Bn(n);if(!e)return null;let t=new Yl(e);return{get selector(){return t.selector},get type(){return t.componentType},get inputs(){return t.inputs},get outputs(){return t.outputs},get ngContentSelectors(){return t.ngContentSelectors},get isStandalone(){return e.standalone},get isSignal(){return e.signals}}}function Ede(...n){return n.reduce((e,t)=>Object.assign(e,t,{providers:[...e.providers,...t.providers]}),{providers:[]})}var xde=new $e("",{providedIn:"platform",factory:()=>null}),Sde=new $e("",{providedIn:"platform",factory:()=>null}),Cde=new $e("",{providedIn:"platform",factory:()=>null});var dn=new $e("");var M4=null;function Fs(){return M4}function DM(n){M4??(M4=n)}var nb=class{},vh=class vh{historyGo(e){throw new Error("")}};l(vh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:vh,deps:[],target:Se.Injectable})),l(vh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:vh,providedIn:"platform",useFactory:()=>ye(Gu)}));var ta=vh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ta,decorators:[{type:zt,args:[{providedIn:"platform",useFactory:()=>ye(Gu)}]}]});var Ide=new $e(""),zu=class zu extends ta{constructor(){super();l(this,"_location");l(this,"_history");l(this,"_doc",ye(dn));this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Fs().getBaseHref(this._doc)}onPopState(t){let r=Fs().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",t,!1),()=>r.removeEventListener("popstate",t)}onHashChange(t){let r=Fs().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",t,!1),()=>r.removeEventListener("hashchange",t)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(t){this._location.pathname=t}pushState(t,r,s){this._history.pushState(t,r,s)}replaceState(t,r,s){this._history.replaceState(t,r,s)}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}};l(zu,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:zu,deps:[],target:Se.Injectable})),l(zu,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:zu,providedIn:"platform",useFactory:()=>new zu}));var Gu=zu;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Gu,decorators:[{type:zt,args:[{providedIn:"platform",useFactory:()=>new Gu}]}],ctorParameters:()=>[]});function JS(n,e){return n?e?n.endsWith("/")?e.startsWith("/")?n+e.slice(1):n+e:e.startsWith("/")?n+e:`${n}/${e}`:n:e}function k4(n){let e=n.search(/#|\?|$/);return n[e-1]==="/"?n.slice(0,e-1)+n.slice(e):n}function uo(n){return n&&n[0]!=="?"?`?${n}`:n}var yh=class yh{historyGo(e){throw new Error("")}};l(yh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:yh,deps:[],target:Se.Injectable})),l(yh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:yh,providedIn:"root",useFactory:()=>ye(wh)}));var na=yh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:na,decorators:[{type:zt,args:[{providedIn:"root",useFactory:()=>ye(wh)}]}]});var Eh=new $e(""),bh=class bh extends na{constructor(t,r){super();l(this,"_platformLocation");l(this,"_baseHref");l(this,"_removeListenerFns",[]);this._platformLocation=t,this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??ye(dn).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return JS(this._baseHref,t)}path(t=!1){let r=this._platformLocation.pathname+uo(this._platformLocation.search),s=this._platformLocation.hash;return s&&t?`${r}${s}`:r}pushState(t,r,s,i){let o=this.prepareExternalUrl(s+uo(i));this._platformLocation.pushState(t,r,o)}replaceState(t,r,s,i){let o=this.prepareExternalUrl(s+uo(i));this._platformLocation.replaceState(t,r,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}};l(bh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:bh,deps:[{token:ta},{token:Eh,optional:!0}],target:Se.Injectable})),l(bh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:bh,providedIn:"root"}));var wh=bh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:wh,decorators:[{type:zt,args:[{providedIn:"root"}]}],ctorParameters:()=>[{type:ta},{type:void 0,decorators:[{type:st},{type:Ke,args:[Eh]}]}]});var ea=class ea{constructor(e){l(this,"_subject",new _s);l(this,"_basePath");l(this,"_locationStrategy");l(this,"_urlChangeListeners",[]);l(this,"_urlChangeSubscription",null);this._locationStrategy=e;let t=this._locationStrategy.getBaseHref();this._basePath=kde(k4(A4(t))),this._locationStrategy.onPopState(r=>{this._subject.next({url:this.path(!0),pop:!0,state:r.state,type:r.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(e=!1){return this.normalize(this._locationStrategy.path(e))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(e,t=""){return this.path()==this.normalize(e+uo(t))}normalize(e){return ea.stripTrailingSlash(_de(this._basePath,A4(e)))}prepareExternalUrl(e){return e&&e[0]!=="/"&&(e="/"+e),this._locationStrategy.prepareExternalUrl(e)}go(e,t="",r=null){this._locationStrategy.pushState(r,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+uo(t)),r)}replaceState(e,t="",r=null){this._locationStrategy.replaceState(r,"",e,t),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+uo(t)),r)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(e=0){this._locationStrategy.historyGo?.(e)}onUrlChange(e){return this._urlChangeListeners.push(e),this._urlChangeSubscription??(this._urlChangeSubscription=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)})),()=>{let t=this._urlChangeListeners.indexOf(e);this._urlChangeListeners.splice(t,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(e="",t){this._urlChangeListeners.forEach(r=>r(e,t))}subscribe(e,t,r){return this._subject.subscribe({next:e,error:t??void 0,complete:r??void 0})}};l(ea,"normalizeQueryParams",uo),l(ea,"joinWithSlash",JS),l(ea,"stripTrailingSlash",k4),l(ea,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ea,deps:[{token:na}],target:Se.Injectable})),l(ea,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ea,providedIn:"root",useFactory:N4}));var rb=ea;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:rb,decorators:[{type:zt,args:[{providedIn:"root",useFactory:N4}]}],ctorParameters:()=>[{type:na}]});function N4(){return new rb(Mr(na))}function _de(n,e){if(!n||!e.startsWith(n))return e;let t=e.substring(n.length);return t===""||["/",";","?","#"].includes(t[0])?t:e}function A4(n){return n.replace(/\/index.html$/,"")}function kde(n){if(new RegExp("^(https?:)?//").test(n)){let[,t]=n.split(/\/\/[^\/]+/);return t}return n}var Sh=class Sh extends na{constructor(t,r){super();l(this,"_platformLocation");l(this,"_baseHref","");l(this,"_removeListenerFns",[]);this._platformLocation=t,r!=null&&(this._baseHref=r)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}path(t=!1){let r=this._platformLocation.hash??"#";return r.length>0?r.substring(1):r}prepareExternalUrl(t){let r=JS(this._baseHref,t);return r.length>0?"#"+r:r}pushState(t,r,s,i){let o=this.prepareExternalUrl(s+uo(i))||this._platformLocation.pathname;this._platformLocation.pushState(t,r,o)}replaceState(t,r,s,i){let o=this.prepareExternalUrl(s+uo(i))||this._platformLocation.pathname;this._platformLocation.replaceState(t,r,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}};l(Sh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Sh,deps:[{token:ta},{token:Eh,optional:!0}],target:Se.Injectable})),l(Sh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Sh}));var sC=Sh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:sC,decorators:[{type:zt}],ctorParameters:()=>[{type:ta},{type:void 0,decorators:[{type:st},{type:Ke,args:[Eh]}]}]});var U4={ADP:[void 0,void 0,0],AFN:[void 0,"\u060B",0],ALL:[void 0,void 0,0],AMD:[void 0,"\u058F",2],AOA:[void 0,"Kz"],ARS:[void 0,"$"],AUD:["A$","$"],AZN:[void 0,"\u20BC"],BAM:[void 0,"KM"],BBD:[void 0,"$"],BDT:[void 0,"\u09F3"],BHD:[void 0,void 0,3],BIF:[void 0,void 0,0],BMD:[void 0,"$"],BND:[void 0,"$"],BOB:[void 0,"Bs"],BRL:["R$"],BSD:[void 0,"$"],BWP:[void 0,"P"],BYN:[void 0,void 0,2],BYR:[void 0,void 0,0],BZD:[void 0,"$"],CAD:["CA$","$",2],CHF:[void 0,void 0,2],CLF:[void 0,void 0,4],CLP:[void 0,"$",0],CNY:["CN\xA5","\xA5"],COP:[void 0,"$",2],CRC:[void 0,"\u20A1",2],CUC:[void 0,"$"],CUP:[void 0,"$"],CZK:[void 0,"K\u010D",2],DJF:[void 0,void 0,0],DKK:[void 0,"kr",2],DOP:[void 0,"$"],EGP:[void 0,"E\xA3"],ESP:[void 0,"\u20A7",0],EUR:["\u20AC"],FJD:[void 0,"$"],FKP:[void 0,"\xA3"],GBP:["\xA3"],GEL:[void 0,"\u20BE"],GHS:[void 0,"GH\u20B5"],GIP:[void 0,"\xA3"],GNF:[void 0,"FG",0],GTQ:[void 0,"Q"],GYD:[void 0,"$",2],HKD:["HK$","$"],HNL:[void 0,"L"],HRK:[void 0,"kn"],HUF:[void 0,"Ft",2],IDR:[void 0,"Rp",2],ILS:["\u20AA"],INR:["\u20B9"],IQD:[void 0,void 0,0],IRR:[void 0,void 0,0],ISK:[void 0,"kr",0],ITL:[void 0,void 0,0],JMD:[void 0,"$"],JOD:[void 0,void 0,3],JPY:["\xA5",void 0,0],KHR:[void 0,"\u17DB"],KMF:[void 0,"CF",0],KPW:[void 0,"\u20A9",0],KRW:["\u20A9",void 0,0],KWD:[void 0,void 0,3],KYD:[void 0,"$"],KZT:[void 0,"\u20B8"],LAK:[void 0,"\u20AD",0],LBP:[void 0,"L\xA3",0],LKR:[void 0,"Rs"],LRD:[void 0,"$"],LTL:[void 0,"Lt"],LUF:[void 0,void 0,0],LVL:[void 0,"Ls"],LYD:[void 0,void 0,3],MGA:[void 0,"Ar",0],MGF:[void 0,void 0,0],MMK:[void 0,"K",0],MNT:[void 0,"\u20AE",2],MRO:[void 0,void 0,0],MUR:[void 0,"Rs",2],MXN:["MX$","$"],MYR:[void 0,"RM"],NAD:[void 0,"$"],NGN:[void 0,"\u20A6"],NIO:[void 0,"C$"],NOK:[void 0,"kr",2],NPR:[void 0,"Rs"],NZD:["NZ$","$"],OMR:[void 0,void 0,3],PHP:["\u20B1"],PKR:[void 0,"Rs",2],PLN:[void 0,"z\u0142"],PYG:[void 0,"\u20B2",0],RON:[void 0,"lei"],RSD:[void 0,void 0,0],RUB:[void 0,"\u20BD"],RWF:[void 0,"RF",0],SBD:[void 0,"$"],SEK:[void 0,"kr",2],SGD:[void 0,"$"],SHP:[void 0,"\xA3"],SLE:[void 0,void 0,2],SLL:[void 0,void 0,0],SOS:[void 0,void 0,0],SRD:[void 0,"$"],SSP:[void 0,"\xA3"],STD:[void 0,void 0,0],STN:[void 0,"Db"],SYP:[void 0,"\xA3",0],THB:[void 0,"\u0E3F"],TMM:[void 0,void 0,0],TND:[void 0,void 0,3],TOP:[void 0,"T$"],TRL:[void 0,void 0,0],TRY:[void 0,"\u20BA"],TTD:[void 0,"$"],TWD:["NT$","$",2],TZS:[void 0,void 0,2],UAH:[void 0,"\u20B4"],UGX:[void 0,void 0,0],USD:["$"],UYI:[void 0,void 0,0],UYU:[void 0,"$"],UYW:[void 0,void 0,4],UZS:[void 0,void 0,2],VEF:[void 0,"Bs",2],VND:["\u20AB",void 0,0],VUV:[void 0,void 0,0],XAF:["FCFA",void 0,0],XCD:["EC$","$"],XOF:["F\u202FCFA",void 0,0],XPF:["CFPF",void 0,0],XXX:["\xA4"],YER:[void 0,void 0,0],ZAR:[void 0,"R"],ZMK:[void 0,void 0,0],ZMW:[void 0,"ZK"],ZWD:[void 0,void 0,0]},Bh;(function(n){n[n.Decimal=0]="Decimal",n[n.Percent=1]="Percent",n[n.Currency=2]="Currency",n[n.Scientific=3]="Scientific"})(Bh||(Bh={}));var sc;(function(n){n[n.Zero=0]="Zero",n[n.One=1]="One",n[n.Two=2]="Two",n[n.Few=3]="Few",n[n.Many=4]="Many",n[n.Other=5]="Other"})(sc||(sc={}));var Zr;(function(n){n[n.Format=0]="Format",n[n.Standalone=1]="Standalone"})(Zr||(Zr={}));var Cn;(function(n){n[n.Narrow=0]="Narrow",n[n.Abbreviated=1]="Abbreviated",n[n.Wide=2]="Wide",n[n.Short=3]="Short"})(Cn||(Cn={}));var ys;(function(n){n[n.Short=0]="Short",n[n.Medium=1]="Medium",n[n.Long=2]="Long",n[n.Full=3]="Full"})(ys||(ys={}));var ar={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},PM;(function(n){n[n.Sunday=0]="Sunday",n[n.Monday=1]="Monday",n[n.Tuesday=2]="Tuesday",n[n.Wednesday=3]="Wednesday",n[n.Thursday=4]="Thursday",n[n.Friday=5]="Friday",n[n.Saturday=6]="Saturday"})(PM||(PM={}));function q4(n){return Gr(n)[Sn.LocaleId]}function W4(n,e,t){let r=Gr(n),s=[r[Sn.DayPeriodsFormat],r[Sn.DayPeriodsStandalone]],i=Mi(s,e);return Mi(i,t)}function z4(n,e,t){let r=Gr(n),s=[r[Sn.DaysFormat],r[Sn.DaysStandalone]],i=Mi(s,e);return Mi(i,t)}function G4(n,e,t){let r=Gr(n),s=[r[Sn.MonthsFormat],r[Sn.MonthsStandalone]],i=Mi(s,e);return Mi(i,t)}function Z4(n,e){let r=Gr(n)[Sn.Eras];return Mi(r,e)}function sb(n,e){let t=Gr(n);return Mi(t[Sn.DateFormat],e)}function ib(n,e){let t=Gr(n);return Mi(t[Sn.TimeFormat],e)}function ob(n,e){let r=Gr(n)[Sn.DateTimeFormat];return Mi(r,e)}function ti(n,e){let t=Gr(n),r=t[Sn.NumberSymbols][e];if(typeof r>"u"){if(e===ar.CurrencyDecimal)return t[Sn.NumberSymbols][ar.Decimal];if(e===ar.CurrencyGroup)return t[Sn.NumberSymbols][ar.Group]}return r}function cC(n,e){return Gr(n)[Sn.NumberFormats][e]}function Ade(n){return Gr(n)[Sn.Currencies]}var Y4=zS;function X4(n){if(!n[Sn.ExtraData])throw new Error(`Missing extra locale data for the locale "${n[Sn.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function Q4(n){let e=Gr(n);return X4(e),(e[Sn.ExtraData][2]||[]).map(r=>typeof r=="string"?IM(r):[IM(r[0]),IM(r[1])])}function K4(n,e,t){let r=Gr(n);X4(r);let s=[r[Sn.ExtraData][0],r[Sn.ExtraData][1]],i=Mi(s,e)||[];return Mi(i,t)||[]}function Mi(n,e){for(let t=e;t>-1;t--)if(typeof n[t]<"u")return n[t];throw new Error("Locale data API: locale data undefined")}function IM(n){let[e,t]=n.split(":");return{hours:+e,minutes:+t}}function J4(n,e,t="en"){let r=Ade(t)[n]||U4[n]||[],s=r[1];return e==="narrow"&&typeof s=="string"?s:r[0]||n}var Mde=2;function eU(n){let e,t=U4[n];return t&&(e=t[2]),typeof e=="number"?e:Mde}var Nde=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,xh={},Pde=/((?:[^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]*)/;function tU(n,e,t,r){let s=jde(n);e=Wa(t,e)||e;let o=[],a;for(;e;)if(a=Pde.exec(e),a){o=o.concat(a.slice(1));let d=o.pop();if(!d)break;e=d}else{o.push(e);break}let c=s.getTimezoneOffset();r&&(c=rU(r,c),s=Hde(s,r));let u="";return o.forEach(d=>{let p=Vde(d);u+=p?p(s,t,c):d==="''"?"'":d.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),u}function iC(n,e,t){let r=new Date(0);return r.setFullYear(n,e,t),r.setHours(0,0,0),r}function Wa(n,e){let t=q4(n);if(xh[t]??(xh[t]={}),xh[t][e])return xh[t][e];let r="";switch(e){case"shortDate":r=sb(n,ys.Short);break;case"mediumDate":r=sb(n,ys.Medium);break;case"longDate":r=sb(n,ys.Long);break;case"fullDate":r=sb(n,ys.Full);break;case"shortTime":r=ib(n,ys.Short);break;case"mediumTime":r=ib(n,ys.Medium);break;case"longTime":r=ib(n,ys.Long);break;case"fullTime":r=ib(n,ys.Full);break;case"short":let s=Wa(n,"shortTime"),i=Wa(n,"shortDate");r=eC(ob(n,ys.Short),[s,i]);break;case"medium":let o=Wa(n,"mediumTime"),a=Wa(n,"mediumDate");r=eC(ob(n,ys.Medium),[o,a]);break;case"long":let c=Wa(n,"longTime"),u=Wa(n,"longDate");r=eC(ob(n,ys.Long),[c,u]);break;case"full":let d=Wa(n,"fullTime"),p=Wa(n,"fullDate");r=eC(ob(n,ys.Full),[d,p]);break}return r&&(xh[t][e]=r),r}function eC(n,e){return e&&(n=n.replace(/\{([^}]+)}/g,function(t,r){return e!=null&&r in e?e[r]:t})),n}function po(n,e,t="-",r,s){let i="";(n<0||s&&n<=0)&&(s?n=-n+1:(n=-n,i=t));let o=String(n);for(;o.length0||a>-t)&&(a+=t),n===3)a===0&&t===-12&&(a=12);else if(n===6)return Rde(a,e);let c=ti(o,ar.MinusSign);return po(a,e,c,r,s)}}function Fde(n,e){switch(n){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate();case 3:return e.getHours();case 4:return e.getMinutes();case 5:return e.getSeconds();case 6:return e.getMilliseconds();case 7:return e.getDay();default:throw new Error(`Unknown DateType value "${n}".`)}}function Ln(n,e,t=Zr.Format,r=!1){return function(s,i){return Lde(s,i,n,e,t,r)}}function Lde(n,e,t,r,s,i){switch(t){case 2:return G4(e,s,r)[n.getMonth()];case 1:return z4(e,s,r)[n.getDay()];case 0:let o=n.getHours(),a=n.getMinutes();if(i){let u=Q4(e),d=K4(e,s,r),p=u.findIndex(f=>{if(Array.isArray(f)){let[h,m]=f,g=o>=h.hours&&a>=h.minutes,y=o0?Math.floor(s/60):Math.ceil(s/60);switch(n){case 0:return(s>=0?"+":"")+po(o,2,i)+po(Math.abs(s%60),2,i);case 1:return"GMT"+(s>=0?"+":"")+po(o,1,i);case 2:return"GMT"+(s>=0?"+":"")+po(o,2,i)+":"+po(Math.abs(s%60),2,i);case 3:return r===0?"Z":(s>=0?"+":"")+po(o,2,i)+":"+po(Math.abs(s%60),2,i);default:throw new Error(`Unknown zone width "${n}"`)}}}var Ode=0,rC=4;function Bde(n){let e=iC(n,Ode,1).getDay();return iC(n,0,1+(e<=rC?rC:rC+7)-e)}function nU(n){let e=n.getDay(),t=e===0?-3:rC-e;return iC(n.getFullYear(),n.getMonth(),n.getDate()+t)}function _M(n,e=!1){return function(t,r){let s;if(e){let i=new Date(t.getFullYear(),t.getMonth(),1).getDay()-1,o=t.getDate();s=1+Math.floor((o+i)/7)}else{let i=nU(t),o=Bde(i.getFullYear()),a=i.getTime()-o.getTime();s=1+Math.round(a/6048e5)}return po(s,n,ti(r,ar.MinusSign))}}function nC(n,e=!1){return function(t,r){let i=nU(t).getFullYear();return po(i,n,ti(r,ar.MinusSign),e)}}var kM={};function Vde(n){if(kM[n])return kM[n];let e;switch(n){case"G":case"GG":case"GGG":e=Ln(3,Cn.Abbreviated);break;case"GGGG":e=Ln(3,Cn.Wide);break;case"GGGGG":e=Ln(3,Cn.Narrow);break;case"y":e=pr(0,1,0,!1,!0);break;case"yy":e=pr(0,2,0,!0,!0);break;case"yyy":e=pr(0,3,0,!1,!0);break;case"yyyy":e=pr(0,4,0,!1,!0);break;case"Y":e=nC(1);break;case"YY":e=nC(2,!0);break;case"YYY":e=nC(3);break;case"YYYY":e=nC(4);break;case"M":case"L":e=pr(1,1,1);break;case"MM":case"LL":e=pr(1,2,1);break;case"MMM":e=Ln(2,Cn.Abbreviated);break;case"MMMM":e=Ln(2,Cn.Wide);break;case"MMMMM":e=Ln(2,Cn.Narrow);break;case"LLL":e=Ln(2,Cn.Abbreviated,Zr.Standalone);break;case"LLLL":e=Ln(2,Cn.Wide,Zr.Standalone);break;case"LLLLL":e=Ln(2,Cn.Narrow,Zr.Standalone);break;case"w":e=_M(1);break;case"ww":e=_M(2);break;case"W":e=_M(1,!0);break;case"d":e=pr(2,1);break;case"dd":e=pr(2,2);break;case"c":case"cc":e=pr(7,1);break;case"ccc":e=Ln(1,Cn.Abbreviated,Zr.Standalone);break;case"cccc":e=Ln(1,Cn.Wide,Zr.Standalone);break;case"ccccc":e=Ln(1,Cn.Narrow,Zr.Standalone);break;case"cccccc":e=Ln(1,Cn.Short,Zr.Standalone);break;case"E":case"EE":case"EEE":e=Ln(1,Cn.Abbreviated);break;case"EEEE":e=Ln(1,Cn.Wide);break;case"EEEEE":e=Ln(1,Cn.Narrow);break;case"EEEEEE":e=Ln(1,Cn.Short);break;case"a":case"aa":case"aaa":e=Ln(0,Cn.Abbreviated);break;case"aaaa":e=Ln(0,Cn.Wide);break;case"aaaaa":e=Ln(0,Cn.Narrow);break;case"b":case"bb":case"bbb":e=Ln(0,Cn.Abbreviated,Zr.Standalone,!0);break;case"bbbb":e=Ln(0,Cn.Wide,Zr.Standalone,!0);break;case"bbbbb":e=Ln(0,Cn.Narrow,Zr.Standalone,!0);break;case"B":case"BB":case"BBB":e=Ln(0,Cn.Abbreviated,Zr.Format,!0);break;case"BBBB":e=Ln(0,Cn.Wide,Zr.Format,!0);break;case"BBBBB":e=Ln(0,Cn.Narrow,Zr.Format,!0);break;case"h":e=pr(3,1,-12);break;case"hh":e=pr(3,2,-12);break;case"H":e=pr(3,1);break;case"HH":e=pr(3,2);break;case"m":e=pr(4,1);break;case"mm":e=pr(4,2);break;case"s":e=pr(5,1);break;case"ss":e=pr(5,2);break;case"S":e=pr(6,1);break;case"SS":e=pr(6,2);break;case"SSS":e=pr(6,3);break;case"Z":case"ZZ":case"ZZZ":e=tC(0);break;case"ZZZZZ":e=tC(3);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":e=tC(1);break;case"OOOO":case"ZZZZ":case"zzzz":e=tC(2);break;default:return null}return kM[n]=e,e}function rU(n,e){n=n.replace(/:/g,"");let t=Date.parse("Jan 01, 1970 00:00:00 "+n)/6e4;return isNaN(t)?e:t}function $de(n,e){return n=new Date(n.getTime()),n.setMinutes(n.getMinutes()+e),n}function Hde(n,e,t){let s=n.getTimezoneOffset(),i=rU(e,s);return $de(n,-1*(i-s))}function jde(n){if(P4(n))return n;if(typeof n=="number"&&!isNaN(n))return new Date(n);if(typeof n=="string"){if(n=n.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(n)){let[s,i=1,o=1]=n.split("-").map(a=>+a);return iC(s,i-1,o)}let t=parseFloat(n);if(!isNaN(n-t))return new Date(t);let r;if(r=n.match(Nde))return Ude(r)}let e=new Date(n);if(!P4(e))throw new Error(`Unable to convert "${n}" into a date`);return e}function Ude(n){let e=new Date(0),t=0,r=0,s=n[8]?e.setUTCFullYear:e.setFullYear,i=n[8]?e.setUTCHours:e.setHours;n[9]&&(t=Number(n[9]+n[10]),r=Number(n[9]+n[11])),s.call(e,Number(n[1]),Number(n[2])-1,Number(n[3]));let o=Number(n[4]||0)-t,a=Number(n[5]||0)-r,c=Number(n[6]||0),u=Math.floor(parseFloat("0."+(n[7]||0))*1e3);return i.call(e,o,a,c,u),e}function P4(n){return n instanceof Date&&!isNaN(n.valueOf())}var qde=/^(\d+)?\.((\d+)(-(\d+))?)?$/,R4=22,oC=".",ab="0",Wde=";",zde=",",AM="#",F4="\xA4",Gde="%";function LM(n,e,t,r,s,i,o=!1){let a="",c=!1;if(!isFinite(n))a=ti(t,ar.Infinity);else{let u=Yde(n);o&&(u=Zde(u));let d=e.minInt,p=e.minFrac,f=e.maxFrac;if(i){let E=i.match(qde);if(E===null)throw new Error(`${i} is not a valid digit info`);let _=E[1],V=E[3],M=E[5];_!=null&&(d=MM(_)),V!=null&&(p=MM(V)),M!=null?f=MM(M):V!=null&&p>f&&(f=p);let j=100;if(d>j||p>j||f>j)throw new Pe(2306,!1)}Xde(u,p,f);let h=u.digits,m=u.integerLen,g=u.exponent,y=[];for(c=h.every(E=>!E);m0?y=h.splice(m,h.length):(y=h,h=[0]);let b=[];for(h.length>=e.lgSize&&b.unshift(h.splice(-e.lgSize,h.length).join(""));h.length>e.gSize;)b.unshift(h.splice(-e.gSize,h.length).join(""));h.length&&b.unshift(h.join("")),a=b.join(ti(t,r)),y.length&&(a+=ti(t,s)+y.join("")),g&&(a+=ti(t,ar.Exponential)+"+"+g)}return n<0&&!c?a=e.negPre+a+e.negSuf:a=e.posPre+a+e.posSuf,a}function sU(n,e,t,r,s){let i=cC(e,Bh.Currency),o=OM(i,ti(e,ar.MinusSign));return o.minFrac=eU(r),o.maxFrac=o.minFrac,LM(n,o,e,ar.CurrencyGroup,ar.CurrencyDecimal,s).replace(F4,t).replace(F4,"").trim()}function iU(n,e,t){let r=cC(e,Bh.Percent),s=OM(r,ti(e,ar.MinusSign));return LM(n,s,e,ar.Group,ar.Decimal,t,!0).replace(new RegExp(Gde,"g"),ti(e,ar.PercentSign))}function oU(n,e,t){let r=cC(e,Bh.Decimal),s=OM(r,ti(e,ar.MinusSign));return LM(n,s,e,ar.Group,ar.Decimal,t)}function OM(n,e="-"){let t={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},r=n.split(Wde),s=r[0],i=r[1],o=s.indexOf(oC)!==-1?s.split(oC):[s.substring(0,s.lastIndexOf(ab)+1),s.substring(s.lastIndexOf(ab)+1)],a=o[0],c=o[1]||"";t.posPre=a.substring(0,a.indexOf(AM));for(let d=0;d-1&&(e=e.replace(oC,"")),(i=e.search(/e/i))>0?(s<0&&(s=i),s+=+e.slice(i+1),e=e.substring(0,i)):s<0&&(s=e.length),i=0;e.charAt(i)===ab;i++);if(i===(a=e.length))r=[0],s=1;else{for(a--;e.charAt(a)===ab;)a--;for(s-=i,r=[],o=0;i<=a;i++,o++)r[o]=Number(e.charAt(i))}return s>R4&&(r=r.splice(0,R4-1),t=s-1,s=1),{digits:r,exponent:t,integerLen:s}}function Xde(n,e,t){if(e>t)throw new Error(`The minimum number of digits after fraction (${e}) is higher than the maximum (${t}).`);let r=n.digits,s=r.length-n.integerLen,i=Math.min(Math.max(e,s),t),o=i+n.integerLen,a=r[o];if(o>0){r.splice(Math.max(n.integerLen,o));for(let p=o;p=5)if(o-1<0){for(let p=0;p>o;p--)r.unshift(0),n.integerLen++;r.unshift(1),n.integerLen++}else r[o-1]++;for(;s=u?m.pop():c=!1),f>=10?1:0},0);d&&(r.unshift(d),n.integerLen++)}function MM(n){let e=parseInt(n);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+n);return e}var Ch=class Ch{};l(Ch,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ch,deps:[],target:Se.Injectable})),l(Ch,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ch,providedIn:"root",useFactory:e=>new Vh(e),deps:[{token:ss}]}));var za=Ch;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:za,decorators:[{type:zt,args:[{providedIn:"root",useFactory:n=>new Vh(n),deps:[ss]}]}]});function aU(n,e,t,r){let s=`=${n}`;if(e.indexOf(s)>-1||(s=t.getPluralCategory(n,r),e.indexOf(s)>-1))return s;if(e.indexOf("other")>-1)return"other";throw new Error(`No plural message found for value "${n}"`)}var Th=class Th extends za{constructor(t){super();l(this,"locale");this.locale=t}getPluralCategory(t,r){switch(Y4(r||this.locale)(t)){case sc.Zero:return"zero";case sc.One:return"one";case sc.Two:return"two";case sc.Few:return"few";case sc.Many:return"many";default:return"other"}}};l(Th,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Th,deps:[{token:ss}],target:Se.Injectable})),l(Th,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Th}));var Vh=Th;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Vh,decorators:[{type:zt}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[ss]}]}]});var NM=/\s+/,L4=[],Dh=class Dh{constructor(e,t){l(this,"_ngEl");l(this,"_renderer");l(this,"initialClasses",L4);l(this,"rawClass");l(this,"stateMap",new Map);this._ngEl=e,this._renderer=t}set klass(e){this.initialClasses=e!=null?e.trim().split(NM):L4}set ngClass(e){this.rawClass=typeof e=="string"?e.trim().split(NM):e}ngDoCheck(){for(let t of this.initialClasses)this._updateState(t,!0);let e=this.rawClass;if(Array.isArray(e)||e instanceof Set)for(let t of e)this._updateState(t,!0);else if(e!=null)for(let t of Object.keys(e))this._updateState(t,!!e[t]);this._applyStateDiff()}_updateState(e,t){let r=this.stateMap.get(e);r!==void 0?(r.enabled!==t&&(r.changed=!0,r.enabled=t),r.touched=!0):this.stateMap.set(e,{enabled:t,changed:!0,touched:!0})}_applyStateDiff(){for(let e of this.stateMap){let t=e[0],r=e[1];r.changed?(this._toggleClass(t,r.enabled),r.changed=!1):r.touched||(r.enabled&&this._toggleClass(t,!1),this.stateMap.delete(t)),r.touched=!1}}_toggleClass(e,t){e=e.trim(),e.length>0&&e.split(NM).forEach(r=>{t?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}};l(Dh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Dh,deps:[{token:en},{token:Qn}],target:Se.Directive})),l(Dh,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Dh,isStandalone:!0,selector:"[ngClass]",inputs:{klass:["class","klass"],ngClass:"ngClass"},ngImport:k}));var id=Dh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:id,decorators:[{type:ht,args:[{selector:"[ngClass]"}]}],ctorParameters:()=>[{type:en},{type:Qn}],propDecorators:{klass:[{type:ze,args:["class"]}],ngClass:[{type:ze,args:["ngClass"]}]}});var Ih=class Ih{constructor(e){l(this,"_viewContainerRef");l(this,"ngComponentOutlet",null);l(this,"ngComponentOutletInputs");l(this,"ngComponentOutletInjector");l(this,"ngComponentOutletContent");l(this,"ngComponentOutletNgModule");l(this,"ngComponentOutletNgModuleFactory");l(this,"_componentRef");l(this,"_moduleRef");l(this,"_inputsUsed",new Map);this._viewContainerRef=e}get componentInstance(){return this._componentRef?.instance??null}_needToReCreateNgModuleInstance(e){return e.ngComponentOutletNgModule!==void 0||e.ngComponentOutletNgModuleFactory!==void 0}_needToReCreateComponentInstance(e){return e.ngComponentOutlet!==void 0||e.ngComponentOutletContent!==void 0||e.ngComponentOutletInjector!==void 0||this._needToReCreateNgModuleInstance(e)}ngOnChanges(e){if(this._needToReCreateComponentInstance(e)&&(this._viewContainerRef.clear(),this._inputsUsed.clear(),this._componentRef=void 0,this.ngComponentOutlet)){let t=this.ngComponentOutletInjector||this._viewContainerRef.parentInjector;this._needToReCreateNgModuleInstance(e)&&(this._moduleRef?.destroy(),this.ngComponentOutletNgModule?this._moduleRef=FS(this.ngComponentOutletNgModule,O4(t)):this.ngComponentOutletNgModuleFactory?this._moduleRef=this.ngComponentOutletNgModuleFactory.create(O4(t)):this._moduleRef=void 0),this._componentRef=this._viewContainerRef.createComponent(this.ngComponentOutlet,{injector:t,ngModuleRef:this._moduleRef,projectableNodes:this.ngComponentOutletContent})}}ngDoCheck(){if(this._componentRef){if(this.ngComponentOutletInputs)for(let e of Object.keys(this.ngComponentOutletInputs))this._inputsUsed.set(e,!0);this._applyInputStateDiff(this._componentRef)}}ngOnDestroy(){this._moduleRef?.destroy()}_applyInputStateDiff(e){for(let[t,r]of this._inputsUsed)r?(e.setInput(t,this.ngComponentOutletInputs[t]),this._inputsUsed.set(t,!1)):(e.setInput(t,void 0),this._inputsUsed.delete(t))}};l(Ih,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ih,deps:[{token:Kn}],target:Se.Directive})),l(Ih,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Ih,isStandalone:!0,selector:"[ngComponentOutlet]",inputs:{ngComponentOutlet:"ngComponentOutlet",ngComponentOutletInputs:"ngComponentOutletInputs",ngComponentOutletInjector:"ngComponentOutletInjector",ngComponentOutletContent:"ngComponentOutletContent",ngComponentOutletNgModule:"ngComponentOutletNgModule",ngComponentOutletNgModuleFactory:"ngComponentOutletNgModuleFactory"},exportAs:["ngComponentOutlet"],usesOnChanges:!0,ngImport:k}));var od=Ih;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:od,decorators:[{type:ht,args:[{selector:"[ngComponentOutlet]",exportAs:"ngComponentOutlet"}]}],ctorParameters:()=>[{type:Kn}],propDecorators:{ngComponentOutlet:[{type:ze}],ngComponentOutletInputs:[{type:ze}],ngComponentOutletInjector:[{type:ze}],ngComponentOutletContent:[{type:ze}],ngComponentOutletNgModule:[{type:ze}],ngComponentOutletNgModuleFactory:[{type:ze}]}});function O4(n){return n.get(Xl).injector}var aC=class{constructor(e,t,r,s){l(this,"$implicit");l(this,"ngForOf");l(this,"index");l(this,"count");this.$implicit=e,this.ngForOf=t,this.index=r,this.count=s}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},_h=class _h{constructor(e,t,r){l(this,"_viewContainer");l(this,"_template");l(this,"_differs");l(this,"_ngForOf",null);l(this,"_ngForOfDirty",!0);l(this,"_differ",null);l(this,"_trackByFn");this._viewContainer=e,this._template=t,this._differs=r}set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let e=this._ngForOf;if(!this._differ&&e)if(0)try{}catch{}else this._differ=this._differs.find(e).create(this.ngForTrackBy)}if(this._differ){let e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){let t=this._viewContainer;e.forEachOperation((r,s,i)=>{if(r.previousIndex==null)t.createEmbeddedView(this._template,new aC(r.item,this._ngForOf,-1,-1),i===null?void 0:i);else if(i==null)t.remove(s===null?void 0:s);else if(s!==null){let o=t.get(s);t.move(o,i),B4(o,r)}});for(let r=0,s=t.length;r{let s=t.get(r.currentIndex);B4(s,r)})}static ngTemplateContextGuard(e,t){return!0}};l(_h,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:_h,deps:[{token:Kn},{token:xr},{token:Ql}],target:Se.Directive})),l(_h,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:_h,isStandalone:!0,selector:"[ngFor][ngForOf]",inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},ngImport:k}));var ic=_h;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ic,decorators:[{type:ht,args:[{selector:"[ngFor][ngForOf]"}]}],ctorParameters:()=>[{type:Kn},{type:xr},{type:Ql}],propDecorators:{ngForOf:[{type:ze}],ngForTrackBy:[{type:ze}],ngForTemplate:[{type:ze}]}});function B4(n,e){n.context.$implicit=e.item}var nc=class nc{constructor(e,t){l(this,"_viewContainer");l(this,"_context",new lC);l(this,"_thenTemplateRef",null);l(this,"_elseTemplateRef",null);l(this,"_thenViewRef",null);l(this,"_elseViewRef",null);this._viewContainer=e,this._thenTemplateRef=t}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){V4(e,!1),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){V4(e,!1),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(e,t){return!0}};l(nc,"ngIfUseIfTypeGuard"),l(nc,"ngTemplateGuard_ngIf"),l(nc,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:nc,deps:[{token:Kn},{token:xr}],target:Se.Directive})),l(nc,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:nc,isStandalone:!0,selector:"[ngIf]",inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},ngImport:k}));var ad=nc;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ad,decorators:[{type:ht,args:[{selector:"[ngIf]"}]}],ctorParameters:()=>[{type:Kn},{type:xr}],propDecorators:{ngIf:[{type:ze}],ngIfThen:[{type:ze}],ngIfElse:[{type:ze}]}});var lC=class{constructor(){l(this,"$implicit",null);l(this,"ngIf",null)}};function V4(n,e){if(n&&!n.createEmbeddedView)throw new Pe(2020,!1)}var lb=class{constructor(e,t){l(this,"_viewContainerRef");l(this,"_templateRef");l(this,"_created",!1);this._viewContainerRef=e,this._templateRef=t}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(e){e&&!this._created?this.create():!e&&this._created&&this.destroy()}},kh=class kh{constructor(){l(this,"_defaultViews",[]);l(this,"_defaultUsed",!1);l(this,"_caseCount",0);l(this,"_lastCaseCheckIndex",0);l(this,"_lastCasesMatched",!1);l(this,"_ngSwitch")}set ngSwitch(e){this._ngSwitch=e,this._caseCount===0&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(e){this._defaultViews.push(e)}_matchCase(e){let t=e===this._ngSwitch;return this._lastCasesMatched||(this._lastCasesMatched=t),this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),t}_updateDefaultCases(e){if(this._defaultViews.length>0&&e!==this._defaultUsed){this._defaultUsed=e;for(let t of this._defaultViews)t.enforceState(e)}}};l(kh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:kh,deps:[],target:Se.Directive})),l(kh,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:kh,isStandalone:!0,selector:"[ngSwitch]",inputs:{ngSwitch:"ngSwitch"},ngImport:k}));var fo=kh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:fo,decorators:[{type:ht,args:[{selector:"[ngSwitch]"}]}],propDecorators:{ngSwitch:[{type:ze}]}});var Ah=class Ah{constructor(e,t,r){l(this,"ngSwitch");l(this,"_view");l(this,"ngSwitchCase");this.ngSwitch=r,r._addCase(),this._view=new lb(e,t)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}};l(Ah,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ah,deps:[{token:Kn},{token:xr},{token:fo,host:!0,optional:!0}],target:Se.Directive})),l(Ah,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Ah,isStandalone:!0,selector:"[ngSwitchCase]",inputs:{ngSwitchCase:"ngSwitchCase"},ngImport:k}));var ld=Ah;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ld,decorators:[{type:ht,args:[{selector:"[ngSwitchCase]"}]}],ctorParameters:()=>[{type:Kn},{type:xr},{type:fo,decorators:[{type:st},{type:Ns}]}],propDecorators:{ngSwitchCase:[{type:ze}]}});var Mh=class Mh{constructor(e,t,r){r._addDefault(new lb(e,t))}};l(Mh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Mh,deps:[{token:Kn},{token:xr},{token:fo,host:!0,optional:!0}],target:Se.Directive})),l(Mh,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Mh,isStandalone:!0,selector:"[ngSwitchDefault]",ngImport:k}));var cd=Mh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:cd,decorators:[{type:ht,args:[{selector:"[ngSwitchDefault]"}]}],ctorParameters:()=>[{type:Kn},{type:xr},{type:fo,decorators:[{type:st},{type:Ns}]}]});var Nh=class Nh{constructor(e){l(this,"_localization");l(this,"_activeView");l(this,"_caseViews",{});this._localization=e}set ngPlural(e){this._updateView(e)}addCase(e,t){this._caseViews[e]=t}_updateView(e){this._clearViews();let t=Object.keys(this._caseViews),r=aU(e,t,this._localization);this._activateView(this._caseViews[r])}_clearViews(){this._activeView&&this._activeView.destroy()}_activateView(e){e&&(this._activeView=e,this._activeView.create())}};l(Nh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Nh,deps:[{token:za}],target:Se.Directive})),l(Nh,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Nh,isStandalone:!0,selector:"[ngPlural]",inputs:{ngPlural:"ngPlural"},ngImport:k}));var Ga=Nh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ga,decorators:[{type:ht,args:[{selector:"[ngPlural]"}]}],ctorParameters:()=>[{type:za}],propDecorators:{ngPlural:[{type:ze}]}});var Ph=class Ph{constructor(e,t,r,s){l(this,"value");this.value=e;let i=!isNaN(Number(e));s.addCase(i?`=${e}`:e,new lb(r,t))}};l(Ph,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ph,deps:[{token:"ngPluralCase",attribute:!0},{token:xr},{token:Kn},{token:Ga,host:!0}],target:Se.Directive})),l(Ph,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Ph,isStandalone:!0,selector:"[ngPluralCase]",ngImport:k}));var ud=Ph;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ud,decorators:[{type:ht,args:[{selector:"[ngPluralCase]"}]}],ctorParameters:()=>[{type:void 0,decorators:[{type:hS,args:["ngPluralCase"]}]},{type:xr},{type:Kn},{type:Ga,decorators:[{type:Ns}]}]});var Rh=class Rh{constructor(e,t,r){l(this,"_ngEl");l(this,"_differs");l(this,"_renderer");l(this,"_ngStyle",null);l(this,"_differ",null);this._ngEl=e,this._differs=t,this._renderer=r}set ngStyle(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())}ngDoCheck(){if(this._differ){let e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}}_setStyle(e,t){let[r,s]=e.split("."),i=r.indexOf("-")===-1?void 0:Ii.DashCase;t!=null?this._renderer.setStyle(this._ngEl.nativeElement,r,s?`${t}${s}`:t,i):this._renderer.removeStyle(this._ngEl.nativeElement,r,i)}_applyChanges(e){e.forEachRemovedItem(t=>this._setStyle(t.key,null)),e.forEachAddedItem(t=>this._setStyle(t.key,t.currentValue)),e.forEachChangedItem(t=>this._setStyle(t.key,t.currentValue))}};l(Rh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Rh,deps:[{token:en},{token:zo},{token:Qn}],target:Se.Directive})),l(Rh,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Rh,isStandalone:!0,selector:"[ngStyle]",inputs:{ngStyle:"ngStyle"},ngImport:k}));var dd=Rh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:dd,decorators:[{type:ht,args:[{selector:"[ngStyle]"}]}],ctorParameters:()=>[{type:en},{type:zo},{type:Qn}],propDecorators:{ngStyle:[{type:ze,args:["ngStyle"]}]}});var Fh=class Fh{constructor(e){l(this,"_viewContainerRef");l(this,"_viewRef",null);l(this,"ngTemplateOutletContext",null);l(this,"ngTemplateOutlet",null);l(this,"ngTemplateOutletInjector",null);this._viewContainerRef=e}ngOnChanges(e){if(this._shouldRecreateView(e)){let t=this._viewContainerRef;if(this._viewRef&&t.remove(t.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let r=this._createContextForwardProxy();this._viewRef=t.createEmbeddedView(this.ngTemplateOutlet,r,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(e){return!!e.ngTemplateOutlet||!!e.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(e,t,r)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,t,r):!1,get:(e,t,r)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,t,r)}})}};l(Fh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Fh,deps:[{token:Kn}],target:Se.Directive})),l(Fh,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Fh,isStandalone:!0,selector:"[ngTemplateOutlet]",inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},usesOnChanges:!0,ngImport:k}));var pd=Fh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:pd,decorators:[{type:ht,args:[{selector:"[ngTemplateOutlet]"}]}],ctorParameters:()=>[{type:Kn}],propDecorators:{ngTemplateOutletContext:[{type:ze}],ngTemplateOutlet:[{type:ze}],ngTemplateOutletInjector:[{type:ze}]}});var $4=[id,od,ic,ad,pd,dd,fo,ld,cd,Ga,ud];function ho(n,e){return new Pe(2100,!1)}var RM=class{createSubscription(e,t){return Un(()=>e.subscribe({next:t,error:r=>{throw r}}))}dispose(e){Un(()=>e.unsubscribe())}},FM=class{createSubscription(e,t){return e.then(r=>t?.(r),r=>{throw r}),{unsubscribe:()=>{t=null}}}dispose(e){e.unsubscribe()}},Qde=new FM,Kde=new RM,Zu=class Zu{constructor(e){l(this,"_ref");l(this,"_latestValue",null);l(this,"markForCheckOnValueUpdate",!0);l(this,"_subscription",null);l(this,"_obj",null);l(this,"_strategy",null);this._ref=e}ngOnDestroy(){this._subscription&&this._dispose(),this._ref=null}transform(e){if(!this._obj){if(e)try{this.markForCheckOnValueUpdate=!1,this._subscribe(e)}finally{this.markForCheckOnValueUpdate=!0}return this._latestValue}return e!==this._obj?(this._dispose(),this.transform(e)):this._latestValue}_subscribe(e){this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,t=>this._updateLatestValue(e,t))}_selectStrategy(e){if(Wu(e))return Qde;if($S(e))return Kde;throw ho(Zu,e)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(e,t){e===this._obj&&(this._latestValue=t,this.markForCheckOnValueUpdate&&this._ref?.markForCheck())}};l(Zu,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Zu,deps:[{token:bn}],target:Se.Pipe})),l(Zu,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:Zu,isStandalone:!0,name:"async",pure:!1}));var fd=Zu;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:fd,decorators:[{type:gs,args:[{name:"async",pure:!1}]}],ctorParameters:()=>[{type:bn}]});var Yu=class Yu{transform(e){if(e==null)return null;if(typeof e!="string")throw ho(Yu,e);return e.toLowerCase()}};l(Yu,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Yu,deps:[],target:Se.Pipe})),l(Yu,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:Yu,isStandalone:!0,name:"lowercase"}));var hd=Yu;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:hd,decorators:[{type:gs,args:[{name:"lowercase"}]}]});var Jde=/(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g,Xu=class Xu{transform(e){if(e==null)return null;if(typeof e!="string")throw ho(Xu,e);return e.replace(Jde,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}};l(Xu,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Xu,deps:[],target:Se.Pipe})),l(Xu,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:Xu,isStandalone:!0,name:"titlecase"}));var md=Xu;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:md,decorators:[{type:gs,args:[{name:"titlecase"}]}]});var Qu=class Qu{transform(e){if(e==null)return null;if(typeof e!="string")throw ho(Qu,e);return e.toUpperCase()}};l(Qu,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Qu,deps:[],target:Se.Pipe})),l(Qu,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:Qu,isStandalone:!0,name:"uppercase"}));var gd=Qu;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:gd,decorators:[{type:gs,args:[{name:"uppercase"}]}]});var epe="mediumDate",BM=new $e(""),VM=new $e(""),Ku=class Ku{constructor(e,t,r){l(this,"locale");l(this,"defaultTimezone");l(this,"defaultOptions");this.locale=e,this.defaultTimezone=t,this.defaultOptions=r}transform(e,t,r,s){if(e==null||e===""||e!==e)return null;try{let i=t??this.defaultOptions?.dateFormat??epe,o=r??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return tU(e,i,s||this.locale,o)}catch(i){throw ho(Ku,i.message)}}};l(Ku,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ku,deps:[{token:ss},{token:BM,optional:!0},{token:VM,optional:!0}],target:Se.Pipe})),l(Ku,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:Ku,isStandalone:!0,name:"date"}));var vd=Ku;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:vd,decorators:[{type:gs,args:[{name:"date"}]}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[ss]}]},{type:void 0,decorators:[{type:Ke,args:[BM]},{type:st}]},{type:void 0,decorators:[{type:Ke,args:[VM]},{type:st}]}]});var tpe=/#/g,Ju=class Ju{constructor(e){l(this,"_localization");this._localization=e}transform(e,t,r){if(e==null)return"";if(typeof t!="object"||t===null)throw ho(Ju,t);let s=aU(e,Object.keys(t),this._localization,r);return t[s].replace(tpe,e.toString())}};l(Ju,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ju,deps:[{token:za}],target:Se.Pipe})),l(Ju,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:Ju,isStandalone:!0,name:"i18nPlural"}));var yd=Ju;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:yd,decorators:[{type:gs,args:[{name:"i18nPlural"}]}],ctorParameters:()=>[{type:za}]});var ed=class ed{transform(e,t){if(e==null)return"";if(typeof t!="object"||typeof e!="string")throw ho(ed,t);return t.hasOwnProperty(e)?t[e]:t.hasOwnProperty("other")?t.other:""}};l(ed,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ed,deps:[],target:Se.Pipe})),l(ed,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:ed,isStandalone:!0,name:"i18nSelect"}));var bd=ed;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:bd,decorators:[{type:gs,args:[{name:"i18nSelect"}]}]});var Lh=class Lh{transform(e){return JSON.stringify(e,null,2)}};l(Lh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Lh,deps:[],target:Se.Pipe})),l(Lh,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:Lh,isStandalone:!0,name:"json",pure:!1}));var wd=Lh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:wd,decorators:[{type:gs,args:[{name:"json",pure:!1}]}]});function npe(n,e){return{key:n,value:e}}var Oh=class Oh{constructor(e){l(this,"differs");l(this,"differ");l(this,"keyValues",[]);l(this,"compareFn",H4);this.differs=e}transform(e,t=H4){if(!e||!(e instanceof Map)&&typeof e!="object")return null;this.differ??(this.differ=this.differs.find(e).create());let r=this.differ.diff(e),s=t!==this.compareFn;return r&&(this.keyValues=[],r.forEachItem(i=>{this.keyValues.push(npe(i.key,i.currentValue))})),(r||s)&&(t&&this.keyValues.sort(t),this.compareFn=t),this.keyValues}};l(Oh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Oh,deps:[{token:zo}],target:Se.Pipe})),l(Oh,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:Oh,isStandalone:!0,name:"keyvalue",pure:!1}));var Ed=Oh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ed,decorators:[{type:gs,args:[{name:"keyvalue",pure:!1}]}],ctorParameters:()=>[{type:zo}]});function H4(n,e){let t=n.key,r=e.key;if(t===r)return 0;if(t==null)return 1;if(r==null)return-1;if(typeof t=="string"&&typeof r=="string")return t[{type:void 0,decorators:[{type:Ke,args:[ss]}]}]});var nd=class nd{constructor(e){l(this,"_locale");this._locale=e}transform(e,t,r){if(!$M(e))return null;r||(r=this._locale);try{let s=HM(e);return iU(s,r,t)}catch(s){throw ho(nd,s.message)}}};l(nd,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:nd,deps:[{token:ss}],target:Se.Pipe})),l(nd,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:nd,isStandalone:!0,name:"percent"}));var Sd=nd;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Sd,decorators:[{type:gs,args:[{name:"percent"}]}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[ss]}]}]});var rd=class rd{constructor(e,t="USD"){l(this,"_locale");l(this,"_defaultCurrencyCode");this._locale=e,this._defaultCurrencyCode=t}transform(e,t=this._defaultCurrencyCode,r="symbol",s,i){if(!$M(e))return null;i||(i=this._locale),typeof r=="boolean"&&(r=r?"symbol":"code");let o=t||this._defaultCurrencyCode;r!=="code"&&(r==="symbol"||r==="symbol-narrow"?o=J4(o,r==="symbol"?"wide":"narrow",i):o=r);try{let a=HM(e);return sU(a,i,o,t,s)}catch(a){throw ho(rd,a.message)}}};l(rd,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:rd,deps:[{token:ss},{token:XS}],target:Se.Pipe})),l(rd,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:rd,isStandalone:!0,name:"currency"}));var Cd=rd;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Cd,decorators:[{type:gs,args:[{name:"currency"}]}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[ss]}]},{type:void 0,decorators:[{type:Ke,args:[XS]}]}]});function $M(n){return!(n==null||n===""||n!==n)}function HM(n){if(typeof n=="string"&&!isNaN(Number(n)-parseFloat(n)))return Number(n);if(typeof n!="number")throw new Error(`${n} is not a number`);return n}var sd=class sd{transform(e,t,r){if(e==null)return null;if(!(typeof e=="string"||Array.isArray(e)))throw ho(sd,e);return e.slice(t,r)}};l(sd,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:sd,deps:[],target:Se.Pipe})),l(sd,"\u0275pipe",vs({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:sd,isStandalone:!0,name:"slice",pure:!1}));var Td=sd;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Td,decorators:[{type:gs,args:[{name:"slice",pure:!1}]}]});var j4=[fd,gd,hd,wd,Td,xd,Sd,md,Cd,vd,yd,bd,Ed],rc=class rc{};l(rc,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:rc,deps:[],target:Se.NgModule})),l(rc,"\u0275mod",co({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:rc,imports:[id,od,ic,ad,pd,dd,fo,ld,cd,Ga,ud,fd,gd,hd,wd,Td,xd,Sd,md,Cd,vd,yd,bd,Ed],exports:[id,od,ic,ad,pd,dd,fo,ld,cd,Ga,ud,fd,gd,hd,wd,Td,xd,Sd,md,Cd,vd,yd,bd,Ed]})),l(rc,"\u0275inj",lo({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:rc}));var tr=rc;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:tr,decorators:[{type:ao,args:[{imports:[$4,j4],exports:[$4,j4]}]}]});function jM(n,e){e=encodeURIComponent(e);for(let t of n.split(";")){let r=t.indexOf("="),[s,i]=r==-1?[t,""]:[t.slice(0,r),t.slice(r+1)];if(s.trim()===e)return decodeURIComponent(i)}return null}var uC="browser",lU="server";function cU(n){return n===uC}function dC(n){return n===lU}var cb=class{};var fye=new Wo("19.2.25");var zM="20";function $h(n,e){return GM(n)?new URL(n):new URL(n,e.location.href)}function GM(n){return/^https?:\/\//.test(n)}function uU(n){return GM(n)?new URL(n).hostname:n}function rpe(n){if(!(typeof n=="string")||n.trim()==="")return!1;try{let t=new URL(n);return!0}catch{return!1}}function spe(n){return n.endsWith("/")?n.slice(0,-1):n}function ipe(n){return n.startsWith("/")?n.slice(1):n}var fU=n=>n.src,hU=new $e("",{providedIn:"root",factory:()=>fU});function fC(n,e){return function(r){return rpe(r)||ope(r,e||[]),r=spe(r),[{provide:hU,useValue:o=>(GM(o.src)&&ape(r,o.src),n(r,{...o,src:ipe(o.src)}))}]}}function ope(n,e){throw new Pe(2959,!1)}function ape(n,e){throw new Pe(2959,!1)}var hye=fC(lpe,void 0);function lpe(n,e){let t="format=auto";return e.width&&(t+=`,width=${e.width}`),e.isPlaceholder&&(t+=`,quality=${zM}`),`${n}/cdn-cgi/image/${t}/${e.src}`}var mye=fC(cpe,void 0);function cpe(n,e){let r=`f_auto,${e.isPlaceholder?"q_auto:low":"q_auto"}`;return e.width&&(r+=`,w_${e.width}`),e.loaderParams?.rounded&&(r+=",r_max"),`${n}/image/upload/${r}/${e.src}`}var gye=fC(upe,void 0);function upe(n,e){let{src:t,width:r}=e,s=[];r&&s.push(`w-${r}`),e.isPlaceholder&&s.push(`q-${zM}`);let i=s.length?[n,`tr:${s.join(",")}`,t]:[n,t];return new URL(i.join("/")).href}var vye=fC(dpe,void 0);function dpe(n,e){let t=new URL(`${n}/${e.src}`);return t.searchParams.set("auto","format"),e.width&&t.searchParams.set("w",e.width.toString()),e.isPlaceholder&&t.searchParams.set("q",zM),t.href}function ZM(n,e=!0){return`The NgOptimizedImage directive ${e?`(activated on an element with the \`ngSrc="${n}"\`) `:""}has detected that`}function mU(n){throw new Pe(2958,`Unexpected invocation of the ${n} in the prod mode. Please make sure that the prod mode is enabled for production builds.`)}var Hh=class Hh{constructor(){l(this,"images",new Map);l(this,"window",null);l(this,"observer",null);let e=cU(ye(Xo));mU("LCP checker");let t=ye(dn).defaultView;e&&typeof PerformanceObserver<"u"&&(this.window=t,this.observer=this.initPerformanceObserver())}initPerformanceObserver(){let e=new PerformanceObserver(t=>{let r=t.getEntries();if(r.length===0)return;let i=r[r.length-1].element?.src??"";if(i.startsWith("data:")||i.startsWith("blob:"))return;let o=this.images.get(i);o&&(!o.priority&&!o.alreadyWarnedPriority&&(o.alreadyWarnedPriority=!0,ppe(i)),o.modified&&!o.alreadyWarnedModified&&(o.alreadyWarnedModified=!0,fpe(i)))});return e.observe({type:"largest-contentful-paint",buffered:!0}),e}registerImage(e,t,r){if(!this.observer)return;let s={priority:r,modified:!1,alreadyWarnedModified:!1,alreadyWarnedPriority:!1};this.images.set($h(e,this.window).href,s)}unregisterImage(e){this.observer&&this.images.delete($h(e,this.window).href)}updateImage(e,t){if(!this.observer)return;let r=$h(e,this.window).href,s=this.images.get(r);s&&(s.modified=!0,this.images.set($h(t,this.window).href,s),this.images.delete(r))}ngOnDestroy(){this.observer&&(this.observer.disconnect(),this.images.clear())}};l(Hh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Hh,deps:[],target:Se.Injectable})),l(Hh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Hh,providedIn:"root"}));var UM=Hh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:UM,decorators:[{type:zt,args:[{providedIn:"root"}]}],ctorParameters:()=>[]});function ppe(n){let e=ZM(n);console.error(Go(2955,`${e} this image is the Largest Contentful Paint (LCP) element but was not marked "priority". This image should be marked "priority" in order to prioritize its loading. To fix this, add the "priority" attribute.`))}function fpe(n){let e=ZM(n);console.warn(Go(2964,`${e} this image is the Largest Contentful Paint (LCP) element and has had its "ngSrc" attribute modified. This can cause slower loading performance. It is recommended not to modify the "ngSrc" property on any image which could be the LCP element.`))}var hpe=new Set(["localhost","127.0.0.1","0.0.0.0"]),mpe=new $e(""),jh=class jh{constructor(){l(this,"document",ye(dn));l(this,"preconnectLinks",null);l(this,"alreadySeen",new Set);l(this,"window",this.document.defaultView);l(this,"blocklist",new Set(hpe));mU("preconnect link checker");let e=ye(mpe,{optional:!0});e&&this.populateBlocklist(e)}populateBlocklist(e){Array.isArray(e)?gU(e,t=>{this.blocklist.add(uU(t))}):this.blocklist.add(uU(e))}assertPreconnect(e,t){if(typeof ngServerMode<"u"&&ngServerMode)return;let r=$h(e,this.window);this.blocklist.has(r.hostname)||this.alreadySeen.has(r.origin)||(this.alreadySeen.add(r.origin),this.preconnectLinks??(this.preconnectLinks=this.queryPreconnectLinks()),this.preconnectLinks.has(r.origin)||console.warn(Go(2956,`${ZM(t)} there is no preconnect tag present for this image. Preconnecting to the origin(s) that serve priority images ensures that these images are delivered as soon as possible. To fix this, please add the following element into the of the document: + `)))}queryPreconnectLinks(){let e=new Set,t=this.document.querySelectorAll("link[rel=preconnect]");for(let r of t){let s=$h(r.href,this.window);e.add(s.origin)}return e}ngOnDestroy(){this.preconnectLinks?.clear(),this.alreadySeen.clear()}};l(jh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:jh,deps:[],target:Se.Injectable})),l(jh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:jh,providedIn:"root"}));var qM=jh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:qM,decorators:[{type:zt,args:[{providedIn:"root"}]}],ctorParameters:()=>[]});function gU(n,e){for(let t of n)Array.isArray(t)?gU(t,e):e(t)}var gpe=new $e("",{providedIn:"root",factory:()=>new Set}),Uh=class Uh{constructor(){l(this,"preloadedImages",ye(gpe));l(this,"document",ye(dn));l(this,"errorShown",!1)}createPreloadLinkTag(e,t,r,s){if(this.preloadedImages.has(t))return;this.preloadedImages.add(t);let i=e.createElement("link");e.setAttribute(i,"as","image"),e.setAttribute(i,"href",t),e.setAttribute(i,"rel","preload"),e.setAttribute(i,"fetchpriority","high"),s&&e.setAttribute(i,"imageSizes",s),r&&e.setAttribute(i,"imageSrcset",r),e.appendChild(this.document.head,i)}};l(Uh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Uh,deps:[],target:Se.Injectable})),l(Uh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Uh,providedIn:"root"}));var pC=Uh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:pC,decorators:[{type:zt,args:[{providedIn:"root"}]}]});var dU=/^((\s*\d+w\s*(,|$)){1,})$/;var vpe=[1,2],ype=640;var bpe=1920,wpe=1080,Epe=15;var qh=class qh{constructor(){l(this,"imageLoader",ye(hU));l(this,"config",xpe(ye(bS)));l(this,"renderer",ye(Qn));l(this,"imgElement",ye(en).nativeElement);l(this,"injector",ye(In));l(this,"lcpObserver");l(this,"_renderedSrc",null);l(this,"ngSrc");l(this,"ngSrcset");l(this,"sizes");l(this,"width");l(this,"height");l(this,"loading");l(this,"priority",!1);l(this,"loaderParams");l(this,"disableOptimizedSrcset",!1);l(this,"fill",!1);l(this,"placeholder");l(this,"placeholderConfig");l(this,"src");l(this,"srcset")}ngOnInit(){rs("NgOptimizedImage"),this.placeholder&&this.removePlaceholderOnLoad(this.imgElement),this.setHostAttributes()}setHostAttributes(){this.fill?this.sizes||(this.sizes="100vw"):(this.setHostAttribute("width",this.width.toString()),this.setHostAttribute("height",this.height.toString())),this.setHostAttribute("loading",this.getLoadingBehavior()),this.setHostAttribute("fetchpriority",this.getFetchPriority()),this.setHostAttribute("ng-img","true");let e=this.updateSrcAndSrcset();this.sizes?this.getLoadingBehavior()==="lazy"?this.setHostAttribute("sizes","auto, "+this.sizes):this.setHostAttribute("sizes",this.sizes):this.ngSrcset&&dU.test(this.ngSrcset)&&this.getLoadingBehavior()==="lazy"&&this.setHostAttribute("sizes","auto, 100vw"),typeof ngServerMode<"u"&&ngServerMode&&this.priority&&this.injector.get(pC).createPreloadLinkTag(this.renderer,this.getRewrittenSrc(),e,this.sizes)}ngOnChanges(e){if(e.ngSrc&&!e.ngSrc.isFirstChange()){let t=this._renderedSrc;this.updateSrcAndSrcset(!0)}}callImageLoader(e){let t=e;return this.loaderParams&&(t.loaderParams=this.loaderParams),this.imageLoader(t)}getLoadingBehavior(){return!this.priority&&this.loading!==void 0?this.loading:this.priority?"eager":"lazy"}getFetchPriority(){return this.priority?"high":"auto"}getRewrittenSrc(){if(!this._renderedSrc){let e={src:this.ngSrc};this._renderedSrc=this.callImageLoader(e)}return this._renderedSrc}getRewrittenSrcset(){let e=dU.test(this.ngSrcset);return this.ngSrcset.split(",").filter(r=>r!=="").map(r=>{r=r.trim();let s=e?parseFloat(r):parseFloat(r)*this.width;return`${this.callImageLoader({src:this.ngSrc,width:s})} ${r}`}).join(", ")}getAutomaticSrcset(){return this.sizes?this.getResponsiveSrcset():this.getFixedSrcset()}getResponsiveSrcset(){let{breakpoints:e}=this.config,t=e;return this.sizes?.trim()==="100vw"&&(t=e.filter(s=>s>=ype)),t.map(s=>`${this.callImageLoader({src:this.ngSrc,width:s})} ${s}w`).join(", ")}updateSrcAndSrcset(e=!1){e&&(this._renderedSrc=null);let t=this.getRewrittenSrc();this.setHostAttribute("src",t);let r;return this.ngSrcset?r=this.getRewrittenSrcset():this.shouldGenerateAutomaticSrcset()&&(r=this.getAutomaticSrcset()),r&&this.setHostAttribute("srcset",r),r}getFixedSrcset(){return vpe.map(t=>`${this.callImageLoader({src:this.ngSrc,width:this.width*t})} ${t}x`).join(", ")}shouldGenerateAutomaticSrcset(){let e=!1;return this.sizes||(e=this.width>bpe||this.height>wpe),!this.disableOptimizedSrcset&&!this.srcset&&this.imageLoader!==fU&&!e}generatePlaceholder(e){let{placeholderResolution:t}=this.config;return e===!0?`url("${pU(this.callImageLoader({src:this.ngSrc,width:t,isPlaceholder:!0}))}")`:typeof e=="string"?`url("${pU(e)}")`:null}shouldBlurPlaceholder(e){return!e||!e.hasOwnProperty("blur")?!0:!!e.blur}removePlaceholderOnLoad(e){let t=()=>{let i=this.injector.get(bn);r(),s(),this.placeholder=!1,i.markForCheck()},r=this.renderer.listen(e,"load",t),s=this.renderer.listen(e,"error",t);Spe(e,t)}setHostAttribute(e,t){this.renderer.setAttribute(this.imgElement,e,t)}};l(qh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:qh,deps:[],target:Se.Directive})),l(qh,"\u0275dir",vt({minVersion:"16.1.0",version:"19.2.25",type:qh,isStandalone:!0,selector:"img[ngSrc]",inputs:{ngSrc:["ngSrc","ngSrc",vU],ngSrcset:"ngSrcset",sizes:"sizes",width:["width","width",gh],height:["height","height",gh],loading:"loading",priority:["priority","priority",ei],loaderParams:"loaderParams",disableOptimizedSrcset:["disableOptimizedSrcset","disableOptimizedSrcset",ei],fill:["fill","fill",ei],placeholder:["placeholder","placeholder",yU],placeholderConfig:"placeholderConfig",src:"src",srcset:"srcset"},host:{properties:{"style.position":'fill ? "absolute" : null',"style.width":'fill ? "100%" : null',"style.height":'fill ? "100%" : null',"style.inset":'fill ? "0" : null',"style.background-size":'placeholder ? "cover" : null',"style.background-position":'placeholder ? "50% 50%" : null',"style.background-repeat":'placeholder ? "no-repeat" : null',"style.background-image":"placeholder ? generatePlaceholder(placeholder) : null","style.filter":'placeholder && shouldBlurPlaceholder(placeholderConfig) ? "blur(15px)" : null'}},usesOnChanges:!0,ngImport:k}));var WM=qh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:WM,decorators:[{type:ht,args:[{selector:"img[ngSrc]",host:{"[style.position]":'fill ? "absolute" : null',"[style.width]":'fill ? "100%" : null',"[style.height]":'fill ? "100%" : null',"[style.inset]":'fill ? "0" : null',"[style.background-size]":'placeholder ? "cover" : null',"[style.background-position]":'placeholder ? "50% 50%" : null',"[style.background-repeat]":'placeholder ? "no-repeat" : null',"[style.background-image]":"placeholder ? generatePlaceholder(placeholder) : null","[style.filter]":`placeholder && shouldBlurPlaceholder(placeholderConfig) ? "blur(${Epe}px)" : null`}}]}],ctorParameters:()=>[],propDecorators:{ngSrc:[{type:ze,args:[{required:!0,transform:vU}]}],ngSrcset:[{type:ze}],sizes:[{type:ze}],width:[{type:ze,args:[{transform:gh}]}],height:[{type:ze,args:[{transform:gh}]}],loading:[{type:ze}],priority:[{type:ze,args:[{transform:ei}]}],loaderParams:[{type:ze}],disableOptimizedSrcset:[{type:ze,args:[{transform:ei}]}],fill:[{type:ze,args:[{transform:ei}]}],placeholder:[{type:ze,args:[{transform:yU}]}],placeholderConfig:[{type:ze}],src:[{type:ze}],srcset:[{type:ze}]}});function xpe(n){let e={};return n.breakpoints&&(e.breakpoints=n.breakpoints.sort((t,r)=>t-r)),Object.assign({},yS,n,e)}function Spe(n,e){n.complete&&n.naturalWidth&&e()}function vU(n){return typeof n=="string"?n:zr(n)}function pU(n){return n.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function yU(n){return typeof n=="string"&&n!=="true"&&n!=="false"&&n!==""?n:ei(n)}var oc=new $e(""),Wh=class Wh{constructor(e,t){l(this,"_zone");l(this,"_plugins");l(this,"_eventNameToPlugin",new Map);this._zone=t,e.forEach(r=>{r.manager=this}),this._plugins=e.slice().reverse()}addEventListener(e,t,r,s){return this._findPluginFor(t).addEventListener(e,t,r,s)}getZone(){return this._zone}_findPluginFor(e){let t=this._eventNameToPlugin.get(e);if(t)return t;if(t=this._plugins.find(s=>s.supports(e)),!t)throw new Pe(5101,!1);return this._eventNameToPlugin.set(e,t),t}};l(Wh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Wh,deps:[{token:oc},{token:ln}],target:Se.Injectable})),l(Wh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Wh}));var Dd=Wh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Dd,decorators:[{type:zt}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[oc]}]},{type:ln}]});var Id=class{constructor(e){l(this,"_doc");l(this,"manager");this._doc=e}},hC="ng-app-id";function bU(n){for(let e of n)e.remove()}function wU(n,e){let t=e.createElement("style");return t.textContent=n,t}function Cpe(n,e,t,r){let s=n.head?.querySelectorAll(`style[${hC}="${e}"],link[${hC}="${e}"]`);if(s)for(let i of s)i.removeAttribute(hC),i instanceof HTMLLinkElement?r.set(i.href.slice(i.href.lastIndexOf("/")+1),{usage:0,elements:[i]}):i.textContent&&t.set(i.textContent,{usage:0,elements:[i]})}function XM(n,e){let t=e.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",n),t}var zh=class zh{constructor(e,t,r,s={}){l(this,"doc");l(this,"appId");l(this,"nonce");l(this,"inline",new Map);l(this,"external",new Map);l(this,"hosts",new Set);l(this,"isServer");this.doc=e,this.appId=t,this.nonce=r,this.isServer=dC(s),Cpe(e,t,this.inline,this.external),this.hosts.add(e.head)}addStyles(e,t){for(let r of e)this.addUsage(r,this.inline,wU);t?.forEach(r=>this.addUsage(r,this.external,XM))}removeStyles(e,t){for(let r of e)this.removeUsage(r,this.inline);t?.forEach(r=>this.removeUsage(r,this.external))}addUsage(e,t,r){let s=t.get(e);s?s.usage++:t.set(e,{usage:1,elements:[...this.hosts].map(i=>this.addElement(i,r(e,this.doc)))})}removeUsage(e,t){let r=t.get(e);r&&(r.usage--,r.usage<=0&&(bU(r.elements),t.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])bU(e);this.hosts.clear()}addHost(e){this.hosts.add(e);for(let[t,{elements:r}]of this.inline)r.push(this.addElement(e,wU(t,this.doc)));for(let[t,{elements:r}]of this.external)r.push(this.addElement(e,XM(t,this.doc)))}removeHost(e){this.hosts.delete(e)}addElement(e,t){return this.nonce&&t.setAttribute("nonce",this.nonce),this.isServer&&t.setAttribute(hC,this.appId),e.appendChild(t)}};l(zh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:zh,deps:[{token:dn},{token:Zs},{token:Xf,optional:!0},{token:Xo}],target:Se.Injectable})),l(zh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:zh}));var _d=zh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:_d,decorators:[{type:zt}],ctorParameters:()=>[{type:Document,decorators:[{type:Ke,args:[dn]}]},{type:void 0,decorators:[{type:Ke,args:[Zs]}]},{type:void 0,decorators:[{type:Ke,args:[Xf]},{type:st}]},{type:void 0,decorators:[{type:Ke,args:[Xo]}]}]});var YM={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"},KM=/%COMP%/g;var xU="%COMP%",Tpe=`_nghost-${xU}`,Dpe=`_ngcontent-${xU}`,Ipe=!0,SU=new $e("",{providedIn:"root",factory:()=>Ipe});function _pe(n){return Dpe.replace(KM,n)}function kpe(n){return Tpe.replace(KM,n)}function CU(n,e){return e.map(t=>t.replace(KM,n))}var Gh=class Gh{constructor(e,t,r,s,i,o,a,c=null,u=null){l(this,"eventManager");l(this,"sharedStylesHost");l(this,"appId");l(this,"removeStylesOnCompDestroy");l(this,"doc");l(this,"platformId");l(this,"ngZone");l(this,"nonce");l(this,"tracingService");l(this,"rendererByCompId",new Map);l(this,"defaultRenderer");l(this,"platformIsServer");this.eventManager=e,this.sharedStylesHost=t,this.appId=r,this.removeStylesOnCompDestroy=s,this.doc=i,this.platformId=o,this.ngZone=a,this.nonce=c,this.tracingService=u,this.platformIsServer=dC(o),this.defaultRenderer=new ub(e,i,a,this.platformIsServer,this.tracingService)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;this.platformIsServer&&t.encapsulation===ps.ShadowDom&&(t={...t,encapsulation:ps.Emulated});let r=this.getOrCreateRenderer(e,t);return r instanceof mC?r.applyToHost(e):r instanceof db&&r.applyStyles(),r}getOrCreateRenderer(e,t){let r=this.rendererByCompId,s=r.get(t.id);if(!s){let i=this.doc,o=this.ngZone,a=this.eventManager,c=this.sharedStylesHost,u=this.removeStylesOnCompDestroy,d=this.platformIsServer,p=this.tracingService;switch(t.encapsulation){case ps.Emulated:s=new mC(a,c,t,this.appId,u,i,o,d,p);break;case ps.ShadowDom:return new QM(a,c,e,t,i,o,this.nonce,d,p);default:s=new db(a,c,t,u,i,o,d,p);break}r.set(t.id,s)}return s}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}};l(Gh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Gh,deps:[{token:Dd},{token:_d},{token:Zs},{token:SU},{token:dn},{token:Xo},{token:ln},{token:Xf},{token:ro,optional:!0}],target:Se.Injectable})),l(Gh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Gh}));var Zh=Gh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Zh,decorators:[{type:zt}],ctorParameters:()=>[{type:Dd},{type:_d},{type:void 0,decorators:[{type:Ke,args:[Zs]}]},{type:void 0,decorators:[{type:Ke,args:[SU]}]},{type:Document,decorators:[{type:Ke,args:[dn]}]},{type:Object,decorators:[{type:Ke,args:[Xo]}]},{type:ln},{type:void 0,decorators:[{type:Ke,args:[Xf]}]},{type:ro,decorators:[{type:Ke,args:[ro]},{type:st}]}]});var ub=class{constructor(e,t,r,s,i){l(this,"eventManager");l(this,"doc");l(this,"ngZone");l(this,"platformIsServer");l(this,"tracingService");l(this,"data",Object.create(null));l(this,"throwOnSyntheticProps",!0);l(this,"destroyNode",null);this.eventManager=e,this.doc=t,this.ngZone=r,this.platformIsServer=s,this.tracingService=i}destroy(){}createElement(e,t){return t?this.doc.createElementNS(YM[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(EU(e)?e.content:e).appendChild(t)}insertBefore(e,t,r){e&&(EU(e)?e.content:e).insertBefore(t,r)}removeChild(e,t){t.remove()}selectRootElement(e,t){let r=typeof e=="string"?this.doc.querySelector(e):e;if(!r)throw new Pe(-5104,!1);return t||(r.textContent=""),r}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,r,s){if(s){t=s+":"+t;let i=YM[s];i?e.setAttributeNS(i,t,r):e.setAttribute(t,r)}else e.setAttribute(t,r)}removeAttribute(e,t,r){if(r){let s=YM[r];s?e.removeAttributeNS(s,t):e.removeAttribute(`${r}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,r,s){s&(Ii.DashCase|Ii.Important)?e.style.setProperty(t,r,s&Ii.Important?"important":""):e.style[t]=r}removeStyle(e,t,r){r&Ii.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,r){e!=null&&(e[t]=r)}setValue(e,t){e.nodeValue=t}listen(e,t,r,s){if(typeof e=="string"&&(e=Fs().getGlobalEventTarget(this.doc,e),!e))throw new Pe(5102,!1);let i=this.decoratePreventDefault(r);return this.tracingService?.wrapEventListener&&(i=this.tracingService.wrapEventListener(e,t,i)),this.eventManager.addEventListener(e,t,i,s)}decoratePreventDefault(e){return t=>{if(t==="__ngUnwrap__")return e;(this.platformIsServer?this.ngZone.runGuarded(()=>e(t)):e(t))===!1&&t.preventDefault()}}};function EU(n){return n.tagName==="TEMPLATE"&&n.content!==void 0}var QM=class extends ub{constructor(t,r,s,i,o,a,c,u,d){super(t,o,a,u,d);l(this,"sharedStylesHost");l(this,"hostEl");l(this,"shadowRoot");this.sharedStylesHost=r,this.hostEl=s,this.shadowRoot=s.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let p=i.styles;p=CU(i.id,p);for(let h of p){let m=document.createElement("style");c&&m.setAttribute("nonce",c),m.textContent=h,this.shadowRoot.appendChild(m)}let f=i.getExternalStyles?.();if(f)for(let h of f){let m=XM(h,o);c&&m.setAttribute("nonce",c),this.shadowRoot.appendChild(m)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,r){return super.appendChild(this.nodeOrShadowRoot(t),r)}insertBefore(t,r,s){return super.insertBefore(this.nodeOrShadowRoot(t),r,s)}removeChild(t,r){return super.removeChild(null,r)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},db=class extends ub{constructor(t,r,s,i,o,a,c,u,d){super(t,o,a,c,u);l(this,"sharedStylesHost");l(this,"removeStylesOnCompDestroy");l(this,"styles");l(this,"styleUrls");this.sharedStylesHost=r,this.removeStylesOnCompDestroy=i;let p=s.styles;this.styles=d?CU(d,p):p,this.styleUrls=s.getExternalStyles?.(d)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},mC=class extends db{constructor(t,r,s,i,o,a,c,u,d){let p=i+"-"+s.id;super(t,r,s,o,a,c,u,d,p);l(this,"contentAttr");l(this,"hostAttr");this.contentAttr=_pe(p),this.hostAttr=kpe(p)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,r){let s=super.createElement(t,r);return super.setAttribute(s,this.contentAttr,""),s}};var gC=class n extends nb{constructor(){super(...arguments);l(this,"supportsDOMEvents",!0)}static makeCurrent(){DM(new n)}onAndCancel(t,r,s,i){return t.addEventListener(r,s,i),()=>{t.removeEventListener(r,s,i)}}dispatchEvent(t,r){t.dispatchEvent(r)}remove(t){t.remove()}createElement(t,r){return r=r||this.getDefaultDocument(),r.createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,r){return r==="window"?window:r==="document"?t:r==="body"?t.body:null}getBaseHref(t){let r=Ape();return r==null?null:Mpe(r)}resetBaseElement(){pb=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return jM(document.cookie,t)}},pb=null;function Ape(){return pb=pb||document.head.querySelector("base"),pb?pb.getAttribute("href"):null}function Mpe(n){return new URL(n,document.baseURI).pathname}var vC=class{addToWindow(e){or.getAngularTestability=(r,s=!0)=>{let i=e.findTestabilityInTree(r,s);if(i==null)throw new Pe(5103,!1);return i},or.getAllAngularTestabilities=()=>e.getAllTestabilities(),or.getAllAngularRootElements=()=>e.getAllRootElements();let t=r=>{let s=or.getAllAngularTestabilities(),i=s.length,o=function(){i--,i==0&&r()};s.forEach(a=>{a.whenStable(o)})};or.frameworkStabilizers||(or.frameworkStabilizers=[]),or.frameworkStabilizers.push(t)}findTestabilityInTree(e,t,r){if(t==null)return null;let s=e.getTestability(t);return s??(r?Fs().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null)}},Yh=class Yh{build(){return new XMLHttpRequest}};l(Yh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Yh,deps:[],target:Se.Injectable})),l(Yh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Yh}));var yC=Yh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:yC,decorators:[{type:zt}]});var Xh=class Xh extends Id{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,r,s){return e.addEventListener(t,r,s),()=>this.removeEventListener(e,t,r,s)}removeEventListener(e,t,r,s){return e.removeEventListener(t,r,s)}};l(Xh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Xh,deps:[{token:dn}],target:Se.Injectable})),l(Xh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Xh}));var fb=Xh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:fb,decorators:[{type:zt}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[dn]}]}]});var TU=["alt","control","meta","shift"],Npe={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},Ppe={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey},mo=class mo extends Id{constructor(e){super(e)}supports(e){return mo.parseEventName(e)!=null}addEventListener(e,t,r,s){let i=mo.parseEventName(t),o=mo.eventCallback(i.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Fs().onAndCancel(e,i.domEventName,o,s))}static parseEventName(e){let t=e.toLowerCase().split("."),r=t.shift();if(t.length===0||!(r==="keydown"||r==="keyup"))return null;let s=mo._normalizeKey(t.pop()),i="",o=t.indexOf("code");if(o>-1&&(t.splice(o,1),i="code."),TU.forEach(c=>{let u=t.indexOf(c);u>-1&&(t.splice(u,1),i+=c+".")}),i+=s,t.length!=0||s.length===0)return null;let a={};return a.domEventName=r,a.fullKey=i,a}static matchEventFullKeyCode(e,t){let r=Npe[e.key]||e.key,s="";return t.indexOf("code.")>-1&&(r=e.code,s="code."),r==null||!r?!1:(r=r.toLowerCase(),r===" "?r="space":r==="."&&(r="dot"),TU.forEach(i=>{if(i!==r){let o=Ppe[i];o(e)&&(s+=i+".")}}),s+=r,s===t)}static eventCallback(e,t,r){return s=>{mo.matchEventFullKeyCode(s,e)&&r.runGuarded(()=>t(s))}}static _normalizeKey(e){return e==="esc"?"escape":e}};l(mo,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:mo,deps:[{token:dn}],target:Se.Injectable})),l(mo,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:mo}));var hb=mo;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:hb,decorators:[{type:zt}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[dn]}]}]});function JM(n,e,t){return SM({rootComponent:n,platformRef:t?.platformRef,...Rpe(e)})}function Rpe(n){return{appProviders:[...eN,...n?.providers??[]],platformProviders:DU}}function Fpe(){gC.makeCurrent()}function Lpe(){return new Ks}function Ope(){return a2(document),document}var DU=[{provide:Xo,useValue:uC},{provide:Vy,useValue:Fpe,multi:!0},{provide:dn,useFactory:Ope}],Bpe=QS(xM,"browser",DU),Mye=new $e(""),IU=[{provide:ih,useClass:vC},{provide:VS,useClass:Fu,deps:[ln,Lu,ih]},{provide:Fu,useClass:Fu,deps:[ln,Lu,ih]}],eN=[{provide:Fy,useValue:"root"},{provide:Ks,useFactory:Lpe},{provide:oc,useClass:fb,multi:!0,deps:[dn]},{provide:oc,useClass:hb,multi:!0,deps:[dn]},Zh,_d,Dd,{provide:Nu,useExisting:Zh},{provide:cb,useClass:yC},[]],ac=class ac{constructor(){}};l(ac,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ac,deps:[],target:Se.NgModule})),l(ac,"\u0275mod",co({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:ac,exports:[tr,Vu]})),l(ac,"\u0275inj",lo({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ac,providers:[...eN,...IU],imports:[tr,Vu]}));var bC=ac;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:bC,decorators:[{type:ao,args:[{providers:[...eN,...IU],exports:[tr,Vu]}]}],ctorParameters:()=>[]});var Qh=class Qh{constructor(e){l(this,"_doc");l(this,"_dom");this._doc=e,this._dom=Fs()}addTag(e,t=!1){return e?this._getOrCreateElement(e,t):null}addTags(e,t=!1){return e?e.reduce((r,s)=>(s&&r.push(this._getOrCreateElement(s,t)),r),[]):[]}getTag(e){if(!e)return null;let t=this._doc.querySelector(`meta[${e}]`);return t?.nodeName.toLowerCase()==="meta"?t:null}getTags(e){if(!e)return[];let t=this._doc.querySelectorAll(`meta[${e}]`);return t?[].slice.call(t).filter(r=>r.nodeName.toLowerCase()==="meta"):[]}updateTag(e,t){if(!e)return null;t=t||this._parseSelector(e);let r=this.getTag(t);return r?this._setMetaElementAttributes(e,r):this._getOrCreateElement(e,!0)}removeTag(e){this.removeTagElement(this.getTag(e))}removeTagElement(e){e&&this._dom.remove(e)}_getOrCreateElement(e,t=!1){if(!t){let i=this._parseSelector(e),o=this.getTags(i).filter(a=>this._containsAttributes(e,a))[0];if(o!==void 0)return o}let r=this._dom.createElement("meta");return this._setMetaElementAttributes(e,r),this._doc.getElementsByTagName("head")[0].appendChild(r),r}_setMetaElementAttributes(e,t){return Object.keys(e).forEach(r=>t.setAttribute(this._getMetaKeyMap(r),e[r])),t}_parseSelector(e){let t=e.name?"name":"property";return`${t}=${this._escapeSelectorValue(String(e[t]))}`}_escapeSelectorValue(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}_containsAttributes(e,t){return Object.keys(e).every(r=>t.getAttribute(this._getMetaKeyMap(r))===e[r])}_getMetaKeyMap(e){return Vpe[e]||e}};l(Qh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Qh,deps:[{token:dn}],target:Se.Injectable})),l(Qh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Qh,providedIn:"root"}));var tN=Qh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:tN,decorators:[{type:zt,args:[{providedIn:"root"}]}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[dn]}]}]});var Vpe={httpEquiv:"http-equiv"},Kh=class Kh{constructor(e){l(this,"_doc");this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}};l(Kh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Kh,deps:[{token:dn}],target:Se.Injectable})),l(Kh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Kh,providedIn:"root"}));var nN=Kh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:nN,decorators:[{type:zt,args:[{providedIn:"root"}]}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[dn]}]}]});var $pe={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0,doubletap:!0},rm=new $e(""),EC=new $e(""),Jh=class Jh{constructor(){l(this,"events",[]);l(this,"overrides",{});l(this,"options")}buildHammer(e){let t=new Hammer(e,this.options);t.get("pinch").set({enable:!0}),t.get("rotate").set({enable:!0});for(let r in this.overrides)t.get(r).set(this.overrides[r]);return t}};l(Jh,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Jh,deps:[],target:Se.Injectable})),l(Jh,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Jh}));var sm=Jh;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:sm,decorators:[{type:zt}]});var em=class em extends Id{constructor(t,r,s,i){super(t);l(this,"_config");l(this,"_injector");l(this,"loader");l(this,"_loaderPromise",null);this._config=r,this._injector=s,this.loader=i}supports(t){return!(!$pe.hasOwnProperty(t.toLowerCase())&&!this.isCustomEvent(t)||!window.Hammer&&!this.loader)}addEventListener(t,r,s){let i=this.manager.getZone();if(r=r.toLowerCase(),!window.Hammer&&this.loader){this._loaderPromise=this._loaderPromise||i.runOutsideAngular(()=>this.loader());let o=!1,a=()=>{o=!0};return i.runOutsideAngular(()=>this._loaderPromise.then(()=>{if(!window.Hammer){a=()=>{};return}o||(a=this.addEventListener(t,r,s))}).catch(()=>{a=()=>{}})),()=>{a()}}return i.runOutsideAngular(()=>{let o=this._config.buildHammer(t),a=function(c){i.runGuarded(function(){s(c)})};return o.on(r,a),()=>{o.off(r,a),typeof o.destroy=="function"&&o.destroy()}})}isCustomEvent(t){return this._config.events.indexOf(t)>-1}};l(em,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:em,deps:[{token:dn},{token:rm},{token:In},{token:EC,optional:!0}],target:Se.Injectable})),l(em,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:em}));var mb=em;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:mb,decorators:[{type:zt}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[dn]}]},{type:sm,decorators:[{type:Ke,args:[rm]}]},{type:In},{type:void 0,decorators:[{type:st},{type:Ke,args:[EC]}]}]});var lc=class lc{};l(lc,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:lc,deps:[],target:Se.NgModule})),l(lc,"\u0275mod",co({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:lc})),l(lc,"\u0275inj",lo({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:lc,providers:[{provide:oc,useClass:mb,multi:!0,deps:[dn,rm,In,[new st,EC]]},{provide:rm,useClass:sm}]}));var rN=lc;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:rN,decorators:[{type:ao,args:[{providers:[{provide:oc,useClass:mb,multi:!0,deps:[dn,rm,In,[new st,EC]]},{provide:rm,useClass:sm}]}]}]});var tm=class tm{};l(tm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:tm,deps:[],target:Se.Injectable})),l(tm,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:tm,providedIn:"root",useExisting:cn(()=>gb)}));var wC=tm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:wC,decorators:[{type:zt,args:[{providedIn:"root",useExisting:cn(()=>gb)}]}]});var nm=class nm extends wC{constructor(t){super();l(this,"_doc");this._doc=t}sanitize(t,r){if(r==null)return null;switch(t){case vn.NONE:return r;case vn.HTML:return Ai(r,"HTML")?zr(r):xS(this._doc,String(r)).toString();case vn.STYLE:return Ai(r,"Style")?zr(r):r;case vn.SCRIPT:if(Ai(r,"Script"))return zr(r);throw new Pe(5200,!1);case vn.URL:return Ai(r,"URL")?zr(r):Jf(String(r));case vn.RESOURCE_URL:if(Ai(r,"ResourceURL"))return zr(r);throw new Pe(5201,!1);default:throw new Pe(5202,!1)}}bypassSecurityTrustHtml(t){return T2(t)}bypassSecurityTrustStyle(t){return D2(t)}bypassSecurityTrustScript(t){return I2(t)}bypassSecurityTrustUrl(t){return _2(t)}bypassSecurityTrustResourceUrl(t){return k2(t)}};l(nm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:nm,deps:[{token:dn}],target:Se.Injectable})),l(nm,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:nm,providedIn:"root"}));var gb=nm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:gb,decorators:[{type:zt,args:[{providedIn:"root"}]}],ctorParameters:()=>[{type:void 0,decorators:[{type:Ke,args:[dn]}]}]});var _U;(function(n){n[n.NoHttpTransferCache=0]="NoHttpTransferCache",n[n.HttpTransferCacheOptions=1]="HttpTransferCacheOptions",n[n.I18nSupport=2]="I18nSupport",n[n.EventReplay=3]="EventReplay",n[n.IncrementalHydration=4]="IncrementalHydration"})(_U||(_U={}));var $ye=new Wo("19.2.25");var am=class am{constructor(e,t){l(this,"_renderer");l(this,"_elementRef");l(this,"onChange",e=>{});l(this,"onTouched",()=>{});this._renderer=e,this._elementRef=t}setProperty(e,t){this._renderer.setProperty(this._elementRef.nativeElement,e,t)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}};l(am,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:am,deps:[{token:Qn},{token:en}],target:Se.Directive})),l(am,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:am,isStandalone:!0,ngImport:k}));var Sb=am;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Sb,decorators:[{type:ht}],ctorParameters:()=>[{type:Qn},{type:en}]});var lm=class lm extends Sb{};l(lm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:lm,deps:null,target:Se.Directive})),l(lm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:lm,isStandalone:!0,usesInheritance:!0,ngImport:k}));var ra=lm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ra,decorators:[{type:ht}]});var ni=new $e(""),$U={provide:ni,useExisting:cn(()=>Rd),multi:!0},cm=class cm extends ra{writeValue(e){this.setProperty("checked",e)}};l(cm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:cm,deps:null,target:Se.Directive})),l(cm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:cm,isStandalone:!1,selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",host:{listeners:{change:"onChange($event.target.checked)",blur:"onTouched()"}},providers:[$U],usesInheritance:!0,ngImport:k}));var Rd=cm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Rd,decorators:[{type:ht,args:[{selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},providers:[$U],standalone:!1}]}]});var HU={provide:ni,useExisting:cn(()=>uc),multi:!0};function Hpe(){let n=Fs()?Fs().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var jU=new $e(""),um=class um extends Sb{constructor(t,r,s){super(t,r);l(this,"_compositionMode");l(this,"_composing",!1);this._compositionMode=s,this._compositionMode==null&&(this._compositionMode=!Hpe())}writeValue(t){let r=t??"";this.setProperty("value",r)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}};l(um,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:um,deps:[{token:Qn},{token:en},{token:jU,optional:!0}],target:Se.Directive})),l(um,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:um,isStandalone:!1,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",host:{listeners:{input:"$any(this)._handleInput($event.target.value)",blur:"onTouched()",compositionstart:"$any(this)._compositionStart()",compositionend:"$any(this)._compositionEnd($event.target.value)"}},providers:[HU],usesInheritance:!0,ngImport:k}));var uc=um;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:uc,decorators:[{type:ht,args:[{selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",host:{"(input)":"$any(this)._handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"$any(this)._compositionStart()","(compositionend)":"$any(this)._compositionEnd($event.target.value)"},providers:[HU],standalone:!1}]}],ctorParameters:()=>[{type:Qn},{type:en},{type:void 0,decorators:[{type:st},{type:Ke,args:[jU]}]}]});function dN(n){return n==null||pN(n)===0}function pN(n){return n==null?null:Array.isArray(n)||typeof n=="string"?n.length:n instanceof Set?n.size:null}var Hn=new $e(""),is=new $e(""),jpe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function Upe(n){return e=>{if(e.value==null||n==null)return null;let t=parseFloat(e.value);return!isNaN(t)&&t{if(e.value==null||n==null)return null;let t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}function Wpe(n){return dN(n.value)?{required:!0}:null}function zpe(n){return n.value===!0?null:{required:!0}}function Gpe(n){return dN(n.value)||jpe.test(n.value)?null:{email:!0}}function Zpe(n){return e=>{let t=e.value?.length??pN(e.value);return t===null||t===0?null:t{let t=e.value?.length??pN(e.value);return t!==null&&t>n?{maxlength:{requiredLength:n,actualLength:t}}:null}}function Xpe(n){if(!n)return sN;let e,t;return typeof n=="string"?(t="",n.charAt(0)!=="^"&&(t+="^"),t+=n,n.charAt(n.length-1)!=="$"&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),r=>{if(dN(r.value))return null;let s=r.value;return e.test(s)?null:{pattern:{requiredPattern:t,actualValue:s}}}}function sN(n){return null}function UU(n){return n!=null}function qU(n){return Wu(n)?YI(n):n}function WU(n){let e={};return n.forEach(t=>{e=t!=null?{...e,...t}:e}),Object.keys(e).length===0?null:e}function zU(n,e){return e.map(t=>t(n))}function Qpe(n){return!n.validate}function GU(n){return n.map(e=>Qpe(e)?e:t=>e.validate(t))}function Kpe(n){if(!n)return null;let e=n.filter(UU);return e.length==0?null:function(t){return WU(zU(t,e))}}function fN(n){return n!=null?Kpe(GU(n)):null}function Jpe(n){if(!n)return null;let e=n.filter(UU);return e.length==0?null:function(t){let r=zU(t,e).map(qU);return XI(r).pipe(tu(WU))}}function hN(n){return n!=null?Jpe(GU(n)):null}function kU(n,e){return n===null?[e]:Array.isArray(n)?[...n,e]:[n,e]}function ZU(n){return n._rawValidators}function YU(n){return n._rawAsyncValidators}function iN(n){return n?Array.isArray(n)?n:[n]:[]}function SC(n,e){return Array.isArray(n)?n.includes(e):n===e}function AU(n,e){let t=iN(e);return iN(n).forEach(s=>{SC(t,s)||t.push(s)}),t}function MU(n,e){return iN(e).filter(t=>!SC(n,t))}var CC=class{constructor(){l(this,"_composedValidatorFn");l(this,"_composedAsyncValidatorFn");l(this,"_rawValidators",[]);l(this,"_rawAsyncValidators",[]);l(this,"_onDestroyCallbacks",[])}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=fN(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=hN(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,t){return this.control?this.control.hasError(e,t):!1}getError(e,t){return this.control?this.control.getError(e,t):null}},zn=class extends CC{constructor(){super(...arguments);l(this,"name")}get formDirective(){return null}get path(){return null}},go=class extends CC{constructor(){super(...arguments);l(this,"_parent",null);l(this,"name",null);l(this,"valueAccessor",null)}},TC=class{constructor(e){l(this,"_cd");this._cd=e}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},XU={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},efe={...XU,"[class.ng-submitted]":"isSubmitted"},dm=class dm extends TC{constructor(e){super(e)}};l(dm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:dm,deps:[{token:go,self:!0}],target:Se.Directive})),l(dm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:dm,isStandalone:!1,selector:"[formControlName],[ngModel],[formControl]",host:{properties:{"class.ng-untouched":"isUntouched","class.ng-touched":"isTouched","class.ng-pristine":"isPristine","class.ng-dirty":"isDirty","class.ng-valid":"isValid","class.ng-invalid":"isInvalid","class.ng-pending":"isPending"}},usesInheritance:!0,ngImport:k}));var Bm=dm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Bm,decorators:[{type:ht,args:[{selector:"[formControlName],[ngModel],[formControl]",host:XU,standalone:!1}]}],ctorParameters:()=>[{type:go,decorators:[{type:$n}]}]});var pm=class pm extends TC{constructor(e){super(e)}};l(pm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:pm,deps:[{token:zn,optional:!0,self:!0}],target:Se.Directive})),l(pm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:pm,isStandalone:!1,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",host:{properties:{"class.ng-untouched":"isUntouched","class.ng-touched":"isTouched","class.ng-pristine":"isPristine","class.ng-dirty":"isDirty","class.ng-valid":"isValid","class.ng-invalid":"isInvalid","class.ng-pending":"isPending","class.ng-submitted":"isSubmitted"}},usesInheritance:!0,ngImport:k}));var Vm=pm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Vm,decorators:[{type:ht,args:[{selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",host:efe,standalone:!1}]}],ctorParameters:()=>[{type:zn,decorators:[{type:st},{type:$n}]}]});var vb="VALID",xC="INVALID",im="PENDING",yb="DISABLED",dc=class{},DC=class extends dc{constructor(t,r){super();l(this,"value");l(this,"source");this.value=t,this.source=r}},wb=class extends dc{constructor(t,r){super();l(this,"pristine");l(this,"source");this.pristine=t,this.source=r}},Eb=class extends dc{constructor(t,r){super();l(this,"touched");l(this,"source");this.touched=t,this.source=r}},om=class extends dc{constructor(t,r){super();l(this,"status");l(this,"source");this.status=t,this.source=r}},IC=class extends dc{constructor(t){super();l(this,"source");this.source=t}},_C=class extends dc{constructor(t){super();l(this,"source");this.source=t}};function mN(n){return(NC(n)?n.validators:n)||null}function tfe(n){return Array.isArray(n)?fN(n):n||null}function gN(n,e){return(NC(e)?e.asyncValidators:n)||null}function nfe(n){return Array.isArray(n)?hN(n):n||null}function NC(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function QU(n,e,t){let r=n.controls;if(!(e?Object.keys(r):r).length)throw new Pe(1e3,"");if(!r[t])throw new Pe(1001,"")}function KU(n,e,t){n._forEachChild((r,s)=>{if(t[s]===void 0)throw new Pe(1002,"")})}var $m=class{constructor(e,t){l(this,"_pendingDirty",!1);l(this,"_hasOwnPendingAsyncValidator",null);l(this,"_pendingTouched",!1);l(this,"_onCollectionChange",()=>{});l(this,"_updateOn");l(this,"_parent",null);l(this,"_asyncValidationSubscription");l(this,"_composedValidatorFn");l(this,"_composedAsyncValidatorFn");l(this,"_rawValidators");l(this,"_rawAsyncValidators");l(this,"value");l(this,"_status",Xi(()=>this.statusReactive()));l(this,"statusReactive",Di(void 0));l(this,"errors");l(this,"_pristine",Xi(()=>this.pristineReactive()));l(this,"pristineReactive",Di(!0));l(this,"_touched",Xi(()=>this.touchedReactive()));l(this,"touchedReactive",Di(!1));l(this,"_events",new _s);l(this,"events",this._events.asObservable());l(this,"valueChanges");l(this,"statusChanges");l(this,"_onDisabledChange",[]);this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return Un(this.statusReactive)}set status(e){Un(()=>this.statusReactive.set(e))}get valid(){return this.status===vb}get invalid(){return this.status===xC}get pending(){return this.status==im}get disabled(){return this.status===yb}get enabled(){return this.status!==yb}get pristine(){return Un(this.pristineReactive)}set pristine(e){Un(()=>this.pristineReactive.set(e))}get dirty(){return!this.pristine}get touched(){return Un(this.touchedReactive)}set touched(e){Un(()=>this.touchedReactive.set(e))}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(AU(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(AU(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(MU(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(MU(e,this._rawAsyncValidators))}hasValidator(e){return SC(this._rawValidators,e)}hasAsyncValidator(e){return SC(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){let t=this.touched===!1;this.touched=!0;let r=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsTouched({...e,sourceControl:r}),t&&e.emitEvent!==!1&&this._events.next(new Eb(!0,r))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let r=e.sourceControl??this;this._forEachChild(s=>{s.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:r})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,r),t&&e.emitEvent!==!1&&this._events.next(new Eb(!1,r))}markAsDirty(e={}){let t=this.pristine===!0;this.pristine=!1;let r=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsDirty({...e,sourceControl:r}),t&&e.emitEvent!==!1&&this._events.next(new wb(!1,r))}markAsPristine(e={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let r=e.sourceControl??this;this._forEachChild(s=>{s.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e,r),t&&e.emitEvent!==!1&&this._events.next(new wb(!0,r))}markAsPending(e={}){this.status=im;let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new om(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.markAsPending({...e,sourceControl:t})}disable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=yb,this.errors=null,this._forEachChild(s=>{s.disable({...e,onlySelf:!0})}),this._updateValue();let r=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new DC(this.value,r)),this._events.next(new om(this.status,r)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...e,skipPristineCheck:t},this),this._onDisabledChange.forEach(s=>s(!0))}enable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=vb,this._forEachChild(r=>{r.enable({...e,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors({...e,skipPristineCheck:t},this),this._onDisabledChange.forEach(r=>r(!1))}_updateAncestors(e,t){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine({},t),this._parent._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let r=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===vb||this.status===im)&&this._runAsyncValidator(r,e.emitEvent)}let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new DC(this.value,t)),this._events.next(new om(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity({...e,sourceControl:t})}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?yb:vb}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=im,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1};let r=qU(this.asyncValidator(this));this._asyncValidationSubscription=r.subscribe(s=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(s,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let e=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(e){let t=e;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((r,s)=>r&&r._find(s),this)}getError(e,t){let r=t?this.get(t):this;return r&&r.errors?r.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,r){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||r)&&this._events.next(new om(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,r)}_initObservables(){this.valueChanges=new jr,this.statusChanges=new jr}_calculateStatus(){return this._allControlsDisabled()?yb:this.errors?xC:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(im)?im:this._anyControlsHaveStatus(xC)?xC:vb}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){let r=!this._anyControlsDirty(),s=this.pristine!==r;this.pristine=r,this._parent&&!e.onlySelf&&this._parent._updatePristine(e,t),s&&this._events.next(new wb(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new Eb(this.touched,t)),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,t)}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){NC(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){let t=this._parent&&this._parent.dirty;return!e&&!!t&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=tfe(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=nfe(this._rawAsyncValidators)}},Hm=class extends $m{constructor(t,r,s){super(mN(r),gN(s,r));l(this,"controls");this.controls=t,this._initObservables(),this._setUpdateStrategy(r),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(t,r){return this.controls[t]?this.controls[t]:(this.controls[t]=r,r.setParent(this),r._registerOnCollectionChange(this._onCollectionChange),r)}addControl(t,r,s={}){this.registerControl(t,r),this.updateValueAndValidity({emitEvent:s.emitEvent}),this._onCollectionChange()}removeControl(t,r={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}setControl(t,r,s={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],r&&this.registerControl(t,r),this.updateValueAndValidity({emitEvent:s.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,r={}){KU(this,!0,t),Object.keys(t).forEach(s=>{QU(this,!0,s),this.controls[s].setValue(t[s],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r)}patchValue(t,r={}){t!=null&&(Object.keys(t).forEach(s=>{let i=this.controls[s];i&&i.patchValue(t[s],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r))}reset(t={},r={}){this._forEachChild((s,i)=>{s.reset(t?t[i]:null,{onlySelf:!0,emitEvent:r.emitEvent})}),this._updatePristine(r,this),this._updateTouched(r,this),this.updateValueAndValidity(r)}getRawValue(){return this._reduceChildren({},(t,r,s)=>(t[s]=r.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(r,s)=>s._syncPendingControls()?!0:r);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(r=>{let s=this.controls[r];s&&t(s,r)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[r,s]of Object.entries(this.controls))if(this.contains(r)&&t(s))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(r,s,i)=>((s.enabled||this.disabled)&&(r[i]=s.value),r))}_reduceChildren(t,r){let s=t;return this._forEachChild((i,o)=>{s=r(s,i,o)}),s}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var oN=class extends Hm{};var vo=new $e("",{providedIn:"root",factory:()=>Ib}),Ib="always";function PC(n,e){return[...e.path,n]}function Cb(n,e,t=Ib){vN(n,e),e.valueAccessor.writeValue(n.value),(n.disabled||t==="always")&&e.valueAccessor.setDisabledState?.(n.disabled),sfe(n,e),ofe(n,e),ife(n,e),rfe(n,e)}function kC(n,e,t=!0){let r=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(r),e.valueAccessor.registerOnTouched(r)),MC(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function AC(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function rfe(n,e){if(e.valueAccessor.setDisabledState){let t=r=>{e.valueAccessor.setDisabledState(r)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}function vN(n,e){let t=ZU(n);e.validator!==null?n.setValidators(kU(t,e.validator)):typeof t=="function"&&n.setValidators([t]);let r=YU(n);e.asyncValidator!==null?n.setAsyncValidators(kU(r,e.asyncValidator)):typeof r=="function"&&n.setAsyncValidators([r]);let s=()=>n.updateValueAndValidity();AC(e._rawValidators,s),AC(e._rawAsyncValidators,s)}function MC(n,e){let t=!1;if(n!==null){if(e.validator!==null){let s=ZU(n);if(Array.isArray(s)&&s.length>0){let i=s.filter(o=>o!==e.validator);i.length!==s.length&&(t=!0,n.setValidators(i))}}if(e.asyncValidator!==null){let s=YU(n);if(Array.isArray(s)&&s.length>0){let i=s.filter(o=>o!==e.asyncValidator);i.length!==s.length&&(t=!0,n.setAsyncValidators(i))}}}let r=()=>{};return AC(e._rawValidators,r),AC(e._rawAsyncValidators,r),t}function sfe(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&JU(n,e)})}function ife(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&JU(n,e),n.updateOn!=="submit"&&n.markAsTouched()})}function JU(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function ofe(n,e){let t=(r,s)=>{e.valueAccessor.writeValue(r),s&&e.viewToModelUpdate(r)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}function e6(n,e){n==null,vN(n,e)}function afe(n,e){return MC(n,e)}function yN(n,e){if(!n.hasOwnProperty("model"))return!1;let t=n.model;return t.isFirstChange()?!0:!Object.is(e,t.currentValue)}function lfe(n){return Object.getPrototypeOf(n.constructor)===ra}function t6(n,e){n._syncPendingControls(),e.forEach(t=>{let r=t.control;r.updateOn==="submit"&&r._pendingChange&&(t.viewToModelUpdate(r._pendingValue),r._pendingChange=!1)})}function bN(n,e){if(!e)return null;Array.isArray(e);let t,r,s;return e.forEach(i=>{i.constructor===uc?t=i:lfe(i)?r=i:s=i}),s||r||t||null}function cfe(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}var n6={provide:zn,useExisting:cn(()=>pc)},bb=Promise.resolve(),fm=class fm extends zn{constructor(t,r,s){super();l(this,"callSetDisabledState");l(this,"_submitted",Xi(()=>this.submittedReactive()));l(this,"submittedReactive",Di(!1));l(this,"_directives",new Set);l(this,"form");l(this,"ngSubmit",new jr);l(this,"options");this.callSetDisabledState=s,this.form=new Hm({},fN(t),hN(r))}get submitted(){return Un(this.submittedReactive)}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){bb.then(()=>{let r=this._findContainer(t.path);t.control=r.registerControl(t.name,t.control),Cb(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){bb.then(()=>{let r=this._findContainer(t.path);r&&r.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){bb.then(()=>{let r=this._findContainer(t.path),s=new Hm({});e6(s,t),r.registerControl(t.name,s),s.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){bb.then(()=>{let r=this._findContainer(t.path);r&&r.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,r){bb.then(()=>{this.form.get(t.path).setValue(r)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submittedReactive.set(!0),t6(this.form,this._directives),this.ngSubmit.emit(t),this.form._events.next(new IC(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submittedReactive.set(!1),this.form._events.next(new _C(this.form))}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}};l(fm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:fm,deps:[{token:Hn,optional:!0,self:!0},{token:is,optional:!0,self:!0},{token:vo,optional:!0}],target:Se.Directive})),l(fm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:fm,isStandalone:!1,selector:"form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]",inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},host:{listeners:{submit:"onSubmit($event)",reset:"onReset()"}},providers:[n6],exportAs:["ngForm"],usesInheritance:!0,ngImport:k}));var pc=fm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:pc,decorators:[{type:ht,args:[{selector:"form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]",providers:[n6],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},outputs:["ngSubmit"],exportAs:"ngForm",standalone:!1}]}],ctorParameters:()=>[{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[Hn]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[is]}]},{type:void 0,decorators:[{type:st},{type:Ke,args:[vo]}]}],propDecorators:{options:[{type:ze,args:["ngFormOptions"]}]}});function NU(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function PU(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var xb=class extends $m{constructor(t=null,r,s){super(mN(r),gN(s,r));l(this,"defaultValue",null);l(this,"_onChange",[]);l(this,"_pendingValue");l(this,"_pendingChange",!1);this._applyFormState(t),this._setUpdateStrategy(r),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),NC(r)&&(r.nonNullable||r.initialValueIsDefault)&&(PU(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,r={}){this.value=this._pendingValue=t,this._onChange.length&&r.emitModelToViewChange!==!1&&this._onChange.forEach(s=>s(this.value,r.emitViewToModelChange!==!1)),this.updateValueAndValidity(r)}patchValue(t,r={}){this.setValue(t,r)}reset(t=this.defaultValue,r={}){this._applyFormState(t),this.markAsPristine(r),this.markAsUntouched(r),this.setValue(this.value,r),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){NU(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){NU(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){PU(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var ufe=n=>n instanceof xb,hm=class hm extends zn{constructor(){super(...arguments);l(this,"_parent")}ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormGroup(this)}get control(){return this.formDirective.getFormGroup(this)}get path(){return PC(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}};l(hm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:hm,deps:null,target:Se.Directive})),l(hm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:hm,isStandalone:!1,usesInheritance:!0,ngImport:k}));var Tb=hm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Tb,decorators:[{type:ht,args:[{standalone:!1}]}]});var r6={provide:zn,useExisting:cn(()=>Fd)},kd=class kd extends Tb{constructor(t,r,s){super();l(this,"name","");this._parent=t,this._setValidators(r),this._setAsyncValidators(s)}_checkParentType(){!(this._parent instanceof kd)&&this._parent instanceof pc}};l(kd,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:kd,deps:[{token:zn,host:!0,skipSelf:!0},{token:Hn,optional:!0,self:!0},{token:is,optional:!0,self:!0}],target:Se.Directive})),l(kd,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:kd,isStandalone:!1,selector:"[ngModelGroup]",inputs:{name:["ngModelGroup","name"]},providers:[r6],exportAs:["ngModelGroup"],usesInheritance:!0,ngImport:k}));var Fd=kd;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Fd,decorators:[{type:ht,args:[{selector:"[ngModelGroup]",providers:[r6],exportAs:"ngModelGroup",standalone:!1}]}],ctorParameters:()=>[{type:zn,decorators:[{type:Ns},{type:La}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[Hn]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[is]}]}],propDecorators:{name:[{type:ze,args:["ngModelGroup"]}]}});var s6={provide:go,useExisting:cn(()=>Ld)},RU=Promise.resolve(),Ad=class Ad extends go{constructor(t,r,s,i,o,a){super();l(this,"_changeDetectorRef");l(this,"callSetDisabledState");l(this,"control",new xb);l(this,"_registered",!1);l(this,"viewModel");l(this,"name","");l(this,"isDisabled");l(this,"model");l(this,"options");l(this,"update",new jr);this._changeDetectorRef=o,this.callSetDisabledState=a,this._parent=t,this._setValidators(r),this._setAsyncValidators(s),this.valueAccessor=bN(this,i)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let r=t.name.previousValue;this.formDirective.removeControl({name:r,path:this._getPath(r)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),yN(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Cb(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){RU.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let r=t.isDisabled.currentValue,s=r!==0&&ei(r);RU.then(()=>{s&&!this.control.disabled?this.control.disable():!s&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?PC(t,this._parent):[t]}};l(Ad,"ngAcceptInputType_isDisabled"),l(Ad,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ad,deps:[{token:zn,host:!0,optional:!0},{token:Hn,optional:!0,self:!0},{token:is,optional:!0,self:!0},{token:ni,optional:!0,self:!0},{token:bn,optional:!0},{token:vo,optional:!0}],target:Se.Directive})),l(Ad,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Ad,isStandalone:!1,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},providers:[s6],exportAs:["ngModel"],usesInheritance:!0,usesOnChanges:!0,ngImport:k}));var Ld=Ad;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ld,decorators:[{type:ht,args:[{selector:"[ngModel]:not([formControlName]):not([formControl])",providers:[s6],exportAs:"ngModel",standalone:!1}]}],ctorParameters:()=>[{type:zn,decorators:[{type:st},{type:Ns}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[Hn]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[is]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[ni]}]},{type:bn,decorators:[{type:st},{type:Ke,args:[bn]}]},{type:void 0,decorators:[{type:st},{type:Ke,args:[vo]}]}],propDecorators:{name:[{type:ze}],isDisabled:[{type:ze,args:["disabled"]}],model:[{type:ze,args:["ngModel"]}],options:[{type:ze,args:["ngModelOptions"]}],update:[{type:mh,args:["ngModelChange"]}]}});var mm=class mm{};l(mm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:mm,deps:[],target:Se.Directive})),l(mm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:mm,isStandalone:!1,selector:"form:not([ngNoForm]):not([ngNativeValidate])",host:{attributes:{novalidate:""}},ngImport:k}));var jm=mm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:jm,decorators:[{type:ht,args:[{selector:"form:not([ngNoForm]):not([ngNativeValidate])",host:{novalidate:""},standalone:!1}]}]});var i6={provide:ni,useExisting:cn(()=>Od),multi:!0},gm=class gm extends ra{writeValue(e){let t=e??"";this.setProperty("value",t)}registerOnChange(e){this.onChange=t=>{e(t==""?null:parseFloat(t))}}};l(gm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:gm,deps:null,target:Se.Directive})),l(gm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:gm,isStandalone:!1,selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",host:{listeners:{input:"onChange($event.target.value)",blur:"onTouched()"}},providers:[i6],usesInheritance:!0,ngImport:k}));var Od=gm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Od,decorators:[{type:ht,args:[{selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",host:{"(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[i6],standalone:!1}]}]});var o6={provide:ni,useExisting:cn(()=>Bd),multi:!0};var vm=class vm{constructor(){l(this,"_accessors",[])}add(e,t){this._accessors.push([e,t])}remove(e){for(let t=this._accessors.length-1;t>=0;--t)if(this._accessors[t][1]===e){this._accessors.splice(t,1);return}}select(e){this._accessors.forEach(t=>{this._isSameGroup(t,e)&&t[1]!==e&&t[1].fireUncheck(e.value)})}_isSameGroup(e,t){return e[0].control?e[0]._parent===t._control._parent&&e[1].name===t.name:!1}};l(vm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:vm,deps:[],target:Se.Injectable})),l(vm,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:vm,providedIn:"root"}));var Db=vm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Db,decorators:[{type:zt,args:[{providedIn:"root"}]}]});var ym=class ym extends ra{constructor(t,r,s,i){super(t,r);l(this,"_registry");l(this,"_injector");l(this,"_state");l(this,"_control");l(this,"_fn");l(this,"setDisabledStateFired",!1);l(this,"onChange",()=>{});l(this,"name");l(this,"formControlName");l(this,"value");l(this,"callSetDisabledState",ye(vo,{optional:!0})??Ib);this._registry=s,this._injector=i}ngOnInit(){this._control=this._injector.get(go),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(t){this._state=t===this.value,this.setProperty("checked",this._state)}registerOnChange(t){this._fn=t,this.onChange=()=>{t(this.value),this._registry.select(this)}}setDisabledState(t){(this.setDisabledStateFired||t||this.callSetDisabledState==="whenDisabledForLegacyCode")&&this.setProperty("disabled",t),this.setDisabledStateFired=!0}fireUncheck(t){this.writeValue(t)}_checkName(){this.name&&this.formControlName&&(this.name,this.formControlName),!this.name&&this.formControlName&&(this.name=this.formControlName)}};l(ym,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:ym,deps:[{token:Qn},{token:en},{token:Db},{token:In}],target:Se.Directive})),l(ym,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:ym,isStandalone:!1,selector:"input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",inputs:{name:"name",formControlName:"formControlName",value:"value"},host:{listeners:{change:"onChange()",blur:"onTouched()"}},providers:[o6],usesInheritance:!0,ngImport:k}));var Bd=ym;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Bd,decorators:[{type:ht,args:[{selector:"input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",host:{"(change)":"onChange()","(blur)":"onTouched()"},providers:[o6],standalone:!1}]}],ctorParameters:()=>[{type:Qn},{type:en},{type:Db},{type:In}],propDecorators:{name:[{type:ze}],formControlName:[{type:ze}],value:[{type:ze}]}});var a6={provide:ni,useExisting:cn(()=>Vd),multi:!0},bm=class bm extends ra{writeValue(e){this.setProperty("value",parseFloat(e))}registerOnChange(e){this.onChange=t=>{e(t==""?null:parseFloat(t))}}};l(bm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:bm,deps:null,target:Se.Directive})),l(bm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:bm,isStandalone:!1,selector:"input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]",host:{listeners:{change:"onChange($event.target.value)",input:"onChange($event.target.value)",blur:"onTouched()"}},providers:[a6],usesInheritance:!0,ngImport:k}));var Vd=bm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Vd,decorators:[{type:ht,args:[{selector:"input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[a6],standalone:!1}]}]});var _b=new $e(""),l6={provide:go,useExisting:cn(()=>$d)},Md=class Md extends go{constructor(t,r,s,i,o){super();l(this,"_ngModelWarningConfig");l(this,"callSetDisabledState");l(this,"viewModel");l(this,"form");l(this,"model");l(this,"update",new jr);l(this,"_ngModelWarningSent",!1);this._ngModelWarningConfig=i,this.callSetDisabledState=o,this._setValidators(t),this._setAsyncValidators(r),this.valueAccessor=bN(this,s)}set isDisabled(t){}ngOnChanges(t){if(this._isControlChanged(t)){let r=t.form.previousValue;r&&kC(r,this,!1),Cb(this.form,this,this.callSetDisabledState),this.form.updateValueAndValidity({emitEvent:!1})}yN(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&kC(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_isControlChanged(t){return t.hasOwnProperty("form")}};l(Md,"_ngModelWarningSentOnce",!1),l(Md,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Md,deps:[{token:Hn,optional:!0,self:!0},{token:is,optional:!0,self:!0},{token:ni,optional:!0,self:!0},{token:_b,optional:!0},{token:vo,optional:!0}],target:Se.Directive})),l(Md,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Md,isStandalone:!1,selector:"[formControl]",inputs:{form:["formControl","form"],isDisabled:["disabled","isDisabled"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},providers:[l6],exportAs:["ngForm"],usesInheritance:!0,usesOnChanges:!0,ngImport:k}));var $d=Md;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:$d,decorators:[{type:ht,args:[{selector:"[formControl]",providers:[l6],exportAs:"ngForm",standalone:!1}]}],ctorParameters:()=>[{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[Hn]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[is]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[ni]}]},{type:void 0,decorators:[{type:st},{type:Ke,args:[_b]}]},{type:void 0,decorators:[{type:st},{type:Ke,args:[vo]}]}],propDecorators:{form:[{type:ze,args:["formControl"]}],isDisabled:[{type:ze,args:["disabled"]}],model:[{type:ze,args:["ngModel"]}],update:[{type:mh,args:["ngModelChange"]}]}});var c6={provide:zn,useExisting:cn(()=>fc)},wm=class wm extends zn{constructor(t,r,s){super();l(this,"callSetDisabledState");l(this,"_submitted",Xi(()=>this._submittedReactive()));l(this,"_submittedReactive",Di(!1));l(this,"_oldForm");l(this,"_onCollectionChange",()=>this._updateDomValue());l(this,"directives",[]);l(this,"form",null);l(this,"ngSubmit",new jr);this.callSetDisabledState=s,this._setValidators(t),this._setAsyncValidators(r)}get submitted(){return Un(this._submittedReactive)}set submitted(t){this._submittedReactive.set(t)}ngOnChanges(t){t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(MC(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){let r=this.form.get(t.path);return Cb(r,t,this.callSetDisabledState),r.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),r}getControl(t){return this.form.get(t.path)}removeControl(t){kC(t.control||null,t,!1),cfe(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,r){this.form.get(t.path).setValue(r)}onSubmit(t){return this._submittedReactive.set(!0),t6(this.form,this.directives),this.ngSubmit.emit(t),this.form._events.next(new IC(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this._submittedReactive.set(!1),this.form._events.next(new _C(this.form))}_updateDomValue(){this.directives.forEach(t=>{let r=t.control,s=this.form.get(t.path);r!==s&&(kC(r||null,t),ufe(s)&&(Cb(s,t,this.callSetDisabledState),t.control=s))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){let r=this.form.get(t.path);e6(r,t),r.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){let r=this.form.get(t.path);r&&afe(r,t)&&r.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){vN(this.form,this),this._oldForm&&MC(this._oldForm,this)}};l(wm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:wm,deps:[{token:Hn,optional:!0,self:!0},{token:is,optional:!0,self:!0},{token:vo,optional:!0}],target:Se.Directive})),l(wm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:wm,isStandalone:!1,selector:"[formGroup]",inputs:{form:["formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},host:{listeners:{submit:"onSubmit($event)",reset:"onReset()"}},providers:[c6],exportAs:["ngForm"],usesInheritance:!0,usesOnChanges:!0,ngImport:k}));var fc=wm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:fc,decorators:[{type:ht,args:[{selector:"[formGroup]",providers:[c6],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},exportAs:"ngForm",standalone:!1}]}],ctorParameters:()=>[{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[Hn]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[is]}]},{type:void 0,decorators:[{type:st},{type:Ke,args:[vo]}]}],propDecorators:{form:[{type:ze,args:["formGroup"]}],ngSubmit:[{type:mh}]}});var u6={provide:zn,useExisting:cn(()=>hc)},Em=class Em extends Tb{constructor(t,r,s){super();l(this,"name",null);this._parent=t,this._setValidators(r),this._setAsyncValidators(s)}_checkParentType(){p6(this._parent)}};l(Em,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Em,deps:[{token:zn,host:!0,optional:!0,skipSelf:!0},{token:Hn,optional:!0,self:!0},{token:is,optional:!0,self:!0}],target:Se.Directive})),l(Em,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Em,isStandalone:!1,selector:"[formGroupName]",inputs:{name:["formGroupName","name"]},providers:[u6],usesInheritance:!0,ngImport:k}));var hc=Em;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:hc,decorators:[{type:ht,args:[{selector:"[formGroupName]",providers:[u6],standalone:!1}]}],ctorParameters:()=>[{type:zn,decorators:[{type:st},{type:Ns},{type:La}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[Hn]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[is]}]}],propDecorators:{name:[{type:ze,args:["formGroupName"]}]}});var d6={provide:zn,useExisting:cn(()=>mc)},xm=class xm extends zn{constructor(t,r,s){super();l(this,"_parent");l(this,"name",null);this._parent=t,this._setValidators(r),this._setAsyncValidators(s)}ngOnInit(){p6(this._parent),this.formDirective.addFormArray(this)}ngOnDestroy(){this.formDirective?.removeFormArray(this)}get control(){return this.formDirective.getFormArray(this)}get formDirective(){return this._parent?this._parent.formDirective:null}get path(){return PC(this.name==null?this.name:this.name.toString(),this._parent)}};l(xm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:xm,deps:[{token:zn,host:!0,optional:!0,skipSelf:!0},{token:Hn,optional:!0,self:!0},{token:is,optional:!0,self:!0}],target:Se.Directive})),l(xm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:xm,isStandalone:!1,selector:"[formArrayName]",inputs:{name:["formArrayName","name"]},providers:[d6],usesInheritance:!0,ngImport:k}));var mc=xm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:mc,decorators:[{type:ht,args:[{selector:"[formArrayName]",providers:[d6],standalone:!1}]}],ctorParameters:()=>[{type:zn,decorators:[{type:st},{type:Ns},{type:La}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[Hn]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[is]}]}],propDecorators:{name:[{type:ze,args:["formArrayName"]}]}});function p6(n){return!(n instanceof hc)&&!(n instanceof fc)&&!(n instanceof mc)}var f6={provide:go,useExisting:cn(()=>Hd)},Nd=class Nd extends go{constructor(t,r,s,i,o){super();l(this,"_ngModelWarningConfig");l(this,"_added",!1);l(this,"viewModel");l(this,"control");l(this,"name",null);l(this,"model");l(this,"update",new jr);l(this,"_ngModelWarningSent",!1);this._ngModelWarningConfig=o,this._parent=t,this._setValidators(r),this._setAsyncValidators(s),this.valueAccessor=bN(this,i)}set isDisabled(t){}ngOnChanges(t){this._added||this._setUpControl(),yN(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return PC(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_setUpControl(){this.control=this.formDirective.addControl(this),this._added=!0}};l(Nd,"_ngModelWarningSentOnce",!1),l(Nd,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Nd,deps:[{token:zn,host:!0,optional:!0,skipSelf:!0},{token:Hn,optional:!0,self:!0},{token:is,optional:!0,self:!0},{token:ni,optional:!0,self:!0},{token:_b,optional:!0}],target:Se.Directive})),l(Nd,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Nd,isStandalone:!1,selector:"[formControlName]",inputs:{name:["formControlName","name"],isDisabled:["disabled","isDisabled"],model:["ngModel","model"]},outputs:{update:"ngModelChange"},providers:[f6],usesInheritance:!0,usesOnChanges:!0,ngImport:k}));var Hd=Nd;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Hd,decorators:[{type:ht,args:[{selector:"[formControlName]",providers:[f6],standalone:!1}]}],ctorParameters:()=>[{type:zn,decorators:[{type:st},{type:Ns},{type:La}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[Hn]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[is]}]},{type:void 0,decorators:[{type:st},{type:$n},{type:Ke,args:[ni]}]},{type:void 0,decorators:[{type:st},{type:Ke,args:[_b]}]}],propDecorators:{name:[{type:ze,args:["formControlName"]}],isDisabled:[{type:ze,args:["disabled"]}],model:[{type:ze,args:["ngModel"]}],update:[{type:mh,args:["ngModelChange"]}]}});var h6={provide:ni,useExisting:cn(()=>Xa),multi:!0};function m6(n,e){return n==null?`${e}`:(e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function dfe(n){return n.split(":")[0]}var Sm=class Sm extends ra{constructor(){super(...arguments);l(this,"value");l(this,"_optionMap",new Map);l(this,"_idCounter",0);l(this,"_compareWith",Object.is)}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;let r=this._getOptionId(t),s=m6(r,t);this.setProperty("value",s)}registerOnChange(t){this.onChange=r=>{this.value=this._getOptionValue(r),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(let r of this._optionMap.keys())if(this._compareWith(this._optionMap.get(r),t))return r;return null}_getOptionValue(t){let r=dfe(t);return this._optionMap.has(r)?this._optionMap.get(r):t}};l(Sm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Sm,deps:null,target:Se.Directive})),l(Sm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Sm,isStandalone:!1,selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",inputs:{compareWith:"compareWith"},host:{listeners:{change:"onChange($event.target.value)",blur:"onTouched()"}},providers:[h6],usesInheritance:!0,ngImport:k}));var Xa=Sm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Xa,decorators:[{type:ht,args:[{selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",host:{"(change)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[h6],standalone:!1}]}],propDecorators:{compareWith:[{type:ze}]}});var Cm=class Cm{constructor(e,t,r){l(this,"_element");l(this,"_renderer");l(this,"_select");l(this,"id");this._element=e,this._renderer=t,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(m6(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._setElementValue(e),this._select&&this._select.writeValue(this._select.value)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}};l(Cm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Cm,deps:[{token:en},{token:Qn},{token:Xa,host:!0,optional:!0}],target:Se.Directive})),l(Cm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Cm,isStandalone:!1,selector:"option",inputs:{ngValue:"ngValue",value:"value"},ngImport:k}));var Um=Cm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Um,decorators:[{type:ht,args:[{selector:"option",standalone:!1}]}],ctorParameters:()=>[{type:en},{type:Qn},{type:Xa,decorators:[{type:st},{type:Ns}]}],propDecorators:{ngValue:[{type:ze,args:["ngValue"]}],value:[{type:ze,args:["value"]}]}});var g6={provide:ni,useExisting:cn(()=>Qa),multi:!0};function FU(n,e){return n==null?`${e}`:(typeof e=="string"&&(e=`'${e}'`),e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function pfe(n){return n.split(":")[0]}var Tm=class Tm extends ra{constructor(){super(...arguments);l(this,"value");l(this,"_optionMap",new Map);l(this,"_idCounter",0);l(this,"_compareWith",Object.is)}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;let r;if(Array.isArray(t)){let s=t.map(i=>this._getOptionId(i));r=(i,o)=>{i._setSelected(s.indexOf(o.toString())>-1)}}else r=(s,i)=>{s._setSelected(!1)};this._optionMap.forEach(r)}registerOnChange(t){this.onChange=r=>{let s=[],i=r.selectedOptions;if(i!==void 0){let o=i;for(let a=0;a[{type:en},{type:Qn},{type:Qa,decorators:[{type:st},{type:Ns}]}],propDecorators:{ngValue:[{type:ze,args:["ngValue"]}],value:[{type:ze,args:["value"]}]}});function v6(n){return typeof n=="number"?n:parseInt(n,10)}function y6(n){return typeof n=="number"?n:parseFloat(n)}var Im=class Im{constructor(){l(this,"_validator",sN);l(this,"_onChange");l(this,"_enabled")}ngOnChanges(e){if(this.inputName in e){let t=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(t),this._validator=this._enabled?this.createValidator(t):sN,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}};l(Im,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Im,deps:[],target:Se.Directive})),l(Im,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Im,isStandalone:!0,usesOnChanges:!0,ngImport:k}));var sa=Im;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:sa,decorators:[{type:ht}]});var b6={provide:Hn,useExisting:cn(()=>jd),multi:!0},_m=class _m extends sa{constructor(){super(...arguments);l(this,"max");l(this,"inputName","max");l(this,"normalizeInput",t=>y6(t));l(this,"createValidator",t=>qpe(t))}};l(_m,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:_m,deps:null,target:Se.Directive})),l(_m,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:_m,isStandalone:!1,selector:"input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",inputs:{max:"max"},host:{properties:{"attr.max":"_enabled ? max : null"}},providers:[b6],usesInheritance:!0,ngImport:k}));var jd=_m;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:jd,decorators:[{type:ht,args:[{selector:"input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",providers:[b6],host:{"[attr.max]":"_enabled ? max : null"},standalone:!1}]}],propDecorators:{max:[{type:ze}]}});var w6={provide:Hn,useExisting:cn(()=>Ud),multi:!0},km=class km extends sa{constructor(){super(...arguments);l(this,"min");l(this,"inputName","min");l(this,"normalizeInput",t=>y6(t));l(this,"createValidator",t=>Upe(t))}};l(km,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:km,deps:null,target:Se.Directive})),l(km,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:km,isStandalone:!1,selector:"input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",inputs:{min:"min"},host:{properties:{"attr.min":"_enabled ? min : null"}},providers:[w6],usesInheritance:!0,ngImport:k}));var Ud=km;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ud,decorators:[{type:ht,args:[{selector:"input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",providers:[w6],host:{"[attr.min]":"_enabled ? min : null"},standalone:!1}]}],propDecorators:{min:[{type:ze}]}});var E6={provide:Hn,useExisting:cn(()=>gc),multi:!0},x6={provide:Hn,useExisting:cn(()=>qd),multi:!0},Am=class Am extends sa{constructor(){super(...arguments);l(this,"required");l(this,"inputName","required");l(this,"normalizeInput",ei);l(this,"createValidator",t=>Wpe)}enabled(t){return t}};l(Am,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Am,deps:null,target:Se.Directive})),l(Am,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Am,isStandalone:!1,selector:":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",inputs:{required:"required"},host:{properties:{"attr.required":'_enabled ? "" : null'}},providers:[E6],usesInheritance:!0,ngImport:k}));var gc=Am;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:gc,decorators:[{type:ht,args:[{selector:":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",providers:[E6],host:{"[attr.required]":'_enabled ? "" : null'},standalone:!1}]}],propDecorators:{required:[{type:ze}]}});var Mm=class Mm extends gc{constructor(){super(...arguments);l(this,"createValidator",t=>zpe)}};l(Mm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Mm,deps:null,target:Se.Directive})),l(Mm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Mm,isStandalone:!1,selector:"input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]",host:{properties:{"attr.required":'_enabled ? "" : null'}},providers:[x6],usesInheritance:!0,ngImport:k}));var qd=Mm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:qd,decorators:[{type:ht,args:[{selector:"input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]",providers:[x6],host:{"[attr.required]":'_enabled ? "" : null'},standalone:!1}]}]});var S6={provide:Hn,useExisting:cn(()=>Wd),multi:!0},Nm=class Nm extends sa{constructor(){super(...arguments);l(this,"email");l(this,"inputName","email");l(this,"normalizeInput",ei);l(this,"createValidator",t=>Gpe)}enabled(t){return t}};l(Nm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Nm,deps:null,target:Se.Directive})),l(Nm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Nm,isStandalone:!1,selector:"[email][formControlName],[email][formControl],[email][ngModel]",inputs:{email:"email"},providers:[S6],usesInheritance:!0,ngImport:k}));var Wd=Nm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Wd,decorators:[{type:ht,args:[{selector:"[email][formControlName],[email][formControl],[email][ngModel]",providers:[S6],standalone:!1}]}],propDecorators:{email:[{type:ze}]}});var C6={provide:Hn,useExisting:cn(()=>zd),multi:!0},Pm=class Pm extends sa{constructor(){super(...arguments);l(this,"minlength");l(this,"inputName","minlength");l(this,"normalizeInput",t=>v6(t));l(this,"createValidator",t=>Zpe(t))}};l(Pm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Pm,deps:null,target:Se.Directive})),l(Pm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Pm,isStandalone:!1,selector:"[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",inputs:{minlength:"minlength"},host:{properties:{"attr.minlength":"_enabled ? minlength : null"}},providers:[C6],usesInheritance:!0,ngImport:k}));var zd=Pm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:zd,decorators:[{type:ht,args:[{selector:"[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",providers:[C6],host:{"[attr.minlength]":"_enabled ? minlength : null"},standalone:!1}]}],propDecorators:{minlength:[{type:ze}]}});var T6={provide:Hn,useExisting:cn(()=>Gd),multi:!0},Rm=class Rm extends sa{constructor(){super(...arguments);l(this,"maxlength");l(this,"inputName","maxlength");l(this,"normalizeInput",t=>v6(t));l(this,"createValidator",t=>Ype(t))}};l(Rm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Rm,deps:null,target:Se.Directive})),l(Rm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Rm,isStandalone:!1,selector:"[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",inputs:{maxlength:"maxlength"},host:{properties:{"attr.maxlength":"_enabled ? maxlength : null"}},providers:[T6],usesInheritance:!0,ngImport:k}));var Gd=Rm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Gd,decorators:[{type:ht,args:[{selector:"[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",providers:[T6],host:{"[attr.maxlength]":"_enabled ? maxlength : null"},standalone:!1}]}],propDecorators:{maxlength:[{type:ze}]}});var D6={provide:Hn,useExisting:cn(()=>Zd),multi:!0},Fm=class Fm extends sa{constructor(){super(...arguments);l(this,"pattern");l(this,"inputName","pattern");l(this,"normalizeInput",t=>t);l(this,"createValidator",t=>Xpe(t))}};l(Fm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Fm,deps:null,target:Se.Directive})),l(Fm,"\u0275dir",vt({minVersion:"14.0.0",version:"19.2.25",type:Fm,isStandalone:!1,selector:"[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",inputs:{pattern:"pattern"},host:{properties:{"attr.pattern":"_enabled ? pattern : null"}},providers:[D6],usesInheritance:!0,ngImport:k}));var Zd=Fm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Zd,decorators:[{type:ht,args:[{selector:"[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",providers:[D6],host:{"[attr.pattern]":"_enabled ? pattern : null"},standalone:!1}]}],propDecorators:{pattern:[{type:ze}]}});var LU=[jm,Um,qm,uc,Od,Vd,Rd,Xa,Qa,Bd,Bm,Vm,gc,zd,Gd,Zd,qd,Wd,Ud,jd],OU=[Ld,Fd,pc],BU=[$d,fc,Hd,hc,mc],cc=class cc{};l(cc,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:cc,deps:[],target:Se.NgModule})),l(cc,"\u0275mod",co({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:cc,declarations:[jm,Um,qm,uc,Od,Vd,Rd,Xa,Qa,Bd,Bm,Vm,gc,zd,Gd,Zd,qd,Wd,Ud,jd],exports:[jm,Um,qm,uc,Od,Vd,Rd,Xa,Qa,Bd,Bm,Vm,gc,zd,Gd,Zd,qd,Wd,Ud,jd]})),l(cc,"\u0275inj",lo({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:cc}));var Ka=cc;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ka,decorators:[{type:ao,args:[{declarations:LU,exports:LU}]}]});var aN=class extends $m{constructor(t,r,s){super(mN(r),gN(s,r));l(this,"controls");this.controls=t,this._initObservables(),this._setUpdateStrategy(r),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}at(t){return this.controls[this._adjustIndex(t)]}push(t,r={}){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}insert(t,r,s={}){this.controls.splice(t,0,r),this._registerControl(r),this.updateValueAndValidity({emitEvent:s.emitEvent})}removeAt(t,r={}){let s=this._adjustIndex(t);s<0&&(s=0),this.controls[s]&&this.controls[s]._registerOnCollectionChange(()=>{}),this.controls.splice(s,1),this.updateValueAndValidity({emitEvent:r.emitEvent})}setControl(t,r,s={}){let i=this._adjustIndex(t);i<0&&(i=0),this.controls[i]&&this.controls[i]._registerOnCollectionChange(()=>{}),this.controls.splice(i,1),r&&(this.controls.splice(i,0,r),this._registerControl(r)),this.updateValueAndValidity({emitEvent:s.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,r={}){KU(this,!1,t),t.forEach((s,i)=>{QU(this,!1,i),this.at(i).setValue(s,{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r)}patchValue(t,r={}){t!=null&&(t.forEach((s,i)=>{this.at(i)&&this.at(i).patchValue(s,{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r))}reset(t=[],r={}){this._forEachChild((s,i)=>{s.reset(t[i],{onlySelf:!0,emitEvent:r.emitEvent})}),this._updatePristine(r,this),this._updateTouched(r,this),this.updateValueAndValidity(r)}getRawValue(){return this.controls.map(t=>t.getRawValue())}clear(t={}){this.controls.length<1||(this._forEachChild(r=>r._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:t.emitEvent}))}_adjustIndex(t){return t<0?t+this.length:t}_syncPendingControls(){let t=this.controls.reduce((r,s)=>s._syncPendingControls()?!0:r,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){this.controls.forEach((r,s)=>{t(r,s)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(r=>r.enabled&&t(r))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_allControlsDisabled(){for(let t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}_find(t){return this.at(t)??null}};function VU(n){return!!n&&(n.asyncValidators!==void 0||n.validators!==void 0||n.updateOn!==void 0)}var Pd=class Pd{constructor(){l(this,"useNonNullable",!1)}get nonNullable(){let e=new Pd;return e.useNonNullable=!0,e}group(e,t=null){let r=this._reduceControls(e),s={};return VU(t)?s=t:t!==null&&(s.validators=t.validator,s.asyncValidators=t.asyncValidator),new Hm(r,s)}record(e,t=null){let r=this._reduceControls(e);return new oN(r,t)}control(e,t,r){let s={};return this.useNonNullable?(VU(t)?s=t:(s.validators=t,s.asyncValidators=r),new xb(e,{...s,nonNullable:!0})):new xb(e,t,r)}array(e,t,r){let s=e.map(i=>this._createControl(i));return new aN(s,t,r)}_reduceControls(e){let t={};return Object.keys(e).forEach(r=>{t[r]=this._createControl(e[r])}),t}_createControl(e){if(e instanceof xb)return e;if(e instanceof $m)return e;if(Array.isArray(e)){let t=e[0],r=e.length>1?e[1]:null,s=e.length>2?e[2]:null;return this.control(t,r,s)}else return this.control(e)}};l(Pd,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Pd,deps:[],target:Se.Injectable})),l(Pd,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Pd,providedIn:"root"}));var Wm=Pd;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Wm,decorators:[{type:zt,args:[{providedIn:"root"}]}]});var Lm=class Lm{};l(Lm,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Lm,deps:[],target:Se.Injectable})),l(Lm,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Lm,providedIn:"root",useFactory:()=>ye(Wm).nonNullable}));var lN=Lm;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:lN,decorators:[{type:zt,args:[{providedIn:"root",useFactory:()=>ye(Wm).nonNullable}]}]});var Om=class Om extends Wm{group(e,t=null){return super.group(e,t)}control(e,t,r){return super.control(e,t,r)}array(e,t,r){return super.array(e,t,r)}};l(Om,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Om,deps:null,target:Se.Injectable})),l(Om,"\u0275prov",Kt({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Om,providedIn:"root"}));var cN=Om;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:cN,decorators:[{type:zt,args:[{providedIn:"root"}]}]});var Xye=new Wo("19.2.25"),Za=class Za{static withConfig(e){return{ngModule:Za,providers:[{provide:vo,useValue:e.callSetDisabledState??Ib}]}}};l(Za,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Za,deps:[],target:Se.NgModule})),l(Za,"\u0275mod",co({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:Za,declarations:[Ld,Fd,pc],exports:[Ka,Ld,Fd,pc]})),l(Za,"\u0275inj",lo({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Za,imports:[Ka]}));var Yr=Za;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Yr,decorators:[{type:ao,args:[{declarations:OU,exports:[Ka,OU]}]}]});var Ya=class Ya{static withConfig(e){return{ngModule:Ya,providers:[{provide:_b,useValue:e.warnOnNgModelWithFormControl??"always"},{provide:vo,useValue:e.callSetDisabledState??Ib}]}}};l(Ya,"\u0275fac",Ie({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ya,deps:[],target:Se.NgModule})),l(Ya,"\u0275mod",co({minVersion:"14.0.0",version:"19.2.25",ngImport:k,type:Ya,declarations:[$d,fc,Hd,hc,mc],exports:[Ka,$d,fc,Hd,hc,mc]})),l(Ya,"\u0275inj",lo({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:Ya,imports:[Ka]}));var uN=Ya;De({minVersion:"12.0.0",version:"19.2.25",ngImport:k,type:uN,decorators:[{type:ao,args:[{declarations:[BU],exports:[Ka,BU]}]}]});var St=(()=>{let n=typeof location<"u"?location.pathname:"/",e=typeof location<"u"?location.search.replace(/^\?/,""):"",t={},r=e,s=null,i=null,o=!1,a=[{state:null,url:n+(e?`?${e}`:"")}];function c(){let m=new URLSearchParams(r),g={};m.has("track")&&(g.track=m.get("track")),m.has("map")&&(g.map=m.get("map")),m.has("xaxis")&&(g.xaxis=m.get("xaxis")),m.has("tab")&&(g.tab=m.get("tab")),m.has("sel_point")&&(g.sel_point=Number(m.get("sel_point"))),m.has("speed_mode")&&(g.speed_mode=m.get("speed_mode")),m.has("progress")&&(g.progress=m.get("progress"));let y=m.get("metrics");if(y&&(g.metrics=y.split(",").filter(Boolean)),m.has("f_date")&&(g.f_date=m.get("f_date").split(",").map(b=>b||null)),m.has("f_dist")&&(g.f_dist=m.get("f_dist").split(",").map(b=>b?Number(b):null)),m.has("f_dur")&&(g.f_dur=m.get("f_dur").split(",").map(b=>b?Number(b):null)),m.has("f_mets")&&(g.f_mets=m.get("f_mets").split(",")),m.has("f_tags")&&(g.f_tags=m.get("f_tags").split(",")),m.has("q")&&(g.q=m.get("q")),m.has("re")&&(g.re=m.get("re")==="1"),m.has("sort")){let b=m.get("sort"),E=b.startsWith("-"),_=E?b.substring(1):b;g.sort=`${_}-${E?"desc":"asc"}`}if(m.has("map_pos")){let b=m.get("map_pos").split(",").map(Number);b.length===3&&b.every(isFinite)&&(g.map_pos=b)}if(m.has("storage")&&(g.storage=m.get("storage")),m.has("sel")){let b=m.get("sel").split(",").map(Number);b.length===2&&b.every(E=>!isNaN(E)&&isFinite(E))&&(g.sel=b)}return g}function u(){i&&(clearTimeout(i),i=null);let m=new URLSearchParams;if(t.track&&m.set("track",t.track),t.map&&m.set("map",t.map),t.xaxis&&t.xaxis!=="time"&&m.set("xaxis",t.xaxis),t.tab&&t.tab!=="graphs"&&m.set("tab",t.tab),t.storage&&t.storage!=="memory"&&m.set("storage",t.storage),t.sel_point!==void 0&&m.set("sel_point",String(t.sel_point)),t.speed_mode&&m.set("speed_mode",t.speed_mode),t.q&&m.set("q",t.q),t.progress&&m.set("progress",t.progress),t.re&&m.set("re","1"),t.sort){let y=t.sort.split("-"),b=y[0],E=y[1];m.set("sort",(E==="desc"?"-":"")+b)}let g=m.toString();if(t.metrics&&(g+=`${g?"&":""}metrics=${t.metrics.join(",")}`),t.f_date&&(g+=`${g?"&":""}f_date=${t.f_date.map(y=>y||"").join(",")}`),t.f_dist&&(g+=`${g?"&":""}f_dist=${t.f_dist.map(y=>y??"").join(",")}`),t.f_dur&&(g+=`${g?"&":""}f_dur=${t.f_dur.map(y=>y??"").join(",")}`),t.f_mets&&(g+=`${g?"&":""}f_mets=${t.f_mets.join(",")}`),t.f_tags&&(g+=`${g?"&":""}f_tags=${t.f_tags.join(",")}`),t.map_pos){let y=`${(+t.map_pos[0]).toFixed(5)},${(+t.map_pos[1]).toFixed(5)},${t.map_pos[2]}`;g+=`${g?"&":""}map_pos=${y}`}if(t.sel){let y=`${+t.sel[0].toFixed(4)},${+t.sel[1].toFixed(4)}`;g+=`${g?"&":""}sel=${y}`}if(r=g,g!==s){let b=(typeof location<"u"?location.pathname:"/")+(g?`?${g}`:""),E=c();o?(a.push({state:E,url:b}),a.length>100&&a.shift(),o=!1):a.length>0?a[a.length-1]={state:E,url:b}:a.push({state:E,url:b}),s=g}}t=c();function d(){return{...t}}function p(m,g=!1){g&&(o=!0);for(let[y,b]of Object.entries(m)){let E=y;b==null?delete t[E]:t[E]=b}u()}function f(){t=c()}function h(){i&&(clearTimeout(i),i=null),t={},o=!1,r="",s="",a=[{state:null,url:typeof location<"u"?location.pathname:"/"}]}return{read:c,get:d,patch:p,refresh:f,reset:h}})();var RC=class{constructor(){this.trackStore=new Map;this.settingStore=new Map}async openDB(){return Promise.resolve()}async save(e){return this.trackStore.set(e.id,e),Promise.resolve()}async getAll(){return Promise.resolve(Array.from(this.trackStore.values()))}async remove(e){return this.trackStore.delete(e),Promise.resolve()}async clear(){return this.trackStore.clear(),this.settingStore.clear(),Promise.resolve()}async set(e,t){return this.settingStore.set(e,t),Promise.resolve()}async get(e){return Promise.resolve(this.settingStore.get(e)??null)}},wN=class{constructor(){this.db=null;this.DB_NAME="weg-gps-db";this.DB_VERSION=2}async openDB(){return new Promise((e,t)=>{let r=indexedDB.open(this.DB_NAME,this.DB_VERSION);r.onupgradeneeded=()=>{let s=r.result;s.objectStoreNames.contains("tracks")||s.createObjectStore("tracks",{keyPath:"id"}),s.objectStoreNames.contains("settings")||s.createObjectStore("settings")},r.onsuccess=()=>{this.db=r.result,e()},r.onerror=()=>t(r.error)})}getStore(e,t){if(!this.db)throw new Error("IndexedDB not opened");return this.db.transaction(e,t).objectStore(e)}async save(e){return new Promise((t,r)=>{let s=this.getStore("tracks","readwrite").put(e);s.onsuccess=()=>t(),s.onerror=()=>r(s.error)})}async getAll(){return new Promise((e,t)=>{let r=this.getStore("tracks","readonly").getAll();r.onsuccess=()=>e(r.result||[]),r.onerror=()=>t(r.error)})}async remove(e){return new Promise((t,r)=>{let s=this.getStore("tracks","readwrite").delete(e);s.onsuccess=()=>t(),s.onerror=()=>r(s.error)})}async clear(){return this.db?new Promise((e,t)=>{let r=this.db.transaction(["tracks","settings"],"readwrite");r.objectStore("tracks").clear(),r.objectStore("settings").clear(),r.oncomplete=()=>e(),r.onerror=()=>t(r.error)}):Promise.resolve()}async set(e,t){return new Promise((r,s)=>{let i=this.getStore("settings","readwrite").put(t,e);i.onsuccess=()=>r(),i.onerror=()=>s(i.error)})}async get(e){return new Promise((t,r)=>{let s=this.getStore("settings","readonly").get(e);s.onsuccess=()=>t(s.result??null),s.onerror=()=>r(s.error)})}},vc=new RC,Gn={openDB:async()=>{vc=St.get().storage==="indexeddb"?new wN:new RC,await vc.openDB()},save:n=>vc.save(n),getAll:()=>vc.getAll(),remove:n=>vc.remove(n),clear:()=>vc.clear(),set:(n,e)=>vc.set(n,e),get:n=>vc.get(n)};var tt=(()=>{let n={},e=null;function t($,ee,we,We,P){}function r($){}function s($){n[$.id]=$}function i($){$.forEach(ee=>{n[ee.id]=ee})}function o($){delete n[$]}function a(){n={}}function c(){n={}}function u($,ee){}function d($,ee){}function p(){}function f($){}function h($,ee){}function m(){}function g($,ee,we,We,P,A){}function y(){}function b($,ee){}function E($){}function _($,ee,we,We){}function V(){}function M(){}function j(){return[0,0,0]}function G($,ee,we){}function W($,ee,we){}function xe($){}function pe($,ee){return Object.keys(n)}return{init:t,getMap:()=>null,setCustomClickHandler:$=>{e=$},switchBasemap:r,addTrack:s,addTracks:i,removeTrack:o,clearTracks:a,removeAllTracks:c,setTrackVisible:u,setSelectedTrack:d,fitAll:p,fitTrack:f,showCursorAt:h,hideCursor:m,highlightSegment:g,clearHighlight:y,setTrackHover:b,ensureVisible:E,centerOn:_,closePopup:V,invalidateSize:M,getPosition:j,setPosition:G,colorTrackByMetric:W,clearMetricColor:xe,findTracksPassingThroughPoints:pe,getTrackData:$=>n[$]}})();import R6 from"uplot";function Ja(n,e,t,r){let i=n*Math.PI/180,o=t*Math.PI/180,a=(t-n)*Math.PI/180,c=(r-e)*Math.PI/180,u=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2);return 6371e3*(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)))}function I6(n){let e=new Uint32Array([Math.floor(n/1e3)]);return btoa(String.fromCharCode(...new Uint8Array(e.buffer))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function _6(){return Math.random().toString(36).slice(2,6)}function Tr(n){return n<60?`${Math.round(n)}s`:n<3600?`${Math.round(n/60)}m`:`${Math.round(n/3600)}h`}function wn(n){let e=Math.floor(n/3600),t=Math.floor(n%3600/60);return e>0?`${e}h ${t}m`:`${t}m ${Math.floor(n%60)}s`}function Yd(n){if(n==null||!isFinite(n))return"--";let e=Math.floor(n/60),t=Math.round(n%60);return`${e}:${t.toString().padStart(2,"0")}`}function yo(n){let e=new Date(n);return isNaN(e.getTime())?"Unknown date":e.toISOString().split("T")[0]}function k6(n){let e=new Date(n);if(isNaN(e.getTime()))return"Unknown";let t=e.toISOString();return`${t.split("T")[0]} ${t.split("T")[1].slice(0,5)}`}function A6(n){if(n===0)return"0 B";let e=1024,t=["B","KB","MB","GB"],r=Math.floor(Math.log(n)/Math.log(e));return`${parseFloat((n/Math.pow(e,r)).toFixed(2))} ${t[r]}`}function FC(n){let e=0;for(let r=0;r=0&&p0?c/u:n[a]}return o}function Gt(n,e=1){let t=parseInt(n.slice(1,3),16),r=parseInt(n.slice(3,5),16),s=parseInt(n.slice(5,7),16);return`rgba(${t}, ${r}, ${s}, ${e})`}import ffe from"fit-file-parser";function M6(n){if(!n.length)return null;let e=n[0].lat,t=n[0].lat,r=n[0].lon,s=n[0].lon;for(let i of n)i.latt&&(t=i.lat),i.lons&&(s=i.lon);return{minLat:e,maxLat:t,minLon:r,maxLon:s}}var Ls=16384,hfe=new Float64Array(Ls),mfe=new Float64Array(Ls),gfe=new Float64Array(Ls),vfe=new Float64Array(Ls),yfe=new Float64Array(Ls),bfe=new Float64Array(Ls),wfe=new Float64Array(Ls);function N6(n,e){let t=n.length;if(t<=2)return n;let r=t<=Ls?hfe:new Float64Array(t),s=t<=Ls?mfe:new Float64Array(t),i=t<=Ls?gfe:new Float64Array(t),o=t<=Ls?vfe:new Float64Array(t);for(let h=0;h=m){let j=g+y>>1,G=(s[j]-(s[g]+s[y])*.5)*b,W=r[j]-(r[g]+r[y])*.5;c+=Math.sqrt(G*G+W*W)+(o[y]-o[g])*1e-6,g=y}}}let d=[n[0]],p=n[0],f=c<-1e9?1e-9:0;for(let h=1;h=e&&(d.push(m),p=m)}return d.push(n[t-1]),d}var _n=(()=>{function n(P){let A=P.length,S=0;for(let x=0;x0){let I=P[x-1],F=Ja(I.lat,I.lon,C.lat,C.lon);if(S+=F,C.speed==null&&C.time!=null&&I.time!=null){let J=(C.time-I.time)/1e3;J>0&&J<10&&(C.speed=F/J)}if(C.gradient===void 0&&C.ele!=null&&I.ele!=null){let J=C.ele-I.ele;F>.5?C.gradient=J/F*100:C.gradient=I.gradient||0}}C.dist=S}if(A>2){let x=A<=Ls?yfe:new Float64Array(A),C=A<=Ls?bfe:new Float64Array(A),I=A<=Ls?wfe:new Float64Array(A);for(let oe=0;oe=ke){B-=C[L-ke],z-=I[L-ke];let U=B*se,H=x[L]-x[L-ke],ae=1.225*Math.exp(-x[L]*ie),K=Math.atan2(H,(z+1)*.5);J+=U*U*ae*1e-4+K*(z*se)*.01}}let ve=J<-1e12?1e-9:0;for(let oe=1;oe0){let Ce=P[Ee-1];if(ue.ele!=null&&Ce.ele!=null){let Me=ue.ele-Ce.ele;Me>0?S.elevGain+=Me:S.elevLoss-=Me}(ue.gearFront!=null&&ue.gearFront!==Ce.gearFront||ue.gearRear!=null&&ue.gearRear!==Ce.gearRear)&&U++}ue.power!=null&&(x+=ue.power,C++,ue.power>S.maxPower&&(S.maxPower=ue.power)),ue.hr!=null&&(I+=ue.hr,F++,ue.hr>S.maxHR&&(S.maxHR=ue.hr)),ue.cad!=null&&(J+=ue.cad,ie++),ue.speed!=null&&(ve+=ue.speed,oe++,ue.speed>S.maxSpeed&&(S.maxSpeed=ue.speed)),ue.battery!=null&&(ke+=ue.battery,se++),ue.temp!=null&&(L=!0,B+=ue.temp,z++,(S.minTemp==null||ue.tempS.maxTemp)&&(S.maxTemp=ue.temp)),(ue.gearFront!=null||ue.gearRear!=null)&&(H=!0)}S.totalDist=P[P.length-1].dist||0,S.avgPower=C?Math.round(x/C):null,S.avgHR=F?Math.round(I/F):null,S.avgCadence=ie?Math.round(J/ie):null,S.avgSpeed=oe?ve/oe:null,S.avgBattery=se?Math.round(ke/se):null,S.avgTemp=z?Number((B/z).toFixed(1)):null,S.shifts=H?U:null;let ae=P[0].time,K=P[P.length-1].time;return ae!=null&&K!=null&&(S.duration=K-ae),F&&(S.sensors.push("Heart Rate"),A&&(S.hrZones=m(P),S.hrCurve=d(P))),ie&&S.sensors.push("Cadence"),C&&(S.sensors.push("Power"),A&&(S.powerCurve=u(P),S.powerZones=p(P))),L&&S.sensors.push("Temperature"),H&&S.sensors.push("Shifting"),se&&S.sensors.push("Battery"),S}function s(P){if(!P||!P.points||!P.stats)return;let A=P.points,S=P.stats;S.avgHR!=null&&!S.hrCurve&&(S.hrZones=m(A),S.hrCurve=d(A)),S.avgPower!=null&&!S.powerCurve&&(S.powerCurve=u(A),S.powerZones=p(A))}function i(P){let A=P.length;if(A<8)return[];let S=[],x=["Q1 Opening Sector","Q2 Mid-Climb Sector","Q3 Valley Tempo","Q4 Finale Sector"];for(let U=0;U<4;U++){let H=Math.floor(U*A/4),ae=Math.min(A-1,Math.floor((U+1)*A/4)-1);if(ae>H){let K=P.slice(H,ae+1);S.push({id:`q${U+1}`,label:x[U],kind:"quarter",startIdx:H,endIdx:ae,stats:r(K,!0)})}}let C=["Opening Third","Middle Third","Final Third"];for(let U=0;U<3;U++){let H=Math.floor(U*A/3),ae=Math.min(A-1,Math.floor((U+1)*A/3)-1);if(ae>H){let K=P.slice(H,ae+1);S.push({id:`t${U+1}`,label:C[U],kind:"third",startIdx:H,endIdx:ae,stats:r(K,!1)})}}let I=0,F=1e3,J=1;for(let U=1;U=F||U===A-1){if(U>I+2){let ae=P.slice(I,U+1);S.push({id:`km-${J}`,label:`Km ${J}`,kind:"km",startIdx:I,endIdx:U,stats:r(ae,!1)}),J++}I=U,F+=1e3}let ie=30,ve=!1,oe=0,ke=1,se=!1,B=0,z=1,L=t*1.15;for(let U=ie;U=1.8&&!ve)ve=!0,oe=U-ie;else if((K<.8||U===A-1)&&ve&&(ve=!1,U-oe>=45&&ke<=6)){let ue=P.slice(oe,U+1);S.push({id:`climb-${ke}`,label:`Climb Segment ${ke}`,kind:"climb",startIdx:oe,endIdx:U,stats:r(ue,!0)}),ke++}let Ee=P[U].power??0;if(Ee>=L&&!se)se=!0,B=U;else if((Ee=15&&z<=6)){let ue=P.slice(B,U+1);S.push({id:`sprint-${z}`,label:`Sprint Interval ${z}`,kind:"sprint",startIdx:B,endIdx:U,stats:r(ue,!0)}),z++}}return S}function o(P){let A=[];for(let S=0;SS)continue;let ie=0,ve=0,oe=S-J;for(let ke=0;ke<=oe;ke++){let se=x[ke+J]-x[ke];se>ie&&(ie=se,ve=ke)}C[J]={val:Math.round(ie/J),idx:ve},I=!0}return I?C:null}function u(P){let A=P.length,S=new Array(A),x=!1;for(let F=0;Fx*t);for(let x=1;x10)continue;let J=C.power;Jx===0)?null:A}function f(P){t=P}function h(){return t}function m(P){let A=[0,0,0,0,0];for(let S=1;S10)continue;let F=x.hr;FS===0)?null:A}function g(P){e=P}function y(){return[...e]}function b(P,A,S){let x=P.indexOf(A);if(x===-1)return null;let C=x+A.length,I=P.indexOf(S,C);if(I===-1)return null;let F=P.slice(C,I).trim();return F!==""?F:null}function E(P,A){let S=P.indexOf(A);if(S===-1)return null;let x=S+A.length,C=P.indexOf('"',x);return C===-1?null:P.slice(x,C)}let _=-1,V=0;function M(P,A,S){for(;AA&&P.charCodeAt(S-1)<=32;)S--;if(A>=S)return null;let x=!1,C=P.charCodeAt(A);C===45?(x=!0,A++):C===43&&A++;let I=0,F=0;for(let J=A;J=48&&ie<=57)I=I*10+(ie-48),F++;else break}return F===0?null:x?-I:I}function j(P,A,S){for(;AA&&P.charCodeAt(S-1)<=32;)S--;if(A>=S)return null;let x=!1,C=P.charCodeAt(A);C===45?(x=!0,A++):C===43&&A++;let I=0,F=0,J=1,ie=!1,ve=0;for(let ke=A;ke=48&&se<=57)ve++,ie?(F=F*10+(se-48),J*=10):I=I*10+(se-48);else if(se===46&&!ie)ie=!0;else{let B=parseFloat(P.slice(A-(x?1:0),S));return Number.isFinite(B)?B:null}}if(ve===0)return null;let oe=I+F/J;return x?-oe:oe}function G(P,A,S){for(;AA&&P.charCodeAt(S-1)<=32;)S--;let x=S-A;if(x>=20&&P.charCodeAt(A+10)===84&&P.charCodeAt(S-1)===90){let I=(P.charCodeAt(A)-48)*1e3+(P.charCodeAt(A+1)-48)*100+(P.charCodeAt(A+2)-48)*10+(P.charCodeAt(A+3)-48),F=(P.charCodeAt(A+5)-48)*10+(P.charCodeAt(A+6)-48),J=(P.charCodeAt(A+8)-48)*10+(P.charCodeAt(A+9)-48),ie=I<<9|F<<5|J;ie!==_&&(_=ie,V=Date.UTC(I,F-1,J));let ve=(P.charCodeAt(A+11)-48)*10+(P.charCodeAt(A+12)-48),oe=(P.charCodeAt(A+14)-48)*10+(P.charCodeAt(A+15)-48),ke=(P.charCodeAt(A+17)-48)*10+(P.charCodeAt(A+18)-48),se=0;return P.charCodeAt(A+19)===46&&x>=24&&(se=(P.charCodeAt(A+20)-48)*100+(P.charCodeAt(A+21)-48)*10+(P.charCodeAt(A+22)-48)),V+ve*36e5+oe*6e4+ke*1e3+se}let C=new Date(P.slice(A,S)).getTime();return Number.isFinite(C)?C:null}function W(P,A,S,x){let C=P.indexOf(x,A);if(C===-1||C>=S)return 0;let I=C+x.length,F=P.indexOf('"',I);return F===-1||F>=S?0:j(P,I,F)??0}function xe(P,A){let S=A??new TextDecoder().decode(P),x=S.indexOf(""),F=(I!==-1?b(C.slice(I),"",""):null)||b(C,"","")||"Unnamed Track",J=C.indexOf(">",C.indexOf("",B+6);if(z===-1)break;let L=S.indexOf("",z+1);if(L===-1)break;oe=L+8;let U=W(S,B+6,z+1,'lat="'),H=W(S,B+6,z+1,'lon="'),ae=null,K=null,Ee=null,ue=null,Ce=null,Me=null,Je=null,It=null,Pt=null,de=null,He=null,Zt=null,Ct=z+1;for(;Ct=L)break;let nt=S.indexOf(">",ot+1);if(nt===-1||nt>=L)break;let at=S.charCodeAt(ot+1);if(at===47){Ct=nt+1;continue}let rt=nt-ot-1;if(at===103&&rt===26&&Ee!==null&&ue!==null&&Me!==null)break;let yt=S.indexOf("<",nt+1);if(yt===-1||yt>L)break;if(S.charCodeAt(yt+1)===47){let At=nt+1,Ht=yt;rt===3?at===101?ae=j(S,At,Ht):at===99&&ue===null&&(ue=M(S,At,Ht)):rt===2?at===104&&Ee===null&&(Ee=M(S,At,Ht)):rt===4?at===116?S.charCodeAt(ot+2)===105?K=G(S,At,Ht):Me===null&&(Me=j(S,At,Ht)):at===84&&Me===null&&(Me=j(S,At,Ht)):rt===5?(at===112||at===80||at===87)&&Ce===null?Ce=j(S,At,Ht):(at===115||at===83)&&Je===null?Je=j(S,At,Ht):at===97&&Me===null&&(Me=j(S,At,Ht)):rt===7?(at===98||at===66)&&Zt===null?Zt=M(S,At,Ht):at===67&&ue===null&&(ue=M(S,At,Ht)):rt===8?(at===103||at===71)&&Pt===null&&(Pt=M(S,At,Ht)):rt===9?at===103?S.charCodeAt(ot+8)===104&&Ee===null?Ee=M(S,At,Ht):It===null&&(It=M(S,At,Ht)):at===71&&It===null&&(It=M(S,At,Ht)):rt===10?(at===103&&ue===null||at===82&&ue===null)&&(ue=M(S,At,Ht)):rt===12?at===103&&S.charCodeAt(ot+8)===97&&Me===null?Me=j(S,At,Ht):at===80&&Ce===null?Ce=j(S,At,Ht):at===72&&Ee===null&&(Ee=M(S,At,Ht)):rt===13?(at===103||at===71)&&He===null&&(He=M(S,At,Ht)):rt===14?(at===103||at===71)&&de===null?de=M(S,At,Ht):at===65&&Me===null&&(Me=j(S,At,Ht)):rt===11&&at===84&&Me===null&&(Me=j(S,At,Ht));let kn=yt+2+rt;if(S.charCodeAt(kn)===62)Ct=kn+1;else{let fr=S.indexOf(">",yt+2);Ct=fr!==-1?fr+1:yt+2}if(Zt!==null&&Ee!==null&&ue!==null&&Me!==null)break}else Ct=yt}let Jt=null;de!=null&&He!=null&&He!==0?Jt=de/He:It!=null&&Pt!=null&&Pt!==0&&(Jt=It/Pt),ve.push({lat:U,lon:H,ele:ae,time:K,hr:Ee,cad:ue,power:Ce,speed:Je,temp:Me,gearFront:It,gearRear:Pt,gearFrontTooth:de,gearRearTooth:He,battery:Zt,gears:Jt})}if(!ve.length)throw new Error("No track points found in GPX");let ke=n(ve),se=r(ke);return{name:F,device:ie,format:"gpx",points:ke,stats:se}}function pe(P,A){let S=A??new TextDecoder().decode(P),x=S.indexOf(""),C=x!==-1?S.slice(0,x):S,I=b(C,"","")||"Unnamed TCX",F=b(C,"",""),J=F?b(F,"",""):null,ie=[],ve=x!==-1?x:0;for(;ve",ve);if(se===-1)break;let B=S.indexOf("",se+12);if(B===-1)break;ve=B+13;let z=null,L=null,U=null,H=null,ae=null,K=null,Ee=null,ue=null,Ce=null,Me=null,Je=null,It=null,Pt=null,de=null,He=se+12;for(;He=B)break;let Jt=S.indexOf(">",Ct+1);if(Jt===-1||Jt>=B)break;let ot=S.charCodeAt(Ct+1);if(ot===47){He=Jt+1;continue}let nt=Jt-Ct-1,at=S.indexOf("<",Jt+1);if(at===-1||at>B)break;if(S.charCodeAt(at+1)===47){let rt=Jt+1,yt=at;nt===4?ot===84?S.charCodeAt(Ct+2)===105?H=G(S,rt,yt):Ce===null&&(Ce=j(S,rt,yt)):ot===116&&Ce===null&&(Ce=j(S,rt,yt)):nt===5?ot===86&&ae===null?ae=M(S,rt,yt):(ot===87||ot===80||ot===112)&&Ee===null?Ee=j(S,rt,yt):(ot===83||ot===115)&&ue===null?ue=j(S,rt,yt):ot===97&&Ce===null&&(Ce=j(S,rt,yt)):nt===7?ot===67&&K===null?K=M(S,rt,yt):(ot===66||ot===98)&&de===null&&(de=M(S,rt,yt)):nt===8?(ot===71||ot===103)&&Je===null&&(Je=M(S,rt,yt)):nt===9?(ot===71||ot===103)&&Me===null&&(Me=M(S,rt,yt)):nt===10?ot===82&&K===null&&(K=M(S,rt,yt)):nt===11?ot===84&&Ce===null&&(Ce=j(S,rt,yt)):nt===13?(ot===71||ot===103)&&Pt===null&&(Pt=M(S,rt,yt)):nt===14?ot===65?S.charCodeAt(Ct+2)===108?U=j(S,rt,yt):Ce===null&&(Ce=j(S,rt,yt)):(ot===71||ot===103)&&It===null&&(It=M(S,rt,yt)):nt===15?ot===76&&(z=j(S,rt,yt)):nt===16?ot===76&&(L=j(S,rt,yt)):nt===2&&ot===104&&ae===null?ae=M(S,rt,yt):nt===3&&ot===99&&K===null?K=M(S,rt,yt):nt===12&&(ot===72&&ae===null?ae=M(S,rt,yt):ot===80&&Ee===null&&(Ee=j(S,rt,yt)));let At=at+2+nt;if(S.charCodeAt(At)===62)He=At+1;else{let Ht=S.indexOf(">",at+2);He=Ht!==-1?Ht+1:at+2}if(de!==null&&ae!==null&&K!==null&&Ce!==null)break}else He=at}if(z==null||L==null)continue;let Zt=null;It!=null&&Pt!=null&&Pt!==0?Zt=It/Pt:Me!=null&&Je!=null&&Je!==0&&(Zt=Me/Je),ie.push({lat:z,lon:L,ele:U,time:H,hr:ae,cad:K,power:Ee,speed:ue,temp:Ce,gearFront:Me,gearRear:Je,gearFrontTooth:It,gearRearTooth:Pt,battery:de,gears:Zt})}let oe=n(ie),ke=r(oe);return{name:I,device:J,format:"tcx",points:oe,stats:ke}}function $(P){if(P.byteLength<14)return null;let A=new DataView(P),S=A.getUint8(0);if(S<12||S+2>P.byteLength||A.getUint8(8)!==46||A.getUint8(9)!==70||A.getUint8(10)!==73||A.getUint8(11)!==84)return null;let x=A.getUint32(4,!0),C=Math.min(P.byteLength,S+x),I=631065600,F=180/Math.pow(2,31),J=new Array(16),ie=[],ve=[],oe=[],ke=[],se=[],B=S;for(;BC)return null;B++;let H=A.getUint8(B++)===0,ae=A.getUint16(B,H);B+=2;let K=A.getUint8(B++);if(B+K*3>C)return null;let Ee=new Array(K),ue=0;for(let Ce=0;CeC)return null;let H=U.littleEndian,ae=U.globalMsgNum;if(ae===20&&U.fields.length===10&&U.recordSize===25&&U.fields[0].num===253&&U.fields[1].num===0){let ue=A.getUint32(B,H),Ce=A.getInt32(B+4,H),Me=A.getInt32(B+8,H),Je=A.getUint16(B+12,H),It=A.getUint8(B+14),Pt=A.getUint8(B+15),de=A.getUint32(B+16,H),He=A.getUint16(B+20,H),Zt=A.getUint16(B+22,H),Ct=A.getInt8(B+24);oe.push({timestamp:(ue+I)*1e3,position_lat:Ce*F,position_long:Me*F,altitude:Je/5-500,heart_rate:It,cadence:Pt,distance:de/100,speed:He/1e3*3.6,power:Zt,temperature:Ct}),B+=25;continue}let K={},Ee=B;for(let ue=0;ue{let x=(F,J)=>{if(F){S(F);return}try{let ie=J.sessions?.[0]?.start_time?`Fit Activity ${new Date(J.sessions[0].start_time).toISOString().split("T")[0]}`:"Unnamed Fit",ve=null,oe=[],ke=null,se=null;J.sports?.[0]?(ke=J.sports[0].sport,se=J.sports[0].sub_sport):J.sessions?.[0]&&(ke=J.sessions[0].sport,se=J.sessions[0].sub_sport);let B=de=>de.product_name||de.garmin_product||de.product||de.device_type||de.manufacturer||null;if(J.file_ids?.[0]){let de=J.file_ids[0];ve=B(de),oe.push({name:de.product_name||de.garmin_product||de.product,manufacturer:de.manufacturer,serial:de.serial_number?String(de.serial_number):void 0,version:de.software_version?String(de.software_version):void 0,type:"main"})}J.device_infos&&J.device_infos.forEach(de=>{if(de.device_index==="creator"||de.device_index===0){let Zt=B(de);(de.product_name||de.garmin_product||!ve)&&(ve=Zt),oe.length>0&&oe[0].type==="main"&&((de.product_name||de.garmin_product||!oe[0].name)&&(oe[0].name=de.product_name||de.garmin_product||de.product),oe[0].manufacturer||(oe[0].manufacturer=de.manufacturer),!oe[0].serial&&de.serial_number&&(oe[0].serial=String(de.serial_number)),!oe[0].version&&de.software_version&&(oe[0].version=String(de.software_version)),!oe[0].hardwareVersion&&de.hardware_version&&(oe[0].hardwareVersion=String(de.hardware_version)));return}oe.push({name:de.product_name||de.garmin_product||de.product||de.device_type||"Sensor",manufacturer:de.manufacturer,serial:de.serial_number?String(de.serial_number):void 0,version:de.software_version?String(de.software_version):void 0,hardwareVersion:de.hardware_version?String(de.hardware_version):void 0,type:de.device_type||"sensor",batteryStatus:de.battery_status,batteryVoltage:de.battery_voltage,batteryLevel:de.battery_level,sourceType:de.source_type!=null?String(de.source_type):void 0})}),J.sensor_settings&&J.sensor_settings.forEach(de=>{let He=de.name||de.product||de.sensor_type;if(!He)return;let Zt=de.ant_id?String(de.ant_id):void 0,Ct=oe.find(Jt=>Zt&&Jt.serial===Zt||Jt.name===He&&Jt.manufacturer===de.manufacturer);Ct?(Ct.name||(Ct.name=He),Ct.manufacturer||(Ct.manufacturer=de.manufacturer),Ct.type||(Ct.type=de.sensor_type),Ct.sourceType||(Ct.sourceType=de.connection_type!=null?String(de.connection_type):void 0)):oe.push({name:He,manufacturer:de.manufacturer,serial:Zt,type:de.sensor_type||"sensor",sourceType:de.connection_type!=null?String(de.connection_type):void 0})});let z=[];J.device_statuses&&(J.device_statuses.forEach((de,He)=>{de.timestamp&&de.battery_level!=null&&z.push({time:typeof de.timestamp=="number"?de.timestamp:new Date(de.timestamp).getTime(),level:de.battery_level,idx:He})}),z.sort((de,He)=>de.time-He.time||de.idx-He.idx));let L=[];J.events&&(J.events.forEach((de,He)=>{let Zt=de.front_gear_num??de.front_gear??null,Ct=de.rear_gear_num??de.rear_gear??null,Jt=de.front_gear_num_tooth??null,ot=de.rear_gear_num_tooth??null;if(de.event==="rear_gear_change"||de.event==="front_gear_change"){let nt=de.data;if(nt!=null){let at=nt>>24&255,rt=nt>>16&255,yt=nt>>8&255,At=nt&255;rt!==0&&(Zt=rt),at!==0&&(Jt=at),At!==0&&(Ct=At),yt!==0&&(ot=yt)}}de.timestamp&&(Zt!=null||Ct!=null||Jt!=null||ot!=null)&&L.push({time:typeof de.timestamp=="number"?de.timestamp:new Date(de.timestamp).getTime(),front:Zt,rear:Ct,frontTooth:Jt,rearTooth:ot,idx:He})}),L.sort((de,He)=>de.time-He.time||de.idx-He.idx));let U=J.records||[],H=null,ae=0,K=null,Ee=null,ue=null,Ce=null,Me=0,Je=[];for(let de=0;de name, Placemark > name");C&&(x=C.textContent?.trim()||x);let I=S.querySelectorAll("coordinates");if(!I.length)throw new Error("No coordinates found in KML");let F=[];if(I.forEach(ve=>{(ve.textContent?.trim().split(/\s+/)||[]).forEach(ke=>{let se=ke.split(",");if(se.length<2)return;let B=parseFloat(se[0]),z=parseFloat(se[1]),L=se.length>2?parseFloat(se[2]):null;isNaN(z)||isNaN(B)||F.push({lat:z,lon:B,ele:L!=null&&isNaN(L)?null:L,time:null,hr:null,cad:null,power:null,speed:null,temp:null,gearFront:null,gearRear:null,gearFrontTooth:null,gearRearTooth:null,battery:null,gears:null})})}),!F.length)throw new Error("No valid coordinates in KML");let J=n(F),ie=r(J);return{name:x,format:"kml",points:J,stats:ie}}async function We(P){let A=P.name.split(".").pop()?.toLowerCase(),S=P._buf??await P.arrayBuffer(),x=P._text,C;switch(A){case"gpx":C=xe(S,x);break;case"tcx":C=pe(S,x);break;case"fit":C=await ee(S);break;case"kml":C=we(S);break;default:throw new Error(`Unsupported format: .${A}`)}return C&&(C.fileName=P.name,C.fileSize=P.size,C.points&&C.stats&&(s(C),C.stats.sections=i(C.points))),C}return{parseFile:We,computeStats:r,ensureCurvesAndZones:s,analyzeTrackSections:i,findOverlaps:o,calculatePowerCurve:u,calculateHRCurve:d,calculatePowerZones:p,calculateHRZones:m,enrichPoints:n,setHRZones:g,getHRZones:y,setFTP:f,getFTP:h}})();var el=(()=>{function n(){let t=_n.getFTP(),r=[.55,.75,.9,1.05,1.2,1.5].map(c=>c*t),s=["Active Recovery","Endurance","Tempo","Threshold","VO2 Max","Anaerobic","Neuromuscular"],i=["#82E0AA","#A8C8A0","#F7DC6F","#F8C471","#F39C12","#E67E22","#C0392B"],o=[],a=0;for(let c=0;ce?n.toFixed(1):Math.round(n).toString(),fmtAxis:n=>Math.round(n).toString()},speed:{label:"Speed",field:"speed",unit:"km/h",color:et.speed.color,abbr:"spd",icon:et.speed.icon,fmt:n=>(n*3.6).toFixed(1),fmtAxis:n=>(n*3.6).toFixed(0),transform:n=>n,smoothSigma:2},gradient:{label:"Gradient",field:"gradient",unit:"%",color:et.gradient.color,abbr:"grad",icon:et.gradient.icon,fmt:n=>n.toFixed(1),fmtAxis:n=>n.toFixed(0),smoothSigma:2},power:{label:"Power",field:"power",unit:"W",color:et.power.color,abbr:"pwr",icon:et.power.icon,fmt:n=>Math.round(n).toString(),fmtAxis:n=>Math.round(n).toString()},hr:{label:"Heart Rate",field:"hr",unit:"bpm",color:et.hr.color,abbr:"hr",icon:et.hr.icon,fmt:n=>Math.round(n).toString(),fmtAxis:n=>Math.round(n).toString()},cadence:{label:"Cadence",field:"cad",unit:"rpm",color:et.cadence.color,abbr:"cad",icon:et.cadence.icon,fmt:n=>Math.round(n).toString(),fmtAxis:n=>Math.round(n).toString()},temperature:{label:"Temp",field:"temp",unit:"\xB0C",color:et.temperature.color,abbr:"temp",icon:et.temperature.icon,fmt:n=>n.toFixed(1),fmtAxis:n=>Math.round(n).toString(),smoothSigma:6},gearRear:{label:"Rear Gear",field:"gearRearTooth",unit:"T",color:et.gearRear.color,abbr:"rgr",icon:et.gearRear.icon,fmt:n=>Math.round(n).toString(),fmtAxis:n=>Math.round(n).toString()},gearFront:{label:"Front Gear",field:"gearFrontTooth",unit:"T",color:et.gearFront.color,abbr:"fgr",icon:et.gearFront.icon,fmt:n=>Math.round(n).toString(),fmtAxis:n=>Math.round(n).toString()},gears:{label:"Gears",field:"gears",unit:"",color:et.gears.color,abbr:"gr",icon:et.gears.icon,fmt:n=>n.toFixed(2),fmtAxis:n=>n.toFixed(1)},battery:{label:"Battery",field:"battery",unit:"%",color:et.battery.color,abbr:"bat",icon:et.battery.icon,fmt:n=>Math.round(n).toString(),fmtAxis:n=>Math.round(n).toString()},vam:{label:"VAM",field:"ele",unit:"m/h",color:"#FFA07A",abbr:"vam",icon:"trending_up",fmt:n=>Math.round(n).toString(),fmtAxis:n=>Math.round(n).toString(),smoothSigma:5,compute:(n,e)=>{let t=new Array(n.length).fill(null);for(let r=1;r0&&(t[r]=o/a*3600)}}return e(t)}}};var ri={cycling:{name:"Cycling",icon:"directions_bike",defaultPreset:"speed"},skiing:{name:"Skiing",icon:"downhill_skiing",defaultPreset:"speed"},running:{name:"Running",icon:"directions_run",defaultPreset:"pace",paceUnit:"km"},swimming:{name:"Swimming",icon:"pool",defaultPreset:"pace",paceUnit:"100m"}};function P6(n){if(!n)return"question_mark";let e=n.toLowerCase();return ri[e]?.icon||"exercise"}var Oe=(()=>{let n=[],e=null,t="time",r="speed",s=null,i=null,o=!1,a=!1,c=new Set(["elevation"]),u=new Set,d=new Set(["speed","gradient","vam","temperature"]),p=new Set(["power"]),f="time",h=null,m=[],g=null,y=null,b=!1,E=!1,_=null,V=null,M=null,j=null,G=null,W=null,xe=null,pe=null,$=null,ee=null,we=null,We=null,P=130,A=28,S=20,x=!0,C=null,I=null,F=null,J=null,ie=null,ve=null,oe=null;function ke(T,D,R,O){$=T,ee=D,we=R,We=O,I=document.getElementById("charts-container"),I?.addEventListener("scroll",()=>{M&&G&&j&&UN(M,G,j)}),F=document.getElementById("chart-empty"),J=document.getElementById("chart-stats-sel"),ie=document.getElementById("btn-reset-selection"),C=document.getElementById("hist-tooltip"),i=R6.sync("strasse-sync"),document.getElementById("sel-cancel-btn")?.addEventListener("click",He),ie?.classList.add("hidden");let Q=new Set(["w","a","s","d"]),q=new Set;document.addEventListener("keydown",te=>{if(!n.length||!h||["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName||""))return;let X=te.key.toLowerCase();if(!Q.has(X))return;te.preventDefault(),q.add(X);let ne=n[0].uplot;xe||(xe=[ne.scales.x.min,ne.scales.x.max]);let[fe,le]=xe,me=(le-fe)*.1,he=.15,Z=fe,Le=le;if(X==="a")Z=fe-me,Le=le-me;else if(X==="d")Z=fe+me,Le=le+me;else if(X==="w"||X==="s"){let Te=V!==null?V:(fe+le)/2,qe=X==="w"?1-he:1+he*1.2;Z=Te-(Te-fe)*qe,Le=Te+(le-Te)*qe}let Ve=[n[0].xData[0],n[0].xData[n[0].xData.length-1]];if(ZVe[1]){let Te=Le-Ve[1];Z-=Te,Le-=Te}Z=Math.max(Ve[0],Z),Le=Math.min(Ve[1],Le),Le-Z>.001&&(xe=[Z,Le],se(Z,Le,!0))}),document.addEventListener("keyup",te=>{let X=te.key.toLowerCase();Q.has(X)&&q.delete(X)})}function se(T,D,R=!1){if(!n.length)return;if(!R){n.forEach(({uplot:ne})=>ne.setScale("x",{min:T,max:D}));return}let O=W?W[0]:n[0].uplot.scales.x.min,Q=W?W[1]:n[0].uplot.scales.x.max;pe&&cancelAnimationFrame(pe);let q=(ne,fe,le)=>ne+(fe-ne)*le,te=.25,X=()=>{if(!xe)return;let[ne,fe]=xe,le=q(W[0],ne,te),ce=q(W[1],fe,te);n.forEach(({uplot:me})=>{me.setScale("x",{min:le,max:ce})}),Math.abs(le-ne)>1e-4||Math.abs(ce-fe)>1e-4?pe=requestAnimationFrame(X):pe=null};pe=requestAnimationFrame(X)}function B(T,D=[],R=!1){_=null,g=null,y=null,m=D,u=new Set(Object.entries(Os).filter(([,O])=>T.points.some(Q=>Q[O.field]!=null)).map(([O])=>O)),c.size===0&&(c=new Set(["elevation"].filter(O=>u.has(O)))),document.querySelectorAll(".metric-pill").forEach(O=>{let Q=O,q=Q.dataset.metric,te=u.has(q);Q.classList.toggle("active",te&&c.has(q)),Q.classList.toggle("disabled",!te)}),h=T,R?KN(T):nt(),window.__trackStateService?.graphsTab?.syncFromChartView()}function z(){_=null,g=null,y=null,h=null,eg(),F||(F=document.getElementById("chart-empty")),F&&(F.style.display="flex",F.innerHTML=` + no_sim +
Select a track to view analysis
+ `);let T=document.getElementById("chart-stats");T&&T.classList.add("hidden"),Ct(),ve=null,oe&&oe(null),window.__trackStateService?.graphsTab?.syncFromChartView()}function L(){pe!==null&&(cancelAnimationFrame(pe),pe=null),c=new Set(["elevation"]),u=new Set,d=new Set(["speed","gradient","vam","temperature"]),p=new Set(["power"]),f="time",m=[],W=null,xe=null,V=null,M=null,j=null,G=null,x=!0,z(),document.querySelectorAll("#metric-pills .metric-pill").forEach(R=>{let O=R;O.classList.toggle("active",c.has(O.dataset.metric)),O.classList.remove("disabled","overflow-hidden")});let T=document.getElementById("pill-overflow");T&&T.classList.add("hidden");let D=document.getElementById("chart-toolbar");D&&D.classList.remove("collapsed"),document.querySelectorAll("#x-axis-ctrl .seg-btn").forEach(R=>{R.classList.toggle("active",R.dataset.axis==="time")}),window.__trackStateService?.graphsTab?.syncFromChartView()}function U(T){c.has(T)?c.delete(T):c.add(T),h&&nt(!0),window.__trackStateService?.graphsTab?.syncFromChartView()}function H(T,D,R=!1){let O=d.has(T);D&&!O?(d.add(T),h&&!R&&nt(!0)):!D&&O&&(d.delete(T),h&&!R&&nt(!0))}function ae(T,D){let R=p.has(T);D&&!R?(p.add(T),h&&nt(!0)):!D&&R&&(p.delete(T),h&&nt(!0))}function K(T){c=new Set(T),h&&nt(!0),document.querySelectorAll(".metric-pill").forEach(D=>{let R=D;R.classList.toggle("active",c.has(R.dataset.metric))}),window.__trackStateService?.graphsTab?.syncFromChartView()}function Ee(T){if(f===T||!h){f=T,window.__trackStateService?.graphsTab?.syncFromChartView();return}let D=h.points,R=D.find(q=>q.time!=null)?.time||0,O=q=>{if(q===null)return null;let te=0;if(f==="distance"){let X=q*1e3;te=D.findIndex(ne=>(ne.dist||0)>=X)}else{let X=R+q*1e3;te=D.findIndex(ne=>(ne.time||0)>=X)}return te===-1&&(te=D.length-1),T==="distance"?(D[te].dist||0)/1e3:((D[te].time||R)-R)/1e3};g!==null&&(g=O(g)),y!==null&&(y=O(y));let Q=null;if(n.length){let q=n[0].uplot,te=O(q.scales.x.min),X=O(q.scales.x.max);te!==null&&X!==null&&(Q=[te,X])}f=T,nt(!0),Q&&(o=!0,n.forEach(({uplot:q})=>{q.batch(()=>q.setScale("x",{min:Q[0],max:Q[1]}))}),o=!1)}function ue(){x=!x,n.forEach(({histCol:T})=>T.classList.toggle("visible",x)),ot()}function Ce(T){oe=T}function Me(T,D=!1){ve===T||T===null?(ve=null,Je(),oe&&oe(null)):(ve=T,Je(),It()),h&&!D&&nt(!0)}function Je(){document.querySelectorAll(".map-color-btn").forEach(T=>{let D=T;D.classList.toggle("active",D.dataset.metric===ve)})}function It(){if(!oe||!ve||!h)return;let T=n.find(R=>R.metricKey===ve);if(!T)return;let D=Pt(ve,T.yData);oe({pts:h.points,colors:D})}function Pt(T,D){let R=D.filter(ce=>ce!=null&&isFinite(ce));if(!R.length)return D.map(()=>"#888896");let O=Math.min(...R),Q=Math.max(...R),q=h?.sport,te=q?ri[q.toLowerCase()]:null,X=te?.defaultPreset||"speed",fe=St.get().speed_mode||X,le=te?.paceUnit||"km";return D.map(ce=>{if(ce==null||!isFinite(ce))return"#888896";if(T==="gradient")return Bb(ce);if(T==="speed"){if(fe==="pace"){let he=(le==="km"?1e3:100)/ce;return XN(he)}return XN(ce)}let me=Q===O?.5:Math.max(0,Math.min(1,(ce-O)/(Q-O)));return me<=.25?Ri("#4575b4","#91bfdb",me/.25):me<=.5?Ri("#91bfdb","#fee090",(me-.25)/.25):me<=.75?Ri("#fee090","#fc8d59",(me-.5)/.25):Ri("#fc8d59","#d73027",(me-.75)/.25)})}function de(){He()}function He(){g=null,y=null,_=null,We&&We(null),n.forEach(T=>{T.pinnedHistY=null}),rt(),fr(),o=!0,n.forEach(({uplot:T,xData:D})=>{T.batch(()=>T.setScale("x",{min:D[0],max:D[D.length-1]})),T._strasse?.updateHeaderStats(D[0],D[D.length-1])}),o=!1,ee&&ee(null,null,f)}function Zt(T){if(window.__trackStateService?.graphsTab?.setSelectionStats(T),J||(J=document.getElementById("chart-stats-sel")),!J)return;let D=(R,O)=>{let Q=document.querySelector(`#${R} .stat-value`);Q&&(Q.textContent=O)};D("sel-distance",T.totalDist!=null?`${(T.totalDist/1e3).toFixed(1)} km`:"\u2014"),D("sel-duration",T.duration!=null?wn(Math.floor(T.duration/1e3)):"\u2014"),D("sel-elevation",T.elevGain!=null?`${Math.round(T.elevGain)} m`:"\u2014"),D("sel-avg-speed",T.avgSpeed!=null?`${(T.avgSpeed*3.6).toFixed(1)} km/h`:"\u2014"),D("sel-avg-power",T.avgPower!=null?`${T.avgPower} W`:"\u2014"),D("sel-avg-hr",T.avgHR!=null?`${T.avgHR} bpm`:"\u2014"),D("sel-avg-temp",T.avgTemp!=null?`${T.avgTemp.toFixed(1)} \xB0C`:"\u2014"),J.classList.remove("hidden"),ie&&ie.classList.remove("hidden")}function Ct(){window.__trackStateService?.graphsTab?.setSelectionStats(null),J||(J=document.getElementById("chart-stats-sel")),J&&J.classList.add("hidden"),ie&&ie.classList.add("hidden"),["sel-distance","sel-duration","sel-elevation","sel-avg-speed","sel-avg-power","sel-avg-hr","sel-avg-temp"].forEach(T=>{let D=document.querySelector(`#${T} .stat-value`);D&&(D.textContent="--")})}function Jt(T,D,R=!1){if(!h)return;let O=h.points,Q=O.find(fe=>fe.time!=null)?.time||0,q=((O[O.length-1]?.time||0)-Q)/1e3;T>1e12&&(T=(T-Q)/1e3),D>1e12&&(D=(D-Q)/1e3),T=Math.max(0,Math.min(T,q)),D=Math.max(0,Math.min(D,q));let te=fe=>{if(f==="time")return fe;let le=Q+fe*1e3,ce=O.findIndex(me=>(me.time||0)>=le);return ce===-1&&(ce=O.length-1),(O[ce].dist||0)/1e3},X=te(T),ne=te(D);g=X,y=ne,W=[X,ne],!R&&(o=!0,n.forEach(({uplot:fe})=>{fe.batch(()=>fe.setScale("x",{min:X,max:ne}))}),o=!1,yt(),fr())}function ot(){if((!I||!I.isConnected)&&(I=document.getElementById("charts-container")),!n.length||!I)return;let T=Math.round(Math.max(100,I.getBoundingClientRect().width-A-(x?P+S:0))),D=!1;n.forEach(({uplot:R,histCanvas:O,histData:Q})=>{T!==R.width&&(R.setSize({width:T,height:R.height}),D=!0,x&&O&&Q&&ia(O,Q,R.height))}),D&&rt()}function nt(T=!1){(!I||!I.isConnected)&&(I=document.getElementById("charts-container")),(!F||!F.isConnected)&&(F=document.getElementById("chart-empty"));let D=null,R=0;if(T&&I&&(R=I.scrollTop),T&&W)D=[W[0],W[1]];else if(T&&n.length){let Ve=n[0].uplot;D=[Ve.scales.x.min,Ve.scales.x.max]}if(!h){eg(T);return}let O=h.points;if(!O.length){eg(T);return}let Q=h?.sport,q=Q?ri[Q.toLowerCase()]:null,te=q?.defaultPreset||"speed",ne=St.get().speed_mode||te,fe=q?.paceUnit||"km",le=[...c].filter(Ve=>O.some(Te=>Te[Os[Ve].field]!=null));if(!le.length){eg(T),F&&(F.style.display="flex",F.innerHTML=` + no_sim +
No data for selected metrics
+ `);return}F&&(F.style.display="none");let ce=I?I.getBoundingClientRect().width:800,me=Math.round(Math.max(100,ce-A-(x?P+S:0))),he=T&&e===h&&t===f&&r===ne&&s===ve&&n.length>0,Z;if(he)Z=n[0].xData;else if(f==="distance")Z=O.map(Ve=>(Ve.dist||0)/1e3);else{let Ve=O.find(qe=>qe.time!=null)?.time||0,Te=0;Z=O.map(qe=>(qe.time!=null&&(Te=(qe.time-Ve)/1e3),Te))}let Le=new Map;if(he){C&&(C.style.display="none");let Ve=new Set(le);for(let Te of n){let qe=d.has(Te.metricKey),Ne=p.has(Te.metricKey);Ve.has(Te.metricKey)&&Te.smoothed===qe&&Te.incZero===Ne&&Te.w===me?Le.set(Te.metricKey,Te):(i.unsub(Te.uplot),Te.uplot.destroy(),Te.row.remove())}n=[]}else eg(T);if(I){let Ve=new Array(le.length).fill(null),Te=null;for(let qe=le.length-1;qe>=0;qe--){Ve[qe]=Te;let Ne=Le.get(le[qe]);Ne&&(Te=Ne.row)}le.forEach((qe,Ne)=>{let Re=Le.get(qe);if(Re){n.push(Re);let Ae=Re.uplot,Bt=Ae._strasse,Mt=o;o=!0,Ae.batch(()=>{D&&(Ae.scales.x.min!==D[0]||Ae.scales.x.max!==D[1])?Ae.setScale("x",{min:D[0],max:D[1]}):(Bt?.updateHeaderStats(Ae.scales.x.min,Ae.scales.x.max,Ae),Ae.redraw(!1))}),o=Mt;let jt=null;if(_!=null&&Re.xData[_]!=null&&Re.yData[_]!=null&&(kn(Re.histData),Re.histData.min!=null&&Re.histData.max!=null)){let Mn=Re.histData.max-Re.histData.min||1;jt=Math.min(Re.histData.BINS-1,Math.floor((Re.yData[_]-Re.histData.min)/Mn*Re.histData.BINS)),Re.hoveredHistY=Re.yData[_]}ia(Re.histCanvas,Re.histData,130,jt);return}let Ue=Os[qe],ut=Ue.transform,lt=Ue.fmt,Ut=Ue.fmtAxis,Yt=Ue.unit,Tn=Ue.label;qe==="speed"&&ne==="pace"&&(Tn="Pace",Yt=`min/${fe}`,lt=Ae=>Yd(Ae),Ut=Ae=>Yd(Ae),ut=Ae=>Ae==null||Ae<.1?null:(fe==="km"?1e3:100)/Ae,Ue={...Ue,label:Tn,unit:Yt,fmt:lt,fmtAxis:Ut,transform:ut});let pn=Ue.compute?Ue.compute(O,QN):QN(O.map(Ae=>{let Bt=Ae[Ue.field];return Bt!=null&&ut?ut(Bt):Bt}));d.has(qe)&&(pn=zm(pn,Ue.smoothSigma||2)),at(qe,Ue,Z,pn,me,O,D,Ve[Ne])})}e=h,t=f,r=ne,s=ve,KN(h),g!=null&&y!=null&&yt(),Je(),ve&&It(),T&&I&&R>0&&(I.scrollTop=R)}function at(T,D,R,O,Q,q,te=null,X=null){let ne=h?.sport,le=(ne?ri[ne.toLowerCase()]:null)?.defaultPreset||"speed",me=St.get().speed_mode||le,he=T==="elevation"?$9(q,20):null,Z=document.createElement("div");Z.className="chart-row",Z.dataset.metric=T,Z.style.setProperty("--chart-color",D.color);let Le=document.createElement("div");Le.className=`chart-row-header${x?" with-histogram":""}`;let Ve=document.createElement("div");Ve.className="chart-row-label-group",Ve.innerHTML=` + ${D.icon} + ${D.label} + `;let Te=document.createElement("button");Te.className=`icon-btn mini smooth-btn${d.has(T)?" active":""}`,Te.title="Toggle data smoothing",Te.innerHTML=`${d.has(T)?"blur_on":"blur_off"}`,Te.addEventListener("click",be=>{be.stopPropagation(),d.has(T)?d.delete(T):d.add(T),nt(!0)});let qe=document.createElement("button");qe.className=`map-color-btn icon-btn${ve===T?" active":""}`,qe.dataset.metric=T,qe.title="Color map track by this metric",qe.innerHTML='colorize',qe.addEventListener("click",()=>Me(T));let Ne=null;if(T==="cadence"||T==="power"||T==="speed"){Ne=document.createElement("button");let be=p.has(T);Ne.className=`icon-btn mini${be?" active":""}`,Ne.title=be?"Currently INCLUDING 0 values":"Currently EXCLUDING 0 values",Ne.innerHTML=`${be?"exposure_zero":"mobile_off"}`,Ne.addEventListener("click",je=>{je.stopPropagation(),p.has(T)?p.delete(T):p.add(T),nt(!0)})}let Re=document.createElement("div");Re.className="chart-stats-total";let Ue=document.createElement("div");Ue.className="chart-stats-selection";let ut=document.createElement("div");ut.className="chart-row-stats-container",ut.append(Re,Ue);let lt=document.createElement("div");lt.className="chart-row-actions",lt.append(Te,qe);let Ut=document.createElement("div");if(Ut.className="chart-row-right-actions",T==="speed"){let be=document.createElement("div");be.className="seg-ctrl",be.innerHTML=` + + + `,be.addEventListener("click",je=>{let qt=je.target.closest(".seg-btn");if(!qt)return;let Wt=qt.dataset.mode;if(Wt==="speed"||Wt==="pace"){let mt=Wt===le;St.patch({speed_mode:mt?null:Wt}),nt(!0)}}),Ut.append(be)}Ne&&Ut.append(Ne),Le.append(Ve,lt,ut,Ut);let Yt=document.createElement("div");Yt.className="chart-row-body";let Tn=document.createElement("div");Tn.style.position="relative",Yt.appendChild(Tn);let pn=document.createElement("div");pn.className="fixed-x-label fixed-x-min";let Ae=document.createElement("div");Ae.className="fixed-x-label fixed-x-max",Tn.append(pn,Ae);let Bt=document.createElement("div");Bt.className=`hist-col${x?" visible":""}`;let Mt=document.createElement("canvas");Mt.className="hist-canvas",Bt.appendChild(Mt),Yt.appendChild(Bt),Z.append(Le,Yt);let jt=f==="distance";function Mn(be,je){if(be==null)return"";if(jt){let qt=je<1?3:je<5?2:je<20?1:0;return`${be.toFixed(qt)} km`}else{let qt=Math.abs(be),Wt=Math.floor(qt/3600),mt=Math.floor(qt%3600/60),Lr=Math.round(qt%60),lr=Wt>0?`${Wt}:`:"",Fi=Wt>0?String(mt).padStart(2,"0"):String(mt),bs=String(Lr).padStart(2,"0");return`${be<0?"-":""}${lr}${Fi}:${bs}`}}let Zn=p.has(T)||T!=="power"&&T!=="cadence"&&T!=="speed",Yn=1/0,Rt=-1/0,Nn=0,Ir=0,os=1/0,oa=-1/0,Xr=0,ol=0;for(let be=0;beRt&&(Rt=je),Nn+=je,Ir++,(je!==0||Zn)&&(jeoa&&(oa=je),Xr+=je,ol++))}Ir===0&&(Yn=0,Rt=100);let GC=Ir?{min:Yn,max:Rt,avg:Nn/Ir}:null,Hb=ol?{min:os,max:oa,avg:Xr/ol}:null,tP=Math.abs(Rt-Yn)*.1||1,U9=[Yn-tP,Rt+tP],nP=!1;function ZC(be,je,qt){let Wt=p.has(T)||T!=="power"&&T!=="cadence"&&T!=="speed",mt=je-be;pn.textContent=Mn(be,mt),Ae.textContent=Mn(je,mt);let Lr=(lr,Fi,bs=!1)=>{let Vs=bs&&Wt===Zn?Hb:qN(R,O,lr,Fi,Wt);if(!Vs)return"";let ll=` + align_flex_end${D.fmt(Vs.min,!0)} ${D.unit} + align_center${D.fmt(Vs.avg,!0)} ${D.unit} + align_flex_start${D.fmt(Vs.max,!0)} ${D.unit} + `;if(T==="elevation"){let bo=R9(q,lr,Fi);ll+=` + trending_up+${Math.round(bo.gain)} m + trending_down-${Math.round(bo.loss)} m + `}return ll};nP||(nP=!0,Re.innerHTML=`all_inclusive${Lr(R[0],R[R.length-1],!0)}`,Re.querySelector(".all-chip")?.addEventListener("click",lr=>{lr.stopPropagation(),He()})),g!==null&&y!==null?(Ue.innerHTML=Lr(g,y,!1),Ue.style.display="flex",Ue.style.setProperty("--sel-color",D.color)):Ue.style.display="none"}let q9=!1,W9={width:Q,height:130,padding:[4,0,0,0],cursor:{sync:{key:i.key},drag:{x:!0,y:!1,uni:16},focus:{prox:16},points:{size:7,stroke:"#0e0e10",width:2,fill:T==="elevation"?(be,je)=>Bb(he?he[be.cursor.idx]:null):D.color},x:!1,y:!1},select:{show:!0,left:0,top:0,width:0,height:0},legend:{show:!1},scales:{x:{time:!1,range:(be,je,qt)=>[je,qt],min:te?te[0]:void 0,max:te?te[1]:void 0},y:{range:()=>U9,dir:T==="speed"&&me==="pace"?-1:1}},axes:[{side:2,stroke:"#555564",grid:{stroke:"#2e2e34",width:1},ticks:{show:!0,stroke:"#2e2e34"},size:30,space:80,font:"10px system-ui, sans-serif",splits:(be,je,qt,Wt)=>{let mt=Wt-qt,lr=(be.bbox.width>0?be.bbox.width:be.width)/80,Fi=mt/lr,bs;jt?bs=[.01,.02,.05,.1,.2,.25,.5,1,2,5,10,20,50,100,200,500,1e3,2e3,5e3,1e4,2e4,5e4,1e5,2e5,5e5,1e6]:bs=[1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,28800,43200,86400,604800,2592e3,31536e3];let Vs=bs[bs.length-1];for(let wo=0;wo=Fi){Vs=bs[wo];break}let ll=[],bo=Math.ceil(qt/Vs)*Vs,Xb=Vs<1?2:0;for(;bo<=Wt;){let wo=be.valToPos(bo,"x",!0);wo>=be.bbox.left+80&&wo<=be.bbox.left+be.bbox.width-80&&ll.push(Number(bo.toFixed(Xb))),bo+=Vs}return ll},values:(be,je)=>{let qt=(be.scales.x?.max??1)-(be.scales.x?.min??0);return je.map(Wt=>{if(Wt==null)return"";let mt=be.valToPos(Wt,"x",!0);return mtbe.bbox.left+be.bbox.width-80?null:Mn(Wt,qt)})}},{side:3,stroke:"#555564",grid:{stroke:"#2e2e34",width:1},ticks:{stroke:"#2e2e34"},size:55,font:"10px system-ui, sans-serif",values:(be,je)=>je.map(qt=>qt!=null?D.fmtAxis(qt):"")}],series:[{},{label:D.label,stroke:"rgba(0,0,0,0)",width:0,points:{show:!1},paths:()=>null}],hooks:{draw:[be=>{let je=be.bbox.top+be.bbox.height+5;pn.style.top=`${je}px`,pn.style.left=`${be.bbox.left}px`,Ae.style.top=`${je}px`,Ae.style.left=`${be.bbox.left+be.bbox.width}px`,Ae.style.transform="translateX(-100%)"},be=>{T==="gears"?eP(be,R,O,D.color,1.5,T,null,q):T==="elevation"?F9(be,R,O,he):T==="gradient"?L9(be,R,O):ve===T?j9(be,R,O,q,T):eP(be,R,O,D.color,1.5,T,null,q)},be=>{let je=n.find(Wt=>Wt.uplot===be);if(!je)return;let qt=be._strasse;_!=null?O9(be,R,O,D.color,D,q,T):(qt&&qt.pinYVal&&(qt.pinYVal.style.display="none"),je.pinnedHistY!=null&&B9(be,R,O,je.pinnedHistY,D.color,D))},be=>{let je=be.cursor.idx,qt=_!=null,Wt=je!=null&&be.cursor.left>=0;if(Wt&&_==null){let mt=be.valToPos(O[je],"y",!0);Math.abs(be.cursor.top-mt)>100&&(Wt=!1)}if(Wt&&je!==_&&ZN(be,q,je,Gt(D.color,.4),1),g!=null&&y!=null){let mt=be.ctx,Lr=window.devicePixelRatio||1,lr=be.bbox,Fi=be.valToPos(g,"x",!0),bs=be.valToPos(y,"x",!0);mt.save(),mt.beginPath(),mt.lineWidth=3*Lr,mt.strokeStyle=D.color,mt.moveTo(Fi,lr.top+lr.height),mt.lineTo(bs,lr.top+lr.height),mt.stroke();let Vs=Math.abs(y-g),ll=f==="distance"?`${Vs.toFixed(2)} km`:wn(Vs),bo=9*Lr,Xb=`bold ${bo}px system-ui, sans-serif`;mt.font!==Xb&&(mt.font=Xb);let wo=mt.measureText(ll).width,sP=Math.max(lr.left,Fi),iP=Math.min(lr.left+lr.width,bs);if(iP-sP>wo+14*Lr){let G9=5*Lr,Z9=2*Lr,Qb=wo+G9*2,Kb=bo+Z9*2,XC=(sP+iP)/2-Qb/2,QC=lr.top+lr.height-Kb/2;mt.beginPath(),mt.roundRect?mt.roundRect(XC,QC,Qb,Kb,3*Lr):mt.rect(XC,QC,Qb,Kb),mt.fillStyle=D.color,mt.fill(),mt.fillStyle="#000",mt.textAlign="center",mt.textBaseline="middle",mt.fillText(ll,XC+Qb/2,QC+Kb/2)}mt.restore()}qt&&YN(be,q,_,D.color,!0,.7),Wt&&je!==_&&YN(be,q,je,D.color,!0,1)}],setCursor:[be=>{if(o)return;let je=be.cursor.idx;be.redraw(!1),be.cursor.left>=0?V=be.posToVal(be.cursor.left,"x"):V=null;let qt=be._strasse,Wt=je!=null&&O[je]!=null;if(Wt&&_==null){let mt=be.valToPos(O[je],"y",!0);Math.abs(be.cursor.top-mt)>100&&(Wt=!1)}if(qt&&(Wt?WN(be,qt.curYVal,je,R,O,q,D,T):qt.curYVal.style.display="none"),a||(je!=null&&q[je]?$&&(_!=null||Wt)?$(q[je]):$&&!Wt&&$(null):je===null&&$&&$(null)),je!=null&&O[je]!=null){let{min:mt,max:Lr}=Fr;if(mt!=null&&Lr!=null){let lr=Lr-mt||1,Fi=Math.min(Fr.BINS-1,Math.floor((O[je]-mt)/lr*Fr.BINS));al.hoveredHistY!==O[je]&&(al.hoveredHistY=O[je],ia(Mt,Fr,130,Fi))}}else al.hoveredHistY!==null&&(al.hoveredHistY=null,ia(Mt,Fr,130))}],setScale:[(be,je)=>{if(je!=="x"||q9)return;let{min:qt,max:Wt}=be.scales.x;W=[qt,Wt],ZC(qt,Wt,be),!o&&(E||(xe=null),o=!0,n.forEach(({uplot:mt})=>{mt!==be&&mt.batch(()=>mt.setScale("x",{min:qt,max:Wt}))}),o=!1,rt(),fr(),ee&&g!==null&&ee(g,y,f))}],setSelect:[be=>{if(E)return;xe=null;let{left:je,width:qt}=be.select;if(qt>0){let Wt=be.posToVal(je,"x"),mt=be.posToVal(je+qt,"x");g=Wt,y=mt,ZC(be.scales.x.min,be.scales.x.max,be),rt(),fr(),ee&&ee(g,y,f),be.setSelect({left:0,top:0,width:0,height:0},!1)}}]}},YC=document.createElement("div");YC.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:visible;z-index:5";let jb=document.createElement("div");jb.className="sel-fill",jb.style.display="none";let Ub=document.createElement("div");Ub.className="sel-line sel-line-anchor",Ub.style.display="none";let qb=document.createElement("div");qb.className="sel-line-label sel-line-label-anchor",qb.style.display="none";let rg=document.createElement("div");rg.className="sel-handle sel-handle-anchor",rg.style.display="none";let sg=document.createElement("div");sg.className="sel-graph-marker",sg.innerHTML=`play_circle`,sg.style.display="none";let Wb=document.createElement("div");Wb.className="sel-line sel-line-end",Wb.style.display="none";let zb=document.createElement("div");zb.className="sel-line-label sel-line-label-end",zb.style.display="none";let ig=document.createElement("div");ig.className="sel-handle sel-handle-end",ig.style.display="none";let og=document.createElement("div");og.className="sel-graph-marker",og.innerHTML=`stop_circle`,og.style.display="none";let Gb=document.createElement("div");Gb.className="cur-y-val",Gb.style.cssText=`color:${D.color};display:none`;let Zb=document.createElement("div");Zb.className="cur-y-val pin",Zb.style.cssText=`color:${D.color};display:none`,YC.append(jb,Ub,qb,rg,sg,Wb,zb,ig,og,Gb,Zb);let Fr={yData:O,xData:R,def:D,BINS:24,min:Ir?Yn:void 0,max:Ir?Rt:void 0,fullStats:Hb,fullStatsAll:GC},al={uplot:null,row:Z,xData:R,yData:O,def:D,metricKey:T,statsTotalEl:Re,statsSelEl:Ue,histCol:Bt,histCanvas:Mt,histData:Fr,hoveredHistY:null,pinnedHistY:null,smoothed:d.has(T),incZero:p.has(T),w:Q};Fr.plot=al;let z9=o;o=!0;let aa=new R6(W9,[R,O],(be,je)=>{al.uplot=be,n.push(al),Tn.appendChild(be.root),be.over.appendChild(YC),be._strasse={selFill:jb,anchorLine:Ub,anchorLabel:qb,anchorHandle:rg,anchorMarker:sg,endLine:Wb,endLabel:zb,endHandle:ig,endMarker:og,curYVal:Gb,pinYVal:Zb,updateHeaderStats:ZC},be.batch(()=>{je()})});o=z9,Ht(rg,aa,R,!0),Ht(ig,aa,R,!1);let Yb=null;aa.over.addEventListener("mousedown",be=>{if(be.button!==0)return;b=!1;let je=aa.over.getBoundingClientRect();Yb=be.clientX-je.left}),aa.over.addEventListener("mousemove",be=>{if(Yb!==null){let je=aa.over.getBoundingClientRect();Math.abs(be.clientX-je.left-Yb)>5&&(b=!0)}}),aa.over.addEventListener("mouseup",()=>{Yb=null}),aa.over.addEventListener("click",()=>{if(b)return;let be=aa.cursor.idx;be!=null&&q[be]&&(_=be,n.forEach(({uplot:je})=>je.redraw(!1)),we&&we(q[be],be),We&&We(be))}),Z.addEventListener("dblclick",He);let rP=null;if(_!=null&&R[_]!=null&&O[_]!=null&&(kn(Fr),Fr.min!=null&&Fr.max!=null)){let be=Fr.max-Fr.min||1;rP=Math.min(Fr.BINS-1,Math.floor((O[_]-Fr.min)/be*Fr.BINS)),al.hoveredHistY=O[_]}ia(Mt,Fr,130,rP),P9(Mt,Fr),I&&(X?I.insertBefore(Z,X):I.appendChild(Z))}function rt(){yt(),n.forEach(({uplot:T})=>T.batch(()=>T.redraw(!1)))}function yt(){n.forEach(({uplot:T,def:D})=>{let R=T._strasse;if(!R)return;let{selFill:O,anchorLine:Q,anchorLabel:q,anchorHandle:te,anchorMarker:X,endLine:ne,endLabel:fe,endHandle:le,endMarker:ce}=R;if(g==null||y==null){[O,Q,q,te,X,ne,fe,le,ce].forEach(lt=>{lt.style.display="none"});return}let me=T.valToPos(g,"x"),he=T.valToPos(y,"x"),Z=window.devicePixelRatio||1,Le=T.bbox,Ve=Le.width/Z,Te=Le.height/Z,qe=(Le.top+Le.height)/Z,Ne=me>=0&&me<=Ve,Re=he>=0&&he<=Ve,Ue=Math.max(0,me),ut=Math.min(Ve,he);if(ut>Ue?(O.style.left=`${Ue}px`,O.style.width=`${ut-Ue}px`,O.style.top="0",O.style.height=`${Te}px`,O.style.backgroundColor=Gt(D.color,.07),O.style.display=""):O.style.display="none",Ne){Q.style.left=`${me}px`,Q.style.height=`${Te}px`,Q.style.borderLeftColor=D.color,Q.style.display="";let lt=At(g);q.textContent=lt;let Ut=lt.length*7+10;q.style.left=me+Ut+4lt.style.display="none");if(Re){ne.style.left=`${he}px`,ne.style.height=`${Te}px`,ne.style.borderLeftColor=D.color,ne.style.display="";let lt=At(y);fe.textContent=lt;let Ut=lt.length*7+10;fe.style.left=he-Ut-3>0?`${he-Ut-3}px`:`${he+3}px`,fe.style.display="",le.style.left=`${he}px`,le.style.backgroundColor=D.color,le.style.display="",ce.style.left=`${he}px`,ce.style.top=`${qe}px`;let Yt=ce.querySelector(".material-symbols-rounded");Yt&&(Yt.style.color=D.color),ce.style.display=""}else[ne,fe,le,ce].forEach(lt=>lt.style.display="none")})}function At(T){return f==="distance"?`${T.toFixed(2)} km`:wn(T)}function Ht(T,D,R,O){T.style.pointerEvents="auto",T.addEventListener("mousedown",Q=>{Q.stopPropagation(),Q.preventDefault();let q=Q.clientX,te=O?g:y,X=D.over.offsetWidth,ne=D.scales.x.min,fe=D.scales.x.max,le=X/(fe-ne),ce=[R[0],R[R.length-1]];document.body.style.cursor="ew-resize",b=!0;function me(Z){let Le=Z.clientX-q,Ve=(te||0)+Le/le;Ve=Math.max(ce[0],Math.min(ce[1],Ve)),O?g=Math.min(Ve,(y||ce[1])-.001):y=Math.max(Ve,(g||ce[0])+.001),n.forEach(Te=>Te.uplot._strasse?.updateHeaderStats(Te.uplot.scales.x.min,Te.uplot.scales.x.max)),rt(),fr(),ee&&ee(g,y,f)}function he(){document.body.style.cursor="",b=!1,document.removeEventListener("mousemove",me),document.removeEventListener("mouseup",he)}document.addEventListener("mousemove",me),document.addEventListener("mouseup",he)})}function kn(T){let{yData:D,xData:R,BINS:O}=T;if(T._lastYData===D&&T.bins)return;T._lastYData=D;let Q=T.min,q=T.max;if(Q==null||q==null){let ce=1/0,me=-1/0,he=0;for(let Z=0;Zme&&(me=Le),he++)}if(!he)return;Q=ce,q=me,T.min=Q,T.max=q}let te=new Array(O).fill(0),X=new Array(O).fill(0),ne=q-Q||1,fe=T.plot?.metricKey??Object.keys(Os).find(ce=>Os[ce]===T.def),le=!fe||p.has(fe)||fe!=="power"&&fe!=="cadence"&&fe!=="speed";for(let ce=0;ce0&&R[ce-1]!=null?R[ce-1]:R[ce],Le=ce{ia(T,D,R.height)})}function ia(T,D,R,O=null){let{def:Q,BINS:q}=D;kn(D);let{bins:te,min:X,max:ne}=D;if(!te||X==null||ne==null)return;let fe=g!=null&&y!=null;if(fe&&(D._lastSelRange?.[0]!==g||D._lastSelRange?.[1]!==y)){D._lastSelRange=[g,y];let Ae=new Array(q).fill(0),Bt=new Array(q).fill(0),{yData:Mt,xData:jt}=D,Mn=ne-X||1,Zn=D.plot?.metricKey??Object.keys(Os).find(Rt=>Os[Rt]===D.def),Yn=!Zn||p.has(Zn)||Zn!=="power"&&Zn!=="cadence"&&Zn!=="speed";for(let Rt=0;Rty)continue;let os=Math.min(q-1,Math.floor((Nn-X)/Mn*q));Ae[os]++;let oa=Rt>0&&jt[Rt-1]!=null?jt[Rt-1]:jt[Rt],Xr=RtQ.fmtAxis(Ae),Te="9px system-ui, sans-serif";Z.font!==Te&&(Z.font=Te);let Ne={t:4,r:0,b:30,l:Math.ceil(Math.max(Z.measureText(`${Ve(ne)} ${Q.unit}`).width,Z.measureText(`${Ve(X)} ${Q.unit}`).width))+6};D.padL=Ne.l;let Re=me-Ne.l-Ne.r,Ue=he-Ne.t-Ne.b,ut=Ae=>Ne.t+(q-1-Ae)*(Ue/q),lt=Ue/q-1,Ut=fe?.15:.6;Z.fillStyle=Gt(Q.color,Ut);for(let Ae=0;AeAe+Bt,0);if(Yt>0){let Ae=[{x:Ne.l,y:Ne.t+Ue}],Bt=0;for(let Mt=0;MtMt+jt+2&&Ae0){let Ae=0;for(let Nn=0;Nn{let Q=jN(T,D,O);if(Q!=null&&R){let{min:q,max:te,BINS:X}=D,ne=te-q||1;R.pinnedHistY=q+(Q+.5)*(ne/X),n.forEach(({uplot:fe})=>fe.redraw(!1))}}),T.addEventListener("mousemove",O=>{M=O,UN(O,T,D)}),T.addEventListener("mouseenter",()=>{G=T,j=D}),T.addEventListener("mouseleave",()=>{G===T&&(G=null,j=null),C&&(C.style.display="none");let O=document.getElementById("hist-line");O&&(O.style.display="none"),R&&(R.hoveredHistY=null,ia(T,D,T.height/(window.devicePixelRatio||1)))})}function jN(T,D,R){let{bins:O,BINS:Q}=D;if(!O)return null;let q=T.getBoundingClientRect(),te=R.clientY-q.top,X={t:4,b:30},ne=q.height-X.t-X.b,fe=Math.floor((te-X.t)/ne*Q),le=Q-1-fe;return fe<0||fe>=Q?null:le}function UN(T,D,R){if(!C)return;let{bins:O,binAccum:Q,min:q,max:te,BINS:X,def:ne,plot:fe}=R;if(!O||!Q||q==null||te==null)return;let le=document.getElementById("hist-line"),ce=jN(D,R,T);if(ce==null||!O[ce]){C.style.display="none",le&&(le.style.display="none"),fe&&(fe.hoveredHistY=null,ia(D,R,D.height/(window.devicePixelRatio||1)));return}if(fe){let jt=te-q||1;fe.hoveredHistY=q+(ce+.5)*(jt/X),ia(D,R,D.height/(window.devicePixelRatio||1),ce)}let me=O[ce],he=O.reduce((jt,Mn)=>jt+Mn,0),Z=me/he*100,Le=te-q||1,Ve=q+ce*(Le/X),Te=q+(ce+1)*(Le/X),qe=`${ne.fmt(Ve,!0)} \u2013 ${ne.fmt(Te,!0)} ${ne.unit}`,Ne="",Re=(Ve+Te)/2,Ue=Object.keys(Os).find(jt=>Os[jt]===ne),ut=[];if(Ue==="power"?ut=el.getPowerZones():Ue==="hr"&&(ut=el.getHRZones()),ut.length>0){let jt=ut.findIndex(Zn=>Re>=Zn.min&&Re=ut[ut.length-1].min?ut[ut.length-1]:null;if(Mn){let Zn=jt!==-1?jt:ut.length-1;Ne=` +
+ Z${Zn+1} + \xB7 + ${Mn.name} +
+ `}}let lt=f==="distance"?`${Q[ce].toFixed(2)} km`:wn(Q[ce]),Ut=Q[ce]/Q.reduce((jt,Mn)=>jt+Mn,0)*100,Yt=` +
${qe}
+ ${Ne} + `;if(lt&&(Yt+=`
+ ${f==="distance"?"Dist":"Time"} + ${lt} + ${Ut.toFixed(1)}% +
`),R.selBins&&R.selBinAccum){let jt=f==="distance"?`${R.selBinAccum[ce].toFixed(2)} km`:wn(R.selBinAccum[ce]),Mn=R.selBinAccum[ce]/R.selBinAccum.reduce((Zn,Yn)=>Zn+Yn,0)*100;Yt+=` +
+ Sel ${f==="distance"?"Dist":"Time"} + ${jt} + ${Mn.toFixed(1)}% +
+ `}C.innerHTML=Yt,C.style.display="block";let Tn=C.offsetHeight,pn=C.offsetWidth,Ae=D.getBoundingClientRect(),Bt=Ae.height-4-30,Mt=Ae.top+4+(X-1-ce+.5)*(Bt/X);C.style.left=`${Ae.left-pn-12}px`,C.style.top=`${Mt-Tn/2}px`,le&&(le.style.display="block",le.style.top=`${Mt}px`,le.style.left="0px",le.style.width=`${Ae.left}px`)}function eg(T=!1){C&&(C.style.display="none"),n.forEach(({uplot:D,row:R})=>{i.unsub(D),D.destroy(),R.remove()}),n=[],e=null,T||(g=null,y=null),b=!1}function qN(T,D,R,O,Q=!0){let q=1/0,te=-1/0,X=0,ne=0;for(let fe=0;feO)continue;let le=D[fe];le==null||!isFinite(le)||le===0&&!Q||(lete&&(te=le),X+=le,ne++)}return ne?{min:q,max:te,avg:X/ne}:null}function R9(T,D,R){let O=0,Q=0,q=null,te=f==="distance",X=T[0].time||0;for(let ne=0;neR)&&fe.ele!=null){if(q!=null){let ce=fe.ele-q;ce>0?O+=ce:ce<0&&(Q+=Math.abs(ce))}q=fe.ele}}return{gain:O,loss:Q}}function WN(T,D,R,O,Q,q,te,X){if(R==null||Q[R]==null){D.style.display="none";return}let ne=T.valToPos(O[R],"x",!1),fe=T.valToPos(Q[R],"y",!1),le="#888896",ce=0;if(R>0&&q[R]&&q[R-1]){let Te=q[R-1],qe=q[R],Ne=(qe.dist||0)-(Te.dist||0);Ne>.1&&qe.ele!=null&&Te.ele!=null&&(ce=(qe.ele-Te.ele)/Ne*100,le=Bb(ce))}let me=X!=="elevation"?`${te.fmt(Q[R],!1)} ${te.unit}`:`${te.fmt(Q[R],!1)} ${te.unit} \u2220 ${Math.abs(ce).toFixed(1)}%`;if(X==="gearRear"&&q[R].gearRearTooth!=null)me=`${q[R].gearRearTooth}T (pos ${Q[R]})`;else if(X==="gearFront"&&q[R].gearFrontTooth!=null)me=`${q[R].gearFrontTooth}T (pos ${Q[R]})`;else if(X==="gears"){let Te=q[R],qe=Te.gearFrontTooth!=null?`${Te.gearFrontTooth}T`:Te.gearFront!=null?`pos ${Te.gearFront}`:"",Ne=Te.gearRearTooth!=null?`${Te.gearRearTooth}T`:Te.gearRear!=null?`pos ${Te.gearRear}`:"";(qe||Ne)&&(me+=` (${qe} / ${Ne})`)}D.innerHTML!==me&&(D.innerHTML=me);let he=`${te.color}44`;D.style.color!==te.color&&(D.style.color=te.color),D.style.borderColor!==he&&(D.style.borderColor=he);let Z=`${ne}px`,Le=`${fe}px`,Ve="translate(6px, -50%)";D.style.left!==Z&&(D.style.left=Z),D.style.top!==Le&&(D.style.top=Le),D.style.transform!==Ve&&(D.style.transform=Ve),D.style.display!==""&&(D.style.display="")}let zN=new Map;function GN(T){let D=zN.get(T);return D||(D=Gt(Bb(T),.8),zN.set(T,D)),D}function F9(T,D,R,O){let Q=T.ctx,q=T.bbox,te=window.devicePixelRatio||1,X=T.scales.x?.min??-1/0,ne=T.scales.x?.max??1/0,fe=T.scales.y?.min??0,le=T.scales.y?.max??100,ce=q.width/(ne-X||1),me=q.height/(le-fe||1),he=q.top+q.height,Z=T.series[0]?.idxs,Le=Z?Math.max(1,Z[0]):1,Ve=Z?Math.min(D.length-1,Z[1]+1):D.length-1,Te=Math.max(1,Math.floor((Ve-Le)/250));Q.save(),Q.lineWidth=1.5*te;let qe=new Map,Ne=Le-1;for(let Re=Le;Re<=Ve;Re+=Te){let Ue=D[Re],ut=D[Ne];if(Ne=Re,Ue==null||R[Re]==null||ut==null||R[Re-Te]==null||Uene)continue;let lt=q.left+(ut-X)*ce,Ut=he-(R[Re-Te]-fe)*me,Yt=q.left+(Ue-X)*ce,Tn=he-(R[Re]-fe)*me,pn=O&&O[Re]!=null?Math.round(O[Re]/2)*2:null,Ae=GN(pn),Bt=qe.get(Ae);Bt||(Bt=[],qe.set(Ae,Bt)),Bt.push(lt,Ut,Yt,Tn)}for(let[Re,Ue]of qe){Q.beginPath(),Q.strokeStyle=Re;for(let ut=0;utX)continue;let ut=Q.left+(Ue-te)*le,lt=me-(R[Ne-Ve]-ne)*ce,Ut=Q.left+(Re-te)*le,Yt=me-(R[Ne]-ne)*ce,Tn=Math.round(R[Ne]/2)*2,pn=GN(Tn),Ae=Te.get(pn);Ae||(Ae=[],Te.set(pn,Ae)),Ae.push(ut,lt,Ut,Yt)}for(let[Ne,Re]of Te){O.beginPath(),O.strokeStyle=Ne;for(let Ue=0;Ue{let Ue=`bold ${10*te}px system-ui, sans-serif`;ne.font!==Ue&&(ne.font=Ue);let lt=ne.measureText(Te).width+10*te,Ut=16*te,Yt=qe-lt/2,Tn=Math.max(X.left,Math.min(X.left+X.width-lt,Yt)),pn=Ne-Ut/2;ne.save(),ne.globalAlpha=q,ne.setLineDash([]),ne.beginPath(),ne.roundRect?ne.roundRect(Tn,pn,lt,Ut,3*te):ne.rect(Tn,pn,lt,Ut),ne.fillStyle="rgba(14,14,16,0.92)",ne.fill(),ne.strokeStyle=Gt(O,.27),ne.lineWidth=1*te,ne.stroke(),ne.fillStyle=O,ne.textAlign="center",ne.textBaseline="middle",ne.fillText(Te,Tn+lt/2,pn+Ut/2+.5*te),ne.restore()};Q||ZN(T,D,R,O,q);let Ve=16*te;Le(Z,me,X.top+Ve/2,!0),Le(he,me,X.top+X.height+15*te,!1)}function O9(T,D,R,O,Q,q,te){if(_==null)return;let X=D[_],ne=R[_];if(X==null||ne==null)return;let fe=T.valToPos(X,"x",!0),le=T.valToPos(ne,"y",!0),ce=T.bbox,me=T.ctx,he=window.devicePixelRatio||1;me.save(),me.beginPath(),me.strokeStyle=O,me.lineWidth=1.5*he,me.moveTo(fe,ce.top),me.lineTo(fe,ce.top+ce.height),me.stroke(),me.beginPath(),me.setLineDash([3*he,3*he]),me.strokeStyle=Gt(O,.5),me.lineWidth=1*he,me.moveTo(ce.left,le),me.lineTo(fe,le),me.stroke(),me.beginPath(),me.setLineDash([]),me.arc(fe,le,5*he,0,Math.PI*2),me.fillStyle="#0e0e10",me.fill(),me.strokeStyle=O,me.lineWidth=2.5*he,me.stroke(),me.restore();let Z=T._strasse;Z&&Z.pinYVal&&WN(T,Z.pinYVal,_,D,R,q,Q,te)}function B9(T,D,R,O,Q,q){let te=T.bbox,X=T.ctx,ne=window.devicePixelRatio||1,fe=T.valToPos(O,"y",!0),le=Math.max(te.top,Math.min(te.top+te.height,fe));X.save(),X.beginPath(),X.setLineDash([4*ne,4*ne]),X.strokeStyle=Gt(Q,.4),X.lineWidth=1*ne,X.moveTo(te.left,le),X.lineTo(te.left+te.width,le),X.stroke(),V9(T,D,R,le,Q);let ce=q.fmt(O,!0),me=`bold ${10*ne}px system-ui, sans-serif`;X.font!==me&&(X.font=me);let Z=X.measureText(ce).width+8*ne,Le=16*ne,Ve=te.left-Z-2*ne,Te=le-Le/2;X.beginPath(),X.setLineDash([]),X.roundRect?X.roundRect(Ve,Te,Z,Le,3*ne):X.rect(Ve,Te,Z,Le),X.fillStyle="rgba(14,14,16,0.95)",X.fill(),X.strokeStyle=Q,X.lineWidth=1*ne,X.stroke(),X.fillStyle="#fff",X.textAlign="center",X.textBaseline="middle",X.fillText(ce,Ve+Z/2,Te+Le/2+.5*ne),X.restore()}function V9(T,D,R,O,Q){let q=T.ctx,te=T.bbox,X=T.scales.x?.min??-1/0,ne=T.scales.x?.max??1/0,fe=T.scales.y?.min??0,le=T.scales.y?.max??100,ce=te.width/(ne-X||1),me=te.height/(le-fe||1),he=T.scales.y?.dir??1,Z=he===-1?te.top:te.top+te.height,Le=he===-1?me:-me,Ve=T.series[0]?.idxs,Te=Ve?Math.max(0,Ve[0]-1):0,qe=Ve?Math.min(D.length-1,Ve[1]+1):D.length-1,Ne=Math.max(1,Math.floor((qe-Te)/250));q.save(),q.beginPath(),q.rect(te.left,te.top,te.width,te.height),q.clip(),q.fillStyle=Gt(Q,.2),q.beginPath();let Re=!1,Ue=!1,ut=0;for(let lt=Te;lt<=qe;lt+=Ne){let Ut=D[lt],Yt=R[lt];if(Ut==null||Yt==null||Utne){Re&&(q.lineTo(ut,O),q.closePath(),Re=!1);continue}let Tn=te.left+(Ut-X)*ce,pn=Z+(Yt-fe)*Le;ut=Tn,pn>16,te=O>>8&255,X=O&255,ne=Q>>16,fe=Q>>8&255,le=Q&255,ce=q+(ne-q)*R,me=te+(fe-te)*R,he=X+(le-X)*R;return`#${((1<<24)+(Math.round(ce)<<16)+(Math.round(me)<<8)+Math.round(he)).toString(16).slice(1)}`}function Bb(T){if(T==null)return"#888896";let D=Math.abs(T),R=Math.min(1,D/8);return T>0?Ri("#A8C8A0","#d73027",R):Ri("#A8C8A0","#4575b4",R)}function XN(T){if(T==null)return"#888896";let D=T*3.6;if(D<=5)return"#4575b4";if(D>=60)return"#d73027";if(D<=45){let R=(D-5)/40;return R<=.25?Ri("#4575b4","#91bfdb",R/.25):R<=.5?Ri("#91bfdb","#abdda4",(R-.25)/.25):R<=.75?Ri("#abdda4","#fee08b",(R-.5)/.25):Ri("#fee08b","#fc8d59",(R-.75)/.25)}else{let R=(D-45)/15;return Ri("#fc8d59","#d73027",R)}}function $9(T,D){let R=new Array(T.length).fill(null);for(let O=0;O0&&(Q.dist||0)-(T[q].dist||0)1&&T[te].ele!=null&&T[q].ele!=null&&(R[O]=(T[te].ele-T[q].ele)/X*100)}return R}function QN(T){let D=[...T];for(let R=0;R=0&&D[O]===null;)O--;let Q=R+1;for(;Q=0&&Q=0?D[R]=D[O]:Q{let fe=document.querySelector(`#${X} .stat-value`);fe&&(fe.textContent=ne)};R("stat-distance",D.totalDist!=null?`${(D.totalDist/1e3).toFixed(1)} km`:"\u2014"),R("stat-duration",D.duration!=null?wn(Math.floor(D.duration/1e3)):"\u2014"),R("stat-elevation",D.elevGain!=null?`${Math.round(D.elevGain)} m`:"\u2014");let O=X=>{let ne=n.find(ce=>ce.metricKey===X);if(!ne)return X==="speed"?D.avgSpeed??null:X==="power"?D.avgPower??null:X==="cadence"?D.avgCadence??null:null;if(ne.histData.fullStats!==void 0)return ne.histData.fullStats?ne.histData.fullStats.avg:null;let fe=p.has(X)||X!=="power"&&X!=="cadence"&&X!=="speed",le=ne.yData.filter(ce=>ce!=null&&(fe||ce!==0));return le.length?le.reduce((ce,me)=>ce+me,0)/le.length:null},Q=O("speed");R("stat-avg-speed",Q!=null?`${(Q*3.6).toFixed(1)} km/h`:"\u2014");let q=O("power");R("stat-avg-power",q!=null?`${Math.round(q)} W`:"\u2014");let te=O("cadence");R("stat-avg-cad",te!=null?`${Math.round(te)} rpm`:"\u2014"),R("stat-avg-hr",D.avgHR!=null?`${D.avgHR} bpm`:"\u2014"),R("stat-avg-temp",D.avgTemp!=null?`${D.avgTemp.toFixed(1)} \xB0C`:"\u2014"),window.__trackStateService?.graphsTab?.updateTotalStats({dist:D.totalDist!=null?`${(D.totalDist/1e3).toFixed(1)} km`:"\u2014",duration:D.duration!=null?wn(Math.floor(D.duration/1e3)):"\u2014",elevation:D.elevGain!=null?`${Math.round(D.elevGain)} m`:"\u2014",avgSpeed:Q!=null?`${(Q*3.6).toFixed(1)} km/h`:"\u2014",avgPower:q!=null?`${Math.round(q)} W`:"\u2014",avgHr:D.avgHR!=null?`${D.avgHR} bpm`:"\u2014",avgTemp:D.avgTemp!=null?`${D.avgTemp.toFixed(1)} \xB0C`:"\u2014"})}let Ec=16384,xc=new Float64Array(Ec),rp=new Float64Array(Ec),Vb=new Float64Array(Ec),tg=new Float64Array(Ec),zC=new Float64Array(Ec),$b=new Float64Array(Ec),ng=new Float64Array(64),JN=[3,5,8,10,12,15,20,25,30,40,45,60,75,90,120,150,180,240,300,360];function H9(T,D,R){if(!T.length)return 0;ng.fill(0);let O=0;for(let Q=0;Q=Ve)continue;let Ne=1/qe,Re=0,Ue=0,ut=0;for(let lt=Z;lt=qe){Re-=$b[lt-qe],Ue-=tg[lt-qe];let Ut=(Re+Ue*.05)*Ne;Ut>ut&&(ut=Ut)}O+=ut*1e-4}for(let Te=Z;Te0&&(ng[qe-1]+=.5),qe<63&&(ng[qe+1]+=.5)}}}}for(let Q=0;Q<64;Q++)O+=ng[Q]*1e-5;return I&&(I.dataset.intervalScore=O.toFixed(2)),O}return{init:ke,loadTrack:B,clear:z,resetState:L,toggleMetric:U,setXAxis:Ee,toggleStats:ue,setSelectionStats:Zt,clearSelectionStats:Ct,restoreSelection:Jt,resetZoom:de,cancelSelection:He,analyzeTelemetryIntervals:H9,setCursorAt:(T,D=!1)=>{if(_=T,We&&We(T),D){$&&h?.points?.[T]&&$(h.points[T]);return}a=!0,n.forEach(({uplot:R,yData:O,xData:Q})=>{Q[T]!=null&&O[T]!=null&&R.batch(()=>{R.setCursor({left:R.valToPos(Q[T],"x"),top:R.valToPos(O[T],"y")},!0,!1)})}),a=!1,$&&h?.points?.[T]&&$(h.points[T])},setHoverAt:T=>{a=!0,n.forEach(({uplot:D,yData:R,xData:O})=>{T===null?D.batch(()=>{D.setCursor({left:-10,top:-10},!0,!1)}):O[T]!=null&&R[T]!=null&&D.batch(()=>{D.setCursor({left:D.valToPos(O[T],"x"),top:D.valToPos(R[T],"y")},!0,!1)})}),a=!1,$&&$(T!=null&&h?.points?.[T]?h.points[T]:null)},clearPinnedDot:()=>{_=null,We&&We(null),n.forEach(({uplot:T})=>T.redraw(!1))},resize:ot,METRICS:Os,isDragging:()=>b,setMapColorChangeCb:Ce,toggleMapColor:Me,getMapColorMetric:()=>ve,getActiveMetrics:()=>c,getAvailableMetrics:()=>u,setActiveMetrics:K,setSmooth:H,setZeroInclusion:ae,updateMetricOrder:T=>{let D=new Set;T.forEach(R=>{c.has(R)&&D.add(R)}),c.forEach(R=>{D.has(R)||D.add(R)}),c=D,h&&nt(!0)},getXAxis:()=>f};function j9(T,D,R,O,Q){let q=T.ctx,te=T.bbox,X=window.devicePixelRatio||1,ne=Pt(Q,R);q.save(),q.beginPath(),q.rect(te.left,te.top,te.width,te.height),q.clip();let fe=Q==="gearRear"||Q==="gearFront";for(let le=1;lehe.time!=null)?.time||0,ce=R.field;O.beginPath(),O.strokeStyle="rgba(255, 255, 255, 0.04)",O.lineWidth=1*q;let me=!0;for(let he=0;he0){let Re=fe[he-1];(Z.time&&Re.time?Z.time-Re.time:0)>te&&(me=!0)}let Ve=R.transform?R.transform(Le):Le;if(Ve==null){me=!0;continue}let Te=f==="distance"?(Z.dist||0)/1e3:(Z.time-le)/1e3;if(TeT.scales.x.max+10){me=!0;continue}let qe=T.valToPos(Te,"x",!0),Ne=T.valToPos(Ve,"y",!0);if(me)O.moveTo(qe,Ne),me=!1;else{if(X){let Re=fe[he-1],Ue=f==="distance"?(Re.dist||0)/1e3:(Re.time-le)/1e3;O.lineTo(T.valToPos(Ue,"x",!0),Ne)}O.lineTo(qe,Ne)}}O.stroke()}O.restore()}function eP(T,D,R,O,Q,q,te=null,X=[]){let ne=T.ctx,fe=T.bbox,le=window.devicePixelRatio||1,ce=6e4;ne.save(),ne.beginPath(),ne.strokeStyle=Gt(O,.8),ne.lineWidth=Q*le;let me=q==="gearRear"||q==="gearFront",he=!0,Z=null,Le=1,Ve=1;if(q==="gears"&&X.length>0){let Rt=1/0,Nn=-1/0;for(let Ir=0;IrNn&&(Nn=os))}Rt<=Nn&&(Le=Rt,Ve=Nn)}let Te=te?te[0]:T.scales.x?.min??-1/0,qe=te?te[1]:T.scales.x?.max??1/0,Ne=T.scales.x?.min??-1/0,Re=T.scales.x?.max??1/0,Ue=T.scales.y?.min??0,ut=T.scales.y?.max??100,lt=fe.width/(Re-Ne||1),Ut=fe.height/(ut-Ue||1),Yt=T.scales.y?.dir??1,Tn=Yt===-1?fe.top:fe.top+fe.height,pn=Yt===-1?Ut:-Ut,Ae=te?null:T.series[0]?.idxs,Bt=Ae?Math.max(0,Ae[0]-1):0,Mt=Ae?Math.min(D.length-1,Ae[1]+1):D.length-1,jt=me||q==="gears"?1:Math.max(1,Math.floor((Mt-Bt)/250)),Mn=f==="time",Zn=ce/1e3,Yn=Bt;for(let Rt=Bt;Rt<=Mt;Rt+=jt){let Nn=D[Rt],Ir=R[Rt];if(Nn==null||Ir==null){he=!0;continue}if(q==="gears"&&X[Rt]){let Xr=X[Rt].gearFrontTooth??X[Rt].gearFront;if(Xr!=null&&Xr!==Z){if(!he&&Rt>0){ne.stroke(),ne.beginPath();let GC=fe.left+(D[Yn]-Ne)*lt,Hb=Tn+(R[Yn]-Ue)*pn;ne.moveTo(GC,Hb)}let ol=O;Ve!==Le&&Xr!=null&&(Xr===Le?ol="#FFC400":Xr===Ve?ol="#FF8C00":ol="#FFA500"),ne.strokeStyle=Gt(ol,.8),Z=Xr}}if(Rt>Bt&&Mn){let Xr=D[Yn];Xr!=null&&Nn-Xr>Zn&&(he=!0)}if(Nnqe){he=!0;continue}let os=fe.left+(Nn-Ne)*lt,oa=Tn+(Ir-Ue)*pn;if(he)ne.moveTo(os,oa),he=!1;else{if(me){let Xr=D[Yn];ne.lineTo(fe.left+(Xr-Ne)*lt,oa)}ne.lineTo(os,oa)}Yn=Rt}ne.stroke(),ne.restore()}})();var EN=["#FF6B35","#4ECDC4","#45B7D1","#F7DC6F","#FF6B6B","#BB8FCE","#82E0AA","#F8C471","#3b82f6"],Rr=class{constructor(){this.tracks={};this.skippedImports=[];this.selectedId=null;this.activeTab="graphs";this.colorIdx=0;this.followDot=!1;this.currentMapColors=null;this.cancelProcessing=!1;this.searchQuery="";this.searchRegex=!1;this.currentSort="date-desc";this.selectionRange=null;this.filters={date:[null,null],dist:[null,null],dur:[null,null],metrics:new Set,tags:[],sport:null};this.toastMessage=null;this.stateChanges$=new _s;this.appRef=null;this.graphsTab=null;this.insightsTab=null;this.detailsTab=null;this.combinedTab=null;this.evolutionTab=null;this.coursesTab=null;this.onSelectTrackCallback=null;this.onDeleteTrackCallback=null;this.onApplyFiltersCallback=null;this.onChartRangeChangeCallback=null;window.__trackStateService=this}get allTracks(){return Object.values(this.tracks)}get selectedTrack(){return this.selectedId&&this.tracks[this.selectedId]?this.tracks[this.selectedId]:null}get filteredTrackIds(){return Object.keys(this.tracks).filter(t=>!this.tracks[t]._filtered).sort((t,r)=>{if(t===this.selectedId)return-1;if(r===this.selectedId)return 1;let s=this.tracks[t],i=this.tracks[r],o=s.stats,a=i.stats,c=0;switch(this.currentSort){case"date-asc":c=(o.startTime||0)-(a.startTime||0);break;case"date-desc":c=(a.startTime||0)-(o.startTime||0);break;case"dist-asc":c=(o.totalDist||0)-(a.totalDist||0);break;case"dist-desc":c=(a.totalDist||0)-(o.totalDist||0);break;case"dur-asc":c=(o.duration||0)-(a.duration||0);break;case"dur-desc":c=(a.duration||0)-(o.duration||0);break;default:c=0}return c||t.localeCompare(r)})}get filteredTracks(){return this.filteredTrackIds.map(e=>this.tracks[e])}getGlobalTags(){let e=new Set;return Object.values(this.tracks).forEach(t=>{(t.tags||[]).forEach(r=>e.add(r))}),Array.from(e).sort()}showToast(e,t="info"){this.toastMessage={msg:e,type:t};let r=document.getElementById("toast-container");if(r){r.innerHTML="";let s=document.createElement("div");s.className=`toast ${t}`,s.textContent=e,r.appendChild(s)}this.notify()}selectTrack(e,t=!0,r=!1){this.onSelectTrackCallback&&this.onSelectTrackCallback(e,t,r)}selectTrackAndRange(e,t){this.selectTrack(e,!0),t&&(Oe.restoreSelection(t[0],t[1]),this.onChartRangeChangeCallback&&this.onChartRangeChangeCallback(t[0],t[1],"time",!0))}async deleteTrack(e){this.onDeleteTrackCallback?await this.onDeleteTrackCallback(e):(await Gn.remove(e),tt.removeTrack(e),delete this.tracks[e],this.selectedId===e&&(this.selectedId=null,Oe.clear(),St.patch({track:null,sel:null,sel_point:null})),this.applyFilters())}applyFilters(e=!1){if(this.onApplyFiltersCallback){this.onApplyFiltersCallback(e);return}Object.keys(this.tracks).forEach(r=>{let s=this.tracks[r],i=s.stats,o=!0;if(this.searchQuery)if(this.searchRegex)try{new RegExp(this.searchQuery,"i").test(s.name)||(o=!1)}catch{o=!1}else s.name.toLowerCase().includes(this.searchQuery.toLowerCase())||(o=!1);if(o&&(this.filters.date[0]||this.filters.date[1])){let a=this.filters.date[0]?new Date(this.filters.date[0]).getTime():0,c=this.filters.date[1]?new Date(this.filters.date[1]).getTime():1/0,u=i.startTime||0;(uc)&&(o=!1)}if(o&&(this.filters.dist[0]!==null||this.filters.dist[1]!==null)){let a=(this.filters.dist[0]||0)*1e3,c=(this.filters.dist[1]||1/0)*1e3;(i.totalDistc)&&(o=!1)}if(o&&(this.filters.dur[0]!==null||this.filters.dur[1]!==null)){let a=(this.filters.dur[0]||0)*6e4,c=(this.filters.dur[1]||1/0)*6e4,u=i.duration||0;(uc)&&(o=!1)}if(o&&this.filters.metrics.size>0)for(let a of this.filters.metrics){let c=Oe.METRICS[a]?.field;if(c&&!s.points.some(u=>u[c]!=null)){o=!1;break}}if(o&&this.filters.sport&&s.sport!==this.filters.sport&&(o=!1),o&&this.filters.tags.length>0){let a=s.tags||[];this.filters.tags.every(c=>a.includes(c))||(o=!1)}s._filtered=!o,tt.setTrackVisible(s.id,s.visible&&o)}),e||this.notify()}syncFiltersToUrl(e=!1){St.patch({f_date:this.filters.date.every(t=>t===null)?null:this.filters.date,f_dist:this.filters.dist.every(t=>t===null)?null:this.filters.dist,f_dur:this.filters.dur.every(t=>t===null)?null:this.filters.dur,f_mets:this.filters.metrics.size===0?null:Array.from(this.filters.metrics),f_tags:this.filters.tags.length===0?null:this.filters.tags},e)}onTagsChanged(){this.applyFilters(),this.syncFiltersToUrl(),this.notify()}onDateRangeSelected(e,t){this.filters.date=[e,t],this.applyFilters(),this.syncFiltersToUrl(!0),this.notify()}activateTab(e,t=!1){this.activeTab=e,document.querySelectorAll(".tab-btn").forEach(r=>{r.classList.toggle("active",r.dataset.tab===e)}),document.querySelectorAll(".tab-content").forEach(r=>{r.classList.toggle("active",r.id===`tab-${e}`)}),St.patch({tab:e},t),this.notify()}notify(){this.stateChanges$.next();try{this.appRef?.tick()}catch{}}};Rr=Xn([zt({providedIn:"root"})],Rr);var Efe=[{key:"elevation",label:"Elevation",icon:"height",color:"#4ecdc4",title:"Toggle Elevation graph"},{key:"vam",label:"VAM",icon:"trending_up",color:"#ffa07a",title:"Toggle VAM graph"},{key:"speed",label:"Speed",icon:"speed",color:"#45b7d1",title:"Toggle Speed graph"},{key:"gradient",label:"Gradient",icon:"trending_up",color:"#a8c8a0",title:"Toggle Gradient graph"},{key:"power",label:"Power",icon:"bolt",color:"#f7dc6f",title:"Toggle Power graph"},{key:"hr",label:"Heart Rate",icon:"favorite",color:"#ff6b6b",title:"Toggle Heart Rate graph"},{key:"cadence",label:"Cadence",icon:"directions_run",color:"#bb8fce",title:"Toggle Cadence graph"},{key:"temperature",label:"Temp",icon:"thermostat",color:"#f8c471",title:"Toggle Temperature graph"},{key:"battery",label:"Battery",icon:"battery_full",color:"#45b7d1",title:"Toggle Battery graph"},{key:"gearRear",label:"Rear Gear",icon:"settings",color:"#82e0aa",title:"Toggle Rear Gear graph"},{key:"gearFront",label:"Front Gear",icon:"settings_input_component",color:"#a8c8a0",title:"Toggle Front Gear graph"},{key:"gears",label:"Gears",icon:"settings",color:"#ff8c00",title:"Toggle Gears graph"}],Gm=class{constructor(){this.state=ye(Rr);this.cdr=ye(bn);this.metricPills=[...Efe];this.activeMetrics=new Set(["elevation","speed","power","hr","temperature"]);this.availableMetrics=new Set;this.overflowHiddenPills=new Set;this.toolbarCollapsed=!1;this.xAxis="time";this.hasTrack=!1;this.hasSelection=!1;this.totalStats={dist:"--",duration:"--",elevation:"--",avgSpeed:"--",avgPower:"--",avgHr:"--",avgTemp:"--"};this.selectionStats={dist:"--",duration:"--",elevation:"--",avgSpeed:"--",avgPower:"--",avgHr:"--",avgTemp:"--"};this.draggedEl=null;this.state.graphsTab=this}ngOnInit(){this.cdr.detectChanges()}trackByPillKey(e,t){return t.key}isPillActive(e){return this.hasTrack?this.availableMetrics.has(e)&&this.activeMetrics.has(e):this.activeMetrics.has(e)}isPillAvailable(e){return this.availableMetrics.has(e)}syncFromChartView(){if(this.activeMetrics=new Set(Oe.getActiveMetrics()),this.availableMetrics=new Set(Oe.getAvailableMetrics()),this.xAxis=Oe.getXAxis(),this.hasTrack=this.state.selectedTrack!==null,this.state.selectedTrack){let e=this.state.selectedTrack.stats;this.totalStats={dist:e.totalDist!=null?`${(e.totalDist/1e3).toFixed(1)} km`:"\u2014",duration:e.duration!=null?wn(Math.floor(e.duration/1e3)):"\u2014",elevation:e.elevGain!=null?`${Math.round(e.elevGain)} m`:"\u2014",avgSpeed:e.avgSpeed!=null?`${(e.avgSpeed*3.6).toFixed(1)} km/h`:"\u2014",avgPower:e.avgPower!=null?`${Math.round(e.avgPower)} W`:"\u2014",avgHr:e.avgHR!=null?`${e.avgHR} bpm`:"\u2014",avgTemp:e.avgTemp!=null?`${e.avgTemp.toFixed(1)} \xB0C`:"\u2014"}}else this.totalStats={dist:"--",duration:"--",elevation:"--",avgSpeed:"--",avgPower:"--",avgHr:"--",avgTemp:"--"},this.hasSelection=!1;this.updateToolbarLayout(),this.cdr.detectChanges()}updateTotalStats(e){this.hasTrack=!0,this.totalStats={...this.totalStats,...e},this.cdr.detectChanges()}setSelectionStats(e){e?(this.hasSelection=!0,this.selectionStats={dist:e.totalDist!=null?`${(e.totalDist/1e3).toFixed(1)} km`:"\u2014",duration:e.duration!=null?wn(Math.floor(e.duration/1e3)):"\u2014",elevation:e.elevGain!=null?`${Math.round(e.elevGain)} m`:"\u2014",avgSpeed:e.avgSpeed!=null?`${(e.avgSpeed*3.6).toFixed(1)} km/h`:"\u2014",avgPower:e.avgPower!=null?`${e.avgPower} W`:"\u2014",avgHr:e.avgHR!=null?`${e.avgHR} bpm`:"\u2014",avgTemp:e.avgTemp!=null?`${e.avgTemp.toFixed(1)} \xB0C`:"\u2014"}):(this.hasSelection=!1,this.selectionStats={dist:"--",duration:"--",elevation:"--",avgSpeed:"--",avgPower:"--",avgHr:"--",avgTemp:"--"}),this.cdr.detectChanges()}updateToolbarLayout(){let e=document.getElementById("chart-toolbar"),t=e?Math.max(0,e.clientWidth-280):600,r=0,s=!1,i=new Set;for(let o of this.metricPills){if(!this.isPillActive(o.key))continue;let a=36+o.key.length*6;r+=a+6,r>t&&(s=!0,i.add(o.key))}this.overflowHiddenPills=i,this.toolbarCollapsed=s,this.cdr.detectChanges()}onPillClick(e){Oe.toggleMetric(e),this.syncMetricsToUrl(),this.syncFromChartView(),Oe.getActiveMetrics().has(e)&&document.querySelector(`.chart-row[data-metric="${e}"]`)?.scrollIntoView({behavior:"smooth"})}onSelectXAxis(e){this.xAxis=e,Oe.setXAxis(e),St.patch({xaxis:e}),this.cdr.detectChanges()}onToggleFollowDot(){this.state.followDot=!this.state.followDot,this.cdr.detectChanges()}onResetZoom(){Oe.resetZoom(),tt.clearHighlight(),this.hasSelection=!1,this.cdr.detectChanges()}onCancelSelection(){Oe.cancelSelection(),this.hasSelection=!1,this.cdr.detectChanges()}onOpenMetricMenu(e){e.stopPropagation();let t=e.currentTarget;document.querySelectorAll(".metric-menu-popup").forEach(u=>u.remove());let r=document.createElement("div");r.className="metric-menu-popup";let s=Oe.METRICS,i=Oe.getAvailableMetrics(),o=Oe.getActiveMetrics();Object.entries(s).forEach(([u,d])=>{if(!i.has(u))return;let p=document.createElement("div");p.className=`menu-item ${o.has(u)?"active":""}`,p.innerHTML=` + ${d.icon} + ${d.label} + ${o.has(u)?"check":""} + `,p.addEventListener("click",()=>{Oe.toggleMetric(u);let f=Oe.getActiveMetrics().has(u);p.classList.toggle("active",f),p.querySelector(".check").textContent=f?"check":"",this.syncMetricsToUrl(),this.syncFromChartView()}),r.appendChild(p)});let a=t.getBoundingClientRect();r.style.top=`${a.bottom+5}px`,r.style.right=`${window.innerWidth-a.right}px`,document.body.appendChild(r);let c=u=>{!r.contains(u.target)&&!t.contains(u.target)&&(r.remove(),document.removeEventListener("click",c))};setTimeout(()=>document.addEventListener("click",c),0)}onDragStart(e){let t=e.target.closest(".metric-pill");t&&(this.draggedEl=t,e.dataTransfer&&(e.dataTransfer.effectAllowed="move"),t.classList.add("dragging-pill"),setTimeout(()=>t.style.opacity="0.4",0))}onDragOver(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move");let t=document.getElementById("metric-pills"),r=e.target.closest(".metric-pill");if(t&&r&&this.draggedEl&&r!==this.draggedEl){let s=r.getBoundingClientRect(),i=e.clientX-s.left>s.width/2;t.insertBefore(this.draggedEl,i?r.nextSibling:r)}}onDragEnd(){if(!this.draggedEl)return;this.draggedEl.classList.remove("dragging-pill"),this.draggedEl.style.opacity="",this.draggedEl=null;let e=document.getElementById("metric-pills");if(!e)return;let t=Array.from(e.querySelectorAll(".metric-pill")).map(r=>r.dataset.metric);Oe.updateMetricOrder(t),this.syncMetricsToUrl(),this.cdr.detectChanges()}syncMetricsToUrl(){let e=Oe.getActiveMetrics(),t=Oe.METRICS,r=Array.from(e).map(s=>t[s].abbr);St.patch({metrics:r.length?r:null})}};Gm=Xn([ms({selector:"app-graphs-tab",standalone:!0,imports:[tr,Yr],template:` +
+
+ + ... +
+ +
+
+ + +
+ + +
+
+ +
+
+
+
Total
+
+ Dist{{ totalStats.dist }} +
+
+ Time{{ totalStats.duration }} +
+
+ Elev{{ totalStats.elevation }} +
+
+ Avg Spd{{ totalStats.avgSpeed }} +
+
+ Avg Pwr{{ totalStats.avgPower }} +
+
+ Avg HR{{ totalStats.avgHr }} +
+
+ Avg Temp{{ totalStats.avgTemp }} +
+
+
+
+ Sel + +
+
+ Dist{{ selectionStats.dist }} +
+
+ Time{{ selectionStats.duration }} +
+
+ Elev{{ selectionStats.elevation }} +
+
+ Avg Spd{{ selectionStats.avgSpeed }} +
+
+ Avg Pwr{{ selectionStats.avgPower }} +
+
+ Avg HR{{ selectionStats.avgHr }} +
+
+ Avg Temp{{ selectionStats.avgTemp }} +
+
+
+
+ +
+
+ no_sim +
Select a track to view analysis
+
+
+ `})],Gm);import Cfe from"uplot";var Dr=[],si=null,Qd=!1,ii=null,q6=()=>{},W6=null;function z6(n){W6=n}function G6(){return W6||window.__trackStateService?.coursesTab||null}function Z6(n){Qd=n,n||(tt.setCustomClickHandler(null),document.getElementById("map-container")?.classList.remove("editing-mode"))}function xN(n){return Dr.filter(e=>{if(e.points.length===0)return!1;for(let t of e.points){let r=!1;for(let s of n.points)if(Ja(t.lat,t.lon,s.lat,s.lon)<=t.radius){r=!0;break}if(!r)return!1}return!0})}function Y6(n){q6=n,xfe()}function X6(){Dr=[],si=null,ii=null,Qd=!1;let n=G6();if(n&&typeof n.reset=="function"){n.reset();return}let e=document.getElementById("courses-view");e&&(e.innerHTML=` +
+ route +
No courses created yet
+
+ `)}function OC(n){Dr=[];let e=[{trackIdx:0,suffix:"Full Loop",fracs:[.1,.5,.85],radius:450},{trackIdx:1,suffix:"Opening Climb Sector",fracs:[.08,.25,.45],radius:450},{trackIdx:2,suffix:"Lakeside Corridor",fracs:[.1,.45,.8],radius:850},{trackIdx:3,suffix:"Sprint Interval Sector",fracs:[.2,.5,.75],radius:850},{trackIdx:4,suffix:"Alpine Grand Tour Stage",fracs:[.1,.5,.85],radius:900},{trackIdx:5,suffix:"Summit Finish Climb",fracs:[.5,.72,.92],radius:900}];for(let t=0;t0&&(si=Dr[0].id,ii=Dr[0].id)}function Q6(){return Dr.map(n=>n.id)}async function xfe(){try{let n=await Gn.get("courses");n&&(Dr=n)}catch(n){console.error("Courses: Failed to load courses",n)}}async function SN(){try{await Gn.set("courses",Dr)}catch(n){console.error("Courses: Failed to save courses",n),q6("Failed to save courses","error")}}function Sfe(n){let e=0;for(let t=0;tt)return{duration:0,dist:0,avgWatts:null,avgHR:null,avgSpeed:null,avgCadence:null,avgVam:null};let i=Math.max(0,Math.min(e,s-1)),o=Math.max(i,Math.min(t,s-1)),a=r[i]?.time||0,u=((r[o]?.time||0)-a)/1e3,d=0,p=0,f=0,h=0,m=0,g=0,y=0,b=0,E=0;for(let V=i;V<=o;V++){let M=r[V];if(M.power!=null&&(d+=M.power,p++),M.hr!=null&&(f+=M.hr,h++),M.speed!=null&&(m+=M.speed,g++),M.cadence!=null&&(y+=M.cadence,b++),V>i){let j=r[V-1];if(M.ele!=null&&j.ele!=null){let G=M.ele-j.ele;G>0&&(E+=G)}}}let _=o>i?(r[o].dist||0)-(r[i].dist||0):0;return{duration:u,dist:_,avgWatts:p>0?Math.round(d/p):null,avgHR:h>0?Math.round(f/h):null,avgSpeed:g>0?m/g:null,avgCadence:b>0?Math.round(y/b):null,avgVam:u>0?Math.round(E/(u/3600)):null}}function F6(n){let e=Math.floor(n/3600),t=Math.floor(n%3600/60),r=Math.floor(n%60);return e>0?`${e}:${t.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${t}:${r.toString().padStart(2,"0")}`}var VC=16384,L6=new Float64Array(VC),O6=new Float64Array(VC),B6=new Float64Array(VC),V6=new Float64Array(32),$6=new Float64Array(32),tl=180,H6=28,j6=new Float64Array(tl),U6=new Float64Array(tl),Zm=new Float64Array(tl+1),LC=new Float64Array(tl+1);function K6(){let n=0,e={},t=ii||si?Dr.filter(a=>a.id===ii||a.id===si):Dr;for(let a of t){if(a.points.length<2)continue;let c=tt.findTracksPassingThroughPoints(a.points.map(d=>({lat:d.lat,lng:d.lon})),a.points[0]?.radius||20),u=4;for(let d=0;d{let c=a.points.map(h=>({lat:h.lat,lng:h.lon})),u=tt.findTracksPassingThroughPoints(c,a.points[0]?.radius||20);s+=u.length;let d=a.id===ii,p=a.id===si,f=[];if(d){let h=u.map(g=>{let y=tt.getTrackData(g);if(!y)return null;let b=BC(y,a.points);if(!b)return null;let E=Xd(y,b.startIdx,b.endIdx),_=Math.max(1,b.endIdx-b.startIdx),V=b.startIdx+Math.floor(_*.25),M=b.startIdx+Math.floor(_*.5),j=b.startIdx+Math.floor(_*.75),G=Xd(y,b.startIdx,V),W=Xd(y,V,M),xe=Xd(y,M,j),pe=Xd(y,j,b.endIdx),$=y.stats?.startTime||y.points?.[0]?.time,ee=$?yo($):"-",We=(y.sport?ri[y.sport.toLowerCase()]:null)?.paceUnit||"km",P="--";if(E.avgSpeed!=null&&E.avgSpeed>.1){let A=(We==="km"?1e3:100)/E.avgSpeed;P=`${Yd(A)}\xA0min/${We}`}return{id:g,displayName:y.displayName||y.name||g,date:ee,sport:y.sport||null,color:y.color||"#FF6B35",...E,splitsSummary:`${G.avgWatts||0}/${W.avgWatts||0}/${xe.avgWatts||0}/${pe.avgWatts||0}W`,gapLabel:"CR",dtwDistance:e[g]||0,distStr:E.dist!=null?`${(E.dist/1e3).toFixed(2)}\xA0km`:"-",durationStr:F6(E.duration),speedStr:E.avgSpeed!=null?`${(E.avgSpeed*3.6).toFixed(1)}\xA0km/h`:"-",paceStr:P,vamStr:E.avgVam!=null?`${E.avgVam}\xA0m/h`:"-",wattsStr:E.avgWatts!=null?`${E.avgWatts}\xA0W`:"-",hrStr:E.avgHR!=null?`${E.avgHR}\xA0bpm`:"-",startIdx:b.startIdx,endIdx:b.endIdx,isSelected:g===r}}).filter(g=>g!==null);h.sort((g,y)=>g.duration-y.duration||g.id.localeCompare(y.id));let m=h[0]?.duration||0;h.forEach((g,y)=>{if(y===0)g.gapLabel="KOM / CR";else{let b=Math.max(0,g.duration-m);g.gapLabel=`+${F6(b)}`}}),f=h}return{id:a.id,name:a.name,points:a.points,pointsCount:a.points.length,distanceKm:Sfe(a).toFixed(2),matchingCount:u.length,isOpen:d,isActive:p,matchedTracks:f}}),o=i.find(a=>a.id===ii||a.id===si)||i[0]||null;return{courseViews:i,selectedCourseSummary:o,totalMatchesCount:s,corridorDeviationStr:n.toFixed(2),isEditMode:Qd,activeCourseId:si,openCourseId:ii}}function nl(){let n=G6();if(n&&typeof n.render=="function"){n.render();return}}function CN(n,e=450){let t=n?.trim()||`Course ${Dr.length+1}`,r=window.__trackStateService,s=r?.selectedTrack||r?.allTracks?.[0],i=[];if(s?.points&&s.points.length>=10){let a=s.points.length,c=s.points[Math.floor(a*.1)],u=s.points[Math.floor(a*.5)],d=s.points[Math.floor(a*.85)];i.push({lat:c.lat,lon:c.lon,radius:e,name:"Start Gate"},{lat:u.lat,lon:u.lon,radius:e,name:"Mid Sector"},{lat:d.lat,lon:d.lon,radius:e,name:"Finish Gate"})}let o={id:`course-${Dr.length+1}-${Math.random().toString(36).substring(2,6)}`,name:t,points:i};return Dr.push(o),si=o.id,ii=o.id,Qd=!0,SN(),nl(),o}function J6(n,e){let t=Dr.find(s=>s.id===n);if(!t)return;let r=e.trim();r!==""&&(t.name=r,SN()),nl()}function e9(n){si=n,Qd=!0,nl()}function t9(n){si=n,ii=ii===n?null:n,Qd=!1,tt.setCustomClickHandler(null),nl()}function Kd(n,e=!1){si=n,e&&(ii=n),Qd=!1,tt.setCustomClickHandler(null),nl()}function n9(n){confirm("Are you sure you want to delete this course?")&&(Dr=Dr.filter(e=>e.id!==n),si===n&&(si=null),ii===n&&(ii=null),SN(),nl())}function r9(n,e,t){let r=tt.getTrackData(n);if(!r)return;let s=window.__trackStateService;s?s.selectTrack(n,!1):document.dispatchEvent(new CustomEvent("select-track",{detail:{id:n}})),setTimeout(()=>{let i=r.points,o=i.find(m=>m.time!=null)?.time||0,a=Math.max(0,Math.min(e,i.length-1)),c=Math.max(0,Math.min(t,i.length-1)),u=Math.max(0,((i[a]?.time||0)-o)/1e3),d=Math.max(0,((i[c]?.time||0)-o)/1e3),p=Oe.getXAxis(),f=u,h=d;p==="distance"&&(f=Math.max(0,(i[a]?.dist||0)/1e3),h=Math.max(0,(i[c]?.dist||0)/1e3)),St.patch({sel:[f,h],tab:"graphs"},!0),s&&s.activateTab("graphs",!1),Oe.restoreSelection(u,d),tt.highlightSegment(n,r.points,e,t,!0)},50)}var yc=16384,s9=new Float64Array(yc),i9=new Float64Array(yc),o9=new Float64Array(yc),Tfe=new Float64Array(yc),Dfe=new Float64Array(yc),$C=new Float64Array(yc+1),HC=new Float64Array(yc+1),a9=[1,2,3,5,8,10,15,20,30,45,60,90,120,180,240,300,420,600,900,1200];function Ife(n,e,t){let r=Math.min(n.length,yc);if(r===0)return{minWPrimeBal:2e4,matchesBurned:0,decouplingPct:0,quadrantPct:[25,25,25,25],sectionPeaks:[]};for(let M=0;M0?pe*$*36:0;s9[M]=G,i9[M]=1/W,o9[M]=xe,Tfe[M]=pe,Dfe[M]=ee,$C[M+1]=$C[M]+G,HC[M+1]=HC[M]+ee}let s=0;for(let M=0;Mr)continue;let G=r-j,W=0,xe=0;for(let pe=0;pe<=G;pe++){let $=$C[pe+j]-$C[pe],ee=HC[pe+j]-HC[pe];$>W&&(W=$),ee>xe&&(xe=ee)}s+=(W+xe)/j}let i=2e4,o=2e4,a=0,c=!1,u=r>>1,d=0,p=0,f=[0,0,0,0],h=88,m=e/h;for(let M=0;M0?xe:0,we=546*Math.exp(-.008*(pe+$*.625))+316;o=Math.min(2e4,o-$+(2e4-o)*(1/we)),o17500&&c&&(c=!1);let We=j/G;We>=m&&G>=h?f[0]++:We>=m&&G0?d/u:1,y=r-u>0?p/(r-u):1,b=g>0?(g-y)/g*100:0,E=[Number((f[0]/r*100).toFixed(1)),Number((f[1]/r*100).toFixed(1)),Number((f[2]/r*100).toFixed(1)),Number((f[3]/r*100).toFixed(1))],V=(t&&t.length>0?t.filter(M=>M.kind==="quarter"||M.kind==="climb"||M.kind==="sprint"):[]).slice(0,8).map(M=>{let j=M.stats,G=j.duration&&j.duration>0?j.duration/36e5:0;return{label:M.label,distKm:Number((j.totalDist/1e3).toFixed(2)),avgPower:j.avgPower||0,peak60sPower:j.powerCurve?.[60]?.power||j.avgPower||0,avgHR:j.avgHR||0,vam:G>0?Math.round(j.elevGain/G):0}});return s<-1e12&&(i=0),{minWPrimeBal:i,matchesBurned:a,decouplingPct:b,quadrantPct:E,sectionPeaks:V}}var kb=null,TN=null;function DN(){return kb||window.__trackStateService?.insightsTab||null}function l9(n){TN=n}var Ni=class{constructor(){this.state=ye(Rr);this.cdr=ye(bn);this.elRef=ye(en);this.isResetState=!0;this.hasTrack=!1;this.hasInsights=!1;this.currentTrack=null;this.allTracks=[];this.powerColor=et.power.color;this.hrColor=et.hr.color;this.elevColor=et.elevation.color;this.mapColorMetric=null;this.powerTableExpanded=!1;this.hrTableExpanded=!1;this.wPrimeMinAttr="20000";this.matchesBurned=0;this.sectionRangeBadge="Full Track";this.powerCurveRows=[];this.hrCurveRows=[];this.powerZoneRows=[];this.hrZoneRows=[];this.climbingStats={elevGain:0,elevLoss:0,grade:"0.0",vam:0};this.hasEfficiency=!1;this.efficiencyStats={ef:"0.00",decoupling:"0.0",wPrimeKj:"20.0",quadrantsText:"25% / 25% / 25% / 25%",np:0,ifVal:"0.00",vi:"1.00",tss:0,workKj:0};this.sectionPeaks=[];this.courseRows=[];this.insightPlots=[];this.activeStats=null;this.state.insightsTab=this,kb=this}ngOnInit(){this.state.insightsTab=this,kb=this}ngOnDestroy(){this.destroyPlots(),kb===this&&(kb=null)}showToast(e,t){TN?TN(e,t):this.state.showToast(e,t==="error"?"error":"info")}destroyPlots(){this.insightPlots.forEach(e=>e.destroy()),this.insightPlots=[]}reset(){this.destroyPlots(),document.querySelectorAll(".hr-settings-popup, .pw-settings-popup").forEach(e=>e.remove()),this.isResetState=!0,this.hasTrack=!1,this.hasInsights=!1,this.currentTrack=null,this.activeStats=null,this.powerCurveRows=[],this.hrCurveRows=[],this.powerZoneRows=[],this.hrZoneRows=[],this.sectionPeaks=[],this.courseRows=[],this.cdr.detectChanges()}render(e,t=[],r=null){if(this.destroyPlots(),this.currentTrack=e,this.allTracks=t,this.isResetState=!1,!e){this.hasTrack=!1,this.hasInsights=!1,this.activeStats=null,this.cdr.detectChanges();return}this.hasTrack=!0,_n.ensureCurvesAndZones(e),e.stats.sections||(e.stats.sections=_n.analyzeTrackSections(e.points));let s=r||St.get().sel||null,i=e.points,o=e.stats;if(s&&e.points.length>4){let f=e.points[0].time||0,h=f+s[0]*1e3,m=f+s[1]*1e3,g=e.points.findIndex(b=>(b.time||0)>=h),y=e.points.findIndex(b=>(b.time||0)>=m);g===-1&&(g=0),y===-1&&(y=e.points.length-1),y>g+4&&(i=e.points.slice(g,y+1),o=_n.computeStats(i,!0))}if(this.activeStats=o,!o.powerCurve&&!o.hrZones&&!o.hrCurve){this.hasInsights=!1,this.cdr.detectChanges();return}this.hasInsights=!0,this.mapColorMetric=Oe.getMapColorMetric(),this.powerTableExpanded=!1,this.hrTableExpanded=!1,this.sectionRangeBadge=s?`${wn(Math.round(s[0]))} \u2013 ${wn(Math.round(s[1]))}`:"Full Track";let a=_n.getFTP(),c=Ife(i,a,e.stats.sections);if(this.wPrimeMinAttr=c.minWPrimeBal.toFixed(0),this.matchesBurned=c.matchesBurned,o.powerCurve){let f=Object.keys(o.powerCurve).map(Number).sort((h,m)=>h-m);this.powerCurveRows=f.map(h=>{let m=o.powerCurve[h],g=m.power||m.hr||m.val||0;return{dur:h,durationLabel:Tr(h),val:g,idx:m.idx}})}else this.powerCurveRows=[];if(o.hrCurve){let f=Object.keys(o.hrCurve).map(Number).sort((h,m)=>h-m);this.hrCurveRows=f.map(h=>{let m=o.hrCurve[h],g=m.power||m.hr||m.val||0;return{dur:h,durationLabel:Tr(h),val:g,idx:m.idx}})}else this.hrCurveRows=[];if(o.powerZones){let f=o.powerZones.reduce((g,y)=>g+y,0),h=el.getPowerZones(),m=[];o.powerZones.forEach((g,y)=>{if(y>=h.length)return;let b=h[y],E=f>0?g/f*100:0,_=isFinite(b.max)?`${Math.round(b.min)} - ${Math.round(b.max)} W`:`> ${Math.round(b.min)} W`;m.push({zoneLabel:`Z${y+1}`,name:b.name,rangeText:_,timeStr:wn(Math.round(g)),pct:E,pctStr:E.toFixed(1),color:b.color})}),this.powerZoneRows=m}else this.powerZoneRows=[];if(o.hrZones){let f=o.hrZones.reduce((g,y)=>g+y,0),h=el.getHRZones(),m=[];o.hrZones.forEach((g,y)=>{if(y>=h.length)return;let b=h[y],E=f>0?g/f*100:0,_=isFinite(b.max)?`${Math.round(b.min)} - ${Math.round(b.max)} bpm`:`> ${Math.round(b.min)} bpm`;m.push({zoneLabel:`Z${y+1}`,name:b.name,rangeText:_,timeStr:wn(Math.round(g)),pct:E,pctStr:E.toFixed(1),color:b.color})}),this.hrZoneRows=m}else this.hrZoneRows=[];let u=o.totalDist/1e3,d=u>0?o.elevGain/(u*1e3)*100:0;if(this.climbingStats={elevGain:Math.round(o.elevGain),elevLoss:Math.round(o.elevLoss),grade:d.toFixed(1),vam:o.duration&&o.duration>0?Math.round(o.elevGain/o.duration*36e5):0},o.avgPower&&o.avgHR){this.hasEfficiency=!0;let f=o.avgPower/o.avgHR,h=Math.round(o.avgPower*(1+Math.min(.22,Math.abs(c.decouplingPct)*.005+(o.maxPower>o.avgPower?(o.maxPower-o.avgPower)/Math.max(100,o.maxPower)*.08:.04)))),m=o.avgPower>0?(h/o.avgPower).toFixed(2):"1.00",g=a>0?(h/a).toFixed(2):"0.00",y=o.duration?o.duration/1e3:i.length,b=a>0&&y>0?Math.round(y*h*(h/a)/(a*3600)*100):0,E=Math.round(o.avgPower*y/1e3);this.efficiencyStats={ef:f.toFixed(2),decoupling:c.decouplingPct.toFixed(1),wPrimeKj:(c.minWPrimeBal/1e3).toFixed(1),quadrantsText:`${c.quadrantPct.join("% / ")}%`,np:h,ifVal:g,vi:m,tss:b,workKj:E}}else this.hasEfficiency=!1;this.sectionPeaks=c.sectionPeaks;let p=xN(e);this.courseRows=p.map(f=>{let h=BC(e,f.points);if(h){let m=Xd(e,h.startIdx,h.endIdx),g=e.stats?.startTime||e.points?.[0]?.time,y=g?yo(g):"-",b=m.duration?wn(Math.round(m.duration/1e3)):"-",E=m.avgSpeed?`${(m.avgSpeed*3.6).toFixed(1)} km/h`:"-",_=m.avgSpeed?`${Yd(1e3/m.avgSpeed)} /km`:"-",V=e.sport?e.sport.toLowerCase():"",M=ri[V],j=M?M.icon:"help",G=M?M.name:e.sport||"Unknown";return{id:f.id,name:f.name,hasSegment:!0,dateStr:y,timeStr:b,speedStr:E,paceStr:_,sportIcon:j,sportTitle:G,powerStr:m.avgWatts?`${m.avgWatts} W`:"-",hrStr:m.avgHR?`${m.avgHR} bpm`:"-",cadStr:m.avgCadence?`${m.avgCadence} rpm`:"-"}}return{id:f.id,name:f.name,hasSegment:!1,dateStr:"-",timeStr:"-",speedStr:"-",paceStr:"-",sportIcon:"help",sportTitle:"Unknown",powerStr:"-",hrStr:"-",cadStr:"-"}}),this.cdr.detectChanges(),this.mountCurveCharts(e,o)}mountCurveCharts(e,t){let r=this.insightsGridRef?.nativeElement||this.elRef.nativeElement.querySelector("#insights-grid");if(!r)return;let s=Math.round(r.getBoundingClientRect().width-42)||480;if(t.powerCurve&&this.powerCurveRows.length>0){let i=this.powerCurveChartRef?.nativeElement||r.querySelector("#power-curve-chart"),o=this.powerCurYValRef?.nativeElement||i?.querySelector(".cur-y-val");i&&o&&this.createCurvePlot({chartEl:i,curYValEl:o,gridEl:r,track:e,curve:t.powerCurve,rows:this.powerCurveRows,metricKey:"power",label:"Power Curve",unit:"W",color:this.powerColor,chartWidth:s})}if(t.hrCurve&&this.hrCurveRows.length>0){let i=this.hrCurveChartRef?.nativeElement||r.querySelector("#hr-curve-chart"),o=this.hrCurYValRef?.nativeElement||i?.querySelector(".cur-y-val");i&&o&&this.createCurvePlot({chartEl:i,curYValEl:o,gridEl:r,track:e,curve:t.hrCurve,rows:this.hrCurveRows,metricKey:"hr",label:"Heart Rate Curve",unit:"bpm",color:this.hrColor,chartWidth:s})}}createCurvePlot(e){let{chartEl:t,curYValEl:r,gridEl:s,track:i,curve:o,rows:a,metricKey:c,label:u,unit:d,color:p}=e,f=a.map(y=>y.dur),h=a.map(y=>y.val);t.querySelectorAll(".uplot").forEach(y=>y.remove());let m={id:`${c}-curve`,width:e.chartWidth||Math.round(s.getBoundingClientRect().width-42)||t.clientWidth||500,height:250,padding:[10,10,0,10],scales:{x:{time:!1,distr:3,auto:!0},y:{auto:!0}},series:[{},{label:u,stroke:p,width:2,fill:Gt(p,.1),points:{show:!0,size:5,fill:p}}],axes:[{stroke:"#555564",grid:{stroke:"#2e2e34",width:1},show:!0,values:()=>[],ticks:{show:!1},font:"10px system-ui, sans-serif",size:30},{stroke:"#555564",grid:{stroke:"#2e2e34",width:1},values:(y,b)=>b.map(E=>`${E}${d}`),font:"10px system-ui, sans-serif",size:50}],cursor:{drag:{x:!1,y:!1},dataIdx:(y,b,E)=>E},hooks:{draw:[y=>{let b=y.ctx,E=window.devicePixelRatio||1,_=y.bbox,V=[1,2,5,10,20,30,60,120,300,600,1200,1800,3600,7200,10800],M=f[f.length-1];b.save(),b.fillStyle="#555564",b.textAlign="center",b.textBaseline="top",b.font=`${10*E}px system-ui, sans-serif`;let j=-100;V.forEach(G=>{if(G>M)return;let W=y.valToPos(G,"x",!0);W>j+30*E&&W<_.left+_.width+5*E&&(b.fillText(Tr(G),W,_.top+_.height+6*E),j=W)}),b.restore()}],init:[y=>{y.over.addEventListener("click",()=>{let b=y.cursor.idx;if(b!=null&&f[b]!=null){let E=f[b],_=o[E];_&&this.onShowPeak(_.idx,E)}})}],setCursor:[y=>{if(!y._ready)return;y.redraw(!1);let b=y.cursor.idx,E=y.ctx,_=window.devicePixelRatio||1,V=y.bbox,M=b!=null&&h[b]!=null&&y.cursor.left>=0,j=y.cursor.top,G=M?y.valToPos(h[b],"y",!1):0;if(M&&Math.abs(j-G)<40){let xe=y.valToPos(f[b],"x",!1),pe=y.valToPos(h[b],"y",!1),$=f[b];r.innerHTML=`${Tr($)}: ${h[b]} ${d}`,r.style.transform=`translate(${xe}px, ${pe}px) translate(15px, 15px)`,r.style.display="";let ee=y.valToPos(f[b],"x",!0),we=y.valToPos(h[b],"y",!0);E.save(),E.beginPath(),E.setLineDash([2*_,2*_]),E.strokeStyle=Gt(p,.4),E.lineWidth=1*_,E.moveTo(ee,V.top),E.lineTo(ee,V.top+V.height),E.stroke(),E.beginPath(),E.setLineDash([]),E.arc(ee,we,3*_,0,Math.PI*2),E.fillStyle="#0e0e10",E.fill(),E.strokeStyle=p,E.lineWidth=2*_,E.stroke(),E.restore()}else r.style.display="none"}]},legend:{show:!1}},g=new Cfe(m,[f,h],t);g._ready=!0,this.insightPlots.push(g)}onToggleMapColor(e,t){t.stopPropagation(),Oe.toggleMapColor(e),this.mapColorMetric=Oe.getMapColorMetric(),this.cdr.detectChanges()}onShowPeak(e,t){if(!this.currentTrack)return;let r=this.currentTrack.points,s=Math.min(r.length-1,e+t-1),i=r[0]?.time||0,o=((r[e]?.time||i)-i)/1e3,a=((r[s]?.time||i)-i)/1e3;St.patch({sel:[o,a]}),tt.highlightSegment(this.currentTrack.id,r,e,s,!0)}onSelectCourse(e){Kd(e,!0),St.patch({tab:"courses"},!0),this.state.activateTab("courses",!0)}onHoverCourse(e){if(!this.currentTrack)return;let r=xN(this.currentTrack).find(s=>s.id===e);if(r){let s=BC(this.currentTrack,r.points);s&&tt.highlightSegment(this.currentTrack.id,this.currentTrack.points,s.startIdx,s.endIdx,!1)}}onLeaveCourse(){tt.clearHighlight()}onShowHRZoneSettings(e){if(e.stopPropagation(),!this.currentTrack)return;let t=e.currentTarget,r=this.currentTrack;document.querySelectorAll(".hr-settings-popup").forEach(c=>c.remove());let s=document.createElement("div");s.className="hr-settings-popup";let i=_n.getHRZones();s.innerHTML=` +
Configure HR Zones (bpm)
+
+
+ Z1 / Z2 + +
+
+ Z2 / Z3 + +
+
+ Z3 / Z4 + +
+
+ Z4 / Z5 + +
+ +
+ `;let o=t.getBoundingClientRect();s.style.cssText=` + position: fixed; + z-index: 10000; + background: var(--surface2); + border: 1px solid var(--border); + border-radius: 12px; + padding: 16px; + width: 200px; + box-shadow: 0 8px 32px rgba(0,0,0,0.6); + left: ${o.right-200}px; + top: ${o.bottom+8}px; + `,document.body.appendChild(s),s.querySelector(".save-btn")?.addEventListener("click",async()=>{let c=s.querySelectorAll(".hr-zone-input"),u=Array.from(c).map(d=>parseInt(d.value)||0);for(let d=1;d{!s.contains(c.target)&&!t.contains(c.target)&&(s.remove(),document.removeEventListener("click",a))};setTimeout(()=>document.addEventListener("click",a),10)}onShowPowerZoneSettings(e){if(e.stopPropagation(),!this.currentTrack)return;let t=e.currentTarget,r=this.currentTrack;document.querySelectorAll(".pw-settings-popup").forEach(c=>c.remove());let s=document.createElement("div");s.className="pw-settings-popup";let i=_n.getFTP();s.innerHTML=` +
Configure FTP (Watts)
+
+
+ Your FTP + +
+ +
+ `;let o=t.getBoundingClientRect();s.style.cssText=` + position: fixed; + z-index: 10000; + background: var(--surface2); + border: 1px solid var(--border); + border-radius: 12px; + padding: 16px; + width: 200px; + box-shadow: 0 8px 32px rgba(0,0,0,0.6); + left: ${o.right-200}px; + top: ${o.bottom+8}px; + `,document.body.appendChild(s),s.querySelector(".save-btn")?.addEventListener("click",async()=>{let c=s.querySelector("#ftp-input"),u=parseInt(c.value)||200;_n.setFTP(u),await Gn.set("ftp",u),r.stats=_n.computeStats(r.points,!0),await Gn.save(r),this.render(r,this.allTracks),s.remove(),this.showToast(`FTP updated to ${u}W`)});let a=c=>{!s.contains(c.target)&&!t.contains(c.target)&&(s.remove(),document.removeEventListener("click",a))};setTimeout(()=>document.addEventListener("click",a),10)}};Xn([Ua("insightsGrid")],Ni.prototype,"insightsGridRef",2),Xn([Ua("powerCurveChart")],Ni.prototype,"powerCurveChartRef",2),Xn([Ua("powerCurYVal")],Ni.prototype,"powerCurYValRef",2),Xn([Ua("hrCurveChart")],Ni.prototype,"hrCurveChartRef",2),Xn([Ua("hrCurYVal")],Ni.prototype,"hrCurYValRef",2),Ni=Xn([ms({selector:"app-insights-tab",standalone:!0,imports:[tr,Yr],template:` +
+
+ no_sim +
Select a track for insights
+
+ +
+ analytics +
+ No insights available for this track (requires Power or Heart Rate data) +
+
+ +
+ +
+
+
+
+ boltPower + Curve +
+ +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + +
DurationPeak
{{ row.durationLabel }}{{ row.val }} W + +
+
+
+ + +
+
+
+
+ favoriteHeart + Rate Curve +
+ +
+ +
+
+ +
+
+ + + + + + + + + + + + + + + +
DurationPeak
{{ row.durationLabel }}{{ row.val }} bpm + +
+
+
+ + +
+
+
+
+ boltPower + Zones +
+ +
+ +
+
+
+
+ {{ + z.zoneLabel + }} + {{ z.name }} + {{ + z.rangeText + }} + {{ z.timeStr }} + {{ z.pctStr }}% +
+
+
+
+
+
+
+ + +
+
+
+
+ favoriteHeart + Rate Zones +
+ +
+ +
+
+
+
+ {{ + z.zoneLabel + }} + {{ z.name }} + {{ + z.rangeText + }} + {{ z.timeStr }} + {{ z.pctStr }}% +
+
+
+
+
+
+
+ + +
+
+ terrainClimbing + Analysis +
+
+
+
Total Ascent
+
{{ climbingStats.elevGain }} m
+
+
+
Total Descent
+
{{ climbingStats.elevLoss }} m
+
+
+
Avg Grade
+
{{ climbingStats.grade }} %
+
+
+
VAM
+
{{ climbingStats.vam }} m/h
+
+
+
+ + +
+
+
+ monitoringEfficiency & W' Balance +
+ {{ sectionRangeBadge }} +
+
+
+
EF (Avg Power / Avg HR)
+
{{ efficiencyStats.ef }}
+
+
+
Aerobic Decoupling
+
{{ efficiencyStats.decoupling }} %
+
+
+
Min W' Reserve
+
+ {{ efficiencyStats.wPrimeKj }} kJ ({{ matchesBurned }} matches) +
+
+
+
Quadrants (Q1/Q2/Q3/Q4)
+
{{ efficiencyStats.quadrantsText }}
+
+
+
NP / IF / VI
+
+ {{ efficiencyStats.np }} W \xB7 {{ efficiencyStats.ifVal }} \xB7 {{ efficiencyStats.vi }} +
+
+
+
TSS / Work
+
+ {{ efficiencyStats.tss }} TSS \xB7 {{ efficiencyStats.workKj }} kJ +
+
+
+
+ + +
+
+ segmentTrack + Section & Climb Efforts +
+ + + + + + + + + + + + + + + + + + + + + +
SectionDistAvg WPeak 60sAvg HRVAM
{{ sp.label }}{{ sp.distKm }} km{{ sp.avgPower }} W{{ sp.peak60sPower }} W{{ sp.avgHR }} bpm{{ sp.vam }} m/h
+
+ + +
+
+ routeCourses ({{ courseRows.length }}) +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDateTimeSpeedPaceSportboltfavoritefootprint
+
+
+ {{ c.name }} +
+
+ {{ c.dateStr }} + + {{ c.timeStr }} + {{ c.speedStr }}{{ c.paceStr }} + {{ c.sportIcon }} + {{ c.powerStr }}{{ c.hrStr }}{{ c.cadStr }} + No continuous segment +
+
+
+
+
+ `})],Ni);var _fe={"Heart Rate":et.hr.icon,Cadence:et.cadence.icon,Power:et.power.icon,Temperature:et.temperature.icon,Shifting:et.gears.icon,Battery:et.battery.icon},bc=16384,Pi=[new Float64Array(bc),new Float64Array(bc),new Float64Array(bc),new Float64Array(bc),new Float64Array(bc),new Float64Array(bc),new Float64Array(bc)],c9=[5,15,30,60];function kfe(n,e){let t=n.points,r=Math.min(t.length,bc),s=0;for(let b=0;b=r)continue;let _=1/E,V=Math.max(1,E>>1);for(let M=0;M<7;M++){let j=Pi[M],G=0,W=0,xe=0,pe=0,$=1/(10+M*15+b*2);for(let ee=0;ee=E){let We=j[ee-E];G-=We,W-=We*We;let P=G*_,A=Math.max(0,W*_-P*P),S=j[ee-V],x=we-j[ee-1],C=x*x*$,I=b<4?Math.exp(-C):1/(1+C);pe+=x*x*I;let F=1/(1+A*1e-4);xe+=(we-P)*(S-P)*F}}s+=(xe+pe*.001)/Math.max(1,r)}}let i=n.stats.sections||_n.analyzeTrackSections(t),o=[];for(let b=0;bE[1].secs-b[1].secs).slice(0,8).map(([b,E])=>({combo:b,ratio:(E.front/Math.max(1,E.rear)).toFixed(2),seconds:E.secs,pct:Number((E.secs/Math.max(1,r)*100).toFixed(1)),avgPower:Math.round(E.pwrSum/Math.max(1,E.secs)),avgCadence:Math.round(E.cadSum/Math.max(1,E.secs))})),u=e.length>0?e:[n],d=1,p=1,f=1,h=0,m=0;for(let b=0;bn.stats.totalDist&&d++,(E.avgPower||0)>(n.stats.avgPower||0)&&p++,E.elevGain>n.stats.elevGain&&f++}let g=Math.round(h/Math.max(1,u.length)),y=(m/Math.max(1,u.length)/1e3).toFixed(1);return{stabilityAccum:s,splitRows:o.slice(0,12),gearMatrix:c,peerSummary:{cohortSize:u.length,distRank:d,pwrRank:p,elevRank:f,cohortAvgPower:g,cohortAvgDistKm:y}}}var Ab=null,IN=null,_N=null;function kN(){return Ab||window.__trackStateService?.detailsTab||null}function u9(n,e){IN=n,_N=e}var Jd=class{constructor(){this.state=ye(Rr);this.cdr=ye(bn);this.isResetState=!0;this.currentTrack=null;this.globalTags=[];this.titleInputVal="";this.newTagVal="";this.tagPills=[];this.summary={distKm:"0.00",durationStr:"\u2014",avgSpeedStr:"\u2014",maxSpeedStr:"0.0",avgBattery:null};this.metadata={fileName:"\u2014",fileSizeStr:"\u2014",formatStr:"GPX",sportIcon:"question_mark",sportName:"\u2014",subSport:"",device:"Unknown Device",startTimeStr:"Unknown"};this.sensorInfo={pointsCountStr:"0",sensors:[]};this.telemetryStabilityPct="95.0";this.hasBiometrics=!1;this.biometrics={avgHR:null,maxHR:0,avgPower:null,maxPower:0,avgCadence:null,avgTempStr:null,tempRangeStr:null};this.hasDrivetrain=!1;this.totalShifts=0;this.gearMatrix=[];this.splitRows=[];this.zoneTableRows=[];this.peerSummary={cohortSize:1,distRank:1,pwrRank:1,elevRank:1,cohortAvgPower:0,cohortAvgDistKm:"0.0"};this.deviceCards=[];this.state.detailsTab=this,Ab=this}ngOnInit(){this.state.detailsTab=this,Ab=this}ngOnDestroy(){Ab===this&&(Ab=null)}notifyTagsChanged(){IN?IN():this.state.onTagsChanged()}reset(){this.isResetState=!0,this.currentTrack=null,this.tagPills=[],this.splitRows=[],this.gearMatrix=[],this.zoneTableRows=[],this.deviceCards=[],this.cdr.detectChanges()}render(e,t=[],r=[],s){if(this.isResetState=!1,this.currentTrack=e,this.globalTags=t,!e){this.cdr.detectChanges();return}let i=e;if(s&&s.length===2){let d=e.points[0]?.time||0,p=d+s[0]*1e3,f=d+s[1]*1e3,h=Math.max(0,e.points.findIndex(g=>(g.time||0)>=p)),m=e.points.findIndex(g=>(g.time||0)>=f);if(m===-1&&(m=e.points.length-1),m>h+2){let g=e.points.slice(h,m+1),y=_n.computeStats(g,!0);i={...e,points:g,stats:y}}}let o=i.stats,a=i.points[0]?.time;_n.ensureCurvesAndZones(i);let c=kfe(i,r);this.telemetryStabilityPct=Math.min(99.9,Math.max(80,95+Math.tanh(c.stabilityAccum*.002)*4.5)).toFixed(1),this.titleInputVal=e.displayName||e.name,this.rebuildTagPills(),this.summary={distKm:(o.totalDist/1e3).toFixed(2),durationStr:o.duration?wn(Math.floor(o.duration/1e3)):"\u2014",avgSpeedStr:o.avgSpeed?(o.avgSpeed*3.6).toFixed(1):"\u2014",maxSpeedStr:(o.maxSpeed*3.6).toFixed(1),avgBattery:o.avgBattery??null},this.metadata={fileName:e.fileName||"\u2014",fileSizeStr:e.fileSize?A6(e.fileSize):"\u2014",formatStr:e.format.toUpperCase(),sportIcon:P6(e.sport),sportName:ri[e.sport?.toLowerCase()||""]?.name||"\u2014",subSport:e.subSport||"",device:e.device||"Unknown Device",startTimeStr:a?k6(a):"Unknown"},this.sensorInfo={pointsCountStr:e.points.length.toLocaleString("en-US"),sensors:o.sensors.map(d=>({name:d,icon:_fe[d]||"sensors"}))},this.hasBiometrics=!!(o.avgHR||o.avgPower||o.avgCadence||o.avgTemp!=null),this.biometrics={avgHR:o.avgHR,maxHR:o.maxHR,avgPower:o.avgPower,maxPower:o.maxPower,avgCadence:o.avgCadence,avgTempStr:o.avgTemp!=null?o.avgTemp.toFixed(1):null,tempRangeStr:o.minTemp!=null&&o.maxTemp!=null?`${o.minTemp.toFixed(1)} \u2013 ${o.maxTemp.toFixed(1)}`:null},this.gearMatrix=c.gearMatrix,this.splitRows=c.splitRows,this.peerSummary=c.peerSummary,this.totalShifts=o.shifts??0,this.hasDrivetrain=o.shifts!==null||this.gearMatrix.length>0;let u=[];if(o.powerZones){let d=o.powerZones.reduce((f,h)=>f+h,0),p=el.getPowerZones();o.powerZones.forEach((f,h)=>{if(h0){let m=p[h],g=d>0?f/d*100:0;u.push({kind:"Pwr",zone:`Z${h+1}`,name:m.name,range:isFinite(m.max)?`${Math.round(m.min)}\u2013${Math.round(m.max)} W`:`>${Math.round(m.min)} W`,timeStr:wn(Math.round(f)),pctStr:g.toFixed(1)})}})}if(o.hrZones){let d=o.hrZones.reduce((f,h)=>f+h,0),p=el.getHRZones();o.hrZones.forEach((f,h)=>{if(h0){let m=p[h],g=d>0?f/d*100:0;u.push({kind:"HR",zone:`Z${h+1}`,name:m.name,range:isFinite(m.max)?`${Math.round(m.min)}\u2013${Math.round(m.max)} bpm`:`>${Math.round(m.min)} bpm`,timeStr:wn(Math.round(f)),pctStr:g.toFixed(1)})}})}if(this.zoneTableRows=u,e.devices&&e.devices.length>0){let d=new Set;this.deviceCards=e.devices.filter(p=>{if(!(p.name||p.product||p.manufacturer))return!1;let h=`${p.name}|${p.product}|${p.manufacturer}|${p.serial}`;return d.has(h)?!1:(d.add(h),!0)}).map(p=>{let f=p.name||p.product||"Unknown Device",h=[p.serial?`SN: ${p.serial}`:null,p.version?`v${p.version}`:null,p.hardwareVersion?`hw:${p.hardwareVersion}`:null].filter(Boolean).join(" \u2022 "),m=[p.batteryLevel?`${p.batteryLevel}%`:null,p.batteryStatus?`Status: ${p.batteryStatus}`:null,p.batteryVoltage?`${p.batteryVoltage.toFixed(2)}V`:null].filter(Boolean).join(" \u2022 "),g="",y=String(p.sourceType||"").toLowerCase();y.includes("local")?g="memory":y.includes("antplus")||y.includes("ant_plus")?g="settings_input_antenna":y.includes("bluetooth")&&(g="bluetooth");let b="sensors",E=String(f).toLowerCase();return E.includes("heartrate")||E.includes("hrm")?b=et.hr.icon:E.includes("power")?b=et.power.icon:E.includes("speed")?b=et.speed.icon:E.includes("cadence")?b=et.cadence.icon:E.includes("barometer")?b="air":E.includes("temperature")?b=et.temperature.icon:E.includes("gps")&&(b="location_on"),{name:String(f),manufacturer:p.manufacturer||"",extra:h,battery:m,sourceIcon:g,sourceType:String(p.sourceType||""),deviceIcon:b,type:p.type||"device"}})}else this.deviceCards=[];this.cdr.detectChanges()}rebuildTagPills(){let e=this.currentTrack?.tags||[];this.tagPills=e.map(t=>({name:t,color:FC(t)}))}async onAddTag(){if(!this.currentTrack)return;let e=this.newTagVal.trim().toLowerCase();if(!e)return;let t=new Set(this.currentTrack.tags||[]);if(t.has(e)){this.newTagVal="",this.cdr.detectChanges();return}t.add(e),this.currentTrack.tags=Array.from(t).sort(),await Gn.save(this.currentTrack),this.newTagVal="",this.rebuildTagPills(),this.cdr.detectChanges(),this.notifyTagsChanged()}async onRemoveTag(e){this.currentTrack&&(this.currentTrack.tags=(this.currentTrack.tags||[]).filter(t=>t!==e),await Gn.save(this.currentTrack),this.rebuildTagPills(),this.cdr.detectChanges(),this.notifyTagsChanged())}async onTitleChange(){if(!this.currentTrack)return;let e=this.titleInputVal.trim();e&&(this.currentTrack.displayName=e,await Gn.save(this.currentTrack),this.notifyTagsChanged())}onShowSportMenu(e){e.stopPropagation();let t=this.currentTrack;if(!t)return;let r=e.currentTarget;document.querySelectorAll(".metric-menu-popup").forEach(u=>u.remove());let s=document.createElement("div");s.className="metric-menu-popup",Object.keys(ri).forEach(u=>{let d=ri[u],p=document.createElement("div"),f=t.sport?.toLowerCase()===u;p.className=`menu-item ${f?"active":""}`,p.innerHTML=` + ${d.icon} + ${d.name} + ${f?"check":""} + `,p.addEventListener("click",async()=>{t.sport=u,await Gn.save(t),s.remove(),this.metadata.sportIcon=d.icon,this.metadata.sportName=d.name,this.cdr.detectChanges(),this.notifyTagsChanged()}),s.appendChild(p)});let i=document.createElement("div"),o=!t.sport;i.className=`menu-item ${o?"active":""}`,i.innerHTML=` + block + \u2014 + ${o?"check":""} + `,i.addEventListener("click",async()=>{t.sport=void 0,await Gn.save(t),s.remove(),this.metadata.sportIcon="question_mark",this.metadata.sportName="\u2014",this.cdr.detectChanges(),this.notifyTagsChanged()}),s.appendChild(i),document.body.appendChild(s);let a=r.getBoundingClientRect();s.style.top=`${a.bottom+window.scrollY+4}px`,s.style.left=`${a.left+window.scrollX}px`;let c=u=>{!s.contains(u.target)&&!r.contains(u.target)&&(s.remove(),document.removeEventListener("click",c))};setTimeout(()=>document.addEventListener("click",c),10)}onDeleteTrack(){this.currentTrack&&confirm(`Remove "${this.currentTrack.name}"?`)&&(_N?_N(this.currentTrack.id):this.state.deleteTrack(this.currentTrack.id))}};Jd=Xn([ms({selector:"app-details-tab",standalone:!0,imports:[tr,Yr],template:` +
+
+ no_sim +
Select a track for details
+
+ + +
+ +
+ +
+ +
+
labelTags
+
+ No tags added +
+ {{ t.name }} + close +
+
+
+ + + + + +
+
+ + +
+
+ analyticsActivity Summary +
+
+
+
Distance
+
{{ summary.distKm }} km
+
+
+
Duration
+
{{ summary.durationStr }}
+
+
+
Avg Speed
+
{{ summary.avgSpeedStr }} km/h
+
+
+
Max Speed
+
{{ summary.maxSpeedStr }} km/h
+
+
+
Avg Battery
+
{{ summary.avgBattery }}%
+
+
+
+ + +
+
+ infoFile Metadata +
+
+
+
Original Filename
+
+ {{ metadata.fileName }} +
+
+
+
File Size
+
{{ metadata.fileSizeStr }}
+
+
+
Format
+
{{ metadata.formatStr }}
+
+
+
Sport
+
+ {{ metadata.sportIcon }} + {{ metadata.sportName }} + expand_more + ({{ metadata.subSport }}) +
+
+
+
Device / Creator
+
{{ metadata.device }}
+
+
+
Start Time
+
{{ metadata.startTimeStr }}
+
+
+
+ + +
+
+ sensorsSensor Info +
+
+
+
Total Points
+
{{ sensorInfo.pointsCountStr }} pts
+
+
+
Telemetry Stability
+
{{ telemetryStabilityPct }}%
+
+
+
Peer Cohort Ranking
+
+ Dist #{{ peerSummary.distRank }}/{{ peerSummary.cohortSize }} \xB7 Elev #{{ + peerSummary.elevRank + }}/{{ peerSummary.cohortSize }} ({{ peerSummary.cohortAvgDistKm }} km avg) +
+
+
+
Sensors Found
+
+ + {{ s.icon }} + + + GPS only + +
+
+
+
+ + +
+
+ monitoringBiometric Averages +
+
+
+
Avg HR
+
{{ biometrics.avgHR }} bpm
+
+
+
Max HR
+
{{ biometrics.maxHR }} bpm
+
+
+
Avg Power
+
{{ biometrics.avgPower }} W
+
+
+
Max Power
+
{{ biometrics.maxPower }} W
+
+
+
Avg Cadence
+
{{ biometrics.avgCadence }} rpm
+
+
+
Avg Temp
+
{{ biometrics.avgTempStr }} \xB0C
+
+
+
Temp Range
+
{{ biometrics.tempRangeStr }} \xB0C
+
+
+
+ + +
+
+ settingsDrivetrain & Gear Matrix +
+
+
+
Total Shifts
+
{{ totalShifts }}
+
+
+
Cohort Power Rank
+
+ #{{ peerSummary.pwrRank }} / {{ peerSummary.cohortSize }} ({{ + peerSummary.cohortAvgPower + }} + W avg) +
+
+
+ + + + + + + + + + + + + + + + + + + +
GearRatioShareAvg WCad
{{ gm.combo }}{{ gm.ratio }}{{ gm.pct }}% ({{ gm.seconds }}s){{ gm.avgPower }} W{{ gm.avgCadence }} rpm
+
+ + +
+
+ bar_chartPower & HR Zone Summary +
+ + + + + + + + + + + + + + + + + + + +
ZoneNameRangeTimeShare
{{ zr.kind }} {{ zr.zone }}{{ zr.name }}{{ zr.range }}{{ zr.timeStr }}{{ zr.pctStr }}%
+
+ + +
+
+ splitscreenSection & Kilometer + Splits ({{ splitRows.length }}) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SectionDistTimeGainSpeedPowerHRCadTempStability
{{ sr.label }}{{ sr.distKm }} km{{ sr.durationStr }}+{{ sr.elevGain }} m{{ sr.avgSpeedKmh }} km/h{{ sr.avgPower }} W{{ sr.avgHR }} bpm{{ sr.avgCadence }} rpm{{ sr.avgTemp }} \xB0C{{ sr.stabilityPct }}%
+
+ + +
+
+ watchHardware & Sensors +
+
+
+
+
+ {{ + d.deviceIcon + }} +
+ {{ d.name }} +
+ {{ d.sourceIcon }} +
+
+ {{ d.manufacturer }} +
+
+
+ {{ d.extra }} +
+
+
+ {{ d.type }} +
+
+ battery_charging_full + {{ d.battery }} +
+
+
+
+
+ + +
+
+ deleteDanger Zone +
+
+ +
+
+
+
+
+ `})],Jd);import d9 from"uplot";var Afe=16384,AN=new Float64Array(32*32);function Mfe(n,e){let t=e.length>=2?e:n,r=Math.min(t.length,8);AN.fill(0);let s=[{label:"Power vs Heart Rate",getX:f=>f.power,getY:f=>f.hr},{label:"Speed vs Gradient",getX:f=>f.speed!=null?f.speed*3.6:void 0,getY:f=>f.gradient},{label:"Cadence vs Power",getX:f=>f.cad,getY:f=>f.power},{label:"Elevation vs VAM",getX:f=>f.ele,getY:f=>f.verticalSpeed},{label:"Temperature vs HR",getX:f=>f.temp,getY:f=>f.hr}],i=0,o=0,a=[];for(let f=0;f2){let j=m/_,G=g/_,W=Math.max(0,y/_-j*j),xe=Math.max(0,b/_-G*G),pe=E/_-j*G,$=Math.sqrt(W*xe);V=$>1e-9?pe/$:0,M=W>1e-9?pe/W:0}i+=_,o+=Math.abs(V)*100+Math.abs(M),a.push({pairLabel:h.label,rVal:V,rValStr:V.toFixed(2),slope:M,slopeStr:M.toFixed(2),samples:_})}for(let f=0;f<1024;f++)o+=AN[f]*.001;let c=["Q1 (0\u201325%)","Q2 (25\u201350%)","Q3 (50\u201375%)","Q4 (75\u2013100%)"],u=[],d=n[0],p=n[1]||n[0];for(let f=0;f<4;f++){let h=f*.25,m=(f+1)*.25,g=V=>{let M=V.points||[],j=Math.floor(M.length*h),G=Math.max(j+1,Math.floor(M.length*m)),W=0,xe=0,pe=0,$=0;for(let ee=j;ee0?Math.round(W/$):0,hr:$>0?Math.round(xe/$):0,speedKmh:$>0?pe/$:0}},y=g(d),b=g(p),E=0;for(let V=0;V=0?"+":""}${_}W`,cohortAvgPower:r>0?Math.round(E/r):0})}return{aggPts:i,corrSum:o,correlations:a,sectionRows:u}}var Mb=null;function ep(){return Mb||window.__trackStateService?.combinedTab||null}var wc=class{constructor(){this.state=ye(Rr);this.cdr=ye(bn);this.elRef=ye(en);this.hasTrack=!1;this.isMultiTrack=!1;this.noDataForMetrics=!1;this.currentTracksCount=0;this.currentTracks=[];this.currentTrack=null;this.allTracks=[];this.xMetric="power";this.yMetric="hr";this.xDef=Oe.METRICS.power;this.yDef=Oe.METRICS.hr;this.isPolar=!1;this.isPlaying=!1;this.sliderMax=100;this.sliderValue=0;this.sliderTimeLabel="0:00";this.currentSliderIdx=null;this.aggSummary=null;this.correlations=[];this.sectionRows=[];this.plot=null;this.currentChronoData=[];this.currentSortedData=[];this.playIntervalId=null;this.state.combinedTab=this,Mb=this}ngOnInit(){this.state.combinedTab=this,Mb=this}ngOnDestroy(){this.stopPlaying(),this.destroyPlot(),Mb===this&&(Mb=null)}destroyPlot(){this.plot&&(this.plot.destroy(),this.plot=null)}reset(){this.stopPlaying(),this.destroyPlot(),this.currentTracks=[],this.currentTrack=null,this.hasTrack=!1,this.isMultiTrack=!1,this.xMetric="power",this.yMetric="hr",this.currentSliderIdx=null,this.currentChronoData=[],this.currentSortedData=[],this.isPolar=!1,this.aggSummary=null,this.correlations=[],this.sectionRows=[];let e=document.getElementById("combined-tooltip");e&&e.remove(),this.cdr.detectChanges()}setMetrics(e,t){this.xMetric=e,this.yMetric=t,this.currentTracks.length>=2?this.render(this.currentTracks,this.allTracks):this.currentTrack&&this.render(this.currentTrack,this.allTracks)}setPolar(e){this.isPolar!==e&&(this.isPolar=e,this.currentTracks.length>=2?this.render(this.currentTracks,this.allTracks):this.currentTrack&&this.render(this.currentTrack,this.allTracks))}setSliderProgress(e){let t=Math.max(0,Math.min(1,e)),r=this.currentChronoData.length>0?this.currentChronoData.length-1:this.currentTrack?Math.max(0,this.currentTrack.points.length-1):0;this.currentSliderIdx=Math.round(t*r),this.sliderMax=r,this.sliderValue=this.currentSliderIdx,this.updateSliderLabel(),this.cdr.detectChanges(),this.plot&&this.plot.redraw()}updateSliderLabel(){if(this.currentSliderIdx!==null&&this.currentChronoData[this.currentSliderIdx]){let e=this.currentChronoData[this.currentSliderIdx][2];this.sliderTimeLabel=wn(e)}}render(e,t=[]){this.stopPlaying(),this.allTracks=t,Array.isArray(e)?(this.currentTracks=e,this.currentTrack=e[0]||null):e?(this.currentTracks=[e],this.currentTrack=e):(this.currentTracks=[],this.currentTrack=null);let r=this.currentTrack;if(!r){this.destroyPlot(),this.hasTrack=!1,this.isMultiTrack=!1,this.cdr.detectChanges();return}this.hasTrack=!0,this.currentTracksCount=this.currentTracks.length,this.isMultiTrack=this.currentTracks.length>=2;let s=Oe.METRICS,i=[];for(let o in s){let a=s[o];r.points.some(c=>c[a.field]!=null)&&i.push(o)}if(!i.includes(this.xMetric)&&i.length>0&&(this.xMetric=i[0]),!i.includes(this.yMetric)&&i.length>1?this.yMetric=i[1]:!i.includes(this.yMetric)&&i.length>0&&(this.yMetric=i[0]),this.xDef=s[this.xMetric]||s.power,this.yDef=s[this.yMetric]||s.hr,this.isMultiTrack){let{aggPts:o,corrSum:a,correlations:c,sectionRows:u}=Mfe(this.currentTracks,t);this.correlations=c,this.sectionRows=u;let d=this.currentTracks[0],p=this.currentTracks[1],f=d.stats,h=p.stats,g=((h.totalDist-f.totalDist)/1e3).toFixed(2),b=((h.avgPower||0)-(f.avgPower||0)).toFixed(0),_=((h.avgHR||0)-(f.avgHR||0)).toFixed(0),M=(h.elevGain-f.elevGain).toFixed(0),j=(h.shifts||0)-(f.shifts||0),G=((f.totalDist+h.totalDist)/1e3).toFixed(2),W=(f.elevGain+h.elevGain).toFixed(0),xe=((f.duration||0)+(h.duration||0))/1e3,pe=Math.round(((f.avgPower||0)+(h.avgPower||0))/2),$=Math.max(f.maxPower||0,h.maxPower||0),ee=Math.round(((f.avgHR||0)+(h.avgHR||0))/2),we=Math.max(f.maxHR||0,h.maxHR||0),P=((h.avgTemp??0)-(f.avgTemp??0)).toFixed(1),A=(((f.avgTemp??0)+(h.avgTemp??0))/2).toFixed(1),S=Math.max(f.maxTemp??0,h.maxTemp??0).toFixed(1),x=(f.shifts||0)+(h.shifts||0);this.aggSummary={aggPts:o,corrScore:a.toFixed(4),t1Name:d.displayName||d.name,t1Color:d.color,t2Name:p.displayName||p.name,t2Color:p.color,s1DistKm:(f.totalDist/1e3).toFixed(2),s2DistKm:(h.totalDist/1e3).toFixed(2),distDiff:`${Number(g)>=0?"+":""}${g}`,distDiffPos:Number(g)>=0,totalDist:G,s1Elev:f.elevGain.toFixed(0),s2Elev:h.elevGain.toFixed(0),eleDiff:`${Number(M)>=0?"+":""}${M}`,eleDiffPos:Number(M)>=0,totalElev:W,s1DurStr:f.duration?wn(f.duration/1e3):"--",s2DurStr:h.duration?wn(h.duration/1e3):"--",totalDurStr:wn(xe),s1AvgPwr:f.avgPower||0,s1MaxPwr:f.maxPower||0,s2AvgPwr:h.avgPower||0,s2MaxPwr:h.maxPower||0,pwrDiff:`${Number(b)>=0?"+":""}${b}`,pwrDiffPos:Number(b)>=0,avgPwr:pe,maxPwr:$,s1AvgHr:f.avgHR||0,s1MaxHr:f.maxHR||0,s2AvgHr:h.avgHR||0,s2MaxHr:h.maxHR||0,hrDiff:`${Number(_)>=0?"+":""}${_}`,hrDiffPos:Number(_)>=0,avgHr:ee,maxHr:we,s1TempStr:`${f.avgTemp!=null?f.avgTemp.toFixed(1):"--"} \xB0C / ${f.maxTemp!=null?f.maxTemp.toFixed(1):"--"} \xB0C`,s2TempStr:`${h.avgTemp!=null?h.avgTemp.toFixed(1):"--"} \xB0C / ${h.maxTemp!=null?h.maxTemp.toFixed(1):"--"} \xB0C`,tempDiff:`${Number(P)>=0?"+":""}${P}`,tempDiffPos:Number(P)>=0,avgTemp:A,maxTemp:S,s1Shifts:f.shifts||0,s2Shifts:h.shifts||0,shiftsDiff:j,shiftsDiffStr:`${j>=0?"+":""}${j}`,shiftsDiffPos:j>=0,totalShifts:x}}else this.aggSummary=null,this.correlations=[],this.sectionRows=[];this.noDataForMetrics=!1,this.cdr.detectChanges(),this.updatePlot()}updatePlot(){if(!this.currentTrack)return;let e=this.plotContainerRef?.nativeElement||this.elRef.nativeElement.querySelector("#combined-plot-container");if(!e)return;let t=this.xDef,r=this.yDef;if(this.currentTracks.length>=2){let f=0;for(let _=0;_f&&(f=this.currentTracks[_].points.length);let h=new Array(f);for(let _=0;_0?e.clientWidth:800,b=e.clientHeight>0?e.clientHeight:350,E={width:y,height:b,padding:[10,15,0,0],scales:{x:{time:!1},y:{auto:!0}},series:m,axes:[{side:2,label:"Elapsed Duration (s)",stroke:"#555564",grid:{stroke:"#2e2e34",width:1},font:"10px system-ui, sans-serif",size:30},{side:3,label:`${r.label} (${r.unit})`,stroke:"#555564",grid:{stroke:"#2e2e34",width:1},font:"10px system-ui, sans-serif",size:40}],legend:{show:!0}};this.plot=new d9(E,g,e),this.resize();return}let s=this.currentTrack.points,i=s[0]?.time||0,o=s.map((f,h)=>[f[t.field],f[r.field],((f.time||i)-i)/1e3,(f.dist||0)/1e3,h]).filter(([f,h])=>f!=null&&h!=null);if(o.length===0){this.destroyPlot(),this.noDataForMetrics=!0,this.cdr.detectChanges();return}if(this.isPolar){let f=o.map(E=>E[0]),h=o.map(E=>E[1]),m=Math.min(...f),g=Math.max(...f),y=Math.min(...h),b=Math.max(...h);this.currentChronoData=o.map(E=>{let _=E[0],V=E[1],M=(_-m)/(g-m||1)*2*Math.PI,j=(V-y)/(b-y||1),G=j*Math.cos(M),W=j*Math.sin(M);return[G,W,E[2],E[3],E[4],_,V]})}else this.currentChronoData=o.map(f=>[f[0],f[1],f[2],f[3],f[4],f[0],f[1]]);this.sliderMax=o.length-1,(this.currentSliderIdx===null||this.currentSliderIdx>=o.length)&&(this.currentSliderIdx=o.length-1),this.sliderValue=this.currentSliderIdx,this.updateSliderLabel(),this.cdr.detectChanges(),this.currentSortedData=[...this.currentChronoData].sort((f,h)=>f[0]-h[0]||f[4]-h[4]);let a=this.currentSortedData.map(f=>f[0]),c=this.currentSortedData.map(f=>f[1]),u=e.clientWidth>0?e.clientWidth:600,d=e.clientHeight>0?e.clientHeight:400;if(this.isPolar){let f=Math.min(u,d>0?d:u);u=f,d=f}let p={width:u,height:d,padding:[10,15,0,0],scales:{x:{time:!1,auto:!0},y:{auto:!0}},series:[{},{label:r.label,width:0,points:{show:!0,size:3,fill:Gt(r.color,.3)}}],axes:[{side:2,show:!this.isPolar,label:`${t.label} (${t.unit})`,stroke:"#555564",grid:{stroke:"#2e2e34",width:1},font:"10px system-ui, sans-serif",values:(f,h)=>h.map(m=>m!=null?t.fmtAxis(m):""),size:30},{side:3,show:!this.isPolar,label:`${r.label} (${r.unit})`,stroke:"#555564",grid:{stroke:"#2e2e34",width:1},font:"10px system-ui, sans-serif",values:(f,h)=>h.map(m=>m!=null?r.fmtAxis(m):""),size:40}],cursor:{drag:{x:!1,y:!1},dataIdx:(f,h,m)=>{let g=f.cursor.left,y=f.cursor.top;if(g!=null&&y!=null&&g>=0&&y>=0){let b=1/0,E=-1;for(let _=0;_=0&&b<2500)return E}return m},points:{size:7,stroke:"#fff",width:2,fill:r.color}},legend:{show:!1},hooks:{draw:[f=>{let h=f.ctx,m=window.devicePixelRatio||1;h.save(),h.beginPath(),h.strokeStyle="rgba(255, 255, 255, 0.15)",h.lineWidth=1*m;let g=!1;for(let y=0;y{let h=f.cursor.idx,m=document.getElementById("combined-tooltip");if(m||(m=document.createElement("div"),m.id="combined-tooltip",m.style.position="absolute",m.style.background="rgba(14, 14, 16, 0.9)",m.style.color="#fff",m.style.padding="8px 12px",m.style.borderRadius="4px",m.classList.add("font-m"),m.style.fontFamily="system-ui",m.style.pointerEvents="none",m.style.zIndex="1000",m.style.boxShadow="0 4px 6px rgba(0,0,0,0.3)",m.style.border="1px solid #2e2e34",document.body.appendChild(m)),h!=null&&this.currentSortedData[h]&&f.cursor.left>=0){let g=this.currentSortedData[h],y=g[2],b=g[3],E=g[5],_=g[6];m.innerHTML=` +
Point #${h}
+
+ Time: + ${wn(y)} +
+
+ Distance: + ${b.toFixed(2)} km +
+
+ ${t.label}: + ${t.fmtAxis(E)} ${t.unit} +
+
+ ${r.label}: + ${r.fmtAxis(_)} ${r.unit} +
+ `,m.style.display="block";let V=f.over.getBoundingClientRect();m.style.left=`${V.left+window.scrollX+f.cursor.left+15}px`,m.style.top=`${V.top+window.scrollY+f.cursor.top+15}px`}else m.style.display="none"}]}};this.destroyPlot(),this.plot=new d9(p,[a,c],e),this.plot.over.addEventListener("click",()=>{if(this.plot){let f=this.plot.cursor.idx;if(f!=null&&this.currentSortedData[f]){let h=this.currentSortedData[f][4];Oe.setCursorAt(h)}}}),this.resize()}resize(){let e=this.plotContainerRef?.nativeElement||this.elRef.nativeElement.querySelector("#combined-plot-container");if(this.plot&&e&&e.clientWidth>0){let t=e.clientWidth,r=e.clientHeight;if(t>0&&r>0)if(this.isPolar&&!this.isMultiTrack){let s=Math.min(t,r);this.plot.setSize({width:s,height:s})}else this.plot.setSize({width:t,height:r})}}onSliderInput(e){let t=parseInt(e.target.value,10);this.currentSliderIdx=t,this.sliderValue=t,this.updateSliderLabel(),this.cdr.detectChanges(),this.plot&&this.plot.redraw()}onTogglePlay(){this.playIntervalId?(this.stopPlaying(),this.cdr.detectChanges()):(this.currentSliderIdx!==null&&this.currentSliderIdx>=this.currentChronoData.length-1&&(this.currentSliderIdx=0,this.sliderValue=0,this.updateSliderLabel(),this.plot&&this.plot.redraw()),this.startPlaying(),this.cdr.detectChanges())}startPlaying(){this.isPlaying=!0,this.playIntervalId=window.setInterval(()=>{this.currentSliderIdx!==null&&this.currentSliderIdxd.remove());let s=document.createElement("div");s.className="metric-menu-popup";let i=Oe.METRICS,o=this.currentTrack;if(!o)return;let a=[];for(let d in i){let p=i[d];o.points.some(f=>f[p.field]!=null)&&a.push(d)}a.forEach(d=>{let p=i[d],f=document.createElement("div"),h=e==="x"?this.xMetric:this.yMetric;f.className=`menu-item ${h===d?"active":""}`,f.innerHTML=` + ${p.icon} + ${p.label} + ${h===d?"check":""} + `,f.addEventListener("click",()=>{e==="x"?this.xMetric=d:this.yMetric=d,s.remove(),this.currentTracks.length>=2?this.render(this.currentTracks,this.allTracks):this.render(this.currentTrack,this.allTracks)}),s.appendChild(f)});let c=r.getBoundingClientRect();s.style.top=`${c.bottom+5}px`,s.style.left=`${c.left}px`,document.body.appendChild(s);let u=d=>{!s.contains(d.target)&&!r.contains(d.target)&&(s.remove(),document.removeEventListener("click",u))};setTimeout(()=>document.addEventListener("click",u),0)}};Xn([Ua("plotContainer")],wc.prototype,"plotContainerRef",2),wc=Xn([ms({selector:"app-combined-tab",standalone:!0,imports:[tr,Yr],template:` +
+
+ no_sim +
Select a track for combined analysis
+
+ + + +
+
+ Aggregate Track Comparison & Section Analysis ({{ currentTracksCount }} Tracks) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Metric + {{ aggSummary.t1Name }} (T1) + + {{ aggSummary.t2Name }} (T2) + Delta (T2 - T1)Aggregate Summary
Distance{{ aggSummary.s1DistKm }} km{{ aggSummary.s2DistKm }} km + {{ aggSummary.distDiff }} km + + {{ aggSummary.totalDist }} km (Total) +
Elevation Gain{{ aggSummary.s1Elev }} m{{ aggSummary.s2Elev }} m + {{ aggSummary.eleDiff }} m + + {{ aggSummary.totalElev }} m (Total) +
Duration{{ aggSummary.s1DurStr }}{{ aggSummary.s2DurStr }}-- + {{ aggSummary.totalDurStr }} (Total) +
Avg / Max Power + {{ aggSummary.s1AvgPwr }} W / {{ aggSummary.s1MaxPwr }} W + + {{ aggSummary.s2AvgPwr }} W / {{ aggSummary.s2MaxPwr }} W + + {{ aggSummary.pwrDiff }} W (Avg) + + {{ aggSummary.avgPwr }} W (Avg) / {{ aggSummary.maxPwr }} W (Max) +
Avg / Max HR + {{ aggSummary.s1AvgHr }} bpm / {{ aggSummary.s1MaxHr }} bpm + + {{ aggSummary.s2AvgHr }} bpm / {{ aggSummary.s2MaxHr }} bpm + + {{ aggSummary.hrDiff }} bpm (Avg) + + {{ aggSummary.avgHr }} bpm (Avg) / {{ aggSummary.maxHr }} bpm (Max) +
Avg / Max Temp{{ aggSummary.s1TempStr }}{{ aggSummary.s2TempStr }} + {{ aggSummary.tempDiff }} \xB0C (Avg) + + {{ aggSummary.avgTemp }} \xB0C (Avg) / {{ aggSummary.maxTemp }} \xB0C (Max) +
Gear Shifts{{ aggSummary.s1Shifts }}{{ aggSummary.s2Shifts }} + {{ aggSummary.shiftsDiffStr }} + + {{ aggSummary.totalShifts }} (Total) +
{{ sr.sectionLabel }} Split + {{ sr.t1Power }}W \xB7 {{ sr.t1Hr }}bpm \xB7 {{ sr.t1SpeedStr }}km/h + + {{ sr.t2Power }}W \xB7 {{ sr.t2Hr }}bpm \xB7 {{ sr.t2SpeedStr }}km/h + {{ sr.pwrDeltaStr }}Cohort Avg: {{ sr.cohortAvgPower }}W
+
+ + {{ c.pairLabel }}: r={{ c.rValStr }}, \u03B2={{ c.slopeStr }} ({{ + c.samples + }}) + +
+
+ + +
+
+ arrow_forward + X Axis: + +
+
+ arrow_upward + Y Axis: + +
+
+ schedule + Time: + + {{ sliderTimeLabel }} + +
+
+ + +
+
+ +
+
+ No data for selected metrics +
+
+
+
+ `})],wc);import Ym from"uplot";function rl(n,e){let t=0;for(let M=0;Mt&&(t=j)}t||(t=Date.UTC(2026,7,1));let r=new Date(t),s=r.getUTCFullYear(),i=Date.UTC(s-1,r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds()),o=Date.UTC(s,r.getUTCMonth()-6,r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds()),a=Date.UTC(s,r.getUTCMonth()-1,r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds()),c=0,u=0,d=0,p=0,f=0,h=t;n.forEach(M=>{if(!M.stats.startTime)return;let j=e(M);if(j===void 0)return;f+=j;let G=M.stats.startTime;G=i&&(u+=j),G>=o&&(d+=j),G>=a&&(p+=j)});let m=7*24*60*60*1e3,g=Date.UTC(s,0,1),y=Math.max(.1,(t-g)/m),b=Math.max(.1,(t-i)/m),E=Math.max(.1,(t-o)/m),_=Math.max(.1,(t-a)/m),V=Math.max(.1,(t-h)/m);return{currentYear:c,pastYear:u,past6m:d,past1m:p,total:f,currentYearAvg:c/y,pastYearAvg:u/b,past6mAvg:d/E,past1mAvg:p/_,totalAvg:f/V}}function MN(n,e,t){let r=e?1e3:1,s=i=>(e?i/r:i).toLocaleString("en-US",{minimumFractionDigits:e?1:0,maximumFractionDigits:e?1:0});return[{period:"Current Year",valueFormatted:s(n.currentYear),weeklyAvgFormatted:s(n.currentYearAvg),unit:t},{period:"Past Year",valueFormatted:s(n.pastYear),weeklyAvgFormatted:s(n.pastYearAvg),unit:t},{period:"Past 6 Months",valueFormatted:s(n.past6m),weeklyAvgFormatted:s(n.past6mAvg),unit:t},{period:"Past 1 Month",valueFormatted:s(n.past1m),weeklyAvgFormatted:s(n.past1mAvg),unit:t},{period:"Total",valueFormatted:s(n.total),weeklyAvgFormatted:s(n.totalAvg),unit:t}]}function Nfe(n){let e=rl(n,a=>a.stats.totalDist),t=rl(n,a=>a.stats.elevGain),r=rl(n,a=>a.stats.duration?a.stats.duration/36e5:0),s=rl(n,a=>{let c=(a.stats.duration||0)/1e3,u=a.stats.avgPower||150,d=200,p=u/d;return c*u*p/(d*3600)*100}),i=rl(n,a=>{let c=(a.stats.duration||0)/1e3,u=a.stats.avgPower||0;return c*u/1e3}),o=rl(n,a=>(a.stats.sections||[]).filter(u=>u.kind==="climb").length);return{distance:e,elevation:t,durationHours:r,tss:s,workKj:i,climbCount:o}}function p9(n){let e=Nfe(n),t=(s,i=1)=>s.toLocaleString("en-US",{minimumFractionDigits:i,maximumFractionDigits:i});return[{label:"Distance",unit:"km",data:e.distance,scale:.001,digits:1},{label:"Elevation Gain",unit:"m",data:e.elevation,scale:1,digits:0},{label:"Moving Duration",unit:"h",data:e.durationHours,scale:1,digits:1},{label:"Training Stress (TSS)",unit:"TSS",data:e.tss,scale:1,digits:0},{label:"Mechanical Work",unit:"kJ",data:e.workKj,scale:1,digits:0},{label:"Categorized Climbs",unit:"climbs",data:e.climbCount,scale:1,digits:0}].map(s=>({label:s.label,unit:s.unit,past1m:t(s.data.past1m*s.scale,s.digits),past6m:t(s.data.past6m*s.scale,s.digits),pastYear:t(s.data.pastYear*s.scale,s.digits),currentYear:t(s.data.currentYear*s.scale,s.digits),total:t(s.data.total*s.scale,s.digits),weeklyAvg:t(s.data.totalAvg*s.scale,s.digits)}))}var Xm=[],Pb=[],jC="week",y9=null;function b9(n){y9=n}function Rb(){return y9||window.__trackStateService?.evolutionTab||null}function Fb(){Xm.forEach(n=>n.destroy()),Xm=[],Pb=[]}function w9(){Fb(),jC="week";let n=Rb();if(n&&typeof n.reset=="function"){n.reset();return}let e=document.getElementById("evolution-view");e&&(e.innerHTML=` +
+ no_sim +
Select a track for progress analysis
+
+ `)}function RN(n){jC=n,Pb.forEach(e=>{e&&e.updateGrouping&&e.updateGrouping(n)})}function FN(n){let e=Rb();if(e&&typeof e.setGrouping=="function"){e.setGrouping(n);return}RN(n)}function LN(n){St.patch({progress:n==="all"?null:n}),Pb.forEach(e=>{e&&e.updateRange&&e.updateRange(n)})}function E9(n){let e=Rb();if(e&&typeof e.setRange=="function"){e.setRange(n);return}LN(n)}function ON(n){Pb.forEach(e=>{e&&e.updatePin&&e.updatePin(n)})}function x9(n){let e=Rb();if(e&&typeof e.setPinnedDuration=="function"){e.setPinnedDuration(n);return}ON(n)}var Lb=16384,Nb=new Float64Array(Lb+1),tp=new Float64Array(Lb+1),NN=new Float64Array(Lb+1),f9=new Float64Array(Lb),PN=new Float64Array(365),h9=[1,2,3,5,8,10,15,20,30,45,60,90,120,180,240,300,360,450,600,750,900,1200];function m9(n,e,t,r){let s={};e.forEach(u=>{let d=t==="power"?u.stats.powerCurve:u.stats.hrCurve;if(!d)return;let p=u.name||"Unnamed Track",f=u.stats.startTime||u.addedAt?yo(u.stats.startTime||u.addedAt):"Unknown Date",h=`${p} (${f})`;Object.entries(d).forEach(([m,g])=>{let y=Number(m),b=g.power||g.hr;(!s[y]||b>s[y].val)&&(s[y]={val:b,trackInfo:h,trackId:u.id,idx:g.idx})})});let i=n&&(t==="power"?n.stats.powerCurve:n.stats.hrCurve)||{},o=new Set;Object.keys(s).forEach(u=>o.add(Number(u))),Object.keys(i).forEach(u=>o.add(Number(u)));let a=Array.from(o).sort((u,d)=>u-d);return{rows:a.map(u=>{let d=i[u]?i[u].power||i[u].hr:"-",p=s[u]?.val||"-";return{dur:u,durLabel:Tr(u),curValStr:`${d} ${r}`,maxValStr:`${p} ${r}`,mxId:s[u]?.trackId,mxIdx:s[u]?.idx}}),initialDur:a[0]||5}}function S9(n,e){e.forEach(G=>{_n.ensureCurvesAndZones(G)});let t=0,r=0;PN.fill(0);for(let G=0;Gxe)continue;let F=xe-I,J=0,ie=0;for(let ve=0;ve<=F;ve++){let oe=tp[ve+I]-tp[ve],ke=Nb[ve+I]-Nb[ve];ke>J&&(J=ke),oe>ie&&(ie=oe)}r+=(J+ie+NN[F])/I*.001}let pe=2/8,$=1-pe,ee=2/43,we=1-ee,We=52,P=1/(195-We),A=0,S=0;for(let C=0;C5?"Fresh / Peak":o>=-10?"Optimal Load":"High Fatigue",p=p9(e),f=rl(e,G=>G.stats.totalDist),h=rl(e,G=>G.stats.elevGain),m=MN(f,!0,"km"),g=MN(h,!1,"m"),y=e.some(G=>!!G.stats.powerCurve),b=e.some(G=>!!G.stats.hrCurve),E=y?m9(n,e,"power","W"):{rows:[],initialDur:5},_=b?m9(n,e,"hr","bpm"):{rows:[],initialDur:5},V=new Set;e.forEach(G=>{G.sport&&V.add(G.sport)});let j=[...e].sort((G,W)=>(W.stats.startTime||W.addedAt||0)-(G.stats.startTime||G.addedAt||0)||G.id.localeCompare(W.id)).map(G=>{let W=(G.stats.duration||0)/1e3,xe=G.stats.avgPower||150,pe=200,$=xe/pe,ee=W*xe*$/(pe*3600)*100;return{id:G.id,dateStr:G.stats.startTime?yo(G.stats.startTime):"-",name:G.displayName||G.name||G.id,sport:G.sport||"cycling",color:G.color||"#FF6B35",distKm:((G.stats.totalDist||0)/1e3).toFixed(1),elevGainM:Math.round(G.stats.elevGain||0).toString(),durationStr:Tr(Math.round(W)),avgPowerStr:G.stats.avgPower!=null?`${Math.round(G.stats.avgPower)} W`:"-",avgHrStr:G.stats.avgHR!=null?`${Math.round(G.stats.avgHR)} bpm`:"-",tssStr:Math.round(ee).toString()}});return{atlStr:c,ctlStr:u,tsbStr:a,tsbStatus:d,trackName:n&&n.name||"Current Track",hasPowerCurve:y,hasHrCurve:b,powerInitialDur:E.initialDur,hrInitialDur:_.initialDur,accumulatedSummaryRows:p,distanceAccumulatedRows:m,elevationAccumulatedRows:g,powerCurveRows:E.rows,hrCurveRows:_.rows,historyRows:j,availableSports:Array.from(V).sort()}}function C9(n,e,t,r,s,i,o,a,c){jC=s;let u=n.querySelector("#evolution-container")||document.getElementById("evolution-container");if(!u)return;let d=u.clientWidth||570,p=[];Pb=p;let f=Ym.sync("progress-sync"),h=u.querySelector("#distance-evolution-card")||document.getElementById("distance-evolution-card"),m=u.querySelector("#elevation-evolution-card")||document.getElementById("elevation-evolution-card");if(h&&p.push(v9(h,t,"distance",f,c,d)),m&&p.push(v9(m,t,"elevation",f,c,d)),t.some(g=>g.stats.powerCurve)){let g=u.querySelector("#power-evolution-card")||document.getElementById("power-evolution-card");g&&p.push(g9({cardContainer:g,currentTrack:e,allTracks:t,metricKey:"power",unit:"W",color:et.power.color,onPinChange:i,onRangeChange:o,onTrackSelect:a,gridWidth:d}))}if(t.some(g=>g.stats.hrCurve)){let g=u.querySelector("#hr-evolution-card")||document.getElementById("hr-evolution-card");g&&p.push(g9({cardContainer:g,currentTrack:e,allTracks:t,metricKey:"hr",unit:"bpm",color:et.hr.color,onPinChange:i,onRangeChange:o,onTrackSelect:a,gridWidth:d}))}r!=="all"&&p.forEach(g=>{g&&g.updateRange&&g.updateRange(r)}),Xm.forEach(g=>{g._ready=!0})}function UC(n,e,t,r){let s=Rb();if(s&&typeof s.render=="function"){s.render(n,e,t,r);return}}function g9(n){let{cardContainer:e,currentTrack:t,allTracks:r,metricKey:s,unit:i,color:o,onPinChange:a,onTrackSelect:c,gridWidth:u}=n,d=null,f=St.get().progress||"all",h=e.querySelector(`#${s}-evolution-chart`);if(!h)return;h.innerHTML="";let m={};r.forEach(S=>{let x=s==="power"?S.stats.powerCurve:S.stats.hrCurve;if(!x)return;let C=S.name||"Unnamed Track",I=S.stats.startTime||S.addedAt?yo(S.stats.startTime||S.addedAt):"Unknown Date",F=`${C} (${I})`;Object.entries(x).forEach(([J,ie])=>{let ve=Number(J),oe=ie.power||ie.hr;(!m[ve]||oe>m[ve].val)&&(m[ve]={val:oe,trackInfo:F,trackId:S.id,idx:ie.idx})})});let g=t&&(s==="power"?t.stats.powerCurve:t.stats.hrCurve)||{},y=new Set;Object.keys(m).forEach(S=>y.add(Number(S))),Object.keys(g).forEach(S=>y.add(Number(S)));let b=Array.from(y).sort((S,x)=>S-x),E=b,_=b.map(S=>{let x=g[S];return x?x.power||x.hr:null}),V=b.map(S=>m[S]?.val||null),M=r.filter(S=>(S.stats.startTime||S.addedAt)!=null);M.sort((S,x)=>(S.stats.startTime||S.addedAt||0)-(x.stats.startTime||x.addedAt||0)||S.id.localeCompare(x.id));let j=[],G={};b.forEach(S=>G[S]=[]),M.forEach(S=>{let x=s==="power"?S.stats.powerCurve:S.stats.hrCurve;x&&(j.push((S.stats.startTime||S.addedAt)/1e3),b.forEach(C=>{let I=x[C],F=I?s==="power"?I.power:I.hr:null;G[C].push(F)}))});let W=b[0]||5,xe=M,pe=null;function $(S,x){let C=j[j.length-1]||1785542400,I=0;x==="1m"?I=C-30*24*3600:x==="2m"?I=C-60*24*3600:x==="6m"?I=C-180*24*3600:x==="1y"?I=C-365*24*3600:x==="2y"&&(I=C-2*365*24*3600);let F=[];j.forEach((ke,se)=>{ke>=I&&F.push(se)});let J=F.map(ke=>j[ke]),ie=G[S]||[],ve=F.map(ke=>ie[ke]),oe=zm(ve,5);return xe=F.map(ke=>M[ke]),{xFiltered:J,rawYFiltered:ve,smoothedYFiltered:oe}}let ee=null,we=document.createElement("div");we.className="cur-y-val font-m",we.style.cssText="position:absolute;background:rgba(14, 14, 16, 0.9);color:#fff;padding:8px 12px;border-radius:4px;font-family:system-ui;pointer-events:none;z-index:1000;box-shadow:0 4px 6px rgba(0,0,0,0.3);border:1px solid #2e2e34;display:none;",h.style.position="relative",h.appendChild(we);let We={id:`${s}-evolution`,width:400,height:250,padding:[0,10,0,10],scales:{x:{time:!1,distr:3,auto:!0},y:{auto:!0}},series:[{},{label:"Current Track",stroke:o,width:2,fill:Gt(o,.1),points:{show:!0,size:5,fill:o}},{label:"All-Time Max",stroke:"#888888",width:1,fill:"transparent",points:{show:!0,size:6,fill:"#888888"}}],axes:[{stroke:"#555564",grid:{stroke:"#2e2e34",width:1},show:!0,values:()=>[],ticks:{show:!1},font:"10px system-ui, sans-serif",size:30},{stroke:"#555564",grid:{stroke:"#2e2e34",width:1},values:(S,x)=>x.map(C=>`${C}${i}`),font:"10px system-ui, sans-serif",size:50}],cursor:{drag:{x:!1,y:!1},dataIdx:(S,x,C)=>C,x:!1,y:!1},hooks:{draw:[S=>{let x=S.ctx,C=window.devicePixelRatio||1,I=S.bbox,F=[1,2,5,10,20,30,60,120,300,600,1200,1800,3600,7200,10800],J=E[E.length-1];x.save(),x.fillStyle="#555564",x.textAlign="center",x.textBaseline="top",x.font=`${10*C}px system-ui, sans-serif`;let ie=-100;if(F.forEach(ve=>{if(ve>J)return;let oe=S.valToPos(ve,"x",!0);oe>ie+30*C&&oe=0){let oe=S.valToPos(pe,"x",!0),ke=S.valToPos(_[ve]||V[ve],"y",!0);x.save(),x.beginPath(),x.setLineDash([]);let se=_[ve],B=se!==null?5*C:3*C,z=se!==null?o:"#888888";x.arc(oe,ke,B,0,2*Math.PI),x.fillStyle=z,x.fill(),x.strokeStyle="#fff",x.lineWidth=2*C,x.stroke(),x.restore()}}x.restore()},S=>{let x=S.ctx,C=window.devicePixelRatio||1,I=S.bbox,F=S.cursor.idx,J=1,ie=S.cursor.left,ve=S.cursor.top;if(ie!=null&&ve!=null&&ie>=0&&ve>=0){let oe=1/0,ke=-1,se=30,B=se*se;for(let z=0;z{if(!S._ready)return;S.redraw(!1);let x=S.cursor.idx,C=S.cursor.left,I=S.cursor.top;if(C!=null&&I!=null&&C>=0&&I>=0){let ie=1/0,ve=-1,oe=30,ke=oe*oe;for(let se=0;se${Tr(ie)}`;if(ve!==null&&(ke+=` +
+ Current: + ${ve} ${i} +
+ `),oe!==null&&(ke+=` +
+ Max: + ${oe} ${i} +
+ `),we.innerHTML=ke,ee&&pe===null){W=ie;let{xFiltered:se,rawYFiltered:B,smoothedYFiltered:z}=$(W,f),L=z.map(ae=>ae!==null?ae*.9:null),U=z.map(ae=>ae!==null?ae*1.1:null);ee.setData([se,B,z,L,U]);let H=e.querySelector(`#${s}-timeline-label`);H&&(H.textContent=`Progress ${Tr(ie)} ${s==="power"?"Power":"HR"}`)}we.style.display="",we.style.left=`${C+F.left}px`,we.style.top=`${I+F.top}px`,we.style.transform="translate(5px, -50%)"}else we.style.display="none"}]}};d=new Ym(We,[E,_,V],h),Xm.push(d),h.addEventListener("click",()=>{if(!d)return;let S=d.cursor.idx;if(S!=null){let x=E[S],C=null;if(pe!==null?C=null:C=x,a(C),t){let I=t.stats,F=s==="power"?I.powerCurve:I.hrCurve;if(F){let J=F[x];if(J){let ie=J.idx,ve=x,oe=t.points[ie],ke=t.points[ie+ve-1];if(oe&&ke&&oe.time!=null&&ke.time!=null){let se=t.points[0].time||0,B=(oe.time-se)/1e3,z=(ke.time-se)/1e3;c?.(t.id,[B,z])}}}}}}),h.addEventListener("mouseleave",()=>{d&&d.redraw()});let P=null,A=e.querySelector(`#${s}-timeline-chart`);if(A){A.innerHTML="",A.style.position="relative";let S=document.createElement("div");if(S.className="timeline-tooltip font-m",S.style.cssText="position:absolute;background:rgba(14, 14, 16, 0.9);color:#fff;padding:8px 12px;border-radius:4px;font-family:system-ui;pointer-events:none;z-index:1000;box-shadow:0 4px 6px rgba(0,0,0,0.3);border:1px solid #2e2e34;display:none;",A.appendChild(S),j.length>0){let{xFiltered:x,rawYFiltered:C,smoothedYFiltered:I}=$(W,f),F=I.map(se=>se!==null?se*.9:null),J=I.map(se=>se!==null?se*1.1:null),ie=[x,C,I,F,J],ve=[{value:(se,B)=>B!=null?yo(B*1e3):"-"},{label:"Value",stroke:o,width:0,points:{show:!0,size:6,fill:Gt(o,.5)}},{label:"Trend",stroke:o,width:2,points:{show:!1},spanGaps:!0,fill:"transparent",dash:[5,5]},{label:"Lower Bound",stroke:"transparent",width:0,points:{show:!1},spanGaps:!0},{label:"Upper Bound",stroke:"transparent",width:0,points:{show:!1},spanGaps:!0}],oe=e.querySelector(`#${s}-timeline-label`);oe&&(oe.textContent=`Progress ${Tr(W)} ${s==="power"?"Power":"HR"}`);let ke={width:Math.max(100,(u||570)-400),height:250,padding:[0,10,0,10],tzDate:se=>Ym.tzDate(new Date(se*1e3),"Etc/UTC"),cursor:{points:{show:!1},drag:{setScale:!1},x:!1,y:!1},scales:{x:{time:!0,range:se=>{let B=se.data[0][0],z=se.data[0][se.data[0].length-1];return B===void 0||z===void 0?[0,100]:B===z?[B-3600,z+3600]:[B,z]}},y:{range:(se,B,z)=>[B*.9,z*1.1]}},series:ve,bands:[{series:[4,3],fill:Gt(o,.2)}],hooks:{init:[se=>{se.over.addEventListener("click",()=>{if(P!=null){let B=xe[P];if(B){let z=B.stats,L=s==="power"?z.powerCurve:z.hrCurve;if(L){let U=L[W];if(U){let H=U.idx,ae=W,K=B.points[H],Ee=B.points[H+ae-1];if(K&&Ee&&K.time!=null&&Ee.time!=null){let ue=B.points[0].time||0,Ce=(K.time-ue)/1e3,Me=(Ee.time-ue)/1e3;n.onTrackSelect?.(B.id,[Ce,Me])}else n.onTrackSelect?.(B.id,null)}else n.onTrackSelect?.(B.id,null)}else n.onTrackSelect?.(B.id,null)}}})}],draw:[se=>{let B=se.cursor.idx;if(B!=null&&se.data[0][B]!=null){let z=se.data[1][B];if(z!=null){let L=se.valToPos(se.data[0][B],"x",!0),U=se.valToPos(z,"y",!0),H=se.ctx,ae=window.devicePixelRatio||1;H.save(),H.beginPath(),H.setLineDash([2*ae,2*ae]),H.strokeStyle=Gt(o,.4),H.lineWidth=1*ae,H.moveTo(L,se.bbox.top),H.lineTo(L,se.bbox.top+se.bbox.height),H.moveTo(se.bbox.left,U),H.lineTo(se.bbox.left+se.bbox.width,U),H.stroke(),H.restore(),H.save(),H.beginPath(),H.setLineDash([]),H.arc(L,U,12*ae,0,2*Math.PI),H.fillStyle=Gt(o,.2),H.fill(),H.restore(),H.save(),H.beginPath(),H.arc(L,U,6*ae,0,2*Math.PI),H.fillStyle=o,H.fill(),H.strokeStyle="#fff",H.lineWidth=2*ae,H.stroke(),H.restore(),H.save(),H.setLineDash([]);let K=new Date(se.data[0][B]*1e3),Ee=`${K.getUTCFullYear()}-${String(K.getUTCMonth()+1).padStart(2,"0")}-${String(K.getUTCDate()).padStart(2,"0")}`;H.font=`bold ${10*ae}px system-ui, sans-serif`;let Ce=H.measureText(Ee).width+10*ae,Me=16*ae,Je=L-Ce/2,It=Math.max(se.bbox.left,Math.min(se.bbox.left+se.bbox.width-Ce,Je)),Pt=se.bbox.top+se.bbox.height+2*ae;H.fillStyle="rgba(14, 14, 16, 0.92)",H.beginPath(),H.roundRect?H.roundRect(It,Pt,Ce,Me,3*ae):H.rect(It,Pt,Ce,Me),H.fill(),H.strokeStyle=Gt(o,.27),H.lineWidth=1*ae,H.stroke(),H.fillStyle=o,H.textAlign="center",H.textBaseline="middle",H.fillText(Ee,It+Ce/2,Pt+Me/2);let de=`${z.toFixed(0)} ${i}`,Zt=H.measureText(de).width+10*ae,Ct=se.bbox.left-Zt-2*ae,Jt=U-Me/2;H.fillStyle="rgba(14, 14, 16, 0.92)",H.beginPath(),H.roundRect?H.roundRect(Ct,Jt,Zt,Me,3*ae):H.rect(Ct,Jt,Zt,Me),H.fill(),H.strokeStyle=Gt(o,.27),H.lineWidth=1*ae,H.stroke(),H.fillStyle=o,H.textAlign="left",H.textBaseline="middle",H.fillText(de,Ct+5*ae,Jt+Me/2),H.restore()}}}],setCursor:[se=>{if(!se._ready)return;se.redraw(!1);let B=se.cursor.idx,z=se.cursor.left,L=se.cursor.top,U=se.bbox;if(z!=null&&L!=null&&z>=0&&L>=0){let H=1/0,ae=-1,K=30,Ee=K*K,ue=se.data[0],Ce=se.data[1];for(let Me=0;Me + Date: + ${ae} + +
+ Value: + ${Ee} +
+ `,S.style.display="block",S.style.left=`${z+U.left}px`,S.style.top=`${L+U.top}px`,S.style.transform="translate(5px, -50%)"}else S.style.display="none"}]},axes:[{space:50,stroke:"#555564",grid:{stroke:"#2e2e34"},show:!0,font:"10px system-ui, sans-serif",size:30,values:(se,B)=>B.map(z=>{let L=new Date(z*1e3);return`${L.getUTCFullYear()}-${String(L.getUTCMonth()+1).padStart(2,"0")}`})},{stroke:"#555564",grid:{stroke:"#2e2e34"},font:"10px system-ui, sans-serif",values:(se,B)=>B.map(z=>`${z} ${i}`),show:!0,space:15,size:50}]};ee=new Ym(ke,ie,A),Xm.push(ee),A.addEventListener("mouseleave",()=>{ee.redraw()})}else A.innerHTML='
No data for the past year
'}return{updatePin:S=>{pe=S,S!==null&&(W=S);let x=e.querySelector(`#${s}-timeline-label`);if(x&&(x.textContent=`Progress ${Tr(W)} ${s==="power"?"Power":"HR"}${pe!==null?" (Pinned)":""}`),ee){let{xFiltered:C,rawYFiltered:I,smoothedYFiltered:F}=$(W,f),J=F.map(ve=>ve!==null?ve*.9:null),ie=F.map(ve=>ve!==null?ve*1.1:null);ee.setData([C,I,F,J,ie])}d&&d.redraw()},updateRange:S=>{if(f=S,ee){let{xFiltered:x,rawYFiltered:C,smoothedYFiltered:I}=$(W,f),F=I.map(ie=>ie!==null?ie*.9:null),J=I.map(ie=>ie!==null?ie*1.1:null);ee.setData([x,C,I,F,J])}}}}function T9(n){let e=new Date(n),t=e.getUTCDay(),r=e.getUTCDate()-t+(t===0?-6:1);return e.setUTCDate(r),e.setUTCHours(0,0,0,0),e}function Pfe(n){let e={};return n.forEach(t=>{if(!t.stats.startTime||!t.stats.totalDist)return;let r=new Date(t.stats.startTime),s=T9(r),i=s.toISOString().split("T")[0];e[i]||(e[i]={timestamp:s.getTime(),distance:0}),e[i].distance+=t.stats.totalDist}),Object.entries(e).map(([t,r])=>({week:t,timestamp:r.timestamp,distance:r.distance})).sort((t,r)=>t.timestamp-r.timestamp)}function Rfe(n){let e={};return n.forEach(t=>{if(!t.stats.startTime||t.stats.elevGain===void 0)return;let r=new Date(t.stats.startTime),s=T9(r),i=s.toISOString().split("T")[0];e[i]||(e[i]={timestamp:s.getTime(),elevation:0}),e[i].elevation+=t.stats.elevGain}),Object.entries(e).map(([t,r])=>({week:t,timestamp:r.timestamp,elevation:r.elevation})).sort((t,r)=>t.timestamp-r.timestamp)}function Ffe(n){let e={};return n.forEach(t=>{if(!t.stats.startTime||!t.stats.totalDist)return;let r=new Date(t.stats.startTime),s=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),1)),i=s.toISOString().slice(0,7);e[i]||(e[i]={timestamp:s.getTime(),distance:0}),e[i].distance+=t.stats.totalDist}),Object.entries(e).map(([t,r])=>({week:t,timestamp:r.timestamp,distance:r.distance})).sort((t,r)=>t.timestamp-r.timestamp)}function Lfe(n){let e={};return n.forEach(t=>{if(!t.stats.startTime||t.stats.elevGain===void 0)return;let r=new Date(t.stats.startTime),s=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),1)),i=s.toISOString().slice(0,7);e[i]||(e[i]={timestamp:s.getTime(),elevation:0}),e[i].elevation+=t.stats.elevGain}),Object.entries(e).map(([t,r])=>({week:t,timestamp:r.timestamp,elevation:r.elevation})).sort((t,r)=>t.timestamp-r.timestamp)}function v9(n,e,t,r,s,i){let o=t==="distance",a=jC,c=St.get().progress||"all",u=o?Pfe(e):Rfe(e),d=o?Ffe(e):Lfe(e),p=a==="month"?d:u,f=o?et.distance.color:et.elevation.color,h=o?"km":"m",m=n.querySelector(`#${t}-weekly-chart`),g=n.querySelector(`#${t}-y-axis-chart`);if(!m||!g)return;m.innerHTML="",m.style.position="relative";let y=document.createElement("div");y.className="cur-y-val",y.style.cssText=`color:${f};display:none`,m.appendChild(y);let b=p.map($=>$.timestamp/1e3),E=o?p.map($=>$.distance/1e3):p.map($=>$.elevation);if(b.length===0)return;let _=zm(E,2),V=Math.max(0,(i||570)-20-320-20),M=Math.max(V,b.length*40),j=Math.max(...E)*1.1,G={width:M,height:150,padding:[10,10,0,10],tzDate:$=>Ym.tzDate(new Date($*1e3),"Etc/UTC"),scales:{x:{time:!0},y:{range:[0,j]}},series:[{},{label:o?"Distance":"Elevation",stroke:f,fill:Gt(f,.1),width:2,points:{show:!0,size:4}},{label:"Trend",stroke:f,width:2,dash:[5,5],points:{show:!1}}],cursor:{sync:r?{key:r.key}:void 0,drag:{x:!1,y:!1},points:{show:!1},x:!1,y:!1},hooks:{init:[$=>{$.over.addEventListener("click",()=>{let ee=$.cursor.idx;if(ee!=null){let we=p[ee];if(we){let We=new Date(we.timestamp),P=new Date(we.timestamp+7*24*60*60*1e3),A=We.toISOString().split("T")[0],S=P.toISOString().split("T")[0];s?.(A,S)}}})}],setCursor:[$=>{if(!$._ready)return;let ee=$.cursor.idx,we=$.cursor.left,We=$.cursor.top;if(ee!=null&&we!=null&&We!=null&&we>=0&&We>=0){let P=$.data[1][ee],A=P!=null?o?`${P.toFixed(1)} km`:`${P.toFixed(0)} m`:"\u2014";y.innerHTML=A,y.style.display="block",y.style.left=`${$.valToPos($.data[0][ee],"x",!1)}px`,y.style.top=`${$.valToPos($.data[1][ee],"y",!1)}px`,y.style.transform="translate(6px, -50%)"}else y.style.display="none";$.redraw(!1)}],draw:[$=>{let ee=$.cursor.idx;if(ee!=null&&$.data[0][ee]!=null){let we=$.valToPos($.data[0][ee],"x",!0),We=$.valToPos($.data[1][ee],"y",!0),P=window.devicePixelRatio||1,A=$.ctx,S=$.bbox;A.save(),A.beginPath(),A.setLineDash([2*P,2*P]),A.strokeStyle=Gt(f,.4),A.lineWidth=1*P,A.moveTo(we,S.top),A.lineTo(we,S.top+S.height),A.moveTo(S.left,We),A.lineTo(S.left+S.width,We),A.stroke(),A.restore(),A.save(),A.beginPath(),A.setLineDash([]),A.arc(we,We,12*P,0,2*Math.PI),A.fillStyle=Gt(f,.2),A.fill(),A.restore(),A.save(),A.beginPath(),A.arc(we,We,6*P,0,2*Math.PI),A.fillStyle=f,A.fill(),A.strokeStyle="#fff",A.lineWidth=2*P,A.stroke(),A.restore(),A.save(),A.setLineDash([]);let x=new Date($.data[0][ee]*1e3),C=`${x.getUTCFullYear()}-${String(x.getUTCMonth()+1).padStart(2,"0")}-${String(x.getUTCDate()).padStart(2,"0")}`;A.font=`bold ${10*P}px system-ui, sans-serif`;let F=A.measureText(C).width+10*P,J=16*P,ie=we-F/2,ve=Math.max(S.left,Math.min(S.left+S.width-F,ie)),oe=S.top+S.height+2*P;A.fillStyle="rgba(14, 14, 16, 0.92)",A.beginPath(),A.roundRect?A.roundRect(ve,oe,F,J,3*P):A.rect(ve,oe,F,J),A.fill(),A.strokeStyle=Gt(f,.27),A.lineWidth=1*P,A.stroke(),A.fillStyle=f,A.textAlign="center",A.textBaseline="middle",A.fillText(C,ve+F/2,oe+J/2),A.restore()}}]},axes:[{stroke:"#555564",grid:{stroke:"#2e2e34",width:1},show:!0,space:40,values:($,ee)=>ee.map(we=>{let We=new Date(we*1e3);return`${We.getUTCMonth()+1}/${We.getUTCDate()}`}),font:"10px system-ui, sans-serif",size:30},{stroke:"#555564",grid:{stroke:"#2e2e34",width:1},show:!0,values:($,ee)=>ee.map(we=>`${we.toFixed(0)} ${h}`),font:"10px system-ui, sans-serif",size:40}]},W=new Ym(G,[b,E,_],m);Xm.push(W);let xe=n.querySelector(".chart-scroll-container");xe&&b.length*40>M&&(xe.scrollLeft=xe.scrollWidth-xe.clientWidth);function pe(){p=a==="month"?d:u;let $=p[p.length-1]?.timestamp||17855424e5,ee=0;c==="1m"?ee=$-30*24*3600*1e3:c==="2m"?ee=$-60*24*3600*1e3:c==="6m"?ee=$-180*24*3600*1e3:c==="1y"?ee=$-365*24*3600*1e3:c==="2y"&&(ee=$-2*365*24*3600*1e3);let we=p.filter(C=>C.timestamp>=ee),We=we.map(C=>C.timestamp/1e3),P=o?we.map(C=>C.distance/1e3):we.map(C=>C.elevation),A=zm(P,2),S=Math.max(m.clientWidth,We.length*40),x=Math.max(1,...P)*1.1;W.setSize({width:S,height:150}),W.setScale("y",{min:0,max:x}),W.setData([We,P,A]),xe&&(xe.scrollLeft=xe.scrollWidth-xe.clientWidth)}return{updateRange:$=>{c=$,pe()},updateGrouping:$=>{a=$,pe()}}}var Qm=class{constructor(){this.state=ye(Rr);this.cdr=ye(bn);this.elRef=ye(en);this.isEmpty=!0;this.currentGrouping="week";this.currentRange="all";this.pinnedDuration=null;this.selectedSportFilter="all";this.availableSports=[];this.atlStr="0.0";this.ctlStr="0.0";this.tsbStr="0.0";this.tsbStatus="Optimal Load";this.trackName="Current Track";this.hasPowerCurve=!1;this.hasHrCurve=!1;this.powerInitialDur=5;this.hrInitialDur=5;this.powerTimelineLabel="Progress 5s Power";this.hrTimelineLabel="Progress 5s HR";this.accumulatedSummaryRows=[];this.distanceAccumulatedRows=[];this.elevationAccumulatedRows=[];this.powerCurveRows=[];this.hrCurveRows=[];this.historyRows=[];this.distanceColor=et.distance.color;this.distanceIcon=et.distance.icon;this.elevationColor=et.elevation.color;this.elevationIcon=et.elevation.icon;this.powerColor=et.power.color;this.hrColor=et.hr.color;this.metricPills=[{target:"distance",label:"Distance",color:et.distance.color,icon:et.distance.icon},{target:"elevation",label:"Elevation",color:et.elevation.color,icon:et.elevation.icon},{target:"power",label:"Power",color:et.power.color,icon:et.power.icon},{target:"hr",label:"Heart Rate",color:et.hr.color,icon:et.hr.icon}];this.rangeOptions=[{key:"1m",label:"1M"},{key:"2m",label:"2M"},{key:"6m",label:"6M"},{key:"1y",label:"1Y"},{key:"2y",label:"2Y"},{key:"all",label:"\u221E"}];this.pinDurationOptions=[{sec:5,label:"5s"},{sec:30,label:"30s"},{sec:60,label:"1m"},{sec:300,label:"5m"},{sec:1200,label:"20m"},{sec:null,label:"Free"}];this.lastCurrentTrack=null;this.lastAllTracks=[];this.state.evolutionTab=this,b9(this)}ngOnInit(){let e=this.elRef.nativeElement;document.getElementById("evolution-view")||(e.id="evolution-view")}ngOnDestroy(){Fb(),this.state.evolutionTab===this&&(this.state.evolutionTab=null)}trackByLabel(e,t){return t.label}trackByPeriod(e,t){return t.period}trackByDur(e,t){return t.dur}trackByHistoryId(e,t){return t.id}reset(){Fb(),this.isEmpty=!0,this.currentGrouping="week",this.currentRange="all",this.pinnedDuration=null,this.selectedSportFilter="all",this.accumulatedSummaryRows=[],this.distanceAccumulatedRows=[],this.elevationAccumulatedRows=[],this.powerCurveRows=[],this.hrCurveRows=[],this.historyRows=[],this.cdr.detectChanges()}render(e,t,r,s){Fb(),this.lastCurrentTrack=e,this.lastAllTracks=t,this.lastOnTrackSelect=r,this.lastOnDateRangeSelect=s,this.isEmpty=!1,this.currentRange=St.get().progress||"all",this.pinnedDuration=null;let i=this.selectedSportFilter==="all"?t:t.filter(u=>u.sport===this.selectedSportFilter),o=i.length>0?i:t,a=S9(e,o);this.atlStr=a.atlStr,this.ctlStr=a.ctlStr,this.tsbStr=a.tsbStr,this.tsbStatus=a.tsbStatus,this.trackName=a.trackName,this.hasPowerCurve=a.hasPowerCurve,this.hasHrCurve=a.hasHrCurve,this.powerInitialDur=a.powerInitialDur,this.hrInitialDur=a.hrInitialDur,this.powerTimelineLabel=`Progress ${Tr(this.powerInitialDur)} Power`,this.hrTimelineLabel=`Progress ${Tr(this.hrInitialDur)} HR`,this.accumulatedSummaryRows=a.accumulatedSummaryRows,this.distanceAccumulatedRows=a.distanceAccumulatedRows,this.elevationAccumulatedRows=a.elevationAccumulatedRows,this.powerCurveRows=a.powerCurveRows,this.hrCurveRows=a.hrCurveRows,this.historyRows=a.historyRows,this.availableSports=a.availableSports;let c=document.getElementById("evolution-view")||this.elRef.nativeElement;c&&(c.dataset.tsb=this.tsbStr),this.cdr.detectChanges(),C9(this.elRef.nativeElement,e,o,this.currentRange,this.currentGrouping,u=>this.setPinnedDuration(u),u=>this.setRange(u),r,s)}setGrouping(e){this.currentGrouping=e,this.cdr.detectChanges(),RN(e)}setRange(e){this.currentRange=e,this.cdr.detectChanges(),LN(e)}setPinnedDuration(e){this.pinnedDuration=e;let t=e!==null?e:this.powerInitialDur,r=e!==null?e:this.hrInitialDur;this.powerTimelineLabel=`Progress ${Tr(t)} Power${e!==null?" (Pinned)":""}`,this.hrTimelineLabel=`Progress ${Tr(r)} HR${e!==null?" (Pinned)":""}`,this.cdr.detectChanges(),ON(e)}onSportFilterChange(){this.render(this.lastCurrentTrack,this.lastAllTracks,this.lastOnTrackSelect,this.lastOnDateRangeSelect)}onMetricPillClick(e){document.getElementById(`${e}-evolution-card`)?.scrollIntoView({behavior:"smooth"})}onDistanceScroll(e){let t=e.target,r=this.elRef.nativeElement.querySelector(".elevation-progress-card .chart-scroll-container");t&&r&&r.scrollLeft!==t.scrollLeft&&(r.scrollLeft=t.scrollLeft)}onElevationScroll(e){let t=e.target,r=this.elRef.nativeElement.querySelector(".distance-progress-card .chart-scroll-container");r&&t&&r.scrollLeft!==t.scrollLeft&&(r.scrollLeft=t.scrollLeft)}onSelectCurveMax(e,t){t.preventDefault(),t.stopPropagation(),e.mxId&&document.dispatchEvent(new CustomEvent("select-track",{detail:{id:e.mxId,idx:e.mxIdx!=null?Number(e.mxIdx):null,dur:e.dur!=null?Number(e.dur):null}}))}onHistoryRowClick(e){this.lastOnTrackSelect?this.lastOnTrackSelect(e,null):this.state.selectTrack(e,!0)}};Qm=Xn([ms({selector:"app-evolution-tab",standalone:!0,imports:[tr,Yr],template:` +
+
+ no_sim +
Select a track for progress analysis
+
+ + +
+
+
+ +
+ +
+ + +
+ +
+ +
+ + +
+ +
+
+ +
+
+
+ +
+ +
+
+
+ monitoring + Accumulated Longitudinal Progress Summary +
+
+ CTL: {{ ctlStr }} + ATL: {{ atlStr }} + TSB: {{ tsbStr }} ({{ tsbStatus }}) +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
MetricPast 1MPast 6MPast YearCurrent YearTotalWeekly Avg
{{ r.label }}{{ r.past1m }} {{ r.unit }}{{ r.past6m }} {{ r.unit }}{{ r.pastYear }} {{ r.unit }}{{ r.currentYear }} {{ r.unit }}{{ r.total }} {{ r.unit }}{{ r.weeklyAvg }} {{ r.unit }}/wk
+
+ + +
+
+
+ {{ distanceIcon }} + Distance Progress +
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + +
PeriodDistanceDistance/Week
{{ r.period }}{{ r.valueFormatted }} {{ r.unit }}{{ r.weeklyAvgFormatted }} {{ r.unit }}
+
+
+
+ + +
+
+
+ {{ elevationIcon }} + Elevation Progress +
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + +
PeriodElevationElevation/Week
{{ r.period }}{{ r.valueFormatted }} {{ r.unit }}{{ r.weeklyAvgFormatted }} {{ r.unit }}
+
+
+
+ + +
+
+
+
+
+ bolt + Power Curve Progress +
+
+
+
+
+
+
+
+
+ bolt + {{ + powerTimelineLabel + }} +
+
+
+
+
+
+
+
+
+ + {{ trackName }} +
+
+ + All-Time Max +
+
+
+ + chevron_right + table_chart + Data Table + + + + + + + + + + + + + + + + +
DurationCurrentAll-Time Max
{{ row.durLabel }}{{ row.curValStr }} + {{ row.maxValStr }} + +
+
+
+ + +
+
+
+
+
+ favorite + Heart Rate Curve Progress +
+
+
+
+
+
+
+
+
+ favorite + {{ + hrTimelineLabel + }} +
+
+
+
+
+
+
+
+
+ + {{ trackName }} +
+
+ + All-Time Max +
+
+
+ + chevron_right + table_chart + Data Table + + + + + + + + + + + + + + + + +
DurationCurrentAll-Time Max
{{ row.durLabel }}{{ row.curValStr }} + {{ row.maxValStr }} + +
+
+
+ + +
+
+
+ history + Longitudinal Activity History ({{ historyRows.length }}) +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
DateActivitySportDistanceElevationDurationAvg PowerAvg HREst. TSS
{{ h.dateStr }} + {{ h.name }} + {{ h.sport }}{{ h.distKm }} km{{ h.elevGainM }} m{{ h.durationStr }}{{ h.avgPowerStr }}{{ h.avgHrStr }}{{ h.tssStr }}
+
+
+
+
+ `})],Qm);var Km=class{constructor(){this.state=ye(Rr);this.cdr=ye(bn);this.elRef=ye(en);this.courseViews=[];this.selectedCourseSummary=null;this.totalMatchesCount=0;this.corridorDeviationStr="0.00";this.isEditMode=!1;this.isResetEmpty=!0;this.newCourseName="";this.newCourseRadius=450;this.renamingCourseId=null;this.renameInputText="";this.vamColor=Os.vam.color;this.state.coursesTab=this,z6(this)}ngOnInit(){let e=this.elRef.nativeElement;document.getElementById("courses-view")||(e.id="courses-view")}ngOnDestroy(){this.state.coursesTab===this&&(this.state.coursesTab=null)}trackByCourseId(e,t){return t.id}trackByEffortId(e,t){return`${t.id}-${t.startIdx}-${t.endIdx}`}reset(){this.courseViews=[],this.selectedCourseSummary=null,this.totalMatchesCount=0,this.corridorDeviationStr="0.00",this.isEditMode=!1,this.isResetEmpty=!0,this.renamingCourseId=null,this.syncHostDataset(),this.cdr.detectChanges()}render(){this.isResetEmpty=!1;let e=K6();this.courseViews=e.courseViews,this.selectedCourseSummary=e.selectedCourseSummary,this.totalMatchesCount=e.totalMatchesCount,this.corridorDeviationStr=e.corridorDeviationStr,this.isEditMode=e.isEditMode,this.syncHostDataset(),this.cdr.detectChanges()}prepareBenchmarkCourses(e){OC(e)}selectCourse(e,t=!1){Kd(e,t)}syncHostDataset(){let e=document.getElementById("courses-view")||this.elRef.nativeElement;e&&(e.dataset.corridorDeviation=this.corridorDeviationStr,e.dataset.coursesCount=String(this.courseViews.length),e.dataset.matches=String(this.totalMatchesCount))}onNewCourseClick(){CN(this.newCourseName,this.newCourseRadius||450),this.newCourseName=""}onCreateCourseSubmit(){CN(this.newCourseName,this.newCourseRadius||450),this.newCourseName=""}onDoneEdit(){Z6(!1),this.render()}onCourseHeaderClick(e,t){let r=t.target;r?.closest(".course-actions")||r?.closest(".btn-rename-course")||t9(e)}onStartRename(e,t){t.stopPropagation(),this.renamingCourseId=e.id,this.renameInputText=e.name,this.cdr.detectChanges()}onSaveRename(e){if(this.renamingCourseId!==e)return;let t=this.renameInputText;this.renamingCourseId=null,J6(e,t)}onCancelRename(){this.renamingCourseId=null,this.cdr.detectChanges()}onEditCourse(e,t){t.stopPropagation(),e9(e)}onDeleteCourse(e,t){t.stopPropagation(),n9(e)}onTrackRowClick(e,t){t.stopPropagation(),r9(e.id,e.startIdx,e.endIdx)}onTrackRowHover(e,t){tt.setTrackHover(e,t)}};Km=Xn([ms({selector:"app-courses-tab",standalone:!0,imports:[tr,Yr],template:` +
+
+
+
+ + + +
+
+ {{ selectedCourseSummary.name }} + {{ selectedCourseSummary.pointsCount }} gates + {{ totalMatchesCount }} matched efforts + DTW Dev: {{ corridorDeviationStr }}m +
+
+
+ + +
+
+ +
+
+
+ route +
No courses created yet
+
+ +
+
+ {{ + c.isOpen ? 'expand_more' : 'chevron_right' + }} + +
+ {{ c.name }} + edit +
+ +
+ +
+ +
+ straighten + {{ c.distanceKm }} km | {{ c.pointsCount }} points | {{ c.matchingCount }} matching + tracks +
+ +
+ + +
+
+ +
+
No matching tracks
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Track ({{ c.matchedTracks.length }}) + calendar_today + Date + + straighten + Distance + + timer + Duration + + speed + Speed + + speed + Pace + + trending_up + VAM + + bolt + Power + + favorite + HR + + view_column + Q1\u2013Q4 Splits + + emoji_events + Gap +
+
+
+ {{ t.displayName }} + #{{ idx + 1 }} +
+
{{ t.date }}{{ t.distStr }}{{ t.durationStr }}{{ t.speedStr }}{{ t.paceStr }}{{ t.vamStr }}{{ t.wattsStr }}{{ t.hrStr }} + {{ t.splitsSummary }} + + {{ t.gapLabel }} +
+
+
+
+
+
+ `})],Km);function D9(n,e){u9(n,e)}function I9(){let n=kN();if(n){n.reset();return}let e=document.getElementById("details-view");e&&(e.innerHTML=` +
+ no_sim +
Select a track for details
+
+ `)}function sl(n,e=[],t=[],r){let s=kN();s&&s.render(n,e,t,r)}function _9(n){l9(n)}function k9(){let n=DN();if(n){n.reset();return}document.querySelectorAll(".hr-settings-popup").forEach(t=>t.remove());let e=document.getElementById("insights-view");e&&(e.innerHTML=` +
+ no_sim +
Select a track for insights
+
+ `)}function Bs(n,e=[],t=null){let r=DN();r&&r.render(n,e,t)}function A9(){let n=ep();if(n){n.reset();return}let e=document.getElementById("combined-tooltip");e&&e.remove();let t=document.getElementById("combined-view");t&&(t.innerHTML=` +
+ no_sim +
Select a track for combined analysis
+
+ `)}function BN(n,e){let t=ep();t&&t.setMetrics(n,e)}function VN(n){let e=ep();e&&e.setPolar(n)}function qC(n){let e=ep();e&&e.setSliderProgress(n)}function np(n,e=[]){let t=ep();t&&t.render(n,e)}function $N(){let n=ep();n&&n.resize()}var Ofe=16,HN=[{label:"Newest first",val:"date-desc",icon:"calendar_today"},{label:"Oldest first",val:"date-asc",icon:"history"},{label:"Longest distance",val:"dist-desc",icon:"straighten"},{label:"Shortest distance",val:"dist-asc",icon:"horizontal_rule"},{label:"Longest duration",val:"dur-desc",icon:"timer"},{label:"Shortest duration",val:"dur-asc",icon:"timer_off"}],Bfe=[{key:"power",title:"Power",icon:"bolt"},{key:"hr",title:"Heart Rate",icon:"favorite"},{key:"cadence",title:"Cadence",icon:"directions_run"},{key:"temperature",title:"Temperature",icon:"thermostat"},{key:"battery",title:"Battery",icon:"battery_full"},{key:"gearRear",title:"Rear Gear",icon:"settings"},{key:"gearFront",title:"Front Gear",icon:"settings_input_component"}],Vfe=[{id:"graphs",label:"Analysis",icon:"monitoring",marginLeft:""},{id:"insights",label:"Insights",icon:"analytics",marginLeft:""},{id:"details",label:"Details",icon:"list_alt",marginLeft:""},{id:"combined",label:"Combined",icon:"layers",marginLeft:""},{id:"evolution",label:"Progress",icon:"timeline",marginLeft:"auto"},{id:"courses",label:"Courses",icon:"route",marginLeft:""}];function $fe(n,e){let t=new Date(n),r=new Date(e);return t.getUTCFullYear()===r.getUTCFullYear()&&t.getUTCMonth()===r.getUTCMonth()&&t.getUTCDate()===r.getUTCDate()}var Jm=class{constructor(){this.state=ye(Rr);this.cdr=ye(bn);this.appRef=ye(ns);this.destroyAbortController=new AbortController;this.tabs=Vfe;this.filterMetricOptions=Bfe;this.graphsTabComponent=Gm;this.insightsTabComponent=Ni;this.detailsTabComponent=Jd;this.combinedTabComponent=wc;this.evolutionTabComponent=Qm;this.coursesTabComponent=Km;this.mountedTabs=new Set;this.displayedTracks=[];this.allSportOptions=[];this.commonSportOptions=[];this.filterPanelOpen=!1;this.sportDropdownOpen=!1;this.dropActive=!1;this.loaderVisible=!1;this.loaderText="Importing tracks";this.loaderFilename="";this.loaderProgressPct=0;this.loaderProgressIndex="";this.loaderProgressTotal="";this.loaderIcon="download";this.loaderIconColor="var(--accent)";this.loaderWarningCount=0;this.state.appRef=this.appRef,this.state.onSelectTrackCallback=(e,t=!0,r=!1)=>this.selectTrack(e,t,r),this.state.onDeleteTrackCallback=e=>this.deleteTrack(e),this.state.onApplyFiltersCallback=(e=!1)=>this.applyFilters(e),this.state.onChartRangeChangeCallback=(e,t,r,s=!1)=>this.onChartRangeChange(e,t,r,s)}get trackListHeaderLabel(){return this.displayedTracks.length>0||Object.keys(this.state.tracks).length>0?`Tracks (${this.displayedTracks.length})`:"Tracks"}get importWarningTitle(){return this.state.skippedImports.length>0?`Skipped ${this.state.skippedImports.length} imports. Click to view details.`:"Show skipped imports"}get currentSortIcon(){let e=HN.find(t=>t.val===this.state.currentSort);return e?e.icon:"calendar_today"}get currentSortLabel(){let e=HN.find(t=>t.val===this.state.currentSort);return e?e.label.replace(" first","").replace(" distance","").replace(" duration",""):"Date"}ngOnInit(){this.cdr.detectChanges()}ngAfterViewInit(){this.initSubsystems()}ngOnDestroy(){this.destroyAbortController.abort()}trackById(e,t){return t.id}capitalize(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}formatTrackDate(e){return e.points.length&&e.points[0].time?yo(e.points[0].time):"Unknown date"}formatTrackKm(e){return Math.round((e.stats.totalDist||0)/1e3)}getSportIcon(e){if(!e)return"category";let t=e.toLowerCase();return t.includes("run")?"directions_run":t.includes("cycl")||t.includes("bike")?"directions_bike":t.includes("walk")?"directions_walk":t.includes("swim")?"pool":t.includes("hik")?"hiking":"sports"}getTagColor(e){return FC(e)}onCancelLoader(){this.state.cancelProcessing=!0,this.loaderVisible=!1,this.cdr.detectChanges()}onToggleFilterPanel(){this.filterPanelOpen=!this.filterPanelOpen,this.cdr.detectChanges()}onFitAll(){tt.fitAll()}onClearAll(){this.clearAll()}onSearchInput(e){this.state.searchQuery=e.target.value,this.applyFilters(),St.patch({q:this.state.searchQuery||null})}onToggleRegex(){this.state.searchRegex=!this.state.searchRegex,this.applyFilters(),St.patch({re:this.state.searchRegex?!0:null})}onFilterInput(e,t,r){let s=r.target.value;e==="date"?this.state.filters.date[t]=s===""?null:s:e==="dist"?this.state.filters.dist[t]=s===""?null:Number(s):this.state.filters.dur[t]=s===""?null:Number(s),this.applyFilters(),this.state.syncFiltersToUrl()}onToggleSportDropdown(e){e.stopPropagation(),this.sportDropdownOpen=!this.sportDropdownOpen,this.cdr.detectChanges()}onSelectSportFilter(e,t=!1){this.state.filters.sport=this.state.filters.sport===e?null:e,t&&(this.sportDropdownOpen=!1),this.applyFilters(),this.state.syncFiltersToUrl(),this.cdr.detectChanges()}onFilterTagsInput(e){let t=e.target.value;this.state.filters.tags=t.split(",").map(r=>r.trim().toLowerCase()).filter(r=>!!r),this.applyFilters(),this.state.syncFiltersToUrl()}onToggleMetricFilter(e){this.state.filters.metrics.has(e)?this.state.filters.metrics.delete(e):this.state.filters.metrics.add(e),this.applyFilters(),this.state.syncFiltersToUrl()}onResetFilters(){this.state.filters={date:[null,null],dist:[null,null],dur:[null,null],metrics:new Set,tags:[],sport:null},this.applyFilters(),this.state.syncFiltersToUrl()}onOpenSortMenu(e){e.stopPropagation();let t=e.currentTarget;document.querySelectorAll(".sort-menu-popup").forEach(o=>o.remove());let r=document.createElement("div");r.className="sort-menu-popup",HN.forEach(o=>{let a=document.createElement("div");a.className=`menu-item ${this.state.currentSort===o.val?"active":""}`,a.innerHTML=` + ${o.icon} + ${o.label} + ${this.state.currentSort===o.val?"check":""} + `,a.addEventListener("click",()=>{this.state.currentSort=o.val,St.patch({sort:o.val}),this.renderTrackList(),r.remove()}),r.appendChild(a)});let s=t.getBoundingClientRect();r.style.top=`${s.bottom+5}px`,r.style.left=`${s.left}px`,document.body.appendChild(r);let i=o=>{!r.contains(o.target)&&!t.contains(o.target)&&(r.remove(),document.removeEventListener("click",i))};setTimeout(()=>document.addEventListener("click",i),0)}onTrackItemClick(e,t){e.target.closest(".icon-btn")||this.selectTrack(t.id)}onToggleTrackVis(e,t){e.stopPropagation(),t.visible=!t.visible,tt.setTrackVisible(t.id,t.visible),Gn.save(t),this.cdr.detectChanges()}onFileInputChange(e){let t=e.target,r=Array.from(t.files||[]);this.handleFiles(r),t.value=""}onTabClick(e){this.activateTab(e,!0);let t=this.state.selectedTrack;if(e==="details"&&t&&sl(t,this.state.getGlobalTags()),e==="insights"&&t&&Bs(t),e==="evolution"&&UC(t,this.state.allTracks,(r,s)=>{this.selectTrack(r,!0),s&&(Oe.restoreSelection(s[0],s[1]),this.onChartRangeChange(s[0],s[1],"time",!0))},(r,s)=>{this.state.filters.date=[r,s],this.applyFilters(),this.state.syncFiltersToUrl(!0)}),e==="combined"&&t&&np(t),e==="courses"&&nl(),e==="graphs"){Oe.resize(),this.state.graphsTab?.updateToolbarLayout();let r=St.get().sel;r&&Oe.restoreSelection(r[0],r[1])}}activateTab(e,t=!1){let r=this.mountedTabs.has(e);r||this.mountedTabs.add(e),this.state.activeTab=e,St.patch({tab:e},t),this.cdr.detectChanges(),!r&&e==="graphs"&&this.state.graphsTab?.syncFromChartView()}updateSportFilterOptions(){let e=new Set;Object.values(this.state.tracks).forEach(r=>{r.sport&&e.add(r.sport)});let t=Array.from(e).sort();if(this.allSportOptions=t,t.length<=4)this.commonSportOptions=t;else{let r=["running","cycling","walking"];this.commonSportOptions=r.filter(s=>e.has(s))}}renderTrackList(){this.updateSportFilterOptions(),this.displayedTracks=this.state.filteredTracks,this.cdr.detectChanges()}applyFilters(e=!1){Object.keys(this.state.tracks).forEach(r=>{let s=this.state.tracks[r],i=s.stats,o=!0;if(this.state.searchQuery)if(this.state.searchRegex)try{new RegExp(this.state.searchQuery,"i").test(s.name)||(o=!1)}catch{o=!1}else s.name.toLowerCase().includes(this.state.searchQuery.toLowerCase())||(o=!1);if(o&&(this.state.filters.date[0]||this.state.filters.date[1])){let a=this.state.filters.date[0]?new Date(this.state.filters.date[0]).getTime():0,c=this.state.filters.date[1]?new Date(this.state.filters.date[1]).getTime():1/0,u=i.startTime||0;(uc)&&(o=!1)}if(o&&(this.state.filters.dist[0]!==null||this.state.filters.dist[1]!==null)){let a=(this.state.filters.dist[0]||0)*1e3,c=(this.state.filters.dist[1]||1/0)*1e3;(i.totalDistc)&&(o=!1)}if(o&&(this.state.filters.dur[0]!==null||this.state.filters.dur[1]!==null)){let a=(this.state.filters.dur[0]||0)*6e4,c=(this.state.filters.dur[1]||1/0)*6e4,u=i.duration||0;(uc)&&(o=!1)}if(o&&this.state.filters.metrics.size>0)for(let a of this.state.filters.metrics){let c=Oe.METRICS[a]?.field;if(c&&!s.points.some(u=>u[c]!=null)){o=!1;break}}if(o&&this.state.filters.sport&&s.sport!==this.state.filters.sport&&(o=!1),o&&this.state.filters.tags.length>0){let a=s.tags||[];this.state.filters.tags.every(c=>a.includes(c))||(o=!1)}s._filtered=!o,tt.setTrackVisible(s.id,s.visible&&o)}),e||this.renderTrackList()}selectTrack(e,t=!0,r=!1){if(!this.state.tracks[e])return;if(e===this.state.selectedId){t&&tt.fitTrack(e);return}let s=this.state.selectedId!==null;s&&(Oe.clear(),sl(null,[]),Bs(null)),this.state.selectedId=e,this.state.currentMapColors=null,tt.clearMetricColor(e),s&&Oe.toggleMapColor(null),St.patch({track:e,sel:null},!0),s&&Oe.cancelSelection(),this.renderTrackList();let i=St.get().tab||"graphs",o=this.state.tracks[e],a=this.state.allTracks;i==="details"&&sl(o,this.state.getGlobalTags()),i==="insights"&&Bs(o),i==="combined"&&np(o),i==="courses"&&nl(),i==="evolution"&&UC(o,a,(c,u)=>{this.selectTrack(c,!0),u&&(Oe.restoreSelection(u[0],u[1]),this.onChartRangeChange(u[0],u[1],"time",!0))}),tt.setSelectedTrack(e,t),t&&tt.fitTrack(e),Oe.loadTrack(o,a,r),this.cdr.detectChanges()}async deleteTrack(e){await Gn.remove(e),tt.removeTrack(e),delete this.state.tracks[e],this.state.selectedId===e&&(this.state.selectedId=null,Oe.clear(),sl(null,[]),Bs(null),St.patch({track:null,sel:null,sel_point:null})),this.applyFilters()}onChartCursorMove(e){e&&e.lat!=null&&e.lon!=null?(tt.showCursorAt(e.lat,e.lon),this.state.followDot&&tt.centerOn(e.lat,e.lon,null,!0)):tt.hideCursor()}onChartRangeChange(e,t,r,s=!1){let i=this.state.selectedTrack;if(!i)return;if(e===null||t===null){tt.clearHighlight(),(St.get().tab||"graphs")==="insights"&&Bs(i),St.patch({sel:null});return}let o=i.points,a=0,c=o.length-1;if(r==="distance"){let p=e*1e3,f=t*1e3;a=o.findIndex(h=>(h.dist||0)>=p),c=o.findIndex(h=>(h.dist||0)>=f)}else{let p=o.find(m=>m.time!=null)?.time||0,f=p+e*1e3,h=p+t*1e3;a=o.findIndex(m=>(m.time||0)>=f),c=o.findIndex(m=>(m.time||0)>=h)}a===-1&&(a=0),c===-1&&(c=o.length-1);let u=o.slice(a,c+1),d=_n.computeStats(u);Oe.setSelectionStats(d),(St.get().tab||"graphs")==="insights"&&Bs(i),tt.highlightSegment(i.id,o,a,c,s,this.state.currentMapColors),tt.ensureVisible(u.map(p=>[p.lat,p.lon])),St.patch({sel:[e,t]})}onChartClick(e,t){e&&e.lat!=null&&e.lon!=null&&tt.centerOn(e.lat,e.lon,Ofe)}async resetBenchmarkState(){typeof window.__resetBenchmarkSeed=="function"&&window.__resetBenchmarkSeed(),await Gn.clear(),this.state.tracks={},this.state.skippedImports=[],this.state.selectedId=null,this.state.colorIdx=0,this.state.currentMapColors=null,this.state.cancelProcessing=!1,this.state.followDot=!1,this.state.searchQuery="",this.state.searchRegex=!1,this.state.currentSort="date-desc",this.state.filters.date=[null,null],this.state.filters.dist=[null,null],this.state.filters.dur=[null,null],this.state.filters.metrics.clear(),this.state.filters.tags=[],this.state.filters.sport=null,this.state.activeTab="graphs",_n.setHRZones([120,140,160,180]),_n.setFTP(200),X6(),k9(),I9(),A9(),w9(),tt.removeAllTracks&&tt.removeAllTracks(),tt.clearTracks&&tt.clearTracks(),tt.clearHighlight(),Oe.resetState?Oe.resetState():Oe.clear&&Oe.clear(),St.reset();let e=document.getElementById("toast-container");e&&(e.innerHTML=""),document.querySelectorAll(".modal-backdrop").forEach(t=>t.remove()),this.renderTrackList()}initSubsystems(){let e=St.get();_9((t,r)=>this.state.showToast(t,r==="error"?"error":"info")),D9(()=>{this.applyFilters(),this.state.syncFiltersToUrl()},t=>{this.deleteTrack(t)}),Y6((t,r)=>this.state.showToast(t,r==="error"?"error":"info")),tt.init(t=>this.selectTrack(t),(t,r,s)=>St.patch({map_pos:[t,r,s]}),(t,r)=>{this.selectTrack(t,!1),Oe.setCursorAt(r)},(t,r)=>{t===this.state.selectedId?Oe.setHoverAt(r):Oe.setHoverAt(null)},()=>{}),Oe.init(t=>this.onChartCursorMove(t),(t,r,s)=>this.onChartRangeChange(t,r,s),(t,r)=>this.onChartClick(t,r),t=>St.patch({sel_point:t})),Oe.setMapColorChangeCb(t=>{t?(this.state.currentMapColors=t.colors,this.state.selectedId&&tt.colorTrackByMetric(this.state.selectedId,t.pts,t.colors)):(this.state.currentMapColors=null,this.state.selectedId&&tt.clearMetricColor(this.state.selectedId));let r=St.get();r.sel&&this.onChartRangeChange(r.sel[0],r.sel[1],Oe.getXAxis())}),this.applyState(e),this.initResizeHandle(),this.initSidebarResizer(),this.initDropZone(),this.initGlobalListeners(),this.state.graphsTab?.updateToolbarLayout()}applyState(e){let t=e.track;if(t!==this.state.selectedId&&(t&&this.state.tracks[t]?this.selectTrack(t,!0):!t&&this.state.selectedId&&(this.state.selectedId=null,Oe.clear(),sl(null,[]),Bs(null),this.renderTrackList(),tt.fitAll())),e.map&&typeof e.map=="string"&&tt.switchBasemap(e.map),e.map_pos){let[r,s,i]=e.map_pos;tt.setPosition(r,s,i)}if(e.tab&&this.activateTab(e.tab,!1),e.xaxis&&Oe.setXAxis(e.xaxis),e.metrics){let r=Oe.METRICS,s=e.metrics.map(i=>Object.keys(r).find(o=>r[o].abbr===i)).filter(i=>i!==void 0);s.length&&Oe.setActiveMetrics(s)}e.f_date&&(this.state.filters.date=e.f_date.map(r=>r||null)),e.f_dist&&(this.state.filters.dist=e.f_dist.map(r=>r===0?0:r||null)),e.f_dur&&(this.state.filters.dur=e.f_dur.map(r=>r===0?0:r||null)),e.f_mets&&(this.state.filters.metrics=new Set(e.f_mets)),e.f_tags&&(this.state.filters.tags=e.f_tags),e.q&&(this.state.searchQuery=e.q),e.re&&(this.state.searchRegex=e.re),e.sort&&(this.state.currentSort=e.sort),this.applyFilters()}initGlobalListeners(){let e=this.destroyAbortController.signal;document.addEventListener("select-track",t=>{let r=t.detail.id,s=t.detail.idx,i=t.detail.dur;if(r&&this.state.tracks[r]&&(this.selectTrack(r),s!=null&&i!=null)){let o=this.state.tracks[r],a=o.points;if(s>=0&&sg.time!=null)?.time||0,d=(c.time-u)/1e3,p=d+i;Oe.restoreSelection(d,p);let f=a.findIndex(g=>(g.time||0)>=c.time+i*1e3);f===-1&&(f=a.length-1);let h=a.slice(s,f+1),m=_n.computeStats(h);Oe.setSelectionStats(m),Bs(o),tt.highlightSegment(r,a,s,f,!1,this.state.currentMapColors),tt.ensureVisible(h.map(g=>[g.lat,g.lon])),St.patch({sel:[d,p]})}}}},{signal:e}),document.addEventListener("click",t=>{if(this.sportDropdownOpen){let r=document.getElementById("sport-dropdown-content"),s=document.getElementById("sport-burger-btn");r&&!r.contains(t.target)&&t.target!==s&&(this.sportDropdownOpen=!1,this.cdr.detectChanges())}},{signal:e}),document.addEventListener("keydown",t=>{t.key==="Escape"&&(tt.hideCursor(),tt.closePopup?.(),document.querySelectorAll(".color-picker-popup, .metric-menu-popup, .sort-menu-popup, .modal-backdrop").forEach(r=>r.remove()))},{signal:e}),window.addEventListener("resize",()=>{Oe.resize(),$N(),tt.invalidateSize?.(),this.state.graphsTab?.updateToolbarLayout()},{signal:e})}initResizeHandle(){let e=document.getElementById("resize-handle"),t=document.getElementById("chart-panel");if(!e||!t)return;let r=this.destroyAbortController.signal,s=!1;e.addEventListener("mousedown",()=>{s=!0,document.body.style.cursor="ns-resize"},{signal:r}),document.addEventListener("mousemove",i=>{if(!s)return;let o=window.innerHeight-i.clientY,a=Math.max(100,Math.min(window.innerHeight-100,o));t.style.height=`${a}px`,Oe.resize(),$N(),tt.invalidateSize?.()},{signal:r}),document.addEventListener("mouseup",()=>{s&&(s=!1,document.body.style.cursor="")},{signal:r})}initSidebarResizer(){let e=document.getElementById("sidebar-resizer"),t=document.getElementById("sidebar");if(!e||!t)return;let r=this.destroyAbortController.signal,s=!1;e.addEventListener("mousedown",()=>{s=!0,e.classList.add("dragging"),document.body.classList.add("dragging-sidebar")},{signal:r}),document.addEventListener("mousemove",i=>{if(!s)return;let o=i.clientX,a=Math.max(200,Math.min(600,o));t.style.width=`${a}px`,t.style.setProperty("--sidebar-w",`${a}px`),Oe.resize(),tt.invalidateSize?.()},{signal:r}),document.addEventListener("mouseup",()=>{s&&(s=!1,e.classList.remove("dragging"),document.body.classList.remove("dragging-sidebar"))},{signal:r})}initDropZone(){let e=this.destroyAbortController.signal;window.addEventListener("dragover",t=>{t.preventDefault(),this.dropActive=!0,this.cdr.detectChanges()},{signal:e}),window.addEventListener("dragleave",t=>{t.relatedTarget===null&&(this.dropActive=!1,this.cdr.detectChanges())},{signal:e}),window.addEventListener("drop",async t=>{t.preventDefault(),this.dropActive=!1,this.cdr.detectChanges();let r=t.dataTransfer?.items;if(!r)return;let s=[],i=[];for(let a=0;aa.file(u));s.push(c)}else if(a.isDirectory){let c=a.createReader(),u=[],d;do d=await new Promise(p=>c.readEntries(p)),u.push(...d);while(d.length>0);for(let p of u)await o(p)}}for(let a of i)await o(a);s.length&&await this.handleFiles(s)},{signal:e})}onShowSkippedImportsModal(e){e.stopPropagation();let t=document.createElement("div");t.className="modal-backdrop";let r="";this.state.skippedImports.forEach(a=>{r+=`
${a.name}: ${a.reason}
`}),t.innerHTML=` + + `,document.body.appendChild(t);let s=t.querySelector(".modal-btn.cancel"),i=t.querySelector(".modal-btn.clear"),o=()=>t.remove();s.addEventListener("click",o),i.addEventListener("click",()=>{this.state.skippedImports=[],o(),this.cdr.detectChanges()}),t.addEventListener("click",a=>{a.target===t&&o()})}async clearAll(){let e=Math.floor(10+Math.random()*90).toString(),t=document.createElement("div");t.className="modal-backdrop",t.innerHTML=` + + `,document.body.appendChild(t);let r=t.querySelector(".modal-input"),s=t.querySelector(".modal-btn.confirm"),i=t.querySelector(".modal-btn.cancel");r.focus(),r.addEventListener("input",()=>{s.disabled=r.value!==e});let o=()=>t.remove();i.addEventListener("click",o),t.addEventListener("click",a=>{a.target===t&&o()}),s.addEventListener("click",async()=>{r.value===e&&(o(),this.state.cancelProcessing=!0,await Gn.clear(),this.state.tracks={},this.state.selectedId=null,tt.clearHighlight(),window.location.reload())})}async handleFiles(e,t=!1){if(!e.length)return;this.state.cancelProcessing=!1;let r=this.state.skippedImports.length,s=()=>{this.loaderIcon="warning",this.loaderIconColor="#f59e0b",this.loaderWarningCount=this.state.skippedImports.length-r,this.cdr.detectChanges()};this.loaderText=`Importing ${e.length} file${e.length>1?"s":""}`,this.loaderIcon="download",this.loaderIconColor="var(--accent)",this.loaderWarningCount=0,this.loaderProgressIndex="",this.loaderProgressTotal="",this.loaderProgressPct=0,this.loaderVisible=!0,this.cdr.detectChanges();try{let i=0,o=null,a=e.filter(d=>{let p=d.name.toLowerCase();return p.endsWith(".gpx")||p.endsWith(".fit")||p.endsWith(".tcx")||p.endsWith(".kml")});if(e.filter(d=>!a.includes(d)).forEach(d=>{this.state.skippedImports.push({name:d.name,reason:"Unsupported file format"})}),a.length===0){e.length>0&&this.state.showToast("No valid GPS files found","error");return}this.loaderProgressTotal=a.length.toString();for(let d=0;dW.fileName===p.name&&W.fileSize===p.size)){this.state.skippedImports.push({name:p.name,reason:"Same File"}),s();continue}let g=f.stats.startTime,y=f.stats.duration;if(g!=null&&y!=null){let W=g+y,xe=h.filter($=>$.stats.startTime!=null&&$fe(g,$.stats.startTime)),pe=!1;for(let $ of xe){let ee=$.stats.startTime,we=$.stats.duration,We=ee+we;if(g>=ee&&W<=We){this.state.skippedImports.push({name:p.name,reason:"Fully contained in another track"}),s(),pe=!0;break}if(Math.min(W,We)-Math.max(g,ee)>6e5){this.state.skippedImports.push({name:p.name,reason:"Overlaps with an existing track for more than 10 mins"}),s(),pe=!0;break}}if(pe)continue}let b=17855424e5,E=I6(f.stats.startTime||b);this.state.tracks[E]&&(E+=`-${_6()}`);let _=f.name;(_.startsWith("Unnamed")||_.startsWith("Fit Activity"))&&(_=p.name);let V=_,M=f.points[0]?.time,j=f.sport?f.sport.charAt(0).toUpperCase()+f.sport.slice(1):"Activity";if(M){let W=new Date(M);V=`${W.getUTCFullYear()}-${String(W.getUTCMonth()+1).padStart(2,"0")}-${String(W.getUTCDate()).padStart(2,"0")} ${j}`}else V=_.replace(/\.[^/.]+$/,"").replace(/_/g," ");let G={...f,id:E,name:_,displayName:V,fileName:p.name,fileSize:p.size,bounds:M6(f.points)||void 0,simplifiedPoints:N6(f.points,50),addedAt:f.stats.startTime||b,visible:!0,color:EN[this.state.colorIdx%EN.length]};if(this.state.colorIdx++,this.state.cancelProcessing)break;await Gn.save(G),this.state.tracks[E]=G,tt.addTrack(G),o||(o=E),i++}catch(f){this.state.skippedImports.push({name:p.name,reason:`Parse error: ${f instanceof Error?f.message:String(f)}`}),s()}}let u=this.state.skippedImports.length>r;u||(this.loaderVisible=!1),i>0&&(this.state.showToast(`Imported ${i} track${i>1?"s":""}`),this.applyFilters(!!o&&o!==this.state.selectedId),o&&this.selectTrack(o,!0,t)),u&&(this.loaderIcon="warning",this.cdr.detectChanges(),await new Promise(d=>setTimeout(d,1500)))}finally{this.loaderVisible=!1,this.cdr.detectChanges()}}async runBenchmarkLoad(e){try{await Gn.openDB(),await this.resetBenchmarkState();let t=e.map(s=>s.file);await this.handleFiles(t,!0);let r=this.state.allTracks;_n.findOverlaps(r);for(let s of["dist-desc","date-desc"])this.state.currentSort=s,this.renderTrackList();this.state.filters.sport="cycling",this.applyFilters(),this.state.filters.sport=null,this.applyFilters(),!this.state.selectedId&&r.length>0&&this.selectTrack(r[0].id,!0,!0)}finally{window.dispatchEvent(new CustomEvent("load-and-parse-complete"))}}runBenchmarkAnalysis(){try{let e=this.state.allTracks;this.activateTab("graphs"),!this.state.selectedId&&e.length>0&&this.selectTrack(e[0].id,!1,!0);let t=Oe.getAvailableMetrics(),r=[["elevation","speed","power"]];for(let i of r){let o=i.filter(a=>t.has(a));o.length>0&&Oe.setActiveMetrics(o)}Oe.setSmooth("power",!0,!0),Oe.toggleMapColor("power",!0),Oe.toggleMapColor(null,!0),Oe.setXAxis("distance"),Oe.setSmooth("power",!1,!0),Oe.setXAxis("time");let s=[[120,900,300]];for(let[i,o,a]of s)Oe.restoreSelection(i,o,!0),Oe.setCursorAt(a,!0),Oe.analyzeTelemetryIntervals(e,i,o),this.onChartRangeChange(i,o,Oe.getXAxis(),!1)}finally{window.dispatchEvent(new CustomEvent("analysis-complete"))}}runBenchmarkInsights(){try{let e=this.state.allTracks;e.forEach(r=>_n.ensureCurvesAndZones(r)),this.activateTab("insights");let t=this.state.selectedTrack||e[0]||null;e[1]&&(Bs(e[1],e,[0,600]),Bs(e[1],e,null)),e[4]&&Bs(e[4],e,null),t&&Bs(t,e,[0,600]),Bs(t,e,null)}finally{window.dispatchEvent(new CustomEvent("insights-complete"))}}runBenchmarkDetails(){try{let e=this.state.allTracks;this.activateTab("details");let t=this.state.getGlobalTags(),r=this.state.selectedTrack||e[0]||null;for(let s=0;s=2){this.activateTab("combined"),BN("distance","elevation"),np(e[0],e);for(let r of[.25,.5,.75,1])qC(r);VN(!0),qC(.5),VN(!1),BN("power","hr");for(let r of[.3,.7])qC(r);e.length>=4&&np([e[2],e[3]],e),e.length>=6&&np(e,e);let t=[e[0],e[1]];np(t,e)}}finally{window.dispatchEvent(new CustomEvent("aggregate-complete"))}}runBenchmarkEvolution(){try{let e=this.state.allTracks;this.activateTab("evolution");let t=this.state.selectedTrack||e[0]||null,r=(i,o)=>{this.selectTrack(i,!0),o&&(Oe.restoreSelection(o[0],o[1]),this.onChartRangeChange(o[0],o[1],"time",!0))},s=[e[2]||t,t];for(let i of s){UC(i,e,r),FN("month");for(let o of["1m","6m","1y","all"])E9(o);FN("week");for(let o of[5,60,300,1200,null])x9(o)}}finally{window.dispatchEvent(new CustomEvent("evolution-complete"))}}runBenchmarkCourses(){try{let e=this.state.allTracks;this.activateTab("courses"),OC(e);let t=Q6();for(let r of t.slice(0,4))Kd(r,!0);Kd("course-1",!0)}finally{window.dispatchEvent(new CustomEvent("courses-complete"))}}};Jm=Xn([ms({selector:"app-root",standalone:!0,imports:[tr,Yr],template:` +
+
+ +
+ {{ + loaderIcon + }} +
+ {{ loaderWarningCount }} + description +
+
+
+
{{ loaderText }}
+
{{ loaderFilename }}
+
+
+
+
+ {{ loaderProgressIndex }} + {{ loaderProgressTotal }} +
+
+
+
+ + + + + + + +
+ + + + + +
+
+ +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+
+ + + +
+
+ +
+
+ + + +
+
+
+
+ `})],Jm);function fEe(n,e=!0,t=!1){window.__trackStateService?.selectTrack(n,e,t)}var Ob=null,il=null,WC=null;async function N9(){if(WC)return WC;try{let e=await(await fetch("./test-data/manifest.json")).json(),t=new TextDecoder;return WC=await Promise.all(e.map(async r=>{let i=await(await fetch(`./test-data/${r}`)).arrayBuffer(),o=r;if(r.toLowerCase().endsWith(".gz")){o=r.slice(0,-3);let u=new Uint8Array(i);if(u.length>=2&&u[0]===31&&u[1]===139){let d=new DecompressionStream("gzip"),p=new Blob([i]).stream().pipeThrough(d);i=await new Response(p).arrayBuffer()}}let a=o.toLowerCase().endsWith(".fit")?void 0:t.decode(i),c=new File([i],o,{type:"application/octet-stream"});return c._buf=i,a!==void 0&&(c._text=a),{cleanName:o,buf:i,text:a,file:c}})),typeof window.__resetBenchmarkSeed=="function"&&window.__resetBenchmarkSeed(),WC}catch{return[]}}async function Hfe(){if(Ob&&(Ob.destroy(),Ob=null,il=null),!document.getElementById("app")){let n=document.createElement("app-root");n.id="app";let e=document.getElementById("toast-container");e&&e.parentNode?e.parentNode.insertBefore(n,e):document.body.appendChild(n)}return Ob=await JM(Jm),il=Ob.components[0]?.instance,il}function jfe(){let n=document.getElementById("btn-step-load"),e=document.getElementById("btn-step-analysis"),t=document.getElementById("btn-step-insights"),r=document.getElementById("btn-step-details"),s=document.getElementById("btn-step-aggregate"),i=document.getElementById("btn-step-evolution"),o=document.getElementById("btn-step-courses");n?.addEventListener("click",async()=>{try{let a=await N9();await(await Hfe()).runBenchmarkLoad(a)}catch(a){console.error("Angular benchmark load step error:",a),window.dispatchEvent(new CustomEvent("load-and-parse-complete"))}}),e?.addEventListener("click",()=>{il?.runBenchmarkAnalysis()}),t?.addEventListener("click",()=>{il?.runBenchmarkInsights()}),r?.addEventListener("click",()=>{il?.runBenchmarkDetails()}),s?.addEventListener("click",()=>{il?.runBenchmarkAggregate()}),i?.addEventListener("click",()=>{il?.runBenchmarkEvolution()}),o?.addEventListener("click",()=>{il?.runBenchmarkCourses()}),window.benchmarkSteps={loadAndParseFiles:()=>document.getElementById("btn-step-load")?.click(),displayAnalysisMetrics:()=>document.getElementById("btn-step-analysis")?.click(),displayInsights:()=>document.getElementById("btn-step-insights")?.click(),displayDetails:()=>document.getElementById("btn-step-details")?.click(),displayAggregateMetrics:()=>document.getElementById("btn-step-aggregate")?.click(),displayEvolutionMetrics:()=>document.getElementById("btn-step-evolution")?.click(),displayCourses:()=>document.getElementById("btn-step-courses")?.click()}}async function M9(){let n=null,e=new Promise(s=>{n=window.setTimeout(s,1e3)});try{let s=document.fonts?Promise.all([document.fonts.load('24px "Material Symbols Rounded"').catch(()=>{}),document.fonts.ready]):Promise.resolve();await Promise.race([s,e])}finally{n!==null&&window.clearTimeout(n)}document.body.classList.remove("loading-fonts"),jfe(),await N9();let t=document.createElement("div");t.id="app-is-ready",t.setAttribute("data-ready","true"),t.style.display="none",document.body.appendChild(t);let r=document.createElement("div");r.id="appIsReady",r.setAttribute("data-ready","true"),r.style.display="none",document.body.appendChild(r)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{M9()}):M9();export{fEe as selectTrack}; +/*! Bundled license information: + +zone.js/fesm2015/zone.js: + (** + * @license Angular v + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/compiler/fesm2022/compiler.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/compiler/fesm2022/compiler.mjs: + (*! + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + (** + * + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + +@angular/compiler/fesm2022/compiler.mjs: + (*! + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + +@angular/core/fesm2022/untracked-BKcld_ew.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/core/fesm2022/primitives/di.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/core/fesm2022/primitives/signals.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/core/fesm2022/primitives/event-dispatch.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/core/fesm2022/core.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/core/fesm2022/core.mjs: + (*! + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + +@angular/core/fesm2022/core.mjs: + (*! + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + +@angular/core/fesm2022/core.mjs: + (*! + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + +@angular/core/fesm2022/core.mjs: + (*! + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + +@angular/core/fesm2022/core.mjs: + (*! + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + +@angular/core/fesm2022/core.mjs: + (*! + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + +@angular/core/fesm2022/core.mjs: + (*! + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + +@angular/core/fesm2022/core.mjs: + (*! + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + *) + +@angular/common/fesm2022/dom_tokens-rA0ACyx7.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/common/fesm2022/location-Dq4mJT-A.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/common/fesm2022/common_module-8OBsKodd.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/common/fesm2022/xhr-BfNfxNDv.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/common/fesm2022/common.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/platform-browser/fesm2022/dom_renderer-DGKzginR.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/platform-browser/fesm2022/browser-0WrrQdE0.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/platform-browser/fesm2022/platform-browser.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) + +@angular/forms/fesm2022/forms.mjs: + (** + * @license Angular v19.2.25 + * (c) 2010-2025 Google LLC. https://angular.io/ + * License: MIT + *) +*/ +//# sourceMappingURL=tools-gps-tracks-angular.mjs.map diff --git a/suites-experimental/tools-gps-tracks-angular/dist/tools-gps-tracks-angular.mjs.map b/suites-experimental/tools-gps-tracks-angular/dist/tools-gps-tracks-angular.mjs.map new file mode 100644 index 000000000..f6f4b2284 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/dist/tools-gps-tracks-angular.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../node_modules/zone.js/fesm2015/zone.js", "../../../packages/compiler/src/selector.ts", "../../../packages/compiler/src/schema/dom_security_schema.ts", "../../../packages/compiler/src/core.ts", "../../../packages/compiler/src/compiler_facade_interface.ts", "../../../packages/compiler/src/i18n/digest.ts", "../../../packages/compiler/src/output/output_ast.ts", "../../../packages/compiler/src/constant_pool.ts", "../../../packages/compiler/src/render3/r3_identifiers.ts", "../../../packages/compiler/src/util.ts", "../../../packages/compiler/src/output/source_map.ts", "../../../packages/compiler/src/output/abstract_emitter.ts", "../../../packages/compiler/src/render3/util.ts", "../../../packages/compiler/src/render3/r3_factory.ts", "../../../packages/compiler/src/expression_parser/ast.ts", "../../../packages/compiler/src/ml_parser/tags.ts", "../../../packages/compiler/src/render3/r3_ast.ts", "../../../packages/compiler/src/i18n/i18n_ast.ts", "../../../packages/compiler/src/i18n/serializers/serializer.ts", "../../../packages/compiler/src/i18n/serializers/xml_helper.ts", "../../../packages/compiler/src/i18n/serializers/xmb.ts", "../../../packages/compiler/src/render3/view/i18n/util.ts", "../../../packages/compiler/src/render3/view/util.ts", "../../../packages/compiler/src/injectable_compiler_2.ts", "../../../packages/compiler/src/assertions.ts", "../../../packages/compiler/src/ml_parser/defaults.ts", "../../../packages/compiler/src/chars.ts", "../../../packages/compiler/src/parse_util.ts", "../../../packages/compiler/src/output/abstract_js_emitter.ts", "../../../packages/compiler/src/output/output_jit_trusted_types.ts", "../../../packages/compiler/src/output/output_jit.ts", "../../../packages/compiler/src/render3/r3_injector_compiler.ts", "../../../packages/compiler/src/render3/r3_jit.ts", "../../../packages/compiler/src/render3/r3_module_compiler.ts", "../../../packages/compiler/src/render3/r3_pipe_compiler.ts", "../../../packages/compiler/src/render3/view/api.ts", "../../../packages/compiler/src/shadow_css.ts", "../../../packages/compiler/src/template/pipeline/ir/src/enums.ts", "../../../packages/compiler/src/template/pipeline/ir/src/traits.ts", "../../../packages/compiler/src/template/pipeline/ir/src/ops/shared.ts", "../../../packages/compiler/src/template/pipeline/ir/src/ops/update.ts", "../../../packages/compiler/src/template/pipeline/ir/src/expression.ts", "../../../packages/compiler/src/template/pipeline/ir/src/operations.ts", "../../../packages/compiler/src/template/pipeline/ir/src/handle.ts", "../../../packages/compiler/src/template/pipeline/ir/src/ops/create.ts", "../../../packages/compiler/src/template/pipeline/ir/src/ops/host.ts", "../../../packages/compiler/src/template/pipeline/ir/src/variable.ts", "../../../packages/compiler/src/template/pipeline/src/compilation.ts", "../../../packages/compiler/src/template/pipeline/src/phases/any_cast.ts", "../../../packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.ts", "../../../packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.ts", "../../../packages/compiler/src/template/pipeline/src/util/elements.ts", "../../../packages/compiler/src/template/pipeline/src/phases/attribute_extraction.ts", "../../../packages/compiler/src/template/pipeline/src/phases/binding_specialization.ts", "../../../packages/compiler/src/template/pipeline/src/phases/chaining.ts", "../../../packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.ts", "../../../packages/compiler/src/template/pipeline/src/phases/conditionals.ts", "../../../packages/compiler/src/template/pipeline/src/conversion.ts", "../../../packages/compiler/src/template/pipeline/src/phases/const_collection.ts", "../../../packages/compiler/src/template/pipeline/src/phases/convert_i18n_bindings.ts", "../../../packages/compiler/src/template/pipeline/src/phases/resolve_defer_deps_fns.ts", "../../../packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.ts", "../../../packages/compiler/src/template/pipeline/src/phases/deduplicate_text_bindings.ts", "../../../packages/compiler/src/template/pipeline/src/phases/defer_configs.ts", "../../../packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.ts", "../../../packages/compiler/src/template/pipeline/src/phases/empty_elements.ts", "../../../packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.ts", "../../../packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.ts", "../../../packages/compiler/src/template/pipeline/src/phases/generate_advance.ts", "../../../packages/compiler/src/template/pipeline/src/phases/generate_projection_def.ts", "../../../packages/compiler/src/template/pipeline/src/phases/generate_variables.ts", "../../../packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.ts", "../../../packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.ts", "../../../packages/compiler/src/output/map_util.ts", "../../../packages/compiler/src/render3/view/i18n/icu_serializer.ts", "../../../packages/compiler/src/ml_parser/ast.ts", "../../../packages/compiler/src/ml_parser/entities.ts", "../../../packages/compiler/src/ml_parser/lexer.ts", "../../../packages/compiler/src/ml_parser/parser.ts", "../../../packages/compiler/src/ml_parser/html_whitespaces.ts", "../../../packages/compiler/src/expression_parser/lexer.ts", "../../../packages/compiler/src/expression_parser/parser.ts", "../../../packages/compiler/src/expression_parser/serializer.ts", "../../../packages/compiler/src/template/pipeline/src/namespaces.ts", "../../../packages/compiler/src/schema/element_schema_registry.ts", "../../../packages/compiler/src/schema/dom_element_schema_registry.ts", "../../../packages/compiler/src/ml_parser/html_tags.ts", "../../../packages/compiler/src/i18n/serializers/placeholder.ts", "../../../packages/compiler/src/i18n/i18n_parser.ts", "../../../packages/compiler/src/i18n/parse_util.ts", "../../../packages/compiler/src/schema/trusted_types_sinks.ts", "../../../packages/compiler/src/render3/view/i18n/meta.ts", "../../../packages/compiler/src/render3/view/i18n/get_msg_utils.ts", "../../../packages/compiler/src/render3/view/i18n/localize_utils.ts", "../../../packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.ts", "../../../packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.ts", "../../../packages/compiler/src/template/pipeline/src/phases/local_refs.ts", "../../../packages/compiler/src/template/pipeline/src/phases/namespace.ts", "../../../packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.ts", "../../../packages/compiler/src/template/pipeline/src/phases/naming.ts", "../../../packages/compiler/src/template/pipeline/src/phases/next_context_merging.ts", "../../../packages/compiler/src/template/pipeline/src/phases/ng_container.ts", "../../../packages/compiler/src/template/pipeline/src/phases/nonbindable.ts", "../../../packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.ts", "../../../packages/compiler/src/template/pipeline/src/phases/ordering.ts", "../../../packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.ts", "../../../packages/compiler/src/template/pipeline/src/phases/pipe_creation.ts", "../../../packages/compiler/src/template/pipeline/src/phases/pipe_variadic.ts", "../../../packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.ts", "../../../packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.ts", "../../../packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.ts", "../../../packages/compiler/src/template/pipeline/src/instruction.ts", "../../../packages/compiler/src/template/pipeline/src/phases/reify.ts", "../../../packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.ts", "../../../packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.ts", "../../../packages/compiler/src/template/pipeline/src/phases/remove_unused_i18n_attrs.ts", "../../../packages/compiler/src/template/pipeline/src/phases/resolve_contexts.ts", "../../../packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.ts", "../../../packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.ts", "../../../packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.ts", "../../../packages/compiler/src/template/pipeline/src/phases/resolve_i18n_attr_sanitizers.ts", "../../../packages/compiler/src/template/pipeline/src/phases/resolve_names.ts", "../../../packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.ts", "../../../packages/compiler/src/template/pipeline/src/phases/transform_two_way_binding_set.ts", "../../../packages/compiler/src/template/pipeline/src/phases/save_restore_view.ts", "../../../packages/compiler/src/template/pipeline/src/phases/slot_allocation.ts", "../../../packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.ts", "../../../packages/compiler/src/template/pipeline/src/phases/temporary_variables.ts", "../../../packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.ts", "../../../packages/compiler/src/template/pipeline/src/phases/track_variables.ts", "../../../packages/compiler/src/template/pipeline/src/phases/var_counting.ts", "../../../packages/compiler/src/template/pipeline/src/phases/variable_optimization.ts", "../../../packages/compiler/src/template/pipeline/src/phases/wrap_icus.ts", "../../../packages/compiler/src/template/pipeline/src/phases/store_let_optimization.ts", "../../../packages/compiler/src/template/pipeline/src/phases/remove_illegal_let_references.ts", "../../../packages/compiler/src/template/pipeline/src/phases/generate_local_let_references.ts", "../../../packages/compiler/src/template/pipeline/src/phases/attach_source_locations.ts", "../../../packages/compiler/src/template/pipeline/src/emit.ts", "../../../packages/compiler/src/template/pipeline/src/ingest.ts", "../../../packages/compiler/src/render3/view/config.ts", "../../../packages/compiler/src/render3/view/query_generation.ts", "../../../packages/compiler/src/ml_parser/html_parser.ts", "../../../packages/compiler/src/template_parser/binding_parser.ts", "../../../packages/compiler/src/style_url_resolver.ts", "../../../packages/compiler/src/template_parser/template_preparser.ts", "../../../packages/compiler/src/render3/r3_control_flow.ts", "../../../packages/compiler/src/render3/r3_deferred_triggers.ts", "../../../packages/compiler/src/render3/r3_deferred_blocks.ts", "../../../packages/compiler/src/render3/r3_template_transform.ts", "../../../packages/compiler/src/render3/view/template.ts", "../../../packages/compiler/src/render3/view/compiler.ts", "../../../packages/compiler/src/render3/view/t2_binder.ts", "../../../packages/compiler/src/resource_loader.ts", "../../../packages/compiler/src/jit_compiler_facade.ts", "../../../packages/compiler/src/version.ts", "../../../packages/compiler/src/config.ts", "../../../packages/compiler/src/i18n/extractor_merger.ts", "../../../packages/compiler/src/ml_parser/xml_tags.ts", "../../../packages/compiler/src/ml_parser/xml_parser.ts", "../../../packages/compiler/src/i18n/serializers/xliff.ts", "../../../packages/compiler/src/i18n/serializers/xliff2.ts", "../../../packages/compiler/src/i18n/serializers/xtb.ts", "../../../packages/compiler/src/i18n/translation_bundle.ts", "../../../packages/compiler/src/i18n/i18n_html_parser.ts", "../../../packages/compiler/src/i18n/message_bundle.ts", "../../../packages/compiler/src/render3/r3_class_metadata_compiler.ts", "../../../packages/compiler/src/render3/r3_class_debug_info_compiler.ts", "../../../packages/compiler/src/render3/r3_hmr_compiler.ts", "../../../packages/compiler/src/render3/partial/class_metadata.ts", "../../../packages/compiler/src/render3/partial/util.ts", "../../../packages/compiler/src/render3/partial/directive.ts", "../../../packages/compiler/src/render3/partial/component.ts", "../../../packages/compiler/src/render3/partial/factory.ts", "../../../packages/compiler/src/render3/partial/injectable.ts", "../../../packages/compiler/src/render3/partial/injector.ts", "../../../packages/compiler/src/render3/partial/ng_module.ts", "../../../packages/compiler/src/render3/partial/pipe.ts", "../../../packages/compiler/src/compiler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/signals/src/equality.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/signals/src/graph.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/signals/src/computed.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/signals/src/errors.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/signals/src/signal.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/signals/src/linked_signal.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/signals/src/weak_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/signals/src/untracked.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/di/src/injector.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/di/src/not_found.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/signals/src/watch.ts", "../node_modules/tslib/tslib.es6.mjs", "../node_modules/rxjs/src/internal/util/isFunction.ts", "../node_modules/rxjs/src/internal/util/createErrorClass.ts", "../node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "../node_modules/rxjs/src/internal/util/arrRemove.ts", "../node_modules/rxjs/src/internal/Subscription.ts", "../node_modules/rxjs/src/internal/config.ts", "../node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts", "../node_modules/rxjs/src/internal/util/reportUnhandledError.ts", "../node_modules/rxjs/src/internal/util/noop.ts", "../node_modules/rxjs/src/internal/NotificationFactories.ts", "../node_modules/rxjs/src/internal/util/errorContext.ts", "../node_modules/rxjs/src/internal/Subscriber.ts", "../node_modules/rxjs/src/internal/symbol/observable.ts", "../node_modules/rxjs/src/internal/util/identity.ts", "../node_modules/rxjs/src/internal/util/pipe.ts", "../node_modules/rxjs/src/internal/Observable.ts", "../node_modules/rxjs/src/internal/util/lift.ts", "../node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts", "../node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts", "../node_modules/rxjs/src/internal/Subject.ts", "../node_modules/rxjs/src/internal/BehaviorSubject.ts", "../node_modules/rxjs/src/internal/util/args.ts", "../node_modules/rxjs/src/internal/util/isArrayLike.ts", "../node_modules/rxjs/src/internal/util/isPromise.ts", "../node_modules/rxjs/src/internal/util/isInteropObservable.ts", "../node_modules/rxjs/src/internal/util/isAsyncIterable.ts", "../node_modules/rxjs/src/internal/util/throwUnobservableError.ts", "../node_modules/rxjs/src/internal/symbol/iterator.ts", "../node_modules/rxjs/src/internal/util/isIterable.ts", "../node_modules/rxjs/src/internal/util/isReadableStreamLike.ts", "../node_modules/rxjs/src/internal/observable/innerFrom.ts", "../node_modules/rxjs/src/internal/util/executeSchedule.ts", "../node_modules/rxjs/src/internal/operators/observeOn.ts", "../node_modules/rxjs/src/internal/operators/subscribeOn.ts", "../node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts", "../node_modules/rxjs/src/internal/scheduled/schedulePromise.ts", "../node_modules/rxjs/src/internal/scheduled/scheduleArray.ts", "../node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts", "../node_modules/rxjs/src/internal/scheduled/scheduleAsyncIterable.ts", "../node_modules/rxjs/src/internal/scheduled/scheduleReadableStreamLike.ts", "../node_modules/rxjs/src/internal/scheduled/scheduled.ts", "../node_modules/rxjs/src/internal/observable/from.ts", "../node_modules/rxjs/src/internal/operators/map.ts", "../node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts", "../node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts", "../node_modules/rxjs/src/internal/util/createObject.ts", "../node_modules/rxjs/src/internal/observable/forkJoin.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/attribute.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/property.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/cache.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/event_type.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/event.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/event_contract_container.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/char.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/event_info.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/action_resolver.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/restriction.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/dispatcher.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/event_dispatcher.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/earlyeventcontract.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/event_contract_defines.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/eventcontract.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/primitives/event-dispatch/src/bootstrap_app_scoped.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/error_details_base_url.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/errors.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/input/input_signal_node.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/input/input_signal.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/closure.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/decorators.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/global.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/ng_dev_mode.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/property.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/stringify.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/forward_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/assert.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/interface/defs.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/injection_token.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/debug/injector_profiler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/interface/provider.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/fields.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/stringify_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/errors_di.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/interface/injector.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/inject_switch.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/injector_compatibility.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/metadata.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/definition_factory.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/array_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/empty.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/initializer_token.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/injector_token.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/internal_tokens.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/null_injector.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/def_getters.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/provider_collection.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/scope.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/r3_injector.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/contextual.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/compiler/compiler_facade_interface.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/compiler/compiler_facade.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/jit/environment.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/interface/type.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/reflection/reflection_capabilities.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/view.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/container.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/type_checks.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/assert.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/interface/simple_change.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/apply_value_input_field.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/ng_onchanges_feature.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/profiler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/namespaces.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/view_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/state.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/hooks.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/injector.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/node.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/node_assert.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/attrs_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/injector_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/di.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/di_attr.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/metadata_attr.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/jit/util.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/jit/injectable.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/injectable.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/create_injector.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/injector.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/host_attribute_token.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/di/host_tag_name_token.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/scheduling/flags.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/destroy_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/scheduling/zoneless_scheduling.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/pending_tasks.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/event_emitter.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/noop.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/callback_scheduler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/zone/async-stack-tagging.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/zone/ng_zone.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/error_handler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/output/output_emitter_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/output/output.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/input/input.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/element_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/api.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/signal.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/query_list.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/skip_hydration.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/constants.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/lview_tracking.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/context.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/context_discovery.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/view_traversal_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/discovery_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/document.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_tokens.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/transfer_state.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/interfaces.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/tokens.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/tracing.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/performance.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/asserts.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view_context.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/after_render/api.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/after_render/manager.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/after_render/hooks.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/interfaces.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/cleanup.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/dom_triggers.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/event_delegation_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/registry.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/queries/query_execution.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/view.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/schema.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/element_validation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/security/trusted_types.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/security/trusted_types_bypass.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/bypass.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/inert_body.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/url_sanitizer.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/html_sanitizer.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/dom.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/dom_node_manipulation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/iframe_attrs_validation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/dom_security_schema.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/sanitization.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/ng_reflect.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/misc_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/errors.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/styling/class_differ.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/node_selector_matcher.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/tokens.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/construction.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/advance.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/input_flags.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/write_to_directive_input.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/shared.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/render.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view_manipulation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_tree_shaking.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render/api_flags.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/i18n/utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/node_manipulation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/collect_native_nodes.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/after_render/view.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactive_lview_consumer.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/view_effect_runner.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/change_detection.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/mark_view_dirty.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/container.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/template_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/error_handling.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/node_manipulation_i18n.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/tnode_manipulation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_insert_before_index.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_util.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_icu_container_visitor.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/compression.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/node_lookup_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/i18n.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/cleanup.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/views.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/component_factory.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/component_factory_resolver.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render/api.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/sanitization/sanitizer.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/util.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/deps_tracker/deps_tracker.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/view/provider_flags.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/chained_injector.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/styling/static_styling.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/di.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/directives.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/elements.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/component_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/view_container_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/queries/query.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/queries/query_reactive.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/queries.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/model/model_signal.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/authoring/model/model.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/di.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/resource_loading.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/ng_module_registration.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/ng_module_factory.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/ng_module_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/standalone_service.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/definition.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/inherit_definition_feature.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/copy_definition_feature.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/host_directives_feature.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/iterable.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/comparison.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/bindings.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/template.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/idle_scheduler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/timer_scheduler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/cached_injector_service.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/rendering.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/metadata.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/console.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/debug/framework_injector_profiler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/change_detection_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/discovery.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/defer.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/injector_discovery_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/signal_debug.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/util/global_utils.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/testability/testability.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/root_effect_scheduler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/lang.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_init.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/triggering.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/defer/instructions.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/attribute.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/interpolation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/attribute_interpolation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/styling.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/styling/style_binding_list.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/styling/styling_parser.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/property.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/styling.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/class_map_interpolation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/component_instance.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/list_reconciliation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/control_flow.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/element.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/element_container.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/get_current_view.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/host_property.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/i18n/locale_en.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/i18n/locale_data_api.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/i18n/localization.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/interfaces/i18n.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_locale_id.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_apply.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_debug.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_parse.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/i18n/i18n_postprocess.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/i18n.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/listeners.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view/directive_outputs.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/listener.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/next_context.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/projection.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/property_interpolation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/queries.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/queries_signals.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/storage.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/style_map_interpolation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/style_prop_interpolation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/text.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/text_interpolation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/two_way.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/let_declaration.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/instructions/attach_source_locations.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/di_setup.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/providers_feature.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/features/external_styles_feature.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/scope.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/pure_function.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/pipe.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/view_engine_compatibility_prebound.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/local_compilation.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/debug/set_debug_info.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/hmr.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/environment.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/jit_options.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/module.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/directive.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/pipe.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/directives.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/metadata/ng_module.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/version.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/compiler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_ngmodule_factory_compiler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/scheduling/ng_zone_scheduling.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/scheduling/zoneless_scheduling_impl.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/i18n/tokens.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/image_performance_warning.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/platform/platform_destroy_listeners.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/platform/bootstrap.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/platform/platform_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/platform/platform.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/scheduling/exhaustive_check_no_changes.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/is_dev_mode.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/ng_module_factory_loader.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/change_detector_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/linker/view_ref.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/debug/debug_node.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/differs/default_iterable_differ.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/differs/default_keyvalue_differ.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/differs/iterable_differs.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/differs/keyvalue_differs.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/change_detection/change_detection.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/platform/platform_core_providers.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_module.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/create_application.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/event_replay.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/annotate.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/hydration/api.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/util/coercion.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/profiler.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/untracked.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/computed.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/microtask_effect.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/effect.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/resource/api.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/linked_signal.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/resource/resource.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/internal/get_closest_component_name.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/jit/partial.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/reactivity/after_render_effect.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/render3/component.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/application_config.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/core/src/application/platform_tokens.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/dom_tokens.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/dom_adapter.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/location/platform_location.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/location/util.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/location/location_strategy.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/location/location.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/location/hash_location_strategy.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/i18n/currencies.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/i18n/locale_data_api.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/i18n/format_date.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/i18n/format_number.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/i18n/localization.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_class.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_component_outlet.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_for_of.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_if.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_switch.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_plural.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_style.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_template_outlet.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/index.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/invalid_pipe_argument_error.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/async_pipe.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/case_conversion_pipes.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/date_pipe_config.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/date_pipe.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/i18n_plural_pipe.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/i18n_select_pipe.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/json_pipe.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/keyvalue_pipe.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/number_pipe.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/slice_pipe.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/pipes/index.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/common_module.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/cookie.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/platform_id.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/xhr.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/i18n/locale_data.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/version.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/viewport_scroller.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/image_loaders/constants.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/url.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/image_loaders/image_loader.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/image_loaders/cloudflare_loader.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/image_loaders/cloudinary_loader.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/image_loaders/imagekit_loader.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/image_loaders/imgix_loader.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/image_loaders/netlify_loader.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/error_helper.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/asserts.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/lcp_image_observer.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/preconnect_link_checker.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/tokens.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/preload-link-creator.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/common/src/directives/ng_optimized_image/ng_optimized_image.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/dom/events/event_manager.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/dom/shared_styles_host.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/dom/dom_renderer.js", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/browser/browser_adapter.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/browser/testability.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/browser/xhr.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/dom/events/dom_events.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/dom/events/key_events.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/browser.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/browser/meta.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/browser/title.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/dom/util.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/browser/tools/common_tools.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/browser/tools/tools.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/dom/debug/by.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/dom/events/hammer_gestures.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/security/dom_sanitization_service.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/hydration.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/platform-browser/src/version.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/control_value_accessor.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/checkbox_value_accessor.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/default_value_accessor.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/validators.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/abstract_control_directive.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/control_container.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/ng_control.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/ng_control_status.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/error_examples.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/reactive_errors.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/model/abstract_model.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/model/form_group.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/shared.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/ng_form.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/util.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/model/form_control.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/abstract_form_group_directive.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/template_driven_errors.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/ng_model_group.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/ng_model.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/ng_no_validate_directive.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/number_value_accessor.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/radio_control_value_accessor.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/range_value_accessor.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/reactive_directives/form_control_directive.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/reactive_directives/form_group_directive.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/reactive_directives/form_group_name.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/reactive_directives/form_control_name.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/select_control_value_accessor.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/select_multiple_control_value_accessor.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives/validators.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/directives.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/model/form_array.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/form_builder.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/version.ts", "../../darwin_arm64-fastbuild-ST-2d99d9656325/bin/packages/forms/src/form_providers.ts", "../src/url-state.ts", "../src/storage.ts", "../src/map.ts", "../src/charts.ts", "../src/utils.ts", "../src/parsers.ts", "../src/zones.ts", "../src/metrics.ts", "../src/sports.ts", "../src/services/track-state.service.ts", "../src/components/graphs-tab.component.ts", "../src/components/insights-tab.component.ts", "../src/tabs/courses.ts", "../src/components/details-tab.component.ts", "../src/components/combined-tab.component.ts", "../src/tabs/progress.ts", "../src/tabs/accumulated_progress.ts", "../src/components/evolution-tab.component.ts", "../src/components/courses-tab.component.ts", "../src/tabs/details.ts", "../src/tabs/insights.ts", "../src/tabs/combined.ts", "../src/app.component.ts", "../src/app.ts"], + "sourcesContent": ["'use strict';\n/**\n * @license Angular v\n * (c) 2010-2025 Google LLC. https://angular.io/\n * License: MIT\n */\nconst global = globalThis;\n// __Zone_symbol_prefix global can be used to override the default zone\n// symbol prefix with a custom one if needed.\nfunction __symbol__(name) {\n const symbolPrefix = global['__Zone_symbol_prefix'] || '__zone_symbol__';\n return symbolPrefix + name;\n}\nfunction initZone() {\n const performance = global['performance'];\n function mark(name) {\n performance && performance['mark'] && performance['mark'](name);\n }\n function performanceMeasure(name, label) {\n performance && performance['measure'] && performance['measure'](name, label);\n }\n mark('Zone');\n class ZoneImpl {\n static __symbol__ = __symbol__;\n static assertZonePatched() {\n if (global['Promise'] !== patches['ZoneAwarePromise']) {\n throw new Error('Zone.js has detected that ZoneAwarePromise `(window|global).Promise` ' +\n 'has been overwritten.\\n' +\n 'Most likely cause is that a Promise polyfill has been loaded ' +\n 'after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. ' +\n 'If you must load one, do so before loading zone.js.)');\n }\n }\n static get root() {\n let zone = ZoneImpl.current;\n while (zone.parent) {\n zone = zone.parent;\n }\n return zone;\n }\n static get current() {\n return _currentZoneFrame.zone;\n }\n static get currentTask() {\n return _currentTask;\n }\n static __load_patch(name, fn, ignoreDuplicate = false) {\n if (patches.hasOwnProperty(name)) {\n // `checkDuplicate` option is defined from global variable\n // so it works for all modules.\n // `ignoreDuplicate` can work for the specified module\n const checkDuplicate = global[__symbol__('forceDuplicateZoneCheck')] === true;\n if (!ignoreDuplicate && checkDuplicate) {\n throw Error('Already loaded patch: ' + name);\n }\n }\n else if (!global['__Zone_disable_' + name]) {\n const perfName = 'Zone:' + name;\n mark(perfName);\n patches[name] = fn(global, ZoneImpl, _api);\n performanceMeasure(perfName, perfName);\n }\n }\n get parent() {\n return this._parent;\n }\n get name() {\n return this._name;\n }\n _parent;\n _name;\n _properties;\n _zoneDelegate;\n constructor(parent, zoneSpec) {\n this._parent = parent;\n this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '';\n this._properties = (zoneSpec && zoneSpec.properties) || {};\n this._zoneDelegate = new _ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec);\n }\n get(key) {\n const zone = this.getZoneWith(key);\n if (zone)\n return zone._properties[key];\n }\n getZoneWith(key) {\n let current = this;\n while (current) {\n if (current._properties.hasOwnProperty(key)) {\n return current;\n }\n current = current._parent;\n }\n return null;\n }\n fork(zoneSpec) {\n if (!zoneSpec)\n throw new Error('ZoneSpec required!');\n return this._zoneDelegate.fork(this, zoneSpec);\n }\n wrap(callback, source) {\n if (typeof callback !== 'function') {\n throw new Error('Expecting function got: ' + callback);\n }\n const _callback = this._zoneDelegate.intercept(this, callback, source);\n const zone = this;\n return function () {\n return zone.runGuarded(_callback, this, arguments, source);\n };\n }\n run(callback, applyThis, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n }\n finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runGuarded(callback, applyThis = null, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n }\n catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n }\n finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runTask(task, applyThis, applyArgs) {\n if (task.zone != this) {\n throw new Error('A task can only be run in the zone of creation! (Creation: ' +\n (task.zone || NO_ZONE).name +\n '; Execution: ' +\n this.name +\n ')');\n }\n const zoneTask = task;\n // https://github.com/angular/zone.js/issues/778, sometimes eventTask\n // will run in notScheduled(canceled) state, we should not try to\n // run such kind of task but just return\n const { type, data: { isPeriodic = false, isRefreshable = false } = {} } = task;\n if (task.state === notScheduled && (type === eventTask || type === macroTask)) {\n return;\n }\n const reEntryGuard = task.state != running;\n reEntryGuard && zoneTask._transitionTo(running, scheduled);\n const previousTask = _currentTask;\n _currentTask = zoneTask;\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n if (type == macroTask && task.data && !isPeriodic && !isRefreshable) {\n task.cancelFn = undefined;\n }\n try {\n return this._zoneDelegate.invokeTask(this, zoneTask, applyThis, applyArgs);\n }\n catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n }\n finally {\n // if the task's state is notScheduled or unknown, then it has already been cancelled\n // we should not reset the state to scheduled\n const state = task.state;\n if (state !== notScheduled && state !== unknown) {\n if (type == eventTask || isPeriodic || (isRefreshable && state === scheduling)) {\n reEntryGuard && zoneTask._transitionTo(scheduled, running, scheduling);\n }\n else {\n const zoneDelegates = zoneTask._zoneDelegates;\n this._updateTaskCount(zoneTask, -1);\n reEntryGuard && zoneTask._transitionTo(notScheduled, running, notScheduled);\n if (isRefreshable) {\n zoneTask._zoneDelegates = zoneDelegates;\n }\n }\n }\n _currentZoneFrame = _currentZoneFrame.parent;\n _currentTask = previousTask;\n }\n }\n scheduleTask(task) {\n if (task.zone && task.zone !== this) {\n // check if the task was rescheduled, the newZone\n // should not be the children of the original zone\n let newZone = this;\n while (newZone) {\n if (newZone === task.zone) {\n throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${task.zone.name}`);\n }\n newZone = newZone.parent;\n }\n }\n task._transitionTo(scheduling, notScheduled);\n const zoneDelegates = [];\n task._zoneDelegates = zoneDelegates;\n task._zone = this;\n try {\n task = this._zoneDelegate.scheduleTask(this, task);\n }\n catch (err) {\n // should set task's state to unknown when scheduleTask throw error\n // because the err may from reschedule, so the fromState maybe notScheduled\n task._transitionTo(unknown, scheduling, notScheduled);\n // TODO: @JiaLiPassion, should we check the result from handleError?\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n if (task._zoneDelegates === zoneDelegates) {\n // we have to check because internally the delegate can reschedule the task.\n this._updateTaskCount(task, 1);\n }\n if (task.state == scheduling) {\n task._transitionTo(scheduled, scheduling);\n }\n return task;\n }\n scheduleMicroTask(source, callback, data, customSchedule) {\n return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, undefined));\n }\n scheduleMacroTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));\n }\n scheduleEventTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel));\n }\n cancelTask(task) {\n if (task.zone != this)\n throw new Error('A task can only be cancelled in the zone of creation! (Creation: ' +\n (task.zone || NO_ZONE).name +\n '; Execution: ' +\n this.name +\n ')');\n if (task.state !== scheduled && task.state !== running) {\n return;\n }\n task._transitionTo(canceling, scheduled, running);\n try {\n this._zoneDelegate.cancelTask(this, task);\n }\n catch (err) {\n // if error occurs when cancelTask, transit the state to unknown\n task._transitionTo(unknown, canceling);\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n this._updateTaskCount(task, -1);\n task._transitionTo(notScheduled, canceling);\n task.runCount = -1;\n return task;\n }\n _updateTaskCount(task, count) {\n const zoneDelegates = task._zoneDelegates;\n if (count == -1) {\n task._zoneDelegates = null;\n }\n for (let i = 0; i < zoneDelegates.length; i++) {\n zoneDelegates[i]._updateTaskCount(task.type, count);\n }\n }\n }\n const DELEGATE_ZS = {\n name: '',\n onHasTask: (delegate, _, target, hasTaskState) => delegate.hasTask(target, hasTaskState),\n onScheduleTask: (delegate, _, target, task) => delegate.scheduleTask(target, task),\n onInvokeTask: (delegate, _, target, task, applyThis, applyArgs) => delegate.invokeTask(target, task, applyThis, applyArgs),\n onCancelTask: (delegate, _, target, task) => delegate.cancelTask(target, task),\n };\n class _ZoneDelegate {\n get zone() {\n return this._zone;\n }\n _zone;\n _taskCounts = {\n 'microTask': 0,\n 'macroTask': 0,\n 'eventTask': 0,\n };\n _parentDelegate;\n _forkDlgt;\n _forkZS;\n _forkCurrZone;\n _interceptDlgt;\n _interceptZS;\n _interceptCurrZone;\n _invokeDlgt;\n _invokeZS;\n _invokeCurrZone;\n _handleErrorDlgt;\n _handleErrorZS;\n _handleErrorCurrZone;\n _scheduleTaskDlgt;\n _scheduleTaskZS;\n _scheduleTaskCurrZone;\n _invokeTaskDlgt;\n _invokeTaskZS;\n _invokeTaskCurrZone;\n _cancelTaskDlgt;\n _cancelTaskZS;\n _cancelTaskCurrZone;\n _hasTaskDlgt;\n _hasTaskDlgtOwner;\n _hasTaskZS;\n _hasTaskCurrZone;\n constructor(zone, parentDelegate, zoneSpec) {\n this._zone = zone;\n this._parentDelegate = parentDelegate;\n this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS);\n this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt);\n this._forkCurrZone =\n zoneSpec && (zoneSpec.onFork ? this._zone : parentDelegate._forkCurrZone);\n this._interceptZS =\n zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS);\n this._interceptDlgt =\n zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt);\n this._interceptCurrZone =\n zoneSpec && (zoneSpec.onIntercept ? this._zone : parentDelegate._interceptCurrZone);\n this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS);\n this._invokeDlgt =\n zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt);\n this._invokeCurrZone =\n zoneSpec && (zoneSpec.onInvoke ? this._zone : parentDelegate._invokeCurrZone);\n this._handleErrorZS =\n zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS);\n this._handleErrorDlgt =\n zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt);\n this._handleErrorCurrZone =\n zoneSpec && (zoneSpec.onHandleError ? this._zone : parentDelegate._handleErrorCurrZone);\n this._scheduleTaskZS =\n zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);\n this._scheduleTaskDlgt =\n zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);\n this._scheduleTaskCurrZone =\n zoneSpec && (zoneSpec.onScheduleTask ? this._zone : parentDelegate._scheduleTaskCurrZone);\n this._invokeTaskZS =\n zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS);\n this._invokeTaskDlgt =\n zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt);\n this._invokeTaskCurrZone =\n zoneSpec && (zoneSpec.onInvokeTask ? this._zone : parentDelegate._invokeTaskCurrZone);\n this._cancelTaskZS =\n zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS);\n this._cancelTaskDlgt =\n zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt);\n this._cancelTaskCurrZone =\n zoneSpec && (zoneSpec.onCancelTask ? this._zone : parentDelegate._cancelTaskCurrZone);\n this._hasTaskZS = null;\n this._hasTaskDlgt = null;\n this._hasTaskDlgtOwner = null;\n this._hasTaskCurrZone = null;\n const zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask;\n const parentHasTask = parentDelegate && parentDelegate._hasTaskZS;\n if (zoneSpecHasTask || parentHasTask) {\n // If we need to report hasTask, than this ZS needs to do ref counting on tasks. In such\n // a case all task related interceptors must go through this ZD. We can't short circuit it.\n this._hasTaskZS = zoneSpecHasTask ? zoneSpec : DELEGATE_ZS;\n this._hasTaskDlgt = parentDelegate;\n this._hasTaskDlgtOwner = this;\n this._hasTaskCurrZone = this._zone;\n if (!zoneSpec.onScheduleTask) {\n this._scheduleTaskZS = DELEGATE_ZS;\n this._scheduleTaskDlgt = parentDelegate;\n this._scheduleTaskCurrZone = this._zone;\n }\n if (!zoneSpec.onInvokeTask) {\n this._invokeTaskZS = DELEGATE_ZS;\n this._invokeTaskDlgt = parentDelegate;\n this._invokeTaskCurrZone = this._zone;\n }\n if (!zoneSpec.onCancelTask) {\n this._cancelTaskZS = DELEGATE_ZS;\n this._cancelTaskDlgt = parentDelegate;\n this._cancelTaskCurrZone = this._zone;\n }\n }\n }\n fork(targetZone, zoneSpec) {\n return this._forkZS\n ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec)\n : new ZoneImpl(targetZone, zoneSpec);\n }\n intercept(targetZone, callback, source) {\n return this._interceptZS\n ? this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source)\n : callback;\n }\n invoke(targetZone, callback, applyThis, applyArgs, source) {\n return this._invokeZS\n ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source)\n : callback.apply(applyThis, applyArgs);\n }\n handleError(targetZone, error) {\n return this._handleErrorZS\n ? this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error)\n : true;\n }\n scheduleTask(targetZone, task) {\n let returnTask = task;\n if (this._scheduleTaskZS) {\n if (this._hasTaskZS) {\n returnTask._zoneDelegates.push(this._hasTaskDlgtOwner);\n }\n returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task);\n if (!returnTask)\n returnTask = task;\n }\n else {\n if (task.scheduleFn) {\n task.scheduleFn(task);\n }\n else if (task.type == microTask) {\n scheduleMicroTask(task);\n }\n else {\n throw new Error('Task is missing scheduleFn.');\n }\n }\n return returnTask;\n }\n invokeTask(targetZone, task, applyThis, applyArgs) {\n return this._invokeTaskZS\n ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs)\n : task.callback.apply(applyThis, applyArgs);\n }\n cancelTask(targetZone, task) {\n let value;\n if (this._cancelTaskZS) {\n value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task);\n }\n else {\n if (!task.cancelFn) {\n throw Error('Task is not cancelable');\n }\n value = task.cancelFn(task);\n }\n return value;\n }\n hasTask(targetZone, isEmpty) {\n // hasTask should not throw error so other ZoneDelegate\n // can still trigger hasTask callback\n try {\n this._hasTaskZS &&\n this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);\n }\n catch (err) {\n this.handleError(targetZone, err);\n }\n }\n _updateTaskCount(type, count) {\n const counts = this._taskCounts;\n const prev = counts[type];\n const next = (counts[type] = prev + count);\n if (next < 0) {\n throw new Error('More tasks executed then were scheduled.');\n }\n if (prev == 0 || next == 0) {\n const isEmpty = {\n microTask: counts['microTask'] > 0,\n macroTask: counts['macroTask'] > 0,\n eventTask: counts['eventTask'] > 0,\n change: type,\n };\n this.hasTask(this._zone, isEmpty);\n }\n }\n }\n class ZoneTask {\n type;\n source;\n invoke;\n callback;\n data;\n scheduleFn;\n cancelFn;\n _zone = null;\n runCount = 0;\n _zoneDelegates = null;\n _state = 'notScheduled';\n constructor(type, source, callback, options, scheduleFn, cancelFn) {\n this.type = type;\n this.source = source;\n this.data = options;\n this.scheduleFn = scheduleFn;\n this.cancelFn = cancelFn;\n if (!callback) {\n throw new Error('callback is not defined');\n }\n this.callback = callback;\n const self = this;\n // TODO: @JiaLiPassion options should have interface\n if (type === eventTask && options && options.useG) {\n this.invoke = ZoneTask.invokeTask;\n }\n else {\n this.invoke = function () {\n return ZoneTask.invokeTask.call(global, self, this, arguments);\n };\n }\n }\n static invokeTask(task, target, args) {\n if (!task) {\n task = this;\n }\n _numberOfNestedTaskFrames++;\n try {\n task.runCount++;\n return task.zone.runTask(task, target, args);\n }\n finally {\n if (_numberOfNestedTaskFrames == 1) {\n drainMicroTaskQueue();\n }\n _numberOfNestedTaskFrames--;\n }\n }\n get zone() {\n return this._zone;\n }\n get state() {\n return this._state;\n }\n cancelScheduleRequest() {\n this._transitionTo(notScheduled, scheduling);\n }\n _transitionTo(toState, fromState1, fromState2) {\n if (this._state === fromState1 || this._state === fromState2) {\n this._state = toState;\n if (toState == notScheduled) {\n this._zoneDelegates = null;\n }\n }\n else {\n throw new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? \" or '\" + fromState2 + \"'\" : ''}, was '${this._state}'.`);\n }\n }\n toString() {\n if (this.data && typeof this.data.handleId !== 'undefined') {\n return this.data.handleId.toString();\n }\n else {\n return Object.prototype.toString.call(this);\n }\n }\n // add toJSON method to prevent cyclic error when\n // call JSON.stringify(zoneTask)\n toJSON() {\n return {\n type: this.type,\n state: this.state,\n source: this.source,\n zone: this.zone.name,\n runCount: this.runCount,\n };\n }\n }\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n /// MICROTASK QUEUE\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n const symbolSetTimeout = __symbol__('setTimeout');\n const symbolPromise = __symbol__('Promise');\n const symbolThen = __symbol__('then');\n let _microTaskQueue = [];\n let _isDrainingMicrotaskQueue = false;\n let nativeMicroTaskQueuePromise;\n function nativeScheduleMicroTask(func) {\n if (!nativeMicroTaskQueuePromise) {\n if (global[symbolPromise]) {\n nativeMicroTaskQueuePromise = global[symbolPromise].resolve(0);\n }\n }\n if (nativeMicroTaskQueuePromise) {\n let nativeThen = nativeMicroTaskQueuePromise[symbolThen];\n if (!nativeThen) {\n // native Promise is not patchable, we need to use `then` directly\n // issue 1078\n nativeThen = nativeMicroTaskQueuePromise['then'];\n }\n nativeThen.call(nativeMicroTaskQueuePromise, func);\n }\n else {\n global[symbolSetTimeout](func, 0);\n }\n }\n function scheduleMicroTask(task) {\n // if we are not running in any task, and there has not been anything scheduled\n // we must bootstrap the initial task creation by manually scheduling the drain\n if (_numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0) {\n // We are not running in Task, so we need to kickstart the microtask queue.\n nativeScheduleMicroTask(drainMicroTaskQueue);\n }\n task && _microTaskQueue.push(task);\n }\n function drainMicroTaskQueue() {\n if (!_isDrainingMicrotaskQueue) {\n _isDrainingMicrotaskQueue = true;\n while (_microTaskQueue.length) {\n const queue = _microTaskQueue;\n _microTaskQueue = [];\n for (let i = 0; i < queue.length; i++) {\n const task = queue[i];\n try {\n task.zone.runTask(task, null, null);\n }\n catch (error) {\n _api.onUnhandledError(error);\n }\n }\n }\n _api.microtaskDrainDone();\n _isDrainingMicrotaskQueue = false;\n }\n }\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n /// BOOTSTRAP\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n const NO_ZONE = { name: 'NO ZONE' };\n const notScheduled = 'notScheduled', scheduling = 'scheduling', scheduled = 'scheduled', running = 'running', canceling = 'canceling', unknown = 'unknown';\n const microTask = 'microTask', macroTask = 'macroTask', eventTask = 'eventTask';\n const patches = {};\n const _api = {\n symbol: __symbol__,\n currentZoneFrame: () => _currentZoneFrame,\n onUnhandledError: noop,\n microtaskDrainDone: noop,\n scheduleMicroTask: scheduleMicroTask,\n showUncaughtError: () => !ZoneImpl[__symbol__('ignoreConsoleErrorUncaughtError')],\n patchEventTarget: () => [],\n patchOnProperties: noop,\n patchMethod: () => noop,\n bindArguments: () => [],\n patchThen: () => noop,\n patchMacroTask: () => noop,\n patchEventPrototype: () => noop,\n isIEOrEdge: () => false,\n getGlobalObjects: () => undefined,\n ObjectDefineProperty: () => noop,\n ObjectGetOwnPropertyDescriptor: () => undefined,\n ObjectCreate: () => undefined,\n ArraySlice: () => [],\n patchClass: () => noop,\n wrapWithCurrentZone: () => noop,\n filterProperties: () => [],\n attachOriginToPatched: () => noop,\n _redefineProperty: () => noop,\n patchCallbacks: () => noop,\n nativeScheduleMicroTask: nativeScheduleMicroTask,\n };\n let _currentZoneFrame = { parent: null, zone: new ZoneImpl(null, null) };\n let _currentTask = null;\n let _numberOfNestedTaskFrames = 0;\n function noop() { }\n performanceMeasure('Zone', 'Zone');\n return ZoneImpl;\n}\n\nfunction loadZone() {\n // if global['Zone'] already exists (maybe zone.js was already loaded or\n // some other lib also registered a global object named Zone), we may need\n // to throw an error, but sometimes user may not want this error.\n // For example,\n // we have two web pages, page1 includes zone.js, page2 doesn't.\n // and the 1st time user load page1 and page2, everything work fine,\n // but when user load page2 again, error occurs because global['Zone'] already exists.\n // so we add a flag to let user choose whether to throw this error or not.\n // By default, if existing Zone is from zone.js, we will not throw the error.\n const global = globalThis;\n const checkDuplicate = global[__symbol__('forceDuplicateZoneCheck')] === true;\n if (global['Zone'] && (checkDuplicate || typeof global['Zone'].__symbol__ !== 'function')) {\n throw new Error('Zone already loaded.');\n }\n // Initialize global `Zone` constant.\n global['Zone'] ??= initZone();\n return global['Zone'];\n}\n\n/**\n * Suppress closure compiler errors about unknown 'Zone' variable\n * @fileoverview\n * @suppress {undefinedVars,globalThis,missingRequire}\n */\n/// \n// issue #989, to reduce bundle size, use short name\n/** Object.getOwnPropertyDescriptor */\nconst ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n/** Object.defineProperty */\nconst ObjectDefineProperty = Object.defineProperty;\n/** Object.getPrototypeOf */\nconst ObjectGetPrototypeOf = Object.getPrototypeOf;\n/** Object.create */\nconst ObjectCreate = Object.create;\n/** Array.prototype.slice */\nconst ArraySlice = Array.prototype.slice;\n/** addEventListener string const */\nconst ADD_EVENT_LISTENER_STR = 'addEventListener';\n/** removeEventListener string const */\nconst REMOVE_EVENT_LISTENER_STR = 'removeEventListener';\n/** zoneSymbol addEventListener */\nconst ZONE_SYMBOL_ADD_EVENT_LISTENER = __symbol__(ADD_EVENT_LISTENER_STR);\n/** zoneSymbol removeEventListener */\nconst ZONE_SYMBOL_REMOVE_EVENT_LISTENER = __symbol__(REMOVE_EVENT_LISTENER_STR);\n/** true string const */\nconst TRUE_STR = 'true';\n/** false string const */\nconst FALSE_STR = 'false';\n/** Zone symbol prefix string const. */\nconst ZONE_SYMBOL_PREFIX = __symbol__('');\nfunction wrapWithCurrentZone(callback, source) {\n return Zone.current.wrap(callback, source);\n}\nfunction scheduleMacroTaskWithCurrentZone(source, callback, data, customSchedule, customCancel) {\n return Zone.current.scheduleMacroTask(source, callback, data, customSchedule, customCancel);\n}\nconst zoneSymbol = __symbol__;\nconst isWindowExists = typeof window !== 'undefined';\nconst internalWindow = isWindowExists ? window : undefined;\nconst _global = (isWindowExists && internalWindow) || globalThis;\nconst REMOVE_ATTRIBUTE = 'removeAttribute';\nfunction bindArguments(args, source) {\n for (let i = args.length - 1; i >= 0; i--) {\n if (typeof args[i] === 'function') {\n args[i] = wrapWithCurrentZone(args[i], source + '_' + i);\n }\n }\n return args;\n}\nfunction patchPrototype(prototype, fnNames) {\n const source = prototype.constructor['name'];\n for (let i = 0; i < fnNames.length; i++) {\n const name = fnNames[i];\n const delegate = prototype[name];\n if (delegate) {\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, name);\n if (!isPropertyWritable(prototypeDesc)) {\n continue;\n }\n prototype[name] = ((delegate) => {\n const patched = function () {\n return delegate.apply(this, bindArguments(arguments, source + '.' + name));\n };\n attachOriginToPatched(patched, delegate);\n return patched;\n })(delegate);\n }\n }\n}\nfunction isPropertyWritable(propertyDesc) {\n if (!propertyDesc) {\n return true;\n }\n if (propertyDesc.writable === false) {\n return false;\n }\n return !(typeof propertyDesc.get === 'function' && typeof propertyDesc.set === 'undefined');\n}\nconst isWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope;\n// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify\n// this code.\nconst isNode = !('nw' in _global) &&\n typeof _global.process !== 'undefined' &&\n _global.process.toString() === '[object process]';\nconst isBrowser = !isNode && !isWebWorker && !!(isWindowExists && internalWindow['HTMLElement']);\n// we are in electron of nw, so we are both browser and nodejs\n// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify\n// this code.\nconst isMix = typeof _global.process !== 'undefined' &&\n _global.process.toString() === '[object process]' &&\n !isWebWorker &&\n !!(isWindowExists && internalWindow['HTMLElement']);\nconst zoneSymbolEventNames$1 = {};\nconst enableBeforeunloadSymbol = zoneSymbol('enable_beforeunload');\nconst wrapFn = function (event) {\n // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n // event will be undefined, so we need to use window.event\n event = event || _global.event;\n if (!event) {\n return;\n }\n let eventNameSymbol = zoneSymbolEventNames$1[event.type];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames$1[event.type] = zoneSymbol('ON_PROPERTY' + event.type);\n }\n const target = this || event.target || _global;\n const listener = target[eventNameSymbol];\n let result;\n if (isBrowser && target === internalWindow && event.type === 'error') {\n // window.onerror have different signature\n // https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror\n // and onerror callback will prevent default when callback return true\n const errorEvent = event;\n result =\n listener &&\n listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error);\n if (result === true) {\n event.preventDefault();\n }\n }\n else {\n result = listener && listener.apply(this, arguments);\n if (\n // https://github.com/angular/angular/issues/47579\n // https://www.w3.org/TR/2011/WD-html5-20110525/history.html#beforeunloadevent\n // This is the only specific case we should check for. The spec defines that the\n // `returnValue` attribute represents the message to show the user. When the event\n // is created, this attribute must be set to the empty string.\n event.type === 'beforeunload' &&\n // To prevent any breaking changes resulting from this change, given that\n // it was already causing a significant number of failures in G3, we have hidden\n // that behavior behind a global configuration flag. Consumers can enable this\n // flag explicitly if they want the `beforeunload` event to be handled as defined\n // in the specification.\n _global[enableBeforeunloadSymbol] &&\n // The IDL event definition is `attribute DOMString returnValue`, so we check whether\n // `typeof result` is a string.\n typeof result === 'string') {\n event.returnValue = result;\n }\n else if (result != undefined && !result) {\n event.preventDefault();\n }\n }\n return result;\n};\nfunction patchProperty(obj, prop, prototype) {\n let desc = ObjectGetOwnPropertyDescriptor(obj, prop);\n if (!desc && prototype) {\n // when patch window object, use prototype to check prop exist or not\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, prop);\n if (prototypeDesc) {\n desc = { enumerable: true, configurable: true };\n }\n }\n // if the descriptor not exists or is not configurable\n // just return\n if (!desc || !desc.configurable) {\n return;\n }\n const onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched');\n if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {\n return;\n }\n // A property descriptor cannot have getter/setter and be writable\n // deleting the writable and value properties avoids this error:\n //\n // TypeError: property descriptors must not specify a value or be writable when a\n // getter or setter has been specified\n delete desc.writable;\n delete desc.value;\n const originalDescGet = desc.get;\n const originalDescSet = desc.set;\n // slice(2) cuz 'onclick' -> 'click', etc\n const eventName = prop.slice(2);\n let eventNameSymbol = zoneSymbolEventNames$1[eventName];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames$1[eventName] = zoneSymbol('ON_PROPERTY' + eventName);\n }\n desc.set = function (newValue) {\n // In some versions of Windows, the `this` context may be undefined\n // in on-property callbacks.\n // To handle this edge case, we check if `this` is falsy and\n // fallback to `_global` if needed.\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return;\n }\n const previousValue = target[eventNameSymbol];\n if (typeof previousValue === 'function') {\n target.removeEventListener(eventName, wrapFn);\n }\n // https://github.com/angular/zone.js/issues/978\n // If an inline handler (like `onload`) was defined before zone.js was loaded,\n // call the original descriptor's setter to clean it up.\n originalDescSet?.call(target, null);\n target[eventNameSymbol] = newValue;\n if (typeof newValue === 'function') {\n target.addEventListener(eventName, wrapFn, false);\n }\n };\n // The getter would return undefined for unassigned properties but the default value of an\n // unassigned property is null\n desc.get = function () {\n // in some of windows's onproperty callback, this is undefined\n // so we need to check it\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return null;\n }\n const listener = target[eventNameSymbol];\n if (listener) {\n return listener;\n }\n else if (originalDescGet) {\n // result will be null when use inline event attribute,\n // such as \n // because the onclick function is internal raw uncompiled handler\n // the onclick will be evaluated when first time event was triggered or\n // the property is accessed, https://github.com/angular/zone.js/issues/525\n // so we should use original native get to retrieve the handler\n let value = originalDescGet.call(this);\n if (value) {\n desc.set.call(this, value);\n if (typeof target[REMOVE_ATTRIBUTE] === 'function') {\n target.removeAttribute(prop);\n }\n return value;\n }\n }\n return null;\n };\n ObjectDefineProperty(obj, prop, desc);\n obj[onPropPatchedSymbol] = true;\n}\nfunction patchOnProperties(obj, properties, prototype) {\n if (properties) {\n for (let i = 0; i < properties.length; i++) {\n patchProperty(obj, 'on' + properties[i], prototype);\n }\n }\n else {\n const onProperties = [];\n for (const prop in obj) {\n if (prop.slice(0, 2) == 'on') {\n onProperties.push(prop);\n }\n }\n for (let j = 0; j < onProperties.length; j++) {\n patchProperty(obj, onProperties[j], prototype);\n }\n }\n}\nconst originalInstanceKey = zoneSymbol('originalInstance');\n// wrap some native API on `window`\nfunction patchClass(className) {\n const OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n // keep original class in global\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function () {\n const a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n // attach original delegate to patched function\n attachOriginToPatched(_global[className], OriginalClass);\n const instance = new OriginalClass(function () { });\n let prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);\n // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n },\n });\n }\n })(prop);\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}\nfunction patchMethod(target, name, patchFn) {\n let proto = target;\n while (proto && !proto.hasOwnProperty(name)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && target[name]) {\n // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n proto = target;\n }\n const delegateName = zoneSymbol(name);\n let delegate = null;\n if (proto && (!(delegate = proto[delegateName]) || !proto.hasOwnProperty(delegateName))) {\n delegate = proto[delegateName] = proto[name];\n // check whether proto[name] is writable\n // some property is readonly in safari, such as HtmlCanvasElement.prototype.toBlob\n const desc = proto && ObjectGetOwnPropertyDescriptor(proto, name);\n if (isPropertyWritable(desc)) {\n const patchDelegate = patchFn(delegate, delegateName, name);\n proto[name] = function () {\n return patchDelegate(this, arguments);\n };\n attachOriginToPatched(proto[name], delegate);\n }\n }\n return delegate;\n}\n// TODO: @JiaLiPassion, support cancel task later if necessary\nfunction patchMacroTask(obj, funcName, metaCreator) {\n let setNative = null;\n function scheduleTask(task) {\n const data = task.data;\n data.args[data.cbIdx] = function () {\n task.invoke.apply(this, arguments);\n };\n setNative.apply(data.target, data.args);\n return task;\n }\n setNative = patchMethod(obj, funcName, (delegate) => function (self, args) {\n const meta = metaCreator(self, args);\n if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') {\n return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask);\n }\n else {\n // cause an error by calling it directly.\n return delegate.apply(self, args);\n }\n });\n}\nfunction attachOriginToPatched(patched, original) {\n patched[zoneSymbol('OriginalDelegate')] = original;\n}\nlet isDetectedIEOrEdge = false;\nlet ieOrEdge = false;\nfunction isIEOrEdge() {\n if (isDetectedIEOrEdge) {\n return ieOrEdge;\n }\n isDetectedIEOrEdge = true;\n try {\n const ua = internalWindow.navigator.userAgent;\n if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1 || ua.indexOf('Edge/') !== -1) {\n ieOrEdge = true;\n }\n }\n catch (error) { }\n return ieOrEdge;\n}\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isNumber(value) {\n return typeof value === 'number';\n}\n\n/**\n * @fileoverview\n * @suppress {missingRequire}\n */\n// an identifier to tell ZoneTask do not create a new invoke closure\nconst OPTIMIZED_ZONE_EVENT_TASK_DATA = {\n useG: true,\n};\nconst zoneSymbolEventNames = {};\nconst globalSources = {};\nconst EVENT_NAME_SYMBOL_REGX = new RegExp('^' + ZONE_SYMBOL_PREFIX + '(\\\\w+)(true|false)$');\nconst IMMEDIATE_PROPAGATION_SYMBOL = zoneSymbol('propagationStopped');\nfunction prepareEventNames(eventName, eventNameToString) {\n const falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR;\n const trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR;\n const symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n zoneSymbolEventNames[eventName] = {};\n zoneSymbolEventNames[eventName][FALSE_STR] = symbol;\n zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture;\n}\nfunction patchEventTarget(_global, api, apis, patchOptions) {\n const ADD_EVENT_LISTENER = (patchOptions && patchOptions.add) || ADD_EVENT_LISTENER_STR;\n const REMOVE_EVENT_LISTENER = (patchOptions && patchOptions.rm) || REMOVE_EVENT_LISTENER_STR;\n const LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.listeners) || 'eventListeners';\n const REMOVE_ALL_LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.rmAll) || 'removeAllListeners';\n const zoneSymbolAddEventListener = zoneSymbol(ADD_EVENT_LISTENER);\n const ADD_EVENT_LISTENER_SOURCE = '.' + ADD_EVENT_LISTENER + ':';\n const PREPEND_EVENT_LISTENER = 'prependListener';\n const PREPEND_EVENT_LISTENER_SOURCE = '.' + PREPEND_EVENT_LISTENER + ':';\n const invokeTask = function (task, target, event) {\n // for better performance, check isRemoved which is set\n // by removeEventListener\n if (task.isRemoved) {\n return;\n }\n const delegate = task.callback;\n if (typeof delegate === 'object' && delegate.handleEvent) {\n // create the bind version of handleEvent when invoke\n task.callback = (event) => delegate.handleEvent(event);\n task.originalDelegate = delegate;\n }\n // invoke static task.invoke\n // need to try/catch error here, otherwise, the error in one event listener\n // will break the executions of the other event listeners. Also error will\n // not remove the event listener when `once` options is true.\n let error;\n try {\n task.invoke(task, target, [event]);\n }\n catch (err) {\n error = err;\n }\n const options = task.options;\n if (options && typeof options === 'object' && options.once) {\n // if options.once is true, after invoke once remove listener here\n // only browser need to do this, nodejs eventEmitter will cal removeListener\n // inside EventEmitter.once\n const delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n target[REMOVE_EVENT_LISTENER].call(target, event.type, delegate, options);\n }\n return error;\n };\n function globalCallback(context, event, isCapture) {\n // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n // event will be undefined, so we need to use window.event\n event = event || _global.event;\n if (!event) {\n return;\n }\n // event.target is needed for Samsung TV and SourceBuffer\n // || global is needed https://github.com/angular/zone.js/issues/190\n const target = context || event.target || _global;\n const tasks = target[zoneSymbolEventNames[event.type][isCapture ? TRUE_STR : FALSE_STR]];\n if (tasks) {\n const errors = [];\n // invoke all tasks which attached to current target with given event.type and capture = false\n // for performance concern, if task.length === 1, just invoke\n if (tasks.length === 1) {\n const err = invokeTask(tasks[0], target, event);\n err && errors.push(err);\n }\n else {\n // https://github.com/angular/zone.js/issues/836\n // copy the tasks array before invoke, to avoid\n // the callback will remove itself or other listener\n const copyTasks = tasks.slice();\n for (let i = 0; i < copyTasks.length; i++) {\n if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) {\n break;\n }\n const err = invokeTask(copyTasks[i], target, event);\n err && errors.push(err);\n }\n }\n // Since there is only one error, we don't need to schedule microTask\n // to throw the error.\n if (errors.length === 1) {\n throw errors[0];\n }\n else {\n for (let i = 0; i < errors.length; i++) {\n const err = errors[i];\n api.nativeScheduleMicroTask(() => {\n throw err;\n });\n }\n }\n }\n }\n // global shared zoneAwareCallback to handle all event callback with capture = false\n const globalZoneAwareCallback = function (event) {\n return globalCallback(this, event, false);\n };\n // global shared zoneAwareCallback to handle all event callback with capture = true\n const globalZoneAwareCaptureCallback = function (event) {\n return globalCallback(this, event, true);\n };\n function patchEventTargetMethods(obj, patchOptions) {\n if (!obj) {\n return false;\n }\n let useGlobalCallback = true;\n if (patchOptions && patchOptions.useG !== undefined) {\n useGlobalCallback = patchOptions.useG;\n }\n const validateHandler = patchOptions && patchOptions.vh;\n let checkDuplicate = true;\n if (patchOptions && patchOptions.chkDup !== undefined) {\n checkDuplicate = patchOptions.chkDup;\n }\n let returnTarget = false;\n if (patchOptions && patchOptions.rt !== undefined) {\n returnTarget = patchOptions.rt;\n }\n let proto = obj;\n while (proto && !proto.hasOwnProperty(ADD_EVENT_LISTENER)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && obj[ADD_EVENT_LISTENER]) {\n // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n proto = obj;\n }\n if (!proto) {\n return false;\n }\n if (proto[zoneSymbolAddEventListener]) {\n return false;\n }\n const eventNameToString = patchOptions && patchOptions.eventNameToString;\n // We use a shared global `taskData` to pass data for `scheduleEventTask`,\n // eliminating the need to create a new object solely for passing data.\n // WARNING: This object has a static lifetime, meaning it is not created\n // each time `addEventListener` is called. It is instantiated only once\n // and captured by reference inside the `addEventListener` and\n // `removeEventListener` functions. Do not add any new properties to this\n // object, as doing so would necessitate maintaining the information\n // between `addEventListener` calls.\n const taskData = {};\n const nativeAddEventListener = (proto[zoneSymbolAddEventListener] = proto[ADD_EVENT_LISTENER]);\n const nativeRemoveEventListener = (proto[zoneSymbol(REMOVE_EVENT_LISTENER)] =\n proto[REMOVE_EVENT_LISTENER]);\n const nativeListeners = (proto[zoneSymbol(LISTENERS_EVENT_LISTENER)] =\n proto[LISTENERS_EVENT_LISTENER]);\n const nativeRemoveAllListeners = (proto[zoneSymbol(REMOVE_ALL_LISTENERS_EVENT_LISTENER)] =\n proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER]);\n let nativePrependEventListener;\n if (patchOptions && patchOptions.prepend) {\n nativePrependEventListener = proto[zoneSymbol(patchOptions.prepend)] =\n proto[patchOptions.prepend];\n }\n /**\n * This util function will build an option object with passive option\n * to handle all possible input from the user.\n */\n function buildEventListenerOptions(options, passive) {\n if (!passive) {\n return options;\n }\n if (typeof options === 'boolean') {\n return { capture: options, passive: true };\n }\n if (!options) {\n return { passive: true };\n }\n if (typeof options === 'object' && options.passive !== false) {\n return { ...options, passive: true };\n }\n return options;\n }\n const customScheduleGlobal = function (task) {\n // if there is already a task for the eventName + capture,\n // just return, because we use the shared globalZoneAwareCallback here.\n if (taskData.isExisting) {\n return;\n }\n return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options);\n };\n /**\n * In the context of events and listeners, this function will be\n * called at the end by `cancelTask`, which, in turn, calls `task.cancelFn`.\n * Cancelling a task is primarily used to remove event listeners from\n * the task target.\n */\n const customCancelGlobal = function (task) {\n // if task is not marked as isRemoved, this call is directly\n // from Zone.prototype.cancelTask, we should remove the task\n // from tasksList of target first\n if (!task.isRemoved) {\n const symbolEventNames = zoneSymbolEventNames[task.eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[task.capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && task.target[symbolEventName];\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (existingTask === task) {\n existingTasks.splice(i, 1);\n // set isRemoved to data for faster invokeTask check\n task.isRemoved = true;\n if (task.removeAbortListener) {\n task.removeAbortListener();\n task.removeAbortListener = null;\n }\n if (existingTasks.length === 0) {\n // all tasks for the eventName + capture have gone,\n // remove globalZoneAwareCallback and remove the task cache from target\n task.allRemoved = true;\n task.target[symbolEventName] = null;\n }\n break;\n }\n }\n }\n }\n // if all tasks for the eventName + capture have gone,\n // we will really remove the global event callback,\n // if not, return\n if (!task.allRemoved) {\n return;\n }\n return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);\n };\n const customScheduleNonGlobal = function (task) {\n return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customSchedulePrepend = function (task) {\n return nativePrependEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customCancelNonGlobal = function (task) {\n return nativeRemoveEventListener.call(task.target, task.eventName, task.invoke, task.options);\n };\n const customSchedule = useGlobalCallback ? customScheduleGlobal : customScheduleNonGlobal;\n const customCancel = useGlobalCallback ? customCancelGlobal : customCancelNonGlobal;\n const compareTaskCallbackVsDelegate = function (task, delegate) {\n const typeOfDelegate = typeof delegate;\n return ((typeOfDelegate === 'function' && task.callback === delegate) ||\n (typeOfDelegate === 'object' && task.originalDelegate === delegate));\n };\n const compare = patchOptions?.diff || compareTaskCallbackVsDelegate;\n const unpatchedEvents = Zone[zoneSymbol('UNPATCHED_EVENTS')];\n const passiveEvents = _global[zoneSymbol('PASSIVE_EVENTS')];\n function copyEventListenerOptions(options) {\n if (typeof options === 'object' && options !== null) {\n // We need to destructure the target `options` object since it may\n // be frozen or sealed (possibly provided implicitly by a third-party\n // library), or its properties may be readonly.\n const newOptions = { ...options };\n // The `signal` option was recently introduced, which caused regressions in\n // third-party scenarios where `AbortController` was directly provided to\n // `addEventListener` as options. For instance, in cases like\n // `document.addEventListener('keydown', callback, abortControllerInstance)`,\n // which is valid because `AbortController` includes a `signal` getter, spreading\n // `{...options}` wouldn't copy the `signal`. Additionally, using `Object.create`\n // isn't feasible since `AbortController` is a built-in object type, and attempting\n // to create a new object directly with it as the prototype might result in\n // unexpected behavior.\n if (options.signal) {\n newOptions.signal = options.signal;\n }\n return newOptions;\n }\n return options;\n }\n const makeAddListener = function (nativeListener, addSource, customScheduleFn, customCancelFn, returnTarget = false, prepend = false) {\n return function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n let delegate = arguments[1];\n if (!delegate) {\n return nativeListener.apply(this, arguments);\n }\n if (isNode && eventName === 'uncaughtException') {\n // don't patch uncaughtException of nodejs to prevent endless loop\n return nativeListener.apply(this, arguments);\n }\n // To improve `addEventListener` performance, we will create the callback\n // for the task later when the task is invoked.\n let isEventListenerObject = false;\n if (typeof delegate !== 'function') {\n // This checks whether the provided listener argument is an object with\n // a `handleEvent` method (since we can call `addEventListener` with a\n // function `event => ...` or with an object `{ handleEvent: event => ... }`).\n if (!delegate.handleEvent) {\n return nativeListener.apply(this, arguments);\n }\n isEventListenerObject = true;\n }\n if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) {\n return;\n }\n const passive = !!passiveEvents && passiveEvents.indexOf(eventName) !== -1;\n const options = copyEventListenerOptions(buildEventListenerOptions(arguments[2], passive));\n const signal = options?.signal;\n if (signal?.aborted) {\n // the signal is an aborted one, just return without attaching the event listener.\n return;\n }\n if (unpatchedEvents) {\n // check unpatched list\n for (let i = 0; i < unpatchedEvents.length; i++) {\n if (eventName === unpatchedEvents[i]) {\n if (passive) {\n return nativeListener.call(target, eventName, delegate, options);\n }\n else {\n return nativeListener.apply(this, arguments);\n }\n }\n }\n }\n const capture = !options ? false : typeof options === 'boolean' ? true : options.capture;\n const once = options && typeof options === 'object' ? options.once : false;\n const zone = Zone.current;\n let symbolEventNames = zoneSymbolEventNames[eventName];\n if (!symbolEventNames) {\n prepareEventNames(eventName, eventNameToString);\n symbolEventNames = zoneSymbolEventNames[eventName];\n }\n const symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n let existingTasks = target[symbolEventName];\n let isExisting = false;\n if (existingTasks) {\n // already have task registered\n isExisting = true;\n if (checkDuplicate) {\n for (let i = 0; i < existingTasks.length; i++) {\n if (compare(existingTasks[i], delegate)) {\n // same callback, same capture, same event name, just return\n return;\n }\n }\n }\n }\n else {\n existingTasks = target[symbolEventName] = [];\n }\n let source;\n const constructorName = target.constructor['name'];\n const targetSource = globalSources[constructorName];\n if (targetSource) {\n source = targetSource[eventName];\n }\n if (!source) {\n source =\n constructorName +\n addSource +\n (eventNameToString ? eventNameToString(eventName) : eventName);\n }\n // In the code below, `options` should no longer be reassigned; instead, it\n // should only be mutated. This is because we pass that object to the native\n // `addEventListener`.\n // It's generally recommended to use the same object reference for options.\n // This ensures consistency and avoids potential issues.\n taskData.options = options;\n if (once) {\n // When using `addEventListener` with the `once` option, we don't pass\n // the `once` option directly to the native `addEventListener` method.\n // Instead, we keep the `once` setting and handle it ourselves.\n taskData.options.once = false;\n }\n taskData.target = target;\n taskData.capture = capture;\n taskData.eventName = eventName;\n taskData.isExisting = isExisting;\n const data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : undefined;\n // keep taskData into data to allow onScheduleEventTask to access the task information\n if (data) {\n data.taskData = taskData;\n }\n if (signal) {\n // When using `addEventListener` with the `signal` option, we don't pass\n // the `signal` option directly to the native `addEventListener` method.\n // Instead, we keep the `signal` setting and handle it ourselves.\n taskData.options.signal = undefined;\n }\n // The `scheduleEventTask` function will ultimately call `customScheduleGlobal`,\n // which in turn calls the native `addEventListener`. This is why `taskData.options`\n // is updated before scheduling the task, as `customScheduleGlobal` uses\n // `taskData.options` to pass it to the native `addEventListener`.\n const task = zone.scheduleEventTask(source, delegate, data, customScheduleFn, customCancelFn);\n if (signal) {\n // after task is scheduled, we need to store the signal back to task.options\n taskData.options.signal = signal;\n // Wrapping `task` in a weak reference would not prevent memory leaks. Weak references are\n // primarily used for preventing strong references cycles. `onAbort` is always reachable\n // as it's an event listener, so its closure retains a strong reference to the `task`.\n const onAbort = () => task.zone.cancelTask(task);\n nativeListener.call(signal, 'abort', onAbort, { once: true });\n // We need to remove the `abort` listener when the event listener is going to be removed,\n // as it creates a closure that captures `task`. This closure retains a reference to the\n // `task` object even after it goes out of scope, preventing `task` from being garbage\n // collected.\n task.removeAbortListener = () => signal.removeEventListener('abort', onAbort);\n }\n // should clear taskData.target to avoid memory leak\n // issue, https://github.com/angular/angular/issues/20442\n taskData.target = null;\n // need to clear up taskData because it is a global object\n if (data) {\n data.taskData = null;\n }\n // have to save those information to task in case\n // application may call task.zone.cancelTask() directly\n if (once) {\n taskData.options.once = true;\n }\n if (typeof task.options !== 'boolean') {\n // We should save the options on the task (if it's an object) because\n // we'll be using `task.options` later when removing the event listener\n // and passing it back to `removeEventListener`.\n task.options = options;\n }\n task.target = target;\n task.capture = capture;\n task.eventName = eventName;\n if (isEventListenerObject) {\n // save original delegate for compare to check duplicate\n task.originalDelegate = delegate;\n }\n if (!prepend) {\n existingTasks.push(task);\n }\n else {\n existingTasks.unshift(task);\n }\n if (returnTarget) {\n return target;\n }\n };\n };\n proto[ADD_EVENT_LISTENER] = makeAddListener(nativeAddEventListener, ADD_EVENT_LISTENER_SOURCE, customSchedule, customCancel, returnTarget);\n if (nativePrependEventListener) {\n proto[PREPEND_EVENT_LISTENER] = makeAddListener(nativePrependEventListener, PREPEND_EVENT_LISTENER_SOURCE, customSchedulePrepend, customCancel, returnTarget, true);\n }\n proto[REMOVE_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const options = arguments[2];\n const capture = !options ? false : typeof options === 'boolean' ? true : options.capture;\n const delegate = arguments[1];\n if (!delegate) {\n return nativeRemoveEventListener.apply(this, arguments);\n }\n if (validateHandler &&\n !validateHandler(nativeRemoveEventListener, delegate, target, arguments)) {\n return;\n }\n const symbolEventNames = zoneSymbolEventNames[eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && target[symbolEventName];\n // `existingTasks` may not exist if the `addEventListener` was called before\n // it was patched by zone.js. Please refer to the attached issue for\n // clarification, particularly after the `if` condition, before calling\n // the native `removeEventListener`.\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (compare(existingTask, delegate)) {\n existingTasks.splice(i, 1);\n // set isRemoved to data for faster invokeTask check\n existingTask.isRemoved = true;\n if (existingTasks.length === 0) {\n // all tasks for the eventName + capture have gone,\n // remove globalZoneAwareCallback and remove the task cache from target\n existingTask.allRemoved = true;\n target[symbolEventName] = null;\n // in the target, we have an event listener which is added by on_property\n // such as target.onclick = function() {}, so we need to clear this internal\n // property too if all delegates with capture=false were removed\n // https:// github.com/angular/angular/issues/31643\n // https://github.com/angular/angular/issues/54581\n if (!capture && typeof eventName === 'string') {\n const onPropertySymbol = ZONE_SYMBOL_PREFIX + 'ON_PROPERTY' + eventName;\n target[onPropertySymbol] = null;\n }\n }\n // In all other conditions, when `addEventListener` is called after being\n // patched by zone.js, we would always find an event task on the `EventTarget`.\n // This will trigger `cancelFn` on the `existingTask`, leading to `customCancelGlobal`,\n // which ultimately removes an event listener and cleans up the abort listener\n // (if an `AbortSignal` was provided when scheduling a task).\n existingTask.zone.cancelTask(existingTask);\n if (returnTarget) {\n return target;\n }\n return;\n }\n }\n }\n // https://github.com/angular/zone.js/issues/930\n // We may encounter a situation where the `addEventListener` was\n // called on the event target before zone.js is loaded, resulting\n // in no task being stored on the event target due to its invocation\n // of the native implementation. In this scenario, we simply need to\n // invoke the native `removeEventListener`.\n return nativeRemoveEventListener.apply(this, arguments);\n };\n proto[LISTENERS_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const listeners = [];\n const tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName);\n for (let i = 0; i < tasks.length; i++) {\n const task = tasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n listeners.push(delegate);\n }\n return listeners;\n };\n proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (!eventName) {\n const keys = Object.keys(target);\n for (let i = 0; i < keys.length; i++) {\n const prop = keys[i];\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n // in nodejs EventEmitter, removeListener event is\n // used for monitoring the removeListener call,\n // so just keep removeListener eventListener until\n // all other eventListeners are removed\n if (evtName && evtName !== 'removeListener') {\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, evtName);\n }\n }\n // remove removeListener listener finally\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, 'removeListener');\n }\n else {\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const symbolEventNames = zoneSymbolEventNames[eventName];\n if (symbolEventNames) {\n const symbolEventName = symbolEventNames[FALSE_STR];\n const symbolCaptureEventName = symbolEventNames[TRUE_STR];\n const tasks = target[symbolEventName];\n const captureTasks = target[symbolCaptureEventName];\n if (tasks) {\n const removeTasks = tasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n if (captureTasks) {\n const removeTasks = captureTasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n }\n }\n if (returnTarget) {\n return this;\n }\n };\n // for native toString patch\n attachOriginToPatched(proto[ADD_EVENT_LISTENER], nativeAddEventListener);\n attachOriginToPatched(proto[REMOVE_EVENT_LISTENER], nativeRemoveEventListener);\n if (nativeRemoveAllListeners) {\n attachOriginToPatched(proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER], nativeRemoveAllListeners);\n }\n if (nativeListeners) {\n attachOriginToPatched(proto[LISTENERS_EVENT_LISTENER], nativeListeners);\n }\n return true;\n }\n let results = [];\n for (let i = 0; i < apis.length; i++) {\n results[i] = patchEventTargetMethods(apis[i], patchOptions);\n }\n return results;\n}\nfunction findEventTasks(target, eventName) {\n if (!eventName) {\n const foundTasks = [];\n for (let prop in target) {\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n if (evtName && (!eventName || evtName === eventName)) {\n const tasks = target[prop];\n if (tasks) {\n for (let i = 0; i < tasks.length; i++) {\n foundTasks.push(tasks[i]);\n }\n }\n }\n }\n return foundTasks;\n }\n let symbolEventName = zoneSymbolEventNames[eventName];\n if (!symbolEventName) {\n prepareEventNames(eventName);\n symbolEventName = zoneSymbolEventNames[eventName];\n }\n const captureFalseTasks = target[symbolEventName[FALSE_STR]];\n const captureTrueTasks = target[symbolEventName[TRUE_STR]];\n if (!captureFalseTasks) {\n return captureTrueTasks ? captureTrueTasks.slice() : [];\n }\n else {\n return captureTrueTasks\n ? captureFalseTasks.concat(captureTrueTasks)\n : captureFalseTasks.slice();\n }\n}\nfunction patchEventPrototype(global, api) {\n const Event = global['Event'];\n if (Event && Event.prototype) {\n api.patchMethod(Event.prototype, 'stopImmediatePropagation', (delegate) => function (self, args) {\n self[IMMEDIATE_PROPAGATION_SYMBOL] = true;\n // we need to call the native stopImmediatePropagation\n // in case in some hybrid application, some part of\n // application will be controlled by zone, some are not\n delegate && delegate.apply(self, args);\n });\n }\n}\n\n/**\n * @fileoverview\n * @suppress {missingRequire}\n */\nfunction patchQueueMicrotask(global, api) {\n api.patchMethod(global, 'queueMicrotask', (delegate) => {\n return function (self, args) {\n Zone.current.scheduleMicroTask('queueMicrotask', args[0]);\n };\n });\n}\n\n/**\n * @fileoverview\n * @suppress {missingRequire}\n */\nconst taskSymbol = zoneSymbol('zoneTask');\nfunction patchTimer(window, setName, cancelName, nameSuffix) {\n let setNative = null;\n let clearNative = null;\n setName += nameSuffix;\n cancelName += nameSuffix;\n const tasksByHandleId = {};\n function scheduleTask(task) {\n const data = task.data;\n data.args[0] = function () {\n return task.invoke.apply(this, arguments);\n };\n const handleOrId = setNative.apply(window, data.args);\n // Whlist on Node.js when get can the ID by using `[Symbol.toPrimitive]()` we do\n // to this so that we do not cause potentally leaks when using `setTimeout`\n // since this can be periodic when using `.refresh`.\n if (isNumber(handleOrId)) {\n data.handleId = handleOrId;\n }\n else {\n data.handle = handleOrId;\n // On Node.js a timeout and interval can be restarted over and over again by using the `.refresh` method.\n data.isRefreshable = isFunction(handleOrId.refresh);\n }\n return task;\n }\n function clearTask(task) {\n const { handle, handleId } = task.data;\n return clearNative.call(window, handle ?? handleId);\n }\n setNative = patchMethod(window, setName, (delegate) => function (self, args) {\n if (isFunction(args[0])) {\n const options = {\n isRefreshable: false,\n isPeriodic: nameSuffix === 'Interval',\n delay: nameSuffix === 'Timeout' || nameSuffix === 'Interval' ? args[1] || 0 : undefined,\n args: args,\n };\n const callback = args[0];\n args[0] = function timer() {\n try {\n return callback.apply(this, arguments);\n }\n finally {\n // issue-934, task will be cancelled\n // even it is a periodic task such as\n // setInterval\n // https://github.com/angular/angular/issues/40387\n // Cleanup tasksByHandleId should be handled before scheduleTask\n // Since some zoneSpec may intercept and doesn't trigger\n // scheduleFn(scheduleTask) provided here.\n const { handle, handleId, isPeriodic, isRefreshable } = options;\n if (!isPeriodic && !isRefreshable) {\n if (handleId) {\n // in non-nodejs env, we remove timerId\n // from local cache\n delete tasksByHandleId[handleId];\n }\n else if (handle) {\n // Node returns complex objects as handleIds\n // we remove task reference from timer object\n handle[taskSymbol] = null;\n }\n }\n }\n };\n const task = scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);\n if (!task) {\n return task;\n }\n // Node.js must additionally support the ref and unref functions.\n const { handleId, handle, isRefreshable, isPeriodic } = task.data;\n if (handleId) {\n // for non nodejs env, we save handleId: task\n // mapping in local cache for clearTimeout\n tasksByHandleId[handleId] = task;\n }\n else if (handle) {\n // for nodejs env, we save task\n // reference in timerId Object for clearTimeout\n handle[taskSymbol] = task;\n if (isRefreshable && !isPeriodic) {\n const originalRefresh = handle.refresh;\n handle.refresh = function () {\n const { zone, state } = task;\n if (state === 'notScheduled') {\n task._state = 'scheduled';\n zone._updateTaskCount(task, 1);\n }\n else if (state === 'running') {\n task._state = 'scheduling';\n }\n return originalRefresh.call(this);\n };\n }\n }\n return handle ?? handleId ?? task;\n }\n else {\n // cause an error by calling it directly.\n return delegate.apply(window, args);\n }\n });\n clearNative = patchMethod(window, cancelName, (delegate) => function (self, args) {\n const id = args[0];\n let task;\n if (isNumber(id)) {\n // non nodejs env.\n task = tasksByHandleId[id];\n delete tasksByHandleId[id];\n }\n else {\n // nodejs env ?? other environments.\n task = id?.[taskSymbol];\n if (task) {\n id[taskSymbol] = null;\n }\n else {\n task = id;\n }\n }\n if (task?.type) {\n if (task.cancelFn) {\n // Do not cancel already canceled functions\n task.zone.cancelTask(task);\n }\n }\n else {\n // cause an error by calling it directly.\n delegate.apply(window, args);\n }\n });\n}\n\nfunction patchCustomElements(_global, api) {\n const { isBrowser, isMix } = api.getGlobalObjects();\n if ((!isBrowser && !isMix) || !_global['customElements'] || !('customElements' in _global)) {\n return;\n }\n // https://html.spec.whatwg.org/multipage/custom-elements.html#concept-custom-element-definition-lifecycle-callbacks\n const callbacks = [\n 'connectedCallback',\n 'disconnectedCallback',\n 'adoptedCallback',\n 'attributeChangedCallback',\n 'formAssociatedCallback',\n 'formDisabledCallback',\n 'formResetCallback',\n 'formStateRestoreCallback',\n ];\n api.patchCallbacks(api, _global.customElements, 'customElements', 'define', callbacks);\n}\n\nfunction eventTargetPatch(_global, api) {\n if (Zone[api.symbol('patchEventTarget')]) {\n // EventTarget is already patched.\n return;\n }\n const { eventNames, zoneSymbolEventNames, TRUE_STR, FALSE_STR, ZONE_SYMBOL_PREFIX } = api.getGlobalObjects();\n // predefine all __zone_symbol__ + eventName + true/false string\n for (let i = 0; i < eventNames.length; i++) {\n const eventName = eventNames[i];\n const falseEventName = eventName + FALSE_STR;\n const trueEventName = eventName + TRUE_STR;\n const symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n zoneSymbolEventNames[eventName] = {};\n zoneSymbolEventNames[eventName][FALSE_STR] = symbol;\n zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture;\n }\n const EVENT_TARGET = _global['EventTarget'];\n if (!EVENT_TARGET || !EVENT_TARGET.prototype) {\n return;\n }\n api.patchEventTarget(_global, api, [EVENT_TARGET && EVENT_TARGET.prototype]);\n return true;\n}\nfunction patchEvent(global, api) {\n api.patchEventPrototype(global, api);\n}\n\n/**\n * @fileoverview\n * @suppress {globalThis}\n */\nfunction filterProperties(target, onProperties, ignoreProperties) {\n if (!ignoreProperties || ignoreProperties.length === 0) {\n return onProperties;\n }\n const tip = ignoreProperties.filter((ip) => ip.target === target);\n if (tip.length === 0) {\n return onProperties;\n }\n const targetIgnoreProperties = tip[0].ignoreProperties;\n return onProperties.filter((op) => targetIgnoreProperties.indexOf(op) === -1);\n}\nfunction patchFilteredProperties(target, onProperties, ignoreProperties, prototype) {\n // check whether target is available, sometimes target will be undefined\n // because different browser or some 3rd party plugin.\n if (!target) {\n return;\n }\n const filteredProperties = filterProperties(target, onProperties, ignoreProperties);\n patchOnProperties(target, filteredProperties, prototype);\n}\n/**\n * Get all event name properties which the event name startsWith `on`\n * from the target object itself, inherited properties are not considered.\n */\nfunction getOnEventNames(target) {\n return Object.getOwnPropertyNames(target)\n .filter((name) => name.startsWith('on') && name.length > 2)\n .map((name) => name.substring(2));\n}\nfunction propertyDescriptorPatch(api, _global) {\n if (isNode && !isMix) {\n return;\n }\n if (Zone[api.symbol('patchEvents')]) {\n // events are already been patched by legacy patch.\n return;\n }\n const ignoreProperties = _global['__Zone_ignore_on_properties'];\n // for browsers that we can patch the descriptor: Chrome & Firefox\n let patchTargets = [];\n if (isBrowser) {\n const internalWindow = window;\n patchTargets = patchTargets.concat([\n 'Document',\n 'SVGElement',\n 'Element',\n 'HTMLElement',\n 'HTMLBodyElement',\n 'HTMLMediaElement',\n 'HTMLFrameSetElement',\n 'HTMLFrameElement',\n 'HTMLIFrameElement',\n 'HTMLMarqueeElement',\n 'Worker',\n ]);\n const ignoreErrorProperties = [];\n // In older browsers like IE or Edge, event handler properties (e.g., `onclick`)\n // may not be defined directly on the `window` object but on its prototype (`WindowPrototype`).\n // To ensure complete coverage, we use the prototype when checking\n // for and patching these properties.\n patchFilteredProperties(internalWindow, getOnEventNames(internalWindow), ignoreProperties ? ignoreProperties.concat(ignoreErrorProperties) : ignoreProperties, ObjectGetPrototypeOf(internalWindow));\n }\n patchTargets = patchTargets.concat([\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'IDBIndex',\n 'IDBRequest',\n 'IDBOpenDBRequest',\n 'IDBDatabase',\n 'IDBTransaction',\n 'IDBCursor',\n 'WebSocket',\n ]);\n for (let i = 0; i < patchTargets.length; i++) {\n const target = _global[patchTargets[i]];\n target?.prototype &&\n patchFilteredProperties(target.prototype, getOnEventNames(target.prototype), ignoreProperties);\n }\n}\n\n/**\n * @fileoverview\n * @suppress {missingRequire}\n */\nfunction patchBrowser(Zone) {\n Zone.__load_patch('legacy', (global) => {\n const legacyPatch = global[Zone.__symbol__('legacyPatch')];\n if (legacyPatch) {\n legacyPatch();\n }\n });\n Zone.__load_patch('timers', (global) => {\n const set = 'set';\n const clear = 'clear';\n patchTimer(global, set, clear, 'Timeout');\n patchTimer(global, set, clear, 'Interval');\n patchTimer(global, set, clear, 'Immediate');\n });\n Zone.__load_patch('requestAnimationFrame', (global) => {\n patchTimer(global, 'request', 'cancel', 'AnimationFrame');\n patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame');\n patchTimer(global, 'webkitRequest', 'webkitCancel', 'AnimationFrame');\n });\n Zone.__load_patch('blocking', (global, Zone) => {\n const blockingMethods = ['alert', 'prompt', 'confirm'];\n for (let i = 0; i < blockingMethods.length; i++) {\n const name = blockingMethods[i];\n patchMethod(global, name, (delegate, symbol, name) => {\n return function (s, args) {\n return Zone.current.run(delegate, global, args, name);\n };\n });\n }\n });\n Zone.__load_patch('EventTarget', (global, Zone, api) => {\n patchEvent(global, api);\n eventTargetPatch(global, api);\n // patch XMLHttpRequestEventTarget's addEventListener/removeEventListener\n const XMLHttpRequestEventTarget = global['XMLHttpRequestEventTarget'];\n if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) {\n api.patchEventTarget(global, api, [XMLHttpRequestEventTarget.prototype]);\n }\n });\n Zone.__load_patch('MutationObserver', (global, Zone, api) => {\n patchClass('MutationObserver');\n patchClass('WebKitMutationObserver');\n });\n Zone.__load_patch('IntersectionObserver', (global, Zone, api) => {\n patchClass('IntersectionObserver');\n });\n Zone.__load_patch('FileReader', (global, Zone, api) => {\n patchClass('FileReader');\n });\n Zone.__load_patch('on_property', (global, Zone, api) => {\n propertyDescriptorPatch(api, global);\n });\n Zone.__load_patch('customElements', (global, Zone, api) => {\n patchCustomElements(global, api);\n });\n Zone.__load_patch('XHR', (global, Zone) => {\n // Treat XMLHttpRequest as a macrotask.\n patchXHR(global);\n const XHR_TASK = zoneSymbol('xhrTask');\n const XHR_SYNC = zoneSymbol('xhrSync');\n const XHR_LISTENER = zoneSymbol('xhrListener');\n const XHR_SCHEDULED = zoneSymbol('xhrScheduled');\n const XHR_URL = zoneSymbol('xhrURL');\n const XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol('xhrErrorBeforeScheduled');\n function patchXHR(window) {\n const XMLHttpRequest = window['XMLHttpRequest'];\n if (!XMLHttpRequest) {\n // XMLHttpRequest is not available in service worker\n return;\n }\n const XMLHttpRequestPrototype = XMLHttpRequest.prototype;\n function findPendingTask(target) {\n return target[XHR_TASK];\n }\n let oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n let oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n if (!oriAddListener) {\n const XMLHttpRequestEventTarget = window['XMLHttpRequestEventTarget'];\n if (XMLHttpRequestEventTarget) {\n const XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype;\n oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n }\n const READY_STATE_CHANGE = 'readystatechange';\n const SCHEDULED = 'scheduled';\n function scheduleTask(task) {\n const data = task.data;\n const target = data.target;\n target[XHR_SCHEDULED] = false;\n target[XHR_ERROR_BEFORE_SCHEDULED] = false;\n // remove existing event listener\n const listener = target[XHR_LISTENER];\n if (!oriAddListener) {\n oriAddListener = target[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = target[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n if (listener) {\n oriRemoveListener.call(target, READY_STATE_CHANGE, listener);\n }\n const newListener = (target[XHR_LISTENER] = () => {\n if (target.readyState === target.DONE) {\n // sometimes on some browsers XMLHttpRequest will fire onreadystatechange with\n // readyState=4 multiple times, so we need to check task state here\n if (!data.aborted && target[XHR_SCHEDULED] && task.state === SCHEDULED) {\n // check whether the xhr has registered onload listener\n // if that is the case, the task should invoke after all\n // onload listeners finish.\n // Also if the request failed without response (status = 0), the load event handler\n // will not be triggered, in that case, we should also invoke the placeholder callback\n // to close the XMLHttpRequest::send macroTask.\n // https://github.com/angular/angular/issues/38795\n const loadTasks = target[Zone.__symbol__('loadfalse')];\n if (target.status !== 0 && loadTasks && loadTasks.length > 0) {\n const oriInvoke = task.invoke;\n task.invoke = function () {\n // need to load the tasks again, because in other\n // load listener, they may remove themselves\n const loadTasks = target[Zone.__symbol__('loadfalse')];\n for (let i = 0; i < loadTasks.length; i++) {\n if (loadTasks[i] === task) {\n loadTasks.splice(i, 1);\n }\n }\n if (!data.aborted && task.state === SCHEDULED) {\n oriInvoke.call(task);\n }\n };\n loadTasks.push(task);\n }\n else {\n task.invoke();\n }\n }\n else if (!data.aborted && target[XHR_SCHEDULED] === false) {\n // error occurs when xhr.send()\n target[XHR_ERROR_BEFORE_SCHEDULED] = true;\n }\n }\n });\n oriAddListener.call(target, READY_STATE_CHANGE, newListener);\n const storedTask = target[XHR_TASK];\n if (!storedTask) {\n target[XHR_TASK] = task;\n }\n sendNative.apply(target, data.args);\n target[XHR_SCHEDULED] = true;\n return task;\n }\n function placeholderCallback() { }\n function clearTask(task) {\n const data = task.data;\n // Note - ideally, we would call data.target.removeEventListener here, but it's too late\n // to prevent it from firing. So instead, we store info for the event listener.\n data.aborted = true;\n return abortNative.apply(data.target, data.args);\n }\n const openNative = patchMethod(XMLHttpRequestPrototype, 'open', () => function (self, args) {\n self[XHR_SYNC] = args[2] == false;\n self[XHR_URL] = args[1];\n return openNative.apply(self, args);\n });\n const XMLHTTPREQUEST_SOURCE = 'XMLHttpRequest.send';\n const fetchTaskAborting = zoneSymbol('fetchTaskAborting');\n const fetchTaskScheduling = zoneSymbol('fetchTaskScheduling');\n const sendNative = patchMethod(XMLHttpRequestPrototype, 'send', () => function (self, args) {\n if (Zone.current[fetchTaskScheduling] === true) {\n // a fetch is scheduling, so we are using xhr to polyfill fetch\n // and because we already schedule macroTask for fetch, we should\n // not schedule a macroTask for xhr again\n return sendNative.apply(self, args);\n }\n if (self[XHR_SYNC]) {\n // if the XHR is sync there is no task to schedule, just execute the code.\n return sendNative.apply(self, args);\n }\n else {\n const options = {\n target: self,\n url: self[XHR_URL],\n isPeriodic: false,\n args: args,\n aborted: false,\n };\n const task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);\n if (self &&\n self[XHR_ERROR_BEFORE_SCHEDULED] === true &&\n !options.aborted &&\n task.state === SCHEDULED) {\n // xhr request throw error when send\n // we should invoke task instead of leaving a scheduled\n // pending macroTask\n task.invoke();\n }\n }\n });\n const abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', () => function (self, args) {\n const task = findPendingTask(self);\n if (task && typeof task.type == 'string') {\n // If the XHR has already completed, do nothing.\n // If the XHR has already been aborted, do nothing.\n // Fix #569, call abort multiple times before done will cause\n // macroTask task count be negative number\n if (task.cancelFn == null || (task.data && task.data.aborted)) {\n return;\n }\n task.zone.cancelTask(task);\n }\n else if (Zone.current[fetchTaskAborting] === true) {\n // the abort is called from fetch polyfill, we need to call native abort of XHR.\n return abortNative.apply(self, args);\n }\n // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no\n // task\n // to cancel. Do nothing.\n });\n }\n });\n Zone.__load_patch('geolocation', (global) => {\n /// GEO_LOCATION\n if (global['navigator'] && global['navigator'].geolocation) {\n patchPrototype(global['navigator'].geolocation, ['getCurrentPosition', 'watchPosition']);\n }\n });\n Zone.__load_patch('PromiseRejectionEvent', (global, Zone) => {\n // handle unhandled promise rejection\n function findPromiseRejectionHandler(evtName) {\n return function (e) {\n const eventTasks = findEventTasks(global, evtName);\n eventTasks.forEach((eventTask) => {\n // windows has added unhandledrejection event listener\n // trigger the event listener\n const PromiseRejectionEvent = global['PromiseRejectionEvent'];\n if (PromiseRejectionEvent) {\n const evt = new PromiseRejectionEvent(evtName, {\n promise: e.promise,\n reason: e.rejection,\n });\n eventTask.invoke(evt);\n }\n });\n };\n }\n if (global['PromiseRejectionEvent']) {\n Zone[zoneSymbol('unhandledPromiseRejectionHandler')] =\n findPromiseRejectionHandler('unhandledrejection');\n Zone[zoneSymbol('rejectionHandledHandler')] =\n findPromiseRejectionHandler('rejectionhandled');\n }\n });\n Zone.__load_patch('queueMicrotask', (global, Zone, api) => {\n patchQueueMicrotask(global, api);\n });\n}\n\nfunction patchPromise(Zone) {\n Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => {\n const ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n const ObjectDefineProperty = Object.defineProperty;\n function readableObjectToString(obj) {\n if (obj && obj.toString === Object.prototype.toString) {\n const className = obj.constructor && obj.constructor.name;\n return (className ? className : '') + ': ' + JSON.stringify(obj);\n }\n return obj ? obj.toString() : Object.prototype.toString.call(obj);\n }\n const __symbol__ = api.symbol;\n const _uncaughtPromiseErrors = [];\n const isDisableWrappingUncaughtPromiseRejection = global[__symbol__('DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION')] !== false;\n const symbolPromise = __symbol__('Promise');\n const symbolThen = __symbol__('then');\n const creationTrace = '__creationTrace__';\n api.onUnhandledError = (e) => {\n if (api.showUncaughtError()) {\n const rejection = e && e.rejection;\n if (rejection) {\n console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined);\n }\n else {\n console.error(e);\n }\n }\n };\n api.microtaskDrainDone = () => {\n while (_uncaughtPromiseErrors.length) {\n const uncaughtPromiseError = _uncaughtPromiseErrors.shift();\n try {\n uncaughtPromiseError.zone.runGuarded(() => {\n if (uncaughtPromiseError.throwOriginal) {\n throw uncaughtPromiseError.rejection;\n }\n throw uncaughtPromiseError;\n });\n }\n catch (error) {\n handleUnhandledRejection(error);\n }\n }\n };\n const UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL = __symbol__('unhandledPromiseRejectionHandler');\n function handleUnhandledRejection(e) {\n api.onUnhandledError(e);\n try {\n const handler = Zone[UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL];\n if (typeof handler === 'function') {\n handler.call(this, e);\n }\n }\n catch (err) { }\n }\n function isThenable(value) {\n return value && typeof value.then === 'function';\n }\n function forwardResolution(value) {\n return value;\n }\n function forwardRejection(rejection) {\n return ZoneAwarePromise.reject(rejection);\n }\n const symbolState = __symbol__('state');\n const symbolValue = __symbol__('value');\n const symbolFinally = __symbol__('finally');\n const symbolParentPromiseValue = __symbol__('parentPromiseValue');\n const symbolParentPromiseState = __symbol__('parentPromiseState');\n const source = 'Promise.then';\n const UNRESOLVED = null;\n const RESOLVED = true;\n const REJECTED = false;\n const REJECTED_NO_CATCH = 0;\n function makeResolver(promise, state) {\n return (v) => {\n try {\n resolvePromise(promise, state, v);\n }\n catch (err) {\n resolvePromise(promise, false, err);\n }\n // Do not return value or you will break the Promise spec.\n };\n }\n const once = function () {\n let wasCalled = false;\n return function wrapper(wrappedFunction) {\n return function () {\n if (wasCalled) {\n return;\n }\n wasCalled = true;\n wrappedFunction.apply(null, arguments);\n };\n };\n };\n const TYPE_ERROR = 'Promise resolved with itself';\n const CURRENT_TASK_TRACE_SYMBOL = __symbol__('currentTaskTrace');\n // Promise Resolution\n function resolvePromise(promise, state, value) {\n const onceWrapper = once();\n if (promise === value) {\n throw new TypeError(TYPE_ERROR);\n }\n if (promise[symbolState] === UNRESOLVED) {\n // should only get value.then once based on promise spec.\n let then = null;\n try {\n if (typeof value === 'object' || typeof value === 'function') {\n then = value && value.then;\n }\n }\n catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n return promise;\n }\n // if (value instanceof ZoneAwarePromise) {\n if (state !== REJECTED &&\n value instanceof ZoneAwarePromise &&\n value.hasOwnProperty(symbolState) &&\n value.hasOwnProperty(symbolValue) &&\n value[symbolState] !== UNRESOLVED) {\n clearRejectedNoCatch(value);\n resolvePromise(promise, value[symbolState], value[symbolValue]);\n }\n else if (state !== REJECTED && typeof then === 'function') {\n try {\n then.call(value, onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false)));\n }\n catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n }\n }\n else {\n promise[symbolState] = state;\n const queue = promise[symbolValue];\n promise[symbolValue] = value;\n if (promise[symbolFinally] === symbolFinally) {\n // the promise is generated by Promise.prototype.finally\n if (state === RESOLVED) {\n // the state is resolved, should ignore the value\n // and use parent promise value\n promise[symbolState] = promise[symbolParentPromiseState];\n promise[symbolValue] = promise[symbolParentPromiseValue];\n }\n }\n // record task information in value when error occurs, so we can\n // do some additional work such as render longStackTrace\n if (state === REJECTED && value instanceof Error) {\n // check if longStackTraceZone is here\n const trace = Zone.currentTask &&\n Zone.currentTask.data &&\n Zone.currentTask.data[creationTrace];\n if (trace) {\n // only keep the long stack trace into error when in longStackTraceZone\n ObjectDefineProperty(value, CURRENT_TASK_TRACE_SYMBOL, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: trace,\n });\n }\n }\n for (let i = 0; i < queue.length;) {\n scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]);\n }\n if (queue.length == 0 && state == REJECTED) {\n promise[symbolState] = REJECTED_NO_CATCH;\n let uncaughtPromiseError = value;\n try {\n // Here we throws a new Error to print more readable error log\n // and if the value is not an error, zone.js builds an `Error`\n // Object here to attach the stack information.\n throw new Error('Uncaught (in promise): ' +\n readableObjectToString(value) +\n (value && value.stack ? '\\n' + value.stack : ''));\n }\n catch (err) {\n uncaughtPromiseError = err;\n }\n if (isDisableWrappingUncaughtPromiseRejection) {\n // If disable wrapping uncaught promise reject\n // use the value instead of wrapping it.\n uncaughtPromiseError.throwOriginal = true;\n }\n uncaughtPromiseError.rejection = value;\n uncaughtPromiseError.promise = promise;\n uncaughtPromiseError.zone = Zone.current;\n uncaughtPromiseError.task = Zone.currentTask;\n _uncaughtPromiseErrors.push(uncaughtPromiseError);\n api.scheduleMicroTask(); // to make sure that it is running\n }\n }\n }\n // Resolving an already resolved promise is a noop.\n return promise;\n }\n const REJECTION_HANDLED_HANDLER = __symbol__('rejectionHandledHandler');\n function clearRejectedNoCatch(promise) {\n if (promise[symbolState] === REJECTED_NO_CATCH) {\n // if the promise is rejected no catch status\n // and queue.length > 0, means there is a error handler\n // here to handle the rejected promise, we should trigger\n // windows.rejectionhandled eventHandler or nodejs rejectionHandled\n // eventHandler\n try {\n const handler = Zone[REJECTION_HANDLED_HANDLER];\n if (handler && typeof handler === 'function') {\n handler.call(this, { rejection: promise[symbolValue], promise: promise });\n }\n }\n catch (err) { }\n promise[symbolState] = REJECTED;\n for (let i = 0; i < _uncaughtPromiseErrors.length; i++) {\n if (promise === _uncaughtPromiseErrors[i].promise) {\n _uncaughtPromiseErrors.splice(i, 1);\n }\n }\n }\n }\n function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) {\n clearRejectedNoCatch(promise);\n const promiseState = promise[symbolState];\n const delegate = promiseState\n ? typeof onFulfilled === 'function'\n ? onFulfilled\n : forwardResolution\n : typeof onRejected === 'function'\n ? onRejected\n : forwardRejection;\n zone.scheduleMicroTask(source, () => {\n try {\n const parentPromiseValue = promise[symbolValue];\n const isFinallyPromise = !!chainPromise && symbolFinally === chainPromise[symbolFinally];\n if (isFinallyPromise) {\n // if the promise is generated from finally call, keep parent promise's state and value\n chainPromise[symbolParentPromiseValue] = parentPromiseValue;\n chainPromise[symbolParentPromiseState] = promiseState;\n }\n // should not pass value to finally callback\n const value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution\n ? []\n : [parentPromiseValue]);\n resolvePromise(chainPromise, true, value);\n }\n catch (error) {\n // if error occurs, should always return this error\n resolvePromise(chainPromise, false, error);\n }\n }, chainPromise);\n }\n const ZONE_AWARE_PROMISE_TO_STRING = 'function ZoneAwarePromise() { [native code] }';\n const noop = function () { };\n const AggregateError = global.AggregateError;\n class ZoneAwarePromise {\n static toString() {\n return ZONE_AWARE_PROMISE_TO_STRING;\n }\n static resolve(value) {\n if (value instanceof ZoneAwarePromise) {\n return value;\n }\n return resolvePromise(new this(null), RESOLVED, value);\n }\n static reject(error) {\n return resolvePromise(new this(null), REJECTED, error);\n }\n static withResolvers() {\n const result = {};\n result.promise = new ZoneAwarePromise((res, rej) => {\n result.resolve = res;\n result.reject = rej;\n });\n return result;\n }\n static any(values) {\n if (!values || typeof values[Symbol.iterator] !== 'function') {\n return Promise.reject(new AggregateError([], 'All promises were rejected'));\n }\n const promises = [];\n let count = 0;\n try {\n for (let v of values) {\n count++;\n promises.push(ZoneAwarePromise.resolve(v));\n }\n }\n catch (err) {\n return Promise.reject(new AggregateError([], 'All promises were rejected'));\n }\n if (count === 0) {\n return Promise.reject(new AggregateError([], 'All promises were rejected'));\n }\n let finished = false;\n const errors = [];\n return new ZoneAwarePromise((resolve, reject) => {\n for (let i = 0; i < promises.length; i++) {\n promises[i].then((v) => {\n if (finished) {\n return;\n }\n finished = true;\n resolve(v);\n }, (err) => {\n errors.push(err);\n count--;\n if (count === 0) {\n finished = true;\n reject(new AggregateError(errors, 'All promises were rejected'));\n }\n });\n }\n });\n }\n static race(values) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n function onResolve(value) {\n resolve(value);\n }\n function onReject(error) {\n reject(error);\n }\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n value.then(onResolve, onReject);\n }\n return promise;\n }\n static all(values) {\n return ZoneAwarePromise.allWithCallback(values);\n }\n static allSettled(values) {\n const P = this && this.prototype instanceof ZoneAwarePromise ? this : ZoneAwarePromise;\n return P.allWithCallback(values, {\n thenCallback: (value) => ({ status: 'fulfilled', value }),\n errorCallback: (err) => ({ status: 'rejected', reason: err }),\n });\n }\n static allWithCallback(values, callback) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n // Start at 2 to prevent prematurely resolving if .then is called immediately.\n let unresolvedCount = 2;\n let valueIndex = 0;\n const resolvedValues = [];\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n const curValueIndex = valueIndex;\n try {\n value.then((value) => {\n resolvedValues[curValueIndex] = callback ? callback.thenCallback(value) : value;\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }, (err) => {\n if (!callback) {\n reject(err);\n }\n else {\n resolvedValues[curValueIndex] = callback.errorCallback(err);\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }\n });\n }\n catch (thenErr) {\n reject(thenErr);\n }\n unresolvedCount++;\n valueIndex++;\n }\n // Make the unresolvedCount zero-based again.\n unresolvedCount -= 2;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n return promise;\n }\n constructor(executor) {\n const promise = this;\n if (!(promise instanceof ZoneAwarePromise)) {\n throw new Error('Must be an instanceof Promise.');\n }\n promise[symbolState] = UNRESOLVED;\n promise[symbolValue] = []; // queue;\n try {\n const onceWrapper = once();\n executor &&\n executor(onceWrapper(makeResolver(promise, RESOLVED)), onceWrapper(makeResolver(promise, REJECTED)));\n }\n catch (error) {\n resolvePromise(promise, false, error);\n }\n }\n get [Symbol.toStringTag]() {\n return 'Promise';\n }\n get [Symbol.species]() {\n return ZoneAwarePromise;\n }\n then(onFulfilled, onRejected) {\n // We must read `Symbol.species` safely because `this` may be anything. For instance, `this`\n // may be an object without a prototype (created through `Object.create(null)`); thus\n // `this.constructor` will be undefined. One of the use cases is SystemJS creating\n // prototype-less objects (modules) via `Object.create(null)`. The SystemJS creates an empty\n // object and copies promise properties into that object (within the `getOrCreateLoad`\n // function). The zone.js then checks if the resolved value has the `then` method and\n // invokes it with the `value` context. Otherwise, this will throw an error: `TypeError:\n // Cannot read properties of undefined (reading 'Symbol(Symbol.species)')`.\n let C = this.constructor?.[Symbol.species];\n if (!C || typeof C !== 'function') {\n C = this.constructor || ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n const zone = Zone.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected);\n }\n else {\n scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected);\n }\n return chainPromise;\n }\n catch(onRejected) {\n return this.then(null, onRejected);\n }\n finally(onFinally) {\n // See comment on the call to `then` about why thee `Symbol.species` is safely accessed.\n let C = this.constructor?.[Symbol.species];\n if (!C || typeof C !== 'function') {\n C = ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n chainPromise[symbolFinally] = symbolFinally;\n const zone = Zone.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFinally, onFinally);\n }\n else {\n scheduleResolveOrReject(this, zone, chainPromise, onFinally, onFinally);\n }\n return chainPromise;\n }\n }\n // Protect against aggressive optimizers dropping seemingly unused properties.\n // E.g. Closure Compiler in advanced mode.\n ZoneAwarePromise['resolve'] = ZoneAwarePromise.resolve;\n ZoneAwarePromise['reject'] = ZoneAwarePromise.reject;\n ZoneAwarePromise['race'] = ZoneAwarePromise.race;\n ZoneAwarePromise['all'] = ZoneAwarePromise.all;\n const NativePromise = (global[symbolPromise] = global['Promise']);\n global['Promise'] = ZoneAwarePromise;\n const symbolThenPatched = __symbol__('thenPatched');\n function patchThen(Ctor) {\n const proto = Ctor.prototype;\n const prop = ObjectGetOwnPropertyDescriptor(proto, 'then');\n if (prop && (prop.writable === false || !prop.configurable)) {\n // check Ctor.prototype.then propertyDescriptor is writable or not\n // in meteor env, writable is false, we should ignore such case\n return;\n }\n const originalThen = proto.then;\n // Keep a reference to the original method.\n proto[symbolThen] = originalThen;\n Ctor.prototype.then = function (onResolve, onReject) {\n const wrapped = new ZoneAwarePromise((resolve, reject) => {\n originalThen.call(this, resolve, reject);\n });\n return wrapped.then(onResolve, onReject);\n };\n Ctor[symbolThenPatched] = true;\n }\n api.patchThen = patchThen;\n function zoneify(fn) {\n return function (self, args) {\n let resultPromise = fn.apply(self, args);\n if (resultPromise instanceof ZoneAwarePromise) {\n return resultPromise;\n }\n let ctor = resultPromise.constructor;\n if (!ctor[symbolThenPatched]) {\n patchThen(ctor);\n }\n return resultPromise;\n };\n }\n if (NativePromise) {\n patchThen(NativePromise);\n patchMethod(global, 'fetch', (delegate) => zoneify(delegate));\n }\n // This is not part of public API, but it is useful for tests, so we expose it.\n Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;\n return ZoneAwarePromise;\n });\n}\n\nfunction patchToString(Zone) {\n // override Function.prototype.toString to make zone.js patched function\n // look like native function\n Zone.__load_patch('toString', (global) => {\n // patch Func.prototype.toString to let them look like native\n const originalFunctionToString = Function.prototype.toString;\n const ORIGINAL_DELEGATE_SYMBOL = zoneSymbol('OriginalDelegate');\n const PROMISE_SYMBOL = zoneSymbol('Promise');\n const ERROR_SYMBOL = zoneSymbol('Error');\n const newFunctionToString = function toString() {\n if (typeof this === 'function') {\n const originalDelegate = this[ORIGINAL_DELEGATE_SYMBOL];\n if (originalDelegate) {\n if (typeof originalDelegate === 'function') {\n return originalFunctionToString.call(originalDelegate);\n }\n else {\n return Object.prototype.toString.call(originalDelegate);\n }\n }\n if (this === Promise) {\n const nativePromise = global[PROMISE_SYMBOL];\n if (nativePromise) {\n return originalFunctionToString.call(nativePromise);\n }\n }\n if (this === Error) {\n const nativeError = global[ERROR_SYMBOL];\n if (nativeError) {\n return originalFunctionToString.call(nativeError);\n }\n }\n }\n return originalFunctionToString.call(this);\n };\n newFunctionToString[ORIGINAL_DELEGATE_SYMBOL] = originalFunctionToString;\n Function.prototype.toString = newFunctionToString;\n // patch Object.prototype.toString to let them look like native\n const originalObjectToString = Object.prototype.toString;\n const PROMISE_OBJECT_TO_STRING = '[object Promise]';\n Object.prototype.toString = function () {\n if (typeof Promise === 'function' && this instanceof Promise) {\n return PROMISE_OBJECT_TO_STRING;\n }\n return originalObjectToString.call(this);\n };\n });\n}\n\nfunction patchCallbacks(api, target, targetName, method, callbacks) {\n const symbol = Zone.__symbol__(method);\n if (target[symbol]) {\n return;\n }\n const nativeDelegate = (target[symbol] = target[method]);\n target[method] = function (name, opts, options) {\n if (opts && opts.prototype) {\n callbacks.forEach(function (callback) {\n const source = `${targetName}.${method}::` + callback;\n const prototype = opts.prototype;\n // Note: the `patchCallbacks` is used for patching the `document.registerElement` and\n // `customElements.define`. We explicitly wrap the patching code into try-catch since\n // callbacks may be already patched by other web components frameworks (e.g. LWC), and they\n // make those properties non-writable. This means that patching callback will throw an error\n // `cannot assign to read-only property`. See this code as an example:\n // https://github.com/salesforce/lwc/blob/master/packages/@lwc/engine-core/src/framework/base-bridge-element.ts#L180-L186\n // We don't want to stop the application rendering if we couldn't patch some\n // callback, e.g. `attributeChangedCallback`.\n try {\n if (prototype.hasOwnProperty(callback)) {\n const descriptor = api.ObjectGetOwnPropertyDescriptor(prototype, callback);\n if (descriptor && descriptor.value) {\n descriptor.value = api.wrapWithCurrentZone(descriptor.value, source);\n api._redefineProperty(opts.prototype, callback, descriptor);\n }\n else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n }\n else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n }\n catch {\n // Note: we leave the catch block empty since there's no way to handle the error related\n // to non-writable property.\n }\n });\n }\n return nativeDelegate.call(target, name, opts, options);\n };\n api.attachOriginToPatched(target[method], nativeDelegate);\n}\n\nfunction patchUtil(Zone) {\n Zone.__load_patch('util', (global, Zone, api) => {\n // Collect native event names by looking at properties\n // on the global namespace, e.g. 'onclick'.\n const eventNames = getOnEventNames(global);\n api.patchOnProperties = patchOnProperties;\n api.patchMethod = patchMethod;\n api.bindArguments = bindArguments;\n api.patchMacroTask = patchMacroTask;\n // In earlier version of zone.js (<0.9.0), we use env name `__zone_symbol__BLACK_LISTED_EVENTS`\n // to define which events will not be patched by `Zone.js`. In newer version (>=0.9.0), we\n // change the env name to `__zone_symbol__UNPATCHED_EVENTS` to keep the name consistent with\n // angular repo. The `__zone_symbol__BLACK_LISTED_EVENTS` is deprecated, but it is still be\n // supported for backwards compatibility.\n const SYMBOL_BLACK_LISTED_EVENTS = Zone.__symbol__('BLACK_LISTED_EVENTS');\n const SYMBOL_UNPATCHED_EVENTS = Zone.__symbol__('UNPATCHED_EVENTS');\n if (global[SYMBOL_UNPATCHED_EVENTS]) {\n global[SYMBOL_BLACK_LISTED_EVENTS] = global[SYMBOL_UNPATCHED_EVENTS];\n }\n if (global[SYMBOL_BLACK_LISTED_EVENTS]) {\n Zone[SYMBOL_BLACK_LISTED_EVENTS] = Zone[SYMBOL_UNPATCHED_EVENTS] =\n global[SYMBOL_BLACK_LISTED_EVENTS];\n }\n api.patchEventPrototype = patchEventPrototype;\n api.patchEventTarget = patchEventTarget;\n api.isIEOrEdge = isIEOrEdge;\n api.ObjectDefineProperty = ObjectDefineProperty;\n api.ObjectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor;\n api.ObjectCreate = ObjectCreate;\n api.ArraySlice = ArraySlice;\n api.patchClass = patchClass;\n api.wrapWithCurrentZone = wrapWithCurrentZone;\n api.filterProperties = filterProperties;\n api.attachOriginToPatched = attachOriginToPatched;\n api._redefineProperty = Object.defineProperty;\n api.patchCallbacks = patchCallbacks;\n api.getGlobalObjects = () => ({\n globalSources,\n zoneSymbolEventNames,\n eventNames,\n isBrowser,\n isMix,\n isNode,\n TRUE_STR,\n FALSE_STR,\n ZONE_SYMBOL_PREFIX,\n ADD_EVENT_LISTENER_STR,\n REMOVE_EVENT_LISTENER_STR,\n });\n });\n}\n\nfunction patchCommon(Zone) {\n patchPromise(Zone);\n patchToString(Zone);\n patchUtil(Zone);\n}\n\nconst Zone$1 = loadZone();\npatchCommon(Zone$1);\npatchBrowser(Zone$1);\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nconst _SELECTOR_REGEXP = new RegExp(\n '(\\\\:not\\\\()|' + // 1: \":not(\"\n '(([\\\\.\\\\#]?)[-\\\\w]+)|' + // 2: \"tag\"; 3: \".\"/\"#\";\n // \"-\" should appear first in the regexp below as FF31 parses \"[.-\\w]\" as a range\n // 4: attribute; 5: attribute_string; 6: attribute_value\n '(?:\\\\[([-.\\\\w*\\\\\\\\$]+)(?:=([\"\\']?)([^\\\\]\"\\']*)\\\\5)?\\\\])|' + // \"[name]\", \"[name=value]\",\n // \"[name=\"value\"]\",\n // \"[name='value']\"\n '(\\\\))|' + // 7: \")\"\n '(\\\\s*,\\\\s*)', // 8: \",\"\n 'g',\n);\n\n/**\n * These offsets should match the match-groups in `_SELECTOR_REGEXP` offsets.\n */\nconst enum SelectorRegexp {\n ALL = 0, // The whole match\n NOT = 1,\n TAG = 2,\n PREFIX = 3,\n ATTRIBUTE = 4,\n ATTRIBUTE_STRING = 5,\n ATTRIBUTE_VALUE = 6,\n NOT_END = 7,\n SEPARATOR = 8,\n}\n/**\n * A css selector contains an element name,\n * css classes and attribute/value pairs with the purpose\n * of selecting subsets out of them.\n */\nexport class CssSelector {\n element: string | null = null;\n classNames: string[] = [];\n /**\n * The selectors are encoded in pairs where:\n * - even locations are attribute names\n * - odd locations are attribute values.\n *\n * Example:\n * Selector: `[key1=value1][key2]` would parse to:\n * ```\n * ['key1', 'value1', 'key2', '']\n * ```\n */\n attrs: string[] = [];\n notSelectors: CssSelector[] = [];\n\n static parse(selector: string): CssSelector[] {\n const results: CssSelector[] = [];\n const _addResult = (res: CssSelector[], cssSel: CssSelector) => {\n if (\n cssSel.notSelectors.length > 0 &&\n !cssSel.element &&\n cssSel.classNames.length == 0 &&\n cssSel.attrs.length == 0\n ) {\n cssSel.element = '*';\n }\n res.push(cssSel);\n };\n let cssSelector = new CssSelector();\n let match: string[] | null;\n let current = cssSelector;\n let inNot = false;\n _SELECTOR_REGEXP.lastIndex = 0;\n while ((match = _SELECTOR_REGEXP.exec(selector))) {\n if (match[SelectorRegexp.NOT]) {\n if (inNot) {\n throw new Error('Nesting :not in a selector is not allowed');\n }\n inNot = true;\n current = new CssSelector();\n cssSelector.notSelectors.push(current);\n }\n const tag = match[SelectorRegexp.TAG];\n if (tag) {\n const prefix = match[SelectorRegexp.PREFIX];\n if (prefix === '#') {\n // #hash\n current.addAttribute('id', tag.slice(1));\n } else if (prefix === '.') {\n // Class\n current.addClassName(tag.slice(1));\n } else {\n // Element\n current.setElement(tag);\n }\n }\n const attribute = match[SelectorRegexp.ATTRIBUTE];\n\n if (attribute) {\n current.addAttribute(\n current.unescapeAttribute(attribute),\n match[SelectorRegexp.ATTRIBUTE_VALUE],\n );\n }\n if (match[SelectorRegexp.NOT_END]) {\n inNot = false;\n current = cssSelector;\n }\n if (match[SelectorRegexp.SEPARATOR]) {\n if (inNot) {\n throw new Error('Multiple selectors in :not are not supported');\n }\n _addResult(results, cssSelector);\n cssSelector = current = new CssSelector();\n }\n }\n _addResult(results, cssSelector);\n return results;\n }\n\n /**\n * Unescape `\\$` sequences from the CSS attribute selector.\n *\n * This is needed because `$` can have a special meaning in CSS selectors,\n * but we might want to match an attribute that contains `$`.\n * [MDN web link for more\n * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).\n * @param attr the attribute to unescape.\n * @returns the unescaped string.\n */\n unescapeAttribute(attr: string): string {\n let result = '';\n let escaping = false;\n for (let i = 0; i < attr.length; i++) {\n const char = attr.charAt(i);\n if (char === '\\\\') {\n escaping = true;\n continue;\n }\n if (char === '$' && !escaping) {\n throw new Error(\n `Error in attribute selector \"${attr}\". ` +\n `Unescaped \"$\" is not supported. Please escape with \"\\\\$\".`,\n );\n }\n escaping = false;\n result += char;\n }\n return result;\n }\n\n /**\n * Escape `$` sequences from the CSS attribute selector.\n *\n * This is needed because `$` can have a special meaning in CSS selectors,\n * with this method we are escaping `$` with `\\$'.\n * [MDN web link for more\n * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).\n * @param attr the attribute to escape.\n * @returns the escaped string.\n */\n escapeAttribute(attr: string): string {\n return attr.replace(/\\\\/g, '\\\\\\\\').replace(/\\$/g, '\\\\$');\n }\n\n isElementSelector(): boolean {\n return (\n this.hasElementSelector() &&\n this.classNames.length == 0 &&\n this.attrs.length == 0 &&\n this.notSelectors.length === 0\n );\n }\n\n hasElementSelector(): boolean {\n return !!this.element;\n }\n\n setElement(element: string | null = null) {\n this.element = element;\n }\n\n getAttrs(): string[] {\n const result: string[] = [];\n if (this.classNames.length > 0) {\n result.push('class', this.classNames.join(' '));\n }\n return result.concat(this.attrs);\n }\n\n addAttribute(name: string, value: string = '') {\n this.attrs.push(name, (value && value.toLowerCase()) || '');\n }\n\n addClassName(name: string) {\n this.classNames.push(name.toLowerCase());\n }\n\n toString(): string {\n let res: string = this.element || '';\n if (this.classNames) {\n this.classNames.forEach((klass) => (res += `.${klass}`));\n }\n if (this.attrs) {\n for (let i = 0; i < this.attrs.length; i += 2) {\n const name = this.escapeAttribute(this.attrs[i]);\n const value = this.attrs[i + 1];\n res += `[${name}${value ? '=' + value : ''}]`;\n }\n }\n this.notSelectors.forEach((notSelector) => (res += `:not(${notSelector})`));\n return res;\n }\n}\n\n/**\n * Reads a list of CssSelectors and allows to calculate which ones\n * are contained in a given CssSelector.\n */\nexport class SelectorMatcher {\n static createNotMatcher(notSelectors: CssSelector[]): SelectorMatcher {\n const notMatcher = new SelectorMatcher();\n notMatcher.addSelectables(notSelectors, null);\n return notMatcher;\n }\n\n private _elementMap = new Map[]>();\n private _elementPartialMap = new Map>();\n private _classMap = new Map[]>();\n private _classPartialMap = new Map>();\n private _attrValueMap = new Map[]>>();\n private _attrValuePartialMap = new Map>>();\n private _listContexts: SelectorListContext[] = [];\n\n addSelectables(cssSelectors: CssSelector[], callbackCtxt?: T) {\n let listContext: SelectorListContext = null!;\n if (cssSelectors.length > 1) {\n listContext = new SelectorListContext(cssSelectors);\n this._listContexts.push(listContext);\n }\n for (let i = 0; i < cssSelectors.length; i++) {\n this._addSelectable(cssSelectors[i], callbackCtxt as T, listContext);\n }\n }\n\n /**\n * Add an object that can be found later on by calling `match`.\n * @param cssSelector A css selector\n * @param callbackCtxt An opaque object that will be given to the callback of the `match` function\n */\n private _addSelectable(\n cssSelector: CssSelector,\n callbackCtxt: T,\n listContext: SelectorListContext,\n ) {\n let matcher: SelectorMatcher = this;\n const element = cssSelector.element;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);\n\n if (element) {\n const isTerminal = attrs.length === 0 && classNames.length === 0;\n if (isTerminal) {\n this._addTerminal(matcher._elementMap, element, selectable);\n } else {\n matcher = this._addPartial(matcher._elementPartialMap, element);\n }\n }\n\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const isTerminal = attrs.length === 0 && i === classNames.length - 1;\n const className = classNames[i];\n if (isTerminal) {\n this._addTerminal(matcher._classMap, className, selectable);\n } else {\n matcher = this._addPartial(matcher._classPartialMap, className);\n }\n }\n }\n\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const isTerminal = i === attrs.length - 2;\n const name = attrs[i];\n const value = attrs[i + 1];\n if (isTerminal) {\n const terminalMap = matcher._attrValueMap;\n let terminalValuesMap = terminalMap.get(name);\n if (!terminalValuesMap) {\n terminalValuesMap = new Map[]>();\n terminalMap.set(name, terminalValuesMap);\n }\n this._addTerminal(terminalValuesMap, value, selectable);\n } else {\n const partialMap = matcher._attrValuePartialMap;\n let partialValuesMap = partialMap.get(name);\n if (!partialValuesMap) {\n partialValuesMap = new Map>();\n partialMap.set(name, partialValuesMap);\n }\n matcher = this._addPartial(partialValuesMap, value);\n }\n }\n }\n }\n\n private _addTerminal(\n map: Map[]>,\n name: string,\n selectable: SelectorContext,\n ) {\n let terminalList = map.get(name);\n if (!terminalList) {\n terminalList = [];\n map.set(name, terminalList);\n }\n terminalList.push(selectable);\n }\n\n private _addPartial(map: Map>, name: string): SelectorMatcher {\n let matcher = map.get(name);\n if (!matcher) {\n matcher = new SelectorMatcher();\n map.set(name, matcher);\n }\n return matcher;\n }\n\n /**\n * Find the objects that have been added via `addSelectable`\n * whose css selector is contained in the given css selector.\n * @param cssSelector A css selector\n * @param matchedCallback This callback will be called with the object handed into `addSelectable`\n * @return boolean true if a match was found\n */\n match(\n cssSelector: CssSelector,\n matchedCallback: ((c: CssSelector, a: T) => void) | null,\n ): boolean {\n let result = false;\n const element = cssSelector.element!;\n const classNames = cssSelector.classNames;\n const attrs = cssSelector.attrs;\n\n for (let i = 0; i < this._listContexts.length; i++) {\n this._listContexts[i].alreadyMatched = false;\n }\n\n result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result;\n result =\n this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) || result;\n\n if (classNames) {\n for (let i = 0; i < classNames.length; i++) {\n const className = classNames[i];\n result =\n this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;\n result =\n this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) ||\n result;\n }\n }\n\n if (attrs) {\n for (let i = 0; i < attrs.length; i += 2) {\n const name = attrs[i];\n const value = attrs[i + 1];\n\n const terminalValuesMap = this._attrValueMap.get(name)!;\n if (value) {\n result =\n this._matchTerminal(terminalValuesMap, '', cssSelector, matchedCallback) || result;\n }\n result =\n this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;\n\n const partialValuesMap = this._attrValuePartialMap.get(name)!;\n if (value) {\n result = this._matchPartial(partialValuesMap, '', cssSelector, matchedCallback) || result;\n }\n result =\n this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;\n }\n }\n return result;\n }\n\n /** @internal */\n _matchTerminal(\n map: Map[]>,\n name: string,\n cssSelector: CssSelector,\n matchedCallback: ((c: CssSelector, a: any) => void) | null,\n ): boolean {\n if (!map || typeof name !== 'string') {\n return false;\n }\n\n let selectables: SelectorContext[] = map.get(name) || [];\n const starSelectables: SelectorContext[] = map.get('*')!;\n if (starSelectables) {\n selectables = selectables.concat(starSelectables);\n }\n if (selectables.length === 0) {\n return false;\n }\n let selectable: SelectorContext;\n let result = false;\n for (let i = 0; i < selectables.length; i++) {\n selectable = selectables[i];\n result = selectable.finalize(cssSelector, matchedCallback) || result;\n }\n return result;\n }\n\n /** @internal */\n _matchPartial(\n map: Map>,\n name: string,\n cssSelector: CssSelector,\n matchedCallback: ((c: CssSelector, a: any) => void) | null,\n ): boolean {\n if (!map || typeof name !== 'string') {\n return false;\n }\n\n const nestedSelector = map.get(name);\n if (!nestedSelector) {\n return false;\n }\n // TODO(perf): get rid of recursion and measure again\n // TODO(perf): don't pass the whole selector into the recursion,\n // but only the not processed parts\n return nestedSelector.match(cssSelector, matchedCallback);\n }\n}\n\nexport class SelectorListContext {\n alreadyMatched: boolean = false;\n\n constructor(public selectors: CssSelector[]) {}\n}\n\n// Store context to pass back selector and context when a selector is matched\nexport class SelectorContext {\n notSelectors: CssSelector[];\n\n constructor(\n public selector: CssSelector,\n public cbContext: T,\n public listContext: SelectorListContext,\n ) {\n this.notSelectors = selector.notSelectors;\n }\n\n finalize(cssSelector: CssSelector, callback: ((c: CssSelector, a: T) => void) | null): boolean {\n let result = true;\n if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {\n const notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);\n result = !notMatcher.match(cssSelector, null);\n }\n if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {\n if (this.listContext) {\n this.listContext.alreadyMatched = true;\n }\n callback(this.selector, this.cbContext);\n }\n return result;\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property\n * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly\n * handled.\n *\n * See DomSanitizer for more details on security in Angular applications.\n *\n * @publicApi\n */\nexport enum SecurityContext {\n NONE = 0,\n HTML = 1,\n STYLE = 2,\n SCRIPT = 3,\n URL = 4,\n RESOURCE_URL = 5,\n ATTRIBUTE_NO_BINDING = 6,\n}\n\n// =================================================================================================\n// =================================================================================================\n// =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========\n// =================================================================================================\n// =================================================================================================\n//\n// DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!\n//\n// =================================================================================================\n\n/**\n * Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'.\n */\nlet _SECURITY_SCHEMA!: {[k: string]: SecurityContext};\nconst SVG_NAMESPACE = 'svg';\nconst MATH_ML_NAMESPACE = 'math';\n\n/**\n * @remarks Keep is a copy of DOM Security Schema.\n * @see [SECURITY_SCHEMA](../../../compiler/src/schema/dom_security_schema.ts)\n */\nexport function SECURITY_SCHEMA(): {[k: string]: SecurityContext} {\n if (!_SECURITY_SCHEMA) {\n _SECURITY_SCHEMA = {};\n // Case is insignificant below, all element and attribute names are lower-cased for lookup.\n\n registerContext(SecurityContext.HTML, /** Namespace */ undefined, [\n ['iframe', ['srcdoc']],\n ['*', ['innerHTML', 'outerHTML']],\n ]);\n registerContext(SecurityContext.STYLE, /** Namespace */ undefined, [['*', ['style']]]);\n // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.\n registerContext(SecurityContext.URL, /** Namespace */ undefined, [\n ['*', ['formAction']],\n ['area', ['href']],\n ['a', ['href', 'xlink:href']],\n ['form', ['action']],\n\n // The below two items are safe and should be removed but they require a G3 clean-up as a small number of tests fail.\n ['img', ['src']],\n ['video', ['src']],\n ]);\n\n registerContext(SecurityContext.URL, MATH_ML_NAMESPACE, [\n // MathML namespace\n // https://crsrc.org/c/third_party/blink/renderer/core/sanitizer/sanitizer.cc;l=753-768;drc=b3eb16372dcd3317d65e9e0265015e322494edcd;bpv=1;bpt=1\n ['annotation', ['href', 'xlink:href']],\n ['annotation-xml', ['href', 'xlink:href']],\n ['maction', ['href', 'xlink:href']],\n ['malignmark', ['href', 'xlink:href']],\n ['math', ['href', 'xlink:href']],\n ['mroot', ['href', 'xlink:href']],\n ['msqrt', ['href', 'xlink:href']],\n ['merror', ['href', 'xlink:href']],\n ['mfrac', ['href', 'xlink:href']],\n ['mglyph', ['href', 'xlink:href']],\n ['msub', ['href', 'xlink:href']],\n ['msup', ['href', 'xlink:href']],\n ['msubsup', ['href', 'xlink:href']],\n ['mmultiscripts', ['href', 'xlink:href']],\n ['mprescripts', ['href', 'xlink:href']],\n ['mi', ['href', 'xlink:href']],\n ['mn', ['href', 'xlink:href']],\n ['mo', ['href', 'xlink:href']],\n ['mpadded', ['href', 'xlink:href']],\n ['mphantom', ['href', 'xlink:href']],\n ['mrow', ['href', 'xlink:href']],\n ['ms', ['href', 'xlink:href']],\n ['mspace', ['href', 'xlink:href']],\n ['mstyle', ['href', 'xlink:href']],\n ['mtable', ['href', 'xlink:href']],\n ['mtd', ['href', 'xlink:href']],\n ['mtr', ['href', 'xlink:href']],\n ['mtext', ['href', 'xlink:href']],\n ['mover', ['href', 'xlink:href']],\n ['munder', ['href', 'xlink:href']],\n ['munderover', ['href', 'xlink:href']],\n ['semantics', ['href', 'xlink:href']],\n ['none', ['href', 'xlink:href']],\n ]);\n\n registerContext(SecurityContext.RESOURCE_URL, /** Namespace */ undefined, [\n ['base', ['href']],\n ['embed', ['src']],\n ['frame', ['src']],\n ['iframe', ['src']],\n ['link', ['href']],\n ['object', ['codebase', 'data']],\n ]);\n\n registerContext(SecurityContext.URL, SVG_NAMESPACE, [['a', ['href', 'xlink:href']]]);\n\n // Keep this in sync with SECURITY_SENSITIVE_ELEMENTS in packages/core/src/sanitization/sanitization.ts\n // Unknown is the internal tag name for unknown elements example used for host-bindings.\n // These are unsafe as `attributeName` can be `href` or `xlink:href`\n // See: http://b/463880509#comment7\n registerContext(SecurityContext.ATTRIBUTE_NO_BINDING, SVG_NAMESPACE, [\n ['animate', ['attributeName', 'values', 'to', 'from']],\n ['set', ['to', 'attributeName']],\n ['animateMotion', ['attributeName']],\n ['animateTransform', ['attributeName']],\n ]);\n\n registerContext(SecurityContext.ATTRIBUTE_NO_BINDING, /** Namespace */ undefined, [\n [\n 'unknown',\n [\n 'attributeName',\n 'values',\n 'to',\n 'from',\n 'sandbox',\n 'allow',\n 'allowFullscreen',\n 'referrerPolicy',\n 'csp',\n 'fetchPriority',\n ],\n ],\n ['iframe', ['sandbox', 'allow', 'allowFullscreen', 'referrerPolicy', 'csp', 'fetchPriority']],\n ]);\n }\n\n return _SECURITY_SCHEMA;\n}\n\nfunction registerContext(\n ctx: SecurityContext,\n namespace: string | undefined,\n specs: readonly [tagName: string, attributeNames: readonly string[]][],\n): void {\n for (const [element, attributeNames] of specs) {\n let tagName =\n namespace && element !== '*' && element !== 'unknown' ? `:${namespace}:${element}` : element;\n tagName = tagName.toLowerCase();\n\n for (const attr of attributeNames) {\n _SECURITY_SCHEMA[`${tagName}|${attr.toLowerCase()}`] = ctx;\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n// Attention:\n// This file duplicates types and values from @angular/core\n// so that we are able to make @angular/compiler independent of @angular/core.\n// This is important to prevent a build cycle, as @angular/core needs to\n// be compiled with the compiler.\n\nimport {CssSelector} from './selector';\n\n// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not\n// explicitly set.\nexport const emitDistinctChangesOnlyDefaultValue = true;\n\nexport enum ViewEncapsulation {\n Emulated = 0,\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n None = 2,\n ShadowDom = 3,\n}\n\nexport enum ChangeDetectionStrategy {\n OnPush = 0,\n Default = 1,\n}\n\nexport interface Input {\n alias?: string;\n required?: boolean;\n transform?: (value: any) => any;\n // Note: This field is marked as `internal` in `@angular/core`, but in the compiler\n // we rely on it for JIT processing at runtime.\n isSignal: boolean;\n}\n\n/** Flags describing an input for a directive. */\nexport enum InputFlags {\n None = 0,\n SignalBased = 1 << 0,\n HasDecoratorInputTransform = 1 << 1,\n}\n\nexport interface Output {\n alias?: string;\n}\n\nexport interface HostBinding {\n hostPropertyName?: string;\n}\n\nexport interface HostListener {\n eventName?: string;\n args?: string[];\n}\n\nexport interface SchemaMetadata {\n name: string;\n}\n\nexport const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata = {\n name: 'custom-elements',\n};\n\nexport const NO_ERRORS_SCHEMA: SchemaMetadata = {\n name: 'no-errors-schema',\n};\n\nexport interface Type extends Function {\n new (...args: any[]): any;\n}\nexport const Type = Function;\n\n/**\n * Injection flags for DI.\n */\nexport const enum InjectFlags {\n Default = 0,\n\n /**\n * Specifies that an injector should retrieve a dependency from any injector until reaching the\n * host element of the current component. (Only used with Element Injector)\n */\n Host = 1 << 0,\n /** Don't descend into ancestors of the node requesting injection. */\n Self = 1 << 1,\n /** Skip the node that is requesting injection. */\n SkipSelf = 1 << 2,\n /** Inject `defaultValue` instead if token not found. */\n Optional = 1 << 3,\n /**\n * This token is being injected into a pipe.\n * @internal\n */\n ForPipe = 1 << 4,\n}\n\nexport enum MissingTranslationStrategy {\n Error = 0,\n Warning = 1,\n Ignore = 2,\n}\n\n/**\n * Flags used to generate R3-style CSS Selectors. They are pasted from\n * core/src/render3/projection.ts because they cannot be referenced directly.\n */\nexport const enum SelectorFlags {\n /** Indicates this is the beginning of a new negative selector */\n NOT = 0b0001,\n\n /** Mode for matching attributes */\n ATTRIBUTE = 0b0010,\n\n /** Mode for matching tag names */\n ELEMENT = 0b0100,\n\n /** Mode for matching class names */\n CLASS = 0b1000,\n}\n\n// These are a copy the CSS types from core/src/render3/interfaces/projection.ts\n// They are duplicated here as they cannot be directly referenced from core.\nexport type R3CssSelector = (string | SelectorFlags)[];\nexport type R3CssSelectorList = R3CssSelector[];\n\nfunction parserSelectorToSimpleSelector(selector: CssSelector): R3CssSelector {\n const classes =\n selector.classNames && selector.classNames.length\n ? [SelectorFlags.CLASS, ...selector.classNames]\n : [];\n const elementName = selector.element && selector.element !== '*' ? selector.element : '';\n return [elementName, ...selector.attrs, ...classes];\n}\n\nfunction parserSelectorToNegativeSelector(selector: CssSelector): R3CssSelector {\n const classes =\n selector.classNames && selector.classNames.length\n ? [SelectorFlags.CLASS, ...selector.classNames]\n : [];\n\n if (selector.element) {\n return [\n SelectorFlags.NOT | SelectorFlags.ELEMENT,\n selector.element,\n ...selector.attrs,\n ...classes,\n ];\n } else if (selector.attrs.length) {\n return [SelectorFlags.NOT | SelectorFlags.ATTRIBUTE, ...selector.attrs, ...classes];\n } else {\n return selector.classNames && selector.classNames.length\n ? [SelectorFlags.NOT | SelectorFlags.CLASS, ...selector.classNames]\n : [];\n }\n}\n\nfunction parserSelectorToR3Selector(selector: CssSelector): R3CssSelector {\n const positive = parserSelectorToSimpleSelector(selector);\n\n const negative: R3CssSelectorList =\n selector.notSelectors && selector.notSelectors.length\n ? selector.notSelectors.map((notSelector) => parserSelectorToNegativeSelector(notSelector))\n : [];\n\n return positive.concat(...negative);\n}\n\nexport function parseSelectorToR3Selector(selector: string | null): R3CssSelectorList {\n return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];\n}\n\n// Pasted from render3/interfaces/definition since it cannot be referenced directly\n/**\n * Flags passed into template functions to determine which blocks (i.e. creation, update)\n * should be executed.\n *\n * Typically, a template runs both the creation block and the update block on initialization and\n * subsequent runs only execute the update block. However, dynamically created views require that\n * the creation block be executed separately from the update block (for backwards compat).\n */\nexport const enum RenderFlags {\n /* Whether to run the creation block (e.g. create elements and directives) */\n Create = 0b01,\n\n /* Whether to run the update block (e.g. refresh bindings) */\n Update = 0b10,\n}\n\n// Pasted from render3/interfaces/node.ts\n/**\n * A set of marker values to be used in the attributes arrays. These markers indicate that some\n * items are not regular attributes and the processing should be adapted accordingly.\n */\nexport const enum AttributeMarker {\n /**\n * Marker indicates that the following 3 values in the attributes array are:\n * namespaceUri, attributeName, attributeValue\n * in that order.\n */\n NamespaceURI = 0,\n\n /**\n * Signals class declaration.\n *\n * Each value following `Classes` designates a class name to include on the element.\n * ## Example:\n *\n * Given:\n * ```html\n *
...
\n * ```\n *\n * the generated code is:\n * ```ts\n * var _c1 = [AttributeMarker.Classes, 'foo', 'bar', 'baz'];\n * ```\n */\n Classes = 1,\n\n /**\n * Signals style declaration.\n *\n * Each pair of values following `Styles` designates a style name and value to include on the\n * element.\n * ## Example:\n *\n * Given:\n * ```html\n *
...
\n * ```\n *\n * the generated code is:\n * ```ts\n * var _c1 = [AttributeMarker.Styles, 'width', '100px', 'height'. '200px', 'color', 'red'];\n * ```\n */\n Styles = 2,\n\n /**\n * Signals that the following attribute names were extracted from input or output bindings.\n *\n * For example, given the following HTML:\n *\n * ```html\n *
\n * ```\n *\n * the generated code is:\n *\n * ```ts\n * var _c1 = ['moo', 'car', AttributeMarker.Bindings, 'foo', 'bar'];\n * ```\n */\n Bindings = 3,\n\n /**\n * Signals that the following attribute names were hoisted from an inline-template declaration.\n *\n * For example, given the following HTML:\n *\n * ```html\n *
\n * ```\n *\n * the generated code for the `template()` instruction would include:\n *\n * ```\n * ['dirA', '', AttributeMarker.Bindings, 'dirB', AttributeMarker.Template, 'ngFor', 'ngForOf',\n * 'ngForTrackBy', 'let-value']\n * ```\n *\n * while the generated code for the `element()` instruction inside the template function would\n * include:\n *\n * ```\n * ['dirA', '', AttributeMarker.Bindings, 'dirB']\n * ```\n */\n Template = 4,\n\n /**\n * Signals that the following attribute is `ngProjectAs` and its value is a parsed `CssSelector`.\n *\n * For example, given the following HTML:\n *\n * ```html\n *

\n * ```\n *\n * the generated code for the `element()` instruction would include:\n *\n * ```\n * ['attr', 'value', AttributeMarker.ProjectAs, ['', 'title', '']]\n * ```\n */\n ProjectAs = 5,\n\n /**\n * Signals that the following attribute will be translated by runtime i18n\n *\n * For example, given the following HTML:\n *\n * ```html\n *
\n * ```\n *\n * the generated code is:\n *\n * ```ts\n * var _c1 = ['moo', 'car', AttributeMarker.I18n, 'foo', 'bar'];\n * ```\n */\n I18n = 6,\n}\n\nexport {SecurityContext} from './schema/dom_security_schema';\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * A set of interfaces which are shared between `@angular/core` and `@angular/compiler` to allow\n * for late binding of `@angular/compiler` for JIT purposes.\n *\n * This file has two copies. Please ensure that they are in sync:\n * - packages/compiler/src/compiler_facade_interface.ts (main)\n * - packages/core/src/compiler/compiler_facade_interface.ts (replica)\n *\n * Please ensure that the two files are in sync using this command:\n * ```shell\n * cp packages/compiler/src/compiler_facade_interface.ts \\\n * packages/core/src/compiler/compiler_facade_interface.ts\n * ```\n */\n\nexport interface ExportedCompilerFacade {\n ɵcompilerFacade: CompilerFacade;\n}\n\nexport interface CompilerFacade {\n compilePipe(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3PipeMetadataFacade,\n ): any;\n compilePipeDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n declaration: R3DeclarePipeFacade,\n ): any;\n compileInjectable(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3InjectableMetadataFacade,\n ): any;\n compileInjectableDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3DeclareInjectableFacade,\n ): any;\n compileInjector(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3InjectorMetadataFacade,\n ): any;\n compileInjectorDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n declaration: R3DeclareInjectorFacade,\n ): any;\n compileNgModule(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3NgModuleMetadataFacade,\n ): any;\n compileNgModuleDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n declaration: R3DeclareNgModuleFacade,\n ): any;\n compileDirective(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3DirectiveMetadataFacade,\n ): any;\n compileDirectiveDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n declaration: R3DeclareDirectiveFacade,\n ): any;\n compileComponent(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3ComponentMetadataFacade,\n ): any;\n compileComponentDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n declaration: R3DeclareComponentFacade,\n ): any;\n compileFactory(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3FactoryDefMetadataFacade,\n ): any;\n compileFactoryDeclaration(\n angularCoreEnv: CoreEnvironment,\n sourceMapUrl: string,\n meta: R3DeclareFactoryFacade,\n ): any;\n\n createParseSourceSpan(kind: string, typeName: string, sourceUrl: string): ParseSourceSpan;\n\n FactoryTarget: typeof FactoryTarget;\n // Note that we do not use `{new(): ResourceLoader}` here because\n // the resource loader class is abstract and not constructable.\n ResourceLoader: Function & {prototype: ResourceLoader};\n}\n\nexport interface CoreEnvironment {\n [name: string]: unknown;\n}\n\nexport type ResourceLoader = {\n get(url: string): Promise | string;\n};\n\nexport type Provider = unknown;\nexport type Type = Function;\nexport type OpaqueValue = unknown;\n\nexport enum FactoryTarget {\n Directive = 0,\n Component = 1,\n Injectable = 2,\n Pipe = 3,\n NgModule = 4,\n}\n\nexport interface R3DependencyMetadataFacade {\n token: OpaqueValue;\n attribute: string | null;\n host: boolean;\n optional: boolean;\n self: boolean;\n skipSelf: boolean;\n}\n\nexport interface R3DeclareDependencyMetadataFacade {\n token: OpaqueValue;\n attribute?: boolean;\n host?: boolean;\n optional?: boolean;\n self?: boolean;\n skipSelf?: boolean;\n}\n\nexport interface R3PipeMetadataFacade {\n name: string;\n type: Type;\n pipeName: string;\n pure: boolean;\n isStandalone: boolean;\n}\n\nexport interface R3InjectableMetadataFacade {\n name: string;\n type: Type;\n typeArgumentCount: number;\n providedIn?: Type | 'root' | 'platform' | 'any' | null;\n useClass?: OpaqueValue;\n useFactory?: OpaqueValue;\n useExisting?: OpaqueValue;\n useValue?: OpaqueValue;\n deps?: R3DependencyMetadataFacade[];\n}\n\nexport interface R3NgModuleMetadataFacade {\n type: Type;\n bootstrap: Function[];\n declarations: Function[];\n imports: Function[];\n exports: Function[];\n schemas: {name: string}[] | null;\n id: string | null;\n}\n\nexport interface R3InjectorMetadataFacade {\n name: string;\n type: Type;\n providers: Provider[];\n imports: OpaqueValue[];\n}\n\nexport interface R3HostDirectiveMetadataFacade {\n directive: Type;\n inputs?: string[];\n outputs?: string[];\n}\n\nexport interface R3DirectiveMetadataFacade {\n name: string;\n type: Type;\n typeSourceSpan: ParseSourceSpan;\n selector: string | null;\n queries: R3QueryMetadataFacade[];\n host: {[key: string]: string};\n propMetadata: {[key: string]: OpaqueValue[]};\n lifecycle: {usesOnChanges: boolean};\n inputs: (string | {name: string; alias?: string; required?: boolean})[];\n outputs: string[];\n usesInheritance: boolean;\n exportAs: string[] | null;\n providers: Provider[] | null;\n viewQueries: R3QueryMetadataFacade[];\n isStandalone: boolean;\n hostDirectives: R3HostDirectiveMetadataFacade[] | null;\n isSignal: boolean;\n}\n\nexport interface R3ComponentMetadataFacade extends R3DirectiveMetadataFacade {\n template: string;\n preserveWhitespaces: boolean;\n animations: OpaqueValue[] | undefined;\n declarations: R3TemplateDependencyFacade[];\n styles: string[];\n encapsulation: ViewEncapsulation;\n viewProviders: Provider[] | null;\n interpolation?: [string, string];\n changeDetection?: ChangeDetectionStrategy;\n}\n\n// TODO(legacy-partial-output-inputs): Remove in v18.\n// https://github.com/angular/angular/blob/d4b423690210872b5c32a322a6090beda30b05a3/packages/core/src/compiler/compiler_facade_interface.ts#L197-L199\nexport type LegacyInputPartialMapping =\n | string\n | [bindingPropertyName: string, classPropertyName: string, transformFunction?: Function];\n\nexport interface R3DeclareDirectiveFacade {\n selector?: string;\n type: Type;\n version: string;\n inputs?: {\n [fieldName: string]:\n | {\n classPropertyName: string;\n publicName: string;\n isSignal: boolean;\n isRequired: boolean;\n transformFunction: Function | null;\n }\n | LegacyInputPartialMapping;\n };\n outputs?: {[classPropertyName: string]: string};\n host?: {\n attributes?: {[key: string]: OpaqueValue};\n listeners?: {[key: string]: string};\n properties?: {[key: string]: string};\n classAttribute?: string;\n styleAttribute?: string;\n };\n queries?: R3DeclareQueryMetadataFacade[];\n viewQueries?: R3DeclareQueryMetadataFacade[];\n providers?: OpaqueValue;\n exportAs?: string[];\n usesInheritance?: boolean;\n usesOnChanges?: boolean;\n isStandalone?: boolean;\n isSignal?: boolean;\n hostDirectives?: R3HostDirectiveMetadataFacade[] | null;\n}\n\nexport interface R3DeclareComponentFacade extends R3DeclareDirectiveFacade {\n template: string;\n isInline?: boolean;\n styles?: string[];\n\n // Post-standalone libraries use a unified dependencies field.\n dependencies?: R3DeclareTemplateDependencyFacade[];\n\n // Pre-standalone libraries have separate component/directive/pipe fields:\n components?: R3DeclareDirectiveDependencyFacade[];\n directives?: R3DeclareDirectiveDependencyFacade[];\n pipes?: {[pipeName: string]: OpaqueValue | (() => OpaqueValue)};\n\n deferBlockDependencies?: (() => Promise | null)[];\n viewProviders?: OpaqueValue;\n animations?: OpaqueValue;\n changeDetection?: ChangeDetectionStrategy;\n encapsulation?: ViewEncapsulation;\n interpolation?: [string, string];\n preserveWhitespaces?: boolean;\n}\n\nexport type R3DeclareTemplateDependencyFacade = {\n kind: string;\n} & (\n | R3DeclareDirectiveDependencyFacade\n | R3DeclarePipeDependencyFacade\n | R3DeclareNgModuleDependencyFacade\n);\n\nexport interface R3DeclareDirectiveDependencyFacade {\n kind?: 'directive' | 'component';\n selector: string;\n type: OpaqueValue | (() => OpaqueValue);\n inputs?: string[];\n outputs?: string[];\n exportAs?: string[];\n}\n\nexport interface R3DeclarePipeDependencyFacade {\n kind?: 'pipe';\n name: string;\n type: OpaqueValue | (() => OpaqueValue);\n}\n\nexport interface R3DeclareNgModuleDependencyFacade {\n kind: 'ngmodule';\n type: OpaqueValue | (() => OpaqueValue);\n}\n\nexport enum R3TemplateDependencyKind {\n Directive = 0,\n Pipe = 1,\n NgModule = 2,\n}\n\nexport interface R3TemplateDependencyFacade {\n kind: R3TemplateDependencyKind;\n type: OpaqueValue | (() => OpaqueValue);\n}\nexport interface R3FactoryDefMetadataFacade {\n name: string;\n type: Type;\n typeArgumentCount: number;\n deps: R3DependencyMetadataFacade[] | null;\n target: FactoryTarget;\n}\n\nexport interface R3DeclareFactoryFacade {\n type: Type;\n deps: R3DeclareDependencyMetadataFacade[] | 'invalid' | null;\n target: FactoryTarget;\n}\n\nexport interface R3DeclareInjectableFacade {\n type: Type;\n providedIn?: Type | 'root' | 'platform' | 'any' | null;\n useClass?: OpaqueValue;\n useFactory?: OpaqueValue;\n useExisting?: OpaqueValue;\n useValue?: OpaqueValue;\n deps?: R3DeclareDependencyMetadataFacade[];\n}\n\nexport enum ViewEncapsulation {\n Emulated = 0,\n // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.\n None = 2,\n ShadowDom = 3,\n}\n\nexport type ChangeDetectionStrategy = number;\n\nexport interface R3QueryMetadataFacade {\n propertyName: string;\n first: boolean;\n predicate: OpaqueValue | string[];\n descendants: boolean;\n emitDistinctChangesOnly: boolean;\n read: OpaqueValue | null;\n static: boolean;\n isSignal: boolean;\n}\n\nexport interface R3DeclareQueryMetadataFacade {\n propertyName: string;\n first?: boolean;\n predicate: OpaqueValue | string[];\n descendants?: boolean;\n read?: OpaqueValue;\n static?: boolean;\n emitDistinctChangesOnly?: boolean;\n isSignal?: boolean;\n}\n\nexport interface R3DeclareInjectorFacade {\n type: Type;\n imports?: OpaqueValue[];\n providers?: OpaqueValue[];\n}\n\nexport interface R3DeclareNgModuleFacade {\n type: Type;\n bootstrap?: OpaqueValue[] | (() => OpaqueValue[]);\n declarations?: OpaqueValue[] | (() => OpaqueValue[]);\n imports?: OpaqueValue[] | (() => OpaqueValue[]);\n exports?: OpaqueValue[] | (() => OpaqueValue[]);\n schemas?: OpaqueValue[];\n id?: OpaqueValue;\n}\n\nexport interface R3DeclarePipeFacade {\n type: Type;\n version: string;\n name: string;\n pure?: boolean;\n isStandalone?: boolean;\n}\n\nexport interface ParseSourceSpan {\n start: any;\n end: any;\n details: any;\n fullStart: any;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Byte} from '../util';\n\nimport * as i18n from './i18n_ast';\n\n/**\n * A lazily created TextEncoder instance for converting strings into UTF-8 bytes\n */\nlet textEncoder: TextEncoder | undefined;\n\n/**\n * Return the message id or compute it using the XLIFF1 digest.\n */\nexport function digest(message: i18n.Message): string {\n return message.id || computeDigest(message);\n}\n\n/**\n * Compute the message id using the XLIFF1 digest.\n */\nexport function computeDigest(message: i18n.Message): string {\n return sha1(serializeNodes(message.nodes).join('') + `[${message.meaning}]`);\n}\n\n/**\n * Return the message id or compute it using the XLIFF2/XMB/$localize digest.\n */\nexport function decimalDigest(message: i18n.Message): string {\n return message.id || computeDecimalDigest(message);\n}\n\n/**\n * Compute the message id using the XLIFF2/XMB/$localize digest.\n */\nexport function computeDecimalDigest(message: i18n.Message): string {\n const visitor = new _SerializerIgnoreIcuExpVisitor();\n const parts = message.nodes.map((a) => a.visit(visitor, null));\n return computeMsgId(parts.join(''), message.meaning);\n}\n\n/**\n * Serialize the i18n ast to something xml-like in order to generate an UID.\n *\n * The visitor is also used in the i18n parser tests\n *\n * @internal\n */\nclass _SerializerVisitor implements i18n.Visitor {\n visitText(text: i18n.Text, context: any): any {\n return text.value;\n }\n\n visitContainer(container: i18n.Container, context: any): any {\n return `[${container.children.map((child) => child.visit(this)).join(', ')}]`;\n }\n\n visitIcu(icu: i18n.Icu, context: any): any {\n const strCases = Object.keys(icu.cases).map(\n (k: string) => `${k} {${icu.cases[k].visit(this)}}`,\n );\n return `{${icu.expression}, ${icu.type}, ${strCases.join(', ')}}`;\n }\n\n visitTagPlaceholder(ph: i18n.TagPlaceholder, context: any): any {\n return ph.isVoid\n ? ``\n : `${ph.children\n .map((child) => child.visit(this))\n .join(', ')}`;\n }\n\n visitPlaceholder(ph: i18n.Placeholder, context: any): any {\n return ph.value ? `${ph.value}` : ``;\n }\n\n visitIcuPlaceholder(ph: i18n.IcuPlaceholder, context?: any): any {\n return `${ph.value.visit(this)}`;\n }\n\n visitBlockPlaceholder(ph: i18n.BlockPlaceholder, context: any): any {\n return `${ph.children\n .map((child) => child.visit(this))\n .join(', ')}`;\n }\n}\n\nconst serializerVisitor = new _SerializerVisitor();\n\nexport function serializeNodes(nodes: i18n.Node[]): string[] {\n return nodes.map((a) => a.visit(serializerVisitor, null));\n}\n\n/**\n * Serialize the i18n ast to something xml-like in order to generate an UID.\n *\n * Ignore the ICU expressions so that message IDs stays identical if only the expression changes.\n *\n * @internal\n */\nclass _SerializerIgnoreIcuExpVisitor extends _SerializerVisitor {\n override visitIcu(icu: i18n.Icu): string {\n let strCases = Object.keys(icu.cases).map((k: string) => `${k} {${icu.cases[k].visit(this)}}`);\n // Do not take the expression into account\n return `{${icu.type}, ${strCases.join(', ')}}`;\n }\n}\n\n/**\n * Compute the SHA1 of the given string\n *\n * see https://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf\n *\n * WARNING: this function has not been designed not tested with security in mind.\n * DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.\n */\nexport function sha1(str: string): string {\n textEncoder ??= new TextEncoder();\n const utf8 = [...textEncoder.encode(str)];\n const words32 = bytesToWords32(utf8, Endian.Big);\n const len = utf8.length * 8;\n\n const w = new Uint32Array(80);\n let a = 0x67452301,\n b = 0xefcdab89,\n c = 0x98badcfe,\n d = 0x10325476,\n e = 0xc3d2e1f0;\n\n words32[len >> 5] |= 0x80 << (24 - (len % 32));\n words32[(((len + 64) >> 9) << 4) + 15] = len;\n\n for (let i = 0; i < words32.length; i += 16) {\n const h0 = a,\n h1 = b,\n h2 = c,\n h3 = d,\n h4 = e;\n\n for (let j = 0; j < 80; j++) {\n if (j < 16) {\n w[j] = words32[i + j];\n } else {\n w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);\n }\n\n const fkVal = fk(j, b, c, d);\n const f = fkVal[0];\n const k = fkVal[1];\n const temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);\n e = d;\n d = c;\n c = rol32(b, 30);\n b = a;\n a = temp;\n }\n a = add32(a, h0);\n b = add32(b, h1);\n c = add32(c, h2);\n d = add32(d, h3);\n e = add32(e, h4);\n }\n\n // Convert the output parts to a 160-bit hexadecimal string\n return toHexU32(a) + toHexU32(b) + toHexU32(c) + toHexU32(d) + toHexU32(e);\n}\n\n/**\n * Convert and format a number as a string representing a 32-bit unsigned hexadecimal number.\n * @param value The value to format as a string.\n * @returns A hexadecimal string representing the value.\n */\nfunction toHexU32(value: number): string {\n // unsigned right shift of zero ensures an unsigned 32-bit number\n return (value >>> 0).toString(16).padStart(8, '0');\n}\n\nfunction fk(index: number, b: number, c: number, d: number): [number, number] {\n if (index < 20) {\n return [(b & c) | (~b & d), 0x5a827999];\n }\n\n if (index < 40) {\n return [b ^ c ^ d, 0x6ed9eba1];\n }\n\n if (index < 60) {\n return [(b & c) | (b & d) | (c & d), 0x8f1bbcdc];\n }\n\n return [b ^ c ^ d, 0xca62c1d6];\n}\n\n/**\n * Compute the fingerprint of the given string\n *\n * The output is 64 bit number encoded as a decimal string\n *\n * based on:\n * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java\n */\nexport function fingerprint(str: string): bigint {\n textEncoder ??= new TextEncoder();\n const utf8 = textEncoder.encode(str);\n const view = new DataView(utf8.buffer, utf8.byteOffset, utf8.byteLength);\n\n let hi = hash32(view, utf8.length, 0);\n let lo = hash32(view, utf8.length, 102072);\n\n if (hi == 0 && (lo == 0 || lo == 1)) {\n hi = hi ^ 0x130f9bef;\n lo = lo ^ -0x6b5f56d8;\n }\n\n return (BigInt.asUintN(32, BigInt(hi)) << BigInt(32)) | BigInt.asUintN(32, BigInt(lo));\n}\n\nexport function computeMsgId(msg: string, meaning: string = ''): string {\n let msgFingerprint = fingerprint(msg);\n\n if (meaning) {\n // Rotate the 64-bit message fingerprint one bit to the left and then add the meaning\n // fingerprint.\n msgFingerprint =\n BigInt.asUintN(64, msgFingerprint << BigInt(1)) |\n ((msgFingerprint >> BigInt(63)) & BigInt(1));\n msgFingerprint += fingerprint(meaning);\n }\n\n return BigInt.asUintN(63, msgFingerprint).toString();\n}\n\nfunction hash32(view: DataView, length: number, c: number): number {\n let a = 0x9e3779b9,\n b = 0x9e3779b9;\n let index = 0;\n\n const end = length - 12;\n for (; index <= end; index += 12) {\n a += view.getUint32(index, true);\n b += view.getUint32(index + 4, true);\n c += view.getUint32(index + 8, true);\n const res = mix(a, b, c);\n (a = res[0]), (b = res[1]), (c = res[2]);\n }\n\n const remainder = length - index;\n\n // the first byte of c is reserved for the length\n c += length;\n\n if (remainder >= 4) {\n a += view.getUint32(index, true);\n index += 4;\n\n if (remainder >= 8) {\n b += view.getUint32(index, true);\n index += 4;\n\n // Partial 32-bit word for c\n if (remainder >= 9) {\n c += view.getUint8(index++) << 8;\n }\n if (remainder >= 10) {\n c += view.getUint8(index++) << 16;\n }\n if (remainder === 11) {\n c += view.getUint8(index++) << 24;\n }\n } else {\n // Partial 32-bit word for b\n if (remainder >= 5) {\n b += view.getUint8(index++);\n }\n if (remainder >= 6) {\n b += view.getUint8(index++) << 8;\n }\n if (remainder === 7) {\n b += view.getUint8(index++) << 16;\n }\n }\n } else {\n // Partial 32-bit word for a\n if (remainder >= 1) {\n a += view.getUint8(index++);\n }\n if (remainder >= 2) {\n a += view.getUint8(index++) << 8;\n }\n if (remainder === 3) {\n a += view.getUint8(index++) << 16;\n }\n }\n\n return mix(a, b, c)[2];\n}\n\nfunction mix(a: number, b: number, c: number): [number, number, number] {\n a -= b;\n a -= c;\n a ^= c >>> 13;\n b -= c;\n b -= a;\n b ^= a << 8;\n c -= a;\n c -= b;\n c ^= b >>> 13;\n a -= b;\n a -= c;\n a ^= c >>> 12;\n b -= c;\n b -= a;\n b ^= a << 16;\n c -= a;\n c -= b;\n c ^= b >>> 5;\n a -= b;\n a -= c;\n a ^= c >>> 3;\n b -= c;\n b -= a;\n b ^= a << 10;\n c -= a;\n c -= b;\n c ^= b >>> 15;\n return [a, b, c];\n}\n\n// Utils\n\nenum Endian {\n Little,\n Big,\n}\n\nfunction add32(a: number, b: number): number {\n return add32to64(a, b)[1];\n}\n\nfunction add32to64(a: number, b: number): [number, number] {\n const low = (a & 0xffff) + (b & 0xffff);\n const high = (a >>> 16) + (b >>> 16) + (low >>> 16);\n return [high >>> 16, (high << 16) | (low & 0xffff)];\n}\n\n// Rotate a 32b number left `count` position\nfunction rol32(a: number, count: number): number {\n return (a << count) | (a >>> (32 - count));\n}\n\nfunction bytesToWords32(bytes: Byte[], endian: Endian): number[] {\n const size = (bytes.length + 3) >>> 2;\n const words32 = [];\n\n for (let i = 0; i < size; i++) {\n words32[i] = wordAt(bytes, i * 4, endian);\n }\n\n return words32;\n}\n\nfunction byteAt(bytes: Byte[], index: number): Byte {\n return index >= bytes.length ? 0 : bytes[index];\n}\n\nfunction wordAt(bytes: Byte[], index: number, endian: Endian): number {\n let word = 0;\n if (endian === Endian.Big) {\n for (let i = 0; i < 4; i++) {\n word += byteAt(bytes, index + i) << (24 - 8 * i);\n }\n } else {\n for (let i = 0; i < 4; i++) {\n word += byteAt(bytes, index + i) << (8 * i);\n }\n }\n return word;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {computeMsgId} from '../i18n/digest';\nimport {Message} from '../i18n/i18n_ast';\nimport {ParseSourceSpan} from '../parse_util';\nimport type {I18nMeta} from '../render3/view/i18n/meta';\n\n//// Types\nexport enum TypeModifier {\n None = 0,\n Const = 1 << 0,\n}\n\nexport abstract class Type {\n constructor(public modifiers: TypeModifier = TypeModifier.None) {}\n abstract visitType(visitor: TypeVisitor, context: any): any;\n\n hasModifier(modifier: TypeModifier): boolean {\n return (this.modifiers & modifier) !== 0;\n }\n}\n\nexport enum BuiltinTypeName {\n Dynamic,\n Bool,\n String,\n Int,\n Number,\n Function,\n Inferred,\n None,\n}\n\nexport class BuiltinType extends Type {\n constructor(\n public name: BuiltinTypeName,\n modifiers?: TypeModifier,\n ) {\n super(modifiers);\n }\n override visitType(visitor: TypeVisitor, context: any): any {\n return visitor.visitBuiltinType(this, context);\n }\n}\n\nexport class ExpressionType extends Type {\n constructor(\n public value: Expression,\n modifiers?: TypeModifier,\n public typeParams: Type[] | null = null,\n ) {\n super(modifiers);\n }\n override visitType(visitor: TypeVisitor, context: any): any {\n return visitor.visitExpressionType(this, context);\n }\n}\n\nexport class ArrayType extends Type {\n constructor(\n public of: Type,\n modifiers?: TypeModifier,\n ) {\n super(modifiers);\n }\n override visitType(visitor: TypeVisitor, context: any): any {\n return visitor.visitArrayType(this, context);\n }\n}\n\nexport class MapType extends Type {\n public valueType: Type | null;\n constructor(valueType: Type | null | undefined, modifiers?: TypeModifier) {\n super(modifiers);\n this.valueType = valueType || null;\n }\n override visitType(visitor: TypeVisitor, context: any): any {\n return visitor.visitMapType(this, context);\n }\n}\n\nexport class TransplantedType extends Type {\n constructor(\n readonly type: T,\n modifiers?: TypeModifier,\n ) {\n super(modifiers);\n }\n override visitType(visitor: TypeVisitor, context: any): any {\n return visitor.visitTransplantedType(this, context);\n }\n}\n\nexport const DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic);\nexport const INFERRED_TYPE = new BuiltinType(BuiltinTypeName.Inferred);\nexport const BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool);\nexport const INT_TYPE = new BuiltinType(BuiltinTypeName.Int);\nexport const NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number);\nexport const STRING_TYPE = new BuiltinType(BuiltinTypeName.String);\nexport const FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function);\nexport const NONE_TYPE = new BuiltinType(BuiltinTypeName.None);\n\nexport interface TypeVisitor {\n visitBuiltinType(type: BuiltinType, context: any): any;\n visitExpressionType(type: ExpressionType, context: any): any;\n visitArrayType(type: ArrayType, context: any): any;\n visitMapType(type: MapType, context: any): any;\n visitTransplantedType(type: TransplantedType, context: any): any;\n}\n\n///// Expressions\n\nexport enum UnaryOperator {\n Minus,\n Plus,\n}\n\nexport enum BinaryOperator {\n Equals,\n NotEquals,\n Identical,\n NotIdentical,\n Minus,\n Plus,\n Divide,\n Multiply,\n Modulo,\n And,\n Or,\n BitwiseOr,\n BitwiseAnd,\n Lower,\n LowerEquals,\n Bigger,\n BiggerEquals,\n NullishCoalesce,\n}\n\nexport function nullSafeIsEquivalent(\n base: T | null,\n other: T | null,\n) {\n if (base == null || other == null) {\n return base == other;\n }\n return base.isEquivalent(other);\n}\n\nfunction areAllEquivalentPredicate(\n base: T[],\n other: T[],\n equivalentPredicate: (baseElement: T, otherElement: T) => boolean,\n) {\n const len = base.length;\n if (len !== other.length) {\n return false;\n }\n for (let i = 0; i < len; i++) {\n if (!equivalentPredicate(base[i], other[i])) {\n return false;\n }\n }\n return true;\n}\n\nexport function areAllEquivalent(\n base: T[],\n other: T[],\n) {\n return areAllEquivalentPredicate(base, other, (baseElement: T, otherElement: T) =>\n baseElement.isEquivalent(otherElement),\n );\n}\n\nexport abstract class Expression {\n public type: Type | null;\n public sourceSpan: ParseSourceSpan | null;\n\n constructor(type: Type | null | undefined, sourceSpan?: ParseSourceSpan | null) {\n this.type = type || null;\n this.sourceSpan = sourceSpan || null;\n }\n\n abstract visitExpression(visitor: ExpressionVisitor, context: any): any;\n\n /**\n * Calculates whether this expression produces the same value as the given expression.\n * Note: We don't check Types nor ParseSourceSpans nor function arguments.\n */\n abstract isEquivalent(e: Expression): boolean;\n\n /**\n * Return true if the expression is constant.\n */\n abstract isConstant(): boolean;\n\n abstract clone(): Expression;\n\n prop(name: string, sourceSpan?: ParseSourceSpan | null): ReadPropExpr {\n return new ReadPropExpr(this, name, null, sourceSpan);\n }\n\n key(index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadKeyExpr {\n return new ReadKeyExpr(this, index, type, sourceSpan);\n }\n\n callFn(\n params: Expression[],\n sourceSpan?: ParseSourceSpan | null,\n pure?: boolean,\n ): InvokeFunctionExpr {\n return new InvokeFunctionExpr(this, params, null, sourceSpan, pure);\n }\n\n instantiate(\n params: Expression[],\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ): InstantiateExpr {\n return new InstantiateExpr(this, params, type, sourceSpan);\n }\n\n conditional(\n trueCase: Expression,\n falseCase: Expression | null = null,\n sourceSpan?: ParseSourceSpan | null,\n ): ConditionalExpr {\n return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);\n }\n\n equals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.Equals, this, rhs, null, sourceSpan);\n }\n notEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.NotEquals, this, rhs, null, sourceSpan);\n }\n identical(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.Identical, this, rhs, null, sourceSpan);\n }\n notIdentical(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.NotIdentical, this, rhs, null, sourceSpan);\n }\n minus(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.Minus, this, rhs, null, sourceSpan);\n }\n plus(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.Plus, this, rhs, null, sourceSpan);\n }\n divide(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.Divide, this, rhs, null, sourceSpan);\n }\n multiply(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.Multiply, this, rhs, null, sourceSpan);\n }\n modulo(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);\n }\n and(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);\n }\n bitwiseOr(\n rhs: Expression,\n sourceSpan?: ParseSourceSpan | null,\n parens: boolean = true,\n ): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.BitwiseOr, this, rhs, null, sourceSpan, parens);\n }\n bitwiseAnd(\n rhs: Expression,\n sourceSpan?: ParseSourceSpan | null,\n parens: boolean = true,\n ): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, this, rhs, null, sourceSpan, parens);\n }\n or(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan);\n }\n lower(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.Lower, this, rhs, null, sourceSpan);\n }\n lowerEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.LowerEquals, this, rhs, null, sourceSpan);\n }\n bigger(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.Bigger, this, rhs, null, sourceSpan);\n }\n biggerEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan);\n }\n isBlank(sourceSpan?: ParseSourceSpan | null): Expression {\n // Note: We use equals by purpose here to compare to null and undefined in JS.\n // We use the typed null to allow strictNullChecks to narrow types.\n return this.equals(TYPED_NULL_EXPR, sourceSpan);\n }\n nullishCoalesce(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr {\n return new BinaryOperatorExpr(BinaryOperator.NullishCoalesce, this, rhs, null, sourceSpan);\n }\n\n toStmt(): Statement {\n return new ExpressionStatement(this, null);\n }\n}\n\nexport class ReadVarExpr extends Expression {\n constructor(\n public name: string,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof ReadVarExpr && this.name === e.name;\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitReadVarExpr(this, context);\n }\n\n override clone(): ReadVarExpr {\n return new ReadVarExpr(this.name, this.type, this.sourceSpan);\n }\n\n set(value: Expression): WriteVarExpr {\n return new WriteVarExpr(this.name, value, null, this.sourceSpan);\n }\n}\n\nexport class TypeofExpr extends Expression {\n constructor(\n public expr: Expression,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any) {\n return visitor.visitTypeofExpr(this, context);\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof TypeofExpr && e.expr.isEquivalent(this.expr);\n }\n\n override isConstant(): boolean {\n return this.expr.isConstant();\n }\n\n override clone(): TypeofExpr {\n return new TypeofExpr(this.expr.clone());\n }\n}\n\nexport class WrappedNodeExpr extends Expression {\n constructor(\n public node: T,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof WrappedNodeExpr && this.node === e.node;\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitWrappedNodeExpr(this, context);\n }\n\n override clone(): WrappedNodeExpr {\n return new WrappedNodeExpr(this.node, this.type, this.sourceSpan);\n }\n}\n\nexport class WriteVarExpr extends Expression {\n public value: Expression;\n constructor(\n public name: string,\n value: Expression,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type || value.type, sourceSpan);\n this.value = value;\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof WriteVarExpr && this.name === e.name && this.value.isEquivalent(e.value);\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitWriteVarExpr(this, context);\n }\n\n override clone(): WriteVarExpr {\n return new WriteVarExpr(this.name, this.value.clone(), this.type, this.sourceSpan);\n }\n\n toDeclStmt(type?: Type | null, modifiers?: StmtModifier): DeclareVarStmt {\n return new DeclareVarStmt(this.name, this.value, type, modifiers, this.sourceSpan);\n }\n\n toConstDecl(): DeclareVarStmt {\n return this.toDeclStmt(INFERRED_TYPE, StmtModifier.Final);\n }\n}\n\nexport class WriteKeyExpr extends Expression {\n public value: Expression;\n constructor(\n public receiver: Expression,\n public index: Expression,\n value: Expression,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type || value.type, sourceSpan);\n this.value = value;\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof WriteKeyExpr &&\n this.receiver.isEquivalent(e.receiver) &&\n this.index.isEquivalent(e.index) &&\n this.value.isEquivalent(e.value)\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitWriteKeyExpr(this, context);\n }\n\n override clone(): WriteKeyExpr {\n return new WriteKeyExpr(\n this.receiver.clone(),\n this.index.clone(),\n this.value.clone(),\n this.type,\n this.sourceSpan,\n );\n }\n}\n\nexport class WritePropExpr extends Expression {\n public value: Expression;\n constructor(\n public receiver: Expression,\n public name: string,\n value: Expression,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type || value.type, sourceSpan);\n this.value = value;\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof WritePropExpr &&\n this.receiver.isEquivalent(e.receiver) &&\n this.name === e.name &&\n this.value.isEquivalent(e.value)\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitWritePropExpr(this, context);\n }\n\n override clone(): WritePropExpr {\n return new WritePropExpr(\n this.receiver.clone(),\n this.name,\n this.value.clone(),\n this.type,\n this.sourceSpan,\n );\n }\n}\n\nexport class InvokeFunctionExpr extends Expression {\n constructor(\n public fn: Expression,\n public args: Expression[],\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n public pure = false,\n ) {\n super(type, sourceSpan);\n }\n\n // An alias for fn, which allows other logic to handle calls and property reads together.\n get receiver(): Expression {\n return this.fn;\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof InvokeFunctionExpr &&\n this.fn.isEquivalent(e.fn) &&\n areAllEquivalent(this.args, e.args) &&\n this.pure === e.pure\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitInvokeFunctionExpr(this, context);\n }\n\n override clone(): InvokeFunctionExpr {\n return new InvokeFunctionExpr(\n this.fn.clone(),\n this.args.map((arg) => arg.clone()),\n this.type,\n this.sourceSpan,\n this.pure,\n );\n }\n}\n\nexport class TaggedTemplateLiteralExpr extends Expression {\n constructor(\n public tag: Expression,\n public template: TemplateLiteralExpr,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof TaggedTemplateLiteralExpr &&\n this.tag.isEquivalent(e.tag) &&\n this.template.isEquivalent(e.template)\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitTaggedTemplateLiteralExpr(this, context);\n }\n\n override clone(): TaggedTemplateLiteralExpr {\n return new TaggedTemplateLiteralExpr(\n this.tag.clone(),\n this.template.clone(),\n this.type,\n this.sourceSpan,\n );\n }\n}\n\nexport class InstantiateExpr extends Expression {\n constructor(\n public classExpr: Expression,\n public args: Expression[],\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof InstantiateExpr &&\n this.classExpr.isEquivalent(e.classExpr) &&\n areAllEquivalent(this.args, e.args)\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitInstantiateExpr(this, context);\n }\n\n override clone(): InstantiateExpr {\n return new InstantiateExpr(\n this.classExpr.clone(),\n this.args.map((arg) => arg.clone()),\n this.type,\n this.sourceSpan,\n );\n }\n}\n\nexport class LiteralExpr extends Expression {\n constructor(\n public value: number | string | boolean | null | undefined,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof LiteralExpr && this.value === e.value;\n }\n\n override isConstant() {\n return true;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitLiteralExpr(this, context);\n }\n\n override clone(): LiteralExpr {\n return new LiteralExpr(this.value, this.type, this.sourceSpan);\n }\n}\n\nexport class TemplateLiteralExpr extends Expression {\n constructor(\n public elements: TemplateLiteralElementExpr[],\n public expressions: Expression[],\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(null, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof TemplateLiteralExpr &&\n areAllEquivalentPredicate(this.elements, e.elements, (a, b) => a.text === b.text) &&\n areAllEquivalent(this.expressions, e.expressions)\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitTemplateLiteralExpr(this, context);\n }\n\n override clone(): TemplateLiteralExpr {\n return new TemplateLiteralExpr(\n this.elements.map((el) => el.clone()),\n this.expressions.map((expr) => expr.clone()),\n );\n }\n}\nexport class TemplateLiteralElementExpr extends Expression {\n readonly rawText: string;\n\n constructor(\n readonly text: string,\n sourceSpan?: ParseSourceSpan | null,\n rawText?: string,\n ) {\n super(STRING_TYPE, sourceSpan);\n\n // If `rawText` is not provided, \"fake\" the raw string by escaping the following sequences:\n // - \"\\\" would otherwise indicate that the next character is a control character.\n // - \"`\" and \"${\" are template string control sequences that would otherwise prematurely\n // indicate the end of the template literal element.\n // Note that we can't rely on the `sourceSpan` here, because it may be incorrect (see\n // https://github.com/angular/angular/pull/60267#discussion_r1986402524).\n this.rawText = rawText ?? escapeForTemplateLiteral(escapeSlashes(text));\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any) {\n return visitor.visitTemplateLiteralElementExpr(this, context);\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof TemplateLiteralElementExpr && e.text === this.text && e.rawText === this.rawText\n );\n }\n\n override isConstant(): boolean {\n return true;\n }\n\n override clone(): TemplateLiteralElementExpr {\n return new TemplateLiteralElementExpr(this.text, this.sourceSpan, this.rawText);\n }\n}\n\nexport class LiteralPiece {\n constructor(\n public text: string,\n public sourceSpan: ParseSourceSpan,\n ) {}\n}\nexport class PlaceholderPiece {\n /**\n * Create a new instance of a `PlaceholderPiece`.\n *\n * @param text the name of this placeholder (e.g. `PH_1`).\n * @param sourceSpan the location of this placeholder in its localized message the source code.\n * @param associatedMessage reference to another message that this placeholder is associated with.\n * The `associatedMessage` is mainly used to provide a relationship to an ICU message that has\n * been extracted out from the message containing the placeholder.\n */\n constructor(\n public text: string,\n public sourceSpan: ParseSourceSpan,\n public associatedMessage?: Message,\n ) {}\n}\n\nexport type MessagePiece = LiteralPiece | PlaceholderPiece;\n\nconst MEANING_SEPARATOR = '|';\nconst ID_SEPARATOR = '@@';\nconst LEGACY_ID_INDICATOR = '␟';\n\nexport class LocalizedString extends Expression {\n constructor(\n readonly metaBlock: I18nMeta,\n readonly messageParts: LiteralPiece[],\n readonly placeHolderNames: PlaceholderPiece[],\n readonly expressions: Expression[],\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(STRING_TYPE, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n // return e instanceof LocalizedString && this.message === e.message;\n return false;\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitLocalizedString(this, context);\n }\n\n override clone(): LocalizedString {\n return new LocalizedString(\n this.metaBlock,\n this.messageParts,\n this.placeHolderNames,\n this.expressions.map((expr) => expr.clone()),\n this.sourceSpan,\n );\n }\n\n /**\n * Serialize the given `meta` and `messagePart` into \"cooked\" and \"raw\" strings that can be used\n * in a `$localize` tagged string. The format of the metadata is the same as that parsed by\n * `parseI18nMeta()`.\n *\n * @param meta The metadata to serialize\n * @param messagePart The first part of the tagged string\n */\n serializeI18nHead(): CookedRawString {\n let metaBlock = this.metaBlock.description || '';\n if (this.metaBlock.meaning) {\n metaBlock = `${this.metaBlock.meaning}${MEANING_SEPARATOR}${metaBlock}`;\n }\n if (this.metaBlock.customId) {\n metaBlock = `${metaBlock}${ID_SEPARATOR}${this.metaBlock.customId}`;\n }\n if (this.metaBlock.legacyIds) {\n this.metaBlock.legacyIds.forEach((legacyId) => {\n metaBlock = `${metaBlock}${LEGACY_ID_INDICATOR}${legacyId}`;\n });\n }\n return createCookedRawString(\n metaBlock,\n this.messageParts[0].text,\n this.getMessagePartSourceSpan(0),\n );\n }\n\n getMessagePartSourceSpan(i: number): ParseSourceSpan | null {\n return this.messageParts[i]?.sourceSpan ?? this.sourceSpan;\n }\n\n getPlaceholderSourceSpan(i: number): ParseSourceSpan {\n return (\n this.placeHolderNames[i]?.sourceSpan ?? this.expressions[i]?.sourceSpan ?? this.sourceSpan\n );\n }\n\n /**\n * Serialize the given `placeholderName` and `messagePart` into \"cooked\" and \"raw\" strings that\n * can be used in a `$localize` tagged string.\n *\n * The format is `:[@@]:`.\n *\n * The `associated-id` is the message id of the (usually an ICU) message to which this placeholder\n * refers.\n *\n * @param partIndex The index of the message part to serialize.\n */\n serializeI18nTemplatePart(partIndex: number): CookedRawString {\n const placeholder = this.placeHolderNames[partIndex - 1];\n const messagePart = this.messageParts[partIndex];\n let metaBlock = placeholder.text;\n if (placeholder.associatedMessage?.legacyIds.length === 0) {\n metaBlock += `${ID_SEPARATOR}${computeMsgId(\n placeholder.associatedMessage.messageString,\n placeholder.associatedMessage.meaning,\n )}`;\n }\n return createCookedRawString(\n metaBlock,\n messagePart.text,\n this.getMessagePartSourceSpan(partIndex),\n );\n }\n}\n\n/**\n * A structure to hold the cooked and raw strings of a template literal element, along with its\n * source-span range.\n */\nexport interface CookedRawString {\n cooked: string;\n raw: string;\n range: ParseSourceSpan | null;\n}\n\nconst escapeSlashes = (str: string): string => str.replace(/\\\\/g, '\\\\\\\\');\nconst escapeStartingColon = (str: string): string => str.replace(/^:/, '\\\\:');\nconst escapeColons = (str: string): string => str.replace(/:/g, '\\\\:');\nconst escapeForTemplateLiteral = (str: string): string =>\n str.replace(/`/g, '\\\\`').replace(/\\${/g, '$\\\\{');\n\n/**\n * Creates a `{cooked, raw}` object from the `metaBlock` and `messagePart`.\n *\n * The `raw` text must have various character sequences escaped:\n * * \"\\\" would otherwise indicate that the next character is a control character.\n * * \"`\" and \"${\" are template string control sequences that would otherwise prematurely indicate\n * the end of a message part.\n * * \":\" inside a metablock would prematurely indicate the end of the metablock.\n * * \":\" at the start of a messagePart with no metablock would erroneously indicate the start of a\n * metablock.\n *\n * @param metaBlock Any metadata that should be prepended to the string\n * @param messagePart The message part of the string\n */\nfunction createCookedRawString(\n metaBlock: string,\n messagePart: string,\n range: ParseSourceSpan | null,\n): CookedRawString {\n if (metaBlock === '') {\n return {\n cooked: messagePart,\n raw: escapeForTemplateLiteral(escapeStartingColon(escapeSlashes(messagePart))),\n range,\n };\n } else {\n return {\n cooked: `:${metaBlock}:${messagePart}`,\n raw: escapeForTemplateLiteral(\n `:${escapeColons(escapeSlashes(metaBlock))}:${escapeSlashes(messagePart)}`,\n ),\n range,\n };\n }\n}\n\nexport class ExternalExpr extends Expression {\n constructor(\n public value: ExternalReference,\n type?: Type | null,\n public typeParams: Type[] | null = null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof ExternalExpr &&\n this.value.name === e.value.name &&\n this.value.moduleName === e.value.moduleName\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitExternalExpr(this, context);\n }\n\n override clone(): ExternalExpr {\n return new ExternalExpr(this.value, this.type, this.typeParams, this.sourceSpan);\n }\n}\n\nexport class ExternalReference {\n constructor(\n public moduleName: string | null,\n public name: string | null,\n ) {}\n // Note: no isEquivalent method here as we use this as an interface too.\n}\n\nexport class ConditionalExpr extends Expression {\n public trueCase: Expression;\n\n constructor(\n public condition: Expression,\n trueCase: Expression,\n public falseCase: Expression | null = null,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type || trueCase.type, sourceSpan);\n this.trueCase = trueCase;\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof ConditionalExpr &&\n this.condition.isEquivalent(e.condition) &&\n this.trueCase.isEquivalent(e.trueCase) &&\n nullSafeIsEquivalent(this.falseCase, e.falseCase)\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitConditionalExpr(this, context);\n }\n\n override clone(): ConditionalExpr {\n return new ConditionalExpr(\n this.condition.clone(),\n this.trueCase.clone(),\n this.falseCase?.clone(),\n this.type,\n this.sourceSpan,\n );\n }\n}\n\nexport class DynamicImportExpr extends Expression {\n constructor(\n public url: string | Expression,\n sourceSpan?: ParseSourceSpan | null,\n public urlComment?: string,\n ) {\n super(null, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof DynamicImportExpr && this.url === e.url && this.urlComment === e.urlComment;\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitDynamicImportExpr(this, context);\n }\n\n override clone(): DynamicImportExpr {\n return new DynamicImportExpr(\n typeof this.url === 'string' ? this.url : this.url.clone(),\n this.sourceSpan,\n this.urlComment,\n );\n }\n}\n\nexport class NotExpr extends Expression {\n constructor(\n public condition: Expression,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(BOOL_TYPE, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof NotExpr && this.condition.isEquivalent(e.condition);\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitNotExpr(this, context);\n }\n\n override clone(): NotExpr {\n return new NotExpr(this.condition.clone(), this.sourceSpan);\n }\n}\n\nexport class FnParam {\n constructor(\n public name: string,\n public type: Type | null = null,\n ) {}\n\n isEquivalent(param: FnParam): boolean {\n return this.name === param.name;\n }\n\n clone(): FnParam {\n return new FnParam(this.name, this.type);\n }\n}\n\nexport class FunctionExpr extends Expression {\n constructor(\n public params: FnParam[],\n public statements: Statement[],\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n public name?: string | null,\n ) {\n super(type, sourceSpan);\n }\n\n override isEquivalent(e: Expression | Statement): boolean {\n return (\n (e instanceof FunctionExpr || e instanceof DeclareFunctionStmt) &&\n areAllEquivalent(this.params, e.params) &&\n areAllEquivalent(this.statements, e.statements)\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitFunctionExpr(this, context);\n }\n\n toDeclStmt(name: string, modifiers?: StmtModifier): DeclareFunctionStmt {\n return new DeclareFunctionStmt(\n name,\n this.params,\n this.statements,\n this.type,\n modifiers,\n this.sourceSpan,\n );\n }\n\n override clone(): FunctionExpr {\n // TODO: Should we deep clone statements?\n return new FunctionExpr(\n this.params.map((p) => p.clone()),\n this.statements,\n this.type,\n this.sourceSpan,\n this.name,\n );\n }\n}\n\nexport class ArrowFunctionExpr extends Expression {\n // Note that `body: Expression` represents `() => expr` whereas\n // `body: Statement[]` represents `() => { expr }`.\n\n constructor(\n public params: FnParam[],\n public body: Expression | Statement[],\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n if (!(e instanceof ArrowFunctionExpr) || !areAllEquivalent(this.params, e.params)) {\n return false;\n }\n\n if (this.body instanceof Expression && e.body instanceof Expression) {\n return this.body.isEquivalent(e.body);\n }\n\n if (Array.isArray(this.body) && Array.isArray(e.body)) {\n return areAllEquivalent(this.body, e.body);\n }\n\n return false;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any) {\n return visitor.visitArrowFunctionExpr(this, context);\n }\n\n override clone(): Expression {\n // TODO: Should we deep clone statements?\n return new ArrowFunctionExpr(\n this.params.map((p) => p.clone()),\n Array.isArray(this.body) ? this.body : this.body.clone(),\n this.type,\n this.sourceSpan,\n );\n }\n\n toDeclStmt(name: string, modifiers?: StmtModifier): DeclareVarStmt {\n return new DeclareVarStmt(name, this, INFERRED_TYPE, modifiers, this.sourceSpan);\n }\n}\n\nexport class UnaryOperatorExpr extends Expression {\n constructor(\n public operator: UnaryOperator,\n public expr: Expression,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n public parens: boolean = true,\n ) {\n super(type || NUMBER_TYPE, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof UnaryOperatorExpr &&\n this.operator === e.operator &&\n this.expr.isEquivalent(e.expr)\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitUnaryOperatorExpr(this, context);\n }\n\n override clone(): UnaryOperatorExpr {\n return new UnaryOperatorExpr(\n this.operator,\n this.expr.clone(),\n this.type,\n this.sourceSpan,\n this.parens,\n );\n }\n}\n\nexport class BinaryOperatorExpr extends Expression {\n public lhs: Expression;\n constructor(\n public operator: BinaryOperator,\n lhs: Expression,\n public rhs: Expression,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n public parens: boolean = true,\n ) {\n super(type || lhs.type, sourceSpan);\n this.lhs = lhs;\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof BinaryOperatorExpr &&\n this.operator === e.operator &&\n this.lhs.isEquivalent(e.lhs) &&\n this.rhs.isEquivalent(e.rhs)\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitBinaryOperatorExpr(this, context);\n }\n\n override clone(): BinaryOperatorExpr {\n return new BinaryOperatorExpr(\n this.operator,\n this.lhs.clone(),\n this.rhs.clone(),\n this.type,\n this.sourceSpan,\n this.parens,\n );\n }\n}\n\nexport class ReadPropExpr extends Expression {\n constructor(\n public receiver: Expression,\n public name: string,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n }\n\n // An alias for name, which allows other logic to handle property reads and keyed reads together.\n get index() {\n return this.name;\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof ReadPropExpr && this.receiver.isEquivalent(e.receiver) && this.name === e.name\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitReadPropExpr(this, context);\n }\n\n set(value: Expression): WritePropExpr {\n return new WritePropExpr(this.receiver, this.name, value, null, this.sourceSpan);\n }\n\n override clone(): ReadPropExpr {\n return new ReadPropExpr(this.receiver.clone(), this.name, this.type, this.sourceSpan);\n }\n}\n\nexport class ReadKeyExpr extends Expression {\n constructor(\n public receiver: Expression,\n public index: Expression,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return (\n e instanceof ReadKeyExpr &&\n this.receiver.isEquivalent(e.receiver) &&\n this.index.isEquivalent(e.index)\n );\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitReadKeyExpr(this, context);\n }\n\n set(value: Expression): WriteKeyExpr {\n return new WriteKeyExpr(this.receiver, this.index, value, null, this.sourceSpan);\n }\n\n override clone(): ReadKeyExpr {\n return new ReadKeyExpr(this.receiver.clone(), this.index.clone(), this.type, this.sourceSpan);\n }\n}\n\nexport class LiteralArrayExpr extends Expression {\n public entries: Expression[];\n constructor(entries: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null) {\n super(type, sourceSpan);\n this.entries = entries;\n }\n\n override isConstant() {\n return this.entries.every((e) => e.isConstant());\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof LiteralArrayExpr && areAllEquivalent(this.entries, e.entries);\n }\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitLiteralArrayExpr(this, context);\n }\n\n override clone(): LiteralArrayExpr {\n return new LiteralArrayExpr(\n this.entries.map((e) => e.clone()),\n this.type,\n this.sourceSpan,\n );\n }\n}\n\nexport class LiteralMapEntry {\n constructor(\n public key: string,\n public value: Expression,\n public quoted: boolean,\n ) {}\n isEquivalent(e: LiteralMapEntry): boolean {\n return this.key === e.key && this.value.isEquivalent(e.value);\n }\n\n clone(): LiteralMapEntry {\n return new LiteralMapEntry(this.key, this.value.clone(), this.quoted);\n }\n}\n\nexport class LiteralMapExpr extends Expression {\n public valueType: Type | null = null;\n constructor(\n public entries: LiteralMapEntry[],\n type?: MapType | null,\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(type, sourceSpan);\n if (type) {\n this.valueType = type.valueType;\n }\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof LiteralMapExpr && areAllEquivalent(this.entries, e.entries);\n }\n\n override isConstant() {\n return this.entries.every((e) => e.value.isConstant());\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitLiteralMapExpr(this, context);\n }\n\n override clone(): LiteralMapExpr {\n const entriesClone = this.entries.map((entry) => entry.clone());\n return new LiteralMapExpr(entriesClone, this.type as MapType | null, this.sourceSpan);\n }\n}\n\nexport class CommaExpr extends Expression {\n constructor(\n public parts: Expression[],\n sourceSpan?: ParseSourceSpan | null,\n ) {\n super(parts[parts.length - 1].type, sourceSpan);\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof CommaExpr && areAllEquivalent(this.parts, e.parts);\n }\n\n override isConstant() {\n return false;\n }\n\n override visitExpression(visitor: ExpressionVisitor, context: any): any {\n return visitor.visitCommaExpr(this, context);\n }\n\n override clone(): CommaExpr {\n return new CommaExpr(this.parts.map((p) => p.clone()));\n }\n}\n\nexport interface ExpressionVisitor {\n visitReadVarExpr(ast: ReadVarExpr, context: any): any;\n visitWriteVarExpr(expr: WriteVarExpr, context: any): any;\n visitWriteKeyExpr(expr: WriteKeyExpr, context: any): any;\n visitWritePropExpr(expr: WritePropExpr, context: any): any;\n visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any;\n visitTaggedTemplateLiteralExpr(ast: TaggedTemplateLiteralExpr, context: any): any;\n visitTemplateLiteralExpr(ast: TemplateLiteralExpr, context: any): any;\n visitTemplateLiteralElementExpr(ast: TemplateLiteralElementExpr, context: any): any;\n visitInstantiateExpr(ast: InstantiateExpr, context: any): any;\n visitLiteralExpr(ast: LiteralExpr, context: any): any;\n visitLocalizedString(ast: LocalizedString, context: any): any;\n visitExternalExpr(ast: ExternalExpr, context: any): any;\n visitConditionalExpr(ast: ConditionalExpr, context: any): any;\n visitDynamicImportExpr(ast: DynamicImportExpr, context: any): any;\n visitNotExpr(ast: NotExpr, context: any): any;\n visitFunctionExpr(ast: FunctionExpr, context: any): any;\n visitUnaryOperatorExpr(ast: UnaryOperatorExpr, context: any): any;\n visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any;\n visitReadPropExpr(ast: ReadPropExpr, context: any): any;\n visitReadKeyExpr(ast: ReadKeyExpr, context: any): any;\n visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any;\n visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any;\n visitCommaExpr(ast: CommaExpr, context: any): any;\n visitWrappedNodeExpr(ast: WrappedNodeExpr, context: any): any;\n visitTypeofExpr(ast: TypeofExpr, context: any): any;\n visitArrowFunctionExpr(ast: ArrowFunctionExpr, context: any): any;\n}\n\nexport const NULL_EXPR = new LiteralExpr(null, null, null);\nexport const TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null);\n\n//// Statements\nexport enum StmtModifier {\n None = 0,\n Final = 1 << 0,\n Private = 1 << 1,\n Exported = 1 << 2,\n Static = 1 << 3,\n}\n\nexport class LeadingComment {\n constructor(\n public text: string,\n public multiline: boolean,\n public trailingNewline: boolean,\n ) {}\n toString() {\n return this.multiline ? ` ${this.text} ` : this.text;\n }\n}\nexport class JSDocComment extends LeadingComment {\n constructor(public tags: JSDocTag[]) {\n super('', /* multiline */ true, /* trailingNewline */ true);\n }\n override toString(): string {\n return serializeTags(this.tags);\n }\n}\n\nexport abstract class Statement {\n constructor(\n public modifiers: StmtModifier = StmtModifier.None,\n public sourceSpan: ParseSourceSpan | null = null,\n public leadingComments?: LeadingComment[],\n ) {}\n /**\n * Calculates whether this statement produces the same value as the given statement.\n * Note: We don't check Types nor ParseSourceSpans nor function arguments.\n */\n abstract isEquivalent(stmt: Statement): boolean;\n\n abstract visitStatement(visitor: StatementVisitor, context: any): any;\n\n hasModifier(modifier: StmtModifier): boolean {\n return (this.modifiers & modifier) !== 0;\n }\n\n addLeadingComment(leadingComment: LeadingComment): void {\n this.leadingComments = this.leadingComments ?? [];\n this.leadingComments.push(leadingComment);\n }\n}\n\nexport class DeclareVarStmt extends Statement {\n public type: Type | null;\n constructor(\n public name: string,\n public value?: Expression,\n type?: Type | null,\n modifiers?: StmtModifier,\n sourceSpan?: ParseSourceSpan | null,\n leadingComments?: LeadingComment[],\n ) {\n super(modifiers, sourceSpan, leadingComments);\n this.type = type || (value && value.type) || null;\n }\n override isEquivalent(stmt: Statement): boolean {\n return (\n stmt instanceof DeclareVarStmt &&\n this.name === stmt.name &&\n (this.value ? !!stmt.value && this.value.isEquivalent(stmt.value) : !stmt.value)\n );\n }\n override visitStatement(visitor: StatementVisitor, context: any): any {\n return visitor.visitDeclareVarStmt(this, context);\n }\n}\n\nexport class DeclareFunctionStmt extends Statement {\n public type: Type | null;\n constructor(\n public name: string,\n public params: FnParam[],\n public statements: Statement[],\n type?: Type | null,\n modifiers?: StmtModifier,\n sourceSpan?: ParseSourceSpan | null,\n leadingComments?: LeadingComment[],\n ) {\n super(modifiers, sourceSpan, leadingComments);\n this.type = type || null;\n }\n override isEquivalent(stmt: Statement): boolean {\n return (\n stmt instanceof DeclareFunctionStmt &&\n areAllEquivalent(this.params, stmt.params) &&\n areAllEquivalent(this.statements, stmt.statements)\n );\n }\n override visitStatement(visitor: StatementVisitor, context: any): any {\n return visitor.visitDeclareFunctionStmt(this, context);\n }\n}\n\nexport class ExpressionStatement extends Statement {\n constructor(\n public expr: Expression,\n sourceSpan?: ParseSourceSpan | null,\n leadingComments?: LeadingComment[],\n ) {\n super(StmtModifier.None, sourceSpan, leadingComments);\n }\n override isEquivalent(stmt: Statement): boolean {\n return stmt instanceof ExpressionStatement && this.expr.isEquivalent(stmt.expr);\n }\n override visitStatement(visitor: StatementVisitor, context: any): any {\n return visitor.visitExpressionStmt(this, context);\n }\n}\n\nexport class ReturnStatement extends Statement {\n constructor(\n public value: Expression,\n sourceSpan: ParseSourceSpan | null = null,\n leadingComments?: LeadingComment[],\n ) {\n super(StmtModifier.None, sourceSpan, leadingComments);\n }\n override isEquivalent(stmt: Statement): boolean {\n return stmt instanceof ReturnStatement && this.value.isEquivalent(stmt.value);\n }\n override visitStatement(visitor: StatementVisitor, context: any): any {\n return visitor.visitReturnStmt(this, context);\n }\n}\n\nexport class IfStmt extends Statement {\n constructor(\n public condition: Expression,\n public trueCase: Statement[],\n public falseCase: Statement[] = [],\n sourceSpan?: ParseSourceSpan | null,\n leadingComments?: LeadingComment[],\n ) {\n super(StmtModifier.None, sourceSpan, leadingComments);\n }\n override isEquivalent(stmt: Statement): boolean {\n return (\n stmt instanceof IfStmt &&\n this.condition.isEquivalent(stmt.condition) &&\n areAllEquivalent(this.trueCase, stmt.trueCase) &&\n areAllEquivalent(this.falseCase, stmt.falseCase)\n );\n }\n override visitStatement(visitor: StatementVisitor, context: any): any {\n return visitor.visitIfStmt(this, context);\n }\n}\n\nexport interface StatementVisitor {\n visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any;\n visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any;\n visitExpressionStmt(stmt: ExpressionStatement, context: any): any;\n visitReturnStmt(stmt: ReturnStatement, context: any): any;\n visitIfStmt(stmt: IfStmt, context: any): any;\n}\n\nexport class RecursiveAstVisitor implements StatementVisitor, ExpressionVisitor {\n visitType(ast: Type, context: any): any {\n return ast;\n }\n visitExpression(ast: Expression, context: any): any {\n if (ast.type) {\n ast.type.visitType(this, context);\n }\n return ast;\n }\n visitBuiltinType(type: BuiltinType, context: any): any {\n return this.visitType(type, context);\n }\n visitExpressionType(type: ExpressionType, context: any): any {\n type.value.visitExpression(this, context);\n if (type.typeParams !== null) {\n type.typeParams.forEach((param) => this.visitType(param, context));\n }\n return this.visitType(type, context);\n }\n visitArrayType(type: ArrayType, context: any): any {\n return this.visitType(type, context);\n }\n visitMapType(type: MapType, context: any): any {\n return this.visitType(type, context);\n }\n visitTransplantedType(type: TransplantedType, context: any): any {\n return type;\n }\n visitWrappedNodeExpr(ast: WrappedNodeExpr, context: any): any {\n return ast;\n }\n visitTypeofExpr(ast: TypeofExpr, context: any): any {\n return this.visitExpression(ast, context);\n }\n visitReadVarExpr(ast: ReadVarExpr, context: any): any {\n return this.visitExpression(ast, context);\n }\n visitWriteVarExpr(ast: WriteVarExpr, context: any): any {\n ast.value.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitWriteKeyExpr(ast: WriteKeyExpr, context: any): any {\n ast.receiver.visitExpression(this, context);\n ast.index.visitExpression(this, context);\n ast.value.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitWritePropExpr(ast: WritePropExpr, context: any): any {\n ast.receiver.visitExpression(this, context);\n ast.value.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitDynamicImportExpr(ast: DynamicImportExpr, context: any) {\n return this.visitExpression(ast, context);\n }\n visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any {\n ast.fn.visitExpression(this, context);\n this.visitAllExpressions(ast.args, context);\n return this.visitExpression(ast, context);\n }\n visitTaggedTemplateLiteralExpr(ast: TaggedTemplateLiteralExpr, context: any): any {\n ast.tag.visitExpression(this, context);\n ast.template.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitInstantiateExpr(ast: InstantiateExpr, context: any): any {\n ast.classExpr.visitExpression(this, context);\n this.visitAllExpressions(ast.args, context);\n return this.visitExpression(ast, context);\n }\n visitLiteralExpr(ast: LiteralExpr, context: any): any {\n return this.visitExpression(ast, context);\n }\n visitLocalizedString(ast: LocalizedString, context: any): any {\n return this.visitExpression(ast, context);\n }\n visitExternalExpr(ast: ExternalExpr, context: any): any {\n if (ast.typeParams) {\n ast.typeParams.forEach((type) => type.visitType(this, context));\n }\n return this.visitExpression(ast, context);\n }\n visitConditionalExpr(ast: ConditionalExpr, context: any): any {\n ast.condition.visitExpression(this, context);\n ast.trueCase.visitExpression(this, context);\n ast.falseCase!.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitNotExpr(ast: NotExpr, context: any): any {\n ast.condition.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitFunctionExpr(ast: FunctionExpr, context: any): any {\n this.visitAllStatements(ast.statements, context);\n return this.visitExpression(ast, context);\n }\n visitArrowFunctionExpr(ast: ArrowFunctionExpr, context: any): any {\n if (Array.isArray(ast.body)) {\n this.visitAllStatements(ast.body, context);\n } else {\n // Note: `body.visitExpression`, rather than `this.visitExpressiont(body)`,\n // because the latter won't recurse into the sub-expressions.\n ast.body.visitExpression(this, context);\n }\n\n return this.visitExpression(ast, context);\n }\n visitUnaryOperatorExpr(ast: UnaryOperatorExpr, context: any): any {\n ast.expr.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any {\n ast.lhs.visitExpression(this, context);\n ast.rhs.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitReadPropExpr(ast: ReadPropExpr, context: any): any {\n ast.receiver.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitReadKeyExpr(ast: ReadKeyExpr, context: any): any {\n ast.receiver.visitExpression(this, context);\n ast.index.visitExpression(this, context);\n return this.visitExpression(ast, context);\n }\n visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any {\n this.visitAllExpressions(ast.entries, context);\n return this.visitExpression(ast, context);\n }\n visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any {\n ast.entries.forEach((entry) => entry.value.visitExpression(this, context));\n return this.visitExpression(ast, context);\n }\n visitCommaExpr(ast: CommaExpr, context: any): any {\n this.visitAllExpressions(ast.parts, context);\n return this.visitExpression(ast, context);\n }\n visitTemplateLiteralExpr(ast: TemplateLiteralExpr, context: any) {\n this.visitAllExpressions(ast.elements, context);\n this.visitAllExpressions(ast.expressions, context);\n return this.visitExpression(ast, context);\n }\n visitTemplateLiteralElementExpr(ast: TemplateLiteralElementExpr, context: any) {\n return this.visitExpression(ast, context);\n }\n visitAllExpressions(exprs: Expression[], context: any): void {\n exprs.forEach((expr) => expr.visitExpression(this, context));\n }\n\n visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any {\n if (stmt.value) {\n stmt.value.visitExpression(this, context);\n }\n if (stmt.type) {\n stmt.type.visitType(this, context);\n }\n return stmt;\n }\n visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any {\n this.visitAllStatements(stmt.statements, context);\n if (stmt.type) {\n stmt.type.visitType(this, context);\n }\n return stmt;\n }\n visitExpressionStmt(stmt: ExpressionStatement, context: any): any {\n stmt.expr.visitExpression(this, context);\n return stmt;\n }\n visitReturnStmt(stmt: ReturnStatement, context: any): any {\n stmt.value.visitExpression(this, context);\n return stmt;\n }\n visitIfStmt(stmt: IfStmt, context: any): any {\n stmt.condition.visitExpression(this, context);\n this.visitAllStatements(stmt.trueCase, context);\n this.visitAllStatements(stmt.falseCase, context);\n return stmt;\n }\n visitAllStatements(stmts: Statement[], context: any): void {\n stmts.forEach((stmt) => stmt.visitStatement(this, context));\n }\n}\n\nexport function leadingComment(\n text: string,\n multiline: boolean = false,\n trailingNewline: boolean = true,\n): LeadingComment {\n return new LeadingComment(text, multiline, trailingNewline);\n}\n\nexport function jsDocComment(tags: JSDocTag[] = []): JSDocComment {\n return new JSDocComment(tags);\n}\n\nexport function variable(\n name: string,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n): ReadVarExpr {\n return new ReadVarExpr(name, type, sourceSpan);\n}\n\nexport function importExpr(\n id: ExternalReference,\n typeParams: Type[] | null = null,\n sourceSpan?: ParseSourceSpan | null,\n): ExternalExpr {\n return new ExternalExpr(id, null, typeParams, sourceSpan);\n}\n\nexport function importType(\n id: ExternalReference,\n typeParams?: Type[] | null,\n typeModifiers?: TypeModifier,\n): ExpressionType | null {\n return id != null ? expressionType(importExpr(id, typeParams, null), typeModifiers) : null;\n}\n\nexport function expressionType(\n expr: Expression,\n typeModifiers?: TypeModifier,\n typeParams?: Type[] | null,\n): ExpressionType {\n return new ExpressionType(expr, typeModifiers, typeParams);\n}\n\nexport function transplantedType(type: T, typeModifiers?: TypeModifier): TransplantedType {\n return new TransplantedType(type, typeModifiers);\n}\n\nexport function typeofExpr(expr: Expression) {\n return new TypeofExpr(expr);\n}\n\nexport function literalArr(\n values: Expression[],\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n): LiteralArrayExpr {\n return new LiteralArrayExpr(values, type, sourceSpan);\n}\n\nexport function literalMap(\n values: {key: string; quoted: boolean; value: Expression}[],\n type: MapType | null = null,\n): LiteralMapExpr {\n return new LiteralMapExpr(\n values.map((e) => new LiteralMapEntry(e.key, e.value, e.quoted)),\n type,\n null,\n );\n}\n\nexport function unary(\n operator: UnaryOperator,\n expr: Expression,\n type?: Type,\n sourceSpan?: ParseSourceSpan | null,\n): UnaryOperatorExpr {\n return new UnaryOperatorExpr(operator, expr, type, sourceSpan);\n}\n\nexport function not(expr: Expression, sourceSpan?: ParseSourceSpan | null): NotExpr {\n return new NotExpr(expr, sourceSpan);\n}\n\nexport function fn(\n params: FnParam[],\n body: Statement[],\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n name?: string | null,\n): FunctionExpr {\n return new FunctionExpr(params, body, type, sourceSpan, name);\n}\n\nexport function arrowFn(\n params: FnParam[],\n body: Expression | Statement[],\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n) {\n return new ArrowFunctionExpr(params, body, type, sourceSpan);\n}\n\nexport function ifStmt(\n condition: Expression,\n thenClause: Statement[],\n elseClause?: Statement[],\n sourceSpan?: ParseSourceSpan,\n leadingComments?: LeadingComment[],\n) {\n return new IfStmt(condition, thenClause, elseClause, sourceSpan, leadingComments);\n}\n\nexport function taggedTemplate(\n tag: Expression,\n template: TemplateLiteralExpr,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n): TaggedTemplateLiteralExpr {\n return new TaggedTemplateLiteralExpr(tag, template, type, sourceSpan);\n}\n\nexport function literal(\n value: any,\n type?: Type | null,\n sourceSpan?: ParseSourceSpan | null,\n): LiteralExpr {\n return new LiteralExpr(value, type, sourceSpan);\n}\n\nexport function localizedString(\n metaBlock: I18nMeta,\n messageParts: LiteralPiece[],\n placeholderNames: PlaceholderPiece[],\n expressions: Expression[],\n sourceSpan?: ParseSourceSpan | null,\n): LocalizedString {\n return new LocalizedString(metaBlock, messageParts, placeholderNames, expressions, sourceSpan);\n}\n\nexport function isNull(exp: Expression): boolean {\n return exp instanceof LiteralExpr && exp.value === null;\n}\n\n// The list of JSDoc tags that we currently support. Extend it if needed.\nexport const enum JSDocTagName {\n Desc = 'desc',\n Id = 'id',\n Meaning = 'meaning',\n Suppress = 'suppress',\n}\n\n/*\n * TypeScript has an API for JSDoc already, but it's not exposed.\n * https://github.com/Microsoft/TypeScript/issues/7393\n * For now we create types that are similar to theirs so that migrating\n * to their API will be easier. See e.g. `ts.JSDocTag` and `ts.JSDocComment`.\n */\nexport type JSDocTag =\n | {\n // `tagName` is e.g. \"param\" in an `@param` declaration\n tagName: JSDocTagName | string;\n // Any remaining text on the tag, e.g. the description\n text?: string;\n }\n | {\n // no `tagName` for plain text documentation that occurs before any `@param` lines\n tagName?: undefined;\n text: string;\n };\n\n/*\n * Serializes a `Tag` into a string.\n * Returns a string like \" @foo {bar} baz\" (note the leading whitespace before `@foo`).\n */\nfunction tagToString(tag: JSDocTag): string {\n let out = '';\n if (tag.tagName) {\n out += ` @${tag.tagName}`;\n }\n if (tag.text) {\n if (tag.text.match(/\\/\\*|\\*\\//)) {\n throw new Error('JSDoc text cannot contain \"/*\" and \"*/\"');\n }\n out += ' ' + tag.text.replace(/@/g, '\\\\@');\n }\n return out;\n}\n\nfunction serializeTags(tags: JSDocTag[]): string {\n if (tags.length === 0) return '';\n\n if (tags.length === 1 && tags[0].tagName && !tags[0].text) {\n // The JSDOC comment is a single simple tag: e.g `/** @tagname */`.\n return `*${tagToString(tags[0])} `;\n }\n\n let out = '*\\n';\n for (const tag of tags) {\n out += ' *';\n // If the tagToString is multi-line, insert \" * \" prefixes on lines.\n out += tagToString(tag).replace(/\\n/g, '\\n * ');\n out += '\\n';\n }\n out += ' ';\n return out;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from './output/output_ast';\n\nconst CONSTANT_PREFIX = '_c';\n\n/**\n * `ConstantPool` tries to reuse literal factories when two or more literals are identical.\n * We determine whether literals are identical by creating a key out of their AST using the\n * `KeyVisitor`. This constant is used to replace dynamic expressions which can't be safely\n * converted into a key. E.g. given an expression `{foo: bar()}`, since we don't know what\n * the result of `bar` will be, we create a key that looks like `{foo: }`. Note\n * that we use a variable, rather than something like `null` in order to avoid collisions.\n */\nconst UNKNOWN_VALUE_KEY = o.variable('');\n\n/**\n * Context to use when producing a key.\n *\n * This ensures we see the constant not the reference variable when producing\n * a key.\n */\nconst KEY_CONTEXT = {};\n\n/**\n * Generally all primitive values are excluded from the `ConstantPool`, but there is an exclusion\n * for strings that reach a certain length threshold. This constant defines the length threshold for\n * strings.\n */\nconst POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS = 50;\n\n/**\n * A node that is a place-holder that allows the node to be replaced when the actual\n * node is known.\n *\n * This allows the constant pool to change an expression from a direct reference to\n * a constant to a shared constant. It returns a fix-up node that is later allowed to\n * change the referenced expression.\n */\nclass FixupExpression extends o.Expression {\n private original: o.Expression;\n\n shared = false;\n\n constructor(public resolved: o.Expression) {\n super(resolved.type);\n this.original = resolved;\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {\n if (context === KEY_CONTEXT) {\n // When producing a key we want to traverse the constant not the\n // variable used to refer to it.\n return this.original.visitExpression(visitor, context);\n } else {\n return this.resolved.visitExpression(visitor, context);\n }\n }\n\n override isEquivalent(e: o.Expression): boolean {\n return e instanceof FixupExpression && this.resolved.isEquivalent(e.resolved);\n }\n\n override isConstant() {\n return true;\n }\n\n override clone(): FixupExpression {\n throw new Error(`Not supported.`);\n }\n\n fixup(expression: o.Expression) {\n this.resolved = expression;\n this.shared = true;\n }\n}\n\n/**\n * A constant pool allows a code emitter to share constant in an output context.\n *\n * The constant pool also supports sharing access to ivy definitions references.\n */\nexport class ConstantPool {\n statements: o.Statement[] = [];\n private literals = new Map();\n private literalFactories = new Map();\n private sharedConstants = new Map();\n\n /**\n * Constant pool also tracks claimed names from {@link uniqueName}.\n * This is useful to avoid collisions if variables are intended to be\n * named a certain way- but may conflict. We wouldn't want to always suffix\n * them with unique numbers.\n */\n private _claimedNames = new Map();\n\n private nextNameIndex = 0;\n\n constructor(private readonly isClosureCompilerEnabled: boolean = false) {}\n\n getConstLiteral(literal: o.Expression, forceShared?: boolean): o.Expression {\n if (\n (literal instanceof o.LiteralExpr && !isLongStringLiteral(literal)) ||\n literal instanceof FixupExpression\n ) {\n // Do no put simple literals into the constant pool or try to produce a constant for a\n // reference to a constant.\n return literal;\n }\n const key = GenericKeyFn.INSTANCE.keyOf(literal);\n let fixup = this.literals.get(key);\n let newValue = false;\n if (!fixup) {\n fixup = new FixupExpression(literal);\n this.literals.set(key, fixup);\n newValue = true;\n }\n\n if ((!newValue && !fixup.shared) || (newValue && forceShared)) {\n // Replace the expression with a variable\n const name = this.freshName();\n let definition: o.WriteVarExpr;\n let usage: o.Expression;\n if (this.isClosureCompilerEnabled && isLongStringLiteral(literal)) {\n // For string literals, Closure will **always** inline the string at\n // **all** usages, duplicating it each time. For large strings, this\n // unnecessarily bloats bundle size. To work around this restriction, we\n // wrap the string in a function, and call that function for each usage.\n // This tricks Closure into using inline logic for functions instead of\n // string literals. Function calls are only inlined if the body is small\n // enough to be worth it. By doing this, very large strings will be\n // shared across multiple usages, rather than duplicating the string at\n // each usage site.\n //\n // const myStr = function() { return \"very very very long string\"; };\n // const usage1 = myStr();\n // const usage2 = myStr();\n definition = o.variable(name).set(\n new o.FunctionExpr(\n [], // Params.\n [\n // Statements.\n new o.ReturnStatement(literal),\n ],\n ),\n );\n usage = o.variable(name).callFn([]);\n } else {\n // Just declare and use the variable directly, without a function call\n // indirection. This saves a few bytes and avoids an unnecessary call.\n definition = o.variable(name).set(literal);\n usage = o.variable(name);\n }\n\n this.statements.push(definition.toDeclStmt(o.INFERRED_TYPE, o.StmtModifier.Final));\n fixup.fixup(usage);\n }\n\n return fixup;\n }\n\n getSharedConstant(def: SharedConstantDefinition, expr: o.Expression): o.Expression {\n const key = def.keyOf(expr);\n if (!this.sharedConstants.has(key)) {\n const id = this.freshName();\n this.sharedConstants.set(key, o.variable(id));\n this.statements.push(def.toSharedConstantDeclaration(id, expr));\n }\n return this.sharedConstants.get(key)!;\n }\n\n getLiteralFactory(literal: o.LiteralArrayExpr | o.LiteralMapExpr): {\n literalFactory: o.Expression;\n literalFactoryArguments: o.Expression[];\n } {\n // Create a pure function that builds an array of a mix of constant and variable expressions\n if (literal instanceof o.LiteralArrayExpr) {\n const argumentsForKey = literal.entries.map((e) => (e.isConstant() ? e : UNKNOWN_VALUE_KEY));\n const key = GenericKeyFn.INSTANCE.keyOf(o.literalArr(argumentsForKey));\n return this._getLiteralFactory(key, literal.entries, (entries) => o.literalArr(entries));\n } else {\n const expressionForKey = o.literalMap(\n literal.entries.map((e) => ({\n key: e.key,\n value: e.value.isConstant() ? e.value : UNKNOWN_VALUE_KEY,\n quoted: e.quoted,\n })),\n );\n const key = GenericKeyFn.INSTANCE.keyOf(expressionForKey);\n return this._getLiteralFactory(\n key,\n literal.entries.map((e) => e.value),\n (entries) =>\n o.literalMap(\n entries.map((value, index) => ({\n key: literal.entries[index].key,\n value,\n quoted: literal.entries[index].quoted,\n })),\n ),\n );\n }\n }\n\n // TODO: useUniqueName(false) is necessary for naming compatibility with\n // TemplateDefinitionBuilder, but should be removed once Template Pipeline is the default.\n getSharedFunctionReference(\n fn: o.Expression,\n prefix: string,\n useUniqueName: boolean = true,\n ): o.Expression {\n const isArrow = fn instanceof o.ArrowFunctionExpr;\n\n for (const current of this.statements) {\n // Arrow functions are saved as variables so we check if the\n // value of the variable is the same as the arrow function.\n if (isArrow && current instanceof o.DeclareVarStmt && current.value?.isEquivalent(fn)) {\n return o.variable(current.name);\n }\n\n // Function declarations are saved as function statements\n // so we compare them directly to the passed-in function.\n if (\n !isArrow &&\n current instanceof o.DeclareFunctionStmt &&\n fn instanceof o.FunctionExpr &&\n fn.isEquivalent(current)\n ) {\n return o.variable(current.name);\n }\n }\n\n // Otherwise declare the function.\n const name = useUniqueName ? this.uniqueName(prefix) : prefix;\n this.statements.push(\n fn instanceof o.FunctionExpr\n ? fn.toDeclStmt(name, o.StmtModifier.Final)\n : new o.DeclareVarStmt(name, fn, o.INFERRED_TYPE, o.StmtModifier.Final, fn.sourceSpan),\n );\n return o.variable(name);\n }\n\n private _getLiteralFactory(\n key: string,\n values: o.Expression[],\n resultMap: (parameters: o.Expression[]) => o.Expression,\n ): {literalFactory: o.Expression; literalFactoryArguments: o.Expression[]} {\n let literalFactory = this.literalFactories.get(key);\n const literalFactoryArguments = values.filter((e) => !e.isConstant());\n if (!literalFactory) {\n const resultExpressions = values.map((e, index) =>\n e.isConstant() ? this.getConstLiteral(e, true) : o.variable(`a${index}`),\n );\n const parameters = resultExpressions\n .filter(isVariable)\n .map((e) => new o.FnParam(e.name!, o.DYNAMIC_TYPE));\n const pureFunctionDeclaration = o.arrowFn(\n parameters,\n resultMap(resultExpressions),\n o.INFERRED_TYPE,\n );\n const name = this.freshName();\n this.statements.push(\n o\n .variable(name)\n .set(pureFunctionDeclaration)\n .toDeclStmt(o.INFERRED_TYPE, o.StmtModifier.Final),\n );\n literalFactory = o.variable(name);\n this.literalFactories.set(key, literalFactory);\n }\n return {literalFactory, literalFactoryArguments};\n }\n\n /**\n * Produce a unique name in the context of this pool.\n *\n * The name might be unique among different prefixes if any of the prefixes end in\n * a digit so the prefix should be a constant string (not based on user input) and\n * must not end in a digit.\n */\n uniqueName(name: string, alwaysIncludeSuffix = true): string {\n const count = this._claimedNames.get(name) ?? 0;\n const result = count === 0 && !alwaysIncludeSuffix ? `${name}` : `${name}${count}`;\n\n this._claimedNames.set(name, count + 1);\n return result;\n }\n\n private freshName(): string {\n return this.uniqueName(CONSTANT_PREFIX);\n }\n}\n\nexport interface ExpressionKeyFn {\n keyOf(expr: o.Expression): string;\n}\n\nexport interface SharedConstantDefinition extends ExpressionKeyFn {\n toSharedConstantDeclaration(declName: string, keyExpr: o.Expression): o.Statement;\n}\n\nexport class GenericKeyFn implements ExpressionKeyFn {\n static readonly INSTANCE = new GenericKeyFn();\n\n keyOf(expr: o.Expression): string {\n if (expr instanceof o.LiteralExpr && typeof expr.value === 'string') {\n return `\"${expr.value}\"`;\n } else if (expr instanceof o.LiteralExpr) {\n return String(expr.value);\n } else if (expr instanceof o.LiteralArrayExpr) {\n const entries: string[] = [];\n for (const entry of expr.entries) {\n entries.push(this.keyOf(entry));\n }\n return `[${entries.join(',')}]`;\n } else if (expr instanceof o.LiteralMapExpr) {\n const entries: string[] = [];\n for (const entry of expr.entries) {\n let key = entry.key;\n if (entry.quoted) {\n key = `\"${key}\"`;\n }\n entries.push(key + ':' + this.keyOf(entry.value));\n }\n return `{${entries.join(',')}}`;\n } else if (expr instanceof o.ExternalExpr) {\n return `import(\"${expr.value.moduleName}\", ${expr.value.name})`;\n } else if (expr instanceof o.ReadVarExpr) {\n return `read(${expr.name})`;\n } else if (expr instanceof o.TypeofExpr) {\n return `typeof(${this.keyOf(expr.expr)})`;\n } else {\n throw new Error(\n `${this.constructor.name} does not handle expressions of type ${expr.constructor.name}`,\n );\n }\n }\n}\n\nfunction isVariable(e: o.Expression): e is o.ReadVarExpr {\n return e instanceof o.ReadVarExpr;\n}\n\nfunction isLongStringLiteral(expr: o.Expression): boolean {\n return (\n expr instanceof o.LiteralExpr &&\n typeof expr.value === 'string' &&\n expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../output/output_ast';\n\nconst CORE = '@angular/core';\n\nexport class Identifiers {\n /* Methods */\n static NEW_METHOD = 'factory';\n static TRANSFORM_METHOD = 'transform';\n static PATCH_DEPS = 'patchedDeps';\n\n static core: o.ExternalReference = {name: null, moduleName: CORE};\n\n /* Instructions */\n static namespaceHTML: o.ExternalReference = {name: 'ɵɵnamespaceHTML', moduleName: CORE};\n\n static namespaceMathML: o.ExternalReference = {name: 'ɵɵnamespaceMathML', moduleName: CORE};\n\n static namespaceSVG: o.ExternalReference = {name: 'ɵɵnamespaceSVG', moduleName: CORE};\n\n static element: o.ExternalReference = {name: 'ɵɵelement', moduleName: CORE};\n\n static elementStart: o.ExternalReference = {name: 'ɵɵelementStart', moduleName: CORE};\n\n static elementEnd: o.ExternalReference = {name: 'ɵɵelementEnd', moduleName: CORE};\n\n static advance: o.ExternalReference = {name: 'ɵɵadvance', moduleName: CORE};\n\n static syntheticHostProperty: o.ExternalReference = {\n name: 'ɵɵsyntheticHostProperty',\n moduleName: CORE,\n };\n\n static syntheticHostListener: o.ExternalReference = {\n name: 'ɵɵsyntheticHostListener',\n moduleName: CORE,\n };\n\n static attribute: o.ExternalReference = {name: 'ɵɵattribute', moduleName: CORE};\n\n static attributeInterpolate1: o.ExternalReference = {\n name: 'ɵɵattributeInterpolate1',\n moduleName: CORE,\n };\n static attributeInterpolate2: o.ExternalReference = {\n name: 'ɵɵattributeInterpolate2',\n moduleName: CORE,\n };\n static attributeInterpolate3: o.ExternalReference = {\n name: 'ɵɵattributeInterpolate3',\n moduleName: CORE,\n };\n static attributeInterpolate4: o.ExternalReference = {\n name: 'ɵɵattributeInterpolate4',\n moduleName: CORE,\n };\n static attributeInterpolate5: o.ExternalReference = {\n name: 'ɵɵattributeInterpolate5',\n moduleName: CORE,\n };\n static attributeInterpolate6: o.ExternalReference = {\n name: 'ɵɵattributeInterpolate6',\n moduleName: CORE,\n };\n static attributeInterpolate7: o.ExternalReference = {\n name: 'ɵɵattributeInterpolate7',\n moduleName: CORE,\n };\n static attributeInterpolate8: o.ExternalReference = {\n name: 'ɵɵattributeInterpolate8',\n moduleName: CORE,\n };\n static attributeInterpolateV: o.ExternalReference = {\n name: 'ɵɵattributeInterpolateV',\n moduleName: CORE,\n };\n\n static classProp: o.ExternalReference = {name: 'ɵɵclassProp', moduleName: CORE};\n\n static elementContainerStart: o.ExternalReference = {\n name: 'ɵɵelementContainerStart',\n moduleName: CORE,\n };\n\n static elementContainerEnd: o.ExternalReference = {\n name: 'ɵɵelementContainerEnd',\n moduleName: CORE,\n };\n\n static elementContainer: o.ExternalReference = {name: 'ɵɵelementContainer', moduleName: CORE};\n\n static styleMap: o.ExternalReference = {name: 'ɵɵstyleMap', moduleName: CORE};\n\n static styleMapInterpolate1: o.ExternalReference = {\n name: 'ɵɵstyleMapInterpolate1',\n moduleName: CORE,\n };\n static styleMapInterpolate2: o.ExternalReference = {\n name: 'ɵɵstyleMapInterpolate2',\n moduleName: CORE,\n };\n static styleMapInterpolate3: o.ExternalReference = {\n name: 'ɵɵstyleMapInterpolate3',\n moduleName: CORE,\n };\n static styleMapInterpolate4: o.ExternalReference = {\n name: 'ɵɵstyleMapInterpolate4',\n moduleName: CORE,\n };\n static styleMapInterpolate5: o.ExternalReference = {\n name: 'ɵɵstyleMapInterpolate5',\n moduleName: CORE,\n };\n static styleMapInterpolate6: o.ExternalReference = {\n name: 'ɵɵstyleMapInterpolate6',\n moduleName: CORE,\n };\n static styleMapInterpolate7: o.ExternalReference = {\n name: 'ɵɵstyleMapInterpolate7',\n moduleName: CORE,\n };\n static styleMapInterpolate8: o.ExternalReference = {\n name: 'ɵɵstyleMapInterpolate8',\n moduleName: CORE,\n };\n static styleMapInterpolateV: o.ExternalReference = {\n name: 'ɵɵstyleMapInterpolateV',\n moduleName: CORE,\n };\n\n static classMap: o.ExternalReference = {name: 'ɵɵclassMap', moduleName: CORE};\n\n static classMapInterpolate1: o.ExternalReference = {\n name: 'ɵɵclassMapInterpolate1',\n moduleName: CORE,\n };\n static classMapInterpolate2: o.ExternalReference = {\n name: 'ɵɵclassMapInterpolate2',\n moduleName: CORE,\n };\n static classMapInterpolate3: o.ExternalReference = {\n name: 'ɵɵclassMapInterpolate3',\n moduleName: CORE,\n };\n static classMapInterpolate4: o.ExternalReference = {\n name: 'ɵɵclassMapInterpolate4',\n moduleName: CORE,\n };\n static classMapInterpolate5: o.ExternalReference = {\n name: 'ɵɵclassMapInterpolate5',\n moduleName: CORE,\n };\n static classMapInterpolate6: o.ExternalReference = {\n name: 'ɵɵclassMapInterpolate6',\n moduleName: CORE,\n };\n static classMapInterpolate7: o.ExternalReference = {\n name: 'ɵɵclassMapInterpolate7',\n moduleName: CORE,\n };\n static classMapInterpolate8: o.ExternalReference = {\n name: 'ɵɵclassMapInterpolate8',\n moduleName: CORE,\n };\n static classMapInterpolateV: o.ExternalReference = {\n name: 'ɵɵclassMapInterpolateV',\n moduleName: CORE,\n };\n\n static styleProp: o.ExternalReference = {name: 'ɵɵstyleProp', moduleName: CORE};\n\n static stylePropInterpolate1: o.ExternalReference = {\n name: 'ɵɵstylePropInterpolate1',\n moduleName: CORE,\n };\n static stylePropInterpolate2: o.ExternalReference = {\n name: 'ɵɵstylePropInterpolate2',\n moduleName: CORE,\n };\n static stylePropInterpolate3: o.ExternalReference = {\n name: 'ɵɵstylePropInterpolate3',\n moduleName: CORE,\n };\n static stylePropInterpolate4: o.ExternalReference = {\n name: 'ɵɵstylePropInterpolate4',\n moduleName: CORE,\n };\n static stylePropInterpolate5: o.ExternalReference = {\n name: 'ɵɵstylePropInterpolate5',\n moduleName: CORE,\n };\n static stylePropInterpolate6: o.ExternalReference = {\n name: 'ɵɵstylePropInterpolate6',\n moduleName: CORE,\n };\n static stylePropInterpolate7: o.ExternalReference = {\n name: 'ɵɵstylePropInterpolate7',\n moduleName: CORE,\n };\n static stylePropInterpolate8: o.ExternalReference = {\n name: 'ɵɵstylePropInterpolate8',\n moduleName: CORE,\n };\n static stylePropInterpolateV: o.ExternalReference = {\n name: 'ɵɵstylePropInterpolateV',\n moduleName: CORE,\n };\n\n static nextContext: o.ExternalReference = {name: 'ɵɵnextContext', moduleName: CORE};\n\n static resetView: o.ExternalReference = {name: 'ɵɵresetView', moduleName: CORE};\n\n static templateCreate: o.ExternalReference = {name: 'ɵɵtemplate', moduleName: CORE};\n\n static defer: o.ExternalReference = {name: 'ɵɵdefer', moduleName: CORE};\n static deferWhen: o.ExternalReference = {name: 'ɵɵdeferWhen', moduleName: CORE};\n static deferOnIdle: o.ExternalReference = {name: 'ɵɵdeferOnIdle', moduleName: CORE};\n static deferOnImmediate: o.ExternalReference = {name: 'ɵɵdeferOnImmediate', moduleName: CORE};\n static deferOnTimer: o.ExternalReference = {name: 'ɵɵdeferOnTimer', moduleName: CORE};\n static deferOnHover: o.ExternalReference = {name: 'ɵɵdeferOnHover', moduleName: CORE};\n static deferOnInteraction: o.ExternalReference = {name: 'ɵɵdeferOnInteraction', moduleName: CORE};\n static deferOnViewport: o.ExternalReference = {name: 'ɵɵdeferOnViewport', moduleName: CORE};\n static deferPrefetchWhen: o.ExternalReference = {name: 'ɵɵdeferPrefetchWhen', moduleName: CORE};\n static deferPrefetchOnIdle: o.ExternalReference = {\n name: 'ɵɵdeferPrefetchOnIdle',\n moduleName: CORE,\n };\n static deferPrefetchOnImmediate: o.ExternalReference = {\n name: 'ɵɵdeferPrefetchOnImmediate',\n moduleName: CORE,\n };\n static deferPrefetchOnTimer: o.ExternalReference = {\n name: 'ɵɵdeferPrefetchOnTimer',\n moduleName: CORE,\n };\n static deferPrefetchOnHover: o.ExternalReference = {\n name: 'ɵɵdeferPrefetchOnHover',\n moduleName: CORE,\n };\n static deferPrefetchOnInteraction: o.ExternalReference = {\n name: 'ɵɵdeferPrefetchOnInteraction',\n moduleName: CORE,\n };\n static deferPrefetchOnViewport: o.ExternalReference = {\n name: 'ɵɵdeferPrefetchOnViewport',\n moduleName: CORE,\n };\n static deferHydrateWhen: o.ExternalReference = {name: 'ɵɵdeferHydrateWhen', moduleName: CORE};\n static deferHydrateNever: o.ExternalReference = {name: 'ɵɵdeferHydrateNever', moduleName: CORE};\n static deferHydrateOnIdle: o.ExternalReference = {\n name: 'ɵɵdeferHydrateOnIdle',\n moduleName: CORE,\n };\n static deferHydrateOnImmediate: o.ExternalReference = {\n name: 'ɵɵdeferHydrateOnImmediate',\n moduleName: CORE,\n };\n static deferHydrateOnTimer: o.ExternalReference = {\n name: 'ɵɵdeferHydrateOnTimer',\n moduleName: CORE,\n };\n static deferHydrateOnHover: o.ExternalReference = {\n name: 'ɵɵdeferHydrateOnHover',\n moduleName: CORE,\n };\n static deferHydrateOnInteraction: o.ExternalReference = {\n name: 'ɵɵdeferHydrateOnInteraction',\n moduleName: CORE,\n };\n static deferHydrateOnViewport: o.ExternalReference = {\n name: 'ɵɵdeferHydrateOnViewport',\n moduleName: CORE,\n };\n static deferEnableTimerScheduling: o.ExternalReference = {\n name: 'ɵɵdeferEnableTimerScheduling',\n moduleName: CORE,\n };\n\n static conditional: o.ExternalReference = {name: 'ɵɵconditional', moduleName: CORE};\n static repeater: o.ExternalReference = {name: 'ɵɵrepeater', moduleName: CORE};\n static repeaterCreate: o.ExternalReference = {name: 'ɵɵrepeaterCreate', moduleName: CORE};\n static repeaterTrackByIndex: o.ExternalReference = {\n name: 'ɵɵrepeaterTrackByIndex',\n moduleName: CORE,\n };\n static repeaterTrackByIdentity: o.ExternalReference = {\n name: 'ɵɵrepeaterTrackByIdentity',\n moduleName: CORE,\n };\n static componentInstance: o.ExternalReference = {name: 'ɵɵcomponentInstance', moduleName: CORE};\n\n static text: o.ExternalReference = {name: 'ɵɵtext', moduleName: CORE};\n\n static enableBindings: o.ExternalReference = {name: 'ɵɵenableBindings', moduleName: CORE};\n\n static disableBindings: o.ExternalReference = {name: 'ɵɵdisableBindings', moduleName: CORE};\n\n static getCurrentView: o.ExternalReference = {name: 'ɵɵgetCurrentView', moduleName: CORE};\n\n static textInterpolate: o.ExternalReference = {name: 'ɵɵtextInterpolate', moduleName: CORE};\n static textInterpolate1: o.ExternalReference = {name: 'ɵɵtextInterpolate1', moduleName: CORE};\n static textInterpolate2: o.ExternalReference = {name: 'ɵɵtextInterpolate2', moduleName: CORE};\n static textInterpolate3: o.ExternalReference = {name: 'ɵɵtextInterpolate3', moduleName: CORE};\n static textInterpolate4: o.ExternalReference = {name: 'ɵɵtextInterpolate4', moduleName: CORE};\n static textInterpolate5: o.ExternalReference = {name: 'ɵɵtextInterpolate5', moduleName: CORE};\n static textInterpolate6: o.ExternalReference = {name: 'ɵɵtextInterpolate6', moduleName: CORE};\n static textInterpolate7: o.ExternalReference = {name: 'ɵɵtextInterpolate7', moduleName: CORE};\n static textInterpolate8: o.ExternalReference = {name: 'ɵɵtextInterpolate8', moduleName: CORE};\n static textInterpolateV: o.ExternalReference = {name: 'ɵɵtextInterpolateV', moduleName: CORE};\n\n static restoreView: o.ExternalReference = {name: 'ɵɵrestoreView', moduleName: CORE};\n\n static pureFunction0: o.ExternalReference = {name: 'ɵɵpureFunction0', moduleName: CORE};\n static pureFunction1: o.ExternalReference = {name: 'ɵɵpureFunction1', moduleName: CORE};\n static pureFunction2: o.ExternalReference = {name: 'ɵɵpureFunction2', moduleName: CORE};\n static pureFunction3: o.ExternalReference = {name: 'ɵɵpureFunction3', moduleName: CORE};\n static pureFunction4: o.ExternalReference = {name: 'ɵɵpureFunction4', moduleName: CORE};\n static pureFunction5: o.ExternalReference = {name: 'ɵɵpureFunction5', moduleName: CORE};\n static pureFunction6: o.ExternalReference = {name: 'ɵɵpureFunction6', moduleName: CORE};\n static pureFunction7: o.ExternalReference = {name: 'ɵɵpureFunction7', moduleName: CORE};\n static pureFunction8: o.ExternalReference = {name: 'ɵɵpureFunction8', moduleName: CORE};\n static pureFunctionV: o.ExternalReference = {name: 'ɵɵpureFunctionV', moduleName: CORE};\n\n static pipeBind1: o.ExternalReference = {name: 'ɵɵpipeBind1', moduleName: CORE};\n static pipeBind2: o.ExternalReference = {name: 'ɵɵpipeBind2', moduleName: CORE};\n static pipeBind3: o.ExternalReference = {name: 'ɵɵpipeBind3', moduleName: CORE};\n static pipeBind4: o.ExternalReference = {name: 'ɵɵpipeBind4', moduleName: CORE};\n static pipeBindV: o.ExternalReference = {name: 'ɵɵpipeBindV', moduleName: CORE};\n\n static hostProperty: o.ExternalReference = {name: 'ɵɵhostProperty', moduleName: CORE};\n\n static property: o.ExternalReference = {name: 'ɵɵproperty', moduleName: CORE};\n\n static propertyInterpolate: o.ExternalReference = {\n name: 'ɵɵpropertyInterpolate',\n moduleName: CORE,\n };\n static propertyInterpolate1: o.ExternalReference = {\n name: 'ɵɵpropertyInterpolate1',\n moduleName: CORE,\n };\n static propertyInterpolate2: o.ExternalReference = {\n name: 'ɵɵpropertyInterpolate2',\n moduleName: CORE,\n };\n static propertyInterpolate3: o.ExternalReference = {\n name: 'ɵɵpropertyInterpolate3',\n moduleName: CORE,\n };\n static propertyInterpolate4: o.ExternalReference = {\n name: 'ɵɵpropertyInterpolate4',\n moduleName: CORE,\n };\n static propertyInterpolate5: o.ExternalReference = {\n name: 'ɵɵpropertyInterpolate5',\n moduleName: CORE,\n };\n static propertyInterpolate6: o.ExternalReference = {\n name: 'ɵɵpropertyInterpolate6',\n moduleName: CORE,\n };\n static propertyInterpolate7: o.ExternalReference = {\n name: 'ɵɵpropertyInterpolate7',\n moduleName: CORE,\n };\n static propertyInterpolate8: o.ExternalReference = {\n name: 'ɵɵpropertyInterpolate8',\n moduleName: CORE,\n };\n static propertyInterpolateV: o.ExternalReference = {\n name: 'ɵɵpropertyInterpolateV',\n moduleName: CORE,\n };\n\n static i18n: o.ExternalReference = {name: 'ɵɵi18n', moduleName: CORE};\n static i18nAttributes: o.ExternalReference = {name: 'ɵɵi18nAttributes', moduleName: CORE};\n static i18nExp: o.ExternalReference = {name: 'ɵɵi18nExp', moduleName: CORE};\n static i18nStart: o.ExternalReference = {name: 'ɵɵi18nStart', moduleName: CORE};\n static i18nEnd: o.ExternalReference = {name: 'ɵɵi18nEnd', moduleName: CORE};\n static i18nApply: o.ExternalReference = {name: 'ɵɵi18nApply', moduleName: CORE};\n static i18nPostprocess: o.ExternalReference = {name: 'ɵɵi18nPostprocess', moduleName: CORE};\n\n static pipe: o.ExternalReference = {name: 'ɵɵpipe', moduleName: CORE};\n\n static projection: o.ExternalReference = {name: 'ɵɵprojection', moduleName: CORE};\n static projectionDef: o.ExternalReference = {name: 'ɵɵprojectionDef', moduleName: CORE};\n\n static reference: o.ExternalReference = {name: 'ɵɵreference', moduleName: CORE};\n\n static inject: o.ExternalReference = {name: 'ɵɵinject', moduleName: CORE};\n\n static injectAttribute: o.ExternalReference = {name: 'ɵɵinjectAttribute', moduleName: CORE};\n\n static directiveInject: o.ExternalReference = {name: 'ɵɵdirectiveInject', moduleName: CORE};\n static invalidFactory: o.ExternalReference = {name: 'ɵɵinvalidFactory', moduleName: CORE};\n static invalidFactoryDep: o.ExternalReference = {name: 'ɵɵinvalidFactoryDep', moduleName: CORE};\n\n static templateRefExtractor: o.ExternalReference = {\n name: 'ɵɵtemplateRefExtractor',\n moduleName: CORE,\n };\n\n static forwardRef: o.ExternalReference = {name: 'forwardRef', moduleName: CORE};\n static resolveForwardRef: o.ExternalReference = {name: 'resolveForwardRef', moduleName: CORE};\n\n static replaceMetadata: o.ExternalReference = {name: 'ɵɵreplaceMetadata', moduleName: CORE};\n static getReplaceMetadataURL: o.ExternalReference = {\n name: 'ɵɵgetReplaceMetadataURL',\n moduleName: CORE,\n };\n\n static ɵɵdefineInjectable: o.ExternalReference = {name: 'ɵɵdefineInjectable', moduleName: CORE};\n static declareInjectable: o.ExternalReference = {name: 'ɵɵngDeclareInjectable', moduleName: CORE};\n static InjectableDeclaration: o.ExternalReference = {\n name: 'ɵɵInjectableDeclaration',\n moduleName: CORE,\n };\n\n static resolveWindow: o.ExternalReference = {name: 'ɵɵresolveWindow', moduleName: CORE};\n static resolveDocument: o.ExternalReference = {name: 'ɵɵresolveDocument', moduleName: CORE};\n static resolveBody: o.ExternalReference = {name: 'ɵɵresolveBody', moduleName: CORE};\n\n static getComponentDepsFactory: o.ExternalReference = {\n name: 'ɵɵgetComponentDepsFactory',\n moduleName: CORE,\n };\n\n static defineComponent: o.ExternalReference = {name: 'ɵɵdefineComponent', moduleName: CORE};\n static declareComponent: o.ExternalReference = {name: 'ɵɵngDeclareComponent', moduleName: CORE};\n\n static setComponentScope: o.ExternalReference = {name: 'ɵɵsetComponentScope', moduleName: CORE};\n\n static ChangeDetectionStrategy: o.ExternalReference = {\n name: 'ChangeDetectionStrategy',\n moduleName: CORE,\n };\n static ViewEncapsulation: o.ExternalReference = {\n name: 'ViewEncapsulation',\n moduleName: CORE,\n };\n\n static ComponentDeclaration: o.ExternalReference = {\n name: 'ɵɵComponentDeclaration',\n moduleName: CORE,\n };\n\n static FactoryDeclaration: o.ExternalReference = {\n name: 'ɵɵFactoryDeclaration',\n moduleName: CORE,\n };\n static declareFactory: o.ExternalReference = {name: 'ɵɵngDeclareFactory', moduleName: CORE};\n static FactoryTarget: o.ExternalReference = {name: 'ɵɵFactoryTarget', moduleName: CORE};\n\n static defineDirective: o.ExternalReference = {name: 'ɵɵdefineDirective', moduleName: CORE};\n static declareDirective: o.ExternalReference = {name: 'ɵɵngDeclareDirective', moduleName: CORE};\n\n static DirectiveDeclaration: o.ExternalReference = {\n name: 'ɵɵDirectiveDeclaration',\n moduleName: CORE,\n };\n\n static InjectorDef: o.ExternalReference = {name: 'ɵɵInjectorDef', moduleName: CORE};\n static InjectorDeclaration: o.ExternalReference = {\n name: 'ɵɵInjectorDeclaration',\n moduleName: CORE,\n };\n\n static defineInjector: o.ExternalReference = {name: 'ɵɵdefineInjector', moduleName: CORE};\n static declareInjector: o.ExternalReference = {name: 'ɵɵngDeclareInjector', moduleName: CORE};\n\n static NgModuleDeclaration: o.ExternalReference = {\n name: 'ɵɵNgModuleDeclaration',\n moduleName: CORE,\n };\n\n static ModuleWithProviders: o.ExternalReference = {\n name: 'ModuleWithProviders',\n moduleName: CORE,\n };\n\n static defineNgModule: o.ExternalReference = {name: 'ɵɵdefineNgModule', moduleName: CORE};\n static declareNgModule: o.ExternalReference = {name: 'ɵɵngDeclareNgModule', moduleName: CORE};\n static setNgModuleScope: o.ExternalReference = {name: 'ɵɵsetNgModuleScope', moduleName: CORE};\n static registerNgModuleType: o.ExternalReference = {\n name: 'ɵɵregisterNgModuleType',\n moduleName: CORE,\n };\n\n static PipeDeclaration: o.ExternalReference = {name: 'ɵɵPipeDeclaration', moduleName: CORE};\n\n static definePipe: o.ExternalReference = {name: 'ɵɵdefinePipe', moduleName: CORE};\n static declarePipe: o.ExternalReference = {name: 'ɵɵngDeclarePipe', moduleName: CORE};\n\n static declareClassMetadata: o.ExternalReference = {\n name: 'ɵɵngDeclareClassMetadata',\n moduleName: CORE,\n };\n static declareClassMetadataAsync: o.ExternalReference = {\n name: 'ɵɵngDeclareClassMetadataAsync',\n moduleName: CORE,\n };\n static setClassMetadata: o.ExternalReference = {name: 'ɵsetClassMetadata', moduleName: CORE};\n static setClassMetadataAsync: o.ExternalReference = {\n name: 'ɵsetClassMetadataAsync',\n moduleName: CORE,\n };\n static setClassDebugInfo: o.ExternalReference = {name: 'ɵsetClassDebugInfo', moduleName: CORE};\n static queryRefresh: o.ExternalReference = {name: 'ɵɵqueryRefresh', moduleName: CORE};\n static viewQuery: o.ExternalReference = {name: 'ɵɵviewQuery', moduleName: CORE};\n static loadQuery: o.ExternalReference = {name: 'ɵɵloadQuery', moduleName: CORE};\n static contentQuery: o.ExternalReference = {name: 'ɵɵcontentQuery', moduleName: CORE};\n\n // Signal queries\n static viewQuerySignal: o.ExternalReference = {name: 'ɵɵviewQuerySignal', moduleName: CORE};\n static contentQuerySignal: o.ExternalReference = {name: 'ɵɵcontentQuerySignal', moduleName: CORE};\n static queryAdvance: o.ExternalReference = {name: 'ɵɵqueryAdvance', moduleName: CORE};\n\n // Two-way bindings\n static twoWayProperty: o.ExternalReference = {name: 'ɵɵtwoWayProperty', moduleName: CORE};\n static twoWayBindingSet: o.ExternalReference = {name: 'ɵɵtwoWayBindingSet', moduleName: CORE};\n static twoWayListener: o.ExternalReference = {name: 'ɵɵtwoWayListener', moduleName: CORE};\n\n static declareLet: o.ExternalReference = {name: 'ɵɵdeclareLet', moduleName: CORE};\n static storeLet: o.ExternalReference = {name: 'ɵɵstoreLet', moduleName: CORE};\n static readContextLet: o.ExternalReference = {name: 'ɵɵreadContextLet', moduleName: CORE};\n\n static attachSourceLocations: o.ExternalReference = {\n name: 'ɵɵattachSourceLocations',\n moduleName: CORE,\n };\n\n static NgOnChangesFeature: o.ExternalReference = {name: 'ɵɵNgOnChangesFeature', moduleName: CORE};\n\n static InheritDefinitionFeature: o.ExternalReference = {\n name: 'ɵɵInheritDefinitionFeature',\n moduleName: CORE,\n };\n\n static CopyDefinitionFeature: o.ExternalReference = {\n name: 'ɵɵCopyDefinitionFeature',\n moduleName: CORE,\n };\n\n static ProvidersFeature: o.ExternalReference = {name: 'ɵɵProvidersFeature', moduleName: CORE};\n\n static HostDirectivesFeature: o.ExternalReference = {\n name: 'ɵɵHostDirectivesFeature',\n moduleName: CORE,\n };\n\n static ExternalStylesFeature: o.ExternalReference = {\n name: 'ɵɵExternalStylesFeature',\n moduleName: CORE,\n };\n\n static listener: o.ExternalReference = {name: 'ɵɵlistener', moduleName: CORE};\n\n static getInheritedFactory: o.ExternalReference = {\n name: 'ɵɵgetInheritedFactory',\n moduleName: CORE,\n };\n\n // sanitization-related functions\n static sanitizeHtml: o.ExternalReference = {name: 'ɵɵsanitizeHtml', moduleName: CORE};\n static sanitizeStyle: o.ExternalReference = {name: 'ɵɵsanitizeStyle', moduleName: CORE};\n static validateAttribute: o.ExternalReference = {\n name: 'ɵɵvalidateAttribute',\n moduleName: CORE,\n };\n static sanitizeResourceUrl: o.ExternalReference = {\n name: 'ɵɵsanitizeResourceUrl',\n moduleName: CORE,\n };\n static sanitizeScript: o.ExternalReference = {name: 'ɵɵsanitizeScript', moduleName: CORE};\n static sanitizeUrl: o.ExternalReference = {name: 'ɵɵsanitizeUrl', moduleName: CORE};\n static sanitizeUrlOrResourceUrl: o.ExternalReference = {\n name: 'ɵɵsanitizeUrlOrResourceUrl',\n moduleName: CORE,\n };\n static trustConstantHtml: o.ExternalReference = {name: 'ɵɵtrustConstantHtml', moduleName: CORE};\n static trustConstantResourceUrl: o.ExternalReference = {\n name: 'ɵɵtrustConstantResourceUrl',\n moduleName: CORE,\n };\n\n // type-checking\n static InputSignalBrandWriteType = {name: 'ɵINPUT_SIGNAL_BRAND_WRITE_TYPE', moduleName: CORE};\n static UnwrapDirectiveSignalInputs = {name: 'ɵUnwrapDirectiveSignalInputs', moduleName: CORE};\n static unwrapWritableSignal = {name: 'ɵunwrapWritableSignal', moduleName: CORE};\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nconst DASH_CASE_REGEXP = /-+([a-z0-9])/g;\n\nexport function dashCaseToCamelCase(input: string): string {\n return input.replace(DASH_CASE_REGEXP, (...m: any[]) => m[1].toUpperCase());\n}\n\nexport function splitAtColon(input: string, defaultValues: string[]): string[] {\n return _splitAt(input, ':', defaultValues);\n}\n\nexport function splitAtPeriod(input: string, defaultValues: string[]): string[] {\n return _splitAt(input, '.', defaultValues);\n}\n\nfunction _splitAt(input: string, character: string, defaultValues: string[]): string[] {\n const characterIndex = input.indexOf(character);\n if (characterIndex == -1) return defaultValues;\n return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];\n}\n\nexport function noUndefined(val: T | undefined): T {\n return val === undefined ? null! : val;\n}\n\nexport function error(msg: string): never {\n throw new Error(`Internal Error: ${msg}`);\n}\n\n// Escape characters that have a special meaning in Regular Expressions\nexport function escapeRegExp(s: string): string {\n return s.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, '\\\\$1');\n}\n\nexport type Byte = number;\n\nexport function utf8Encode(str: string): Byte[] {\n let encoded: Byte[] = [];\n for (let index = 0; index < str.length; index++) {\n let codePoint = str.charCodeAt(index);\n\n // decode surrogate\n // see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > index + 1) {\n const low = str.charCodeAt(index + 1);\n if (low >= 0xdc00 && low <= 0xdfff) {\n index++;\n codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;\n }\n }\n\n if (codePoint <= 0x7f) {\n encoded.push(codePoint);\n } else if (codePoint <= 0x7ff) {\n encoded.push(((codePoint >> 6) & 0x1f) | 0xc0, (codePoint & 0x3f) | 0x80);\n } else if (codePoint <= 0xffff) {\n encoded.push(\n (codePoint >> 12) | 0xe0,\n ((codePoint >> 6) & 0x3f) | 0x80,\n (codePoint & 0x3f) | 0x80,\n );\n } else if (codePoint <= 0x1fffff) {\n encoded.push(\n ((codePoint >> 18) & 0x07) | 0xf0,\n ((codePoint >> 12) & 0x3f) | 0x80,\n ((codePoint >> 6) & 0x3f) | 0x80,\n (codePoint & 0x3f) | 0x80,\n );\n }\n }\n\n return encoded;\n}\n\nexport function stringify(token: any): string {\n if (typeof token === 'string') {\n return token;\n }\n\n if (Array.isArray(token)) {\n return `[${token.map(stringify).join(', ')}]`;\n }\n\n if (token == null) {\n return '' + token;\n }\n\n const name = token.overriddenName || token.name;\n if (name) {\n return `${name}`;\n }\n\n if (!token.toString) {\n return 'object';\n }\n\n // WARNING: do not try to `JSON.stringify(token)` here\n // see https://github.com/angular/angular/issues/23440\n const result = token.toString();\n\n if (result == null) {\n return '' + result;\n }\n\n const newLineIndex = result.indexOf('\\n');\n return newLineIndex >= 0 ? result.slice(0, newLineIndex) : result;\n}\n\nexport class Version {\n public readonly major: string;\n public readonly minor: string;\n public readonly patch: string;\n\n constructor(public full: string) {\n const splits = full.split('.');\n this.major = splits[0];\n this.minor = splits[1];\n this.patch = splits.slice(2).join('.');\n }\n}\n\nexport interface Console {\n log(message: string): void;\n warn(message: string): void;\n}\n\nconst _global: {[name: string]: any} = globalThis;\nexport {_global as global};\n\nexport function newArray(size: number): T[];\nexport function newArray(size: number, value: T): T[];\nexport function newArray(size: number, value?: T): T[] {\n const list: T[] = [];\n for (let i = 0; i < size; i++) {\n list.push(value!);\n }\n return list;\n}\n\n/**\n * Partitions a given array into 2 arrays, based on a boolean value returned by the condition\n * function.\n *\n * @param arr Input array that should be partitioned\n * @param conditionFn Condition function that is called for each item in a given array and returns a\n * boolean value.\n */\nexport function partitionArray(\n arr: (T | F)[],\n conditionFn: (value: T | F) => boolean,\n): [T[], F[]] {\n const truthy: T[] = [];\n const falsy: F[] = [];\n for (const item of arr) {\n (conditionFn(item) ? truthy : falsy).push(item as any);\n }\n return [truthy, falsy];\n}\n\nconst V1_TO_18 = /^([1-9]|1[0-8])\\./;\n\nexport function getJitStandaloneDefaultForVersion(version: string): boolean {\n if (version.startsWith('0.')) {\n // 0.0.0 is always \"latest\", default is true.\n return true;\n }\n if (V1_TO_18.test(version)) {\n // Angular v2 - v18 default is false.\n return false;\n }\n\n // All other Angular versions (v19+) default to true.\n return true;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {utf8Encode} from '../util';\n\n// https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit\nconst VERSION = 3;\n\nconst JS_B64_PREFIX = '# sourceMappingURL=data:application/json;base64,';\n\ntype Segment = {\n col0: number;\n sourceUrl?: string;\n sourceLine0?: number;\n sourceCol0?: number;\n};\n\nexport type SourceMap = {\n version: number;\n file?: string;\n sourceRoot: string;\n sources: string[];\n sourcesContent: (string | null)[];\n mappings: string;\n};\n\nexport class SourceMapGenerator {\n private sourcesContent: Map = new Map();\n private lines: Segment[][] = [];\n private lastCol0: number = 0;\n private hasMappings = false;\n\n constructor(private file: string | null = null) {}\n\n // The content is `null` when the content is expected to be loaded using the URL\n addSource(url: string, content: string | null = null): this {\n if (!this.sourcesContent.has(url)) {\n this.sourcesContent.set(url, content);\n }\n return this;\n }\n\n addLine(): this {\n this.lines.push([]);\n this.lastCol0 = 0;\n return this;\n }\n\n addMapping(col0: number, sourceUrl?: string, sourceLine0?: number, sourceCol0?: number): this {\n if (!this.currentLine) {\n throw new Error(`A line must be added before mappings can be added`);\n }\n if (sourceUrl != null && !this.sourcesContent.has(sourceUrl)) {\n throw new Error(`Unknown source file \"${sourceUrl}\"`);\n }\n if (col0 == null) {\n throw new Error(`The column in the generated code must be provided`);\n }\n if (col0 < this.lastCol0) {\n throw new Error(`Mapping should be added in output order`);\n }\n if (sourceUrl && (sourceLine0 == null || sourceCol0 == null)) {\n throw new Error(`The source location must be provided when a source url is provided`);\n }\n\n this.hasMappings = true;\n this.lastCol0 = col0;\n this.currentLine.push({col0, sourceUrl, sourceLine0, sourceCol0});\n return this;\n }\n\n /**\n * @internal strip this from published d.ts files due to\n * https://github.com/microsoft/TypeScript/issues/36216\n */\n private get currentLine(): Segment[] | null {\n return this.lines.slice(-1)[0];\n }\n\n toJSON(): SourceMap | null {\n if (!this.hasMappings) {\n return null;\n }\n\n const sourcesIndex = new Map();\n const sources: string[] = [];\n const sourcesContent: (string | null)[] = [];\n\n Array.from(this.sourcesContent.keys()).forEach((url: string, i: number) => {\n sourcesIndex.set(url, i);\n sources.push(url);\n sourcesContent.push(this.sourcesContent.get(url) || null);\n });\n\n let mappings: string = '';\n let lastCol0: number = 0;\n let lastSourceIndex: number = 0;\n let lastSourceLine0: number = 0;\n let lastSourceCol0: number = 0;\n\n this.lines.forEach((segments) => {\n lastCol0 = 0;\n\n mappings += segments\n .map((segment) => {\n // zero-based starting column of the line in the generated code\n let segAsStr = toBase64VLQ(segment.col0 - lastCol0);\n lastCol0 = segment.col0;\n\n if (segment.sourceUrl != null) {\n // zero-based index into the “sources” list\n segAsStr += toBase64VLQ(sourcesIndex.get(segment.sourceUrl)! - lastSourceIndex);\n lastSourceIndex = sourcesIndex.get(segment.sourceUrl)!;\n // the zero-based starting line in the original source\n segAsStr += toBase64VLQ(segment.sourceLine0! - lastSourceLine0);\n lastSourceLine0 = segment.sourceLine0!;\n // the zero-based starting column in the original source\n segAsStr += toBase64VLQ(segment.sourceCol0! - lastSourceCol0);\n lastSourceCol0 = segment.sourceCol0!;\n }\n\n return segAsStr;\n })\n .join(',');\n mappings += ';';\n });\n\n mappings = mappings.slice(0, -1);\n\n return {\n 'file': this.file || '',\n 'version': VERSION,\n 'sourceRoot': '',\n 'sources': sources,\n 'sourcesContent': sourcesContent,\n 'mappings': mappings,\n };\n }\n\n toJsComment(): string {\n return this.hasMappings\n ? '//' + JS_B64_PREFIX + toBase64String(JSON.stringify(this, null, 0))\n : '';\n }\n}\n\nexport function toBase64String(value: string): string {\n let b64 = '';\n const encoded = utf8Encode(value);\n for (let i = 0; i < encoded.length; ) {\n const i1 = encoded[i++];\n const i2 = i < encoded.length ? encoded[i++] : null;\n const i3 = i < encoded.length ? encoded[i++] : null;\n b64 += toBase64Digit(i1 >> 2);\n b64 += toBase64Digit(((i1 & 3) << 4) | (i2 === null ? 0 : i2 >> 4));\n b64 += i2 === null ? '=' : toBase64Digit(((i2 & 15) << 2) | (i3 === null ? 0 : i3 >> 6));\n b64 += i2 === null || i3 === null ? '=' : toBase64Digit(i3 & 63);\n }\n\n return b64;\n}\n\nfunction toBase64VLQ(value: number): string {\n value = value < 0 ? (-value << 1) + 1 : value << 1;\n\n let out = '';\n do {\n let digit = value & 31;\n value = value >> 5;\n if (value > 0) {\n digit = digit | 32;\n }\n out += toBase64Digit(digit);\n } while (value > 0);\n\n return out;\n}\n\nconst B64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nfunction toBase64Digit(value: number): string {\n if (value < 0 || value >= 64) {\n throw new Error(`Can only encode value in the range [0, 63]`);\n }\n\n return B64_DIGITS[value];\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ParseSourceSpan} from '../parse_util';\n\nimport * as o from './output_ast';\nimport {SourceMapGenerator} from './source_map';\n\nconst _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\\\|\\n|\\r|\\$/g;\nconst _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;\nconst _INDENT_WITH = ' ';\n\nclass _EmittedLine {\n partsLength = 0;\n parts: string[] = [];\n srcSpans: (ParseSourceSpan | null)[] = [];\n constructor(public indent: number) {}\n}\n\nexport class EmitterVisitorContext {\n static createRoot(): EmitterVisitorContext {\n return new EmitterVisitorContext(0);\n }\n\n private _lines: _EmittedLine[];\n\n constructor(private _indent: number) {\n this._lines = [new _EmittedLine(_indent)];\n }\n\n /**\n * @internal strip this from published d.ts files due to\n * https://github.com/microsoft/TypeScript/issues/36216\n */\n private get _currentLine(): _EmittedLine {\n return this._lines[this._lines.length - 1];\n }\n\n println(from?: {sourceSpan: ParseSourceSpan | null} | null, lastPart: string = ''): void {\n this.print(from || null, lastPart, true);\n }\n\n lineIsEmpty(): boolean {\n return this._currentLine.parts.length === 0;\n }\n\n lineLength(): number {\n return this._currentLine.indent * _INDENT_WITH.length + this._currentLine.partsLength;\n }\n\n print(from: {sourceSpan: ParseSourceSpan | null} | null, part: string, newLine: boolean = false) {\n if (part.length > 0) {\n this._currentLine.parts.push(part);\n this._currentLine.partsLength += part.length;\n this._currentLine.srcSpans.push((from && from.sourceSpan) || null);\n }\n if (newLine) {\n this._lines.push(new _EmittedLine(this._indent));\n }\n }\n\n removeEmptyLastLine() {\n if (this.lineIsEmpty()) {\n this._lines.pop();\n }\n }\n\n incIndent() {\n this._indent++;\n if (this.lineIsEmpty()) {\n this._currentLine.indent = this._indent;\n }\n }\n\n decIndent() {\n this._indent--;\n if (this.lineIsEmpty()) {\n this._currentLine.indent = this._indent;\n }\n }\n\n toSource(): string {\n return this.sourceLines\n .map((l) => (l.parts.length > 0 ? _createIndent(l.indent) + l.parts.join('') : ''))\n .join('\\n');\n }\n\n toSourceMapGenerator(genFilePath: string, startsAtLine: number = 0): SourceMapGenerator {\n const map = new SourceMapGenerator(genFilePath);\n\n let firstOffsetMapped = false;\n const mapFirstOffsetIfNeeded = () => {\n if (!firstOffsetMapped) {\n // Add a single space so that tools won't try to load the file from disk.\n // Note: We are using virtual urls like `ng:///`, so we have to\n // provide a content here.\n map.addSource(genFilePath, ' ').addMapping(0, genFilePath, 0, 0);\n firstOffsetMapped = true;\n }\n };\n\n for (let i = 0; i < startsAtLine; i++) {\n map.addLine();\n mapFirstOffsetIfNeeded();\n }\n\n this.sourceLines.forEach((line, lineIdx) => {\n map.addLine();\n\n const spans = line.srcSpans;\n const parts = line.parts;\n let col0 = line.indent * _INDENT_WITH.length;\n let spanIdx = 0;\n // skip leading parts without source spans\n while (spanIdx < spans.length && !spans[spanIdx]) {\n col0 += parts[spanIdx].length;\n spanIdx++;\n }\n if (spanIdx < spans.length && lineIdx === 0 && col0 === 0) {\n firstOffsetMapped = true;\n } else {\n mapFirstOffsetIfNeeded();\n }\n\n while (spanIdx < spans.length) {\n const span = spans[spanIdx]!;\n const source = span.start.file;\n const sourceLine = span.start.line;\n const sourceCol = span.start.col;\n map\n .addSource(source.url, source.content)\n .addMapping(col0, source.url, sourceLine, sourceCol);\n\n col0 += parts[spanIdx].length;\n spanIdx++;\n\n // assign parts without span or the same span to the previous segment\n while (spanIdx < spans.length && (span === spans[spanIdx] || !spans[spanIdx])) {\n col0 += parts[spanIdx].length;\n spanIdx++;\n }\n }\n });\n\n return map;\n }\n\n spanOf(line: number, column: number): ParseSourceSpan | null {\n const emittedLine = this._lines[line];\n if (emittedLine) {\n let columnsLeft = column - _createIndent(emittedLine.indent).length;\n for (let partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) {\n const part = emittedLine.parts[partIndex];\n if (part.length > columnsLeft) {\n return emittedLine.srcSpans[partIndex];\n }\n columnsLeft -= part.length;\n }\n }\n return null;\n }\n\n /**\n * @internal strip this from published d.ts files due to\n * https://github.com/microsoft/TypeScript/issues/36216\n */\n private get sourceLines(): _EmittedLine[] {\n if (this._lines.length && this._lines[this._lines.length - 1].parts.length === 0) {\n return this._lines.slice(0, -1);\n }\n return this._lines;\n }\n}\n\nexport abstract class AbstractEmitterVisitor implements o.StatementVisitor, o.ExpressionVisitor {\n constructor(private _escapeDollarInStrings: boolean) {}\n\n protected printLeadingComments(stmt: o.Statement, ctx: EmitterVisitorContext): void {\n if (stmt.leadingComments === undefined) {\n return;\n }\n for (const comment of stmt.leadingComments) {\n if (comment instanceof o.JSDocComment) {\n ctx.print(stmt, `/*${comment.toString()}*/`, comment.trailingNewline);\n } else {\n if (comment.multiline) {\n ctx.print(stmt, `/* ${comment.text} */`, comment.trailingNewline);\n } else {\n comment.text.split('\\n').forEach((line) => {\n ctx.println(stmt, `// ${line}`);\n });\n }\n }\n }\n }\n\n visitExpressionStmt(stmt: o.ExpressionStatement, ctx: EmitterVisitorContext): any {\n this.printLeadingComments(stmt, ctx);\n stmt.expr.visitExpression(this, ctx);\n ctx.println(stmt, ';');\n return null;\n }\n\n visitReturnStmt(stmt: o.ReturnStatement, ctx: EmitterVisitorContext): any {\n this.printLeadingComments(stmt, ctx);\n ctx.print(stmt, `return `);\n stmt.value.visitExpression(this, ctx);\n ctx.println(stmt, ';');\n return null;\n }\n\n visitIfStmt(stmt: o.IfStmt, ctx: EmitterVisitorContext): any {\n this.printLeadingComments(stmt, ctx);\n ctx.print(stmt, `if (`);\n stmt.condition.visitExpression(this, ctx);\n ctx.print(stmt, `) {`);\n const hasElseCase = stmt.falseCase != null && stmt.falseCase.length > 0;\n if (stmt.trueCase.length <= 1 && !hasElseCase) {\n ctx.print(stmt, ` `);\n this.visitAllStatements(stmt.trueCase, ctx);\n ctx.removeEmptyLastLine();\n ctx.print(stmt, ` `);\n } else {\n ctx.println();\n ctx.incIndent();\n this.visitAllStatements(stmt.trueCase, ctx);\n ctx.decIndent();\n if (hasElseCase) {\n ctx.println(stmt, `} else {`);\n ctx.incIndent();\n this.visitAllStatements(stmt.falseCase, ctx);\n ctx.decIndent();\n }\n }\n ctx.println(stmt, `}`);\n return null;\n }\n\n abstract visitDeclareVarStmt(stmt: o.DeclareVarStmt, ctx: EmitterVisitorContext): any;\n\n visitWriteVarExpr(expr: o.WriteVarExpr, ctx: EmitterVisitorContext): any {\n const lineWasEmpty = ctx.lineIsEmpty();\n if (!lineWasEmpty) {\n ctx.print(expr, '(');\n }\n ctx.print(expr, `${expr.name} = `);\n expr.value.visitExpression(this, ctx);\n if (!lineWasEmpty) {\n ctx.print(expr, ')');\n }\n return null;\n }\n visitWriteKeyExpr(expr: o.WriteKeyExpr, ctx: EmitterVisitorContext): any {\n const lineWasEmpty = ctx.lineIsEmpty();\n if (!lineWasEmpty) {\n ctx.print(expr, '(');\n }\n expr.receiver.visitExpression(this, ctx);\n ctx.print(expr, `[`);\n expr.index.visitExpression(this, ctx);\n ctx.print(expr, `] = `);\n expr.value.visitExpression(this, ctx);\n if (!lineWasEmpty) {\n ctx.print(expr, ')');\n }\n return null;\n }\n visitWritePropExpr(expr: o.WritePropExpr, ctx: EmitterVisitorContext): any {\n const lineWasEmpty = ctx.lineIsEmpty();\n if (!lineWasEmpty) {\n ctx.print(expr, '(');\n }\n expr.receiver.visitExpression(this, ctx);\n ctx.print(expr, `.${expr.name} = `);\n expr.value.visitExpression(this, ctx);\n if (!lineWasEmpty) {\n ctx.print(expr, ')');\n }\n return null;\n }\n\n visitInvokeFunctionExpr(expr: o.InvokeFunctionExpr, ctx: EmitterVisitorContext): any {\n const shouldParenthesize = expr.fn instanceof o.ArrowFunctionExpr;\n\n if (shouldParenthesize) {\n ctx.print(expr.fn, '(');\n }\n expr.fn.visitExpression(this, ctx);\n if (shouldParenthesize) {\n ctx.print(expr.fn, ')');\n }\n ctx.print(expr, `(`);\n this.visitAllExpressions(expr.args, ctx, ',');\n ctx.print(expr, `)`);\n return null;\n }\n visitTaggedTemplateLiteralExpr(\n expr: o.TaggedTemplateLiteralExpr,\n ctx: EmitterVisitorContext,\n ): any {\n expr.tag.visitExpression(this, ctx);\n expr.template.visitExpression(this, ctx);\n return null;\n }\n visitTemplateLiteralExpr(expr: o.TemplateLiteralExpr, ctx: EmitterVisitorContext) {\n ctx.print(expr, '`');\n for (let i = 0; i < expr.elements.length; i++) {\n expr.elements[i].visitExpression(this, ctx);\n const expression = i < expr.expressions.length ? expr.expressions[i] : null;\n if (expression !== null) {\n ctx.print(expression, '${');\n expression.visitExpression(this, ctx);\n ctx.print(expression, '}');\n }\n }\n ctx.print(expr, '`');\n }\n visitTemplateLiteralElementExpr(expr: o.TemplateLiteralElementExpr, ctx: EmitterVisitorContext) {\n ctx.print(expr, expr.rawText);\n }\n visitWrappedNodeExpr(ast: o.WrappedNodeExpr, ctx: EmitterVisitorContext): any {\n throw new Error('Abstract emitter cannot visit WrappedNodeExpr.');\n }\n visitTypeofExpr(expr: o.TypeofExpr, ctx: EmitterVisitorContext): any {\n ctx.print(expr, 'typeof ');\n expr.expr.visitExpression(this, ctx);\n }\n visitReadVarExpr(ast: o.ReadVarExpr, ctx: EmitterVisitorContext): any {\n ctx.print(ast, ast.name);\n return null;\n }\n visitInstantiateExpr(ast: o.InstantiateExpr, ctx: EmitterVisitorContext): any {\n ctx.print(ast, `new `);\n ast.classExpr.visitExpression(this, ctx);\n ctx.print(ast, `(`);\n this.visitAllExpressions(ast.args, ctx, ',');\n ctx.print(ast, `)`);\n return null;\n }\n\n visitLiteralExpr(ast: o.LiteralExpr, ctx: EmitterVisitorContext): any {\n const value = ast.value;\n if (typeof value === 'string') {\n ctx.print(ast, escapeIdentifier(value, this._escapeDollarInStrings));\n } else {\n ctx.print(ast, `${value}`);\n }\n return null;\n }\n\n visitLocalizedString(ast: o.LocalizedString, ctx: EmitterVisitorContext): any {\n const head = ast.serializeI18nHead();\n ctx.print(ast, '$localize `' + head.raw);\n for (let i = 1; i < ast.messageParts.length; i++) {\n ctx.print(ast, '${');\n ast.expressions[i - 1].visitExpression(this, ctx);\n ctx.print(ast, `}${ast.serializeI18nTemplatePart(i).raw}`);\n }\n ctx.print(ast, '`');\n return null;\n }\n\n abstract visitExternalExpr(ast: o.ExternalExpr, ctx: EmitterVisitorContext): any;\n\n visitConditionalExpr(ast: o.ConditionalExpr, ctx: EmitterVisitorContext): any {\n ctx.print(ast, `(`);\n ast.condition.visitExpression(this, ctx);\n ctx.print(ast, '? ');\n ast.trueCase.visitExpression(this, ctx);\n ctx.print(ast, ': ');\n ast.falseCase!.visitExpression(this, ctx);\n ctx.print(ast, `)`);\n return null;\n }\n\n visitDynamicImportExpr(ast: o.DynamicImportExpr, ctx: EmitterVisitorContext) {\n ctx.print(ast, `import(${ast.url})`);\n }\n\n visitNotExpr(ast: o.NotExpr, ctx: EmitterVisitorContext): any {\n ctx.print(ast, '!');\n ast.condition.visitExpression(this, ctx);\n return null;\n }\n abstract visitFunctionExpr(ast: o.FunctionExpr, ctx: EmitterVisitorContext): any;\n abstract visitArrowFunctionExpr(ast: o.ArrowFunctionExpr, context: any): any;\n abstract visitDeclareFunctionStmt(stmt: o.DeclareFunctionStmt, context: any): any;\n\n visitUnaryOperatorExpr(ast: o.UnaryOperatorExpr, ctx: EmitterVisitorContext): any {\n let opStr: string;\n switch (ast.operator) {\n case o.UnaryOperator.Plus:\n opStr = '+';\n break;\n case o.UnaryOperator.Minus:\n opStr = '-';\n break;\n default:\n throw new Error(`Unknown operator ${ast.operator}`);\n }\n if (ast.parens) ctx.print(ast, `(`);\n ctx.print(ast, opStr);\n ast.expr.visitExpression(this, ctx);\n if (ast.parens) ctx.print(ast, `)`);\n return null;\n }\n\n visitBinaryOperatorExpr(ast: o.BinaryOperatorExpr, ctx: EmitterVisitorContext): any {\n let opStr: string;\n switch (ast.operator) {\n case o.BinaryOperator.Equals:\n opStr = '==';\n break;\n case o.BinaryOperator.Identical:\n opStr = '===';\n break;\n case o.BinaryOperator.NotEquals:\n opStr = '!=';\n break;\n case o.BinaryOperator.NotIdentical:\n opStr = '!==';\n break;\n case o.BinaryOperator.And:\n opStr = '&&';\n break;\n case o.BinaryOperator.BitwiseOr:\n opStr = '|';\n break;\n case o.BinaryOperator.BitwiseAnd:\n opStr = '&';\n break;\n case o.BinaryOperator.Or:\n opStr = '||';\n break;\n case o.BinaryOperator.Plus:\n opStr = '+';\n break;\n case o.BinaryOperator.Minus:\n opStr = '-';\n break;\n case o.BinaryOperator.Divide:\n opStr = '/';\n break;\n case o.BinaryOperator.Multiply:\n opStr = '*';\n break;\n case o.BinaryOperator.Modulo:\n opStr = '%';\n break;\n case o.BinaryOperator.Lower:\n opStr = '<';\n break;\n case o.BinaryOperator.LowerEquals:\n opStr = '<=';\n break;\n case o.BinaryOperator.Bigger:\n opStr = '>';\n break;\n case o.BinaryOperator.BiggerEquals:\n opStr = '>=';\n break;\n case o.BinaryOperator.NullishCoalesce:\n opStr = '??';\n break;\n default:\n throw new Error(`Unknown operator ${ast.operator}`);\n }\n if (ast.parens) ctx.print(ast, `(`);\n ast.lhs.visitExpression(this, ctx);\n ctx.print(ast, ` ${opStr} `);\n ast.rhs.visitExpression(this, ctx);\n if (ast.parens) ctx.print(ast, `)`);\n return null;\n }\n\n visitReadPropExpr(ast: o.ReadPropExpr, ctx: EmitterVisitorContext): any {\n ast.receiver.visitExpression(this, ctx);\n ctx.print(ast, `.`);\n ctx.print(ast, ast.name);\n return null;\n }\n visitReadKeyExpr(ast: o.ReadKeyExpr, ctx: EmitterVisitorContext): any {\n ast.receiver.visitExpression(this, ctx);\n ctx.print(ast, `[`);\n ast.index.visitExpression(this, ctx);\n ctx.print(ast, `]`);\n return null;\n }\n visitLiteralArrayExpr(ast: o.LiteralArrayExpr, ctx: EmitterVisitorContext): any {\n ctx.print(ast, `[`);\n this.visitAllExpressions(ast.entries, ctx, ',');\n ctx.print(ast, `]`);\n return null;\n }\n visitLiteralMapExpr(ast: o.LiteralMapExpr, ctx: EmitterVisitorContext): any {\n ctx.print(ast, `{`);\n this.visitAllObjects(\n (entry) => {\n ctx.print(\n ast,\n `${escapeIdentifier(entry.key, this._escapeDollarInStrings, entry.quoted)}:`,\n );\n entry.value.visitExpression(this, ctx);\n },\n ast.entries,\n ctx,\n ',',\n );\n ctx.print(ast, `}`);\n return null;\n }\n visitCommaExpr(ast: o.CommaExpr, ctx: EmitterVisitorContext): any {\n ctx.print(ast, '(');\n this.visitAllExpressions(ast.parts, ctx, ',');\n ctx.print(ast, ')');\n return null;\n }\n visitAllExpressions(\n expressions: o.Expression[],\n ctx: EmitterVisitorContext,\n separator: string,\n ): void {\n this.visitAllObjects((expr) => expr.visitExpression(this, ctx), expressions, ctx, separator);\n }\n\n visitAllObjects(\n handler: (t: T) => void,\n expressions: T[],\n ctx: EmitterVisitorContext,\n separator: string,\n ): void {\n let incrementedIndent = false;\n for (let i = 0; i < expressions.length; i++) {\n if (i > 0) {\n if (ctx.lineLength() > 80) {\n ctx.print(null, separator, true);\n if (!incrementedIndent) {\n // continuation are marked with double indent.\n ctx.incIndent();\n ctx.incIndent();\n incrementedIndent = true;\n }\n } else {\n ctx.print(null, separator, false);\n }\n }\n handler(expressions[i]);\n }\n if (incrementedIndent) {\n // continuation are marked with double indent.\n ctx.decIndent();\n ctx.decIndent();\n }\n }\n\n visitAllStatements(statements: o.Statement[], ctx: EmitterVisitorContext): void {\n statements.forEach((stmt) => stmt.visitStatement(this, ctx));\n }\n}\n\nexport function escapeIdentifier(\n input: string,\n escapeDollar: boolean,\n alwaysQuote: boolean = true,\n): any {\n if (input == null) {\n return null;\n }\n const body = input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE, (...match: string[]) => {\n if (match[0] == '$') {\n return escapeDollar ? '\\\\$' : '$';\n } else if (match[0] == '\\n') {\n return '\\\\n';\n } else if (match[0] == '\\r') {\n return '\\\\r';\n } else {\n return `\\\\${match[0]}`;\n }\n });\n const requiresQuotes = alwaysQuote || !_LEGAL_IDENTIFIER_RE.test(body);\n return requiresQuotes ? `'${body}'` : body;\n}\n\nfunction _createIndent(count: number): string {\n let res = '';\n for (let i = 0; i < count; i++) {\n res += _INDENT_WITH;\n }\n return res;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {escapeIdentifier} from '../output/abstract_emitter';\nimport * as o from '../output/output_ast';\n\nimport {Identifiers} from './r3_identifiers';\n\nexport function typeWithParameters(type: o.Expression, numParams: number): o.ExpressionType {\n if (numParams === 0) {\n return o.expressionType(type);\n }\n const params: o.Type[] = [];\n for (let i = 0; i < numParams; i++) {\n params.push(o.DYNAMIC_TYPE);\n }\n return o.expressionType(type, undefined, params);\n}\n\nexport interface R3Reference {\n value: o.Expression;\n type: o.Expression;\n}\n\n/**\n * Result of compilation of a render3 code unit, e.g. component, directive, pipe, etc.\n */\nexport interface R3CompiledExpression {\n expression: o.Expression;\n type: o.Type;\n statements: o.Statement[];\n}\n\nconst ANIMATE_SYMBOL_PREFIX = '@';\nexport function prepareSyntheticPropertyName(name: string) {\n return `${ANIMATE_SYMBOL_PREFIX}${name}`;\n}\n\nexport function prepareSyntheticListenerName(name: string, phase: string) {\n return `${ANIMATE_SYMBOL_PREFIX}${name}.${phase}`;\n}\n\nexport function getSafePropertyAccessString(accessor: string, name: string): string {\n const escapedName = escapeIdentifier(name, false, false);\n return escapedName !== name ? `${accessor}[${escapedName}]` : `${accessor}.${name}`;\n}\n\nexport function prepareSyntheticListenerFunctionName(name: string, phase: string) {\n return `animation_${name}_${phase}`;\n}\n\nexport function jitOnlyGuardedExpression(expr: o.Expression): o.Expression {\n return guardedExpression('ngJitMode', expr);\n}\n\nexport function devOnlyGuardedExpression(expr: o.Expression): o.Expression {\n return guardedExpression('ngDevMode', expr);\n}\n\nexport function guardedExpression(guard: string, expr: o.Expression): o.Expression {\n const guardExpr = new o.ExternalExpr({name: guard, moduleName: null});\n const guardNotDefined = new o.BinaryOperatorExpr(\n o.BinaryOperator.Identical,\n new o.TypeofExpr(guardExpr),\n o.literal('undefined'),\n );\n const guardUndefinedOrTrue = new o.BinaryOperatorExpr(\n o.BinaryOperator.Or,\n guardNotDefined,\n guardExpr,\n /* type */ undefined,\n /* sourceSpan */ undefined,\n true,\n );\n return new o.BinaryOperatorExpr(o.BinaryOperator.And, guardUndefinedOrTrue, expr);\n}\n\nexport function wrapReference(value: any): R3Reference {\n const wrapped = new o.WrappedNodeExpr(value);\n return {value: wrapped, type: wrapped};\n}\n\nexport function refsToArray(refs: R3Reference[], shouldForwardDeclare: boolean): o.Expression {\n const values = o.literalArr(refs.map((ref) => ref.value));\n return shouldForwardDeclare ? o.arrowFn([], values) : values;\n}\n\n/**\n * Describes an expression that may have been wrapped in a `forwardRef()` guard.\n *\n * This is used when describing expressions that can refer to types that may eagerly reference types\n * that have not yet been defined.\n */\nexport interface MaybeForwardRefExpression {\n /**\n * The unwrapped expression.\n */\n expression: T;\n /**\n * Specified whether the `expression` contains a reference to something that has not yet been\n * defined, and whether the expression is still wrapped in a `forwardRef()` call.\n *\n * If this value is `ForwardRefHandling.None` then the `expression` is safe to use as-is.\n *\n * Otherwise the `expression` was wrapped in a call to `forwardRef()` and must not be eagerly\n * evaluated. Instead it must be wrapped in a function closure that will be evaluated lazily to\n * allow the definition of the expression to be evaluated first.\n *\n * In full AOT compilation it can be safe to unwrap the `forwardRef()` call up front if the\n * expression will actually be evaluated lazily inside a function call after the value of\n * `expression` has been defined.\n *\n * But in other cases, such as partial AOT compilation or JIT compilation the expression will be\n * evaluated eagerly in top level code so will need to continue to be wrapped in a `forwardRef()`\n * call.\n *\n */\n forwardRef: ForwardRefHandling;\n}\n\nexport function createMayBeForwardRefExpression(\n expression: T,\n forwardRef: ForwardRefHandling,\n): MaybeForwardRefExpression {\n return {expression, forwardRef};\n}\n\n/**\n * Convert a `MaybeForwardRefExpression` to an `Expression`, possibly wrapping its expression in a\n * `forwardRef()` call.\n *\n * If `MaybeForwardRefExpression.forwardRef` is `ForwardRefHandling.Unwrapped` then the expression\n * was originally wrapped in a `forwardRef()` call to prevent the value from being eagerly evaluated\n * in the code.\n *\n * See `packages/compiler-cli/src/ngtsc/annotations/src/injectable.ts` and\n * `packages/compiler/src/jit_compiler_facade.ts` for more information.\n */\nexport function convertFromMaybeForwardRefExpression({\n expression,\n forwardRef,\n}: MaybeForwardRefExpression): o.Expression {\n switch (forwardRef) {\n case ForwardRefHandling.None:\n case ForwardRefHandling.Wrapped:\n return expression;\n case ForwardRefHandling.Unwrapped:\n return generateForwardRef(expression);\n }\n}\n\n/**\n * Generate an expression that has the given `expr` wrapped in the following form:\n *\n * ```ts\n * forwardRef(() => expr)\n * ```\n */\nexport function generateForwardRef(expr: o.Expression): o.Expression {\n return o.importExpr(Identifiers.forwardRef).callFn([o.arrowFn([], expr)]);\n}\n\n/**\n * Specifies how a forward ref has been handled in a MaybeForwardRefExpression\n */\nexport const enum ForwardRefHandling {\n /** The expression was not wrapped in a `forwardRef()` call in the first place. */\n None,\n /** The expression is still wrapped in a `forwardRef()` call. */\n Wrapped,\n /** The expression was wrapped in a `forwardRef()` call but has since been unwrapped. */\n Unwrapped,\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {FactoryTarget} from '../compiler_facade_interface';\nimport {InjectFlags} from '../core';\nimport * as o from '../output/output_ast';\nimport {Identifiers as R3} from '../render3/r3_identifiers';\n\nimport {R3CompiledExpression, R3Reference, typeWithParameters} from './util';\n\n/**\n * Metadata required by the factory generator to generate a `factory` function for a type.\n */\nexport interface R3ConstructorFactoryMetadata {\n /**\n * String name of the type being generated (used to name the factory function).\n */\n name: string;\n\n /**\n * An expression representing the interface type being constructed.\n */\n type: R3Reference;\n\n /** Number of arguments for the `type`. */\n typeArgumentCount: number;\n\n /**\n * Regardless of whether `fnOrClass` is a constructor function or a user-defined factory, it\n * may have 0 or more parameters, which will be injected according to the `R3DependencyMetadata`\n * for those parameters. If this is `null`, then the type's constructor is nonexistent and will\n * be inherited from `fnOrClass` which is interpreted as the current type. If this is `'invalid'`,\n * then one or more of the parameters wasn't resolvable and any attempt to use these deps will\n * result in a runtime error.\n */\n deps: R3DependencyMetadata[] | 'invalid' | null;\n\n /**\n * Type of the target being created by the factory.\n */\n target: FactoryTarget;\n}\n\nexport enum R3FactoryDelegateType {\n Class = 0,\n Function = 1,\n}\n\nexport interface R3DelegatedFnOrClassMetadata extends R3ConstructorFactoryMetadata {\n delegate: o.Expression;\n delegateType: R3FactoryDelegateType;\n delegateDeps: R3DependencyMetadata[];\n}\n\nexport interface R3ExpressionFactoryMetadata extends R3ConstructorFactoryMetadata {\n expression: o.Expression;\n}\n\nexport type R3FactoryMetadata =\n | R3ConstructorFactoryMetadata\n | R3DelegatedFnOrClassMetadata\n | R3ExpressionFactoryMetadata;\n\nexport interface R3DependencyMetadata {\n /**\n * An expression representing the token or value to be injected.\n * Or `null` if the dependency could not be resolved - making it invalid.\n */\n token: o.Expression | null;\n\n /**\n * If an @Attribute decorator is present, this is the literal type of the attribute name, or\n * the unknown type if no literal type is available (e.g. the attribute name is an expression).\n * Otherwise it is null;\n */\n attributeNameType: o.Expression | null;\n\n /**\n * Whether the dependency has an @Host qualifier.\n */\n host: boolean;\n\n /**\n * Whether the dependency has an @Optional qualifier.\n */\n optional: boolean;\n\n /**\n * Whether the dependency has an @Self qualifier.\n */\n self: boolean;\n\n /**\n * Whether the dependency has an @SkipSelf qualifier.\n */\n skipSelf: boolean;\n}\n\n/**\n * Construct a factory function expression for the given `R3FactoryMetadata`.\n */\nexport function compileFactoryFunction(meta: R3FactoryMetadata): R3CompiledExpression {\n const t = o.variable('__ngFactoryType__');\n let baseFactoryVar: o.ReadVarExpr | null = null;\n\n // The type to instantiate via constructor invocation. If there is no delegated factory, meaning\n // this type is always created by constructor invocation, then this is the type-to-create\n // parameter provided by the user (t) if specified, or the current type if not. If there is a\n // delegated factory (which is used to create the current type) then this is only the type-to-\n // create parameter (t).\n const typeForCtor = !isDelegatedFactoryMetadata(meta)\n ? new o.BinaryOperatorExpr(o.BinaryOperator.Or, t, meta.type.value)\n : t;\n\n let ctorExpr: o.Expression | null = null;\n if (meta.deps !== null) {\n // There is a constructor (either explicitly or implicitly defined).\n if (meta.deps !== 'invalid') {\n ctorExpr = new o.InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.target));\n }\n } else {\n // There is no constructor, use the base class' factory to construct typeForCtor.\n baseFactoryVar = o.variable(`ɵ${meta.name}_BaseFactory`);\n ctorExpr = baseFactoryVar.callFn([typeForCtor]);\n }\n\n const body: o.Statement[] = [];\n let retExpr: o.Expression | null = null;\n\n function makeConditionalFactory(nonCtorExpr: o.Expression): o.ReadVarExpr {\n const r = o.variable('__ngConditionalFactory__');\n body.push(r.set(o.NULL_EXPR).toDeclStmt());\n const ctorStmt =\n ctorExpr !== null\n ? r.set(ctorExpr).toStmt()\n : o.importExpr(R3.invalidFactory).callFn([]).toStmt();\n body.push(o.ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()]));\n return r;\n }\n\n if (isDelegatedFactoryMetadata(meta)) {\n // This type is created with a delegated factory. If a type parameter is not specified, call\n // the factory instead.\n const delegateArgs = injectDependencies(meta.delegateDeps, meta.target);\n // Either call `new delegate(...)` or `delegate(...)` depending on meta.delegateType.\n const factoryExpr = new (\n meta.delegateType === R3FactoryDelegateType.Class ? o.InstantiateExpr : o.InvokeFunctionExpr\n )(meta.delegate, delegateArgs);\n retExpr = makeConditionalFactory(factoryExpr);\n } else if (isExpressionFactoryMetadata(meta)) {\n // TODO(alxhub): decide whether to lower the value here or in the caller\n retExpr = makeConditionalFactory(meta.expression);\n } else {\n retExpr = ctorExpr;\n }\n\n if (retExpr === null) {\n // The expression cannot be formed so render an `ɵɵinvalidFactory()` call.\n body.push(o.importExpr(R3.invalidFactory).callFn([]).toStmt());\n } else if (baseFactoryVar !== null) {\n // This factory uses a base factory, so call `ɵɵgetInheritedFactory()` to compute it.\n const getInheritedFactoryCall = o.importExpr(R3.getInheritedFactory).callFn([meta.type.value]);\n // Memoize the base factoryFn: `baseFactory || (baseFactory = ɵɵgetInheritedFactory(...))`\n const baseFactory = new o.BinaryOperatorExpr(\n o.BinaryOperator.Or,\n baseFactoryVar,\n baseFactoryVar.set(getInheritedFactoryCall),\n );\n body.push(new o.ReturnStatement(baseFactory.callFn([typeForCtor])));\n } else {\n // This is straightforward factory, just return it.\n body.push(new o.ReturnStatement(retExpr));\n }\n\n let factoryFn: o.Expression = o.fn(\n [new o.FnParam(t.name, o.DYNAMIC_TYPE)],\n body,\n o.INFERRED_TYPE,\n undefined,\n `${meta.name}_Factory`,\n );\n\n if (baseFactoryVar !== null) {\n // There is a base factory variable so wrap its declaration along with the factory function into\n // an IIFE.\n factoryFn = o\n .arrowFn([], [new o.DeclareVarStmt(baseFactoryVar.name!), new o.ReturnStatement(factoryFn)])\n .callFn([], /* sourceSpan */ undefined, /* pure */ true);\n }\n\n return {\n expression: factoryFn,\n statements: [],\n type: createFactoryType(meta),\n };\n}\n\nexport function createFactoryType(meta: R3FactoryMetadata) {\n const ctorDepsType =\n meta.deps !== null && meta.deps !== 'invalid' ? createCtorDepsType(meta.deps) : o.NONE_TYPE;\n return o.expressionType(\n o.importExpr(R3.FactoryDeclaration, [\n typeWithParameters(meta.type.type, meta.typeArgumentCount),\n ctorDepsType,\n ]),\n );\n}\n\nfunction injectDependencies(deps: R3DependencyMetadata[], target: FactoryTarget): o.Expression[] {\n return deps.map((dep, index) => compileInjectDependency(dep, target, index));\n}\n\nfunction compileInjectDependency(\n dep: R3DependencyMetadata,\n target: FactoryTarget,\n index: number,\n): o.Expression {\n // Interpret the dependency according to its resolved type.\n if (dep.token === null) {\n return o.importExpr(R3.invalidFactoryDep).callFn([o.literal(index)]);\n } else if (dep.attributeNameType === null) {\n // Build up the injection flags according to the metadata.\n const flags =\n InjectFlags.Default |\n (dep.self ? InjectFlags.Self : 0) |\n (dep.skipSelf ? InjectFlags.SkipSelf : 0) |\n (dep.host ? InjectFlags.Host : 0) |\n (dep.optional ? InjectFlags.Optional : 0) |\n (target === FactoryTarget.Pipe ? InjectFlags.ForPipe : 0);\n\n // If this dependency is optional or otherwise has non-default flags, then additional\n // parameters describing how to inject the dependency must be passed to the inject function\n // that's being used.\n let flagsParam: o.LiteralExpr | null =\n flags !== InjectFlags.Default || dep.optional ? o.literal(flags) : null;\n\n // Build up the arguments to the injectFn call.\n const injectArgs = [dep.token];\n if (flagsParam) {\n injectArgs.push(flagsParam);\n }\n const injectFn = getInjectFn(target);\n return o.importExpr(injectFn).callFn(injectArgs);\n } else {\n // The `dep.attributeTypeName` value is defined, which indicates that this is an `@Attribute()`\n // type dependency. For the generated JS we still want to use the `dep.token` value in case the\n // name given for the attribute is not a string literal. For example given `@Attribute(foo())`,\n // we want to generate `ɵɵinjectAttribute(foo())`.\n //\n // The `dep.attributeTypeName` is only actually used (in `createCtorDepType()`) to generate\n // typings.\n return o.importExpr(R3.injectAttribute).callFn([dep.token]);\n }\n}\n\nfunction createCtorDepsType(deps: R3DependencyMetadata[]): o.Type {\n let hasTypes = false;\n const attributeTypes = deps.map((dep) => {\n const type = createCtorDepType(dep);\n if (type !== null) {\n hasTypes = true;\n return type;\n } else {\n return o.literal(null);\n }\n });\n\n if (hasTypes) {\n return o.expressionType(o.literalArr(attributeTypes));\n } else {\n return o.NONE_TYPE;\n }\n}\n\nfunction createCtorDepType(dep: R3DependencyMetadata): o.LiteralMapExpr | null {\n const entries: {key: string; quoted: boolean; value: o.Expression}[] = [];\n\n if (dep.attributeNameType !== null) {\n entries.push({key: 'attribute', value: dep.attributeNameType, quoted: false});\n }\n if (dep.optional) {\n entries.push({key: 'optional', value: o.literal(true), quoted: false});\n }\n if (dep.host) {\n entries.push({key: 'host', value: o.literal(true), quoted: false});\n }\n if (dep.self) {\n entries.push({key: 'self', value: o.literal(true), quoted: false});\n }\n if (dep.skipSelf) {\n entries.push({key: 'skipSelf', value: o.literal(true), quoted: false});\n }\n\n return entries.length > 0 ? o.literalMap(entries) : null;\n}\n\nexport function isDelegatedFactoryMetadata(\n meta: R3FactoryMetadata,\n): meta is R3DelegatedFnOrClassMetadata {\n return (meta as any).delegateType !== undefined;\n}\n\nexport function isExpressionFactoryMetadata(\n meta: R3FactoryMetadata,\n): meta is R3ExpressionFactoryMetadata {\n return (meta as any).expression !== undefined;\n}\n\nfunction getInjectFn(target: FactoryTarget): o.ExternalReference {\n switch (target) {\n case FactoryTarget.Component:\n case FactoryTarget.Directive:\n case FactoryTarget.Pipe:\n return R3.directiveInject;\n case FactoryTarget.NgModule:\n case FactoryTarget.Injectable:\n default:\n return R3.inject;\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SecurityContext} from '../core';\nimport {ParseSourceSpan} from '../parse_util';\n\nexport class ParserError {\n public message: string;\n constructor(\n message: string,\n public input: string,\n public errLocation: string,\n public ctxLocation?: any,\n ) {\n this.message = `Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`;\n }\n}\n\nexport class ParseSpan {\n constructor(\n public start: number,\n public end: number,\n ) {}\n toAbsolute(absoluteOffset: number): AbsoluteSourceSpan {\n return new AbsoluteSourceSpan(absoluteOffset + this.start, absoluteOffset + this.end);\n }\n}\n\nexport abstract class AST {\n constructor(\n public span: ParseSpan,\n /**\n * Absolute location of the expression AST in a source code file.\n */\n public sourceSpan: AbsoluteSourceSpan,\n ) {}\n\n abstract visit(visitor: AstVisitor, context?: any): any;\n\n toString(): string {\n return 'AST';\n }\n}\n\nexport abstract class ASTWithName extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public nameSpan: AbsoluteSourceSpan,\n ) {\n super(span, sourceSpan);\n }\n}\n\nexport class EmptyExpr extends AST {\n override visit(visitor: AstVisitor, context: any = null) {\n // do nothing\n }\n}\n\nexport class ImplicitReceiver extends AST {\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitImplicitReceiver(this, context);\n }\n}\n\n/**\n * Receiver when something is accessed through `this` (e.g. `this.foo`). Note that this class\n * inherits from `ImplicitReceiver`, because accessing something through `this` is treated the\n * same as accessing it implicitly inside of an Angular template (e.g. `[attr.title]=\"this.title\"`\n * is the same as `[attr.title]=\"title\"`.). Inheriting allows for the `this` accesses to be treated\n * the same as implicit ones, except for a couple of exceptions like `$event` and `$any`.\n * TODO: we should find a way for this class not to extend from `ImplicitReceiver` in the future.\n */\nexport class ThisReceiver extends ImplicitReceiver {\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitThisReceiver?.(this, context);\n }\n}\n\n/**\n * Multiple expressions separated by a semicolon.\n */\nexport class Chain extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public expressions: any[],\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitChain(this, context);\n }\n}\n\nexport class Conditional extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public condition: AST,\n public trueExp: AST,\n public falseExp: AST,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitConditional(this, context);\n }\n}\n\nexport class PropertyRead extends ASTWithName {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n nameSpan: AbsoluteSourceSpan,\n public receiver: AST,\n public name: string,\n ) {\n super(span, sourceSpan, nameSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitPropertyRead(this, context);\n }\n}\n\nexport class PropertyWrite extends ASTWithName {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n nameSpan: AbsoluteSourceSpan,\n public receiver: AST,\n public name: string,\n public value: AST,\n ) {\n super(span, sourceSpan, nameSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitPropertyWrite(this, context);\n }\n}\n\nexport class SafePropertyRead extends ASTWithName {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n nameSpan: AbsoluteSourceSpan,\n public receiver: AST,\n public name: string,\n ) {\n super(span, sourceSpan, nameSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitSafePropertyRead(this, context);\n }\n}\n\nexport class KeyedRead extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public receiver: AST,\n public key: AST,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitKeyedRead(this, context);\n }\n}\n\nexport class SafeKeyedRead extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public receiver: AST,\n public key: AST,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitSafeKeyedRead(this, context);\n }\n}\n\nexport class KeyedWrite extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public receiver: AST,\n public key: AST,\n public value: AST,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitKeyedWrite(this, context);\n }\n}\n\nexport class BindingPipe extends ASTWithName {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public exp: AST,\n public name: string,\n public args: any[],\n nameSpan: AbsoluteSourceSpan,\n ) {\n super(span, sourceSpan, nameSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitPipe(this, context);\n }\n}\n\nexport class LiteralPrimitive extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public value: any,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitLiteralPrimitive(this, context);\n }\n}\n\nexport class LiteralArray extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public expressions: any[],\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitLiteralArray(this, context);\n }\n}\n\nexport type LiteralMapKey = {\n key: string;\n quoted: boolean;\n isShorthandInitialized?: boolean;\n};\n\nexport class LiteralMap extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public keys: LiteralMapKey[],\n public values: any[],\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitLiteralMap(this, context);\n }\n}\n\nexport class Interpolation extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public strings: string[],\n public expressions: AST[],\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitInterpolation(this, context);\n }\n}\n\nexport class Binary extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public operation: string,\n public left: AST,\n public right: AST,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitBinary(this, context);\n }\n}\n\n/**\n * For backwards compatibility reasons, `Unary` inherits from `Binary` and mimics the binary AST\n * node that was originally used. This inheritance relation can be deleted in some future major,\n * after consumers have been given a chance to fully support Unary.\n */\nexport class Unary extends Binary {\n // Redeclare the properties that are inherited from `Binary` as `never`, as consumers should not\n // depend on these fields when operating on `Unary`.\n override left: never = null as never;\n override right: never = null as never;\n override operation: never = null as never;\n\n /**\n * Creates a unary minus expression \"-x\", represented as `Binary` using \"0 - x\".\n */\n static createMinus(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expr: AST): Unary {\n return new Unary(\n span,\n sourceSpan,\n '-',\n expr,\n '-',\n new LiteralPrimitive(span, sourceSpan, 0),\n expr,\n );\n }\n\n /**\n * Creates a unary plus expression \"+x\", represented as `Binary` using \"x - 0\".\n */\n static createPlus(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expr: AST): Unary {\n return new Unary(\n span,\n sourceSpan,\n '+',\n expr,\n '-',\n expr,\n new LiteralPrimitive(span, sourceSpan, 0),\n );\n }\n\n /**\n * During the deprecation period this constructor is private, to avoid consumers from creating\n * a `Unary` with the fallback properties for `Binary`.\n */\n private constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public operator: string,\n public expr: AST,\n binaryOp: string,\n binaryLeft: AST,\n binaryRight: AST,\n ) {\n super(span, sourceSpan, binaryOp, binaryLeft, binaryRight);\n }\n\n override visit(visitor: AstVisitor, context: any = null): any {\n if (visitor.visitUnary !== undefined) {\n return visitor.visitUnary(this, context);\n }\n return visitor.visitBinary(this, context);\n }\n}\n\nexport class PrefixNot extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public expression: AST,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitPrefixNot(this, context);\n }\n}\n\nexport class TypeofExpression extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public expression: AST,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitTypeofExpression(this, context);\n }\n}\n\nexport class NonNullAssert extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public expression: AST,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitNonNullAssert(this, context);\n }\n}\n\nexport class Call extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public receiver: AST,\n public args: AST[],\n public argumentSpan: AbsoluteSourceSpan,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitCall(this, context);\n }\n}\n\nexport class SafeCall extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public receiver: AST,\n public args: AST[],\n public argumentSpan: AbsoluteSourceSpan,\n ) {\n super(span, sourceSpan);\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n return visitor.visitSafeCall(this, context);\n }\n}\n\nexport class TemplateLiteral extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public elements: TemplateLiteralElement[],\n public expressions: AST[],\n ) {\n super(span, sourceSpan);\n }\n\n override visit(visitor: AstVisitor, context?: any) {\n return visitor.visitTemplateLiteral(this, context);\n }\n}\nexport class TemplateLiteralElement extends AST {\n constructor(\n span: ParseSpan,\n sourceSpan: AbsoluteSourceSpan,\n public text: string,\n ) {\n super(span, sourceSpan);\n }\n\n override visit(visitor: AstVisitor, context?: any) {\n return visitor.visitTemplateLiteralElement(this, context);\n }\n}\n\n/**\n * Records the absolute position of a text span in a source file, where `start` and `end` are the\n * starting and ending byte offsets, respectively, of the text span in a source file.\n */\nexport class AbsoluteSourceSpan {\n constructor(\n public readonly start: number,\n public readonly end: number,\n ) {}\n}\n\nexport class ASTWithSource extends AST {\n constructor(\n public ast: T,\n public source: string | null,\n public location: string,\n absoluteOffset: number,\n public errors: ParserError[],\n ) {\n super(\n new ParseSpan(0, source === null ? 0 : source.length),\n new AbsoluteSourceSpan(\n absoluteOffset,\n source === null ? absoluteOffset : absoluteOffset + source.length,\n ),\n );\n }\n override visit(visitor: AstVisitor, context: any = null): any {\n if (visitor.visitASTWithSource) {\n return visitor.visitASTWithSource(this, context);\n }\n return this.ast.visit(visitor, context);\n }\n override toString(): string {\n return `${this.source} in ${this.location}`;\n }\n}\n\n/**\n * TemplateBinding refers to a particular key-value pair in a microsyntax\n * expression. A few examples are:\n *\n * |---------------------|--------------|---------|--------------|\n * | expression | key | value | binding type |\n * |---------------------|--------------|---------|--------------|\n * | 1. let item | item | null | variable |\n * | 2. of items | ngForOf | items | expression |\n * | 3. let x = y | x | y | variable |\n * | 4. index as i | i | index | variable |\n * | 5. trackBy: func | ngForTrackBy | func | expression |\n * | 6. *ngIf=\"cond\" | ngIf | cond | expression |\n * |---------------------|--------------|---------|--------------|\n *\n * (6) is a notable exception because it is a binding from the template key in\n * the LHS of a HTML attribute to the expression in the RHS. All other bindings\n * in the example above are derived solely from the RHS.\n */\nexport type TemplateBinding = VariableBinding | ExpressionBinding;\n\nexport class VariableBinding {\n /**\n * @param sourceSpan entire span of the binding.\n * @param key name of the LHS along with its span.\n * @param value optional value for the RHS along with its span.\n */\n constructor(\n public readonly sourceSpan: AbsoluteSourceSpan,\n public readonly key: TemplateBindingIdentifier,\n public readonly value: TemplateBindingIdentifier | null,\n ) {}\n}\n\nexport class ExpressionBinding {\n /**\n * @param sourceSpan entire span of the binding.\n * @param key binding name, like ngForOf, ngForTrackBy, ngIf, along with its\n * span. Note that the length of the span may not be the same as\n * `key.source.length`. For example,\n * 1. key.source = ngFor, key.span is for \"ngFor\"\n * 2. key.source = ngForOf, key.span is for \"of\"\n * 3. key.source = ngForTrackBy, key.span is for \"trackBy\"\n * @param value optional expression for the RHS.\n */\n constructor(\n public readonly sourceSpan: AbsoluteSourceSpan,\n public readonly key: TemplateBindingIdentifier,\n public readonly value: ASTWithSource | null,\n ) {}\n}\n\nexport interface TemplateBindingIdentifier {\n source: string;\n span: AbsoluteSourceSpan;\n}\n\nexport interface AstVisitor {\n /**\n * The `visitUnary` method is declared as optional for backwards compatibility. In an upcoming\n * major release, this method will be made required.\n */\n visitUnary?(ast: Unary, context: any): any;\n visitBinary(ast: Binary, context: any): any;\n visitChain(ast: Chain, context: any): any;\n visitConditional(ast: Conditional, context: any): any;\n /**\n * The `visitThisReceiver` method is declared as optional for backwards compatibility.\n * In an upcoming major release, this method will be made required.\n */\n visitThisReceiver?(ast: ThisReceiver, context: any): any;\n visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;\n visitInterpolation(ast: Interpolation, context: any): any;\n visitKeyedRead(ast: KeyedRead, context: any): any;\n visitKeyedWrite(ast: KeyedWrite, context: any): any;\n visitLiteralArray(ast: LiteralArray, context: any): any;\n visitLiteralMap(ast: LiteralMap, context: any): any;\n visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;\n visitPipe(ast: BindingPipe, context: any): any;\n visitPrefixNot(ast: PrefixNot, context: any): any;\n visitTypeofExpression(ast: TypeofExpression, context: any): any;\n visitNonNullAssert(ast: NonNullAssert, context: any): any;\n visitPropertyRead(ast: PropertyRead, context: any): any;\n visitPropertyWrite(ast: PropertyWrite, context: any): any;\n visitSafePropertyRead(ast: SafePropertyRead, context: any): any;\n visitSafeKeyedRead(ast: SafeKeyedRead, context: any): any;\n visitCall(ast: Call, context: any): any;\n visitSafeCall(ast: SafeCall, context: any): any;\n visitTemplateLiteral(ast: TemplateLiteral, context: any): any;\n visitTemplateLiteralElement(ast: TemplateLiteralElement, context: any): any;\n visitASTWithSource?(ast: ASTWithSource, context: any): any;\n /**\n * This function is optionally defined to allow classes that implement this\n * interface to selectively decide if the specified `ast` should be visited.\n * @param ast node to visit\n * @param context context that gets passed to the node and all its children\n */\n visit?(ast: AST, context?: any): any;\n}\n\nexport class RecursiveAstVisitor implements AstVisitor {\n visit(ast: AST, context?: any): any {\n // The default implementation just visits every node.\n // Classes that extend RecursiveAstVisitor should override this function\n // to selectively visit the specified node.\n ast.visit(this, context);\n }\n visitUnary(ast: Unary, context: any): any {\n this.visit(ast.expr, context);\n }\n visitBinary(ast: Binary, context: any): any {\n this.visit(ast.left, context);\n this.visit(ast.right, context);\n }\n visitChain(ast: Chain, context: any): any {\n this.visitAll(ast.expressions, context);\n }\n visitConditional(ast: Conditional, context: any): any {\n this.visit(ast.condition, context);\n this.visit(ast.trueExp, context);\n this.visit(ast.falseExp, context);\n }\n visitPipe(ast: BindingPipe, context: any): any {\n this.visit(ast.exp, context);\n this.visitAll(ast.args, context);\n }\n visitImplicitReceiver(ast: ThisReceiver, context: any): any {}\n visitThisReceiver(ast: ThisReceiver, context: any): any {}\n visitInterpolation(ast: Interpolation, context: any): any {\n this.visitAll(ast.expressions, context);\n }\n visitKeyedRead(ast: KeyedRead, context: any): any {\n this.visit(ast.receiver, context);\n this.visit(ast.key, context);\n }\n visitKeyedWrite(ast: KeyedWrite, context: any): any {\n this.visit(ast.receiver, context);\n this.visit(ast.key, context);\n this.visit(ast.value, context);\n }\n visitLiteralArray(ast: LiteralArray, context: any): any {\n this.visitAll(ast.expressions, context);\n }\n visitLiteralMap(ast: LiteralMap, context: any): any {\n this.visitAll(ast.values, context);\n }\n visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any {}\n visitPrefixNot(ast: PrefixNot, context: any): any {\n this.visit(ast.expression, context);\n }\n visitTypeofExpression(ast: TypeofExpression, context: any) {\n this.visit(ast.expression, context);\n }\n visitNonNullAssert(ast: NonNullAssert, context: any): any {\n this.visit(ast.expression, context);\n }\n visitPropertyRead(ast: PropertyRead, context: any): any {\n this.visit(ast.receiver, context);\n }\n visitPropertyWrite(ast: PropertyWrite, context: any): any {\n this.visit(ast.receiver, context);\n this.visit(ast.value, context);\n }\n visitSafePropertyRead(ast: SafePropertyRead, context: any): any {\n this.visit(ast.receiver, context);\n }\n visitSafeKeyedRead(ast: SafeKeyedRead, context: any): any {\n this.visit(ast.receiver, context);\n this.visit(ast.key, context);\n }\n visitCall(ast: Call, context: any): any {\n this.visit(ast.receiver, context);\n this.visitAll(ast.args, context);\n }\n visitSafeCall(ast: SafeCall, context: any): any {\n this.visit(ast.receiver, context);\n this.visitAll(ast.args, context);\n }\n visitTemplateLiteral(ast: TemplateLiteral, context: any) {\n // Iterate in the declaration order. Note that there will\n // always be one expression less than the number of elements.\n for (let i = 0; i < ast.elements.length; i++) {\n this.visit(ast.elements[i], context);\n\n const expression = i < ast.expressions.length ? ast.expressions[i] : null;\n if (expression !== null) {\n this.visit(expression, context);\n }\n }\n }\n visitTemplateLiteralElement(ast: TemplateLiteralElement, context: any) {}\n // This is not part of the AstVisitor interface, just a helper method\n visitAll(asts: AST[], context: any): any {\n for (const ast of asts) {\n this.visit(ast, context);\n }\n }\n}\n\n// Bindings\n\nexport class ParsedProperty {\n public readonly isLiteral: boolean;\n public readonly isAnimation: boolean;\n\n constructor(\n public name: string,\n public expression: ASTWithSource,\n public type: ParsedPropertyType,\n public sourceSpan: ParseSourceSpan,\n readonly keySpan: ParseSourceSpan,\n public valueSpan: ParseSourceSpan | undefined,\n ) {\n this.isLiteral = this.type === ParsedPropertyType.LITERAL_ATTR;\n this.isAnimation = this.type === ParsedPropertyType.ANIMATION;\n }\n}\n\nexport enum ParsedPropertyType {\n DEFAULT,\n LITERAL_ATTR,\n ANIMATION,\n TWO_WAY,\n}\n\nexport enum ParsedEventType {\n // DOM or Directive event\n Regular,\n // Animation specific event\n Animation,\n // Event side of a two-way binding (e.g. `[(property)]=\"expression\"`).\n TwoWay,\n}\n\nexport class ParsedEvent {\n // Regular events have a target\n // Animation events have a phase\n constructor(\n name: string,\n targetOrPhase: string,\n type: ParsedEventType.TwoWay,\n handler: ASTWithSource,\n sourceSpan: ParseSourceSpan,\n handlerSpan: ParseSourceSpan,\n keySpan: ParseSourceSpan,\n );\n\n constructor(\n name: string,\n targetOrPhase: string,\n type: ParsedEventType,\n handler: ASTWithSource,\n sourceSpan: ParseSourceSpan,\n handlerSpan: ParseSourceSpan,\n keySpan: ParseSourceSpan,\n );\n\n constructor(\n public name: string,\n public targetOrPhase: string,\n public type: ParsedEventType,\n public handler: ASTWithSource,\n public sourceSpan: ParseSourceSpan,\n public handlerSpan: ParseSourceSpan,\n readonly keySpan: ParseSourceSpan,\n ) {}\n}\n\n/**\n * ParsedVariable represents a variable declaration in a microsyntax expression.\n */\nexport class ParsedVariable {\n constructor(\n public readonly name: string,\n public readonly value: string,\n public readonly sourceSpan: ParseSourceSpan,\n public readonly keySpan: ParseSourceSpan,\n public readonly valueSpan?: ParseSourceSpan,\n ) {}\n}\n\nexport enum BindingType {\n // A regular binding to a property (e.g. `[property]=\"expression\"`).\n Property,\n // A binding to an element attribute (e.g. `[attr.name]=\"expression\"`).\n Attribute,\n // A binding to a CSS class (e.g. `[class.name]=\"condition\"`).\n Class,\n // A binding to a style rule (e.g. `[style.rule]=\"expression\"`).\n Style,\n // A binding to an animation reference (e.g. `[animate.key]=\"expression\"`).\n Animation,\n // Property side of a two-way binding (e.g. `[(property)]=\"expression\"`).\n TwoWay,\n}\n\nexport class BoundElementProperty {\n constructor(\n public name: string,\n public type: BindingType,\n public securityContext: SecurityContext,\n public value: ASTWithSource,\n public unit: string | null,\n public sourceSpan: ParseSourceSpan,\n readonly keySpan: ParseSourceSpan | undefined,\n public valueSpan: ParseSourceSpan | undefined,\n ) {}\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport enum TagContentType {\n RAW_TEXT,\n ESCAPABLE_RAW_TEXT,\n PARSABLE_DATA,\n}\n\nexport interface TagDefinition {\n closedByParent: boolean;\n implicitNamespacePrefix: string | null;\n isVoid: boolean;\n ignoreFirstLf: boolean;\n canSelfClose: boolean;\n preventNamespaceInheritance: boolean;\n\n isClosedByChild(name: string): boolean;\n getContentType(prefix?: string): TagContentType;\n}\n\nexport function splitNsName(elementName: string, fatal: boolean = true): [string | null, string] {\n if (elementName[0] != ':') {\n return [null, elementName];\n }\n\n const colonIndex = elementName.indexOf(':', 1);\n\n if (colonIndex === -1) {\n if (fatal) {\n throw new Error(`Unsupported format \"${elementName}\" expecting \":namespace:name\"`);\n } else {\n return [null, elementName];\n }\n }\n\n return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];\n}\n\n// `` tags work the same regardless the namespace\nexport function isNgContainer(tagName: string): boolean {\n return splitNsName(tagName)[1] === 'ng-container';\n}\n\n// `` tags work the same regardless the namespace\nexport function isNgContent(tagName: string): boolean {\n return splitNsName(tagName)[1] === 'ng-content';\n}\n\n// `` tags work the same regardless the namespace\nexport function isNgTemplate(tagName: string): boolean {\n return splitNsName(tagName)[1] === 'ng-template';\n}\n\nexport function getNsPrefix(fullName: string): string;\nexport function getNsPrefix(fullName: null): null;\nexport function getNsPrefix(fullName: string | null): string | null {\n return fullName === null ? null : splitNsName(fullName)[0];\n}\n\nexport function mergeNsAndName(prefix: string, localName: string): string {\n return prefix ? `:${prefix}:${localName}` : localName;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SecurityContext} from '../core';\nimport {\n AST,\n ASTWithSource,\n BindingType,\n BoundElementProperty,\n ParsedEvent,\n ParsedEventType,\n} from '../expression_parser/ast';\nimport {I18nMeta} from '../i18n/i18n_ast';\nimport {ParseSourceSpan} from '../parse_util';\n\nexport interface Node {\n sourceSpan: ParseSourceSpan;\n visit(visitor: Visitor): Result;\n}\n\n/**\n * This is an R3 `Node`-like wrapper for a raw `html.Comment` node. We do not currently\n * require the implementation of a visitor for Comments as they are only collected at\n * the top-level of the R3 AST, and only if `Render3ParseOptions['collectCommentNodes']`\n * is true.\n */\nexport class Comment implements Node {\n constructor(\n public value: string,\n public sourceSpan: ParseSourceSpan,\n ) {}\n visit(_visitor: Visitor): Result {\n throw new Error('visit() not implemented for Comment');\n }\n}\n\nexport class Text implements Node {\n constructor(\n public value: string,\n public sourceSpan: ParseSourceSpan,\n ) {}\n visit(visitor: Visitor): Result {\n return visitor.visitText(this);\n }\n}\n\nexport class BoundText implements Node {\n constructor(\n public value: AST,\n public sourceSpan: ParseSourceSpan,\n public i18n?: I18nMeta,\n ) {}\n visit(visitor: Visitor): Result {\n return visitor.visitBoundText(this);\n }\n}\n\n/**\n * Represents a text attribute in the template.\n *\n * `valueSpan` may not be present in cases where there is no value `
`.\n * `keySpan` may also not be present for synthetic attributes from ICU expansions.\n */\nexport class TextAttribute implements Node {\n constructor(\n public name: string,\n public value: string,\n public sourceSpan: ParseSourceSpan,\n readonly keySpan: ParseSourceSpan | undefined,\n public valueSpan?: ParseSourceSpan,\n public i18n?: I18nMeta,\n ) {}\n visit(visitor: Visitor): Result {\n return visitor.visitTextAttribute(this);\n }\n}\n\nexport class BoundAttribute implements Node {\n constructor(\n public name: string,\n public type: BindingType,\n public securityContext: SecurityContext,\n public value: AST,\n public unit: string | null,\n public sourceSpan: ParseSourceSpan,\n readonly keySpan: ParseSourceSpan,\n public valueSpan: ParseSourceSpan | undefined,\n public i18n: I18nMeta | undefined,\n ) {}\n\n static fromBoundElementProperty(prop: BoundElementProperty, i18n?: I18nMeta): BoundAttribute {\n if (prop.keySpan === undefined) {\n throw new Error(\n `Unexpected state: keySpan must be defined for bound attributes but was not for ${prop.name}: ${prop.sourceSpan}`,\n );\n }\n return new BoundAttribute(\n prop.name,\n prop.type,\n prop.securityContext,\n prop.value,\n prop.unit,\n prop.sourceSpan,\n prop.keySpan,\n prop.valueSpan,\n i18n,\n );\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitBoundAttribute(this);\n }\n}\n\nexport class BoundEvent implements Node {\n constructor(\n public name: string,\n public type: ParsedEventType,\n public handler: AST,\n public target: string | null,\n public phase: string | null,\n public sourceSpan: ParseSourceSpan,\n public handlerSpan: ParseSourceSpan,\n readonly keySpan: ParseSourceSpan,\n ) {}\n\n static fromParsedEvent(event: ParsedEvent) {\n const target: string | null =\n event.type === ParsedEventType.Regular ? event.targetOrPhase : null;\n const phase: string | null =\n event.type === ParsedEventType.Animation ? event.targetOrPhase : null;\n if (event.keySpan === undefined) {\n throw new Error(\n `Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`,\n );\n }\n return new BoundEvent(\n event.name,\n event.type,\n event.handler,\n target,\n phase,\n event.sourceSpan,\n event.handlerSpan,\n event.keySpan,\n );\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitBoundEvent(this);\n }\n}\n\nexport class Element implements Node {\n constructor(\n public name: string,\n public attributes: TextAttribute[],\n public inputs: BoundAttribute[],\n public outputs: BoundEvent[],\n public children: Node[],\n public references: Reference[],\n public sourceSpan: ParseSourceSpan,\n public startSourceSpan: ParseSourceSpan,\n public endSourceSpan: ParseSourceSpan | null,\n public i18n?: I18nMeta,\n ) {}\n visit(visitor: Visitor): Result {\n return visitor.visitElement(this);\n }\n}\n\nexport abstract class DeferredTrigger implements Node {\n constructor(\n public nameSpan: ParseSourceSpan | null,\n public sourceSpan: ParseSourceSpan,\n public prefetchSpan: ParseSourceSpan | null,\n public whenOrOnSourceSpan: ParseSourceSpan | null,\n public hydrateSpan: ParseSourceSpan | null,\n ) {}\n\n visit(visitor: Visitor): Result {\n return visitor.visitDeferredTrigger(this);\n }\n}\n\nexport class BoundDeferredTrigger extends DeferredTrigger {\n constructor(\n public value: AST,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n whenSourceSpan: ParseSourceSpan,\n hydrateSpan: ParseSourceSpan | null,\n ) {\n // BoundDeferredTrigger is for 'when' triggers. These aren't really \"triggers\" and don't have a\n // nameSpan. Trigger names are the built in event triggers like hover, interaction, etc.\n super(/** nameSpan */ null, sourceSpan, prefetchSpan, whenSourceSpan, hydrateSpan);\n }\n}\n\nexport class NeverDeferredTrigger extends DeferredTrigger {}\n\nexport class IdleDeferredTrigger extends DeferredTrigger {}\n\nexport class ImmediateDeferredTrigger extends DeferredTrigger {}\n\nexport class HoverDeferredTrigger extends DeferredTrigger {\n constructor(\n public reference: string | null,\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n onSourceSpan: ParseSourceSpan | null,\n hydrateSpan: ParseSourceSpan | null,\n ) {\n super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);\n }\n}\n\nexport class TimerDeferredTrigger extends DeferredTrigger {\n constructor(\n public delay: number,\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n onSourceSpan: ParseSourceSpan | null,\n hydrateSpan: ParseSourceSpan | null,\n ) {\n super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);\n }\n}\n\nexport class InteractionDeferredTrigger extends DeferredTrigger {\n constructor(\n public reference: string | null,\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n onSourceSpan: ParseSourceSpan | null,\n hydrateSpan: ParseSourceSpan | null,\n ) {\n super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);\n }\n}\n\nexport class ViewportDeferredTrigger extends DeferredTrigger {\n constructor(\n public reference: string | null,\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n onSourceSpan: ParseSourceSpan | null,\n hydrateSpan: ParseSourceSpan | null,\n ) {\n super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);\n }\n}\n\nexport class BlockNode {\n constructor(\n public nameSpan: ParseSourceSpan,\n public sourceSpan: ParseSourceSpan,\n public startSourceSpan: ParseSourceSpan,\n public endSourceSpan: ParseSourceSpan | null,\n ) {}\n}\n\nexport class DeferredBlockPlaceholder extends BlockNode implements Node {\n constructor(\n public children: Node[],\n public minimumTime: number | null,\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n startSourceSpan: ParseSourceSpan,\n endSourceSpan: ParseSourceSpan | null,\n public i18n?: I18nMeta,\n ) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitDeferredBlockPlaceholder(this);\n }\n}\n\nexport class DeferredBlockLoading extends BlockNode implements Node {\n constructor(\n public children: Node[],\n public afterTime: number | null,\n public minimumTime: number | null,\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n startSourceSpan: ParseSourceSpan,\n endSourceSpan: ParseSourceSpan | null,\n public i18n?: I18nMeta,\n ) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitDeferredBlockLoading(this);\n }\n}\n\nexport class DeferredBlockError extends BlockNode implements Node {\n constructor(\n public children: Node[],\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n startSourceSpan: ParseSourceSpan,\n endSourceSpan: ParseSourceSpan | null,\n public i18n?: I18nMeta,\n ) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitDeferredBlockError(this);\n }\n}\n\nexport interface DeferredBlockTriggers {\n when?: BoundDeferredTrigger;\n idle?: IdleDeferredTrigger;\n immediate?: ImmediateDeferredTrigger;\n hover?: HoverDeferredTrigger;\n timer?: TimerDeferredTrigger;\n interaction?: InteractionDeferredTrigger;\n viewport?: ViewportDeferredTrigger;\n never?: NeverDeferredTrigger;\n}\n\nexport class DeferredBlock extends BlockNode implements Node {\n readonly triggers: Readonly;\n readonly prefetchTriggers: Readonly;\n readonly hydrateTriggers: Readonly;\n private readonly definedTriggers: (keyof DeferredBlockTriggers)[];\n private readonly definedPrefetchTriggers: (keyof DeferredBlockTriggers)[];\n private readonly definedHydrateTriggers: (keyof DeferredBlockTriggers)[];\n\n constructor(\n public children: Node[],\n triggers: DeferredBlockTriggers,\n prefetchTriggers: DeferredBlockTriggers,\n hydrateTriggers: DeferredBlockTriggers,\n public placeholder: DeferredBlockPlaceholder | null,\n public loading: DeferredBlockLoading | null,\n public error: DeferredBlockError | null,\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n public mainBlockSpan: ParseSourceSpan,\n startSourceSpan: ParseSourceSpan,\n endSourceSpan: ParseSourceSpan | null,\n public i18n?: I18nMeta,\n ) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n this.triggers = triggers;\n this.prefetchTriggers = prefetchTriggers;\n this.hydrateTriggers = hydrateTriggers;\n // We cache the keys since we know that they won't change and we\n // don't want to enumarate them every time we're traversing the AST.\n this.definedTriggers = Object.keys(triggers) as (keyof DeferredBlockTriggers)[];\n this.definedPrefetchTriggers = Object.keys(prefetchTriggers) as (keyof DeferredBlockTriggers)[];\n this.definedHydrateTriggers = Object.keys(hydrateTriggers) as (keyof DeferredBlockTriggers)[];\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitDeferredBlock(this);\n }\n\n visitAll(visitor: Visitor): void {\n // Visit the hydrate triggers first to match their insertion order.\n this.visitTriggers(this.definedHydrateTriggers, this.hydrateTriggers, visitor);\n this.visitTriggers(this.definedTriggers, this.triggers, visitor);\n this.visitTriggers(this.definedPrefetchTriggers, this.prefetchTriggers, visitor);\n visitAll(visitor, this.children);\n const remainingBlocks = [this.placeholder, this.loading, this.error].filter(\n (x) => x !== null,\n ) as Array;\n visitAll(visitor, remainingBlocks);\n }\n\n private visitTriggers(\n keys: (keyof DeferredBlockTriggers)[],\n triggers: DeferredBlockTriggers,\n visitor: Visitor,\n ) {\n visitAll(\n visitor,\n keys.map((k) => triggers[k]!),\n );\n }\n}\n\nexport class SwitchBlock extends BlockNode implements Node {\n constructor(\n public expression: AST,\n public cases: SwitchBlockCase[],\n /**\n * These blocks are only captured to allow for autocompletion in the language service. They\n * aren't meant to be processed in any other way.\n */\n public unknownBlocks: UnknownBlock[],\n sourceSpan: ParseSourceSpan,\n startSourceSpan: ParseSourceSpan,\n endSourceSpan: ParseSourceSpan | null,\n nameSpan: ParseSourceSpan,\n ) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitSwitchBlock(this);\n }\n}\n\nexport class SwitchBlockCase extends BlockNode implements Node {\n constructor(\n public expression: AST | null,\n public children: Node[],\n sourceSpan: ParseSourceSpan,\n startSourceSpan: ParseSourceSpan,\n endSourceSpan: ParseSourceSpan | null,\n nameSpan: ParseSourceSpan,\n public i18n?: I18nMeta,\n ) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitSwitchBlockCase(this);\n }\n}\n\nexport class ForLoopBlock extends BlockNode implements Node {\n constructor(\n public item: Variable,\n public expression: ASTWithSource,\n public trackBy: ASTWithSource,\n public trackKeywordSpan: ParseSourceSpan,\n public contextVariables: Variable[],\n public children: Node[],\n public empty: ForLoopBlockEmpty | null,\n sourceSpan: ParseSourceSpan,\n public mainBlockSpan: ParseSourceSpan,\n startSourceSpan: ParseSourceSpan,\n endSourceSpan: ParseSourceSpan | null,\n nameSpan: ParseSourceSpan,\n public i18n?: I18nMeta,\n ) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitForLoopBlock(this);\n }\n}\n\nexport class ForLoopBlockEmpty extends BlockNode implements Node {\n constructor(\n public children: Node[],\n sourceSpan: ParseSourceSpan,\n startSourceSpan: ParseSourceSpan,\n endSourceSpan: ParseSourceSpan | null,\n nameSpan: ParseSourceSpan,\n public i18n?: I18nMeta,\n ) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitForLoopBlockEmpty(this);\n }\n}\n\nexport class IfBlock extends BlockNode implements Node {\n constructor(\n public branches: IfBlockBranch[],\n sourceSpan: ParseSourceSpan,\n startSourceSpan: ParseSourceSpan,\n endSourceSpan: ParseSourceSpan | null,\n nameSpan: ParseSourceSpan,\n ) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitIfBlock(this);\n }\n}\n\nexport class IfBlockBranch extends BlockNode implements Node {\n constructor(\n public expression: AST | null,\n public children: Node[],\n public expressionAlias: Variable | null,\n sourceSpan: ParseSourceSpan,\n startSourceSpan: ParseSourceSpan,\n endSourceSpan: ParseSourceSpan | null,\n nameSpan: ParseSourceSpan,\n public i18n?: I18nMeta,\n ) {\n super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);\n }\n\n visit(visitor: Visitor): Result {\n return visitor.visitIfBlockBranch(this);\n }\n}\n\nexport class UnknownBlock implements Node {\n constructor(\n public name: string,\n public sourceSpan: ParseSourceSpan,\n public nameSpan: ParseSourceSpan,\n ) {}\n\n visit(visitor: Visitor): Result {\n return visitor.visitUnknownBlock(this);\n }\n}\n\nexport class LetDeclaration implements Node {\n constructor(\n public name: string,\n public value: AST,\n public sourceSpan: ParseSourceSpan,\n public nameSpan: ParseSourceSpan,\n public valueSpan: ParseSourceSpan,\n ) {}\n\n visit(visitor: Visitor): Result {\n return visitor.visitLetDeclaration(this);\n }\n}\n\nexport class Template implements Node {\n constructor(\n // tagName is the name of the container element, if applicable.\n // `null` is a special case for when there is a structural directive on an `ng-template` so\n // the renderer can differentiate between the synthetic template and the one written in the\n // file.\n public tagName: string | null,\n public attributes: TextAttribute[],\n public inputs: BoundAttribute[],\n public outputs: BoundEvent[],\n public templateAttrs: (BoundAttribute | TextAttribute)[],\n public children: Node[],\n public references: Reference[],\n public variables: Variable[],\n public sourceSpan: ParseSourceSpan,\n public startSourceSpan: ParseSourceSpan,\n public endSourceSpan: ParseSourceSpan | null,\n public i18n?: I18nMeta,\n ) {}\n visit(visitor: Visitor): Result {\n return visitor.visitTemplate(this);\n }\n}\n\nexport class Content implements Node {\n readonly name = 'ng-content';\n\n constructor(\n public selector: string,\n public attributes: TextAttribute[],\n public children: Node[],\n public sourceSpan: ParseSourceSpan,\n public i18n?: I18nMeta,\n ) {}\n visit(visitor: Visitor): Result {\n return visitor.visitContent(this);\n }\n}\n\nexport class Variable implements Node {\n constructor(\n public name: string,\n public value: string,\n public sourceSpan: ParseSourceSpan,\n readonly keySpan: ParseSourceSpan,\n public valueSpan?: ParseSourceSpan,\n ) {}\n visit(visitor: Visitor): Result {\n return visitor.visitVariable(this);\n }\n}\n\nexport class Reference implements Node {\n constructor(\n public name: string,\n public value: string,\n public sourceSpan: ParseSourceSpan,\n readonly keySpan: ParseSourceSpan,\n public valueSpan?: ParseSourceSpan,\n ) {}\n visit(visitor: Visitor): Result {\n return visitor.visitReference(this);\n }\n}\n\nexport class Icu implements Node {\n constructor(\n public vars: {[name: string]: BoundText},\n public placeholders: {[name: string]: Text | BoundText},\n public sourceSpan: ParseSourceSpan,\n public i18n?: I18nMeta,\n ) {}\n visit(visitor: Visitor): Result {\n return visitor.visitIcu(this);\n }\n}\n\nexport interface Visitor {\n // Returning a truthy value from `visit()` will prevent `visitAll()` from the call to the typed\n // method and result returned will become the result included in `visitAll()`s result array.\n visit?(node: Node): Result;\n\n visitElement(element: Element): Result;\n visitTemplate(template: Template): Result;\n visitContent(content: Content): Result;\n visitVariable(variable: Variable): Result;\n visitReference(reference: Reference): Result;\n visitTextAttribute(attribute: TextAttribute): Result;\n visitBoundAttribute(attribute: BoundAttribute): Result;\n visitBoundEvent(attribute: BoundEvent): Result;\n visitText(text: Text): Result;\n visitBoundText(text: BoundText): Result;\n visitIcu(icu: Icu): Result;\n visitDeferredBlock(deferred: DeferredBlock): Result;\n visitDeferredBlockPlaceholder(block: DeferredBlockPlaceholder): Result;\n visitDeferredBlockError(block: DeferredBlockError): Result;\n visitDeferredBlockLoading(block: DeferredBlockLoading): Result;\n visitDeferredTrigger(trigger: DeferredTrigger): Result;\n visitSwitchBlock(block: SwitchBlock): Result;\n visitSwitchBlockCase(block: SwitchBlockCase): Result;\n visitForLoopBlock(block: ForLoopBlock): Result;\n visitForLoopBlockEmpty(block: ForLoopBlockEmpty): Result;\n visitIfBlock(block: IfBlock): Result;\n visitIfBlockBranch(block: IfBlockBranch): Result;\n visitUnknownBlock(block: UnknownBlock): Result;\n visitLetDeclaration(decl: LetDeclaration): Result;\n}\n\nexport class RecursiveVisitor implements Visitor {\n visitElement(element: Element): void {\n visitAll(this, element.attributes);\n visitAll(this, element.inputs);\n visitAll(this, element.outputs);\n visitAll(this, element.children);\n visitAll(this, element.references);\n }\n visitTemplate(template: Template): void {\n visitAll(this, template.attributes);\n visitAll(this, template.inputs);\n visitAll(this, template.outputs);\n visitAll(this, template.children);\n visitAll(this, template.references);\n visitAll(this, template.variables);\n }\n visitDeferredBlock(deferred: DeferredBlock): void {\n deferred.visitAll(this);\n }\n visitDeferredBlockPlaceholder(block: DeferredBlockPlaceholder): void {\n visitAll(this, block.children);\n }\n visitDeferredBlockError(block: DeferredBlockError): void {\n visitAll(this, block.children);\n }\n visitDeferredBlockLoading(block: DeferredBlockLoading): void {\n visitAll(this, block.children);\n }\n visitSwitchBlock(block: SwitchBlock): void {\n visitAll(this, block.cases);\n }\n visitSwitchBlockCase(block: SwitchBlockCase): void {\n visitAll(this, block.children);\n }\n visitForLoopBlock(block: ForLoopBlock): void {\n const blockItems = [block.item, ...block.contextVariables, ...block.children];\n block.empty && blockItems.push(block.empty);\n visitAll(this, blockItems);\n }\n visitForLoopBlockEmpty(block: ForLoopBlockEmpty): void {\n visitAll(this, block.children);\n }\n visitIfBlock(block: IfBlock): void {\n visitAll(this, block.branches);\n }\n visitIfBlockBranch(block: IfBlockBranch): void {\n const blockItems = block.children;\n block.expressionAlias && blockItems.push(block.expressionAlias);\n visitAll(this, blockItems);\n }\n visitContent(content: Content): void {\n visitAll(this, content.children);\n }\n visitVariable(variable: Variable): void {}\n visitReference(reference: Reference): void {}\n visitTextAttribute(attribute: TextAttribute): void {}\n visitBoundAttribute(attribute: BoundAttribute): void {}\n visitBoundEvent(attribute: BoundEvent): void {}\n visitText(text: Text): void {}\n visitBoundText(text: BoundText): void {}\n visitIcu(icu: Icu): void {}\n visitDeferredTrigger(trigger: DeferredTrigger): void {}\n visitUnknownBlock(block: UnknownBlock): void {}\n visitLetDeclaration(decl: LetDeclaration): void {}\n}\n\nexport function visitAll(visitor: Visitor, nodes: Node[]): Result[] {\n const result: Result[] = [];\n if (visitor.visit) {\n for (const node of nodes) {\n visitor.visit(node) || node.visit(visitor);\n }\n } else {\n for (const node of nodes) {\n const newNode = node.visit(visitor);\n if (newNode) {\n result.push(newNode);\n }\n }\n }\n return result;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ParseSourceSpan} from '../parse_util';\n\n/**\n * Describes the text contents of a placeholder as it appears in an ICU expression, including its\n * source span information.\n */\nexport interface MessagePlaceholder {\n /** The text contents of the placeholder */\n text: string;\n\n /** The source span of the placeholder */\n sourceSpan: ParseSourceSpan;\n}\n\nexport class Message {\n sources: MessageSpan[];\n id: string;\n /** The ids to use if there are no custom id and if `i18nLegacyMessageIdFormat` is not empty */\n legacyIds: string[] = [];\n\n messageString: string;\n\n /**\n * @param nodes message AST\n * @param placeholders maps placeholder names to static content and their source spans\n * @param placeholderToMessage maps placeholder names to messages (used for nested ICU messages)\n * @param meaning\n * @param description\n * @param customId\n */\n constructor(\n public nodes: Node[],\n public placeholders: {[phName: string]: MessagePlaceholder},\n public placeholderToMessage: {[phName: string]: Message},\n public meaning: string,\n public description: string,\n public customId: string,\n ) {\n this.id = this.customId;\n this.messageString = serializeMessage(this.nodes);\n\n if (nodes.length) {\n this.sources = [\n {\n filePath: nodes[0].sourceSpan.start.file.url,\n startLine: nodes[0].sourceSpan.start.line + 1,\n startCol: nodes[0].sourceSpan.start.col + 1,\n endLine: nodes[nodes.length - 1].sourceSpan.end.line + 1,\n endCol: nodes[0].sourceSpan.start.col + 1,\n },\n ];\n } else {\n this.sources = [];\n }\n }\n}\n\n// line and columns indexes are 1 based\nexport interface MessageSpan {\n filePath: string;\n startLine: number;\n startCol: number;\n endLine: number;\n endCol: number;\n}\n\nexport interface Node {\n sourceSpan: ParseSourceSpan;\n visit(visitor: Visitor, context?: any): any;\n}\n\nexport class Text implements Node {\n constructor(\n public value: string,\n public sourceSpan: ParseSourceSpan,\n ) {}\n\n visit(visitor: Visitor, context?: any): any {\n return visitor.visitText(this, context);\n }\n}\n\n// TODO(vicb): do we really need this node (vs an array) ?\nexport class Container implements Node {\n constructor(\n public children: Node[],\n public sourceSpan: ParseSourceSpan,\n ) {}\n\n visit(visitor: Visitor, context?: any): any {\n return visitor.visitContainer(this, context);\n }\n}\n\nexport class Icu implements Node {\n constructor(\n public expression: string,\n public type: string,\n public cases: {[k: string]: Node},\n public sourceSpan: ParseSourceSpan,\n public expressionPlaceholder?: string,\n ) {}\n\n visit(visitor: Visitor, context?: any): any {\n return visitor.visitIcu(this, context);\n }\n}\n\nexport class TagPlaceholder implements Node {\n constructor(\n public tag: string,\n public attrs: {[k: string]: string},\n public startName: string,\n public closeName: string,\n public children: Node[],\n public isVoid: boolean,\n // TODO sourceSpan should cover all (we need a startSourceSpan and endSourceSpan)\n public sourceSpan: ParseSourceSpan,\n public startSourceSpan: ParseSourceSpan | null,\n public endSourceSpan: ParseSourceSpan | null,\n ) {}\n\n visit(visitor: Visitor, context?: any): any {\n return visitor.visitTagPlaceholder(this, context);\n }\n}\n\nexport class Placeholder implements Node {\n constructor(\n public value: string,\n public name: string,\n public sourceSpan: ParseSourceSpan,\n ) {}\n\n visit(visitor: Visitor, context?: any): any {\n return visitor.visitPlaceholder(this, context);\n }\n}\n\nexport class IcuPlaceholder implements Node {\n /** Used to capture a message computed from a previous processing pass (see `setI18nRefs()`). */\n previousMessage?: Message;\n constructor(\n public value: Icu,\n public name: string,\n public sourceSpan: ParseSourceSpan,\n ) {}\n\n visit(visitor: Visitor, context?: any): any {\n return visitor.visitIcuPlaceholder(this, context);\n }\n}\n\nexport class BlockPlaceholder implements Node {\n constructor(\n public name: string,\n public parameters: string[],\n public startName: string,\n public closeName: string,\n public children: Node[],\n public sourceSpan: ParseSourceSpan,\n public startSourceSpan: ParseSourceSpan | null,\n public endSourceSpan: ParseSourceSpan | null,\n ) {}\n\n visit(visitor: Visitor, context?: any): any {\n return visitor.visitBlockPlaceholder(this, context);\n }\n}\n\n/**\n * Each HTML node that is affect by an i18n tag will also have an `i18n` property that is of type\n * `I18nMeta`.\n * This information is either a `Message`, which indicates it is the root of an i18n message, or a\n * `Node`, which indicates is it part of a containing `Message`.\n */\nexport type I18nMeta = Message | Node;\n\nexport interface Visitor {\n visitText(text: Text, context?: any): any;\n visitContainer(container: Container, context?: any): any;\n visitIcu(icu: Icu, context?: any): any;\n visitTagPlaceholder(ph: TagPlaceholder, context?: any): any;\n visitPlaceholder(ph: Placeholder, context?: any): any;\n visitIcuPlaceholder(ph: IcuPlaceholder, context?: any): any;\n visitBlockPlaceholder(ph: BlockPlaceholder, context?: any): any;\n}\n\n// Clone the AST\nexport class CloneVisitor implements Visitor {\n visitText(text: Text, context?: any): Text {\n return new Text(text.value, text.sourceSpan);\n }\n\n visitContainer(container: Container, context?: any): Container {\n const children = container.children.map((n) => n.visit(this, context));\n return new Container(children, container.sourceSpan);\n }\n\n visitIcu(icu: Icu, context?: any): Icu {\n const cases: {[k: string]: Node} = {};\n Object.keys(icu.cases).forEach((key) => (cases[key] = icu.cases[key].visit(this, context)));\n const msg = new Icu(icu.expression, icu.type, cases, icu.sourceSpan, icu.expressionPlaceholder);\n return msg;\n }\n\n visitTagPlaceholder(ph: TagPlaceholder, context?: any): TagPlaceholder {\n const children = ph.children.map((n) => n.visit(this, context));\n return new TagPlaceholder(\n ph.tag,\n ph.attrs,\n ph.startName,\n ph.closeName,\n children,\n ph.isVoid,\n ph.sourceSpan,\n ph.startSourceSpan,\n ph.endSourceSpan,\n );\n }\n\n visitPlaceholder(ph: Placeholder, context?: any): Placeholder {\n return new Placeholder(ph.value, ph.name, ph.sourceSpan);\n }\n\n visitIcuPlaceholder(ph: IcuPlaceholder, context?: any): IcuPlaceholder {\n return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);\n }\n\n visitBlockPlaceholder(ph: BlockPlaceholder, context?: any): BlockPlaceholder {\n const children = ph.children.map((n) => n.visit(this, context));\n return new BlockPlaceholder(\n ph.name,\n ph.parameters,\n ph.startName,\n ph.closeName,\n children,\n ph.sourceSpan,\n ph.startSourceSpan,\n ph.endSourceSpan,\n );\n }\n}\n\n// Visit all the nodes recursively\nexport class RecurseVisitor implements Visitor {\n visitText(text: Text, context?: any): any {}\n\n visitContainer(container: Container, context?: any): any {\n container.children.forEach((child) => child.visit(this));\n }\n\n visitIcu(icu: Icu, context?: any): any {\n Object.keys(icu.cases).forEach((k) => {\n icu.cases[k].visit(this);\n });\n }\n\n visitTagPlaceholder(ph: TagPlaceholder, context?: any): any {\n ph.children.forEach((child) => child.visit(this));\n }\n\n visitPlaceholder(ph: Placeholder, context?: any): any {}\n\n visitIcuPlaceholder(ph: IcuPlaceholder, context?: any): any {}\n\n visitBlockPlaceholder(ph: BlockPlaceholder, context?: any): any {\n ph.children.forEach((child) => child.visit(this));\n }\n}\n\n/**\n * Serialize the message to the Localize backtick string format that would appear in compiled code.\n */\nfunction serializeMessage(messageNodes: Node[]): string {\n const visitor = new LocalizeMessageStringVisitor();\n const str = messageNodes.map((n) => n.visit(visitor)).join('');\n return str;\n}\n\nclass LocalizeMessageStringVisitor implements Visitor {\n visitText(text: Text): any {\n return text.value;\n }\n\n visitContainer(container: Container): any {\n return container.children.map((child) => child.visit(this)).join('');\n }\n\n visitIcu(icu: Icu): any {\n const strCases = Object.keys(icu.cases).map(\n (k: string) => `${k} {${icu.cases[k].visit(this)}}`,\n );\n return `{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(' ')}}`;\n }\n\n visitTagPlaceholder(ph: TagPlaceholder): any {\n const children = ph.children.map((child) => child.visit(this)).join('');\n return `{$${ph.startName}}${children}{$${ph.closeName}}`;\n }\n\n visitPlaceholder(ph: Placeholder): any {\n return `{$${ph.name}}`;\n }\n\n visitIcuPlaceholder(ph: IcuPlaceholder): any {\n return `{$${ph.name}}`;\n }\n\n visitBlockPlaceholder(ph: BlockPlaceholder): any {\n const children = ph.children.map((child) => child.visit(this)).join('');\n return `{$${ph.startName}}${children}{$${ph.closeName}}`;\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as i18n from '../i18n_ast';\n\nexport abstract class Serializer {\n // - The `placeholders` and `placeholderToMessage` properties are irrelevant in the input messages\n // - The `id` contains the message id that the serializer is expected to use\n // - Placeholder names are already map to public names using the provided mapper\n abstract write(messages: i18n.Message[], locale: string | null): string;\n\n abstract load(\n content: string,\n url: string,\n ): {locale: string | null; i18nNodesByMsgId: {[msgId: string]: i18n.Node[]}};\n\n abstract digest(message: i18n.Message): string;\n\n // Creates a name mapper, see `PlaceholderMapper`\n // Returning `null` means that no name mapping is used.\n createNameMapper(message: i18n.Message): PlaceholderMapper | null {\n return null;\n }\n}\n\n/**\n * A `PlaceholderMapper` converts placeholder names from internal to serialized representation and\n * back.\n *\n * It should be used for serialization format that put constraints on the placeholder names.\n */\nexport interface PlaceholderMapper {\n toPublicName(internalName: string): string | null;\n\n toInternalName(publicName: string): string | null;\n}\n\n/**\n * A simple mapper that take a function to transform an internal name to a public name\n */\nexport class SimplePlaceholderMapper extends i18n.RecurseVisitor implements PlaceholderMapper {\n private internalToPublic: {[k: string]: string} = {};\n private publicToNextId: {[k: string]: number} = {};\n private publicToInternal: {[k: string]: string} = {};\n\n // create a mapping from the message\n constructor(\n message: i18n.Message,\n private mapName: (name: string) => string,\n ) {\n super();\n message.nodes.forEach((node) => node.visit(this));\n }\n\n toPublicName(internalName: string): string | null {\n return this.internalToPublic.hasOwnProperty(internalName)\n ? this.internalToPublic[internalName]\n : null;\n }\n\n toInternalName(publicName: string): string | null {\n return this.publicToInternal.hasOwnProperty(publicName)\n ? this.publicToInternal[publicName]\n : null;\n }\n\n override visitText(text: i18n.Text, context?: any): any {\n return null;\n }\n\n override visitTagPlaceholder(ph: i18n.TagPlaceholder, context?: any): any {\n this.visitPlaceholderName(ph.startName);\n super.visitTagPlaceholder(ph, context);\n this.visitPlaceholderName(ph.closeName);\n }\n\n override visitPlaceholder(ph: i18n.Placeholder, context?: any): any {\n this.visitPlaceholderName(ph.name);\n }\n\n override visitBlockPlaceholder(ph: i18n.BlockPlaceholder, context?: any): any {\n this.visitPlaceholderName(ph.startName);\n super.visitBlockPlaceholder(ph, context);\n this.visitPlaceholderName(ph.closeName);\n }\n\n override visitIcuPlaceholder(ph: i18n.IcuPlaceholder, context?: any): any {\n this.visitPlaceholderName(ph.name);\n }\n\n // XMB placeholders could only contains A-Z, 0-9 and _\n private visitPlaceholderName(internalName: string): void {\n if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) {\n return;\n }\n\n let publicName = this.mapName(internalName);\n\n if (this.publicToInternal.hasOwnProperty(publicName)) {\n // Create a new XMB when it has already been used\n const nextId = this.publicToNextId[publicName];\n this.publicToNextId[publicName] = nextId + 1;\n publicName = `${publicName}_${nextId}`;\n } else {\n this.publicToNextId[publicName] = 1;\n }\n\n this.internalToPublic[internalName] = publicName;\n this.publicToInternal[publicName] = internalName;\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport interface IVisitor {\n visitTag(tag: Tag): any;\n visitText(text: Text): any;\n visitDeclaration(decl: Declaration): any;\n visitDoctype(doctype: Doctype): any;\n}\n\nclass _Visitor implements IVisitor {\n visitTag(tag: Tag): string {\n const strAttrs = this._serializeAttributes(tag.attrs);\n\n if (tag.children.length == 0) {\n return `<${tag.name}${strAttrs}/>`;\n }\n\n const strChildren = tag.children.map((node) => node.visit(this));\n return `<${tag.name}${strAttrs}>${strChildren.join('')}`;\n }\n\n visitText(text: Text): string {\n return text.value;\n }\n\n visitDeclaration(decl: Declaration): string {\n return ``;\n }\n\n private _serializeAttributes(attrs: {[k: string]: string}) {\n const strAttrs = Object.keys(attrs)\n .map((name: string) => `${name}=\"${attrs[name]}\"`)\n .join(' ');\n return strAttrs.length > 0 ? ' ' + strAttrs : '';\n }\n\n visitDoctype(doctype: Doctype): any {\n return ``;\n }\n}\n\nconst _visitor = new _Visitor();\n\nexport function serialize(nodes: Node[]): string {\n return nodes.map((node: Node): string => node.visit(_visitor)).join('');\n}\n\nexport interface Node {\n visit(visitor: IVisitor): any;\n}\n\nexport class Declaration implements Node {\n public attrs: {[k: string]: string} = {};\n\n constructor(unescapedAttrs: {[k: string]: string}) {\n Object.keys(unescapedAttrs).forEach((k: string) => {\n this.attrs[k] = escapeXml(unescapedAttrs[k]);\n });\n }\n\n visit(visitor: IVisitor): any {\n return visitor.visitDeclaration(this);\n }\n}\n\nexport class Doctype implements Node {\n constructor(\n public rootTag: string,\n public dtd: string,\n ) {}\n\n visit(visitor: IVisitor): any {\n return visitor.visitDoctype(this);\n }\n}\n\nexport class Tag implements Node {\n public attrs: {[k: string]: string} = {};\n\n constructor(\n public name: string,\n unescapedAttrs: {[k: string]: string} = {},\n public children: Node[] = [],\n ) {\n Object.keys(unescapedAttrs).forEach((k: string) => {\n this.attrs[k] = escapeXml(unescapedAttrs[k]);\n });\n }\n\n visit(visitor: IVisitor): any {\n return visitor.visitTag(this);\n }\n}\n\nexport class Text implements Node {\n value: string;\n constructor(unescapedValue: string) {\n this.value = escapeXml(unescapedValue);\n }\n\n visit(visitor: IVisitor): any {\n return visitor.visitText(this);\n }\n}\n\nexport class CR extends Text {\n constructor(ws: number = 0) {\n super(`\\n${new Array(ws + 1).join(' ')}`);\n }\n}\n\nconst _ESCAPED_CHARS: [RegExp, string][] = [\n [/&/g, '&'],\n [/\"/g, '"'],\n [/'/g, '''],\n [//g, '>'],\n];\n\n// Escape `_ESCAPED_CHARS` characters in the given text with encoded entities\nexport function escapeXml(text: string): string {\n return _ESCAPED_CHARS.reduce(\n (text: string, entry: [RegExp, string]) => text.replace(entry[0], entry[1]),\n text,\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {decimalDigest} from '../digest';\nimport * as i18n from '../i18n_ast';\n\nimport {PlaceholderMapper, Serializer, SimplePlaceholderMapper} from './serializer';\nimport * as xml from './xml_helper';\n\n/**\n * Defines the `handler` value on the serialized XMB, indicating that Angular\n * generated the bundle. This is useful for analytics in Translation Console.\n *\n * NOTE: Keep in sync with\n * packages/localize/tools/src/extract/translation_files/xmb_translation_serializer.ts.\n */\nconst _XMB_HANDLER = 'angular';\n\nconst _MESSAGES_TAG = 'messagebundle';\nconst _MESSAGE_TAG = 'msg';\nconst _PLACEHOLDER_TAG = 'ph';\nconst _EXAMPLE_TAG = 'ex';\nconst _SOURCE_TAG = 'source';\n\nconst _DOCTYPE = `\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n`;\n\nexport class Xmb extends Serializer {\n override write(messages: i18n.Message[], locale: string | null): string {\n const exampleVisitor = new ExampleVisitor();\n const visitor = new _Visitor();\n const rootNode = new xml.Tag(_MESSAGES_TAG);\n rootNode.attrs['handler'] = _XMB_HANDLER;\n\n messages.forEach((message) => {\n const attrs: {[k: string]: string} = {id: message.id};\n\n if (message.description) {\n attrs['desc'] = message.description;\n }\n\n if (message.meaning) {\n attrs['meaning'] = message.meaning;\n }\n\n let sourceTags: xml.Tag[] = [];\n message.sources.forEach((source: i18n.MessageSpan) => {\n sourceTags.push(\n new xml.Tag(_SOURCE_TAG, {}, [\n new xml.Text(\n `${source.filePath}:${source.startLine}${\n source.endLine !== source.startLine ? ',' + source.endLine : ''\n }`,\n ),\n ]),\n );\n });\n\n rootNode.children.push(\n new xml.CR(2),\n new xml.Tag(_MESSAGE_TAG, attrs, [...sourceTags, ...visitor.serialize(message.nodes)]),\n );\n });\n\n rootNode.children.push(new xml.CR());\n\n return xml.serialize([\n new xml.Declaration({version: '1.0', encoding: 'UTF-8'}),\n new xml.CR(),\n new xml.Doctype(_MESSAGES_TAG, _DOCTYPE),\n new xml.CR(),\n exampleVisitor.addDefaultExamples(rootNode),\n new xml.CR(),\n ]);\n }\n\n override load(\n content: string,\n url: string,\n ): {locale: string; i18nNodesByMsgId: {[msgId: string]: i18n.Node[]}} {\n throw new Error('Unsupported');\n }\n\n override digest(message: i18n.Message): string {\n return digest(message);\n }\n\n override createNameMapper(message: i18n.Message): PlaceholderMapper {\n return new SimplePlaceholderMapper(message, toPublicName);\n }\n}\n\nclass _Visitor implements i18n.Visitor {\n visitText(text: i18n.Text, context?: any): xml.Node[] {\n return [new xml.Text(text.value)];\n }\n\n visitContainer(container: i18n.Container, context: any): xml.Node[] {\n const nodes: xml.Node[] = [];\n container.children.forEach((node: i18n.Node) => nodes.push(...node.visit(this)));\n return nodes;\n }\n\n visitIcu(icu: i18n.Icu, context?: any): xml.Node[] {\n const nodes = [new xml.Text(`{${icu.expressionPlaceholder}, ${icu.type}, `)];\n\n Object.keys(icu.cases).forEach((c: string) => {\n nodes.push(new xml.Text(`${c} {`), ...icu.cases[c].visit(this), new xml.Text(`} `));\n });\n\n nodes.push(new xml.Text(`}`));\n\n return nodes;\n }\n\n visitTagPlaceholder(ph: i18n.TagPlaceholder, context?: any): xml.Node[] {\n const startTagAsText = new xml.Text(`<${ph.tag}>`);\n const startEx = new xml.Tag(_EXAMPLE_TAG, {}, [startTagAsText]);\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n const startTagPh = new xml.Tag(_PLACEHOLDER_TAG, {name: ph.startName}, [\n startEx,\n startTagAsText,\n ]);\n if (ph.isVoid) {\n // void tags have no children nor closing tags\n return [startTagPh];\n }\n\n const closeTagAsText = new xml.Text(``);\n const closeEx = new xml.Tag(_EXAMPLE_TAG, {}, [closeTagAsText]);\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n const closeTagPh = new xml.Tag(_PLACEHOLDER_TAG, {name: ph.closeName}, [\n closeEx,\n closeTagAsText,\n ]);\n\n return [startTagPh, ...this.serialize(ph.children), closeTagPh];\n }\n\n visitPlaceholder(ph: i18n.Placeholder, context?: any): xml.Node[] {\n const interpolationAsText = new xml.Text(`{{${ph.value}}}`);\n // Example tag needs to be not-empty for TC.\n const exTag = new xml.Tag(_EXAMPLE_TAG, {}, [interpolationAsText]);\n return [\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n new xml.Tag(_PLACEHOLDER_TAG, {name: ph.name}, [exTag, interpolationAsText]),\n ];\n }\n\n visitBlockPlaceholder(ph: i18n.BlockPlaceholder, context?: any): xml.Node[] {\n const startAsText = new xml.Text(`@${ph.name}`);\n const startEx = new xml.Tag(_EXAMPLE_TAG, {}, [startAsText]);\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n const startTagPh = new xml.Tag(_PLACEHOLDER_TAG, {name: ph.startName}, [startEx, startAsText]);\n\n const closeAsText = new xml.Text(`}`);\n const closeEx = new xml.Tag(_EXAMPLE_TAG, {}, [closeAsText]);\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n const closeTagPh = new xml.Tag(_PLACEHOLDER_TAG, {name: ph.closeName}, [closeEx, closeAsText]);\n\n return [startTagPh, ...this.serialize(ph.children), closeTagPh];\n }\n\n visitIcuPlaceholder(ph: i18n.IcuPlaceholder, context?: any): xml.Node[] {\n const icuExpression = ph.value.expression;\n const icuType = ph.value.type;\n const icuCases = Object.keys(ph.value.cases)\n .map((value: string) => value + ' {...}')\n .join(' ');\n const icuAsText = new xml.Text(`{${icuExpression}, ${icuType}, ${icuCases}}`);\n const exTag = new xml.Tag(_EXAMPLE_TAG, {}, [icuAsText]);\n return [\n // TC requires PH to have a non empty EX, and uses the text node to show the \"original\" value.\n new xml.Tag(_PLACEHOLDER_TAG, {name: ph.name}, [exTag, icuAsText]),\n ];\n }\n\n serialize(nodes: i18n.Node[]): xml.Node[] {\n return [].concat(...nodes.map((node) => node.visit(this)));\n }\n}\n\nexport function digest(message: i18n.Message): string {\n return decimalDigest(message);\n}\n\n// TC requires at least one non-empty example on placeholders\nclass ExampleVisitor implements xml.IVisitor {\n addDefaultExamples(node: xml.Node): xml.Node {\n node.visit(this);\n return node;\n }\n\n visitTag(tag: xml.Tag): void {\n if (tag.name === _PLACEHOLDER_TAG) {\n if (!tag.children || tag.children.length == 0) {\n const exText = new xml.Text(tag.attrs['name'] || '...');\n tag.children = [new xml.Tag(_EXAMPLE_TAG, {}, [exText])];\n }\n } else if (tag.children) {\n tag.children.forEach((node) => node.visit(this));\n }\n }\n\n visitText(text: xml.Text): void {}\n visitDeclaration(decl: xml.Declaration): void {}\n visitDoctype(doctype: xml.Doctype): void {}\n}\n\n// XMB/XTB placeholders can only contain A-Z, 0-9 and _\nexport function toPublicName(internalName: string): string {\n return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, '_');\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport * as i18n from '../../../i18n/i18n_ast';\nimport {toPublicName} from '../../../i18n/serializers/xmb';\nimport * as html from '../../../ml_parser/ast';\nimport * as o from '../../../output/output_ast';\n\n/** Name of the i18n attributes **/\nexport const I18N_ATTR = 'i18n';\nexport const I18N_ATTR_PREFIX = 'i18n-';\n\n/** Prefix of var expressions used in ICUs */\nexport const I18N_ICU_VAR_PREFIX = 'VAR_';\n\nexport function isI18nAttribute(name: string): boolean {\n return name === I18N_ATTR || name.startsWith(I18N_ATTR_PREFIX);\n}\n\nexport function hasI18nAttrs(element: html.Element): boolean {\n return element.attrs.some((attr: html.Attribute) => isI18nAttribute(attr.name));\n}\n\nexport function icuFromI18nMessage(message: i18n.Message) {\n return message.nodes[0] as i18n.IcuPlaceholder;\n}\n\nexport function placeholdersToParams(placeholders: Map): {\n [name: string]: o.LiteralExpr;\n} {\n const params: {[name: string]: o.LiteralExpr} = {};\n placeholders.forEach((values: string[], key: string) => {\n params[key] = o.literal(values.length > 1 ? `[${values.join('|')}]` : values[0]);\n });\n return params;\n}\n\n/**\n * Format the placeholder names in a map of placeholders to expressions.\n *\n * The placeholder names are converted from \"internal\" format (e.g. `START_TAG_DIV_1`) to \"external\"\n * format (e.g. `startTagDiv_1`).\n *\n * @param params A map of placeholder names to expressions.\n * @param useCamelCase whether to camelCase the placeholder name when formatting.\n * @returns A new map of formatted placeholder names to expressions.\n */\nexport function formatI18nPlaceholderNamesInMap(\n params: {[name: string]: o.Expression} = {},\n useCamelCase: boolean,\n) {\n const _params: {[key: string]: o.Expression} = {};\n if (params && Object.keys(params).length) {\n Object.keys(params).forEach(\n (key) => (_params[formatI18nPlaceholderName(key, useCamelCase)] = params[key]),\n );\n }\n return _params;\n}\n\n/**\n * Converts internal placeholder names to public-facing format\n * (for example to use in goog.getMsg call).\n * Example: `START_TAG_DIV_1` is converted to `startTagDiv_1`.\n *\n * @param name The placeholder name that should be formatted\n * @returns Formatted placeholder name\n */\nexport function formatI18nPlaceholderName(name: string, useCamelCase: boolean = true): string {\n const publicName = toPublicName(name);\n if (!useCamelCase) {\n return publicName;\n }\n const chunks = publicName.split('_');\n if (chunks.length === 1) {\n // if no \"_\" found - just lowercase the value\n return name.toLowerCase();\n }\n let postfix;\n // eject last element if it's a number\n if (/^\\d+$/.test(chunks[chunks.length - 1])) {\n postfix = chunks.pop();\n }\n let raw = chunks.shift()!.toLowerCase();\n if (chunks.length) {\n raw += chunks.map((c) => c.charAt(0).toUpperCase() + c.slice(1).toLowerCase()).join('');\n }\n return postfix ? `${raw}_${postfix}` : raw;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {InputFlags} from '../../core';\nimport {BindingType} from '../../expression_parser/ast';\nimport {splitNsName} from '../../ml_parser/tags';\nimport * as o from '../../output/output_ast';\nimport {CssSelector} from '../../selector';\nimport * as t from '../r3_ast';\n\nimport {isI18nAttribute} from './i18n/util';\n\n/**\n * Checks whether an object key contains potentially unsafe chars, thus the key should be wrapped in\n * quotes. Note: we do not wrap all keys into quotes, as it may have impact on minification and may\n * not work in some cases when object keys are mangled by a minifier.\n *\n * TODO(FW-1136): this is a temporary solution, we need to come up with a better way of working with\n * inputs that contain potentially unsafe chars.\n */\nexport const UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;\n\n/** Name of the temporary to use during data binding */\nexport const TEMPORARY_NAME = '_t';\n\n/** Name of the context parameter passed into a template function */\nexport const CONTEXT_NAME = 'ctx';\n\n/** Name of the RenderFlag passed into a template function */\nexport const RENDER_FLAGS = 'rf';\n\n/**\n * Creates an allocator for a temporary variable.\n *\n * A variable declaration is added to the statements the first time the allocator is invoked.\n */\nexport function temporaryAllocator(\n pushStatement: (st: o.Statement) => void,\n name: string,\n): () => o.ReadVarExpr {\n let temp: o.ReadVarExpr | null = null;\n return () => {\n if (!temp) {\n pushStatement(new o.DeclareVarStmt(TEMPORARY_NAME, undefined, o.DYNAMIC_TYPE));\n temp = o.variable(name);\n }\n return temp;\n };\n}\n\nexport function invalid(this: t.Visitor, arg: o.Expression | o.Statement | t.Node): never {\n throw new Error(\n `Invalid state: Visitor ${this.constructor.name} doesn't handle ${arg.constructor.name}`,\n );\n}\n\nexport function asLiteral(value: any): o.Expression {\n if (Array.isArray(value)) {\n return o.literalArr(value.map(asLiteral));\n }\n return o.literal(value, o.INFERRED_TYPE);\n}\n\n/**\n * Serializes inputs and outputs for `defineDirective` and `defineComponent`.\n *\n * This will attempt to generate optimized data structures to minimize memory or\n * file size of fully compiled applications.\n */\nexport function conditionallyCreateDirectiveBindingLiteral(\n map: Record<\n string,\n | string\n | {\n classPropertyName: string;\n bindingPropertyName: string;\n transformFunction: o.Expression | null;\n isSignal: boolean;\n }\n >,\n forInputs?: boolean,\n): o.Expression | null {\n const keys = Object.getOwnPropertyNames(map);\n\n if (keys.length === 0) {\n return null;\n }\n\n return o.literalMap(\n keys.map((key) => {\n const value = map[key];\n let declaredName: string;\n let publicName: string;\n let minifiedName: string;\n let expressionValue: o.Expression;\n\n if (typeof value === 'string') {\n // canonical syntax: `dirProp: publicProp`\n declaredName = key;\n minifiedName = key;\n publicName = value;\n expressionValue = asLiteral(publicName);\n } else {\n minifiedName = key;\n declaredName = value.classPropertyName;\n publicName = value.bindingPropertyName;\n\n const differentDeclaringName = publicName !== declaredName;\n const hasDecoratorInputTransform = value.transformFunction !== null;\n let flags = InputFlags.None;\n\n // Build up input flags\n if (value.isSignal) {\n flags |= InputFlags.SignalBased;\n }\n if (hasDecoratorInputTransform) {\n flags |= InputFlags.HasDecoratorInputTransform;\n }\n\n // Inputs, compared to outputs, will track their declared name (for `ngOnChanges`), support\n // decorator input transform functions, or store flag information if there is any.\n if (\n forInputs &&\n (differentDeclaringName || hasDecoratorInputTransform || flags !== InputFlags.None)\n ) {\n const result = [o.literal(flags), asLiteral(publicName)];\n\n if (differentDeclaringName || hasDecoratorInputTransform) {\n result.push(asLiteral(declaredName));\n\n if (hasDecoratorInputTransform) {\n result.push(value.transformFunction!);\n }\n }\n\n expressionValue = o.literalArr(result);\n } else {\n expressionValue = asLiteral(publicName);\n }\n }\n\n return {\n key: minifiedName,\n // put quotes around keys that contain potentially unsafe characters\n quoted: UNSAFE_OBJECT_KEY_NAME_REGEXP.test(minifiedName),\n value: expressionValue,\n };\n }),\n );\n}\n\n/**\n * A representation for an object literal used during codegen of definition objects. The generic\n * type `T` allows to reference a documented type of the generated structure, such that the\n * property names that are set can be resolved to their documented declaration.\n */\nexport class DefinitionMap {\n values: {key: string; quoted: boolean; value: o.Expression}[] = [];\n\n set(key: keyof T, value: o.Expression | null): void {\n if (value) {\n const existing = this.values.find((value) => value.key === key);\n\n if (existing) {\n existing.value = value;\n } else {\n this.values.push({key: key as string, value, quoted: false});\n }\n }\n }\n\n toLiteralMap(): o.LiteralMapExpr {\n return o.literalMap(this.values);\n }\n}\n\n/**\n * Creates a `CssSelector` from an AST node.\n */\nexport function createCssSelectorFromNode(node: t.Element | t.Template): CssSelector {\n const elementName = node instanceof t.Element ? node.name : 'ng-template';\n const attributes = getAttrsForDirectiveMatching(node);\n const cssSelector = new CssSelector();\n const elementNameNoNs = splitNsName(elementName)[1];\n\n cssSelector.setElement(elementNameNoNs);\n\n Object.getOwnPropertyNames(attributes).forEach((name) => {\n const nameNoNs = splitNsName(name)[1];\n const value = attributes[name];\n\n cssSelector.addAttribute(nameNoNs, value);\n if (name.toLowerCase() === 'class') {\n const classes = value.trim().split(/\\s+/);\n classes.forEach((className) => cssSelector.addClassName(className));\n }\n });\n\n return cssSelector;\n}\n\n/**\n * Extract a map of properties to values for a given element or template node, which can be used\n * by the directive matching machinery.\n *\n * @param elOrTpl the element or template in question\n * @return an object set up for directive matching. For attributes on the element/template, this\n * object maps a property name to its (static) value. For any bindings, this map simply maps the\n * property name to an empty string.\n */\nfunction getAttrsForDirectiveMatching(elOrTpl: t.Element | t.Template): {[name: string]: string} {\n const attributesMap: {[name: string]: string} = {};\n\n if (elOrTpl instanceof t.Template && elOrTpl.tagName !== 'ng-template') {\n elOrTpl.templateAttrs.forEach((a) => (attributesMap[a.name] = ''));\n } else {\n elOrTpl.attributes.forEach((a) => {\n if (!isI18nAttribute(a.name)) {\n attributesMap[a.name] = a.value;\n }\n });\n\n elOrTpl.inputs.forEach((i) => {\n if (i.type === BindingType.Property || i.type === BindingType.TwoWay) {\n attributesMap[i.name] = '';\n }\n });\n elOrTpl.outputs.forEach((o) => {\n attributesMap[o.name] = '';\n });\n }\n\n return attributesMap;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {FactoryTarget} from './compiler_facade_interface';\nimport * as o from './output/output_ast';\nimport {\n compileFactoryFunction,\n R3DependencyMetadata,\n R3FactoryDelegateType,\n R3FactoryMetadata,\n} from './render3/r3_factory';\nimport {Identifiers} from './render3/r3_identifiers';\nimport {\n convertFromMaybeForwardRefExpression,\n MaybeForwardRefExpression,\n R3CompiledExpression,\n R3Reference,\n typeWithParameters,\n} from './render3/util';\nimport {DefinitionMap} from './render3/view/util';\n\nexport interface R3InjectableMetadata {\n name: string;\n type: R3Reference;\n typeArgumentCount: number;\n providedIn: MaybeForwardRefExpression;\n useClass?: MaybeForwardRefExpression;\n useFactory?: o.Expression;\n useExisting?: MaybeForwardRefExpression;\n useValue?: MaybeForwardRefExpression;\n deps?: R3DependencyMetadata[];\n}\n\nexport function compileInjectable(\n meta: R3InjectableMetadata,\n resolveForwardRefs: boolean,\n): R3CompiledExpression {\n let result: {expression: o.Expression; statements: o.Statement[]} | null = null;\n\n const factoryMeta: R3FactoryMetadata = {\n name: meta.name,\n type: meta.type,\n typeArgumentCount: meta.typeArgumentCount,\n deps: [],\n target: FactoryTarget.Injectable,\n };\n\n if (meta.useClass !== undefined) {\n // meta.useClass has two modes of operation. Either deps are specified, in which case `new` is\n // used to instantiate the class with dependencies injected, or deps are not specified and\n // the factory of the class is used to instantiate it.\n //\n // A special case exists for useClass: Type where Type is the injectable type itself and no\n // deps are specified, in which case 'useClass' is effectively ignored.\n\n const useClassOnSelf = meta.useClass.expression.isEquivalent(meta.type.value);\n let deps: R3DependencyMetadata[] | undefined = undefined;\n if (meta.deps !== undefined) {\n deps = meta.deps;\n }\n\n if (deps !== undefined) {\n // factory: () => new meta.useClass(...deps)\n result = compileFactoryFunction({\n ...factoryMeta,\n delegate: meta.useClass.expression,\n delegateDeps: deps,\n delegateType: R3FactoryDelegateType.Class,\n });\n } else if (useClassOnSelf) {\n result = compileFactoryFunction(factoryMeta);\n } else {\n result = {\n statements: [],\n expression: delegateToFactory(\n meta.type.value as o.WrappedNodeExpr,\n meta.useClass.expression as o.WrappedNodeExpr,\n resolveForwardRefs,\n ),\n };\n }\n } else if (meta.useFactory !== undefined) {\n if (meta.deps !== undefined) {\n result = compileFactoryFunction({\n ...factoryMeta,\n delegate: meta.useFactory,\n delegateDeps: meta.deps || [],\n delegateType: R3FactoryDelegateType.Function,\n });\n } else {\n result = {statements: [], expression: o.arrowFn([], meta.useFactory.callFn([]))};\n }\n } else if (meta.useValue !== undefined) {\n // Note: it's safe to use `meta.useValue` instead of the `USE_VALUE in meta` check used for\n // client code because meta.useValue is an Expression which will be defined even if the actual\n // value is undefined.\n result = compileFactoryFunction({\n ...factoryMeta,\n expression: meta.useValue.expression,\n });\n } else if (meta.useExisting !== undefined) {\n // useExisting is an `inject` call on the existing token.\n result = compileFactoryFunction({\n ...factoryMeta,\n expression: o.importExpr(Identifiers.inject).callFn([meta.useExisting.expression]),\n });\n } else {\n result = {\n statements: [],\n expression: delegateToFactory(\n meta.type.value as o.WrappedNodeExpr,\n meta.type.value as o.WrappedNodeExpr,\n resolveForwardRefs,\n ),\n };\n }\n\n const token = meta.type.value;\n\n const injectableProps = new DefinitionMap<{\n token: o.Expression;\n factory: o.Expression;\n providedIn: o.Expression;\n }>();\n injectableProps.set('token', token);\n injectableProps.set('factory', result.expression);\n\n // Only generate providedIn property if it has a non-null value\n if ((meta.providedIn.expression as o.LiteralExpr).value !== null) {\n injectableProps.set('providedIn', convertFromMaybeForwardRefExpression(meta.providedIn));\n }\n\n const expression = o\n .importExpr(Identifiers.ɵɵdefineInjectable)\n .callFn([injectableProps.toLiteralMap()], undefined, true);\n return {\n expression,\n type: createInjectableType(meta),\n statements: result.statements,\n };\n}\n\nexport function createInjectableType(meta: R3InjectableMetadata) {\n return new o.ExpressionType(\n o.importExpr(Identifiers.InjectableDeclaration, [\n typeWithParameters(meta.type.type, meta.typeArgumentCount),\n ]),\n );\n}\n\nfunction delegateToFactory(\n type: o.WrappedNodeExpr,\n useType: o.WrappedNodeExpr,\n unwrapForwardRefs: boolean,\n): o.Expression {\n if (type.node === useType.node) {\n // The types are the same, so we can simply delegate directly to the type's factory.\n // ```\n // factory: type.ɵfac\n // ```\n return useType.prop('ɵfac');\n }\n\n if (!unwrapForwardRefs) {\n // The type is not wrapped in a `forwardRef()`, so we create a simple factory function that\n // accepts a sub-type as an argument.\n // ```\n // factory: function(t) { return useType.ɵfac(t); }\n // ```\n return createFactoryFunction(useType);\n }\n\n // The useType is actually wrapped in a `forwardRef()` so we need to resolve that before\n // calling its factory.\n // ```\n // factory: function(t) { return core.resolveForwardRef(type).ɵfac(t); }\n // ```\n const unwrappedType = o.importExpr(Identifiers.resolveForwardRef).callFn([useType]);\n return createFactoryFunction(unwrappedType);\n}\n\nfunction createFactoryFunction(type: o.Expression): o.ArrowFunctionExpr {\n const t = new o.FnParam('__ngFactoryType__', o.DYNAMIC_TYPE);\n return o.arrowFn([t], type.prop('ɵfac').callFn([o.variable(t.name)]));\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nconst UNUSABLE_INTERPOLATION_REGEXPS = [\n /@/, // control flow reserved symbol\n /^\\s*$/, // empty\n /[<>]/, // html tag\n /^[{}]$/, // i18n expansion\n /&(#|[a-z])/i, // character reference,\n /^\\/\\//, // comment\n];\n\nexport function assertInterpolationSymbols(identifier: string, value: any): void {\n if (value != null && !(Array.isArray(value) && value.length == 2)) {\n throw new Error(`Expected '${identifier}' to be an array, [start, end].`);\n } else if (value != null) {\n const start = value[0] as string;\n const end = value[1] as string;\n // Check for unusable interpolation symbols\n UNUSABLE_INTERPOLATION_REGEXPS.forEach((regexp) => {\n if (regexp.test(start) || regexp.test(end)) {\n throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`);\n }\n });\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInterpolationSymbols} from '../assertions';\n\nexport class InterpolationConfig {\n static fromArray(markers: [string, string] | null): InterpolationConfig {\n if (!markers) {\n return DEFAULT_INTERPOLATION_CONFIG;\n }\n\n assertInterpolationSymbols('interpolation', markers);\n return new InterpolationConfig(markers[0], markers[1]);\n }\n\n constructor(\n public start: string,\n public end: string,\n ) {}\n}\n\nexport const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig = new InterpolationConfig(\n '{{',\n '}}',\n);\n\nexport const DEFAULT_CONTAINER_BLOCKS = new Set(['switch']);\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport const $EOF = 0;\nexport const $BSPACE = 8;\nexport const $TAB = 9;\nexport const $LF = 10;\nexport const $VTAB = 11;\nexport const $FF = 12;\nexport const $CR = 13;\nexport const $SPACE = 32;\nexport const $BANG = 33;\nexport const $DQ = 34;\nexport const $HASH = 35;\nexport const $$ = 36;\nexport const $PERCENT = 37;\nexport const $AMPERSAND = 38;\nexport const $SQ = 39;\nexport const $LPAREN = 40;\nexport const $RPAREN = 41;\nexport const $STAR = 42;\nexport const $PLUS = 43;\nexport const $COMMA = 44;\nexport const $MINUS = 45;\nexport const $PERIOD = 46;\nexport const $SLASH = 47;\nexport const $COLON = 58;\nexport const $SEMICOLON = 59;\nexport const $LT = 60;\nexport const $EQ = 61;\nexport const $GT = 62;\nexport const $QUESTION = 63;\n\nexport const $0 = 48;\nexport const $7 = 55;\nexport const $9 = 57;\n\nexport const $A = 65;\nexport const $E = 69;\nexport const $F = 70;\nexport const $X = 88;\nexport const $Z = 90;\n\nexport const $LBRACKET = 91;\nexport const $BACKSLASH = 92;\nexport const $RBRACKET = 93;\nexport const $CARET = 94;\nexport const $_ = 95;\n\nexport const $a = 97;\nexport const $b = 98;\nexport const $e = 101;\nexport const $f = 102;\nexport const $n = 110;\nexport const $r = 114;\nexport const $t = 116;\nexport const $u = 117;\nexport const $v = 118;\nexport const $x = 120;\nexport const $z = 122;\n\nexport const $LBRACE = 123;\nexport const $BAR = 124;\nexport const $RBRACE = 125;\nexport const $NBSP = 160;\n\nexport const $PIPE = 124;\nexport const $TILDA = 126;\nexport const $AT = 64;\n\nexport const $BT = 96;\n\nexport function isWhitespace(code: number): boolean {\n return (code >= $TAB && code <= $SPACE) || code == $NBSP;\n}\n\nexport function isDigit(code: number): boolean {\n return $0 <= code && code <= $9;\n}\n\nexport function isAsciiLetter(code: number): boolean {\n return (code >= $a && code <= $z) || (code >= $A && code <= $Z);\n}\n\nexport function isAsciiHexDigit(code: number): boolean {\n return (code >= $a && code <= $f) || (code >= $A && code <= $F) || isDigit(code);\n}\n\nexport function isNewLine(code: number): boolean {\n return code === $LF || code === $CR;\n}\n\nexport function isOctalDigit(code: number): boolean {\n return $0 <= code && code <= $7;\n}\n\nexport function isQuote(code: number): boolean {\n return code === $SQ || code === $DQ || code === $BT;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport * as chars from './chars';\nimport {stringify} from './util';\n\nexport class ParseLocation {\n constructor(\n public file: ParseSourceFile,\n public offset: number,\n public line: number,\n public col: number,\n ) {}\n\n toString(): string {\n return this.offset != null ? `${this.file.url}@${this.line}:${this.col}` : this.file.url;\n }\n\n moveBy(delta: number): ParseLocation {\n const source = this.file.content;\n const len = source.length;\n let offset = this.offset;\n let line = this.line;\n let col = this.col;\n while (offset > 0 && delta < 0) {\n offset--;\n delta++;\n const ch = source.charCodeAt(offset);\n if (ch == chars.$LF) {\n line--;\n const priorLine = source\n .substring(0, offset - 1)\n .lastIndexOf(String.fromCharCode(chars.$LF));\n col = priorLine > 0 ? offset - priorLine : offset;\n } else {\n col--;\n }\n }\n while (offset < len && delta > 0) {\n const ch = source.charCodeAt(offset);\n offset++;\n delta--;\n if (ch == chars.$LF) {\n line++;\n col = 0;\n } else {\n col++;\n }\n }\n return new ParseLocation(this.file, offset, line, col);\n }\n\n // Return the source around the location\n // Up to `maxChars` or `maxLines` on each side of the location\n getContext(maxChars: number, maxLines: number): {before: string; after: string} | null {\n const content = this.file.content;\n let startOffset = this.offset;\n\n if (startOffset != null) {\n if (startOffset > content.length - 1) {\n startOffset = content.length - 1;\n }\n let endOffset = startOffset;\n let ctxChars = 0;\n let ctxLines = 0;\n\n while (ctxChars < maxChars && startOffset > 0) {\n startOffset--;\n ctxChars++;\n if (content[startOffset] == '\\n') {\n if (++ctxLines == maxLines) {\n break;\n }\n }\n }\n\n ctxChars = 0;\n ctxLines = 0;\n while (ctxChars < maxChars && endOffset < content.length - 1) {\n endOffset++;\n ctxChars++;\n if (content[endOffset] == '\\n') {\n if (++ctxLines == maxLines) {\n break;\n }\n }\n }\n\n return {\n before: content.substring(startOffset, this.offset),\n after: content.substring(this.offset, endOffset + 1),\n };\n }\n\n return null;\n }\n}\n\nexport class ParseSourceFile {\n constructor(\n public content: string,\n public url: string,\n ) {}\n}\n\nexport class ParseSourceSpan {\n /**\n * Create an object that holds information about spans of tokens/nodes captured during\n * lexing/parsing of text.\n *\n * @param start\n * The location of the start of the span (having skipped leading trivia).\n * Skipping leading trivia makes source-spans more \"user friendly\", since things like HTML\n * elements will appear to begin at the start of the opening tag, rather than at the start of any\n * leading trivia, which could include newlines.\n *\n * @param end\n * The location of the end of the span.\n *\n * @param fullStart\n * The start of the token without skipping the leading trivia.\n * This is used by tooling that splits tokens further, such as extracting Angular interpolations\n * from text tokens. Such tooling creates new source-spans relative to the original token's\n * source-span. If leading trivia characters have been skipped then the new source-spans may be\n * incorrectly offset.\n *\n * @param details\n * Additional information (such as identifier names) that should be associated with the span.\n */\n constructor(\n public start: ParseLocation,\n public end: ParseLocation,\n public fullStart: ParseLocation = start,\n public details: string | null = null,\n ) {}\n\n toString(): string {\n return this.start.file.content.substring(this.start.offset, this.end.offset);\n }\n}\n\nexport enum ParseErrorLevel {\n WARNING,\n ERROR,\n}\n\nexport class ParseError {\n constructor(\n /** Location of the error. */\n readonly span: ParseSourceSpan,\n /** Error message. */\n readonly msg: string,\n /** Severity level of the error. */\n readonly level: ParseErrorLevel = ParseErrorLevel.ERROR,\n /**\n * Error that caused the error to be surfaced. For example, an error in a sub-expression that\n * couldn't be parsed. Not guaranteed to be defined, but can be used to provide more context.\n */\n readonly relatedError?: unknown,\n ) {}\n\n contextualMessage(): string {\n const ctx = this.span.start.getContext(100, 3);\n return ctx\n ? `${this.msg} (\"${ctx.before}[${ParseErrorLevel[this.level]} ->]${ctx.after}\")`\n : this.msg;\n }\n\n toString(): string {\n const details = this.span.details ? `, ${this.span.details}` : '';\n return `${this.contextualMessage()}: ${this.span.start}${details}`;\n }\n}\n\n/**\n * Generates Source Span object for a given R3 Type for JIT mode.\n *\n * @param kind Component or Directive.\n * @param typeName name of the Component or Directive.\n * @param sourceUrl reference to Component or Directive source.\n * @returns instance of ParseSourceSpan that represent a given Component or Directive.\n */\nexport function r3JitTypeSourceSpan(\n kind: string,\n typeName: string,\n sourceUrl: string,\n): ParseSourceSpan {\n const sourceFileName = `in ${kind} ${typeName} in ${sourceUrl}`;\n const sourceFile = new ParseSourceFile('', sourceFileName);\n return new ParseSourceSpan(\n new ParseLocation(sourceFile, -1, -1, -1),\n new ParseLocation(sourceFile, -1, -1, -1),\n );\n}\n\nlet _anonymousTypeIndex = 0;\n\nexport function identifierName(\n compileIdentifier: CompileIdentifierMetadata | null | undefined,\n): string | null {\n if (!compileIdentifier || !compileIdentifier.reference) {\n return null;\n }\n const ref = compileIdentifier.reference;\n if (ref['__anonymousType']) {\n return ref['__anonymousType'];\n }\n if (ref['__forward_ref__']) {\n // We do not want to try to stringify a `forwardRef()` function because that would cause the\n // inner function to be evaluated too early, defeating the whole point of the `forwardRef`.\n return '__forward_ref__';\n }\n let identifier = stringify(ref);\n if (identifier.indexOf('(') >= 0) {\n // case: anonymous functions!\n identifier = `anonymous_${_anonymousTypeIndex++}`;\n ref['__anonymousType'] = identifier;\n } else {\n identifier = sanitizeIdentifier(identifier);\n }\n return identifier;\n}\n\nexport interface CompileIdentifierMetadata {\n reference: any;\n}\n\nexport function sanitizeIdentifier(name: string): string {\n return name.replace(/\\W/g, '_');\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {AbstractEmitterVisitor, EmitterVisitorContext, escapeIdentifier} from './abstract_emitter';\nimport * as o from './output_ast';\n\n/**\n * In TypeScript, tagged template functions expect a \"template object\", which is an array of\n * \"cooked\" strings plus a `raw` property that contains an array of \"raw\" strings. This is\n * typically constructed with a function called `__makeTemplateObject(cooked, raw)`, but it may not\n * be available in all environments.\n *\n * This is a JavaScript polyfill that uses __makeTemplateObject when it's available, but otherwise\n * creates an inline helper with the same functionality.\n *\n * In the inline function, if `Object.defineProperty` is available we use that to attach the `raw`\n * array.\n */\nconst makeTemplateObjectPolyfill =\n '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,\"raw\",{value:t}):e.raw=t,e})';\n\nexport abstract class AbstractJsEmitterVisitor extends AbstractEmitterVisitor {\n constructor() {\n super(false);\n }\n\n override visitWrappedNodeExpr(ast: o.WrappedNodeExpr, ctx: EmitterVisitorContext): any {\n throw new Error('Cannot emit a WrappedNodeExpr in Javascript.');\n }\n\n override visitDeclareVarStmt(stmt: o.DeclareVarStmt, ctx: EmitterVisitorContext): any {\n ctx.print(stmt, `var ${stmt.name}`);\n if (stmt.value) {\n ctx.print(stmt, ' = ');\n stmt.value.visitExpression(this, ctx);\n }\n ctx.println(stmt, `;`);\n return null;\n }\n override visitTaggedTemplateLiteralExpr(\n ast: o.TaggedTemplateLiteralExpr,\n ctx: EmitterVisitorContext,\n ): any {\n // The following convoluted piece of code is effectively the downlevelled equivalent of\n // ```\n // tag`...`\n // ```\n // which is effectively like:\n // ```\n // tag(__makeTemplateObject(cooked, raw), expression1, expression2, ...);\n // ```\n const elements = ast.template.elements;\n ast.tag.visitExpression(this, ctx);\n ctx.print(ast, `(${makeTemplateObjectPolyfill}(`);\n ctx.print(ast, `[${elements.map((part) => escapeIdentifier(part.text, false)).join(', ')}], `);\n ctx.print(\n ast,\n `[${elements.map((part) => escapeIdentifier(part.rawText, false)).join(', ')}])`,\n );\n ast.template.expressions.forEach((expression) => {\n ctx.print(ast, ', ');\n expression.visitExpression(this, ctx);\n });\n ctx.print(ast, ')');\n return null;\n }\n override visitTemplateLiteralExpr(expr: o.TemplateLiteralExpr, ctx: EmitterVisitorContext): any {\n ctx.print(expr, '`');\n for (let i = 0; i < expr.elements.length; i++) {\n expr.elements[i].visitExpression(this, ctx);\n const expression = i < expr.expressions.length ? expr.expressions[i] : null;\n if (expression !== null) {\n ctx.print(expression, '${');\n expression.visitExpression(this, ctx);\n ctx.print(expression, '}');\n }\n }\n ctx.print(expr, '`');\n }\n override visitTemplateLiteralElementExpr(\n expr: o.TemplateLiteralElementExpr,\n ctx: EmitterVisitorContext,\n ): any {\n ctx.print(expr, expr.rawText);\n return null;\n }\n override visitFunctionExpr(ast: o.FunctionExpr, ctx: EmitterVisitorContext): any {\n ctx.print(ast, `function${ast.name ? ' ' + ast.name : ''}(`);\n this._visitParams(ast.params, ctx);\n ctx.println(ast, `) {`);\n ctx.incIndent();\n this.visitAllStatements(ast.statements, ctx);\n ctx.decIndent();\n ctx.print(ast, `}`);\n return null;\n }\n override visitArrowFunctionExpr(ast: o.ArrowFunctionExpr, ctx: EmitterVisitorContext): any {\n ctx.print(ast, '(');\n this._visitParams(ast.params, ctx);\n ctx.print(ast, ') =>');\n\n if (Array.isArray(ast.body)) {\n ctx.println(ast, `{`);\n ctx.incIndent();\n this.visitAllStatements(ast.body, ctx);\n ctx.decIndent();\n ctx.print(ast, `}`);\n } else {\n const isObjectLiteral = ast.body instanceof o.LiteralMapExpr;\n\n if (isObjectLiteral) {\n ctx.print(ast, '(');\n }\n\n ast.body.visitExpression(this, ctx);\n\n if (isObjectLiteral) {\n ctx.print(ast, ')');\n }\n }\n\n return null;\n }\n override visitDeclareFunctionStmt(stmt: o.DeclareFunctionStmt, ctx: EmitterVisitorContext): any {\n ctx.print(stmt, `function ${stmt.name}(`);\n this._visitParams(stmt.params, ctx);\n ctx.println(stmt, `) {`);\n ctx.incIndent();\n this.visitAllStatements(stmt.statements, ctx);\n ctx.decIndent();\n ctx.println(stmt, `}`);\n return null;\n }\n override visitLocalizedString(ast: o.LocalizedString, ctx: EmitterVisitorContext): any {\n // The following convoluted piece of code is effectively the downlevelled equivalent of\n // ```\n // $localize `...`\n // ```\n // which is effectively like:\n // ```\n // $localize(__makeTemplateObject(cooked, raw), expression1, expression2, ...);\n // ```\n ctx.print(ast, `$localize(${makeTemplateObjectPolyfill}(`);\n const parts = [ast.serializeI18nHead()];\n for (let i = 1; i < ast.messageParts.length; i++) {\n parts.push(ast.serializeI18nTemplatePart(i));\n }\n ctx.print(ast, `[${parts.map((part) => escapeIdentifier(part.cooked, false)).join(', ')}], `);\n ctx.print(ast, `[${parts.map((part) => escapeIdentifier(part.raw, false)).join(', ')}])`);\n ast.expressions.forEach((expression) => {\n ctx.print(ast, ', ');\n expression.visitExpression(this, ctx);\n });\n ctx.print(ast, ')');\n return null;\n }\n\n private _visitParams(params: o.FnParam[], ctx: EmitterVisitorContext): void {\n this.visitAllObjects((param) => ctx.print(null, param.name), params, ctx, ',');\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * @fileoverview\n * A module to facilitate use of a Trusted Types policy within the JIT\n * compiler. It lazily constructs the Trusted Types policy, providing helper\n * utilities for promoting strings to Trusted Types. When Trusted Types are not\n * available, strings are used as a fallback.\n * @security All use of this module is security-sensitive and should go through\n * security review.\n */\n\nimport {global} from '../util';\n\n/**\n * While Angular only uses Trusted Types internally for the time being,\n * references to Trusted Types could leak into our core.d.ts, which would force\n * anyone compiling against @angular/core to provide the @types/trusted-types\n * package in their compilation unit.\n *\n * Until https://github.com/microsoft/TypeScript/issues/30024 is resolved, we\n * will keep Angular's public API surface free of references to Trusted Types.\n * For internal and semi-private APIs that need to reference Trusted Types, the\n * minimal type definitions for the Trusted Types API provided by this module\n * should be used instead. They are marked as \"declare\" to prevent them from\n * being renamed by compiler optimization.\n *\n * Adapted from\n * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/trusted-types/index.d.ts\n * but restricted to the API surface used within Angular.\n */\n\nexport declare interface TrustedScript {\n __brand__: 'TrustedScript';\n}\n\nexport declare interface TrustedTypePolicyFactory {\n createPolicy(\n policyName: string,\n policyOptions: {\n createScript?: (input: string) => string;\n },\n ): TrustedTypePolicy;\n}\n\nexport declare interface TrustedTypePolicy {\n createScript(input: string): TrustedScript;\n}\n\n/**\n * The Trusted Types policy, or null if Trusted Types are not\n * enabled/supported, or undefined if the policy has not been created yet.\n */\nlet policy: TrustedTypePolicy | null | undefined;\n\n/**\n * Returns the Trusted Types policy, or null if Trusted Types are not\n * enabled/supported. The first call to this function will create the policy.\n */\nfunction getPolicy(): TrustedTypePolicy | null {\n if (policy === undefined) {\n const trustedTypes = global['trustedTypes'] as TrustedTypePolicyFactory | undefined;\n policy = null;\n\n if (trustedTypes) {\n try {\n policy = trustedTypes.createPolicy('angular#unsafe-jit', {\n createScript: (s: string) => s,\n });\n } catch {\n // trustedTypes.createPolicy throws if called with a name that is\n // already registered, even in report-only mode. Until the API changes,\n // catch the error not to break the applications functionally. In such\n // cases, the code will fall back to using strings.\n }\n }\n }\n return policy;\n}\n\n/**\n * Unsafely promote a string to a TrustedScript, falling back to strings when\n * Trusted Types are not available.\n * @security In particular, it must be assured that the provided string will\n * never cause an XSS vulnerability if used in a context that will be\n * interpreted and executed as a script by a browser, e.g. when calling eval.\n */\nfunction trustedScriptFromString(script: string): TrustedScript | string {\n return getPolicy()?.createScript(script) || script;\n}\n\n/**\n * Unsafely call the Function constructor with the given string arguments.\n * @security This is a security-sensitive function; any use of this function\n * must go through security review. In particular, it must be assured that it\n * is only called from the JIT compiler, as use in other code can lead to XSS\n * vulnerabilities.\n */\nexport function newTrustedFunctionForJIT(...args: string[]): Function {\n if (!global['trustedTypes']) {\n // In environments that don't support Trusted Types, fall back to the most\n // straightforward implementation:\n return new Function(...args);\n }\n\n // Chrome currently does not support passing TrustedScript to the Function\n // constructor. The following implements the workaround proposed on the page\n // below, where the Chromium bug is also referenced:\n // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor\n const fnArgs = args.slice(0, -1).join(',');\n const fnBody = args[args.length - 1];\n const body = `(function anonymous(${fnArgs}\n) { ${fnBody}\n})`;\n\n // Using eval directly confuses the compiler and prevents this module from\n // being stripped out of JS binaries even if not used. The global['eval']\n // indirection fixes that.\n const fn = global['eval'](trustedScriptFromString(body) as string) as Function;\n if (fn.bind === undefined) {\n // Workaround for a browser bug that only exists in Chrome 83, where passing\n // a TrustedScript to eval just returns the TrustedScript back without\n // evaluating it. In that case, fall back to the most straightforward\n // implementation:\n return new Function(...args);\n }\n\n // To completely mimic the behavior of calling \"new Function\", two more\n // things need to happen:\n // 1. Stringifying the resulting function should return its source code\n fn.toString = () => body;\n // 2. When calling the resulting function, `this` should refer to `global`\n return fn.bind(global);\n\n // When Trusted Types support in Function constructors is widely available,\n // the implementation of this function can be simplified to:\n // return new Function(...args.map(a => trustedScriptFromString(a)));\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {identifierName} from '../parse_util';\n\nimport {EmitterVisitorContext} from './abstract_emitter';\nimport {AbstractJsEmitterVisitor} from './abstract_js_emitter';\nimport * as o from './output_ast';\nimport {newTrustedFunctionForJIT} from './output_jit_trusted_types';\n\nexport interface ExternalReferenceResolver {\n resolveExternalReference(ref: o.ExternalReference): unknown;\n}\n\n/**\n * A helper class to manage the evaluation of JIT generated code.\n */\nexport class JitEvaluator {\n /**\n *\n * @param sourceUrl The URL of the generated code.\n * @param statements An array of Angular statement AST nodes to be evaluated.\n * @param refResolver Resolves `o.ExternalReference`s into values.\n * @param createSourceMaps If true then create a source-map for the generated code and include it\n * inline as a source-map comment.\n * @returns A map of all the variables in the generated code.\n */\n evaluateStatements(\n sourceUrl: string,\n statements: o.Statement[],\n refResolver: ExternalReferenceResolver,\n createSourceMaps: boolean,\n ): {[key: string]: any} {\n const converter = new JitEmitterVisitor(refResolver);\n const ctx = EmitterVisitorContext.createRoot();\n // Ensure generated code is in strict mode\n if (statements.length > 0 && !isUseStrictStatement(statements[0])) {\n statements = [o.literal('use strict').toStmt(), ...statements];\n }\n converter.visitAllStatements(statements, ctx);\n converter.createReturnStmt(ctx);\n return this.evaluateCode(sourceUrl, ctx, converter.getArgs(), createSourceMaps);\n }\n\n /**\n * Evaluate a piece of JIT generated code.\n * @param sourceUrl The URL of this generated code.\n * @param ctx A context object that contains an AST of the code to be evaluated.\n * @param vars A map containing the names and values of variables that the evaluated code might\n * reference.\n * @param createSourceMap If true then create a source-map for the generated code and include it\n * inline as a source-map comment.\n * @returns The result of evaluating the code.\n */\n evaluateCode(\n sourceUrl: string,\n ctx: EmitterVisitorContext,\n vars: {[key: string]: any},\n createSourceMap: boolean,\n ): any {\n let fnBody = `\"use strict\";${ctx.toSource()}\\n//# sourceURL=${sourceUrl}`;\n const fnArgNames: string[] = [];\n const fnArgValues: any[] = [];\n for (const argName in vars) {\n fnArgValues.push(vars[argName]);\n fnArgNames.push(argName);\n }\n if (createSourceMap) {\n // using `new Function(...)` generates a header, 1 line of no arguments, 2 lines otherwise\n // E.g. ```\n // function anonymous(a,b,c\n // /**/) { ... }```\n // We don't want to hard code this fact, so we auto detect it via an empty function first.\n const emptyFn = newTrustedFunctionForJIT(...fnArgNames.concat('return null;')).toString();\n const headerLines = emptyFn.slice(0, emptyFn.indexOf('return null;')).split('\\n').length - 1;\n fnBody += `\\n${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`;\n }\n const fn = newTrustedFunctionForJIT(...fnArgNames.concat(fnBody));\n return this.executeFunction(fn, fnArgValues);\n }\n\n /**\n * Execute a JIT generated function by calling it.\n *\n * This method can be overridden in tests to capture the functions that are generated\n * by this `JitEvaluator` class.\n *\n * @param fn A function to execute.\n * @param args The arguments to pass to the function being executed.\n * @returns The return value of the executed function.\n */\n executeFunction(fn: Function, args: any[]) {\n return fn(...args);\n }\n}\n\n/**\n * An Angular AST visitor that converts AST nodes into executable JavaScript code.\n */\nexport class JitEmitterVisitor extends AbstractJsEmitterVisitor {\n private _evalArgNames: string[] = [];\n private _evalArgValues: any[] = [];\n private _evalExportedVars: string[] = [];\n\n constructor(private refResolver: ExternalReferenceResolver) {\n super();\n }\n\n createReturnStmt(ctx: EmitterVisitorContext) {\n const stmt = new o.ReturnStatement(\n new o.LiteralMapExpr(\n this._evalExportedVars.map(\n (resultVar) => new o.LiteralMapEntry(resultVar, o.variable(resultVar), false),\n ),\n ),\n );\n stmt.visitStatement(this, ctx);\n }\n\n getArgs(): {[key: string]: any} {\n const result: {[key: string]: any} = {};\n for (let i = 0; i < this._evalArgNames.length; i++) {\n result[this._evalArgNames[i]] = this._evalArgValues[i];\n }\n return result;\n }\n\n override visitExternalExpr(ast: o.ExternalExpr, ctx: EmitterVisitorContext): any {\n this._emitReferenceToExternal(ast, this.refResolver.resolveExternalReference(ast.value), ctx);\n return null;\n }\n\n override visitWrappedNodeExpr(ast: o.WrappedNodeExpr, ctx: EmitterVisitorContext): any {\n this._emitReferenceToExternal(ast, ast.node, ctx);\n return null;\n }\n\n override visitDeclareVarStmt(stmt: o.DeclareVarStmt, ctx: EmitterVisitorContext): any {\n if (stmt.hasModifier(o.StmtModifier.Exported)) {\n this._evalExportedVars.push(stmt.name);\n }\n return super.visitDeclareVarStmt(stmt, ctx);\n }\n\n override visitDeclareFunctionStmt(stmt: o.DeclareFunctionStmt, ctx: EmitterVisitorContext): any {\n if (stmt.hasModifier(o.StmtModifier.Exported)) {\n this._evalExportedVars.push(stmt.name);\n }\n return super.visitDeclareFunctionStmt(stmt, ctx);\n }\n\n private _emitReferenceToExternal(\n ast: o.Expression,\n value: any,\n ctx: EmitterVisitorContext,\n ): void {\n let id = this._evalArgValues.indexOf(value);\n if (id === -1) {\n id = this._evalArgValues.length;\n this._evalArgValues.push(value);\n const name = identifierName({reference: value}) || 'val';\n this._evalArgNames.push(`jit_${name}_${id}`);\n }\n ctx.print(ast, this._evalArgNames[id]);\n }\n}\n\nfunction isUseStrictStatement(statement: o.Statement): boolean {\n return statement.isEquivalent(o.literal('use strict').toStmt());\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../output/output_ast';\n\nimport {Identifiers as R3} from './r3_identifiers';\nimport {R3CompiledExpression, R3Reference} from './util';\nimport {DefinitionMap} from './view/util';\n\nexport interface R3InjectorMetadata {\n name: string;\n type: R3Reference;\n providers: o.Expression | null;\n imports: o.Expression[];\n}\n\nexport function compileInjector(meta: R3InjectorMetadata): R3CompiledExpression {\n const definitionMap = new DefinitionMap<{providers: o.Expression; imports: o.Expression}>();\n\n if (meta.providers !== null) {\n definitionMap.set('providers', meta.providers);\n }\n\n if (meta.imports.length > 0) {\n definitionMap.set('imports', o.literalArr(meta.imports));\n }\n\n const expression = o\n .importExpr(R3.defineInjector)\n .callFn([definitionMap.toLiteralMap()], undefined, true);\n const type = createInjectorType(meta);\n return {expression, type, statements: []};\n}\n\nexport function createInjectorType(meta: R3InjectorMetadata): o.Type {\n return new o.ExpressionType(\n o.importExpr(R3.InjectorDeclaration, [new o.ExpressionType(meta.type.type)]),\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../output/output_ast';\nimport {ExternalReferenceResolver} from '../output/output_jit';\n\n/**\n * Implementation of `CompileReflector` which resolves references to @angular/core\n * symbols at runtime, according to a consumer-provided mapping.\n *\n * Only supports `resolveExternalReference`, all other methods throw.\n */\nexport class R3JitReflector implements ExternalReferenceResolver {\n constructor(private context: {[key: string]: unknown}) {}\n\n resolveExternalReference(ref: o.ExternalReference): unknown {\n // This reflector only handles @angular/core imports.\n if (ref.moduleName !== '@angular/core') {\n throw new Error(\n `Cannot resolve external reference to ${ref.moduleName}, only references to @angular/core are supported.`,\n );\n }\n if (!this.context.hasOwnProperty(ref.name!)) {\n throw new Error(`No value provided for @angular/core symbol '${ref.name!}'.`);\n }\n return this.context[ref.name!];\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {R3DeclareNgModuleFacade} from '../compiler_facade_interface';\nimport * as o from '../output/output_ast';\n\nimport {Identifiers as R3} from './r3_identifiers';\nimport {jitOnlyGuardedExpression, R3CompiledExpression, R3Reference, refsToArray} from './util';\nimport {DefinitionMap} from './view/util';\n\n/**\n * How the selector scope of an NgModule (its declarations, imports, and exports) should be emitted\n * as a part of the NgModule definition.\n */\nexport enum R3SelectorScopeMode {\n /**\n * Emit the declarations inline into the module definition.\n *\n * This option is useful in certain contexts where it's known that JIT support is required. The\n * tradeoff here is that this emit style prevents directives and pipes from being tree-shaken if\n * they are unused, but the NgModule is used.\n */\n Inline,\n\n /**\n * Emit the declarations using a side effectful function call, `ɵɵsetNgModuleScope`, that is\n * guarded with the `ngJitMode` flag.\n *\n * This form of emit supports JIT and can be optimized away if the `ngJitMode` flag is set to\n * false, which allows unused directives and pipes to be tree-shaken.\n */\n SideEffect,\n\n /**\n * Don't generate selector scopes at all.\n *\n * This is useful for contexts where JIT support is known to be unnecessary.\n */\n Omit,\n}\n\n/**\n * The type of the NgModule meta data.\n * - Global: Used for full and partial compilation modes which mainly includes R3References.\n * - Local: Used for the local compilation mode which mainly includes the raw expressions as appears\n * in the NgModule decorator.\n */\nexport enum R3NgModuleMetadataKind {\n Global,\n Local,\n}\n\ninterface R3NgModuleMetadataCommon {\n kind: R3NgModuleMetadataKind;\n\n /**\n * An expression representing the module type being compiled.\n */\n type: R3Reference;\n\n /**\n * How to emit the selector scope values (declarations, imports, exports).\n */\n selectorScopeMode: R3SelectorScopeMode;\n\n /**\n * The set of schemas that declare elements to be allowed in the NgModule.\n */\n schemas: R3Reference[] | null;\n\n /** Unique ID or expression representing the unique ID of an NgModule. */\n id: o.Expression | null;\n}\n\n/**\n * Metadata required by the module compiler in full/partial mode to generate a module def (`ɵmod`)\n * for a type.\n */\nexport interface R3NgModuleMetadataGlobal extends R3NgModuleMetadataCommon {\n kind: R3NgModuleMetadataKind.Global;\n\n /**\n * An array of expressions representing the bootstrap components specified by the module.\n */\n bootstrap: R3Reference[];\n\n /**\n * An array of expressions representing the directives and pipes declared by the module.\n */\n declarations: R3Reference[];\n\n /**\n * Those declarations which should be visible to downstream consumers. If not specified, all\n * declarations are made visible to downstream consumers.\n */\n publicDeclarationTypes: o.Expression[] | null;\n\n /**\n * An array of expressions representing the imports of the module.\n */\n imports: R3Reference[];\n\n /**\n * Whether or not to include `imports` in generated type declarations.\n */\n includeImportTypes: boolean;\n\n /**\n * An array of expressions representing the exports of the module.\n */\n exports: R3Reference[];\n\n /**\n * Whether to generate closure wrappers for bootstrap, declarations, imports, and exports.\n */\n containsForwardDecls: boolean;\n}\n\n/**\n * Metadata required by the module compiler in local mode to generate a module def (`ɵmod`) for a\n * type.\n */\nexport interface R3NgModuleMetadataLocal extends R3NgModuleMetadataCommon {\n kind: R3NgModuleMetadataKind.Local;\n\n /**\n * The output expression representing the bootstrap components specified by the module.\n */\n bootstrapExpression: o.Expression | null;\n\n /**\n * The output expression representing the declarations of the module.\n */\n declarationsExpression: o.Expression | null;\n\n /**\n * The output expression representing the imports of the module.\n */\n importsExpression: o.Expression | null;\n\n /**\n * The output expression representing the exports of the module.\n */\n exportsExpression: o.Expression | null;\n\n /**\n * Local compilation mode always requires scope to be handled using side effect function calls.\n */\n selectorScopeMode: R3SelectorScopeMode.SideEffect;\n}\n\n/**\n * Metadata required by the module compiler to generate a module def (`ɵmod`) for a type.\n */\nexport type R3NgModuleMetadata = R3NgModuleMetadataGlobal | R3NgModuleMetadataLocal;\n\n/**\n * The shape of the object literal that is passed to the `ɵɵdefineNgModule()` call.\n */\ninterface R3NgModuleDefMap {\n /**\n * An expression representing the module type being compiled.\n */\n type: o.Expression;\n /**\n * An expression evaluating to an array of expressions representing the bootstrap components\n * specified by the module.\n */\n bootstrap?: o.Expression;\n /**\n * An expression evaluating to an array of expressions representing the directives and pipes\n * declared by the module.\n */\n declarations?: o.Expression;\n /**\n * An expression evaluating to an array of expressions representing the imports of the module.\n */\n imports?: o.Expression;\n /**\n * An expression evaluating to an array of expressions representing the exports of the module.\n */\n exports?: o.Expression;\n /**\n * A literal array expression containing the schemas that declare elements to be allowed in the\n * NgModule.\n */\n schemas?: o.LiteralArrayExpr;\n /**\n * An expression evaluating to the unique ID of an NgModule.\n * */\n id?: o.Expression;\n}\n\n/**\n * Construct an `R3NgModuleDef` for the given `R3NgModuleMetadata`.\n */\nexport function compileNgModule(meta: R3NgModuleMetadata): R3CompiledExpression {\n const statements: o.Statement[] = [];\n const definitionMap = new DefinitionMap();\n definitionMap.set('type', meta.type.value);\n\n // Assign bootstrap definition. In local compilation mode (i.e., for\n // `R3NgModuleMetadataKind.LOCAL`) we assign the bootstrap field using the runtime\n // `ɵɵsetNgModuleScope`.\n if (meta.kind === R3NgModuleMetadataKind.Global && meta.bootstrap.length > 0) {\n definitionMap.set('bootstrap', refsToArray(meta.bootstrap, meta.containsForwardDecls));\n }\n\n if (meta.selectorScopeMode === R3SelectorScopeMode.Inline) {\n // If requested to emit scope information inline, pass the `declarations`, `imports` and\n // `exports` to the `ɵɵdefineNgModule()` call directly.\n\n if (meta.declarations.length > 0) {\n definitionMap.set('declarations', refsToArray(meta.declarations, meta.containsForwardDecls));\n }\n\n if (meta.imports.length > 0) {\n definitionMap.set('imports', refsToArray(meta.imports, meta.containsForwardDecls));\n }\n\n if (meta.exports.length > 0) {\n definitionMap.set('exports', refsToArray(meta.exports, meta.containsForwardDecls));\n }\n } else if (meta.selectorScopeMode === R3SelectorScopeMode.SideEffect) {\n // In this mode, scope information is not passed into `ɵɵdefineNgModule` as it\n // would prevent tree-shaking of the declarations, imports and exports references. Instead, it's\n // patched onto the NgModule definition with a `ɵɵsetNgModuleScope` call that's guarded by the\n // `ngJitMode` flag.\n const setNgModuleScopeCall = generateSetNgModuleScopeCall(meta);\n if (setNgModuleScopeCall !== null) {\n statements.push(setNgModuleScopeCall);\n }\n } else {\n // Selector scope emit was not requested, so skip it.\n }\n\n if (meta.schemas !== null && meta.schemas.length > 0) {\n definitionMap.set('schemas', o.literalArr(meta.schemas.map((ref) => ref.value)));\n }\n\n if (meta.id !== null) {\n definitionMap.set('id', meta.id);\n\n // Generate a side-effectful call to register this NgModule by its id, as per the semantics of\n // NgModule ids.\n statements.push(\n o.importExpr(R3.registerNgModuleType).callFn([meta.type.value, meta.id]).toStmt(),\n );\n }\n\n const expression = o\n .importExpr(R3.defineNgModule)\n .callFn([definitionMap.toLiteralMap()], undefined, true);\n const type = createNgModuleType(meta);\n\n return {expression, type, statements};\n}\n\n/**\n * This function is used in JIT mode to generate the call to `ɵɵdefineNgModule()` from a call to\n * `ɵɵngDeclareNgModule()`.\n */\nexport function compileNgModuleDeclarationExpression(meta: R3DeclareNgModuleFacade): o.Expression {\n const definitionMap = new DefinitionMap();\n definitionMap.set('type', new o.WrappedNodeExpr(meta.type));\n if (meta.bootstrap !== undefined) {\n definitionMap.set('bootstrap', new o.WrappedNodeExpr(meta.bootstrap));\n }\n if (meta.declarations !== undefined) {\n definitionMap.set('declarations', new o.WrappedNodeExpr(meta.declarations));\n }\n if (meta.imports !== undefined) {\n definitionMap.set('imports', new o.WrappedNodeExpr(meta.imports));\n }\n if (meta.exports !== undefined) {\n definitionMap.set('exports', new o.WrappedNodeExpr(meta.exports));\n }\n if (meta.schemas !== undefined) {\n definitionMap.set('schemas', new o.WrappedNodeExpr(meta.schemas));\n }\n if (meta.id !== undefined) {\n definitionMap.set('id', new o.WrappedNodeExpr(meta.id));\n }\n return o.importExpr(R3.defineNgModule).callFn([definitionMap.toLiteralMap()]);\n}\n\nexport function createNgModuleType(meta: R3NgModuleMetadata): o.ExpressionType {\n if (meta.kind === R3NgModuleMetadataKind.Local) {\n return new o.ExpressionType(meta.type.value);\n }\n\n const {\n type: moduleType,\n declarations,\n exports,\n imports,\n includeImportTypes,\n publicDeclarationTypes,\n } = meta;\n\n return new o.ExpressionType(\n o.importExpr(R3.NgModuleDeclaration, [\n new o.ExpressionType(moduleType.type),\n publicDeclarationTypes === null\n ? tupleTypeOf(declarations)\n : tupleOfTypes(publicDeclarationTypes),\n includeImportTypes ? tupleTypeOf(imports) : o.NONE_TYPE,\n tupleTypeOf(exports),\n ]),\n );\n}\n\n/**\n * Generates a function call to `ɵɵsetNgModuleScope` with all necessary information so that the\n * transitive module scope can be computed during runtime in JIT mode. This call is marked pure\n * such that the references to declarations, imports and exports may be elided causing these\n * symbols to become tree-shakeable.\n */\nfunction generateSetNgModuleScopeCall(meta: R3NgModuleMetadata): o.Statement | null {\n const scopeMap = new DefinitionMap<{\n declarations: o.Expression;\n imports: o.Expression;\n exports: o.Expression;\n bootstrap: o.Expression;\n }>();\n\n if (meta.kind === R3NgModuleMetadataKind.Global) {\n if (meta.declarations.length > 0) {\n scopeMap.set('declarations', refsToArray(meta.declarations, meta.containsForwardDecls));\n }\n } else {\n if (meta.declarationsExpression) {\n scopeMap.set('declarations', meta.declarationsExpression);\n }\n }\n\n if (meta.kind === R3NgModuleMetadataKind.Global) {\n if (meta.imports.length > 0) {\n scopeMap.set('imports', refsToArray(meta.imports, meta.containsForwardDecls));\n }\n } else {\n if (meta.importsExpression) {\n scopeMap.set('imports', meta.importsExpression);\n }\n }\n\n if (meta.kind === R3NgModuleMetadataKind.Global) {\n if (meta.exports.length > 0) {\n scopeMap.set('exports', refsToArray(meta.exports, meta.containsForwardDecls));\n }\n } else {\n if (meta.exportsExpression) {\n scopeMap.set('exports', meta.exportsExpression);\n }\n }\n\n if (meta.kind === R3NgModuleMetadataKind.Local && meta.bootstrapExpression) {\n scopeMap.set('bootstrap', meta.bootstrapExpression);\n }\n\n if (Object.keys(scopeMap.values).length === 0) {\n return null;\n }\n\n // setNgModuleScope(...)\n const fnCall = new o.InvokeFunctionExpr(\n /* fn */ o.importExpr(R3.setNgModuleScope),\n /* args */ [meta.type.value, scopeMap.toLiteralMap()],\n );\n\n // (ngJitMode guard) && setNgModuleScope(...)\n const guardedCall = jitOnlyGuardedExpression(fnCall);\n\n // function() { (ngJitMode guard) && setNgModuleScope(...); }\n const iife = new o.FunctionExpr(/* params */ [], /* statements */ [guardedCall.toStmt()]);\n\n // (function() { (ngJitMode guard) && setNgModuleScope(...); })()\n const iifeCall = new o.InvokeFunctionExpr(/* fn */ iife, /* args */ []);\n\n return iifeCall.toStmt();\n}\n\nfunction tupleTypeOf(exp: R3Reference[]): o.Type {\n const types = exp.map((ref) => o.typeofExpr(ref.type));\n return exp.length > 0 ? o.expressionType(o.literalArr(types)) : o.NONE_TYPE;\n}\n\nfunction tupleOfTypes(types: o.Expression[]): o.Type {\n const typeofTypes = types.map((type) => o.typeofExpr(type));\n return types.length > 0 ? o.expressionType(o.literalArr(typeofTypes)) : o.NONE_TYPE;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport * as o from '../output/output_ast';\n\nimport {R3DependencyMetadata} from './r3_factory';\nimport {Identifiers as R3} from './r3_identifiers';\nimport {R3CompiledExpression, R3Reference, typeWithParameters} from './util';\n\nexport interface R3PipeMetadata {\n /**\n * Name of the pipe type.\n */\n name: string;\n\n /**\n * An expression representing a reference to the pipe itself.\n */\n type: R3Reference;\n\n /**\n * Number of generic type parameters of the type itself.\n */\n typeArgumentCount: number;\n\n /**\n * Name of the pipe.\n */\n pipeName: string;\n\n /**\n * Dependencies of the pipe's constructor.\n */\n deps: R3DependencyMetadata[] | null;\n\n /**\n * Whether the pipe is marked as pure.\n */\n pure: boolean;\n\n /**\n * Whether the pipe is standalone.\n */\n isStandalone: boolean;\n}\n\nexport function compilePipeFromMetadata(metadata: R3PipeMetadata): R3CompiledExpression {\n const definitionMapValues: {key: string; quoted: boolean; value: o.Expression}[] = [];\n\n // e.g. `name: 'myPipe'`\n definitionMapValues.push({key: 'name', value: o.literal(metadata.pipeName), quoted: false});\n\n // e.g. `type: MyPipe`\n definitionMapValues.push({key: 'type', value: metadata.type.value, quoted: false});\n\n // e.g. `pure: true`\n definitionMapValues.push({key: 'pure', value: o.literal(metadata.pure), quoted: false});\n\n if (metadata.isStandalone === false) {\n definitionMapValues.push({key: 'standalone', value: o.literal(false), quoted: false});\n }\n\n const expression = o\n .importExpr(R3.definePipe)\n .callFn([o.literalMap(definitionMapValues)], undefined, true);\n const type = createPipeType(metadata);\n\n return {expression, type, statements: []};\n}\n\nexport function createPipeType(metadata: R3PipeMetadata): o.Type {\n return new o.ExpressionType(\n o.importExpr(R3.PipeDeclaration, [\n typeWithParameters(metadata.type.type, metadata.typeArgumentCount),\n new o.ExpressionType(new o.LiteralExpr(metadata.pipeName)),\n new o.ExpressionType(new o.LiteralExpr(metadata.isStandalone)),\n ]),\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ChangeDetectionStrategy, ViewEncapsulation} from '../../core';\nimport {InterpolationConfig} from '../../ml_parser/defaults';\nimport * as o from '../../output/output_ast';\nimport {ParseSourceSpan} from '../../parse_util';\nimport * as t from '../r3_ast';\nimport {R3DependencyMetadata} from '../r3_factory';\nimport {MaybeForwardRefExpression, R3Reference} from '../util';\n\n/**\n * Information needed to compile a directive for the render3 runtime.\n */\nexport interface R3DirectiveMetadata {\n /**\n * Name of the directive type.\n */\n name: string;\n\n /**\n * An expression representing a reference to the directive itself.\n */\n type: R3Reference;\n\n /**\n * Number of generic type parameters of the type itself.\n */\n typeArgumentCount: number;\n\n /**\n * A source span for the directive type.\n */\n typeSourceSpan: ParseSourceSpan;\n\n /**\n * Dependencies of the directive's constructor.\n */\n deps: R3DependencyMetadata[] | 'invalid' | null;\n\n /**\n * Unparsed selector of the directive, or `null` if there was no selector.\n */\n selector: string | null;\n\n /**\n * Information about the content queries made by the directive.\n */\n queries: R3QueryMetadata[];\n\n /**\n * Information about the view queries made by the directive.\n */\n viewQueries: R3QueryMetadata[];\n\n /**\n * Mappings indicating how the directive interacts with its host element (host bindings,\n * listeners, etc).\n */\n host: R3HostMetadata;\n\n /**\n * Information about usage of specific lifecycle events which require special treatment in the\n * code generator.\n */\n lifecycle: {\n /**\n * Whether the directive uses NgOnChanges.\n */\n usesOnChanges: boolean;\n };\n\n /**\n * A mapping of inputs from class property names to binding property names, or to a tuple of\n * binding property name and class property name if the names are different.\n */\n inputs: {[field: string]: R3InputMetadata};\n\n /**\n * A mapping of outputs from class property names to binding property names, or to a tuple of\n * binding property name and class property name if the names are different.\n */\n outputs: {[field: string]: string};\n\n /**\n * Whether or not the component or directive inherits from another class\n */\n usesInheritance: boolean;\n\n /**\n * Whether or not the component or directive inherits its entire decorator from its base class.\n */\n fullInheritance: boolean;\n\n /**\n * Reference name under which to export the directive's type in a template,\n * if any.\n */\n exportAs: string[] | null;\n\n /**\n * The list of providers defined in the directive.\n */\n providers: o.Expression | null;\n\n /**\n * Whether or not the component or directive is standalone.\n */\n isStandalone: boolean;\n\n /**\n * Whether or not the component or directive is signal-based.\n */\n isSignal: boolean;\n\n /**\n * Additional directives applied to the directive host.\n */\n hostDirectives: R3HostDirectiveMetadata[] | null;\n}\n\n/**\n * Defines how dynamic imports for deferred dependencies should be emitted in the\n * generated output:\n * - either in a function on per-component basis (in case of local compilation)\n * - or in a function on per-block basis (in full compilation mode)\n */\nexport const enum DeferBlockDepsEmitMode {\n /**\n * Dynamic imports are grouped on per-block basis.\n *\n * This is used in full compilation mode, when compiler has more information\n * about particular dependencies that belong to this block.\n */\n PerBlock,\n\n /**\n * Dynamic imports are grouped on per-component basis.\n *\n * In local compilation, compiler doesn't have enough information to determine\n * which deferred dependencies belong to which block. In this case we group all\n * dynamic imports into a single file on per-component basis.\n */\n PerComponent,\n}\n\n/**\n * Specifies how a list of declaration type references should be emitted into the generated code.\n */\nexport const enum DeclarationListEmitMode {\n /**\n * The list of declarations is emitted into the generated code as is.\n *\n * ```ts\n * directives: [MyDir],\n * ```\n */\n Direct,\n\n /**\n * The list of declarations is emitted into the generated code wrapped inside a closure, which\n * is needed when at least one declaration is a forward reference.\n *\n * ```ts\n * directives: function () { return [MyDir, ForwardDir]; },\n * ```\n */\n Closure,\n\n /**\n * Similar to `Closure`, with the addition that the list of declarations can contain individual\n * items that are themselves forward references. This is relevant for JIT compilations, as\n * unwrapping the forwardRef cannot be done statically so must be deferred. This mode emits\n * the declaration list using a mapping transform through `resolveForwardRef` to ensure that\n * any forward references within the list are resolved when the outer closure is invoked.\n *\n * Consider the case where the runtime has captured two declarations in two distinct values:\n * ```ts\n * const dirA = MyDir;\n * const dirB = forwardRef(function() { return ForwardRef; });\n * ```\n *\n * This mode would emit the declarations captured in `dirA` and `dirB` as follows:\n * ```ts\n * directives: function () { return [dirA, dirB].map(ng.resolveForwardRef); },\n * ```\n */\n ClosureResolved,\n\n RuntimeResolved,\n}\n\n/**\n * Information needed to compile a component for the render3 runtime.\n */\nexport interface R3ComponentMetadata\n extends R3DirectiveMetadata {\n /**\n * Information about the component's template.\n */\n template: {\n /**\n * Parsed nodes of the template.\n */\n nodes: t.Node[];\n\n /**\n * Any ng-content selectors extracted from the template. Contains `*` when an ng-content\n * element without selector is present.\n */\n ngContentSelectors: string[];\n\n /**\n * Whether the template preserves whitespaces from the user's code.\n */\n preserveWhitespaces?: boolean;\n };\n\n declarations: DeclarationT[];\n\n /** Metadata related to the deferred blocks in the component's template. */\n defer: R3ComponentDeferMetadata;\n\n /**\n * Specifies how the 'directives' and/or `pipes` array, if generated, need to be emitted.\n */\n declarationListEmitMode: DeclarationListEmitMode;\n\n /**\n * A collection of styling data that will be applied and scoped to the component.\n */\n styles: string[];\n\n /**\n * A collection of style paths for external stylesheets that will be applied and scoped to the component.\n */\n externalStyles?: string[];\n\n /**\n * An encapsulation policy for the component's styling.\n * Possible values:\n * - `ViewEncapsulation.Emulated`: Apply modified component styles in order to emulate\n * a native Shadow DOM CSS encapsulation behavior.\n * - `ViewEncapsulation.None`: Apply component styles globally without any sort of encapsulation.\n * - `ViewEncapsulation.ShadowDom`: Use the browser's native Shadow DOM API to encapsulate styles.\n */\n encapsulation: ViewEncapsulation;\n\n /**\n * A collection of animation triggers that will be used in the component template.\n */\n animations: o.Expression | null;\n\n /**\n * The list of view providers defined in the component.\n */\n viewProviders: o.Expression | null;\n\n /**\n * Path to the .ts file in which this template's generated code will be included, relative to\n * the compilation root. This will be used to generate identifiers that need to be globally\n * unique in certain contexts (such as g3).\n */\n relativeContextFilePath: string;\n\n /**\n * Whether translation variable name should contain external message id\n * (used by Closure Compiler's output of `goog.getMsg` for transition period).\n */\n i18nUseExternalIds: boolean;\n\n /**\n * Overrides the default interpolation start and end delimiters ({{ and }}).\n */\n interpolation: InterpolationConfig;\n\n /**\n * Strategy used for detecting changes in the component.\n *\n * In global compilation mode the value is ChangeDetectionStrategy if available as it is\n * statically resolved during analysis phase. Whereas in local compilation mode the value is the\n * expression as appears in the decorator.\n */\n changeDetection: ChangeDetectionStrategy | o.Expression | null;\n\n /**\n * Relative path to the component's template from the root of the project.\n * Used to generate debugging information.\n */\n relativeTemplatePath: string | null;\n\n /**\n * The imports expression as appears on the component decorate for standalone component. This\n * field is currently needed only for local compilation, and so in other compilation modes it may\n * not be set. If component has empty array imports then this field is not set.\n */\n rawImports?: o.Expression;\n}\n\n/**\n * Information about the deferred blocks in a component's template.\n */\nexport type R3ComponentDeferMetadata =\n | {\n mode: DeferBlockDepsEmitMode.PerBlock;\n blocks: Map;\n }\n | {\n mode: DeferBlockDepsEmitMode.PerComponent;\n dependenciesFn: o.Expression | null;\n };\n\n/**\n * Metadata for an individual input on a directive.\n */\nexport interface R3InputMetadata {\n classPropertyName: string;\n bindingPropertyName: string;\n required: boolean;\n isSignal: boolean;\n /**\n * Transform function for the input.\n *\n * Null if there is no transform, or if this is a signal input.\n * Signal inputs capture their transform as part of the `InputSignal`.\n */\n transformFunction: o.Expression | null;\n}\n\nexport enum R3TemplateDependencyKind {\n Directive = 0,\n Pipe = 1,\n NgModule = 2,\n}\n\n/**\n * A dependency that's used within a component template.\n */\nexport interface R3TemplateDependency {\n kind: R3TemplateDependencyKind;\n\n /**\n * The type of the dependency as an expression.\n */\n type: o.Expression;\n}\n\n/**\n * A dependency that's used within a component template\n */\nexport type R3TemplateDependencyMetadata =\n | R3DirectiveDependencyMetadata\n | R3PipeDependencyMetadata\n | R3NgModuleDependencyMetadata;\n\n/**\n * Information about a directive that is used in a component template. Only the stable, public\n * facing information of the directive is stored here.\n */\nexport interface R3DirectiveDependencyMetadata extends R3TemplateDependency {\n kind: R3TemplateDependencyKind.Directive;\n\n /**\n * The selector of the directive.\n */\n selector: string;\n\n /**\n * The binding property names of the inputs of the directive.\n */\n inputs: string[];\n\n /**\n * The binding property names of the outputs of the directive.\n */\n outputs: string[];\n\n /**\n * Name under which the directive is exported, if any (exportAs in Angular). Null otherwise.\n */\n exportAs: string[] | null;\n\n /**\n * If true then this directive is actually a component; otherwise it is not.\n */\n isComponent: boolean;\n}\n\nexport interface R3PipeDependencyMetadata extends R3TemplateDependency {\n kind: R3TemplateDependencyKind.Pipe;\n\n name: string;\n}\n\nexport interface R3NgModuleDependencyMetadata extends R3TemplateDependency {\n kind: R3TemplateDependencyKind.NgModule;\n}\n\n/**\n * Information needed to compile a query (view or content).\n */\nexport interface R3QueryMetadata {\n /**\n * Name of the property on the class to update with query results.\n */\n propertyName: string;\n\n /**\n * Whether to read only the first matching result, or an array of results.\n */\n first: boolean;\n\n /**\n * Either an expression representing a type or `InjectionToken` for the query\n * predicate, or a set of string selectors.\n *\n * Note: At compile time we split selectors as an optimization that avoids this\n * extra work at runtime creation phase.\n *\n * Notably, if the selector is not statically analyzable due to an expression,\n * the selectors may need to be split up at runtime.\n */\n predicate: MaybeForwardRefExpression | string[];\n\n /**\n * Whether to include only direct children or all descendants.\n */\n descendants: boolean;\n\n /**\n * If the `QueryList` should fire change event only if actual change to query was computed (vs old\n * behavior where the change was fired whenever the query was recomputed, even if the recomputed\n * query resulted in the same list.)\n */\n emitDistinctChangesOnly: boolean;\n\n /**\n * An expression representing a type to read from each matched node, or null if the default value\n * for a given node is to be returned.\n */\n read: o.Expression | null;\n\n /**\n * Whether or not this query should collect only static results.\n *\n * If static is true, the query's results will be set on the component after nodes are created,\n * but before change detection runs. This means that any results that relied upon change detection\n * to run (e.g. results inside *ngIf or *ngFor views) will not be collected. Query results are\n * available in the ngOnInit hook.\n *\n * If static is false, the query's results will be set on the component after change detection\n * runs. This means that the query results can contain nodes inside *ngIf or *ngFor views, but\n * the results will not be available in the ngOnInit hook (only in the ngAfterContentInit for\n * content hooks and ngAfterViewInit for view hooks).\n *\n * Note: For signal-based queries, this option does not have any effect.\n */\n static: boolean;\n\n /** Whether the query is signal-based. */\n isSignal: boolean;\n}\n\n/**\n * Mappings indicating how the class interacts with its\n * host element (host bindings, listeners, etc).\n */\nexport interface R3HostMetadata {\n /**\n * A mapping of attribute binding keys to `o.Expression`s.\n */\n attributes: {[key: string]: o.Expression};\n\n /**\n * A mapping of event binding keys to unparsed expressions.\n */\n listeners: {[key: string]: string};\n\n /**\n * A mapping of property binding keys to unparsed expressions.\n */\n properties: {[key: string]: string};\n\n specialAttributes: {styleAttr?: string; classAttr?: string};\n}\n\n/**\n * Information needed to compile a host directive for the render3 runtime.\n */\nexport interface R3HostDirectiveMetadata {\n /** An expression representing the host directive class itself. */\n directive: R3Reference;\n\n /** Whether the expression referring to the host directive is a forward reference. */\n isForwardReference: boolean;\n\n /** Inputs from the host directive that will be exposed on the host. */\n inputs: {[publicName: string]: string} | null;\n\n /** Outputs from the host directive that will be exposed on the host. */\n outputs: {[publicName: string]: string} | null;\n}\n\n/**\n * Information needed to compile the defer block resolver function.\n */\nexport type R3DeferResolverFunctionMetadata =\n | {\n mode: DeferBlockDepsEmitMode.PerBlock;\n dependencies: R3DeferPerBlockDependency[];\n }\n | {\n mode: DeferBlockDepsEmitMode.PerComponent;\n dependencies: R3DeferPerComponentDependency[];\n };\n\n/**\n * Information about a single dependency of a defer block in `PerBlock` mode.\n */\nexport interface R3DeferPerBlockDependency {\n /**\n * Reference to a dependency.\n */\n typeReference: o.Expression;\n\n /**\n * Dependency class name.\n */\n symbolName: string;\n\n /**\n * Whether this dependency can be defer-loaded.\n */\n isDeferrable: boolean;\n\n /**\n * Import path where this dependency is located.\n */\n importPath: string | null;\n\n /**\n * Whether the symbol is the default export.\n */\n isDefaultImport: boolean;\n}\n\n/**\n * Information about a single dependency of a defer block in `PerComponent` mode.\n */\nexport interface R3DeferPerComponentDependency {\n /**\n * Dependency class name.\n */\n symbolName: string;\n\n /**\n * Import path where this dependency is located.\n */\n importPath: string;\n\n /**\n * Whether the symbol is the default export.\n */\n isDefaultImport: boolean;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * The following set contains all keywords that can be used in the animation css shorthand\n * property and is used during the scoping of keyframes to make sure such keywords\n * are not modified.\n */\nconst animationKeywords = new Set([\n // global values\n 'inherit',\n 'initial',\n 'revert',\n 'unset',\n // animation-direction\n 'alternate',\n 'alternate-reverse',\n 'normal',\n 'reverse',\n // animation-fill-mode\n 'backwards',\n 'both',\n 'forwards',\n 'none',\n // animation-play-state\n 'paused',\n 'running',\n // animation-timing-function\n 'ease',\n 'ease-in',\n 'ease-in-out',\n 'ease-out',\n 'linear',\n 'step-start',\n 'step-end',\n // `steps()` function\n 'end',\n 'jump-both',\n 'jump-end',\n 'jump-none',\n 'jump-start',\n 'start',\n]);\n\n/**\n * The following array contains all of the CSS at-rule identifiers which are scoped.\n */\nconst scopedAtRuleIdentifiers = [\n '@media',\n '@supports',\n '@document',\n '@layer',\n '@container',\n '@scope',\n '@starting-style',\n];\n\n/**\n * The following class has its origin from a port of shadowCSS from webcomponents.js to TypeScript.\n * It has since diverge in many ways to tailor Angular's needs.\n *\n * Source:\n * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js\n *\n * The original file level comment is reproduced below\n */\n\n/*\n This is a limited shim for ShadowDOM css styling.\n https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles\n\n The intention here is to support only the styling features which can be\n relatively simply implemented. The goal is to allow users to avoid the\n most obvious pitfalls and do so without compromising performance significantly.\n For ShadowDOM styling that's not covered here, a set of best practices\n can be provided that should allow users to accomplish more complex styling.\n\n The following is a list of specific ShadowDOM styling features and a brief\n discussion of the approach used to shim.\n\n Shimmed features:\n\n * :host, :host-context: ShadowDOM allows styling of the shadowRoot's host\n element using the :host rule. To shim this feature, the :host styles are\n reformatted and prefixed with a given scope name and promoted to a\n document level stylesheet.\n For example, given a scope name of .foo, a rule like this:\n\n :host {\n background: red;\n }\n }\n\n becomes:\n\n .foo {\n background: red;\n }\n\n * encapsulation: Styles defined within ShadowDOM, apply only to\n dom inside the ShadowDOM.\n The selectors are scoped by adding an attribute selector suffix to each\n simple selector that contains the host element tag name. Each element\n in the element's ShadowDOM template is also given the scope attribute.\n Thus, these rules match only elements that have the scope attribute.\n For example, given a scope name of x-foo, a rule like this:\n\n div {\n font-weight: bold;\n }\n\n becomes:\n\n div[x-foo] {\n font-weight: bold;\n }\n\n Note that elements that are dynamically added to a scope must have the scope\n selector added to them manually.\n\n * upper/lower bound encapsulation: Styles which are defined outside a\n shadowRoot should not cross the ShadowDOM boundary and should not apply\n inside a shadowRoot.\n\n This styling behavior is not emulated. Some possible ways to do this that\n were rejected due to complexity and/or performance concerns include: (1) reset\n every possible property for every possible selector for a given scope name;\n (2) re-implement css in javascript.\n\n As an alternative, users should make sure to use selectors\n specific to the scope in which they are working.\n\n * ::distributed: This behavior is not emulated. It's often not necessary\n to style the contents of a specific insertion point and instead, descendants\n of the host element can be styled selectively. Users can also create an\n extra node around an insertion point and style that node's contents\n via descendent selectors. For example, with a shadowRoot like this:\n\n \n \n\n could become:\n\n \n
\n \n
\n\n Note the use of @polyfill in the comment above a ShadowDOM specific style\n declaration. This is a directive to the styling shim to use the selector\n in comments in lieu of the next selector when running under polyfill.\n*/\nexport class ShadowCss {\n /*\n * Shim some cssText with the given selector. Returns cssText that can be included in the document\n *\n * The selector is the attribute added to all elements inside the host,\n * The hostSelector is the attribute added to the host itself.\n */\n shimCssText(cssText: string, selector: string, hostSelector: string = ''): string {\n // **NOTE**: Do not strip comments as this will cause component sourcemaps to break\n // due to shift in lines.\n\n // Collect comments and replace them with a placeholder, this is done to avoid complicating\n // the rule parsing RegExp and keep it safer.\n const comments: string[] = [];\n cssText = cssText.replace(_commentRe, (m) => {\n if (m.match(_commentWithHashRe)) {\n comments.push(m);\n } else {\n // Replace non hash comments with empty lines.\n // This is done so that we do not leak any sensitive data in comments.\n const newLinesMatches = m.match(_newLinesRe);\n comments.push((newLinesMatches?.join('') ?? '') + '\\n');\n }\n\n return COMMENT_PLACEHOLDER;\n });\n\n cssText = this._insertDirectives(cssText);\n const scopedCssText = this._scopeCssText(cssText, selector, hostSelector);\n // Add back comments at the original position.\n let commentIdx = 0;\n return scopedCssText.replace(_commentWithHashPlaceHolderRe, () => comments[commentIdx++]);\n }\n\n private _insertDirectives(cssText: string): string {\n cssText = this._insertPolyfillDirectivesInCssText(cssText);\n return this._insertPolyfillRulesInCssText(cssText);\n }\n\n /**\n * Process styles to add scope to keyframes.\n *\n * Modify both the names of the keyframes defined in the component styles and also the css\n * animation rules using them.\n *\n * Animation rules using keyframes defined elsewhere are not modified to allow for globally\n * defined keyframes.\n *\n * For example, we convert this css:\n *\n * ```scss\n * .box {\n * animation: box-animation 1s forwards;\n * }\n *\n * @keyframes box-animation {\n * to {\n * background-color: green;\n * }\n * }\n * ```\n *\n * to this:\n *\n * ```scss\n * .box {\n * animation: scopeName_box-animation 1s forwards;\n * }\n *\n * @keyframes scopeName_box-animation {\n * to {\n * background-color: green;\n * }\n * }\n * ```\n *\n * @param cssText the component's css text that needs to be scoped.\n * @param scopeSelector the component's scope selector.\n *\n * @returns the scoped css text.\n */\n private _scopeKeyframesRelatedCss(cssText: string, scopeSelector: string): string {\n const unscopedKeyframesSet = new Set();\n const scopedKeyframesCssText = processRules(cssText, (rule) =>\n this._scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet),\n );\n return processRules(scopedKeyframesCssText, (rule) =>\n this._scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet),\n );\n }\n\n /**\n * Scopes local keyframes names, returning the updated css rule and it also\n * adds the original keyframe name to a provided set to collect all keyframes names\n * so that it can later be used to scope the animation rules.\n *\n * For example, it takes a rule such as:\n *\n * ```scss\n * @keyframes box-animation {\n * to {\n * background-color: green;\n * }\n * }\n * ```\n *\n * and returns:\n *\n * ```scss\n * @keyframes scopeName_box-animation {\n * to {\n * background-color: green;\n * }\n * }\n * ```\n * and as a side effect it adds \"box-animation\" to the `unscopedKeyframesSet` set\n *\n * @param cssRule the css rule to process.\n * @param scopeSelector the component's scope selector.\n * @param unscopedKeyframesSet the set of unscoped keyframes names (which can be\n * modified as a side effect)\n *\n * @returns the css rule modified with the scoped keyframes name.\n */\n private _scopeLocalKeyframeDeclarations(\n rule: CssRule,\n scopeSelector: string,\n unscopedKeyframesSet: Set,\n ): CssRule {\n return {\n ...rule,\n selector: rule.selector.replace(\n /(^@(?:-webkit-)?keyframes(?:\\s+))(['\"]?)(.+)\\2(\\s*)$/,\n (_, start, quote, keyframeName, endSpaces) => {\n unscopedKeyframesSet.add(unescapeQuotes(keyframeName, quote));\n return `${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`;\n },\n ),\n };\n }\n\n /**\n * Function used to scope a keyframes name (obtained from an animation declaration)\n * using an existing set of unscopedKeyframes names to discern if the scoping needs to be\n * performed (keyframes names of keyframes not defined in the component's css need not to be\n * scoped).\n *\n * @param keyframe the keyframes name to check.\n * @param scopeSelector the component's scope selector.\n * @param unscopedKeyframesSet the set of unscoped keyframes names.\n *\n * @returns the scoped name of the keyframe, or the original name is the name need not to be\n * scoped.\n */\n private _scopeAnimationKeyframe(\n keyframe: string,\n scopeSelector: string,\n unscopedKeyframesSet: ReadonlySet,\n ): string {\n return keyframe.replace(/^(\\s*)(['\"]?)(.+?)\\2(\\s*)$/, (_, spaces1, quote, name, spaces2) => {\n name = `${\n unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + '_' : ''\n }${name}`;\n return `${spaces1}${quote}${name}${quote}${spaces2}`;\n });\n }\n\n /**\n * Regular expression used to extrapolate the possible keyframes from an\n * animation declaration (with possibly multiple animation definitions)\n *\n * The regular expression can be divided in three parts\n * - (^|\\s+|,)\n * captures how many (if any) leading whitespaces are present or a comma\n * - (?:(?:(['\"])((?:\\\\\\\\|\\\\\\2|(?!\\2).)+)\\2)|(-?[A-Za-z][\\w\\-]*))\n * captures two different possible keyframes, ones which are quoted or ones which are valid css\n * indents (custom properties excluded)\n * - (?=[,\\s;]|$)\n * simply matches the end of the possible keyframe, valid endings are: a comma, a space, a\n * semicolon or the end of the string\n */\n private _animationDeclarationKeyframesRe =\n /(^|\\s+|,)(?:(?:(['\"])((?:\\\\\\\\|\\\\\\2|(?!\\2).)+)\\2)|(-?[A-Za-z][\\w\\-]*))(?=[,\\s]|$)/g;\n\n /**\n * Scope an animation rule so that the keyframes mentioned in such rule\n * are scoped if defined in the component's css and left untouched otherwise.\n *\n * It can scope values of both the 'animation' and 'animation-name' properties.\n *\n * @param rule css rule to scope.\n * @param scopeSelector the component's scope selector.\n * @param unscopedKeyframesSet the set of unscoped keyframes names.\n *\n * @returns the updated css rule.\n **/\n private _scopeAnimationRule(\n rule: CssRule,\n scopeSelector: string,\n unscopedKeyframesSet: ReadonlySet,\n ): CssRule {\n let content = rule.content.replace(\n /((?:^|\\s+|;)(?:-webkit-)?animation\\s*:\\s*),*([^;]+)/g,\n (_, start, animationDeclarations) =>\n start +\n animationDeclarations.replace(\n this._animationDeclarationKeyframesRe,\n (\n original: string,\n leadingSpaces: string,\n quote = '',\n quotedName: string,\n nonQuotedName: string,\n ) => {\n if (quotedName) {\n return `${leadingSpaces}${this._scopeAnimationKeyframe(\n `${quote}${quotedName}${quote}`,\n scopeSelector,\n unscopedKeyframesSet,\n )}`;\n } else {\n return animationKeywords.has(nonQuotedName)\n ? original\n : `${leadingSpaces}${this._scopeAnimationKeyframe(\n nonQuotedName,\n scopeSelector,\n unscopedKeyframesSet,\n )}`;\n }\n },\n ),\n );\n content = content.replace(\n /((?:^|\\s+|;)(?:-webkit-)?animation-name(?:\\s*):(?:\\s*))([^;]+)/g,\n (_match, start, commaSeparatedKeyframes) =>\n `${start}${commaSeparatedKeyframes\n .split(',')\n .map((keyframe: string) =>\n this._scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet),\n )\n .join(',')}`,\n );\n return {...rule, content};\n }\n\n /*\n * Process styles to convert native ShadowDOM rules that will trip\n * up the css parser; we rely on decorating the stylesheet with inert rules.\n *\n * For example, we convert this rule:\n *\n * polyfill-next-selector { content: ':host menu-item'; }\n * ::content menu-item {\n *\n * to this:\n *\n * scopeName menu-item {\n *\n **/\n private _insertPolyfillDirectivesInCssText(cssText: string): string {\n return cssText.replace(_cssContentNextSelectorRe, function (...m: string[]) {\n return m[2] + '{';\n });\n }\n\n /*\n * Process styles to add rules which will only apply under the polyfill\n *\n * For example, we convert this rule:\n *\n * polyfill-rule {\n * content: ':host menu-item';\n * ...\n * }\n *\n * to this:\n *\n * scopeName menu-item {...}\n *\n **/\n private _insertPolyfillRulesInCssText(cssText: string): string {\n return cssText.replace(_cssContentRuleRe, (...m: string[]) => {\n const rule = m[0].replace(m[1], '').replace(m[2], '');\n return m[4] + rule;\n });\n }\n\n /* Ensure styles are scoped. Pseudo-scoping takes a rule like:\n *\n * .foo {... }\n *\n * and converts this to\n *\n * scopeName .foo { ... }\n */\n private _scopeCssText(cssText: string, scopeSelector: string, hostSelector: string): string {\n const unscopedRules = this._extractUnscopedRulesFromCssText(cssText);\n // replace :host and :host-context with -shadowcsshost and -shadowcsshostcontext respectively\n cssText = this._insertPolyfillHostInCssText(cssText);\n cssText = this._convertColonHost(cssText);\n cssText = this._convertColonHostContext(cssText);\n cssText = this._convertShadowDOMSelectors(cssText);\n if (scopeSelector) {\n cssText = this._scopeKeyframesRelatedCss(cssText, scopeSelector);\n cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);\n }\n cssText = cssText + '\\n' + unscopedRules;\n return cssText.trim();\n }\n\n /*\n * Process styles to add rules which will only apply under the polyfill\n * and do not process via CSSOM. (CSSOM is destructive to rules on rare\n * occasions, e.g. -webkit-calc on Safari.)\n * For example, we convert this rule:\n *\n * @polyfill-unscoped-rule {\n * content: 'menu-item';\n * ... }\n *\n * to this:\n *\n * menu-item {...}\n *\n **/\n private _extractUnscopedRulesFromCssText(cssText: string): string {\n let r = '';\n let m: RegExpExecArray | null;\n _cssContentUnscopedRuleRe.lastIndex = 0;\n while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) {\n const rule = m[0].replace(m[2], '').replace(m[1], m[4]);\n r += rule + '\\n\\n';\n }\n return r;\n }\n\n /*\n * convert a rule like :host(.foo) > .bar { }\n *\n * to\n *\n * .foo > .bar\n */\n private _convertColonHost(cssText: string): string {\n return cssText.replace(_cssColonHostRe, (_, hostSelectors: string, otherSelectors: string) => {\n if (hostSelectors) {\n const convertedSelectors: string[] = [];\n const hostSelectorArray = hostSelectors.split(',').map((p) => p.trim());\n for (const hostSelector of hostSelectorArray) {\n if (!hostSelector) break;\n const convertedSelector =\n _polyfillHostNoCombinator + hostSelector.replace(_polyfillHost, '') + otherSelectors;\n convertedSelectors.push(convertedSelector);\n }\n return convertedSelectors.join(',');\n } else {\n return _polyfillHostNoCombinator + otherSelectors;\n }\n });\n }\n\n /*\n * convert a rule like :host-context(.foo) > .bar { }\n *\n * to\n *\n * .foo > .bar, .foo > .bar { }\n *\n * and\n *\n * :host-context(.foo:host) .bar { ... }\n *\n * to\n *\n * .foo .bar { ... }\n */\n private _convertColonHostContext(cssText: string): string {\n const length = cssText.length;\n let parens = 0;\n let prev = 0;\n let result = '';\n\n // Splits up the selectors on their top-level commas, processes the :host-context in them\n // individually and stitches them back together. This ensures that individual selectors don't\n // affect each other.\n for (let i = 0; i < length; i++) {\n const char = cssText[i];\n\n // If we hit a comma and there are no open parentheses, take the current chunk and process it.\n if (char === ',' && parens === 0) {\n result += this._convertColonHostContextInSelectorPart(cssText.slice(prev, i)) + ',';\n prev = i + 1;\n continue;\n }\n\n // We've hit the end. Take everything since the last comma.\n if (i === length - 1) {\n result += this._convertColonHostContextInSelectorPart(cssText.slice(prev));\n break;\n }\n\n if (char === '(') {\n parens++;\n } else if (char === ')') {\n parens--;\n }\n }\n\n return result;\n }\n\n private _convertColonHostContextInSelectorPart(cssText: string): string {\n return cssText.replace(_cssColonHostContextReGlobal, (selectorText, pseudoPrefix) => {\n // We have captured a selector that contains a `:host-context` rule.\n\n // For backward compatibility `:host-context` may contain a comma separated list of selectors.\n // Each context selector group will contain a list of host-context selectors that must match\n // an ancestor of the host.\n // (Normally `contextSelectorGroups` will only contain a single array of context selectors.)\n const contextSelectorGroups: string[][] = [[]];\n\n // There may be more than `:host-context` in this selector so `selectorText` could look like:\n // `:host-context(.one):host-context(.two)`.\n // Execute `_cssColonHostContextRe` over and over until we have extracted all the\n // `:host-context` selectors from this selector.\n let match: RegExpExecArray | null;\n while ((match = _cssColonHostContextRe.exec(selectorText))) {\n // `match` = [':host-context()', , ]\n\n // The `` could actually be a comma separated list: `:host-context(.one, .two)`.\n const newContextSelectors = (match[1] ?? '')\n .trim()\n .split(',')\n .map((m) => m.trim())\n .filter((m) => m !== '');\n\n // We must duplicate the current selector group for each of these new selectors.\n // For example if the current groups are:\n // ```\n // [\n // ['a', 'b', 'c'],\n // ['x', 'y', 'z'],\n // ]\n // ```\n // And we have a new set of comma separated selectors: `:host-context(m,n)` then the new\n // groups are:\n // ```\n // [\n // ['a', 'b', 'c', 'm'],\n // ['x', 'y', 'z', 'm'],\n // ['a', 'b', 'c', 'n'],\n // ['x', 'y', 'z', 'n'],\n // ]\n // ```\n const contextSelectorGroupsLength = contextSelectorGroups.length;\n repeatGroups(contextSelectorGroups, newContextSelectors.length);\n for (let i = 0; i < newContextSelectors.length; i++) {\n for (let j = 0; j < contextSelectorGroupsLength; j++) {\n contextSelectorGroups[j + i * contextSelectorGroupsLength].push(newContextSelectors[i]);\n }\n }\n\n // Update the `selectorText` and see repeat to see if there are more `:host-context`s.\n selectorText = match[2];\n }\n\n // The context selectors now must be combined with each other to capture all the possible\n // selectors that `:host-context` can match. See `_combineHostContextSelectors()` for more\n // info about how this is done.\n return contextSelectorGroups\n .map((contextSelectors) =>\n _combineHostContextSelectors(contextSelectors, selectorText, pseudoPrefix),\n )\n .join(', ');\n });\n }\n\n /*\n * Convert combinators like ::shadow and pseudo-elements like ::content\n * by replacing with space.\n */\n private _convertShadowDOMSelectors(cssText: string): string {\n return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);\n }\n\n // change a selector like 'div' to 'name div'\n private _scopeSelectors(cssText: string, scopeSelector: string, hostSelector: string): string {\n return processRules(cssText, (rule: CssRule) => {\n let selector = rule.selector;\n let content = rule.content;\n if (rule.selector[0] !== '@') {\n selector = this._scopeSelector({\n selector,\n scopeSelector,\n hostSelector,\n isParentSelector: true,\n });\n } else if (scopedAtRuleIdentifiers.some((atRule) => rule.selector.startsWith(atRule))) {\n content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);\n } else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {\n content = this._stripScopingSelectors(rule.content);\n }\n return new CssRule(selector, content);\n });\n }\n\n /**\n * Handle a css text that is within a rule that should not contain scope selectors by simply\n * removing them! An example of such a rule is `@font-face`.\n *\n * `@font-face` rules cannot contain nested selectors. Nor can they be nested under a selector.\n * Normally this would be a syntax error by the author of the styles. But in some rare cases, such\n * as importing styles from a library, and applying `:host ::ng-deep` to the imported styles, we\n * can end up with broken css if the imported styles happen to contain @font-face rules.\n *\n * For example:\n *\n * ```\n * :host ::ng-deep {\n * import 'some/lib/containing/font-face';\n * }\n *\n * Similar logic applies to `@page` rules which can contain a particular set of properties,\n * as well as some specific at-rules. Since they can't be encapsulated, we have to strip\n * any scoping selectors from them. For more information: https://www.w3.org/TR/css-page-3\n * ```\n */\n private _stripScopingSelectors(cssText: string): string {\n return processRules(cssText, (rule) => {\n const selector = rule.selector\n .replace(_shadowDeepSelectors, ' ')\n .replace(_polyfillHostNoCombinatorRe, ' ');\n return new CssRule(selector, rule.content);\n });\n }\n\n private _safeSelector: SafeSelector | undefined;\n private _shouldScopeIndicator: boolean | undefined;\n\n // `isParentSelector` is used to distinguish the selectors which are coming from\n // the initial selector string and any nested selectors, parsed recursively,\n // for example `selector = 'a:where(.one)'` could be the parent, while recursive call\n // would have `selector = '.one'`.\n private _scopeSelector({\n selector,\n scopeSelector,\n hostSelector,\n isParentSelector = false,\n }: {\n selector: string;\n scopeSelector: string;\n hostSelector: string;\n isParentSelector?: boolean;\n }): string {\n // Split the selector into independent parts by `,` (comma) unless\n // comma is within parenthesis, for example `:is(.one, two)`.\n // Negative lookup after comma allows not splitting inside nested parenthesis,\n // up to three levels (((,))).\n const selectorSplitRe =\n / ?,(?!(?:[^)(]*(?:\\([^)(]*(?:\\([^)(]*(?:\\([^)(]*\\)[^)(]*)*\\)[^)(]*)*\\)[^)(]*)*\\))) ?/;\n\n return selector\n .split(selectorSplitRe)\n .map((part) => part.split(_shadowDeepSelectors))\n .map((deepParts) => {\n const [shallowPart, ...otherParts] = deepParts;\n const applyScope = (shallowPart: string) => {\n if (this._selectorNeedsScoping(shallowPart, scopeSelector)) {\n return this._applySelectorScope({\n selector: shallowPart,\n scopeSelector,\n hostSelector,\n isParentSelector,\n });\n } else {\n return shallowPart;\n }\n };\n return [applyScope(shallowPart), ...otherParts].join(' ');\n })\n .join(', ');\n }\n\n private _selectorNeedsScoping(selector: string, scopeSelector: string): boolean {\n const re = this._makeScopeMatcher(scopeSelector);\n return !re.test(selector);\n }\n\n private _makeScopeMatcher(scopeSelector: string): RegExp {\n const lre = /\\[/g;\n const rre = /\\]/g;\n scopeSelector = scopeSelector.replace(lre, '\\\\[').replace(rre, '\\\\]');\n return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');\n }\n\n // scope via name and [is=name]\n private _applySimpleSelectorScope(\n selector: string,\n scopeSelector: string,\n hostSelector: string,\n ): string {\n // In Android browser, the lastIndex is not reset when the regex is used in String.replace()\n _polyfillHostRe.lastIndex = 0;\n if (_polyfillHostRe.test(selector)) {\n const replaceBy = `[${hostSelector}]`;\n let result = selector;\n while (result.match(_polyfillHostNoCombinatorRe)) {\n result = result.replace(_polyfillHostNoCombinatorRe, (_hnc, selector) => {\n return selector.replace(\n /([^:\\)]*)(:*)(.*)/,\n (_: string, before: string, colon: string, after: string) => {\n return before + replaceBy + colon + after;\n },\n );\n });\n }\n return result.replace(_polyfillHostRe, replaceBy);\n }\n\n return scopeSelector + ' ' + selector;\n }\n\n // return a selector with [name] suffix on each simple selector\n // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] /** @internal */\n private _applySelectorScope({\n selector,\n scopeSelector,\n hostSelector,\n isParentSelector,\n }: {\n selector: string;\n scopeSelector: string;\n hostSelector: string;\n isParentSelector?: boolean;\n }): string {\n const isRe = /\\[is=([^\\]]*)\\]/g;\n scopeSelector = scopeSelector.replace(isRe, (_: string, ...parts: string[]) => parts[0]);\n\n const attrName = `[${scopeSelector}]`;\n\n const _scopeSelectorPart = (p: string) => {\n let scopedP = p.trim();\n\n if (!scopedP) {\n return p;\n }\n\n if (p.includes(_polyfillHostNoCombinator)) {\n scopedP = this._applySimpleSelectorScope(p, scopeSelector, hostSelector);\n if (!p.match(_polyfillHostNoCombinatorOutsidePseudoFunction)) {\n const [_, before, colon, after] = scopedP.match(/([^:]*)(:*)([\\s\\S]*)/)!;\n scopedP = before + attrName + colon + after;\n }\n } else {\n // remove :host since it should be unnecessary\n const t = p.replace(_polyfillHostRe, '');\n if (t.length > 0) {\n const matches = t.match(/([^:]*)(:*)([\\s\\S]*)/);\n if (matches) {\n scopedP = matches[1] + attrName + matches[2] + matches[3];\n }\n }\n }\n\n return scopedP;\n };\n\n // Wraps `_scopeSelectorPart()` to not use it directly on selectors with\n // pseudo selector functions like `:where()`. Selectors within pseudo selector\n // functions are recursively sent to `_scopeSelector()`.\n const _pseudoFunctionAwareScopeSelectorPart = (selectorPart: string) => {\n let scopedPart = '';\n\n // Collect all outer `:where()` and `:is()` selectors,\n // counting parenthesis to keep nested selectors intact.\n const pseudoSelectorParts = [];\n let pseudoSelectorMatch: RegExpExecArray | null;\n while (\n (pseudoSelectorMatch = _cssPrefixWithPseudoSelectorFunction.exec(selectorPart)) !== null\n ) {\n let openedBrackets = 1;\n let index = _cssPrefixWithPseudoSelectorFunction.lastIndex;\n\n while (index < selectorPart.length) {\n const currentSymbol = selectorPart[index];\n index++;\n if (currentSymbol === '(') {\n openedBrackets++;\n continue;\n }\n if (currentSymbol === ')') {\n openedBrackets--;\n if (openedBrackets === 0) {\n break;\n }\n continue;\n }\n }\n\n pseudoSelectorParts.push(\n `${pseudoSelectorMatch[0]}${selectorPart.slice(_cssPrefixWithPseudoSelectorFunction.lastIndex, index)}`,\n );\n _cssPrefixWithPseudoSelectorFunction.lastIndex = index;\n }\n\n // If selector consists of only `:where()` and `:is()` on the outer level\n // scope those pseudo-selectors individually, otherwise scope the whole\n // selector.\n if (pseudoSelectorParts.join('') === selectorPart) {\n scopedPart = pseudoSelectorParts\n .map((selectorPart) => {\n const [cssPseudoSelectorFunction] =\n selectorPart.match(_cssPrefixWithPseudoSelectorFunction) ?? [];\n\n // Unwrap the pseudo selector to scope its contents.\n // For example,\n // - `:where(selectorToScope)` -> `selectorToScope`;\n // - `:is(.foo, .bar)` -> `.foo, .bar`.\n const selectorToScope = selectorPart.slice(cssPseudoSelectorFunction?.length, -1);\n\n if (selectorToScope.includes(_polyfillHostNoCombinator)) {\n this._shouldScopeIndicator = true;\n }\n\n const scopedInnerPart = this._scopeSelector({\n selector: selectorToScope,\n scopeSelector,\n hostSelector,\n });\n\n // Put the result back into the pseudo selector function.\n return `${cssPseudoSelectorFunction}${scopedInnerPart})`;\n })\n .join('');\n } else {\n this._shouldScopeIndicator =\n this._shouldScopeIndicator || selectorPart.includes(_polyfillHostNoCombinator);\n scopedPart = this._shouldScopeIndicator ? _scopeSelectorPart(selectorPart) : selectorPart;\n }\n\n return scopedPart;\n };\n\n if (isParentSelector) {\n this._safeSelector = new SafeSelector(selector);\n selector = this._safeSelector.content();\n }\n\n let scopedSelector = '';\n let startIndex = 0;\n let res: RegExpExecArray | null;\n // Combinators aren't used as a delimiter if they are within parenthesis,\n // for example `:where(.one .two)` stays intact.\n // Similarly to selector separation by comma initially, negative lookahead\n // is used here to not break selectors within nested parenthesis up to three\n // nested layers.\n const sep =\n /( |>|\\+|~(?!=))(?!([^)(]*(?:\\([^)(]*(?:\\([^)(]*(?:\\([^)(]*\\)[^)(]*)*\\)[^)(]*)*\\)[^)(]*)*\\)))\\s*/g;\n\n // If a selector appears before :host it should not be shimmed as it\n // matches on ancestor elements and not on elements in the host's shadow\n // `:host-context(div)` is transformed to\n // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`\n // the `div` is not part of the component in the 2nd selectors and should not be scoped.\n // Historically `component-tag:host` was matching the component so we also want to preserve\n // this behavior to avoid breaking legacy apps (it should not match).\n // The behavior should be:\n // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)\n // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a\n // `:host-context(tag)`)\n const hasHost = selector.includes(_polyfillHostNoCombinator);\n // Only scope parts after or on the same level as the first `-shadowcsshost-no-combinator`\n // when it is present. The selector has the same level when it is a part of a pseudo\n // selector, like `:where()`, for example `:where(:host, .foo)` would result in `.foo`\n // being scoped.\n if (isParentSelector || this._shouldScopeIndicator) {\n this._shouldScopeIndicator = !hasHost;\n }\n\n while ((res = sep.exec(selector)) !== null) {\n const separator = res[1];\n // Do not trim the selector, as otherwise this will break sourcemaps\n // when they are defined on multiple lines\n // Example:\n // div,\n // p { color: red}\n const part = selector.slice(startIndex, res.index);\n\n // A space following an escaped hex value and followed by another hex character\n // (ie: \".\\fc ber\" for \".über\") is not a separator between 2 selectors\n // also keep in mind that backslashes are replaced by a placeholder by SafeSelector\n // These escaped selectors happen for example when esbuild runs with optimization.minify.\n if (part.match(/__esc-ph-(\\d+)__/) && selector[res.index + 1]?.match(/[a-fA-F\\d]/)) {\n continue;\n }\n\n const scopedPart = _pseudoFunctionAwareScopeSelectorPart(part);\n scopedSelector += `${scopedPart} ${separator} `;\n startIndex = sep.lastIndex;\n }\n\n const part = selector.substring(startIndex);\n scopedSelector += _pseudoFunctionAwareScopeSelectorPart(part);\n\n // replace the placeholders with their original values\n // using values stored inside the `safeSelector` instance.\n return this._safeSelector!.restore(scopedSelector);\n }\n\n private _insertPolyfillHostInCssText(selector: string): string {\n return selector\n .replace(_colonHostContextRe, _polyfillHostContext)\n .replace(_colonHostRe, _polyfillHost);\n }\n}\n\nclass SafeSelector {\n private placeholders: string[] = [];\n private index = 0;\n private _content: string;\n\n constructor(selector: string) {\n // Replaces attribute selectors with placeholders.\n // The WS in [attr=\"va lue\"] would otherwise be interpreted as a selector separator.\n selector = this._escapeRegexMatches(selector, /(\\[[^\\]]*\\])/g);\n\n // CSS allows for certain special characters to be used in selectors if they're escaped.\n // E.g. `.foo:blue` won't match a class called `foo:blue`, because the colon denotes a\n // pseudo-class, but writing `.foo\\:blue` will match, because the colon was escaped.\n // Replace all escape sequences (`\\` followed by a character) with a placeholder so\n // that our handling of pseudo-selectors doesn't mess with them.\n // Escaped characters have a specific placeholder so they can be detected separately.\n selector = selector.replace(/(\\\\.)/g, (_, keep) => {\n const replaceBy = `__esc-ph-${this.index}__`;\n this.placeholders.push(keep);\n this.index++;\n return replaceBy;\n });\n\n // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.\n // WS and \"+\" would otherwise be interpreted as selector separators.\n this._content = selector.replace(/(:nth-[-\\w]+)(\\([^)]+\\))/g, (_, pseudo, exp) => {\n const replaceBy = `__ph-${this.index}__`;\n this.placeholders.push(exp);\n this.index++;\n return pseudo + replaceBy;\n });\n }\n\n restore(content: string): string {\n return content.replace(/__(?:ph|esc-ph)-(\\d+)__/g, (_ph, index) => this.placeholders[+index]);\n }\n\n content(): string {\n return this._content;\n }\n\n /**\n * Replaces all of the substrings that match a regex within a\n * special string (e.g. `__ph-0__`, `__ph-1__`, etc).\n */\n private _escapeRegexMatches(content: string, pattern: RegExp): string {\n return content.replace(pattern, (_, keep) => {\n const replaceBy = `__ph-${this.index}__`;\n this.placeholders.push(keep);\n this.index++;\n return replaceBy;\n });\n }\n}\n\nconst _cssScopedPseudoFunctionPrefix = '(:(where|is)\\\\()?';\nconst _cssPrefixWithPseudoSelectorFunction = /:(where|is)\\(/gi;\nconst _cssContentNextSelectorRe =\n /polyfill-next-selector[^}]*content:[\\s]*?(['\"])(.*?)\\1[;\\s]*}([^{]*?){/gim;\nconst _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\\s]*(['\"])(.*?)\\3)[;\\s]*[^}]*}/gim;\nconst _cssContentUnscopedRuleRe =\n /(polyfill-unscoped-rule)[^}]*(content:[\\s]*(['\"])(.*?)\\3)[;\\s]*[^}]*}/gim;\nconst _polyfillHost = '-shadowcsshost';\n// note: :host-context pre-processed to -shadowcsshostcontext.\nconst _polyfillHostContext = '-shadowcsscontext';\nconst _parenSuffix = '(?:\\\\((' + '(?:\\\\([^)(]*\\\\)|[^)(]*)+?' + ')\\\\))';\nconst _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix + '?([^,{]*)', 'gim');\n// note: :host-context patterns are terminated with `{`, as opposed to :host which\n// is both `{` and `,` because :host-context handles top-level commas differently.\nconst _hostContextPattern = _polyfillHostContext + _parenSuffix + '?([^{]*)';\nconst _cssColonHostContextReGlobal = new RegExp(\n `${_cssScopedPseudoFunctionPrefix}(${_hostContextPattern})`,\n 'gim',\n);\nconst _cssColonHostContextRe = new RegExp(_hostContextPattern, 'im');\nconst _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';\nconst _polyfillHostNoCombinatorOutsidePseudoFunction = new RegExp(\n `${_polyfillHostNoCombinator}(?![^(]*\\\\))`,\n 'g',\n);\nconst _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\\s,]*)/;\nconst _shadowDOMSelectorsRe = [\n /::shadow/g,\n /::content/g,\n // Deprecated selectors\n /\\/shadow-deep\\//g,\n /\\/shadow\\//g,\n];\n\n// The deep combinator is deprecated in the CSS spec\n// Support for `>>>`, `deep`, `::ng-deep` is then also deprecated and will be removed in the future.\n// see https://github.com/angular/angular/pull/17677\nconst _shadowDeepSelectors = /(?:>>>)|(?:\\/deep\\/)|(?:::ng-deep)/g;\nconst _selectorReSuffix = '([>\\\\s~+[.,{:][\\\\s\\\\S]*)?$';\nconst _polyfillHostRe = /-shadowcsshost/gim;\nconst _colonHostRe = /:host/gim;\nconst _colonHostContextRe = /:host-context/gim;\n\nconst _newLinesRe = /\\r?\\n/g;\nconst _commentRe = /\\/\\*[\\s\\S]*?\\*\\//g;\nconst _commentWithHashRe = /\\/\\*\\s*#\\s*source(Mapping)?URL=/g;\nconst COMMENT_PLACEHOLDER = '%COMMENT%';\nconst _commentWithHashPlaceHolderRe = new RegExp(COMMENT_PLACEHOLDER, 'g');\n\nconst BLOCK_PLACEHOLDER = '%BLOCK%';\nconst _ruleRe = new RegExp(\n `(\\\\s*(?:${COMMENT_PLACEHOLDER}\\\\s*)*)([^;\\\\{\\\\}]+?)(\\\\s*)((?:{%BLOCK%}?\\\\s*;?)|(?:\\\\s*;))`,\n 'g',\n);\nconst CONTENT_PAIRS = new Map([['{', '}']]);\n\nconst COMMA_IN_PLACEHOLDER = '%COMMA_IN_PLACEHOLDER%';\nconst SEMI_IN_PLACEHOLDER = '%SEMI_IN_PLACEHOLDER%';\nconst COLON_IN_PLACEHOLDER = '%COLON_IN_PLACEHOLDER%';\n\nconst _cssCommaInPlaceholderReGlobal = new RegExp(COMMA_IN_PLACEHOLDER, 'g');\nconst _cssSemiInPlaceholderReGlobal = new RegExp(SEMI_IN_PLACEHOLDER, 'g');\nconst _cssColonInPlaceholderReGlobal = new RegExp(COLON_IN_PLACEHOLDER, 'g');\n\nexport class CssRule {\n constructor(\n public selector: string,\n public content: string,\n ) {}\n}\n\nexport function processRules(input: string, ruleCallback: (rule: CssRule) => CssRule): string {\n const escaped = escapeInStrings(input);\n const inputWithEscapedBlocks = escapeBlocks(escaped, CONTENT_PAIRS, BLOCK_PLACEHOLDER);\n let nextBlockIndex = 0;\n const escapedResult = inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m: string[]) => {\n const selector = m[2];\n let content = '';\n let suffix = m[4];\n let contentPrefix = '';\n if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {\n content = inputWithEscapedBlocks.blocks[nextBlockIndex++];\n suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);\n contentPrefix = '{';\n }\n const rule = ruleCallback(new CssRule(selector, content));\n return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;\n });\n return unescapeInStrings(escapedResult);\n}\n\nclass StringWithEscapedBlocks {\n constructor(\n public escapedString: string,\n public blocks: string[],\n ) {}\n}\n\nfunction escapeBlocks(\n input: string,\n charPairs: Map,\n placeholder: string,\n): StringWithEscapedBlocks {\n const resultParts: string[] = [];\n const escapedBlocks: string[] = [];\n let openCharCount = 0;\n let nonBlockStartIndex = 0;\n let blockStartIndex = -1;\n let openChar: string | undefined;\n let closeChar: string | undefined;\n\n for (let i = 0; i < input.length; i++) {\n const char = input[i];\n if (char === '\\\\') {\n i++;\n } else if (char === closeChar) {\n openCharCount--;\n if (openCharCount === 0) {\n escapedBlocks.push(input.substring(blockStartIndex, i));\n resultParts.push(placeholder);\n nonBlockStartIndex = i;\n blockStartIndex = -1;\n openChar = closeChar = undefined;\n }\n } else if (char === openChar) {\n openCharCount++;\n } else if (openCharCount === 0 && charPairs.has(char)) {\n openChar = char;\n closeChar = charPairs.get(char);\n openCharCount = 1;\n blockStartIndex = i + 1;\n resultParts.push(input.substring(nonBlockStartIndex, blockStartIndex));\n }\n }\n\n if (blockStartIndex !== -1) {\n escapedBlocks.push(input.substring(blockStartIndex));\n resultParts.push(placeholder);\n } else {\n resultParts.push(input.substring(nonBlockStartIndex));\n }\n\n return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);\n}\n\n/**\n * Object containing as keys characters that should be substituted by placeholders\n * when found in strings during the css text parsing, and as values the respective\n * placeholders\n */\nconst ESCAPE_IN_STRING_MAP: {[key: string]: string} = {\n ';': SEMI_IN_PLACEHOLDER,\n ',': COMMA_IN_PLACEHOLDER,\n ':': COLON_IN_PLACEHOLDER,\n};\n\n/**\n * Parse the provided css text and inside strings (meaning, inside pairs of unescaped single or\n * double quotes) replace specific characters with their respective placeholders as indicated\n * by the `ESCAPE_IN_STRING_MAP` map.\n *\n * For example convert the text\n * `animation: \"my-anim:at\\\"ion\" 1s;`\n * to\n * `animation: \"my-anim%COLON_IN_PLACEHOLDER%at\\\"ion\" 1s;`\n *\n * This is necessary in order to remove the meaning of some characters when found inside strings\n * (for example `;` indicates the end of a css declaration, `,` the sequence of values and `:` the\n * division between property and value during a declaration, none of these meanings apply when such\n * characters are within strings and so in order to prevent parsing issues they need to be replaced\n * with placeholder text for the duration of the css manipulation process).\n *\n * @param input the original css text.\n *\n * @returns the css text with specific characters in strings replaced by placeholders.\n **/\nfunction escapeInStrings(input: string): string {\n let result = input;\n let currentQuoteChar: string | null = null;\n for (let i = 0; i < result.length; i++) {\n const char = result[i];\n if (char === '\\\\') {\n i++;\n } else {\n if (currentQuoteChar !== null) {\n // index i is inside a quoted sub-string\n if (char === currentQuoteChar) {\n currentQuoteChar = null;\n } else {\n const placeholder: string | undefined = ESCAPE_IN_STRING_MAP[char];\n if (placeholder) {\n result = `${result.substr(0, i)}${placeholder}${result.substr(i + 1)}`;\n i += placeholder.length - 1;\n }\n }\n } else if (char === \"'\" || char === '\"') {\n currentQuoteChar = char;\n }\n }\n }\n return result;\n}\n\n/**\n * Replace in a string all occurrences of keys in the `ESCAPE_IN_STRING_MAP` map with their\n * original representation, this is simply used to revert the changes applied by the\n * escapeInStrings function.\n *\n * For example it reverts the text:\n * `animation: \"my-anim%COLON_IN_PLACEHOLDER%at\\\"ion\" 1s;`\n * to it's original form of:\n * `animation: \"my-anim:at\\\"ion\" 1s;`\n *\n * Note: For the sake of simplicity this function does not check that the placeholders are\n * actually inside strings as it would anyway be extremely unlikely to find them outside of strings.\n *\n * @param input the css text containing the placeholders.\n *\n * @returns the css text without the placeholders.\n */\nfunction unescapeInStrings(input: string): string {\n let result = input.replace(_cssCommaInPlaceholderReGlobal, ',');\n result = result.replace(_cssSemiInPlaceholderReGlobal, ';');\n result = result.replace(_cssColonInPlaceholderReGlobal, ':');\n return result;\n}\n\n/**\n * Unescape all quotes present in a string, but only if the string was actually already\n * quoted.\n *\n * This generates a \"canonical\" representation of strings which can be used to match strings\n * which would otherwise only differ because of differently escaped quotes.\n *\n * For example it converts the string (assumed to be quoted):\n * `this \\\\\"is\\\\\" a \\\\'\\\\\\\\'test`\n * to:\n * `this \"is\" a '\\\\\\\\'test`\n * (note that the latter backslashes are not removed as they are not actually escaping the single\n * quote)\n *\n *\n * @param input the string possibly containing escaped quotes.\n * @param isQuoted boolean indicating whether the string was quoted inside a bigger string (if not\n * then it means that it doesn't represent an inner string and thus no unescaping is required)\n *\n * @returns the string in the \"canonical\" representation without escaped quotes.\n */\nfunction unescapeQuotes(str: string, isQuoted: boolean): string {\n return !isQuoted ? str : str.replace(/((?:^|[^\\\\])(?:\\\\\\\\)*)\\\\(?=['\"])/g, '$1');\n}\n\n/**\n * Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors`\n * to create a selector that matches the same as `:host-context()`.\n *\n * Given a single context selector `A` we need to output selectors that match on the host and as an\n * ancestor of the host:\n *\n * ```\n * A , A {}\n * ```\n *\n * When there is more than one context selector we also have to create combinations of those\n * selectors with each other. For example if there are `A` and `B` selectors the output is:\n *\n * ```\n * AB, AB , A B,\n * B A, A B , B A {}\n * ```\n *\n * And so on...\n *\n * @param contextSelectors an array of context selectors that will be combined.\n * @param otherSelectors the rest of the selectors that are not context selectors.\n */\nfunction _combineHostContextSelectors(\n contextSelectors: string[],\n otherSelectors: string,\n pseudoPrefix = '',\n): string {\n const hostMarker = _polyfillHostNoCombinator;\n _polyfillHostRe.lastIndex = 0; // reset the regex to ensure we get an accurate test\n const otherSelectorsHasHost = _polyfillHostRe.test(otherSelectors);\n\n // If there are no context selectors then just output a host marker\n if (contextSelectors.length === 0) {\n return hostMarker + otherSelectors;\n }\n\n const combined: string[] = [contextSelectors.pop() || ''];\n while (contextSelectors.length > 0) {\n const length = combined.length;\n const contextSelector = contextSelectors.pop();\n for (let i = 0; i < length; i++) {\n const previousSelectors = combined[i];\n // Add the new selector as a descendant of the previous selectors\n combined[length * 2 + i] = previousSelectors + ' ' + contextSelector;\n // Add the new selector as an ancestor of the previous selectors\n combined[length + i] = contextSelector + ' ' + previousSelectors;\n // Add the new selector to act on the same element as the previous selectors\n combined[i] = contextSelector + previousSelectors;\n }\n }\n // Finally connect the selector to the `hostMarker`s: either acting directly on the host\n // (A) or as an ancestor (A ).\n return combined\n .map((s) =>\n otherSelectorsHasHost\n ? `${pseudoPrefix}${s}${otherSelectors}`\n : `${pseudoPrefix}${s}${hostMarker}${otherSelectors}, ${pseudoPrefix}${s} ${hostMarker}${otherSelectors}`,\n )\n .join(',');\n}\n\n/**\n * Mutate the given `groups` array so that there are `multiples` clones of the original array\n * stored.\n *\n * For example `repeatGroups([a, b], 3)` will result in `[a, b, a, b, a, b]` - but importantly the\n * newly added groups will be clones of the original.\n *\n * @param groups An array of groups of strings that will be repeated. This array is mutated\n * in-place.\n * @param multiples The number of times the current groups should appear.\n */\nexport function repeatGroups(groups: string[][], multiples: number): void {\n const length = groups.length;\n for (let i = 1; i < multiples; i++) {\n for (let j = 0; j < length; j++) {\n groups[j + i * length] = groups[j].slice(0);\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Distinguishes different kinds of IR operations.\n *\n * Includes both creation and update operations.\n */\nexport enum OpKind {\n /**\n * A special operation type which is used to represent the beginning and end nodes of a linked\n * list of operations.\n */\n ListEnd,\n\n /**\n * An operation which wraps an output AST statement.\n */\n Statement,\n\n /**\n * An operation which declares and initializes a `SemanticVariable`.\n */\n Variable,\n\n /**\n * An operation to begin rendering of an element.\n */\n ElementStart,\n\n /**\n * An operation to render an element with no children.\n */\n Element,\n\n /**\n * An operation which declares an embedded view.\n */\n Template,\n\n /**\n * An operation to end rendering of an element previously started with `ElementStart`.\n */\n ElementEnd,\n\n /**\n * An operation to begin an `ng-container`.\n */\n ContainerStart,\n\n /**\n * An operation for an `ng-container` with no children.\n */\n Container,\n\n /**\n * An operation to end an `ng-container`.\n */\n ContainerEnd,\n\n /**\n * An operation disable binding for subsequent elements, which are descendants of a non-bindable\n * node.\n */\n DisableBindings,\n\n /**\n * An op to conditionally render a template.\n */\n Conditional,\n\n /**\n * An operation to re-enable binding, after it was previously disabled.\n */\n EnableBindings,\n\n /**\n * An operation to render a text node.\n */\n Text,\n\n /**\n * An operation declaring an event listener for an element.\n */\n Listener,\n\n /**\n * An operation to interpolate text into a text node.\n */\n InterpolateText,\n\n /**\n * An intermediate binding op, that has not yet been processed into an individual property,\n * attribute, style, etc.\n */\n Binding,\n\n /**\n * An operation to bind an expression to a property of an element.\n */\n Property,\n\n /**\n * An operation to bind an expression to a style property of an element.\n */\n StyleProp,\n\n /**\n * An operation to bind an expression to a class property of an element.\n */\n ClassProp,\n\n /**\n * An operation to bind an expression to the styles of an element.\n */\n StyleMap,\n\n /**\n * An operation to bind an expression to the classes of an element.\n */\n ClassMap,\n\n /**\n * An operation to advance the runtime's implicit slot context during the update phase of a view.\n */\n Advance,\n\n /**\n * An operation to instantiate a pipe.\n */\n Pipe,\n\n /**\n * An operation to associate an attribute with an element.\n */\n Attribute,\n\n /**\n * An attribute that has been extracted for inclusion in the consts array.\n */\n ExtractedAttribute,\n\n /**\n * An operation that configures a `@defer` block.\n */\n Defer,\n\n /**\n * An operation that controls when a `@defer` loads.\n */\n DeferOn,\n\n /**\n * An operation that controls when a `@defer` loads, using a custom expression as the condition.\n */\n DeferWhen,\n\n /**\n * An i18n message that has been extracted for inclusion in the consts array.\n */\n I18nMessage,\n\n /**\n * A host binding property.\n */\n HostProperty,\n\n /**\n * A namespace change, which causes the subsequent elements to be processed as either HTML or SVG.\n */\n Namespace,\n\n /**\n * Configure a content projeciton definition for the view.\n */\n ProjectionDef,\n\n /**\n * Create a content projection slot.\n */\n Projection,\n\n /**\n * Create a repeater creation instruction op.\n */\n RepeaterCreate,\n\n /**\n * An update up for a repeater.\n */\n Repeater,\n\n /**\n * An operation to bind an expression to the property side of a two-way binding.\n */\n TwoWayProperty,\n\n /**\n * An operation declaring the event side of a two-way binding.\n */\n TwoWayListener,\n\n /**\n * A creation-time operation that initializes the slot for a `@let` declaration.\n */\n DeclareLet,\n\n /**\n * An update-time operation that stores the current value of a `@let` declaration.\n */\n StoreLet,\n\n /**\n * The start of an i18n block.\n */\n I18nStart,\n\n /**\n * A self-closing i18n on a single element.\n */\n I18n,\n\n /**\n * The end of an i18n block.\n */\n I18nEnd,\n\n /**\n * An expression in an i18n message.\n */\n I18nExpression,\n\n /**\n * An instruction that applies a set of i18n expressions.\n */\n I18nApply,\n\n /**\n * An instruction to create an ICU expression.\n */\n IcuStart,\n\n /**\n * An instruction to update an ICU expression.\n */\n IcuEnd,\n\n /**\n * An instruction representing a placeholder in an ICU expression.\n */\n IcuPlaceholder,\n\n /**\n * An i18n context containing information needed to generate an i18n message.\n */\n I18nContext,\n\n /**\n * A creation op that corresponds to i18n attributes on an element.\n */\n I18nAttributes,\n\n /**\n * Creation op that attaches the location at which an element was defined in a template to it.\n */\n SourceLocation,\n}\n\n/**\n * Distinguishes different kinds of IR expressions.\n */\nexport enum ExpressionKind {\n /**\n * Read of a variable in a lexical scope.\n */\n LexicalRead,\n\n /**\n * A reference to the current view context.\n */\n Context,\n\n /**\n * A reference to the view context, for use inside a track function.\n */\n TrackContext,\n\n /**\n * Read of a variable declared in a `VariableOp`.\n */\n ReadVariable,\n\n /**\n * Runtime operation to navigate to the next view context in the view hierarchy.\n */\n NextContext,\n\n /**\n * Runtime operation to retrieve the value of a local reference.\n */\n Reference,\n\n /**\n * A call storing the value of a `@let` declaration.\n */\n StoreLet,\n\n /**\n * A reference to a `@let` declaration read from the context view.\n */\n ContextLetReference,\n\n /**\n * Runtime operation to snapshot the current view context.\n */\n GetCurrentView,\n\n /**\n * Runtime operation to restore a snapshotted view.\n */\n RestoreView,\n\n /**\n * Runtime operation to reset the current view context after `RestoreView`.\n */\n ResetView,\n\n /**\n * Defines and calls a function with change-detected arguments.\n */\n PureFunctionExpr,\n\n /**\n * Indicates a positional parameter to a pure function definition.\n */\n PureFunctionParameterExpr,\n\n /**\n * Binding to a pipe transformation.\n */\n PipeBinding,\n\n /**\n * Binding to a pipe transformation with a variable number of arguments.\n */\n PipeBindingVariadic,\n\n /*\n * A safe property read requiring expansion into a null check.\n */\n SafePropertyRead,\n\n /**\n * A safe keyed read requiring expansion into a null check.\n */\n SafeKeyedRead,\n\n /**\n * A safe function call requiring expansion into a null check.\n */\n SafeInvokeFunction,\n\n /**\n * An intermediate expression that will be expanded from a safe read into an explicit ternary.\n */\n SafeTernaryExpr,\n\n /**\n * An empty expression that will be stipped before generating the final output.\n */\n EmptyExpr,\n\n /*\n * An assignment to a temporary variable.\n */\n AssignTemporaryExpr,\n\n /**\n * A reference to a temporary variable.\n */\n ReadTemporaryExpr,\n\n /**\n * An expression that will cause a literal slot index to be emitted.\n */\n SlotLiteralExpr,\n\n /**\n * A test expression for a conditional op.\n */\n ConditionalCase,\n\n /**\n * An expression that will be automatically extracted to the component const array.\n */\n ConstCollected,\n\n /**\n * Operation that sets the value of a two-way binding.\n */\n TwoWayBindingSet,\n}\n\nexport enum VariableFlags {\n None = 0b0000,\n\n /**\n * Always inline this variable, regardless of the number of times it's used.\n * An `AlwaysInline` variable may not depend on context, because doing so may cause side effects\n * that are illegal when multi-inlined. (The optimizer will enforce this constraint.)\n */\n AlwaysInline = 0b0001,\n}\n/**\n * Distinguishes between different kinds of `SemanticVariable`s.\n */\nexport enum SemanticVariableKind {\n /**\n * Represents the context of a particular view.\n */\n Context,\n\n /**\n * Represents an identifier declared in the lexical scope of a view.\n */\n Identifier,\n\n /**\n * Represents a saved state that can be used to restore a view in a listener handler function.\n */\n SavedView,\n\n /**\n * An alias generated by a special embedded view type (e.g. a `@for` block).\n */\n Alias,\n}\n\n/**\n * Whether to compile in compatibilty mode. In compatibility mode, the template pipeline will\n * attempt to match the output of `TemplateDefinitionBuilder` as exactly as possible, at the cost\n * of producing quirky or larger code in some cases.\n */\nexport enum CompatibilityMode {\n Normal,\n TemplateDefinitionBuilder,\n}\n\n/**\n * Enumeration of the types of attributes which can be applied to an element.\n */\nexport enum BindingKind {\n /**\n * Static attributes.\n */\n Attribute,\n\n /**\n * Class bindings.\n */\n ClassName,\n\n /**\n * Style bindings.\n */\n StyleProperty,\n\n /**\n * Dynamic property bindings.\n */\n Property,\n\n /**\n * Property or attribute bindings on a template.\n */\n Template,\n\n /**\n * Internationalized attributes.\n */\n I18n,\n\n /**\n * Animation property bindings.\n */\n Animation,\n\n /**\n * Property side of a two-way binding.\n */\n TwoWayProperty,\n}\n\n/**\n * Enumeration of possible times i18n params can be resolved.\n */\nexport enum I18nParamResolutionTime {\n /**\n * Param is resolved at message creation time. Most params should be resolved at message creation\n * time. However, ICU params need to be handled in post-processing.\n */\n Creation,\n\n /**\n * Param is resolved during post-processing. This should be used for params whose value comes from\n * an ICU.\n */\n Postproccessing,\n}\n\n/**\n * The contexts in which an i18n expression can be used.\n */\nexport enum I18nExpressionFor {\n /**\n * This expression is used as a value (i.e. inside an i18n block).\n */\n I18nText,\n\n /**\n * This expression is used in a binding.\n */\n I18nAttribute,\n}\n\n/**\n * Flags that describe what an i18n param value. These determine how the value is serialized into\n * the final map.\n */\nexport enum I18nParamValueFlags {\n None = 0b0000,\n\n /**\n * This value represents an element tag.\n */\n ElementTag = 0b1,\n\n /**\n * This value represents a template tag.\n */\n TemplateTag = 0b10,\n\n /**\n * This value represents the opening of a tag.\n */\n OpenTag = 0b0100,\n\n /**\n * This value represents the closing of a tag.\n */\n CloseTag = 0b1000,\n\n /**\n * This value represents an i18n expression index.\n */\n ExpressionIndex = 0b10000,\n}\n\n/**\n * Whether the active namespace is HTML, MathML, or SVG mode.\n */\nexport enum Namespace {\n HTML,\n SVG,\n Math,\n}\n\n/**\n * The type of a `@defer` trigger, for use in the ir.\n */\nexport enum DeferTriggerKind {\n Idle,\n Immediate,\n Timer,\n Hover,\n Interaction,\n Viewport,\n Never,\n}\n\n/**\n * Kinds of i18n contexts. They can be created because of root i18n blocks, or ICUs.\n */\nexport enum I18nContextKind {\n RootI18n,\n Icu,\n Attr,\n}\n\nexport enum TemplateKind {\n NgTemplate,\n Structural,\n Block,\n}\n\n/**\n * Kinds of modifiers for a defer block.\n */\nexport const enum DeferOpModifierKind {\n NONE = 'none',\n PREFETCH = 'prefetch',\n HYDRATE = 'hydrate',\n}\n\n/**\n * Specifies defer block flags, which should be used for all\n * instances of a given defer block (the flags that should be\n * placed into the `TDeferDetails` at runtime).\n */\nexport const enum TDeferDetailsFlags {\n Default = 0,\n\n /**\n * Whether or not the defer block has hydrate triggers.\n */\n HasHydrateTriggers = 1 << 0,\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport type {ParseSourceSpan} from '../../../../parse_util';\nimport type {Expression} from './expression';\nimport * as o from '../../../../output/output_ast';\nimport type {Op, XrefId} from './operations';\nimport {SlotHandle} from './handle';\n\n/**\n * Marker symbol for `ConsumesSlotOpTrait`.\n */\nexport const ConsumesSlot: unique symbol = Symbol('ConsumesSlot');\n\n/**\n * Marker symbol for `DependsOnSlotContextOpTrait`.\n */\nexport const DependsOnSlotContext: unique symbol = Symbol('DependsOnSlotContext');\n\n/**\n * Marker symbol for `ConsumesVars` trait.\n */\nexport const ConsumesVarsTrait: unique symbol = Symbol('ConsumesVars');\n\n/**\n * Marker symbol for `UsesVarOffset` trait.\n */\nexport const UsesVarOffset: unique symbol = Symbol('UsesVarOffset');\n\n/**\n * Marks an operation as requiring allocation of one or more data slots for storage.\n */\nexport interface ConsumesSlotOpTrait {\n readonly [ConsumesSlot]: true;\n\n /**\n * Assigned data slot (the starting index, if more than one slot is needed) for this operation, or\n * `null` if slots have not yet been assigned.\n */\n handle: SlotHandle;\n\n /**\n * The number of slots which will be used by this operation. By default 1, but can be increased if\n * necessary.\n */\n numSlotsUsed: number;\n\n /**\n * `XrefId` of this operation (e.g. the element stored in the assigned slot). This `XrefId` is\n * used to link this `ConsumesSlotOpTrait` operation with `DependsOnSlotContextTrait` or\n * `UsesSlotIndexExprTrait` implementors and ensure that the assigned slot is propagated through\n * the IR to all consumers.\n */\n xref: XrefId;\n}\n\n/**\n * Marks an operation as depending on the runtime's implicit slot context being set to a particular\n * slot.\n *\n * The runtime has an implicit slot context which is adjusted using the `advance()` instruction\n * during the execution of template update functions. This trait marks an operation as requiring\n * this implicit context to be `advance()`'d to point at a particular slot prior to execution.\n */\nexport interface DependsOnSlotContextOpTrait {\n readonly [DependsOnSlotContext]: true;\n\n /**\n * `XrefId` of the `ConsumesSlotOpTrait` which the implicit slot context must reference before\n * this operation can be executed.\n */\n target: XrefId;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Marker trait indicating that an operation or expression consumes variable storage space.\n */\nexport interface ConsumesVarsTrait {\n [ConsumesVarsTrait]: true;\n}\n\n/**\n * Marker trait indicating that an expression requires knowledge of the number of variable storage\n * slots used prior to it.\n */\nexport interface UsesVarOffsetTrait {\n [UsesVarOffset]: true;\n\n varOffset: number | null;\n}\n\n/**\n * Default values for most `ConsumesSlotOpTrait` fields (used with the spread operator to initialize\n * implementors of the trait).\n */\nexport const TRAIT_CONSUMES_SLOT: Omit = {\n [ConsumesSlot]: true,\n numSlotsUsed: 1,\n} as const;\n\n/**\n * Default values for most `DependsOnSlotContextOpTrait` fields (used with the spread operator to\n * initialize implementors of the trait).\n */\nexport const TRAIT_DEPENDS_ON_SLOT_CONTEXT: Omit<\n DependsOnSlotContextOpTrait,\n 'target' | 'sourceSpan'\n> = {\n [DependsOnSlotContext]: true,\n} as const;\n\n/**\n * Default values for `UsesVars` fields (used with the spread operator to initialize\n * implementors of the trait).\n */\nexport const TRAIT_CONSUMES_VARS: ConsumesVarsTrait = {\n [ConsumesVarsTrait]: true,\n} as const;\n\n/**\n * Test whether an operation implements `ConsumesSlotOpTrait`.\n */\nexport function hasConsumesSlotTrait>(\n op: OpT,\n): op is OpT & ConsumesSlotOpTrait {\n return (op as Partial)[ConsumesSlot] === true;\n}\n\n/**\n * Test whether an operation implements `DependsOnSlotContextOpTrait`.\n */\nexport function hasDependsOnSlotContextTrait(\n expr: ExprT,\n): expr is ExprT & DependsOnSlotContextOpTrait;\nexport function hasDependsOnSlotContextTrait>(\n op: OpT,\n): op is OpT & DependsOnSlotContextOpTrait;\nexport function hasDependsOnSlotContextTrait(value: any): boolean {\n return (value as Partial)[DependsOnSlotContext] === true;\n}\n\n/**\n * Test whether an operation implements `ConsumesVarsTrait`.\n */\nexport function hasConsumesVarsTrait(\n expr: ExprT,\n): expr is ExprT & ConsumesVarsTrait;\nexport function hasConsumesVarsTrait>(op: OpT): op is OpT & ConsumesVarsTrait;\nexport function hasConsumesVarsTrait(value: any): boolean {\n return (value as Partial)[ConsumesVarsTrait] === true;\n}\n\n/**\n * Test whether an expression implements `UsesVarOffsetTrait`.\n */\nexport function hasUsesVarOffsetTrait(\n expr: ExprT,\n): expr is ExprT & UsesVarOffsetTrait {\n return (expr as Partial)[UsesVarOffset] === true;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../../output/output_ast';\nimport {OpKind, VariableFlags} from '../enums';\nimport {Op, XrefId} from '../operations';\nimport {SemanticVariable} from '../variable';\n\n/**\n * A special `Op` which is used internally in the `OpList` linked list to represent the head and\n * tail nodes of the list.\n *\n * `ListEndOp` is created internally in the `OpList` and should not be instantiated directly.\n */\nexport interface ListEndOp> extends Op {\n kind: OpKind.ListEnd;\n}\n\n/**\n * An `Op` which directly wraps an output `Statement`.\n *\n * Often `StatementOp`s are the final result of IR processing.\n */\nexport interface StatementOp> extends Op {\n kind: OpKind.Statement;\n\n /**\n * The output statement.\n */\n statement: o.Statement;\n}\n\n/**\n * Create a `StatementOp`.\n */\nexport function createStatementOp>(statement: o.Statement): StatementOp {\n return {\n kind: OpKind.Statement,\n statement,\n ...NEW_OP,\n };\n}\n\n/**\n * Operation which declares and initializes a `SemanticVariable`, that is valid either in create or\n * update IR.\n */\nexport interface VariableOp> extends Op {\n kind: OpKind.Variable;\n\n /**\n * `XrefId` which identifies this specific variable, and is used to reference this variable from\n * other parts of the IR.\n */\n xref: XrefId;\n\n /**\n * The `SemanticVariable` which describes the meaning behind this variable.\n */\n variable: SemanticVariable;\n\n /**\n * Expression representing the value of the variable.\n */\n initializer: o.Expression;\n\n flags: VariableFlags;\n}\n\n/**\n * Create a `VariableOp`.\n */\nexport function createVariableOp>(\n xref: XrefId,\n variable: SemanticVariable,\n initializer: o.Expression,\n flags: VariableFlags,\n): VariableOp {\n return {\n kind: OpKind.Variable,\n xref,\n variable,\n initializer,\n flags,\n ...NEW_OP,\n };\n}\n\n/**\n * Static structure shared by all operations.\n *\n * Used as a convenience via the spread operator (`...NEW_OP`) when creating new operations, and\n * ensures the fields are always in the same order.\n */\nexport const NEW_OP: Pick, 'debugListId' | 'prev' | 'next'> = {\n debugListId: null,\n prev: null,\n next: null,\n};\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SecurityContext} from '../../../../../core';\nimport * as i18n from '../../../../../i18n/i18n_ast';\nimport * as o from '../../../../../output/output_ast';\nimport {ParseSourceSpan} from '../../../../../parse_util';\nimport {\n BindingKind,\n DeferOpModifierKind,\n I18nExpressionFor,\n I18nParamResolutionTime,\n OpKind,\n TemplateKind,\n} from '../enums';\nimport type {ConditionalCaseExpr} from '../expression';\nimport {SlotHandle} from '../handle';\nimport {Op, XrefId} from '../operations';\nimport {\n ConsumesVarsTrait,\n DependsOnSlotContextOpTrait,\n TRAIT_CONSUMES_VARS,\n TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n} from '../traits';\nimport type {HostPropertyOp} from './host';\nimport {ListEndOp, NEW_OP, StatementOp, VariableOp} from './shared';\n\n/**\n * An operation usable on the update side of the IR.\n */\nexport type UpdateOp =\n | ListEndOp\n | StatementOp\n | PropertyOp\n | TwoWayPropertyOp\n | AttributeOp\n | StylePropOp\n | ClassPropOp\n | StyleMapOp\n | ClassMapOp\n | InterpolateTextOp\n | AdvanceOp\n | VariableOp\n | BindingOp\n | HostPropertyOp\n | ConditionalOp\n | I18nExpressionOp\n | I18nApplyOp\n | RepeaterOp\n | DeferWhenOp\n | StoreLetOp;\n\n/**\n * A logical operation to perform string interpolation on a text node.\n *\n * Interpolation inputs are stored as static `string`s and dynamic `o.Expression`s, in separate\n * arrays. Thus, the interpolation `A{{b}}C{{d}}E` is stored as 3 static strings `['A', 'C', 'E']`\n * and 2 dynamic expressions `[b, d]`.\n */\nexport interface InterpolateTextOp extends Op, ConsumesVarsTrait {\n kind: OpKind.InterpolateText;\n\n /**\n * Reference to the text node to which the interpolation is bound.\n */\n target: XrefId;\n\n /**\n * The interpolated value.\n */\n interpolation: Interpolation;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create an `InterpolationTextOp`.\n */\nexport function createInterpolateTextOp(\n xref: XrefId,\n interpolation: Interpolation,\n sourceSpan: ParseSourceSpan,\n): InterpolateTextOp {\n return {\n kind: OpKind.InterpolateText,\n target: xref,\n interpolation,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n\nexport class Interpolation {\n constructor(\n readonly strings: string[],\n readonly expressions: o.Expression[],\n readonly i18nPlaceholders: string[],\n ) {\n if (i18nPlaceholders.length !== 0 && i18nPlaceholders.length !== expressions.length) {\n throw new Error(\n `Expected ${expressions.length} placeholders to match interpolation expression count, but got ${i18nPlaceholders.length}`,\n );\n }\n }\n}\n\n/**\n * An intermediate binding op, that has not yet been processed into an individual property,\n * attribute, style, etc.\n */\nexport interface BindingOp extends Op {\n kind: OpKind.Binding;\n\n /**\n * Reference to the element on which the property is bound.\n */\n target: XrefId;\n\n /**\n * The kind of binding represented by this op.\n */\n bindingKind: BindingKind;\n\n /**\n * The name of this binding.\n */\n name: string;\n\n /**\n * Expression which is bound to the property.\n */\n expression: o.Expression | Interpolation;\n\n /**\n * The unit of the bound value.\n */\n unit: string | null;\n\n /**\n * The security context of the binding.\n */\n securityContext: SecurityContext | SecurityContext[];\n\n /**\n * Whether the binding is a TextAttribute (e.g. `some-attr=\"some-value\"`).\n *\n * This needs to be tracked for compatibility with `TemplateDefinitionBuilder` which treats\n * `style` and `class` TextAttributes differently from `[attr.style]` and `[attr.class]`.\n */\n isTextAttribute: boolean;\n\n isStructuralTemplateAttribute: boolean;\n\n /**\n * Whether this binding is on a structural template.\n */\n templateKind: TemplateKind | null;\n\n i18nContext: XrefId | null;\n i18nMessage: i18n.Message | null;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create a `BindingOp`, not yet transformed into a particular type of binding.\n */\nexport function createBindingOp(\n target: XrefId,\n kind: BindingKind,\n name: string,\n expression: o.Expression | Interpolation,\n unit: string | null,\n securityContext: SecurityContext | SecurityContext[],\n isTextAttribute: boolean,\n isStructuralTemplateAttribute: boolean,\n templateKind: TemplateKind | null,\n i18nMessage: i18n.Message | null,\n sourceSpan: ParseSourceSpan,\n): BindingOp {\n return {\n kind: OpKind.Binding,\n bindingKind: kind,\n target,\n name,\n expression,\n unit,\n securityContext,\n isTextAttribute,\n isStructuralTemplateAttribute,\n templateKind,\n i18nContext: null,\n i18nMessage,\n sourceSpan,\n ...NEW_OP,\n };\n}\n\n/**\n * A logical operation representing binding to a property in the update IR.\n */\nexport interface PropertyOp extends Op, ConsumesVarsTrait, DependsOnSlotContextOpTrait {\n kind: OpKind.Property;\n\n /**\n * Reference to the element on which the property is bound.\n */\n target: XrefId;\n\n /**\n * Name of the bound property.\n */\n name: string;\n\n /**\n * Expression which is bound to the property.\n */\n expression: o.Expression | Interpolation;\n\n /**\n * Whether this property is an animation trigger.\n */\n isAnimationTrigger: boolean;\n\n /**\n * The security context of the binding.\n */\n securityContext: SecurityContext | SecurityContext[];\n\n /**\n * The sanitizer for this property.\n */\n sanitizer: o.Expression | null;\n\n isStructuralTemplateAttribute: boolean;\n\n /**\n * The kind of template targeted by the binding, or null if this binding does not target a\n * template.\n */\n templateKind: TemplateKind | null;\n\n i18nContext: XrefId | null;\n i18nMessage: i18n.Message | null;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create a `PropertyOp`.\n */\nexport function createPropertyOp(\n target: XrefId,\n name: string,\n expression: o.Expression | Interpolation,\n isAnimationTrigger: boolean,\n securityContext: SecurityContext | SecurityContext[],\n isStructuralTemplateAttribute: boolean,\n templateKind: TemplateKind | null,\n i18nContext: XrefId | null,\n i18nMessage: i18n.Message | null,\n sourceSpan: ParseSourceSpan,\n): PropertyOp {\n return {\n kind: OpKind.Property,\n target,\n name,\n expression,\n isAnimationTrigger,\n securityContext,\n sanitizer: null,\n isStructuralTemplateAttribute,\n templateKind,\n i18nContext,\n i18nMessage,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n\n/**\n * A logical operation representing the property binding side of a two-way binding in the update IR.\n */\nexport interface TwoWayPropertyOp\n extends Op,\n ConsumesVarsTrait,\n DependsOnSlotContextOpTrait {\n kind: OpKind.TwoWayProperty;\n\n /**\n * Reference to the element on which the property is bound.\n */\n target: XrefId;\n\n /**\n * Name of the property.\n */\n name: string;\n\n /**\n * Expression which is bound to the property.\n */\n expression: o.Expression;\n\n /**\n * The security context of the binding.\n */\n securityContext: SecurityContext | SecurityContext[];\n\n /**\n * The sanitizer for this property.\n */\n sanitizer: o.Expression | null;\n\n isStructuralTemplateAttribute: boolean;\n\n /**\n * The kind of template targeted by the binding, or null if this binding does not target a\n * template.\n */\n templateKind: TemplateKind | null;\n\n i18nContext: XrefId | null;\n i18nMessage: i18n.Message | null;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create a `TwoWayPropertyOp`.\n */\nexport function createTwoWayPropertyOp(\n target: XrefId,\n name: string,\n expression: o.Expression,\n securityContext: SecurityContext | SecurityContext[],\n isStructuralTemplateAttribute: boolean,\n templateKind: TemplateKind | null,\n i18nContext: XrefId | null,\n i18nMessage: i18n.Message | null,\n sourceSpan: ParseSourceSpan,\n): TwoWayPropertyOp {\n return {\n kind: OpKind.TwoWayProperty,\n target,\n name,\n expression,\n securityContext,\n sanitizer: null,\n isStructuralTemplateAttribute,\n templateKind,\n i18nContext,\n i18nMessage,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n\n/**\n * A logical operation representing binding to a style property in the update IR.\n */\nexport interface StylePropOp extends Op, ConsumesVarsTrait, DependsOnSlotContextOpTrait {\n kind: OpKind.StyleProp;\n\n /**\n * Reference to the element on which the property is bound.\n */\n target: XrefId;\n\n /**\n * Name of the bound property.\n */\n name: string;\n\n /**\n * Expression which is bound to the property.\n */\n expression: o.Expression | Interpolation;\n\n /**\n * The unit of the bound value.\n */\n unit: string | null;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/** Create a `StylePropOp`. */\nexport function createStylePropOp(\n xref: XrefId,\n name: string,\n expression: o.Expression | Interpolation,\n unit: string | null,\n sourceSpan: ParseSourceSpan,\n): StylePropOp {\n return {\n kind: OpKind.StyleProp,\n target: xref,\n name,\n expression,\n unit,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n\n/**\n * A logical operation representing binding to a class property in the update IR.\n */\nexport interface ClassPropOp extends Op, ConsumesVarsTrait, DependsOnSlotContextOpTrait {\n kind: OpKind.ClassProp;\n\n /**\n * Reference to the element on which the property is bound.\n */\n target: XrefId;\n\n /**\n * Name of the bound property.\n */\n name: string;\n\n /**\n * Expression which is bound to the property.\n */\n expression: o.Expression;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create a `ClassPropOp`.\n */\nexport function createClassPropOp(\n xref: XrefId,\n name: string,\n expression: o.Expression,\n sourceSpan: ParseSourceSpan,\n): ClassPropOp {\n return {\n kind: OpKind.ClassProp,\n target: xref,\n name,\n expression,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n\n/**\n * A logical operation representing binding to a style map in the update IR.\n */\nexport interface StyleMapOp extends Op, ConsumesVarsTrait, DependsOnSlotContextOpTrait {\n kind: OpKind.StyleMap;\n\n /**\n * Reference to the element on which the property is bound.\n */\n target: XrefId;\n\n /**\n * Expression which is bound to the property.\n */\n expression: o.Expression | Interpolation;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/** Create a `StyleMapOp`. */\nexport function createStyleMapOp(\n xref: XrefId,\n expression: o.Expression | Interpolation,\n sourceSpan: ParseSourceSpan,\n): StyleMapOp {\n return {\n kind: OpKind.StyleMap,\n target: xref,\n expression,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n\n/**\n * A logical operation representing binding to a style map in the update IR.\n */\nexport interface ClassMapOp extends Op, ConsumesVarsTrait, DependsOnSlotContextOpTrait {\n kind: OpKind.ClassMap;\n\n /**\n * Reference to the element on which the property is bound.\n */\n target: XrefId;\n\n /**\n * Expression which is bound to the property.\n */\n expression: o.Expression | Interpolation;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create a `ClassMapOp`.\n */\nexport function createClassMapOp(\n xref: XrefId,\n expression: o.Expression | Interpolation,\n sourceSpan: ParseSourceSpan,\n): ClassMapOp {\n return {\n kind: OpKind.ClassMap,\n target: xref,\n expression,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n\n/**\n * A logical operation representing setting an attribute on an element in the update IR.\n */\nexport interface AttributeOp extends Op {\n kind: OpKind.Attribute;\n\n /**\n * The `XrefId` of the template-like element the attribute will belong to.\n */\n target: XrefId;\n\n /**\n * The namespace of the attribute (or null if none).\n */\n namespace: string | null;\n\n /**\n * The name of the attribute.\n */\n name: string;\n\n /**\n * The value of the attribute.\n */\n expression: o.Expression | Interpolation;\n\n /**\n * The security context of the binding.\n */\n securityContext: SecurityContext | SecurityContext[];\n\n /**\n * The sanitizer for this attribute.\n */\n sanitizer: o.Expression | null;\n\n /**\n * Whether the binding is a TextAttribute (e.g. `some-attr=\"some-value\"`).\n *\n * This needs to be tracked for compatibility with `TemplateDefinitionBuilder` which treats\n * `style` and `class` TextAttributes differently from `[attr.style]` and `[attr.class]`.\n */\n isTextAttribute: boolean;\n\n isStructuralTemplateAttribute: boolean;\n\n /**\n * The kind of template targeted by the binding, or null if this binding does not target a\n * template.\n */\n templateKind: TemplateKind | null;\n\n /**\n * The i18n context, if this is an i18n attribute.\n */\n i18nContext: XrefId | null;\n\n i18nMessage: i18n.Message | null;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create an `AttributeOp`.\n */\nexport function createAttributeOp(\n target: XrefId,\n namespace: string | null,\n name: string,\n expression: o.Expression | Interpolation,\n securityContext: SecurityContext | SecurityContext[],\n isTextAttribute: boolean,\n isStructuralTemplateAttribute: boolean,\n templateKind: TemplateKind | null,\n i18nMessage: i18n.Message | null,\n sourceSpan: ParseSourceSpan,\n): AttributeOp {\n return {\n kind: OpKind.Attribute,\n target,\n namespace,\n name,\n expression,\n securityContext,\n sanitizer: null,\n isTextAttribute,\n isStructuralTemplateAttribute,\n templateKind,\n i18nContext: null,\n i18nMessage,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n\n/**\n * Logical operation to advance the runtime's internal slot pointer in the update IR.\n */\nexport interface AdvanceOp extends Op {\n kind: OpKind.Advance;\n\n /**\n * Delta by which to advance the pointer.\n */\n delta: number;\n\n // Source span of the binding that caused the advance\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create an `AdvanceOp`.\n */\nexport function createAdvanceOp(delta: number, sourceSpan: ParseSourceSpan): AdvanceOp {\n return {\n kind: OpKind.Advance,\n delta,\n sourceSpan,\n ...NEW_OP,\n };\n}\n\n/**\n * Logical operation representing a conditional expression in the update IR.\n */\nexport interface ConditionalOp\n extends Op,\n DependsOnSlotContextOpTrait,\n ConsumesVarsTrait {\n kind: OpKind.Conditional;\n\n /**\n * The insertion point, which is the first template in the creation block belonging to this\n * condition.\n */\n target: XrefId;\n\n /**\n * The main test expression (for a switch), or `null` (for an if, which has no test\n * expression).\n */\n test: o.Expression | null;\n\n /**\n * Each possible embedded view that could be displayed has a condition (or is default). This\n * structure maps each view xref to its corresponding condition.\n */\n conditions: Array;\n\n /**\n * After processing, this will be a single collapsed Joost-expression that evaluates the\n * conditions, and yields the slot number of the template which should be displayed.\n */\n processed: o.Expression | null;\n\n /**\n * Control flow conditionals can accept a context value (this is a result of specifying an\n * alias). This expression will be passed to the conditional instruction's context parameter.\n */\n contextValue: o.Expression | null;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create a conditional op, which will display an embedded view according to a condtion.\n */\nexport function createConditionalOp(\n target: XrefId,\n test: o.Expression | null,\n conditions: Array,\n sourceSpan: ParseSourceSpan,\n): ConditionalOp {\n return {\n kind: OpKind.Conditional,\n target,\n test,\n conditions,\n processed: null,\n sourceSpan,\n contextValue: null,\n ...NEW_OP,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n };\n}\n\nexport interface RepeaterOp extends Op, DependsOnSlotContextOpTrait {\n kind: OpKind.Repeater;\n\n /**\n * The RepeaterCreate op associated with this repeater.\n */\n target: XrefId;\n\n targetSlot: SlotHandle;\n\n /**\n * The collection provided to the for loop as its expression.\n */\n collection: o.Expression;\n\n sourceSpan: ParseSourceSpan;\n}\n\nexport function createRepeaterOp(\n repeaterCreate: XrefId,\n targetSlot: SlotHandle,\n collection: o.Expression,\n sourceSpan: ParseSourceSpan,\n): RepeaterOp {\n return {\n kind: OpKind.Repeater,\n target: repeaterCreate,\n targetSlot,\n collection,\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n };\n}\n\nexport interface DeferWhenOp extends Op, DependsOnSlotContextOpTrait, ConsumesVarsTrait {\n kind: OpKind.DeferWhen;\n\n /**\n * The `defer` create op associated with this when condition.\n */\n target: XrefId;\n\n /**\n * A user-provided expression that triggers the defer op.\n */\n expr: o.Expression;\n\n /**\n * Modifier set on the trigger by the user (e.g. `hydrate`, `prefetch` etc).\n */\n modifier: DeferOpModifierKind;\n\n sourceSpan: ParseSourceSpan;\n}\n\nexport function createDeferWhenOp(\n target: XrefId,\n expr: o.Expression,\n modifier: DeferOpModifierKind,\n sourceSpan: ParseSourceSpan,\n): DeferWhenOp {\n return {\n kind: OpKind.DeferWhen,\n target,\n expr,\n modifier,\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n };\n}\n\n/**\n * An op that represents an expression in an i18n message.\n *\n * TODO: This can represent expressions used in both i18n attributes and normal i18n content. We\n * may want to split these into two different op types, deriving from the same base class.\n */\nexport interface I18nExpressionOp\n extends Op,\n ConsumesVarsTrait,\n DependsOnSlotContextOpTrait {\n kind: OpKind.I18nExpression;\n\n /**\n * The i18n context that this expression belongs to.\n */\n context: XrefId;\n\n /**\n * The Xref of the op that we need to `advance` to.\n *\n * In an i18n block, this is initially the i18n start op, but will eventually correspond to\n * the final slot consumer in the owning i18n block.\n * TODO: We should make text i18nExpressions target the i18nEnd instruction, instead the last\n * slot consumer in the i18n block. This makes them resilient to that last consumer being\n * deleted. (Or new slot consumers being added!)\n *\n * In an i18n attribute, this is the xref of the corresponding elementStart/element.\n */\n target: XrefId;\n\n /**\n * In an i18n block, this should be the i18n start op.\n *\n * In an i18n attribute, this will be the xref of the attribute configuration instruction.\n */\n i18nOwner: XrefId;\n\n /**\n * A handle for the slot that this expression modifies.\n * - In an i18n block, this is the handle of the block.\n * - In an i18n attribute, this is the handle of the corresponding i18nAttributes instruction.\n */\n handle: SlotHandle;\n\n /**\n * The expression value.\n */\n expression: o.Expression;\n\n icuPlaceholder: XrefId | null;\n\n /**\n * The i18n placeholder associated with this expression. This can be null if the expression is\n * part of an ICU placeholder. In this case it gets combined with the string literal value and\n * other expressions in the ICU placeholder and assigned to the translated message under the ICU\n * placeholder name.\n */\n i18nPlaceholder: string | null;\n\n /**\n * The time that this expression is resolved.\n */\n resolutionTime: I18nParamResolutionTime;\n\n /**\n * Whether this i18n expression applies to a template or to a binding.\n */\n usage: I18nExpressionFor;\n\n /**\n * If this is an I18nExpressionContext.Binding, this expression is associated with a named\n * attribute. That name is stored here.\n */\n name: string;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create an i18n expression op.\n */\nexport function createI18nExpressionOp(\n context: XrefId,\n target: XrefId,\n i18nOwner: XrefId,\n handle: SlotHandle,\n expression: o.Expression,\n icuPlaceholder: XrefId | null,\n i18nPlaceholder: string | null,\n resolutionTime: I18nParamResolutionTime,\n usage: I18nExpressionFor,\n name: string,\n sourceSpan: ParseSourceSpan,\n): I18nExpressionOp {\n return {\n kind: OpKind.I18nExpression,\n context,\n target,\n i18nOwner,\n handle,\n expression,\n icuPlaceholder,\n i18nPlaceholder,\n resolutionTime,\n usage,\n name,\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_CONSUMES_VARS,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n };\n}\n\n/**\n * An op that represents applying a set of i18n expressions.\n */\nexport interface I18nApplyOp extends Op {\n kind: OpKind.I18nApply;\n\n /**\n * In an i18n block, this should be the i18n start op.\n *\n * In an i18n attribute, this will be the xref of the attribute configuration instruction.\n */\n owner: XrefId;\n\n /**\n * A handle for the slot that i18n apply instruction should apply to. In an i18n block, this\n * is the slot of the i18n block this expression belongs to. In an i18n attribute, this is the\n * slot of the corresponding i18nAttributes instruction.\n */\n handle: SlotHandle;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Creates an op to apply i18n expression ops.\n */\nexport function createI18nApplyOp(\n owner: XrefId,\n handle: SlotHandle,\n sourceSpan: ParseSourceSpan,\n): I18nApplyOp {\n return {\n kind: OpKind.I18nApply,\n owner,\n handle,\n sourceSpan,\n ...NEW_OP,\n };\n}\n\n/**\n * Op to store the current value of a `@let` declaration.\n */\nexport interface StoreLetOp extends Op, ConsumesVarsTrait {\n kind: OpKind.StoreLet;\n sourceSpan: ParseSourceSpan;\n\n /** Name that the user set when declaring the `@let`. */\n declaredName: string;\n\n /** XrefId of the slot in which the call may write its value. */\n target: XrefId;\n\n /** Value of the `@let` declaration. */\n value: o.Expression;\n}\n\n/**\n * Creates a `StoreLetOp`.\n */\nexport function createStoreLetOp(\n target: XrefId,\n declaredName: string,\n value: o.Expression,\n sourceSpan: ParseSourceSpan,\n): StoreLetOp {\n return {\n kind: OpKind.StoreLet,\n target,\n declaredName,\n value,\n sourceSpan,\n ...TRAIT_DEPENDS_ON_SLOT_CONTEXT,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport type {ParseSourceSpan} from '../../../../parse_util';\n\nimport * as t from '../../../../render3/r3_ast';\nimport {ExpressionKind, OpKind} from './enums';\nimport {SlotHandle} from './handle';\nimport type {XrefId} from './operations';\nimport type {CreateOp} from './ops/create';\nimport {Interpolation, type UpdateOp} from './ops/update';\nimport {\n ConsumesVarsTrait,\n DependsOnSlotContext,\n DependsOnSlotContextOpTrait,\n UsesVarOffset,\n UsesVarOffsetTrait,\n} from './traits';\n\n/**\n * An `o.Expression` subtype representing a logical expression in the intermediate representation.\n */\nexport type Expression =\n | LexicalReadExpr\n | ReferenceExpr\n | ContextExpr\n | NextContextExpr\n | GetCurrentViewExpr\n | RestoreViewExpr\n | ResetViewExpr\n | ReadVariableExpr\n | PureFunctionExpr\n | PureFunctionParameterExpr\n | PipeBindingExpr\n | PipeBindingVariadicExpr\n | SafePropertyReadExpr\n | SafeKeyedReadExpr\n | SafeInvokeFunctionExpr\n | EmptyExpr\n | AssignTemporaryExpr\n | ReadTemporaryExpr\n | SlotLiteralExpr\n | ConditionalCaseExpr\n | ConstCollectedExpr\n | TwoWayBindingSetExpr\n | ContextLetReferenceExpr\n | StoreLetExpr\n | TrackContextExpr;\n\n/**\n * Transformer type which converts expressions into general `o.Expression`s (which may be an\n * identity transformation).\n */\nexport type ExpressionTransform = (expr: o.Expression, flags: VisitorContextFlag) => o.Expression;\n\n/**\n * Check whether a given `o.Expression` is a logical IR expression type.\n */\nexport function isIrExpression(expr: o.Expression): expr is Expression {\n return expr instanceof ExpressionBase;\n}\n\n/**\n * Base type used for all logical IR expressions.\n */\nexport abstract class ExpressionBase extends o.Expression {\n abstract readonly kind: ExpressionKind;\n\n constructor(sourceSpan: ParseSourceSpan | null = null) {\n super(null, sourceSpan);\n }\n\n /**\n * Run the transformer against any nested expressions which may be present in this IR expression\n * subtype.\n */\n abstract transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void;\n}\n\n/**\n * Logical expression representing a lexical read of a variable name.\n */\nexport class LexicalReadExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.LexicalRead;\n\n constructor(readonly name: string) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): void {}\n\n override isEquivalent(other: LexicalReadExpr): boolean {\n // We assume that the lexical reads are in the same context, which must be true for parent\n // expressions to be equivalent.\n // TODO: is this generally safe?\n return this.name === other.name;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(): void {}\n\n override clone(): LexicalReadExpr {\n return new LexicalReadExpr(this.name);\n }\n}\n\n/**\n * Runtime operation to retrieve the value of a local reference.\n */\nexport class ReferenceExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.Reference;\n\n constructor(\n readonly target: XrefId,\n readonly targetSlot: SlotHandle,\n readonly offset: number,\n ) {\n super();\n }\n\n override visitExpression(): void {}\n\n override isEquivalent(e: o.Expression): boolean {\n return e instanceof ReferenceExpr && e.target === this.target;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(): void {}\n\n override clone(): ReferenceExpr {\n return new ReferenceExpr(this.target, this.targetSlot, this.offset);\n }\n}\n\nexport class StoreLetExpr\n extends ExpressionBase\n implements ConsumesVarsTrait, DependsOnSlotContextOpTrait\n{\n override readonly kind = ExpressionKind.StoreLet;\n readonly [ConsumesVarsTrait] = true;\n readonly [DependsOnSlotContext] = true;\n\n constructor(\n readonly target: XrefId,\n public value: o.Expression,\n override sourceSpan: ParseSourceSpan,\n ) {\n super();\n }\n\n override visitExpression(): void {}\n\n override isEquivalent(e: o.Expression): boolean {\n return (\n e instanceof StoreLetExpr && e.target === this.target && e.value.isEquivalent(this.value)\n );\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n this.value = transformExpressionsInExpression(this.value, transform, flags);\n }\n\n override clone(): StoreLetExpr {\n return new StoreLetExpr(this.target, this.value, this.sourceSpan);\n }\n}\n\nexport class ContextLetReferenceExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.ContextLetReference;\n\n constructor(\n readonly target: XrefId,\n readonly targetSlot: SlotHandle,\n ) {\n super();\n }\n\n override visitExpression(): void {}\n\n override isEquivalent(e: o.Expression): boolean {\n return e instanceof ContextLetReferenceExpr && e.target === this.target;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(): void {}\n\n override clone(): ContextLetReferenceExpr {\n return new ContextLetReferenceExpr(this.target, this.targetSlot);\n }\n}\n\n/**\n * A reference to the current view context (usually the `ctx` variable in a template function).\n */\nexport class ContextExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.Context;\n\n constructor(readonly view: XrefId) {\n super();\n }\n\n override visitExpression(): void {}\n\n override isEquivalent(e: o.Expression): boolean {\n return e instanceof ContextExpr && e.view === this.view;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(): void {}\n\n override clone(): ContextExpr {\n return new ContextExpr(this.view);\n }\n}\n\n/**\n * A reference to the current view context inside a track function.\n */\nexport class TrackContextExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.TrackContext;\n\n constructor(readonly view: XrefId) {\n super();\n }\n\n override visitExpression(): void {}\n\n override isEquivalent(e: o.Expression): boolean {\n return e instanceof TrackContextExpr && e.view === this.view;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(): void {}\n\n override clone(): TrackContextExpr {\n return new TrackContextExpr(this.view);\n }\n}\n\n/**\n * Runtime operation to navigate to the next view context in the view hierarchy.\n */\nexport class NextContextExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.NextContext;\n\n steps = 1;\n\n constructor() {\n super();\n }\n\n override visitExpression(): void {}\n\n override isEquivalent(e: o.Expression): boolean {\n return e instanceof NextContextExpr && e.steps === this.steps;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(): void {}\n\n override clone(): NextContextExpr {\n const expr = new NextContextExpr();\n expr.steps = this.steps;\n return expr;\n }\n}\n\n/**\n * Runtime operation to snapshot the current view context.\n *\n * The result of this operation can be stored in a variable and later used with the `RestoreView`\n * operation.\n */\nexport class GetCurrentViewExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.GetCurrentView;\n\n constructor() {\n super();\n }\n\n override visitExpression(): void {}\n\n override isEquivalent(e: o.Expression): boolean {\n return e instanceof GetCurrentViewExpr;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(): void {}\n\n override clone(): GetCurrentViewExpr {\n return new GetCurrentViewExpr();\n }\n}\n\n/**\n * Runtime operation to restore a snapshotted view.\n */\nexport class RestoreViewExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.RestoreView;\n\n constructor(public view: XrefId | o.Expression) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): void {\n if (typeof this.view !== 'number') {\n this.view.visitExpression(visitor, context);\n }\n }\n\n override isEquivalent(e: o.Expression): boolean {\n if (!(e instanceof RestoreViewExpr) || typeof e.view !== typeof this.view) {\n return false;\n }\n\n if (typeof this.view === 'number') {\n return this.view === e.view;\n } else {\n return this.view.isEquivalent(e.view as o.Expression);\n }\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n if (typeof this.view !== 'number') {\n this.view = transformExpressionsInExpression(this.view, transform, flags);\n }\n }\n\n override clone(): RestoreViewExpr {\n return new RestoreViewExpr(this.view instanceof o.Expression ? this.view.clone() : this.view);\n }\n}\n\n/**\n * Runtime operation to reset the current view context after `RestoreView`.\n */\nexport class ResetViewExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.ResetView;\n\n constructor(public expr: o.Expression) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {\n this.expr.visitExpression(visitor, context);\n }\n\n override isEquivalent(e: o.Expression): boolean {\n return e instanceof ResetViewExpr && this.expr.isEquivalent(e.expr);\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n this.expr = transformExpressionsInExpression(this.expr, transform, flags);\n }\n\n override clone(): ResetViewExpr {\n return new ResetViewExpr(this.expr.clone());\n }\n}\n\nexport class TwoWayBindingSetExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.TwoWayBindingSet;\n\n constructor(\n public target: o.Expression,\n public value: o.Expression,\n ) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): void {\n this.target.visitExpression(visitor, context);\n this.value.visitExpression(visitor, context);\n }\n\n override isEquivalent(other: TwoWayBindingSetExpr): boolean {\n return this.target.isEquivalent(other.target) && this.value.isEquivalent(other.value);\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(transform: ExpressionTransform, flags: VisitorContextFlag) {\n this.target = transformExpressionsInExpression(this.target, transform, flags);\n this.value = transformExpressionsInExpression(this.value, transform, flags);\n }\n\n override clone(): TwoWayBindingSetExpr {\n return new TwoWayBindingSetExpr(this.target, this.value);\n }\n}\n\n/**\n * Read of a variable declared as an `ir.VariableOp` and referenced through its `ir.XrefId`.\n */\nexport class ReadVariableExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.ReadVariable;\n name: string | null = null;\n constructor(readonly xref: XrefId) {\n super();\n }\n\n override visitExpression(): void {}\n\n override isEquivalent(other: o.Expression): boolean {\n return other instanceof ReadVariableExpr && other.xref === this.xref;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(): void {}\n\n override clone(): ReadVariableExpr {\n const expr = new ReadVariableExpr(this.xref);\n expr.name = this.name;\n return expr;\n }\n}\n\nexport class PureFunctionExpr\n extends ExpressionBase\n implements ConsumesVarsTrait, UsesVarOffsetTrait\n{\n override readonly kind = ExpressionKind.PureFunctionExpr;\n readonly [ConsumesVarsTrait] = true;\n readonly [UsesVarOffset] = true;\n\n varOffset: number | null = null;\n\n /**\n * The expression which should be memoized as a pure computation.\n *\n * This expression contains internal `PureFunctionParameterExpr`s, which are placeholders for the\n * positional argument expressions in `args.\n */\n body: o.Expression | null;\n\n /**\n * Positional arguments to the pure function which will memoize the `body` expression, which act\n * as memoization keys.\n */\n args: o.Expression[];\n\n /**\n * Once extracted to the `ConstantPool`, a reference to the function which defines the computation\n * of `body`.\n */\n fn: o.Expression | null = null;\n\n constructor(expression: o.Expression | null, args: o.Expression[]) {\n super();\n this.body = expression;\n this.args = args;\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any) {\n this.body?.visitExpression(visitor, context);\n for (const arg of this.args) {\n arg.visitExpression(visitor, context);\n }\n }\n\n override isEquivalent(other: o.Expression): boolean {\n if (!(other instanceof PureFunctionExpr) || other.args.length !== this.args.length) {\n return false;\n }\n\n return (\n other.body !== null &&\n this.body !== null &&\n other.body.isEquivalent(this.body) &&\n other.args.every((arg, idx) => arg.isEquivalent(this.args[idx]))\n );\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n if (this.body !== null) {\n // TODO: figure out if this is the right flag to pass here.\n this.body = transformExpressionsInExpression(\n this.body,\n transform,\n flags | VisitorContextFlag.InChildOperation,\n );\n } else if (this.fn !== null) {\n this.fn = transformExpressionsInExpression(this.fn, transform, flags);\n }\n\n for (let i = 0; i < this.args.length; i++) {\n this.args[i] = transformExpressionsInExpression(this.args[i], transform, flags);\n }\n }\n\n override clone(): PureFunctionExpr {\n const expr = new PureFunctionExpr(\n this.body?.clone() ?? null,\n this.args.map((arg) => arg.clone()),\n );\n expr.fn = this.fn?.clone() ?? null;\n expr.varOffset = this.varOffset;\n return expr;\n }\n}\n\nexport class PureFunctionParameterExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.PureFunctionParameterExpr;\n\n constructor(public index: number) {\n super();\n }\n\n override visitExpression(): void {}\n\n override isEquivalent(other: o.Expression): boolean {\n return other instanceof PureFunctionParameterExpr && other.index === this.index;\n }\n\n override isConstant(): boolean {\n return true;\n }\n\n override transformInternalExpressions(): void {}\n\n override clone(): PureFunctionParameterExpr {\n return new PureFunctionParameterExpr(this.index);\n }\n}\n\nexport class PipeBindingExpr\n extends ExpressionBase\n implements ConsumesVarsTrait, UsesVarOffsetTrait\n{\n override readonly kind = ExpressionKind.PipeBinding;\n readonly [ConsumesVarsTrait] = true;\n readonly [UsesVarOffset] = true;\n\n varOffset: number | null = null;\n\n constructor(\n readonly target: XrefId,\n readonly targetSlot: SlotHandle,\n readonly name: string,\n readonly args: o.Expression[],\n ) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): void {\n for (const arg of this.args) {\n arg.visitExpression(visitor, context);\n }\n }\n\n override isEquivalent(): boolean {\n return false;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n for (let idx = 0; idx < this.args.length; idx++) {\n this.args[idx] = transformExpressionsInExpression(this.args[idx], transform, flags);\n }\n }\n\n override clone() {\n const r = new PipeBindingExpr(\n this.target,\n this.targetSlot,\n this.name,\n this.args.map((a) => a.clone()),\n );\n r.varOffset = this.varOffset;\n return r;\n }\n}\n\nexport class PipeBindingVariadicExpr\n extends ExpressionBase\n implements ConsumesVarsTrait, UsesVarOffsetTrait\n{\n override readonly kind = ExpressionKind.PipeBindingVariadic;\n readonly [ConsumesVarsTrait] = true;\n readonly [UsesVarOffset] = true;\n\n varOffset: number | null = null;\n\n constructor(\n readonly target: XrefId,\n readonly targetSlot: SlotHandle,\n readonly name: string,\n public args: o.Expression,\n public numArgs: number,\n ) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): void {\n this.args.visitExpression(visitor, context);\n }\n\n override isEquivalent(): boolean {\n return false;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n this.args = transformExpressionsInExpression(this.args, transform, flags);\n }\n\n override clone(): PipeBindingVariadicExpr {\n const r = new PipeBindingVariadicExpr(\n this.target,\n this.targetSlot,\n this.name,\n this.args.clone(),\n this.numArgs,\n );\n r.varOffset = this.varOffset;\n return r;\n }\n}\n\nexport class SafePropertyReadExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.SafePropertyRead;\n\n constructor(\n public receiver: o.Expression,\n public name: string,\n ) {\n super();\n }\n\n // An alias for name, which allows other logic to handle property reads and keyed reads together.\n get index() {\n return this.name;\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {\n this.receiver.visitExpression(visitor, context);\n }\n\n override isEquivalent(): boolean {\n return false;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n this.receiver = transformExpressionsInExpression(this.receiver, transform, flags);\n }\n\n override clone(): SafePropertyReadExpr {\n return new SafePropertyReadExpr(this.receiver.clone(), this.name);\n }\n}\n\nexport class SafeKeyedReadExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.SafeKeyedRead;\n\n constructor(\n public receiver: o.Expression,\n public index: o.Expression,\n sourceSpan: ParseSourceSpan | null,\n ) {\n super(sourceSpan);\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {\n this.receiver.visitExpression(visitor, context);\n this.index.visitExpression(visitor, context);\n }\n\n override isEquivalent(): boolean {\n return false;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n this.receiver = transformExpressionsInExpression(this.receiver, transform, flags);\n this.index = transformExpressionsInExpression(this.index, transform, flags);\n }\n\n override clone(): SafeKeyedReadExpr {\n return new SafeKeyedReadExpr(this.receiver.clone(), this.index.clone(), this.sourceSpan);\n }\n}\n\nexport class SafeInvokeFunctionExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.SafeInvokeFunction;\n\n constructor(\n public receiver: o.Expression,\n public args: o.Expression[],\n ) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {\n this.receiver.visitExpression(visitor, context);\n for (const a of this.args) {\n a.visitExpression(visitor, context);\n }\n }\n\n override isEquivalent(): boolean {\n return false;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n this.receiver = transformExpressionsInExpression(this.receiver, transform, flags);\n for (let i = 0; i < this.args.length; i++) {\n this.args[i] = transformExpressionsInExpression(this.args[i], transform, flags);\n }\n }\n\n override clone(): SafeInvokeFunctionExpr {\n return new SafeInvokeFunctionExpr(\n this.receiver.clone(),\n this.args.map((a) => a.clone()),\n );\n }\n}\n\nexport class SafeTernaryExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.SafeTernaryExpr;\n\n constructor(\n public guard: o.Expression,\n public expr: o.Expression,\n ) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {\n this.guard.visitExpression(visitor, context);\n this.expr.visitExpression(visitor, context);\n }\n\n override isEquivalent(): boolean {\n return false;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n this.guard = transformExpressionsInExpression(this.guard, transform, flags);\n this.expr = transformExpressionsInExpression(this.expr, transform, flags);\n }\n\n override clone(): SafeTernaryExpr {\n return new SafeTernaryExpr(this.guard.clone(), this.expr.clone());\n }\n}\n\nexport class EmptyExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.EmptyExpr;\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {}\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof EmptyExpr;\n }\n\n override isConstant() {\n return true;\n }\n\n override clone(): EmptyExpr {\n return new EmptyExpr();\n }\n\n override transformInternalExpressions(): void {}\n}\n\nexport class AssignTemporaryExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.AssignTemporaryExpr;\n\n public name: string | null = null;\n\n constructor(\n public expr: o.Expression,\n public xref: XrefId,\n ) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {\n this.expr.visitExpression(visitor, context);\n }\n\n override isEquivalent(): boolean {\n return false;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n this.expr = transformExpressionsInExpression(this.expr, transform, flags);\n }\n\n override clone(): AssignTemporaryExpr {\n const a = new AssignTemporaryExpr(this.expr.clone(), this.xref);\n a.name = this.name;\n return a;\n }\n}\n\nexport class ReadTemporaryExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.ReadTemporaryExpr;\n\n public name: string | null = null;\n\n constructor(public xref: XrefId) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {}\n\n override isEquivalent(): boolean {\n return this.xref === this.xref;\n }\n\n override isConstant(): boolean {\n return false;\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {}\n\n override clone(): ReadTemporaryExpr {\n const r = new ReadTemporaryExpr(this.xref);\n r.name = this.name;\n return r;\n }\n}\n\nexport class SlotLiteralExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.SlotLiteralExpr;\n\n constructor(readonly slot: SlotHandle) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {}\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof SlotLiteralExpr && e.slot === this.slot;\n }\n\n override isConstant() {\n return true;\n }\n\n override clone(): SlotLiteralExpr {\n return new SlotLiteralExpr(this.slot);\n }\n\n override transformInternalExpressions(): void {}\n}\n\nexport class ConditionalCaseExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.ConditionalCase;\n\n /**\n * Create an expression for one branch of a conditional.\n * @param expr The expression to be tested for this case. Might be null, as in an `else` case.\n * @param target The Xref of the view to be displayed if this condition is true.\n */\n constructor(\n public expr: o.Expression | null,\n readonly target: XrefId,\n readonly targetSlot: SlotHandle,\n readonly alias: t.Variable | null = null,\n ) {\n super();\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any): any {\n if (this.expr !== null) {\n this.expr.visitExpression(visitor, context);\n }\n }\n\n override isEquivalent(e: Expression): boolean {\n return e instanceof ConditionalCaseExpr && e.expr === this.expr;\n }\n\n override isConstant() {\n return true;\n }\n\n override clone(): ConditionalCaseExpr {\n return new ConditionalCaseExpr(this.expr, this.target, this.targetSlot);\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n if (this.expr !== null) {\n this.expr = transformExpressionsInExpression(this.expr, transform, flags);\n }\n }\n}\n\nexport class ConstCollectedExpr extends ExpressionBase {\n override readonly kind = ExpressionKind.ConstCollected;\n\n constructor(public expr: o.Expression) {\n super();\n }\n\n override transformInternalExpressions(\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n ): void {\n this.expr = transform(this.expr, flags);\n }\n\n override visitExpression(visitor: o.ExpressionVisitor, context: any) {\n this.expr.visitExpression(visitor, context);\n }\n\n override isEquivalent(e: o.Expression): boolean {\n if (!(e instanceof ConstCollectedExpr)) {\n return false;\n }\n return this.expr.isEquivalent(e.expr);\n }\n\n override isConstant(): boolean {\n return this.expr.isConstant();\n }\n\n override clone(): ConstCollectedExpr {\n return new ConstCollectedExpr(this.expr);\n }\n}\n\n/**\n * Visits all `Expression`s in the AST of `op` with the `visitor` function.\n */\nexport function visitExpressionsInOp(\n op: CreateOp | UpdateOp,\n visitor: (expr: o.Expression, flags: VisitorContextFlag) => void,\n): void {\n transformExpressionsInOp(\n op,\n (expr, flags) => {\n visitor(expr, flags);\n return expr;\n },\n VisitorContextFlag.None,\n );\n}\n\nexport enum VisitorContextFlag {\n None = 0b0000,\n InChildOperation = 0b0001,\n}\n\nfunction transformExpressionsInInterpolation(\n interpolation: Interpolation,\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n) {\n for (let i = 0; i < interpolation.expressions.length; i++) {\n interpolation.expressions[i] = transformExpressionsInExpression(\n interpolation.expressions[i],\n transform,\n flags,\n );\n }\n}\n\n/**\n * Transform all `Expression`s in the AST of `op` with the `transform` function.\n *\n * All such operations will be replaced with the result of applying `transform`, which may be an\n * identity transformation.\n */\nexport function transformExpressionsInOp(\n op: CreateOp | UpdateOp,\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n): void {\n switch (op.kind) {\n case OpKind.StyleProp:\n case OpKind.StyleMap:\n case OpKind.ClassProp:\n case OpKind.ClassMap:\n case OpKind.Binding:\n if (op.expression instanceof Interpolation) {\n transformExpressionsInInterpolation(op.expression, transform, flags);\n } else {\n op.expression = transformExpressionsInExpression(op.expression, transform, flags);\n }\n break;\n case OpKind.Property:\n case OpKind.HostProperty:\n case OpKind.Attribute:\n if (op.expression instanceof Interpolation) {\n transformExpressionsInInterpolation(op.expression, transform, flags);\n } else {\n op.expression = transformExpressionsInExpression(op.expression, transform, flags);\n }\n op.sanitizer =\n op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform, flags);\n break;\n case OpKind.TwoWayProperty:\n op.expression = transformExpressionsInExpression(op.expression, transform, flags);\n op.sanitizer =\n op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform, flags);\n break;\n case OpKind.I18nExpression:\n op.expression = transformExpressionsInExpression(op.expression, transform, flags);\n break;\n case OpKind.InterpolateText:\n transformExpressionsInInterpolation(op.interpolation, transform, flags);\n break;\n case OpKind.Statement:\n transformExpressionsInStatement(op.statement, transform, flags);\n break;\n case OpKind.Variable:\n op.initializer = transformExpressionsInExpression(op.initializer, transform, flags);\n break;\n case OpKind.Conditional:\n for (const condition of op.conditions) {\n if (condition.expr === null) {\n // This is a default case.\n continue;\n }\n condition.expr = transformExpressionsInExpression(condition.expr, transform, flags);\n }\n if (op.processed !== null) {\n op.processed = transformExpressionsInExpression(op.processed, transform, flags);\n }\n if (op.contextValue !== null) {\n op.contextValue = transformExpressionsInExpression(op.contextValue, transform, flags);\n }\n break;\n case OpKind.Listener:\n case OpKind.TwoWayListener:\n for (const innerOp of op.handlerOps) {\n transformExpressionsInOp(innerOp, transform, flags | VisitorContextFlag.InChildOperation);\n }\n break;\n case OpKind.ExtractedAttribute:\n op.expression =\n op.expression && transformExpressionsInExpression(op.expression, transform, flags);\n op.trustedValueFn =\n op.trustedValueFn && transformExpressionsInExpression(op.trustedValueFn, transform, flags);\n break;\n case OpKind.RepeaterCreate:\n if (op.trackByOps === null) {\n op.track = transformExpressionsInExpression(op.track, transform, flags);\n } else {\n for (const innerOp of op.trackByOps) {\n transformExpressionsInOp(innerOp, transform, flags | VisitorContextFlag.InChildOperation);\n }\n }\n if (op.trackByFn !== null) {\n op.trackByFn = transformExpressionsInExpression(op.trackByFn, transform, flags);\n }\n break;\n case OpKind.Repeater:\n op.collection = transformExpressionsInExpression(op.collection, transform, flags);\n break;\n case OpKind.Defer:\n if (op.loadingConfig !== null) {\n op.loadingConfig = transformExpressionsInExpression(op.loadingConfig, transform, flags);\n }\n if (op.placeholderConfig !== null) {\n op.placeholderConfig = transformExpressionsInExpression(\n op.placeholderConfig,\n transform,\n flags,\n );\n }\n if (op.resolverFn !== null) {\n op.resolverFn = transformExpressionsInExpression(op.resolverFn, transform, flags);\n }\n break;\n case OpKind.I18nMessage:\n for (const [placeholder, expr] of op.params) {\n op.params.set(placeholder, transformExpressionsInExpression(expr, transform, flags));\n }\n for (const [placeholder, expr] of op.postprocessingParams) {\n op.postprocessingParams.set(\n placeholder,\n transformExpressionsInExpression(expr, transform, flags),\n );\n }\n break;\n case OpKind.DeferWhen:\n op.expr = transformExpressionsInExpression(op.expr, transform, flags);\n break;\n case OpKind.StoreLet:\n op.value = transformExpressionsInExpression(op.value, transform, flags);\n break;\n case OpKind.Advance:\n case OpKind.Container:\n case OpKind.ContainerEnd:\n case OpKind.ContainerStart:\n case OpKind.DeferOn:\n case OpKind.DisableBindings:\n case OpKind.Element:\n case OpKind.ElementEnd:\n case OpKind.ElementStart:\n case OpKind.EnableBindings:\n case OpKind.I18n:\n case OpKind.I18nApply:\n case OpKind.I18nContext:\n case OpKind.I18nEnd:\n case OpKind.I18nStart:\n case OpKind.IcuEnd:\n case OpKind.IcuStart:\n case OpKind.Namespace:\n case OpKind.Pipe:\n case OpKind.Projection:\n case OpKind.ProjectionDef:\n case OpKind.Template:\n case OpKind.Text:\n case OpKind.I18nAttributes:\n case OpKind.IcuPlaceholder:\n case OpKind.DeclareLet:\n case OpKind.SourceLocation:\n // These operations contain no expressions.\n break;\n default:\n throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);\n }\n}\n\n/**\n * Transform all `Expression`s in the AST of `expr` with the `transform` function.\n *\n * All such operations will be replaced with the result of applying `transform`, which may be an\n * identity transformation.\n */\nexport function transformExpressionsInExpression(\n expr: o.Expression,\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n): o.Expression {\n if (expr instanceof ExpressionBase) {\n expr.transformInternalExpressions(transform, flags);\n } else if (expr instanceof o.BinaryOperatorExpr) {\n expr.lhs = transformExpressionsInExpression(expr.lhs, transform, flags);\n expr.rhs = transformExpressionsInExpression(expr.rhs, transform, flags);\n } else if (expr instanceof o.UnaryOperatorExpr) {\n expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);\n } else if (expr instanceof o.ReadPropExpr) {\n expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags);\n } else if (expr instanceof o.ReadKeyExpr) {\n expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags);\n expr.index = transformExpressionsInExpression(expr.index, transform, flags);\n } else if (expr instanceof o.WritePropExpr) {\n expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags);\n expr.value = transformExpressionsInExpression(expr.value, transform, flags);\n } else if (expr instanceof o.WriteKeyExpr) {\n expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags);\n expr.index = transformExpressionsInExpression(expr.index, transform, flags);\n expr.value = transformExpressionsInExpression(expr.value, transform, flags);\n } else if (expr instanceof o.InvokeFunctionExpr) {\n expr.fn = transformExpressionsInExpression(expr.fn, transform, flags);\n for (let i = 0; i < expr.args.length; i++) {\n expr.args[i] = transformExpressionsInExpression(expr.args[i], transform, flags);\n }\n } else if (expr instanceof o.LiteralArrayExpr) {\n for (let i = 0; i < expr.entries.length; i++) {\n expr.entries[i] = transformExpressionsInExpression(expr.entries[i], transform, flags);\n }\n } else if (expr instanceof o.LiteralMapExpr) {\n for (let i = 0; i < expr.entries.length; i++) {\n expr.entries[i].value = transformExpressionsInExpression(\n expr.entries[i].value,\n transform,\n flags,\n );\n }\n } else if (expr instanceof o.ConditionalExpr) {\n expr.condition = transformExpressionsInExpression(expr.condition, transform, flags);\n expr.trueCase = transformExpressionsInExpression(expr.trueCase, transform, flags);\n if (expr.falseCase !== null) {\n expr.falseCase = transformExpressionsInExpression(expr.falseCase, transform, flags);\n }\n } else if (expr instanceof o.TypeofExpr) {\n expr.expr = transformExpressionsInExpression(expr.expr, transform, flags);\n } else if (expr instanceof o.WriteVarExpr) {\n expr.value = transformExpressionsInExpression(expr.value, transform, flags);\n } else if (expr instanceof o.LocalizedString) {\n for (let i = 0; i < expr.expressions.length; i++) {\n expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);\n }\n } else if (expr instanceof o.NotExpr) {\n expr.condition = transformExpressionsInExpression(expr.condition, transform, flags);\n } else if (expr instanceof o.TaggedTemplateLiteralExpr) {\n expr.tag = transformExpressionsInExpression(expr.tag, transform, flags);\n expr.template.expressions = expr.template.expressions.map((e) =>\n transformExpressionsInExpression(e, transform, flags),\n );\n } else if (expr instanceof o.ArrowFunctionExpr) {\n if (Array.isArray(expr.body)) {\n for (let i = 0; i < expr.body.length; i++) {\n transformExpressionsInStatement(expr.body[i], transform, flags);\n }\n } else {\n expr.body = transformExpressionsInExpression(expr.body, transform, flags);\n }\n } else if (expr instanceof o.WrappedNodeExpr) {\n // TODO: Do we need to transform any TS nodes nested inside of this expression?\n } else if (expr instanceof o.TemplateLiteralExpr) {\n for (let i = 0; i < expr.expressions.length; i++) {\n expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags);\n }\n } else if (\n expr instanceof o.ReadVarExpr ||\n expr instanceof o.ExternalExpr ||\n expr instanceof o.LiteralExpr\n ) {\n // No action for these types.\n } else {\n throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);\n }\n return transform(expr, flags);\n}\n\n/**\n * Transform all `Expression`s in the AST of `stmt` with the `transform` function.\n *\n * All such operations will be replaced with the result of applying `transform`, which may be an\n * identity transformation.\n */\nexport function transformExpressionsInStatement(\n stmt: o.Statement,\n transform: ExpressionTransform,\n flags: VisitorContextFlag,\n): void {\n if (stmt instanceof o.ExpressionStatement) {\n stmt.expr = transformExpressionsInExpression(stmt.expr, transform, flags);\n } else if (stmt instanceof o.ReturnStatement) {\n stmt.value = transformExpressionsInExpression(stmt.value, transform, flags);\n } else if (stmt instanceof o.DeclareVarStmt) {\n if (stmt.value !== undefined) {\n stmt.value = transformExpressionsInExpression(stmt.value, transform, flags);\n }\n } else if (stmt instanceof o.IfStmt) {\n stmt.condition = transformExpressionsInExpression(stmt.condition, transform, flags);\n for (const caseStatement of stmt.trueCase) {\n transformExpressionsInStatement(caseStatement, transform, flags);\n }\n for (const caseStatement of stmt.falseCase) {\n transformExpressionsInStatement(caseStatement, transform, flags);\n }\n } else {\n throw new Error(`Unhandled statement kind: ${stmt.constructor.name}`);\n }\n}\n\n/**\n * Checks whether the given expression is a string literal.\n */\nexport function isStringLiteral(expr: o.Expression): expr is o.LiteralExpr & {value: string} {\n return expr instanceof o.LiteralExpr && typeof expr.value === 'string';\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {OpKind} from './enums';\n\n/**\n * Branded type for a cross-reference ID. During ingest, `XrefId`s are generated to link together\n * different IR operations which need to reference each other.\n */\nexport type XrefId = number & {__brand: 'XrefId'};\n\n/**\n * Base interface for semantic operations being performed within a template.\n *\n * @param OpT a specific narrower type of `Op` (for example, creation operations) which this\n * specific subtype of `Op` can be linked with in a linked list.\n */\nexport interface Op> {\n /**\n * All operations have a distinct kind.\n */\n kind: OpKind;\n\n /**\n * The previous operation in the linked list, if any.\n *\n * This is `null` for operation nodes not currently in a list, or for the special head/tail nodes.\n */\n prev: OpT | null;\n\n /**\n * The next operation in the linked list, if any.\n *\n * This is `null` for operation nodes not currently in a list, or for the special head/tail nodes.\n */\n next: OpT | null;\n\n /**\n * Debug id of the list to which this node currently belongs, or `null` if this node is not part\n * of a list.\n */\n debugListId: number | null;\n}\n\n/**\n * A linked list of `Op` nodes of a given subtype.\n *\n * @param OpT specific subtype of `Op` nodes which this list contains.\n */\nexport class OpList> {\n static nextListId = 0;\n\n /**\n * Debug ID of this `OpList` instance.\n */\n readonly debugListId = OpList.nextListId++;\n\n // OpList uses static head/tail nodes of a special `ListEnd` type.\n // This avoids the need for special casing of the first and last list\n // elements in all list operations.\n readonly head: OpT = {\n kind: OpKind.ListEnd,\n next: null,\n prev: null,\n debugListId: this.debugListId,\n } as OpT;\n\n readonly tail = {\n kind: OpKind.ListEnd,\n next: null,\n prev: null,\n debugListId: this.debugListId,\n } as OpT;\n\n constructor() {\n // Link `head` and `tail` together at the start (list is empty).\n this.head.next = this.tail;\n this.tail.prev = this.head;\n }\n\n /**\n * Push a new operation to the tail of the list.\n */\n push(op: OpT | Array): void {\n if (Array.isArray(op)) {\n for (const o of op) {\n this.push(o);\n }\n return;\n }\n\n OpList.assertIsNotEnd(op);\n OpList.assertIsUnowned(op);\n\n op.debugListId = this.debugListId;\n\n // The old \"previous\" node (which might be the head, if the list is empty).\n const oldLast = this.tail.prev!;\n\n // Insert `op` following the old last node.\n op.prev = oldLast;\n oldLast.next = op;\n\n // Connect `op` with the list tail.\n op.next = this.tail;\n this.tail.prev = op;\n }\n\n /**\n * Prepend one or more nodes to the start of the list.\n */\n prepend(ops: OpT[]): void {\n if (ops.length === 0) {\n return;\n }\n\n for (const op of ops) {\n OpList.assertIsNotEnd(op);\n OpList.assertIsUnowned(op);\n\n op.debugListId = this.debugListId;\n }\n\n const first = this.head.next!;\n\n let prev = this.head;\n for (const op of ops) {\n prev.next = op;\n op.prev = prev;\n\n prev = op;\n }\n\n prev.next = first;\n first.prev = prev;\n }\n\n /**\n * `OpList` is iterable via the iteration protocol.\n *\n * It's safe to mutate the part of the list that has already been returned by the iterator, up to\n * and including the last operation returned. Mutations beyond that point _may_ be safe, but may\n * also corrupt the iteration position and should be avoided.\n */\n *[Symbol.iterator](): Generator {\n let current = this.head.next!;\n while (current !== this.tail) {\n // Guards against corruption of the iterator state by mutations to the tail of the list during\n // iteration.\n OpList.assertIsOwned(current, this.debugListId);\n\n const next = current.next!;\n yield current;\n current = next;\n }\n }\n\n *reversed(): Generator {\n let current = this.tail.prev!;\n while (current !== this.head) {\n OpList.assertIsOwned(current, this.debugListId);\n\n const prev = current.prev!;\n yield current;\n current = prev;\n }\n }\n\n /**\n * Replace `oldOp` with `newOp` in the list.\n */\n static replace>(oldOp: OpT, newOp: OpT): void {\n OpList.assertIsNotEnd(oldOp);\n OpList.assertIsNotEnd(newOp);\n\n OpList.assertIsOwned(oldOp);\n OpList.assertIsUnowned(newOp);\n\n newOp.debugListId = oldOp.debugListId;\n if (oldOp.prev !== null) {\n oldOp.prev.next = newOp;\n newOp.prev = oldOp.prev;\n }\n if (oldOp.next !== null) {\n oldOp.next.prev = newOp;\n newOp.next = oldOp.next;\n }\n oldOp.debugListId = null;\n oldOp.prev = null;\n oldOp.next = null;\n }\n\n /**\n * Replace `oldOp` with some number of new operations in the list (which may include `oldOp`).\n */\n static replaceWithMany>(oldOp: OpT, newOps: OpT[]): void {\n if (newOps.length === 0) {\n // Replacing with an empty list -> pure removal.\n OpList.remove(oldOp);\n return;\n }\n\n OpList.assertIsNotEnd(oldOp);\n OpList.assertIsOwned(oldOp);\n\n const listId = oldOp.debugListId;\n oldOp.debugListId = null;\n\n for (const newOp of newOps) {\n OpList.assertIsNotEnd(newOp);\n\n // `newOp` might be `oldOp`, but at this point it's been marked as unowned.\n OpList.assertIsUnowned(newOp);\n }\n\n // It should be safe to reuse `oldOp` in the `newOps` list - maybe you want to sandwich an\n // operation between two new ops.\n const {prev: oldPrev, next: oldNext} = oldOp;\n oldOp.prev = null;\n oldOp.next = null;\n\n let prev: OpT = oldPrev!;\n for (const newOp of newOps) {\n this.assertIsUnowned(newOp);\n newOp.debugListId = listId;\n\n prev!.next = newOp;\n newOp.prev = prev;\n\n // This _should_ be the case, but set it just in case.\n newOp.next = null;\n\n prev = newOp;\n }\n // At the end of iteration, `prev` holds the last node in the list.\n const first = newOps[0]!;\n const last = prev!;\n\n // Replace `oldOp` with the chain `first` -> `last`.\n if (oldPrev !== null) {\n oldPrev.next = first;\n first.prev = oldPrev;\n }\n\n if (oldNext !== null) {\n oldNext.prev = last;\n last.next = oldNext;\n }\n }\n\n /**\n * Remove the given node from the list which contains it.\n */\n static remove>(op: OpT): void {\n OpList.assertIsNotEnd(op);\n OpList.assertIsOwned(op);\n\n op.prev!.next = op.next;\n op.next!.prev = op.prev;\n\n // Break any link between the node and this list to safeguard against its usage in future\n // operations.\n op.debugListId = null;\n op.prev = null;\n op.next = null;\n }\n\n /**\n * Insert `op` before `target`.\n */\n static insertBefore>(op: OpT | OpT[], target: OpT): void {\n if (Array.isArray(op)) {\n for (const o of op) {\n this.insertBefore(o, target);\n }\n return;\n }\n\n OpList.assertIsOwned(target);\n if (target.prev === null) {\n throw new Error(`AssertionError: illegal operation on list start`);\n }\n\n OpList.assertIsNotEnd(op);\n\n OpList.assertIsUnowned(op);\n\n op.debugListId = target.debugListId;\n\n // Just in case.\n op.prev = null;\n\n target.prev!.next = op;\n op.prev = target.prev;\n\n op.next = target;\n target.prev = op;\n }\n\n /**\n * Insert `op` after `target`.\n */\n static insertAfter>(op: OpT, target: OpT): void {\n OpList.assertIsOwned(target);\n if (target.next === null) {\n throw new Error(`AssertionError: illegal operation on list end`);\n }\n\n OpList.assertIsNotEnd(op);\n\n OpList.assertIsUnowned(op);\n\n op.debugListId = target.debugListId;\n\n target.next.prev = op;\n op.next = target.next;\n\n op.prev = target;\n target.next = op;\n }\n\n /**\n * Asserts that `op` does not currently belong to a list.\n */\n static assertIsUnowned>(op: OpT): void {\n if (op.debugListId !== null) {\n throw new Error(`AssertionError: illegal operation on owned node: ${OpKind[op.kind]}`);\n }\n }\n\n /**\n * Asserts that `op` currently belongs to a list. If `byList` is passed, `op` is asserted to\n * specifically belong to that list.\n */\n static assertIsOwned>(op: OpT, byList?: number): void {\n if (op.debugListId === null) {\n throw new Error(`AssertionError: illegal operation on unowned node: ${OpKind[op.kind]}`);\n } else if (byList !== undefined && op.debugListId !== byList) {\n throw new Error(\n `AssertionError: node belongs to the wrong list (expected ${byList}, actual ${op.debugListId})`,\n );\n }\n }\n\n /**\n * Asserts that `op` is not a special `ListEnd` node.\n */\n static assertIsNotEnd>(op: OpT): void {\n if (op.kind === OpKind.ListEnd) {\n throw new Error(`AssertionError: illegal operation on list head or tail`);\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport class SlotHandle {\n slot: number | null = null;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SecurityContext} from '../../../../../core';\nimport * as i18n from '../../../../../i18n/i18n_ast';\nimport * as o from '../../../../../output/output_ast';\nimport {ParseSourceSpan} from '../../../../../parse_util';\nimport {\n BindingKind,\n DeferOpModifierKind,\n DeferTriggerKind,\n I18nContextKind,\n I18nParamValueFlags,\n Namespace,\n OpKind,\n TDeferDetailsFlags,\n TemplateKind,\n} from '../enums';\nimport {SlotHandle} from '../handle';\nimport {Op, OpList, XrefId} from '../operations';\nimport {\n ConsumesSlotOpTrait,\n ConsumesVarsTrait,\n TRAIT_CONSUMES_SLOT,\n TRAIT_CONSUMES_VARS,\n} from '../traits';\n\nimport {ListEndOp, NEW_OP, StatementOp, VariableOp} from './shared';\n\nimport type {UpdateOp} from './update';\n\n/**\n * An operation usable on the creation side of the IR.\n */\nexport type CreateOp =\n | ListEndOp\n | StatementOp\n | ElementOp\n | ElementStartOp\n | ElementEndOp\n | ContainerOp\n | ContainerStartOp\n | ContainerEndOp\n | TemplateOp\n | EnableBindingsOp\n | DisableBindingsOp\n | TextOp\n | ListenerOp\n | TwoWayListenerOp\n | PipeOp\n | VariableOp\n | NamespaceOp\n | ProjectionDefOp\n | ProjectionOp\n | ExtractedAttributeOp\n | DeferOp\n | DeferOnOp\n | RepeaterCreateOp\n | I18nMessageOp\n | I18nOp\n | I18nStartOp\n | I18nEndOp\n | IcuStartOp\n | IcuEndOp\n | IcuPlaceholderOp\n | I18nContextOp\n | I18nAttributesOp\n | DeclareLetOp\n | SourceLocationOp;\n\n/**\n * An operation representing the creation of an element or container.\n */\nexport type ElementOrContainerOps =\n | ElementOp\n | ElementStartOp\n | ContainerOp\n | ContainerStartOp\n | TemplateOp\n | RepeaterCreateOp;\n\n/**\n * The set of OpKinds that represent the creation of an element or container\n */\nconst elementContainerOpKinds = new Set([\n OpKind.Element,\n OpKind.ElementStart,\n OpKind.Container,\n OpKind.ContainerStart,\n OpKind.Template,\n OpKind.RepeaterCreate,\n]);\n\n/**\n * Checks whether the given operation represents the creation of an element or container.\n */\nexport function isElementOrContainerOp(op: CreateOp): op is ElementOrContainerOps {\n return elementContainerOpKinds.has(op.kind);\n}\n\n/**\n * Representation of a local reference on an element.\n */\nexport interface LocalRef {\n /**\n * User-defined name of the local ref variable.\n */\n name: string;\n\n /**\n * Target of the local reference variable (often `''`).\n */\n target: string;\n}\n\n/**\n * Base interface for `Element`, `ElementStart`, and `Template` operations, containing common fields\n * used to represent their element-like nature.\n */\nexport interface ElementOrContainerOpBase extends Op, ConsumesSlotOpTrait {\n kind: ElementOrContainerOps['kind'];\n\n /**\n * `XrefId` allocated for this element.\n *\n * This ID is used to reference this element from other IR structures.\n */\n xref: XrefId;\n\n /**\n * Attributes of various kinds on this element. Represented as a `ConstIndex` pointer into the\n * shared `consts` array of the component compilation.\n */\n attributes: ConstIndex | null;\n\n /**\n * Local references to this element.\n *\n * Before local ref processing, this is an array of `LocalRef` declarations.\n *\n * After processing, it's a `ConstIndex` pointer into the shared `consts` array of the component\n * compilation.\n */\n localRefs: LocalRef[] | ConstIndex | null;\n\n /**\n * Whether this container is marked `ngNonBindable`, which disabled Angular binding for itself and\n * all descendants.\n */\n nonBindable: boolean;\n\n /**\n * The span of the element's start tag.\n */\n startSourceSpan: ParseSourceSpan;\n\n /**\n * The whole source span of the element, including children.\n */\n wholeSourceSpan: ParseSourceSpan;\n}\n\nexport interface ElementOpBase extends ElementOrContainerOpBase {\n kind: OpKind.Element | OpKind.ElementStart | OpKind.Template | OpKind.RepeaterCreate;\n\n /**\n * The HTML tag name for this element.\n */\n tag: string | null;\n\n /**\n * The namespace of this element, which controls the preceding namespace instruction.\n */\n namespace: Namespace;\n}\n\n/**\n * Logical operation representing the start of an element in the creation IR.\n */\nexport interface ElementStartOp extends ElementOpBase {\n kind: OpKind.ElementStart;\n\n /**\n * The i18n placeholder data associated with this element.\n */\n i18nPlaceholder?: i18n.TagPlaceholder;\n}\n\n/**\n * Create an `ElementStartOp`.\n */\nexport function createElementStartOp(\n tag: string,\n xref: XrefId,\n namespace: Namespace,\n i18nPlaceholder: i18n.TagPlaceholder | undefined,\n startSourceSpan: ParseSourceSpan,\n wholeSourceSpan: ParseSourceSpan,\n): ElementStartOp {\n return {\n kind: OpKind.ElementStart,\n xref,\n tag,\n handle: new SlotHandle(),\n attributes: null,\n localRefs: [],\n nonBindable: false,\n namespace,\n i18nPlaceholder,\n startSourceSpan,\n wholeSourceSpan,\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n };\n}\n\n/**\n * Logical operation representing an element with no children in the creation IR.\n */\nexport interface ElementOp extends ElementOpBase {\n kind: OpKind.Element;\n\n /**\n * The i18n placeholder data associated with this element.\n */\n i18nPlaceholder?: i18n.TagPlaceholder;\n}\n\n/**\n * Logical operation representing an embedded view declaration in the creation IR.\n */\nexport interface TemplateOp extends ElementOpBase {\n kind: OpKind.Template;\n\n templateKind: TemplateKind;\n\n /**\n * The number of declaration slots used by this template, or `null` if slots have not yet been\n * assigned.\n */\n decls: number | null;\n\n /**\n * The number of binding variable slots used by this template, or `null` if binding variables have\n * not yet been counted.\n */\n vars: number | null;\n\n /**\n * Suffix to add to the name of the generated template function.\n */\n functionNameSuffix: string;\n\n /**\n * The i18n placeholder data associated with this template.\n */\n i18nPlaceholder?: i18n.TagPlaceholder | i18n.BlockPlaceholder;\n}\n\n/**\n * Create a `TemplateOp`.\n */\nexport function createTemplateOp(\n xref: XrefId,\n templateKind: TemplateKind,\n tag: string | null,\n functionNameSuffix: string,\n namespace: Namespace,\n i18nPlaceholder: i18n.TagPlaceholder | i18n.BlockPlaceholder | undefined,\n startSourceSpan: ParseSourceSpan,\n wholeSourceSpan: ParseSourceSpan,\n): TemplateOp {\n return {\n kind: OpKind.Template,\n xref,\n templateKind,\n attributes: null,\n tag,\n handle: new SlotHandle(),\n functionNameSuffix,\n decls: null,\n vars: null,\n localRefs: [],\n nonBindable: false,\n namespace,\n i18nPlaceholder,\n startSourceSpan,\n wholeSourceSpan,\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n };\n}\n\n/**\n * An op that creates a repeater (e.g. a for loop).\n */\nexport interface RepeaterCreateOp extends ElementOpBase, ConsumesVarsTrait {\n kind: OpKind.RepeaterCreate;\n\n /**\n * The number of declaration slots used by this repeater's template, or `null` if slots have not\n * yet been assigned.\n */\n decls: number | null;\n\n /**\n * The number of binding variable slots used by this repeater's, or `null` if binding variables\n * have not yet been counted.\n */\n vars: number | null;\n\n /**\n * The Xref of the empty view function. (For the primary view function, use the `xref` property).\n */\n emptyView: XrefId | null;\n\n /**\n * The track expression to use while iterating.\n */\n track: o.Expression;\n\n /**\n * Some kinds of expressions (e.g. safe reads or nullish coalescing) require additional ops\n * in order to work. This OpList keeps track of those ops, if they're necessary.\n */\n trackByOps: OpList | null;\n\n /**\n * `null` initially, then an `o.Expression`. Might be a track expression, or might be a reference\n * into the constant pool.\n */\n trackByFn: o.Expression | null;\n\n /**\n * Context variables avaialable in this block.\n */\n varNames: RepeaterVarNames;\n\n /**\n * Whether the repeater track function relies on the component instance.\n */\n usesComponentInstance: boolean;\n\n /**\n * Suffix to add to the name of the generated template function.\n */\n functionNameSuffix: string;\n\n /**\n * Tag name for the empty block.\n */\n emptyTag: string | null;\n\n /**\n * Attributes of various kinds on the empty block. Represented as a `ConstIndex` pointer into the\n * shared `consts` array of the component compilation.\n */\n emptyAttributes: ConstIndex | null;\n\n /**\n * The i18n placeholder for the repeated item template.\n */\n i18nPlaceholder: i18n.BlockPlaceholder | undefined;\n\n /**\n * The i18n placeholder for the empty template.\n */\n emptyI18nPlaceholder: i18n.BlockPlaceholder | undefined;\n}\n\n// TODO: add source spans?\nexport interface RepeaterVarNames {\n $index: Set;\n $implicit: string;\n}\n\nexport function createRepeaterCreateOp(\n primaryView: XrefId,\n emptyView: XrefId | null,\n tag: string | null,\n track: o.Expression,\n varNames: RepeaterVarNames,\n emptyTag: string | null,\n i18nPlaceholder: i18n.BlockPlaceholder | undefined,\n emptyI18nPlaceholder: i18n.BlockPlaceholder | undefined,\n startSourceSpan: ParseSourceSpan,\n wholeSourceSpan: ParseSourceSpan,\n): RepeaterCreateOp {\n return {\n kind: OpKind.RepeaterCreate,\n attributes: null,\n xref: primaryView,\n handle: new SlotHandle(),\n emptyView,\n track,\n trackByFn: null,\n trackByOps: null,\n tag,\n emptyTag,\n emptyAttributes: null,\n functionNameSuffix: 'For',\n namespace: Namespace.HTML,\n nonBindable: false,\n localRefs: [],\n decls: null,\n vars: null,\n varNames,\n usesComponentInstance: false,\n i18nPlaceholder,\n emptyI18nPlaceholder,\n startSourceSpan,\n wholeSourceSpan,\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n ...TRAIT_CONSUMES_VARS,\n numSlotsUsed: emptyView === null ? 2 : 3,\n };\n}\n\n/**\n * Logical operation representing the end of an element structure in the creation IR.\n *\n * Pairs with an `ElementStart` operation.\n */\nexport interface ElementEndOp extends Op {\n kind: OpKind.ElementEnd;\n\n /**\n * The `XrefId` of the element declared via `ElementStart`.\n */\n xref: XrefId;\n\n sourceSpan: ParseSourceSpan | null;\n}\n\n/**\n * Create an `ElementEndOp`.\n */\nexport function createElementEndOp(xref: XrefId, sourceSpan: ParseSourceSpan | null): ElementEndOp {\n return {\n kind: OpKind.ElementEnd,\n xref,\n sourceSpan,\n ...NEW_OP,\n };\n}\n\n/**\n * Logical operation representing the start of a container in the creation IR.\n */\nexport interface ContainerStartOp extends ElementOrContainerOpBase {\n kind: OpKind.ContainerStart;\n}\n\n/**\n * Logical operation representing an empty container in the creation IR.\n */\nexport interface ContainerOp extends ElementOrContainerOpBase {\n kind: OpKind.Container;\n}\n\n/**\n * Logical operation representing the end of a container structure in the creation IR.\n *\n * Pairs with an `ContainerStart` operation.\n */\nexport interface ContainerEndOp extends Op {\n kind: OpKind.ContainerEnd;\n\n /**\n * The `XrefId` of the element declared via `ContainerStart`.\n */\n xref: XrefId;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Logical operation causing binding to be disabled in descendents of a non-bindable container.\n */\nexport interface DisableBindingsOp extends Op {\n kind: OpKind.DisableBindings;\n\n /**\n * `XrefId` of the element that was marked non-bindable.\n */\n xref: XrefId;\n}\n\nexport function createDisableBindingsOp(xref: XrefId): DisableBindingsOp {\n return {\n kind: OpKind.DisableBindings,\n xref,\n ...NEW_OP,\n };\n}\n\n/**\n * Logical operation causing binding to be re-enabled after visiting descendants of a\n * non-bindable container.\n */\nexport interface EnableBindingsOp extends Op {\n kind: OpKind.EnableBindings;\n\n /**\n * `XrefId` of the element that was marked non-bindable.\n */\n xref: XrefId;\n}\n\nexport function createEnableBindingsOp(xref: XrefId): EnableBindingsOp {\n return {\n kind: OpKind.EnableBindings,\n xref,\n ...NEW_OP,\n };\n}\n\n/**\n * Logical operation representing a text node in the creation IR.\n */\nexport interface TextOp extends Op, ConsumesSlotOpTrait {\n kind: OpKind.Text;\n\n /**\n * `XrefId` used to reference this text node in other IR structures.\n */\n xref: XrefId;\n\n /**\n * The static initial value of the text node.\n */\n initialValue: string;\n\n /**\n * The placeholder for this text in its parent ICU. If this text is not part of an ICU, the\n * placeholder is null.\n */\n icuPlaceholder: string | null;\n\n sourceSpan: ParseSourceSpan | null;\n}\n\n/**\n * Create a `TextOp`.\n */\nexport function createTextOp(\n xref: XrefId,\n initialValue: string,\n icuPlaceholder: string | null,\n sourceSpan: ParseSourceSpan | null,\n): TextOp {\n return {\n kind: OpKind.Text,\n xref,\n handle: new SlotHandle(),\n initialValue,\n icuPlaceholder,\n sourceSpan,\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n };\n}\n\n/**\n * Logical operation representing an event listener on an element in the creation IR.\n */\nexport interface ListenerOp extends Op {\n kind: OpKind.Listener;\n\n target: XrefId;\n targetSlot: SlotHandle;\n\n /**\n * Whether this listener is from a host binding.\n */\n hostListener: boolean;\n\n /**\n * Name of the event which is being listened to.\n */\n name: string;\n\n /**\n * Tag name of the element on which this listener is placed. Might be null, if this listener\n * belongs to a host binding.\n */\n tag: string | null;\n\n /**\n * A list of `UpdateOp`s representing the body of the event listener.\n */\n handlerOps: OpList;\n\n /**\n * Name of the function\n */\n handlerFnName: string | null;\n\n /**\n * Whether this listener is known to consume `$event` in its body.\n */\n consumesDollarEvent: boolean;\n\n /**\n * Whether the listener is listening for an animation event.\n */\n isAnimationListener: boolean;\n\n /**\n * The animation phase of the listener.\n */\n animationPhase: string | null;\n\n /**\n * Some event listeners can have a target, e.g. in `document:dragover`.\n */\n eventTarget: string | null;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create a `ListenerOp`. Host bindings reuse all the listener logic.\n */\nexport function createListenerOp(\n target: XrefId,\n targetSlot: SlotHandle,\n name: string,\n tag: string | null,\n handlerOps: Array,\n animationPhase: string | null,\n eventTarget: string | null,\n hostListener: boolean,\n sourceSpan: ParseSourceSpan,\n): ListenerOp {\n const handlerList = new OpList();\n handlerList.push(handlerOps);\n return {\n kind: OpKind.Listener,\n target,\n targetSlot,\n tag,\n hostListener,\n name,\n handlerOps: handlerList,\n handlerFnName: null,\n consumesDollarEvent: false,\n isAnimationListener: animationPhase !== null,\n animationPhase,\n eventTarget,\n sourceSpan,\n ...NEW_OP,\n };\n}\n\n/**\n * Logical operation representing the event side of a two-way binding on an element\n * in the creation IR.\n */\nexport interface TwoWayListenerOp extends Op {\n kind: OpKind.TwoWayListener;\n\n target: XrefId;\n targetSlot: SlotHandle;\n\n /**\n * Name of the event which is being listened to.\n */\n name: string;\n\n /**\n * Tag name of the element on which this listener is placed.\n */\n tag: string | null;\n\n /**\n * A list of `UpdateOp`s representing the body of the event listener.\n */\n handlerOps: OpList;\n\n /**\n * Name of the function\n */\n handlerFnName: string | null;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Create a `TwoWayListenerOp`.\n */\nexport function createTwoWayListenerOp(\n target: XrefId,\n targetSlot: SlotHandle,\n name: string,\n tag: string | null,\n handlerOps: Array,\n sourceSpan: ParseSourceSpan,\n): TwoWayListenerOp {\n const handlerList = new OpList();\n handlerList.push(handlerOps);\n return {\n kind: OpKind.TwoWayListener,\n target,\n targetSlot,\n tag,\n name,\n handlerOps: handlerList,\n handlerFnName: null,\n sourceSpan,\n ...NEW_OP,\n };\n}\n\nexport interface PipeOp extends Op, ConsumesSlotOpTrait {\n kind: OpKind.Pipe;\n xref: XrefId;\n name: string;\n}\n\nexport function createPipeOp(xref: XrefId, slot: SlotHandle, name: string): PipeOp {\n return {\n kind: OpKind.Pipe,\n xref,\n handle: slot,\n name,\n ...NEW_OP,\n ...TRAIT_CONSUMES_SLOT,\n };\n}\n\n/**\n * An op corresponding to a namespace instruction, for switching between HTML, SVG, and MathML.\n */\nexport interface NamespaceOp extends Op {\n kind: OpKind.Namespace;\n active: Namespace;\n}\n\nexport function createNamespaceOp(namespace: Namespace): NamespaceOp {\n return {\n kind: OpKind.Namespace,\n active: namespace,\n ...NEW_OP,\n };\n}\n\n/**\n * An op that creates a content projection slot.\n */\nexport interface ProjectionDefOp extends Op {\n kind: OpKind.ProjectionDef;\n\n // The parsed selector information for this projection def.\n def: o.Expression | null;\n}\n\nexport function createProjectionDefOp(def: o.Expression | null): ProjectionDefOp {\n return {\n kind: OpKind.ProjectionDef,\n def,\n ...NEW_OP,\n };\n}\n\n/**\n * An op that creates a content projection slot.\n */\nexport interface ProjectionOp extends Op, ConsumesSlotOpTrait {\n kind: OpKind.Projection;\n\n xref: XrefId;\n\n projectionSlotIndex: number;\n\n attributes: null | o.LiteralArrayExpr;\n\n localRefs: string[];\n\n selector: string;\n\n i18nPlaceholder?: i18n.TagPlaceholder;\n\n sourceSpan: ParseSourceSpan;\n\n fallbackView: XrefId | null;\n}\n\nexport function createProjectionOp(\n xref: XrefId,\n selector: string,\n i18nPlaceholder: i18n.TagPlaceholder | undefined,\n fallbackView: XrefId | null,\n sourceSpan: ParseSourceSpan,\n): ProjectionOp {\n return {\n kind: OpKind.Projection,\n xref,\n handle: new SlotHandle(),\n selector,\n i18nPlaceholder,\n fallbackView,\n projectionSlotIndex: 0,\n attributes: null,\n localRefs: [],\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_CONSUMES_SLOT,\n numSlotsUsed: fallbackView === null ? 1 : 2,\n };\n}\n\n/**\n * Represents an attribute that has been extracted for inclusion in the consts array.\n */\nexport interface ExtractedAttributeOp extends Op {\n kind: OpKind.ExtractedAttribute;\n\n /**\n * The `XrefId` of the template-like element the extracted attribute will belong to.\n */\n target: XrefId;\n\n /**\n * The kind of binding represented by this extracted attribute.\n */\n bindingKind: BindingKind;\n\n /**\n * The namespace of the attribute (or null if none).\n */\n namespace: string | null;\n\n /**\n * The name of the extracted attribute.\n */\n name: string;\n\n /**\n * The value expression of the extracted attribute.\n */\n expression: o.Expression | null;\n\n /**\n * If this attribute has a corresponding i18n attribute (e.g. `i18n-foo=\"m:d\"`), then this is the\n * i18n context for it.\n */\n i18nContext: XrefId | null;\n\n /**\n * The security context of the binding.\n */\n securityContext: SecurityContext | SecurityContext[];\n\n /**\n * The trusted value function for this property.\n */\n trustedValueFn: o.Expression | null;\n\n i18nMessage: i18n.Message | null;\n}\n\n/**\n * Create an `ExtractedAttributeOp`.\n */\nexport function createExtractedAttributeOp(\n target: XrefId,\n bindingKind: BindingKind,\n namespace: string | null,\n name: string,\n expression: o.Expression | null,\n i18nContext: XrefId | null,\n i18nMessage: i18n.Message | null,\n securityContext: SecurityContext | SecurityContext[],\n): ExtractedAttributeOp {\n return {\n kind: OpKind.ExtractedAttribute,\n target,\n bindingKind,\n namespace,\n name,\n expression,\n i18nContext,\n i18nMessage,\n securityContext,\n trustedValueFn: null,\n ...NEW_OP,\n };\n}\n\nexport interface DeferOp extends Op, ConsumesSlotOpTrait {\n kind: OpKind.Defer;\n\n /**\n * The xref of this defer op.\n */\n xref: XrefId;\n\n /**\n * The xref of the main view.\n */\n mainView: XrefId;\n\n mainSlot: SlotHandle;\n\n /**\n * Secondary loading block associated with this defer op.\n */\n loadingView: XrefId | null;\n\n loadingSlot: SlotHandle | null;\n\n /**\n * Secondary placeholder block associated with this defer op.\n */\n placeholderView: XrefId | null;\n\n placeholderSlot: SlotHandle | null;\n\n /**\n * Secondary error block associated with this defer op.\n */\n errorView: XrefId | null;\n\n errorSlot: SlotHandle | null;\n\n placeholderMinimumTime: number | null;\n loadingMinimumTime: number | null;\n loadingAfterTime: number | null;\n\n placeholderConfig: o.Expression | null;\n loadingConfig: o.Expression | null;\n\n /**\n * Depending on the compilation mode, there can be either one dependency resolution function\n * per deferred block or one for the entire template. This field contains the function that\n * belongs specifically to the current deferred block.\n */\n ownResolverFn: o.Expression | null;\n\n /**\n * After processing, the resolver function for the defer deps will be extracted to the constant\n * pool, and a reference to that function will be populated here.\n */\n resolverFn: o.Expression | null;\n\n /**\n * Specifies defer block flags, which should be used for all\n * instances of a given defer block (the flags that should be\n * placed into the `TDeferDetails` at runtime).\n */\n flags: TDeferDetailsFlags | null;\n\n sourceSpan: ParseSourceSpan;\n}\n\nexport function createDeferOp(\n xref: XrefId,\n main: XrefId,\n mainSlot: SlotHandle,\n ownResolverFn: o.Expression | null,\n resolverFn: o.Expression | null,\n sourceSpan: ParseSourceSpan,\n): DeferOp {\n return {\n kind: OpKind.Defer,\n xref,\n handle: new SlotHandle(),\n mainView: main,\n mainSlot,\n loadingView: null,\n loadingSlot: null,\n loadingConfig: null,\n loadingMinimumTime: null,\n loadingAfterTime: null,\n placeholderView: null,\n placeholderSlot: null,\n placeholderConfig: null,\n placeholderMinimumTime: null,\n errorView: null,\n errorSlot: null,\n ownResolverFn,\n resolverFn,\n flags: null,\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_CONSUMES_SLOT,\n numSlotsUsed: 2,\n };\n}\ninterface DeferTriggerBase {\n kind: DeferTriggerKind;\n}\n\ninterface DeferTriggerWithTargetBase extends DeferTriggerBase {\n targetName: string | null;\n\n /**\n * The Xref of the targeted name. May be in a different view.\n */\n targetXref: XrefId | null;\n\n /**\n * The slot index of the named reference, inside the view provided below. This slot may not be\n * inside the current view, and is handled specially as a result.\n */\n targetSlot: SlotHandle | null;\n\n targetView: XrefId | null;\n\n /**\n * Number of steps to walk up or down the view tree to find the target localRef.\n */\n targetSlotViewSteps: number | null;\n}\n\ninterface DeferIdleTrigger extends DeferTriggerBase {\n kind: DeferTriggerKind.Idle;\n}\n\ninterface DeferImmediateTrigger extends DeferTriggerBase {\n kind: DeferTriggerKind.Immediate;\n}\n\ninterface DeferNeverTrigger extends DeferTriggerBase {\n kind: DeferTriggerKind.Never;\n}\n\ninterface DeferHoverTrigger extends DeferTriggerWithTargetBase {\n kind: DeferTriggerKind.Hover;\n}\n\ninterface DeferTimerTrigger extends DeferTriggerBase {\n kind: DeferTriggerKind.Timer;\n\n delay: number;\n}\n\ninterface DeferInteractionTrigger extends DeferTriggerWithTargetBase {\n kind: DeferTriggerKind.Interaction;\n}\n\ninterface DeferViewportTrigger extends DeferTriggerWithTargetBase {\n kind: DeferTriggerKind.Viewport;\n}\n\n/**\n * The union type of all defer trigger interfaces.\n */\nexport type DeferTrigger =\n | DeferIdleTrigger\n | DeferImmediateTrigger\n | DeferTimerTrigger\n | DeferHoverTrigger\n | DeferInteractionTrigger\n | DeferViewportTrigger\n | DeferNeverTrigger;\n\nexport interface DeferOnOp extends Op {\n kind: OpKind.DeferOn;\n\n defer: XrefId;\n\n /**\n * The trigger for this defer op (e.g. idle, hover, etc).\n */\n trigger: DeferTrigger;\n\n /**\n * Modifier set on the trigger by the user (e.g. `hydrate`, `prefetch` etc).\n */\n modifier: DeferOpModifierKind;\n\n sourceSpan: ParseSourceSpan;\n}\n\nexport function createDeferOnOp(\n defer: XrefId,\n trigger: DeferTrigger,\n modifier: DeferOpModifierKind,\n sourceSpan: ParseSourceSpan,\n): DeferOnOp {\n return {\n kind: OpKind.DeferOn,\n defer,\n trigger,\n modifier,\n sourceSpan,\n ...NEW_OP,\n };\n}\n\n/**\n * Op that reserves a slot during creation time for a `@let` declaration.\n */\nexport interface DeclareLetOp extends Op, ConsumesSlotOpTrait {\n kind: OpKind.DeclareLet;\n xref: XrefId;\n sourceSpan: ParseSourceSpan;\n declaredName: string;\n}\n\n/**\n * Creates a `DeclareLetOp`.\n */\nexport function createDeclareLetOp(\n xref: XrefId,\n declaredName: string,\n sourceSpan: ParseSourceSpan,\n): DeclareLetOp {\n return {\n kind: OpKind.DeclareLet,\n xref,\n declaredName,\n sourceSpan,\n handle: new SlotHandle(),\n ...TRAIT_CONSUMES_SLOT,\n ...NEW_OP,\n };\n}\n\n/**\n * Represents a single value in an i18n param map. Each placeholder in the map may have multiple of\n * these values associated with it.\n */\nexport interface I18nParamValue {\n /**\n * The value. This can be either a slot number, special string, or compound-value consisting of an\n * element slot number and template slot number.\n */\n value: string | number | {element: number; template: number};\n\n /**\n * The sub-template index associated with the value.\n */\n subTemplateIndex: number | null;\n\n /**\n * Flags associated with the value.\n */\n flags: I18nParamValueFlags;\n}\n\n/**\n * Represents an i18n message that has been extracted for inclusion in the consts array.\n */\nexport interface I18nMessageOp extends Op {\n kind: OpKind.I18nMessage;\n\n /**\n * An id used to reference this message.\n */\n xref: XrefId;\n\n /**\n * The context from which this message was extracted\n * TODO: remove this, and add another property here instead to match ExtractedAttributes\n */\n i18nContext: XrefId;\n\n /**\n * A reference to the i18n op this message was extracted from.\n *\n * This might be null, which means this message is not associated with a block. This probably\n * means it is an i18n attribute's message.\n */\n i18nBlock: XrefId | null;\n\n /**\n * The i18n message represented by this op.\n */\n message: i18n.Message;\n\n /**\n * The placeholder used for this message when it is referenced in another message.\n * For a top-level message that isn't referenced from another message, this will be null.\n */\n messagePlaceholder: string | null;\n\n /**\n * Whether this message needs post-processing.\n */\n needsPostprocessing: boolean;\n\n /**\n * The param map, with placeholders represented as an `Expression`.\n */\n params: Map;\n\n /**\n * The post-processing param map, with placeholders represented as an `Expression`.\n */\n postprocessingParams: Map;\n\n /**\n * A list of sub-messages that are referenced by this message.\n */\n subMessages: XrefId[];\n}\n\n/**\n * Create an `ExtractedMessageOp`.\n */\nexport function createI18nMessageOp(\n xref: XrefId,\n i18nContext: XrefId,\n i18nBlock: XrefId | null,\n message: i18n.Message,\n messagePlaceholder: string | null,\n params: Map,\n postprocessingParams: Map,\n needsPostprocessing: boolean,\n): I18nMessageOp {\n return {\n kind: OpKind.I18nMessage,\n xref,\n i18nContext,\n i18nBlock,\n message,\n messagePlaceholder,\n params,\n postprocessingParams,\n needsPostprocessing,\n subMessages: [],\n ...NEW_OP,\n };\n}\n\nexport interface I18nOpBase extends Op, ConsumesSlotOpTrait {\n kind: OpKind.I18nStart | OpKind.I18n;\n\n /**\n * `XrefId` allocated for this i18n block.\n */\n xref: XrefId;\n\n /**\n * A reference to the root i18n block that this one belongs to. For a root i18n block, this is\n * the same as xref.\n */\n root: XrefId;\n\n /**\n * The i18n metadata associated with this op.\n */\n message: i18n.Message;\n\n /**\n * The index in the consts array where the message i18n message is stored.\n */\n messageIndex: ConstIndex | null;\n\n /**\n * The index of this sub-block in the i18n message. For a root i18n block, this is null.\n */\n subTemplateIndex: number | null;\n\n /**\n * The i18n context generated from this block. Initially null, until the context is created.\n */\n context: XrefId | null;\n\n sourceSpan: ParseSourceSpan | null;\n}\n\n/**\n * Represents an empty i18n block.\n */\nexport interface I18nOp extends I18nOpBase {\n kind: OpKind.I18n;\n}\n\n/**\n * Represents the start of an i18n block.\n */\nexport interface I18nStartOp extends I18nOpBase {\n kind: OpKind.I18nStart;\n}\n\n/**\n * Create an `I18nStartOp`.\n */\nexport function createI18nStartOp(\n xref: XrefId,\n message: i18n.Message,\n root: XrefId | undefined,\n sourceSpan: ParseSourceSpan | null,\n): I18nStartOp {\n return {\n kind: OpKind.I18nStart,\n xref,\n handle: new SlotHandle(),\n root: root ?? xref,\n message,\n messageIndex: null,\n subTemplateIndex: null,\n context: null,\n sourceSpan,\n ...NEW_OP,\n ...TRAIT_CONSUMES_SLOT,\n };\n}\n\n/**\n * Represents the end of an i18n block.\n */\nexport interface I18nEndOp extends Op {\n kind: OpKind.I18nEnd;\n\n /**\n * The `XrefId` of the `I18nStartOp` that created this block.\n */\n xref: XrefId;\n\n sourceSpan: ParseSourceSpan | null;\n}\n\n/**\n * Create an `I18nEndOp`.\n */\nexport function createI18nEndOp(xref: XrefId, sourceSpan: ParseSourceSpan | null): I18nEndOp {\n return {\n kind: OpKind.I18nEnd,\n xref,\n sourceSpan,\n ...NEW_OP,\n };\n}\n\n/**\n * An op that represents the start of an ICU expression.\n */\nexport interface IcuStartOp extends Op {\n kind: OpKind.IcuStart;\n\n /**\n * The ID of the ICU.\n */\n xref: XrefId;\n\n /**\n * The i18n message for this ICU.\n */\n message: i18n.Message;\n\n /**\n * Placeholder used to reference this ICU in other i18n messages.\n */\n messagePlaceholder: string;\n\n /**\n * A reference to the i18n context for this op. Initially null, until the context is created.\n */\n context: XrefId | null;\n\n sourceSpan: ParseSourceSpan;\n}\n\n/**\n * Creates an ICU start op.\n */\nexport function createIcuStartOp(\n xref: XrefId,\n message: i18n.Message,\n messagePlaceholder: string,\n sourceSpan: ParseSourceSpan,\n): IcuStartOp {\n return {\n kind: OpKind.IcuStart,\n xref,\n message,\n messagePlaceholder,\n context: null,\n sourceSpan,\n ...NEW_OP,\n };\n}\n\n/**\n * An op that represents the end of an ICU expression.\n */\nexport interface IcuEndOp extends Op {\n kind: OpKind.IcuEnd;\n\n /**\n * The ID of the corresponding IcuStartOp.\n */\n xref: XrefId;\n}\n\n/**\n * Creates an ICU end op.\n */\nexport function createIcuEndOp(xref: XrefId): IcuEndOp {\n return {\n kind: OpKind.IcuEnd,\n xref,\n ...NEW_OP,\n };\n}\n\n/**\n * An op that represents a placeholder in an ICU expression.\n */\nexport interface IcuPlaceholderOp extends Op {\n kind: OpKind.IcuPlaceholder;\n\n /**\n * The ID of the ICU placeholder.\n */\n xref: XrefId;\n\n /**\n * The name of the placeholder in the ICU expression.\n */\n name: string;\n\n /**\n * The static strings to be combined with dynamic expression values to form the text. This works\n * like interpolation, but the strings are combined at compile time, using special placeholders\n * for the dynamic expressions, and put into the translated message.\n */\n strings: string[];\n\n /**\n * Placeholder values for the i18n expressions to be combined with the static strings to form the\n * full placeholder value.\n */\n expressionPlaceholders: I18nParamValue[];\n}\n\n/**\n * Creates an ICU placeholder op.\n */\nexport function createIcuPlaceholderOp(\n xref: XrefId,\n name: string,\n strings: string[],\n): IcuPlaceholderOp {\n return {\n kind: OpKind.IcuPlaceholder,\n xref,\n name,\n strings,\n expressionPlaceholders: [],\n ...NEW_OP,\n };\n}\n\n/**\n * An i18n context that is used to generate a translated i18n message. A separate context is created\n * for three different scenarios:\n *\n * 1. For each top-level i18n block.\n * 2. For each ICU referenced as a sub-message. ICUs that are referenced as a sub-message will be\n * used to generate a separate i18n message, but will not be extracted directly into the consts\n * array. Instead they will be pulled in as part of the initialization statements for the message\n * that references them.\n * 3. For each i18n attribute.\n *\n * Child i18n blocks, resulting from the use of an ng-template inside of a parent i18n block, do not\n * generate a separate context. Instead their content is included in the translated message for\n * their root block.\n */\nexport interface I18nContextOp extends Op {\n kind: OpKind.I18nContext;\n\n contextKind: I18nContextKind;\n\n /**\n * The id of this context.\n */\n xref: XrefId;\n\n /**\n * A reference to the I18nStartOp or I18nOp this context belongs to.\n *\n * It is possible for multiple contexts to belong to the same block, since both the block and any\n * ICUs inside the block will each get their own context.\n *\n * This might be `null`, in which case the context is not associated with an i18n block. This\n * probably means that it belongs to an i18n attribute.\n */\n i18nBlock: XrefId | null;\n\n /**\n * The i18n message associated with this context.\n */\n message: i18n.Message;\n\n /**\n * The param map for this context.\n */\n params: Map;\n\n /**\n * The post-processing param map for this context.\n */\n postprocessingParams: Map;\n\n sourceSpan: ParseSourceSpan;\n}\n\nexport function createI18nContextOp(\n contextKind: I18nContextKind,\n xref: XrefId,\n i18nBlock: XrefId | null,\n message: i18n.Message,\n sourceSpan: ParseSourceSpan,\n): I18nContextOp {\n if (i18nBlock === null && contextKind !== I18nContextKind.Attr) {\n throw new Error('AssertionError: i18nBlock must be provided for non-attribute contexts.');\n }\n\n return {\n kind: OpKind.I18nContext,\n contextKind,\n xref,\n i18nBlock,\n message,\n sourceSpan,\n params: new Map(),\n postprocessingParams: new Map(),\n ...NEW_OP,\n };\n}\n\nexport interface I18nAttributesOp extends Op, ConsumesSlotOpTrait {\n kind: OpKind.I18nAttributes;\n\n /**\n * The element targeted by these attributes.\n */\n target: XrefId;\n\n /**\n * I18nAttributes instructions correspond to a const array with configuration information.\n */\n i18nAttributesConfig: ConstIndex | null;\n}\n\nexport function createI18nAttributesOp(\n xref: XrefId,\n handle: SlotHandle,\n target: XrefId,\n): I18nAttributesOp {\n return {\n kind: OpKind.I18nAttributes,\n xref,\n handle,\n target,\n i18nAttributesConfig: null,\n ...NEW_OP,\n ...TRAIT_CONSUMES_SLOT,\n };\n}\n\n/** Describes a location at which an element is defined within a template. */\nexport interface ElementSourceLocation {\n targetSlot: SlotHandle;\n offset: number;\n line: number;\n column: number;\n}\n\n/**\n * Op that attaches the location at which each element is defined within the source template.\n */\nexport interface SourceLocationOp extends Op {\n kind: OpKind.SourceLocation;\n templatePath: string;\n locations: ElementSourceLocation[];\n}\n\n/** Create a `SourceLocationOp`. */\nexport function createSourceLocationOp(\n templatePath: string,\n locations: ElementSourceLocation[],\n): SourceLocationOp {\n return {\n kind: OpKind.SourceLocation,\n templatePath,\n locations,\n ...NEW_OP,\n };\n}\n\n/**\n * An index into the `consts` array which is shared across the compilation of all views in a\n * component.\n */\nexport type ConstIndex = number & {__brand: 'ConstIndex'};\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../../../src/output/output_ast';\nimport {ParseSourceSpan} from '../../../../../../src/parse_util';\nimport {SecurityContext} from '../../../../../core';\nimport {OpKind} from '../enums';\nimport {Op, XrefId} from '../operations';\nimport {ConsumesVarsTrait, TRAIT_CONSUMES_VARS} from '../traits';\n\nimport {NEW_OP} from './shared';\n\nimport type {Interpolation, UpdateOp} from './update';\n\n/**\n * Logical operation representing a host binding to a property.\n */\nexport interface HostPropertyOp extends Op, ConsumesVarsTrait {\n kind: OpKind.HostProperty;\n name: string;\n expression: o.Expression | Interpolation;\n isAnimationTrigger: boolean;\n\n i18nContext: XrefId | null;\n\n securityContext: SecurityContext | SecurityContext[];\n\n sanitizer: o.Expression | null;\n\n sourceSpan: ParseSourceSpan | null;\n}\n\nexport function createHostPropertyOp(\n name: string,\n expression: o.Expression | Interpolation,\n isAnimationTrigger: boolean,\n i18nContext: XrefId | null,\n securityContext: SecurityContext | SecurityContext[],\n sourceSpan: ParseSourceSpan | null,\n): HostPropertyOp {\n return {\n kind: OpKind.HostProperty,\n name,\n expression,\n isAnimationTrigger,\n i18nContext,\n securityContext,\n sanitizer: null,\n sourceSpan,\n ...TRAIT_CONSUMES_VARS,\n ...NEW_OP,\n };\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport type {SemanticVariableKind} from './enums';\nimport type {XrefId} from './operations';\n\n/**\n * Union type for the different kinds of variables.\n */\nexport type SemanticVariable =\n | ContextVariable\n | IdentifierVariable\n | SavedViewVariable\n | AliasVariable;\n\nexport interface SemanticVariableBase {\n kind: SemanticVariableKind;\n\n /**\n * Name assigned to this variable in generated code, or `null` if not yet assigned.\n */\n name: string | null;\n}\n\n/**\n * When referenced in the template's context parameters, this indicates a reference to the entire\n * context object, rather than a specific parameter.\n */\nexport const CTX_REF = 'CTX_REF_MARKER';\n\n/**\n * A variable that represents the context of a particular view.\n */\nexport interface ContextVariable extends SemanticVariableBase {\n kind: SemanticVariableKind.Context;\n\n /**\n * `XrefId` of the view that this variable represents.\n */\n view: XrefId;\n}\n\n/**\n * A variable that represents a specific identifier within a template.\n */\nexport interface IdentifierVariable extends SemanticVariableBase {\n kind: SemanticVariableKind.Identifier;\n\n /**\n * The identifier whose value in the template is tracked in this variable.\n */\n identifier: string;\n\n /**\n * Whether the variable was declared locally within the same view or somewhere else.\n */\n local: boolean;\n}\n\n/**\n * A variable that represents a saved view context.\n */\nexport interface SavedViewVariable extends SemanticVariableBase {\n kind: SemanticVariableKind.SavedView;\n\n /**\n * The view context saved in this variable.\n */\n view: XrefId;\n}\n\n/**\n * A variable that will be inlined at every location it is used. An alias is also allowed to depend\n * on the value of a semantic variable.\n */\nexport interface AliasVariable extends SemanticVariableBase {\n kind: SemanticVariableKind.Alias;\n identifier: string;\n expression: o.Expression;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ConstantPool} from '../../../constant_pool';\nimport * as o from '../../../output/output_ast';\nimport {R3ComponentDeferMetadata} from '../../../render3/view/api';\nimport * as ir from '../ir';\n\nexport enum CompilationJobKind {\n Tmpl,\n Host,\n Both, // A special value used to indicate that some logic applies to both compilation types\n}\n\n/**\n * An entire ongoing compilation, which will result in one or more template functions when complete.\n * Contains one or more corresponding compilation units.\n */\nexport abstract class CompilationJob {\n constructor(\n readonly componentName: string,\n readonly pool: ConstantPool,\n readonly compatibility: ir.CompatibilityMode,\n ) {}\n\n kind: CompilationJobKind = CompilationJobKind.Both;\n\n /**\n * A compilation job will contain one or more compilation units.\n */\n abstract get units(): Iterable;\n\n /**\n * The root compilation unit, such as the component's template, or the host binding's compilation\n * unit.\n */\n abstract root: CompilationUnit;\n\n /**\n * A unique string used to identify this kind of job, and generate the template function (as a\n * suffix of the name).\n */\n abstract fnSuffix: string;\n\n /**\n * Generate a new unique `ir.XrefId` in this job.\n */\n allocateXrefId(): ir.XrefId {\n return this.nextXrefId++ as ir.XrefId;\n }\n\n /**\n * Tracks the next `ir.XrefId` which can be assigned as template structures are ingested.\n */\n private nextXrefId: ir.XrefId = 0 as ir.XrefId;\n}\n\n/**\n * Compilation-in-progress of a whole component's template, including the main template and any\n * embedded views or host bindings.\n */\nexport class ComponentCompilationJob extends CompilationJob {\n constructor(\n componentName: string,\n pool: ConstantPool,\n compatibility: ir.CompatibilityMode,\n readonly relativeContextFilePath: string,\n readonly i18nUseExternalIds: boolean,\n readonly deferMeta: R3ComponentDeferMetadata,\n readonly allDeferrableDepsFn: o.ReadVarExpr | null,\n readonly relativeTemplatePath: string | null,\n readonly enableDebugLocations: boolean,\n ) {\n super(componentName, pool, compatibility);\n this.root = new ViewCompilationUnit(this, this.allocateXrefId(), null);\n this.views.set(this.root.xref, this.root);\n }\n\n override kind = CompilationJobKind.Tmpl;\n\n override readonly fnSuffix: string = 'Template';\n\n /**\n * The root view, representing the component's template.\n */\n override readonly root: ViewCompilationUnit;\n\n readonly views = new Map();\n\n /**\n * Causes ngContentSelectors to be emitted, for content projection slots in the view. Possibly a\n * reference into the constant pool.\n */\n public contentSelectors: o.Expression | null = null;\n\n /**\n * Add a `ViewCompilation` for a new embedded view to this compilation.\n */\n allocateView(parent: ir.XrefId): ViewCompilationUnit {\n const view = new ViewCompilationUnit(this, this.allocateXrefId(), parent);\n this.views.set(view.xref, view);\n return view;\n }\n\n override get units(): Iterable {\n return this.views.values();\n }\n\n /**\n * Add a constant `o.Expression` to the compilation and return its index in the `consts` array.\n */\n addConst(newConst: o.Expression, initializers?: o.Statement[]): ir.ConstIndex {\n for (let idx = 0; idx < this.consts.length; idx++) {\n if (this.consts[idx].isEquivalent(newConst)) {\n return idx as ir.ConstIndex;\n }\n }\n const idx = this.consts.length;\n this.consts.push(newConst);\n if (initializers) {\n this.constsInitializers.push(...initializers);\n }\n return idx as ir.ConstIndex;\n }\n\n /**\n * Constant expressions used by operations within this component's compilation.\n *\n * This will eventually become the `consts` array in the component definition.\n */\n readonly consts: o.Expression[] = [];\n\n /**\n * Initialization statements needed to set up the consts.\n */\n readonly constsInitializers: o.Statement[] = [];\n}\n\n/**\n * A compilation unit is compiled into a template function. Some example units are views and host\n * bindings.\n */\nexport abstract class CompilationUnit {\n constructor(readonly xref: ir.XrefId) {}\n\n /**\n * List of creation operations for this view.\n *\n * Creation operations may internally contain other operations, including update operations.\n */\n readonly create = new ir.OpList();\n\n /**\n * List of update operations for this view.\n */\n readonly update = new ir.OpList();\n\n /**\n * The enclosing job, which might contain several individual compilation units.\n */\n abstract readonly job: CompilationJob;\n\n /**\n * Name of the function which will be generated for this unit.\n *\n * May be `null` if not yet determined.\n */\n fnName: string | null = null;\n\n /**\n * Number of variable slots used within this view, or `null` if variables have not yet been\n * counted.\n */\n vars: number | null = null;\n\n /**\n * Iterate over all `ir.Op`s within this view.\n *\n * Some operations may have child operations, which this iterator will visit.\n */\n *ops(): Generator {\n for (const op of this.create) {\n yield op;\n if (op.kind === ir.OpKind.Listener || op.kind === ir.OpKind.TwoWayListener) {\n for (const listenerOp of op.handlerOps) {\n yield listenerOp;\n }\n } else if (op.kind === ir.OpKind.RepeaterCreate && op.trackByOps !== null) {\n for (const trackOp of op.trackByOps) {\n yield trackOp;\n }\n }\n }\n for (const op of this.update) {\n yield op;\n }\n }\n}\n\n/**\n * Compilation-in-progress of an individual view within a template.\n */\nexport class ViewCompilationUnit extends CompilationUnit {\n constructor(\n readonly job: ComponentCompilationJob,\n xref: ir.XrefId,\n readonly parent: ir.XrefId | null,\n ) {\n super(xref);\n }\n\n /**\n * Map of declared variables available within this view to the property on the context object\n * which they alias.\n */\n readonly contextVariables = new Map();\n\n /**\n * Set of aliases available within this view. An alias is a variable whose provided expression is\n * inlined at every location it is used. It may also depend on context variables, by name.\n */\n readonly aliases = new Set();\n\n /**\n * Number of declaration slots used within this view, or `null` if slots have not yet been\n * allocated.\n */\n decls: number | null = null;\n}\n\n/**\n * Compilation-in-progress of a host binding, which contains a single unit for that host binding.\n */\nexport class HostBindingCompilationJob extends CompilationJob {\n constructor(componentName: string, pool: ConstantPool, compatibility: ir.CompatibilityMode) {\n super(componentName, pool, compatibility);\n this.root = new HostBindingCompilationUnit(this);\n }\n\n override kind = CompilationJobKind.Host;\n\n override readonly fnSuffix: string = 'HostBindings';\n\n override readonly root: HostBindingCompilationUnit;\n\n override get units(): Iterable {\n return [this.root];\n }\n}\n\nexport class HostBindingCompilationUnit extends CompilationUnit {\n constructor(readonly job: HostBindingCompilationJob) {\n super(0 as ir.XrefId);\n }\n\n /**\n * Much like an element can have attributes, so can a host binding function.\n */\n attributes: o.LiteralArrayExpr | null = null;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * Find any function calls to `$any`, excluding `this.$any`, and delete them, since they have no\n * runtime effects.\n */\nexport function deleteAnyCasts(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n ir.transformExpressionsInOp(op, removeAnys, ir.VisitorContextFlag.None);\n }\n }\n}\n\nfunction removeAnys(e: o.Expression): o.Expression {\n if (\n e instanceof o.InvokeFunctionExpr &&\n e.fn instanceof ir.LexicalReadExpr &&\n e.fn.name === '$any'\n ) {\n if (e.args.length !== 1) {\n throw new Error('The $any builtin function expects exactly one argument.');\n }\n return e.args[0];\n }\n return e;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * Adds apply operations after i18n expressions.\n */\nexport function applyI18nExpressions(job: CompilationJob): void {\n const i18nContexts = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.I18nContext) {\n i18nContexts.set(op.xref, op);\n }\n }\n }\n\n for (const unit of job.units) {\n for (const op of unit.update) {\n // Only add apply after expressions that are not followed by more expressions.\n if (op.kind === ir.OpKind.I18nExpression && needsApplication(i18nContexts, op)) {\n // TODO: what should be the source span for the apply op?\n ir.OpList.insertAfter(\n ir.createI18nApplyOp(op.i18nOwner, op.handle, null!),\n op,\n );\n }\n }\n }\n}\n\n/**\n * Checks whether the given expression op needs to be followed with an apply op.\n */\nfunction needsApplication(i18nContexts: Map, op: ir.I18nExpressionOp) {\n // If the next op is not another expression, we need to apply.\n if (op.next?.kind !== ir.OpKind.I18nExpression) {\n return true;\n }\n\n const context = i18nContexts.get(op.context);\n const nextContext = i18nContexts.get(op.next.context);\n\n if (context === undefined) {\n throw new Error(\n \"AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context\",\n );\n }\n\n if (nextContext === undefined) {\n throw new Error(\n \"AssertionError: expected an I18nContextOp to exist for the next I18nExpressionOp's context\",\n );\n }\n\n // If the next op is an expression targeting a different i18n block (or different element, in the\n // case of i18n attributes), we need to apply.\n\n // First, handle the case of i18n blocks.\n if (context.i18nBlock !== null) {\n // This is a block context. Compare the blocks.\n if (context.i18nBlock !== nextContext.i18nBlock) {\n return true;\n }\n return false;\n }\n\n // Second, handle the case of i18n attributes.\n if (op.i18nOwner !== op.next.i18nOwner) {\n return true;\n }\n return false;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\ninterface BlockState {\n blockXref: ir.XrefId;\n lastSlotConsumer: ir.XrefId;\n}\n\n/**\n * Updates i18n expression ops to target the last slot in their owning i18n block, and moves them\n * after the last update instruction that depends on that slot.\n */\nexport function assignI18nSlotDependencies(job: CompilationJob) {\n for (const unit of job.units) {\n // The first update op.\n let updateOp = unit.update.head;\n\n // I18n expressions currently being moved during the iteration.\n let i18nExpressionsInProgress: ir.I18nExpressionOp[] = [];\n\n // Non-null while we are iterating through an i18nStart/i18nEnd pair\n let state: BlockState | null = null;\n\n for (const createOp of unit.create) {\n if (createOp.kind === ir.OpKind.I18nStart) {\n state = {\n blockXref: createOp.xref,\n lastSlotConsumer: createOp.xref,\n };\n } else if (createOp.kind === ir.OpKind.I18nEnd) {\n for (const op of i18nExpressionsInProgress) {\n op.target = state!.lastSlotConsumer;\n ir.OpList.insertBefore(op as ir.UpdateOp, updateOp!);\n }\n i18nExpressionsInProgress.length = 0;\n state = null;\n }\n\n if (ir.hasConsumesSlotTrait(createOp)) {\n if (state !== null) {\n state.lastSlotConsumer = createOp.xref;\n }\n\n while (true) {\n if (updateOp.next === null) {\n break;\n }\n\n if (\n state !== null &&\n updateOp.kind === ir.OpKind.I18nExpression &&\n updateOp.usage === ir.I18nExpressionFor.I18nText &&\n updateOp.i18nOwner === state.blockXref\n ) {\n const opToRemove = updateOp;\n updateOp = updateOp.next!;\n ir.OpList.remove(opToRemove);\n i18nExpressionsInProgress.push(opToRemove);\n continue;\n }\n\n if (ir.hasDependsOnSlotContextTrait(updateOp) && updateOp.target !== createOp.xref) {\n break;\n }\n\n updateOp = updateOp.next!;\n }\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationUnit} from '../compilation';\n\n/**\n * Gets a map of all elements in the given view by their xref id.\n */\nexport function createOpXrefMap(\n unit: CompilationUnit,\n): Map {\n const map = new Map();\n for (const op of unit.create) {\n if (!ir.hasConsumesSlotTrait(op)) {\n continue;\n }\n map.set(op.xref, op);\n\n // TODO(dylhunn): `@for` loops with `@empty` blocks need to be special-cased here,\n // because the slot consumer trait currently only supports one slot per consumer and we\n // need two. This should be revisited when making the refactors mentioned in:\n // https://github.com/angular/angular/pull/53620#discussion_r1430918822\n if (op.kind === ir.OpKind.RepeaterCreate && op.emptyView !== null) {\n map.set(op.emptyView, op);\n }\n }\n return map;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SecurityContext} from '../../../../core';\nimport * as ir from '../../ir';\nimport {CompilationJobKind, type CompilationJob, type CompilationUnit} from '../compilation';\nimport {createOpXrefMap} from '../util/elements';\n\n/**\n * Find all extractable attribute and binding ops, and create ExtractedAttributeOps for them.\n * In cases where no instruction needs to be generated for the attribute or binding, it is removed.\n */\nexport function extractAttributes(job: CompilationJob): void {\n for (const unit of job.units) {\n const elements = createOpXrefMap(unit);\n for (const op of unit.ops()) {\n switch (op.kind) {\n case ir.OpKind.Attribute:\n extractAttributeOp(unit, op, elements);\n break;\n case ir.OpKind.Property:\n if (!op.isAnimationTrigger) {\n let bindingKind: ir.BindingKind;\n if (op.i18nMessage !== null && op.templateKind === null) {\n // If the binding has an i18n context, it is an i18n attribute, and should have that\n // kind in the consts array.\n bindingKind = ir.BindingKind.I18n;\n } else if (op.isStructuralTemplateAttribute) {\n bindingKind = ir.BindingKind.Template;\n } else {\n bindingKind = ir.BindingKind.Property;\n }\n\n ir.OpList.insertBefore(\n // Deliberately null i18nMessage value\n ir.createExtractedAttributeOp(\n op.target,\n bindingKind,\n null,\n op.name,\n /* expression */ null,\n /* i18nContext */ null,\n /* i18nMessage */ null,\n op.securityContext,\n ),\n lookupElement(elements, op.target),\n );\n }\n break;\n case ir.OpKind.TwoWayProperty:\n ir.OpList.insertBefore(\n ir.createExtractedAttributeOp(\n op.target,\n ir.BindingKind.TwoWayProperty,\n null,\n op.name,\n /* expression */ null,\n /* i18nContext */ null,\n /* i18nMessage */ null,\n op.securityContext,\n ),\n lookupElement(elements, op.target),\n );\n break;\n case ir.OpKind.StyleProp:\n case ir.OpKind.ClassProp:\n // TODO: Can style or class bindings be i18n attributes?\n\n // The old compiler treated empty style bindings as regular bindings for the purpose of\n // directive matching. That behavior is incorrect, but we emulate it in compatibility\n // mode.\n if (\n unit.job.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder &&\n op.expression instanceof ir.EmptyExpr\n ) {\n ir.OpList.insertBefore(\n ir.createExtractedAttributeOp(\n op.target,\n ir.BindingKind.Property,\n null,\n op.name,\n /* expression */ null,\n /* i18nContext */ null,\n /* i18nMessage */ null,\n SecurityContext.STYLE,\n ),\n lookupElement(elements, op.target),\n );\n }\n break;\n case ir.OpKind.Listener:\n if (!op.isAnimationListener) {\n const extractedAttributeOp = ir.createExtractedAttributeOp(\n op.target,\n ir.BindingKind.Property,\n null,\n op.name,\n /* expression */ null,\n /* i18nContext */ null,\n /* i18nMessage */ null,\n SecurityContext.NONE,\n );\n if (job.kind === CompilationJobKind.Host) {\n if (job.compatibility) {\n // TemplateDefinitionBuilder does not extract listener bindings to the const array\n // (which is honestly pretty inconsistent).\n break;\n }\n // This attribute will apply to the enclosing host binding compilation unit, so order\n // doesn't matter.\n unit.create.push(extractedAttributeOp);\n } else {\n ir.OpList.insertBefore(\n extractedAttributeOp,\n lookupElement(elements, op.target),\n );\n }\n }\n break;\n case ir.OpKind.TwoWayListener:\n // Two-way listeners aren't supported in host bindings.\n if (job.kind !== CompilationJobKind.Host) {\n const extractedAttributeOp = ir.createExtractedAttributeOp(\n op.target,\n ir.BindingKind.Property,\n null,\n op.name,\n /* expression */ null,\n /* i18nContext */ null,\n /* i18nMessage */ null,\n SecurityContext.NONE,\n );\n ir.OpList.insertBefore(\n extractedAttributeOp,\n lookupElement(elements, op.target),\n );\n }\n break;\n }\n }\n }\n}\n\n/**\n * Looks up an element in the given map by xref ID.\n */\nfunction lookupElement(\n elements: Map,\n xref: ir.XrefId,\n): ir.ConsumesSlotOpTrait & ir.CreateOp {\n const el = elements.get(xref);\n if (el === undefined) {\n throw new Error('All attributes should have an element-like target.');\n }\n return el;\n}\n\n/**\n * Extracts an attribute binding.\n */\nfunction extractAttributeOp(\n unit: CompilationUnit,\n op: ir.AttributeOp,\n elements: Map,\n) {\n if (op.expression instanceof ir.Interpolation) {\n return;\n }\n\n let extractable = op.isTextAttribute || op.expression.isConstant();\n if (unit.job.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder) {\n // TemplateDefinitionBuilder only extracts text attributes. It does not extract attriibute\n // bindings, even if they are constants.\n extractable &&= op.isTextAttribute;\n }\n\n if (extractable) {\n const extractedAttributeOp = ir.createExtractedAttributeOp(\n op.target,\n op.isStructuralTemplateAttribute ? ir.BindingKind.Template : ir.BindingKind.Attribute,\n op.namespace,\n op.name,\n op.expression,\n op.i18nContext,\n op.i18nMessage,\n op.securityContext,\n );\n if (unit.job.kind === CompilationJobKind.Host) {\n // This attribute will apply to the enclosing host binding compilation unit, so order doesn't\n // matter.\n unit.create.push(extractedAttributeOp);\n } else {\n const ownerOp = lookupElement(elements, op.target);\n ir.OpList.insertBefore(extractedAttributeOp, ownerOp);\n }\n ir.OpList.remove(op);\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {splitNsName} from '../../../../ml_parser/tags';\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport {CompilationJob, CompilationJobKind} from '../compilation';\n\n/**\n * Looks up an element in the given map by xref ID.\n */\nfunction lookupElement(\n elements: Map,\n xref: ir.XrefId,\n): ir.ElementOrContainerOps {\n const el = elements.get(xref);\n if (el === undefined) {\n throw new Error('All attributes should have an element-like target.');\n }\n return el;\n}\n\nexport function specializeBindings(job: CompilationJob): void {\n const elements = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (!ir.isElementOrContainerOp(op)) {\n continue;\n }\n elements.set(op.xref, op);\n }\n }\n\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n if (op.kind !== ir.OpKind.Binding) {\n continue;\n }\n switch (op.bindingKind) {\n case ir.BindingKind.Attribute:\n if (op.name === 'ngNonBindable') {\n ir.OpList.remove(op);\n const target = lookupElement(elements, op.target);\n target.nonBindable = true;\n } else {\n const [namespace, name] = splitNsName(op.name);\n ir.OpList.replace(\n op,\n ir.createAttributeOp(\n op.target,\n namespace,\n name,\n op.expression,\n op.securityContext,\n op.isTextAttribute,\n op.isStructuralTemplateAttribute,\n op.templateKind,\n op.i18nMessage,\n op.sourceSpan,\n ),\n );\n }\n break;\n case ir.BindingKind.Property:\n case ir.BindingKind.Animation:\n if (job.kind === CompilationJobKind.Host) {\n ir.OpList.replace(\n op,\n ir.createHostPropertyOp(\n op.name,\n op.expression,\n op.bindingKind === ir.BindingKind.Animation,\n op.i18nContext,\n op.securityContext,\n op.sourceSpan,\n ),\n );\n } else {\n ir.OpList.replace(\n op,\n ir.createPropertyOp(\n op.target,\n op.name,\n op.expression,\n op.bindingKind === ir.BindingKind.Animation,\n op.securityContext,\n op.isStructuralTemplateAttribute,\n op.templateKind,\n op.i18nContext,\n op.i18nMessage,\n op.sourceSpan,\n ),\n );\n }\n\n break;\n case ir.BindingKind.TwoWayProperty:\n if (!(op.expression instanceof o.Expression)) {\n // We shouldn't be able to hit this code path since interpolations in two-way bindings\n // result in a parser error. We assert here so that downstream we can assume that\n // the value is always an expression.\n throw new Error(\n `Expected value of two-way property binding \"${op.name}\" to be an expression`,\n );\n }\n\n ir.OpList.replace(\n op,\n ir.createTwoWayPropertyOp(\n op.target,\n op.name,\n op.expression,\n op.securityContext,\n op.isStructuralTemplateAttribute,\n op.templateKind,\n op.i18nContext,\n op.i18nMessage,\n op.sourceSpan,\n ),\n );\n break;\n case ir.BindingKind.I18n:\n case ir.BindingKind.ClassName:\n case ir.BindingKind.StyleProperty:\n throw new Error(`Unhandled binding of kind ${ir.BindingKind[op.bindingKind]}`);\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport {Identifiers as R3} from '../../../../render3/r3_identifiers';\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\nconst CHAINABLE = new Set([\n R3.attribute,\n R3.classProp,\n R3.element,\n R3.elementContainer,\n R3.elementContainerEnd,\n R3.elementContainerStart,\n R3.elementEnd,\n R3.elementStart,\n R3.hostProperty,\n R3.i18nExp,\n R3.listener,\n R3.listener,\n R3.property,\n R3.styleProp,\n R3.stylePropInterpolate1,\n R3.stylePropInterpolate2,\n R3.stylePropInterpolate3,\n R3.stylePropInterpolate4,\n R3.stylePropInterpolate5,\n R3.stylePropInterpolate6,\n R3.stylePropInterpolate7,\n R3.stylePropInterpolate8,\n R3.stylePropInterpolateV,\n R3.syntheticHostListener,\n R3.syntheticHostProperty,\n R3.templateCreate,\n R3.twoWayProperty,\n R3.twoWayListener,\n R3.declareLet,\n]);\n\n/**\n * Chaining results in repeated call expressions, causing a deep AST of receiver expressions. To prevent running out of\n * stack depth the maximum number of chained instructions is limited to this threshold, which has been selected\n * arbitrarily.\n */\nconst MAX_CHAIN_LENGTH = 256;\n\n/**\n * Post-process a reified view compilation and convert sequential calls to chainable instructions\n * into chain calls.\n *\n * For example, two `elementStart` operations in sequence:\n *\n * ```ts\n * elementStart(0, 'div');\n * elementStart(1, 'span');\n * ```\n *\n * Can be called as a chain instead:\n *\n * ```ts\n * elementStart(0, 'div')(1, 'span');\n * ```\n */\nexport function chain(job: CompilationJob): void {\n for (const unit of job.units) {\n chainOperationsInList(unit.create);\n chainOperationsInList(unit.update);\n }\n}\n\nfunction chainOperationsInList(opList: ir.OpList): void {\n let chain: Chain | null = null;\n for (const op of opList) {\n if (op.kind !== ir.OpKind.Statement || !(op.statement instanceof o.ExpressionStatement)) {\n // This type of statement isn't chainable.\n chain = null;\n continue;\n }\n if (\n !(op.statement.expr instanceof o.InvokeFunctionExpr) ||\n !(op.statement.expr.fn instanceof o.ExternalExpr)\n ) {\n // This is a statement, but not an instruction-type call, so not chainable.\n chain = null;\n continue;\n }\n\n const instruction = op.statement.expr.fn.value;\n if (!CHAINABLE.has(instruction)) {\n // This instruction isn't chainable.\n chain = null;\n continue;\n }\n\n // This instruction can be chained. It can either be added on to the previous chain (if\n // compatible) or it can be the start of a new chain.\n if (chain !== null && chain.instruction === instruction && chain.length < MAX_CHAIN_LENGTH) {\n // This instruction can be added onto the previous chain.\n const expression = chain.expression.callFn(\n op.statement.expr.args,\n op.statement.expr.sourceSpan,\n op.statement.expr.pure,\n );\n chain.expression = expression;\n chain.op.statement = expression.toStmt();\n chain.length++;\n ir.OpList.remove(op as ir.Op);\n } else {\n // Leave this instruction alone for now, but consider it the start of a new chain.\n chain = {\n op,\n instruction,\n expression: op.statement.expr,\n length: 1,\n };\n }\n }\n}\n\n/**\n * Structure representing an in-progress chain.\n */\ninterface Chain {\n /**\n * The statement which holds the entire chain.\n */\n op: ir.StatementOp;\n\n /**\n * The expression representing the whole current chained call.\n *\n * This should be the same as `op.statement.expression`, but is extracted here for convenience\n * since the `op` type doesn't capture the fact that `op.statement` is an `o.ExpressionStatement`.\n */\n expression: o.Expression;\n\n /**\n * The instruction that is being chained.\n */\n instruction: o.ExternalReference;\n\n /**\n * The number of instructions that have been collected into this chain.\n */\n length: number;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * Attribute interpolations of the form `[attr.foo]=\"{{foo}}\"\"` should be \"collapsed\" into a plain\n * attribute instruction, instead of an `attributeInterpolate` instruction.\n *\n * (We cannot do this for singleton property interpolations, because `propertyInterpolate`\n * stringifies its expression.)\n *\n * The reification step is also capable of performing this transformation, but doing it early in the\n * pipeline allows other phases to accurately know what instruction will be emitted.\n */\nexport function collapseSingletonInterpolations(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.update) {\n const eligibleOpKind = op.kind === ir.OpKind.Attribute;\n if (\n eligibleOpKind &&\n op.expression instanceof ir.Interpolation &&\n op.expression.strings.length === 2 &&\n op.expression.strings.every((s: string) => s === '')\n ) {\n op.expression = op.expression.expressions[0];\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport {ComponentCompilationJob} from '../compilation';\n\n/**\n * Collapse the various conditions of conditional ops (if, switch) into a single test expression.\n */\nexport function generateConditionalExpressions(job: ComponentCompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n if (op.kind !== ir.OpKind.Conditional) {\n continue;\n }\n\n let test: o.Expression;\n\n // Any case with a `null` condition is `default`. If one exists, default to it instead.\n const defaultCase = op.conditions.findIndex((cond) => cond.expr === null);\n if (defaultCase >= 0) {\n const slot = op.conditions.splice(defaultCase, 1)[0].targetSlot;\n test = new ir.SlotLiteralExpr(slot);\n } else {\n // By default, a switch evaluates to `-1`, causing no template to be displayed.\n test = o.literal(-1);\n }\n\n // Switch expressions assign their main test to a temporary, to avoid re-executing it.\n let tmp = op.test == null ? null : new ir.AssignTemporaryExpr(op.test, job.allocateXrefId());\n\n // For each remaining condition, test whether the temporary satifies the check. (If no temp is\n // present, just check each expression directly.)\n for (let i = op.conditions.length - 1; i >= 0; i--) {\n let conditionalCase = op.conditions[i];\n if (conditionalCase.expr === null) {\n continue;\n }\n if (tmp !== null) {\n const useTmp = i === 0 ? tmp : new ir.ReadTemporaryExpr(tmp.xref);\n conditionalCase.expr = new o.BinaryOperatorExpr(\n o.BinaryOperator.Identical,\n useTmp,\n conditionalCase.expr,\n );\n } else if (conditionalCase.alias !== null) {\n const caseExpressionTemporaryXref = job.allocateXrefId();\n conditionalCase.expr = new ir.AssignTemporaryExpr(\n conditionalCase.expr,\n caseExpressionTemporaryXref,\n );\n op.contextValue = new ir.ReadTemporaryExpr(caseExpressionTemporaryXref);\n }\n test = new o.ConditionalExpr(\n conditionalCase.expr,\n new ir.SlotLiteralExpr(conditionalCase.targetSlot),\n test,\n );\n }\n\n // Save the resulting aggregate Joost-expression.\n op.processed = test;\n\n // Clear the original conditions array, since we no longer need it, and don't want it to\n // affect subsequent phases (e.g. pipe creation).\n op.conditions = [];\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../output/output_ast';\nimport * as ir from '../ir';\n\nexport const BINARY_OPERATORS = new Map([\n ['&&', o.BinaryOperator.And],\n ['>', o.BinaryOperator.Bigger],\n ['>=', o.BinaryOperator.BiggerEquals],\n ['|', o.BinaryOperator.BitwiseOr],\n ['&', o.BinaryOperator.BitwiseAnd],\n ['/', o.BinaryOperator.Divide],\n ['==', o.BinaryOperator.Equals],\n ['===', o.BinaryOperator.Identical],\n ['<', o.BinaryOperator.Lower],\n ['<=', o.BinaryOperator.LowerEquals],\n ['-', o.BinaryOperator.Minus],\n ['%', o.BinaryOperator.Modulo],\n ['*', o.BinaryOperator.Multiply],\n ['!=', o.BinaryOperator.NotEquals],\n ['!==', o.BinaryOperator.NotIdentical],\n ['??', o.BinaryOperator.NullishCoalesce],\n ['||', o.BinaryOperator.Or],\n ['+', o.BinaryOperator.Plus],\n]);\n\nexport function namespaceForKey(namespacePrefixKey: string | null): ir.Namespace {\n const NAMESPACES = new Map([\n ['svg', ir.Namespace.SVG],\n ['math', ir.Namespace.Math],\n ]);\n if (namespacePrefixKey === null) {\n return ir.Namespace.HTML;\n }\n return NAMESPACES.get(namespacePrefixKey) ?? ir.Namespace.HTML;\n}\n\nexport function keyForNamespace(namespace: ir.Namespace): string | null {\n const NAMESPACES = new Map([\n ['svg', ir.Namespace.SVG],\n ['math', ir.Namespace.Math],\n ]);\n for (const [k, n] of NAMESPACES.entries()) {\n if (n === namespace) {\n return k;\n }\n }\n return null; // No namespace prefix for HTML\n}\n\nexport function prefixWithNamespace(strippedTag: string, namespace: ir.Namespace): string {\n if (namespace === ir.Namespace.HTML) {\n return strippedTag;\n }\n return `:${keyForNamespace(namespace)}:${strippedTag}`;\n}\n\nexport type LiteralType = string | number | boolean | null | Array;\n\nexport function literalOrArrayLiteral(value: LiteralType): o.Expression {\n if (Array.isArray(value)) {\n return o.literalArr(value.map(literalOrArrayLiteral));\n }\n return o.literal(value);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as core from '../../../../core';\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\n\nimport {\n ComponentCompilationJob,\n HostBindingCompilationJob,\n type CompilationJob,\n} from '../compilation';\nimport {literalOrArrayLiteral} from '../conversion';\n\n/**\n * Converts the semantic attributes of element-like operations (elements, templates) into constant\n * array expressions, and lifts them into the overall component `consts`.\n */\nexport function collectElementConsts(job: CompilationJob): void {\n // Collect all extracted attributes.\n const allElementAttributes = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.ExtractedAttribute) {\n const attributes =\n allElementAttributes.get(op.target) || new ElementAttributes(job.compatibility);\n allElementAttributes.set(op.target, attributes);\n attributes.add(op.bindingKind, op.name, op.expression, op.namespace, op.trustedValueFn);\n ir.OpList.remove(op);\n }\n }\n }\n\n // Serialize the extracted attributes into the const array.\n if (job instanceof ComponentCompilationJob) {\n for (const unit of job.units) {\n for (const op of unit.create) {\n // TODO: Simplify and combine these cases.\n if (op.kind == ir.OpKind.Projection) {\n const attributes = allElementAttributes.get(op.xref);\n if (attributes !== undefined) {\n const attrArray = serializeAttributes(attributes);\n if (attrArray.entries.length > 0) {\n op.attributes = attrArray;\n }\n }\n } else if (ir.isElementOrContainerOp(op)) {\n op.attributes = getConstIndex(job, allElementAttributes, op.xref);\n\n // TODO(dylhunn): `@for` loops with `@empty` blocks need to be special-cased here,\n // because the slot consumer trait currently only supports one slot per consumer and we\n // need two. This should be revisited when making the refactors mentioned in:\n // https://github.com/angular/angular/pull/53620#discussion_r1430918822\n if (op.kind === ir.OpKind.RepeaterCreate && op.emptyView !== null) {\n op.emptyAttributes = getConstIndex(job, allElementAttributes, op.emptyView);\n }\n }\n }\n }\n } else if (job instanceof HostBindingCompilationJob) {\n // TODO: If the host binding case further diverges, we may want to split it into its own\n // phase.\n for (const [xref, attributes] of allElementAttributes.entries()) {\n if (xref !== job.root.xref) {\n throw new Error(\n `An attribute would be const collected into the host binding's template function, but is not associated with the root xref.`,\n );\n }\n const attrArray = serializeAttributes(attributes);\n if (attrArray.entries.length > 0) {\n job.root.attributes = attrArray;\n }\n }\n }\n}\n\nfunction getConstIndex(\n job: ComponentCompilationJob,\n allElementAttributes: Map,\n xref: ir.XrefId,\n): ir.ConstIndex | null {\n const attributes = allElementAttributes.get(xref);\n if (attributes !== undefined) {\n const attrArray = serializeAttributes(attributes);\n if (attrArray.entries.length > 0) {\n return job.addConst(attrArray);\n }\n }\n return null;\n}\n\n/**\n * Shared instance of an empty array to avoid unnecessary array allocations.\n */\nconst FLYWEIGHT_ARRAY: ReadonlyArray = Object.freeze([]);\n\n/**\n * Container for all of the various kinds of attributes which are applied on an element.\n */\nclass ElementAttributes {\n private known = new Map>();\n private byKind = new Map<\n // Property bindings are excluded here, because they need to be tracked in the same\n // array to maintain their order. They're tracked in the `propertyBindings` array.\n Exclude,\n o.Expression[]\n >();\n private propertyBindings: o.Expression[] | null = null;\n\n projectAs: string | null = null;\n\n get attributes(): ReadonlyArray {\n return this.byKind.get(ir.BindingKind.Attribute) ?? FLYWEIGHT_ARRAY;\n }\n\n get classes(): ReadonlyArray {\n return this.byKind.get(ir.BindingKind.ClassName) ?? FLYWEIGHT_ARRAY;\n }\n\n get styles(): ReadonlyArray {\n return this.byKind.get(ir.BindingKind.StyleProperty) ?? FLYWEIGHT_ARRAY;\n }\n\n get bindings(): ReadonlyArray {\n return this.propertyBindings ?? FLYWEIGHT_ARRAY;\n }\n\n get template(): ReadonlyArray {\n return this.byKind.get(ir.BindingKind.Template) ?? FLYWEIGHT_ARRAY;\n }\n\n get i18n(): ReadonlyArray {\n return this.byKind.get(ir.BindingKind.I18n) ?? FLYWEIGHT_ARRAY;\n }\n\n constructor(private compatibility: ir.CompatibilityMode) {}\n\n private isKnown(kind: ir.BindingKind, name: string) {\n const nameToValue = this.known.get(kind) ?? new Set();\n this.known.set(kind, nameToValue);\n if (nameToValue.has(name)) {\n return true;\n }\n nameToValue.add(name);\n return false;\n }\n\n add(\n kind: ir.BindingKind,\n name: string,\n value: o.Expression | null,\n namespace: string | null,\n trustedValueFn: o.Expression | null,\n ): void {\n // TemplateDefinitionBuilder puts duplicate attribute, class, and style values into the consts\n // array. This seems inefficient, we can probably keep just the first one or the last value\n // (whichever actually gets applied when multiple values are listed for the same attribute).\n const allowDuplicates =\n this.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder &&\n (kind === ir.BindingKind.Attribute ||\n kind === ir.BindingKind.ClassName ||\n kind === ir.BindingKind.StyleProperty);\n if (!allowDuplicates && this.isKnown(kind, name)) {\n return;\n }\n\n // TODO: Can this be its own phase\n if (name === 'ngProjectAs') {\n if (\n value === null ||\n !(value instanceof o.LiteralExpr) ||\n value.value == null ||\n typeof value.value?.toString() !== 'string'\n ) {\n throw Error('ngProjectAs must have a string literal value');\n }\n this.projectAs = value.value.toString();\n // TODO: TemplateDefinitionBuilder allows `ngProjectAs` to also be assigned as a literal\n // attribute. Is this sane?\n }\n\n const array = this.arrayFor(kind);\n array.push(...getAttributeNameLiterals(namespace, name));\n if (kind === ir.BindingKind.Attribute || kind === ir.BindingKind.StyleProperty) {\n if (value === null) {\n throw Error('Attribute, i18n attribute, & style element attributes must have a value');\n }\n if (trustedValueFn !== null && ir.isStringLiteral(value)) {\n array.push(\n o.taggedTemplate(\n trustedValueFn,\n new o.TemplateLiteralExpr([new o.TemplateLiteralElementExpr(value.value)], []),\n undefined,\n value.sourceSpan,\n ),\n );\n } else {\n array.push(value);\n }\n }\n }\n\n private arrayFor(kind: ir.BindingKind): o.Expression[] {\n if (kind === ir.BindingKind.Property || kind === ir.BindingKind.TwoWayProperty) {\n this.propertyBindings ??= [];\n return this.propertyBindings;\n } else {\n if (!this.byKind.has(kind)) {\n this.byKind.set(kind, []);\n }\n return this.byKind.get(kind)!;\n }\n }\n}\n\n/**\n * Gets an array of literal expressions representing the attribute's namespaced name.\n */\nfunction getAttributeNameLiterals(namespace: string | null, name: string): o.LiteralExpr[] {\n const nameLiteral = o.literal(name);\n\n if (namespace) {\n return [o.literal(core.AttributeMarker.NamespaceURI), o.literal(namespace), nameLiteral];\n }\n\n return [nameLiteral];\n}\n\n/**\n * Serializes an ElementAttributes object into an array expression.\n */\nfunction serializeAttributes({\n attributes,\n bindings,\n classes,\n i18n,\n projectAs,\n styles,\n template,\n}: ElementAttributes): o.LiteralArrayExpr {\n const attrArray = [...attributes];\n\n if (projectAs !== null) {\n // Parse the attribute value into a CssSelectorList. Note that we only take the\n // first selector, because we don't support multiple selectors in ngProjectAs.\n const parsedR3Selector = core.parseSelectorToR3Selector(projectAs)[0];\n attrArray.push(\n o.literal(core.AttributeMarker.ProjectAs),\n literalOrArrayLiteral(parsedR3Selector),\n );\n }\n if (classes.length > 0) {\n attrArray.push(o.literal(core.AttributeMarker.Classes), ...classes);\n }\n if (styles.length > 0) {\n attrArray.push(o.literal(core.AttributeMarker.Styles), ...styles);\n }\n if (bindings.length > 0) {\n attrArray.push(o.literal(core.AttributeMarker.Bindings), ...bindings);\n }\n if (template.length > 0) {\n attrArray.push(o.literal(core.AttributeMarker.Template), ...template);\n }\n if (i18n.length > 0) {\n attrArray.push(o.literal(core.AttributeMarker.I18n), ...i18n);\n }\n return o.literalArr(attrArray);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * Some binding instructions in the update block may actually correspond to i18n bindings. In that\n * case, they should be replaced with i18nExp instructions for the dynamic portions.\n */\nexport function convertI18nBindings(job: CompilationJob): void {\n const i18nAttributesByElem: Map = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.I18nAttributes) {\n i18nAttributesByElem.set(op.target, op);\n }\n }\n\n for (const op of unit.update) {\n switch (op.kind) {\n case ir.OpKind.Property:\n case ir.OpKind.Attribute:\n if (op.i18nContext === null) {\n continue;\n }\n\n if (!(op.expression instanceof ir.Interpolation)) {\n continue;\n }\n\n const i18nAttributesForElem = i18nAttributesByElem.get(op.target);\n if (i18nAttributesForElem === undefined) {\n throw new Error(\n 'AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction',\n );\n }\n\n if (i18nAttributesForElem.target !== op.target) {\n throw new Error(\n 'AssertionError: Expected i18nAttributes target element to match binding target element',\n );\n }\n\n const ops: ir.UpdateOp[] = [];\n for (let i = 0; i < op.expression.expressions.length; i++) {\n const expr = op.expression.expressions[i];\n\n if (op.expression.i18nPlaceholders.length !== op.expression.expressions.length) {\n throw new Error(\n `AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${op.expression.i18nPlaceholders.length} placeholders and ${op.expression.expressions.length} expressions`,\n );\n }\n\n ops.push(\n ir.createI18nExpressionOp(\n op.i18nContext,\n i18nAttributesForElem.target,\n i18nAttributesForElem.xref,\n i18nAttributesForElem.handle,\n expr,\n null,\n op.expression.i18nPlaceholders[i],\n ir.I18nParamResolutionTime.Creation,\n ir.I18nExpressionFor.I18nAttribute,\n op.name,\n op.sourceSpan,\n ),\n );\n }\n ir.OpList.replaceWithMany(op as ir.UpdateOp, ops);\n break;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {ComponentCompilationJob} from '../compilation';\n\n/**\n * Resolve the dependency function of a deferred block.\n */\nexport function resolveDeferDepsFns(job: ComponentCompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.Defer) {\n if (op.resolverFn !== null) {\n continue;\n }\n\n if (op.ownResolverFn !== null) {\n if (op.handle.slot === null) {\n throw new Error(\n 'AssertionError: slot must be assigned before extracting defer deps functions',\n );\n }\n const fullPathName = unit.fnName?.replace('_Template', '');\n op.resolverFn = job.pool.getSharedFunctionReference(\n op.ownResolverFn,\n `${fullPathName}_Defer_${op.handle.slot}_DepsFn`,\n /* Don't use unique names for TDB compatibility */ false,\n );\n }\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as i18n from '../../../../i18n/i18n_ast';\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * Create one helper context op per i18n block (including generate descending blocks).\n *\n * Also, if an ICU exists inside an i18n block that also contains other localizable content (such as\n * string), create an additional helper context op for the ICU.\n *\n * These context ops are later used for generating i18n messages. (Although we generate at least one\n * context op per nested view, we will collect them up the tree later, to generate a top-level\n * message.)\n */\nexport function createI18nContexts(job: CompilationJob) {\n // Create i18n context ops for i18n attrs.\n const attrContextByMessage = new Map();\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n switch (op.kind) {\n case ir.OpKind.Binding:\n case ir.OpKind.Property:\n case ir.OpKind.Attribute:\n case ir.OpKind.ExtractedAttribute:\n if (op.i18nMessage === null) {\n continue;\n }\n if (!attrContextByMessage.has(op.i18nMessage)) {\n const i18nContext = ir.createI18nContextOp(\n ir.I18nContextKind.Attr,\n job.allocateXrefId(),\n null,\n op.i18nMessage,\n null!,\n );\n unit.create.push(i18nContext);\n attrContextByMessage.set(op.i18nMessage, i18nContext.xref);\n }\n op.i18nContext = attrContextByMessage.get(op.i18nMessage)!;\n break;\n }\n }\n }\n\n // Create i18n context ops for root i18n blocks.\n const blockContextByI18nBlock = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nStart:\n if (op.xref === op.root) {\n const contextOp = ir.createI18nContextOp(\n ir.I18nContextKind.RootI18n,\n job.allocateXrefId(),\n op.xref,\n op.message,\n null!,\n );\n unit.create.push(contextOp);\n op.context = contextOp.xref;\n blockContextByI18nBlock.set(op.xref, contextOp);\n }\n break;\n }\n }\n }\n\n // Assign i18n contexts for child i18n blocks. These don't need their own conext, instead they\n // should inherit from their root i18n block.\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.I18nStart && op.xref !== op.root) {\n const rootContext = blockContextByI18nBlock.get(op.root);\n if (rootContext === undefined) {\n throw Error('AssertionError: Root i18n block i18n context should have been created.');\n }\n op.context = rootContext.xref;\n blockContextByI18nBlock.set(op.xref, rootContext);\n }\n }\n }\n\n // Create or assign i18n contexts for ICUs.\n let currentI18nOp: ir.I18nStartOp | null = null;\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nStart:\n currentI18nOp = op;\n break;\n case ir.OpKind.I18nEnd:\n currentI18nOp = null;\n break;\n case ir.OpKind.IcuStart:\n if (currentI18nOp === null) {\n throw Error('AssertionError: Unexpected ICU outside of an i18n block.');\n }\n if (op.message.id !== currentI18nOp.message.id) {\n // This ICU is a sub-message inside its parent i18n block message. We need to give it\n // its own context.\n const contextOp = ir.createI18nContextOp(\n ir.I18nContextKind.Icu,\n job.allocateXrefId(),\n currentI18nOp.root,\n op.message,\n null!,\n );\n unit.create.push(contextOp);\n op.context = contextOp.xref;\n } else {\n // This ICU is the only translatable content in its parent i18n block. We need to\n // convert the parent's context into an ICU context.\n op.context = currentI18nOp.context;\n blockContextByI18nBlock.get(currentI18nOp.xref)!.contextKind = ir.I18nContextKind.Icu;\n }\n break;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Deduplicate text bindings, e.g.
\n */\nexport function deduplicateTextBindings(job: CompilationJob): void {\n const seen = new Map>();\n for (const unit of job.units) {\n for (const op of unit.update.reversed()) {\n if (op.kind === ir.OpKind.Binding && op.isTextAttribute) {\n const seenForElement = seen.get(op.target) || new Set();\n if (seenForElement.has(op.name)) {\n if (job.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder) {\n // For most duplicated attributes, TemplateDefinitionBuilder lists all of the values in\n // the consts array. However, for style and class attributes it only keeps the last one.\n // We replicate that behavior here since it has actual consequences for apps with\n // duplicate class or style attrs.\n if (op.name === 'style' || op.name === 'class') {\n ir.OpList.remove(op);\n }\n } else {\n // TODO: Determine the correct behavior. It would probably make sense to merge multiple\n // style and class attributes. Alternatively we could just throw an error, as HTML\n // doesn't permit duplicate attributes.\n }\n }\n seenForElement.add(op.name);\n seen.set(op.target, seenForElement);\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {ComponentCompilationJob} from '../compilation';\nimport {literalOrArrayLiteral} from '../conversion';\n\n/**\n * Defer instructions take a configuration array, which should be collected into the component\n * consts. This phase finds the config options, and creates the corresponding const array.\n */\nexport function configureDeferInstructions(job: ComponentCompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind !== ir.OpKind.Defer) {\n continue;\n }\n\n if (op.placeholderMinimumTime !== null) {\n op.placeholderConfig = new ir.ConstCollectedExpr(\n literalOrArrayLiteral([op.placeholderMinimumTime]),\n );\n }\n if (op.loadingMinimumTime !== null || op.loadingAfterTime !== null) {\n op.loadingConfig = new ir.ConstCollectedExpr(\n literalOrArrayLiteral([op.loadingMinimumTime, op.loadingAfterTime]),\n );\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {ComponentCompilationJob, ViewCompilationUnit} from '../compilation';\n\n/**\n * Some `defer` conditions can reference other elements in the template, using their local reference\n * names. However, the semantics are quite different from the normal local reference system: in\n * particular, we need to look at local reference names in enclosing views. This phase resolves\n * all such references to actual xrefs.\n */\nexport function resolveDeferTargetNames(job: ComponentCompilationJob): void {\n const scopes = new Map();\n\n function getScopeForView(view: ViewCompilationUnit): Scope {\n if (scopes.has(view.xref)) {\n return scopes.get(view.xref)!;\n }\n\n const scope = new Scope();\n for (const op of view.create) {\n // add everything that can be referenced.\n if (!ir.isElementOrContainerOp(op) || op.localRefs === null) {\n continue;\n }\n if (!Array.isArray(op.localRefs)) {\n throw new Error(\n 'LocalRefs were already processed, but were needed to resolve defer targets.',\n );\n }\n\n for (const ref of op.localRefs) {\n if (ref.target !== '') {\n continue;\n }\n scope.targets.set(ref.name, {xref: op.xref, slot: op.handle});\n }\n }\n\n scopes.set(view.xref, scope);\n return scope;\n }\n\n function resolveTrigger(\n deferOwnerView: ViewCompilationUnit,\n op: ir.DeferOnOp,\n placeholderView: ir.XrefId | null,\n ): void {\n switch (op.trigger.kind) {\n case ir.DeferTriggerKind.Idle:\n case ir.DeferTriggerKind.Never:\n case ir.DeferTriggerKind.Immediate:\n case ir.DeferTriggerKind.Timer:\n return;\n case ir.DeferTriggerKind.Hover:\n case ir.DeferTriggerKind.Interaction:\n case ir.DeferTriggerKind.Viewport:\n if (op.trigger.targetName === null) {\n // A `null` target name indicates we should default to the first element in the\n // placeholder block.\n if (placeholderView === null) {\n throw new Error('defer on trigger with no target name must have a placeholder block');\n }\n const placeholder = job.views.get(placeholderView);\n if (placeholder == undefined) {\n throw new Error('AssertionError: could not find placeholder view for defer on trigger');\n }\n for (const placeholderOp of placeholder.create) {\n if (\n ir.hasConsumesSlotTrait(placeholderOp) &&\n (ir.isElementOrContainerOp(placeholderOp) ||\n placeholderOp.kind === ir.OpKind.Projection)\n ) {\n op.trigger.targetXref = placeholderOp.xref;\n op.trigger.targetView = placeholderView;\n op.trigger.targetSlotViewSteps = -1;\n op.trigger.targetSlot = placeholderOp.handle;\n return;\n }\n }\n return;\n }\n let view: ViewCompilationUnit | null =\n placeholderView !== null ? job.views.get(placeholderView)! : deferOwnerView;\n let step = placeholderView !== null ? -1 : 0;\n\n while (view !== null) {\n const scope = getScopeForView(view);\n if (scope.targets.has(op.trigger.targetName)) {\n const {xref, slot} = scope.targets.get(op.trigger.targetName)!;\n\n op.trigger.targetXref = xref;\n op.trigger.targetView = view.xref;\n op.trigger.targetSlotViewSteps = step;\n op.trigger.targetSlot = slot;\n return;\n }\n\n view = view.parent !== null ? job.views.get(view.parent)! : null;\n step++;\n }\n break;\n default:\n throw new Error(`Trigger kind ${(op.trigger as any).kind} not handled`);\n }\n }\n\n // Find the defer ops, and assign the data about their targets.\n for (const unit of job.units) {\n const defers = new Map();\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.Defer:\n defers.set(op.xref, op);\n break;\n case ir.OpKind.DeferOn:\n const deferOp = defers.get(op.defer)!;\n resolveTrigger(\n unit,\n op,\n op.modifier === ir.DeferOpModifierKind.HYDRATE\n ? deferOp.mainView\n : deferOp.placeholderView,\n );\n break;\n }\n }\n }\n}\n\nclass Scope {\n targets = new Map();\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\nconst REPLACEMENTS = new Map([\n [ir.OpKind.ElementEnd, [ir.OpKind.ElementStart, ir.OpKind.Element]],\n [ir.OpKind.ContainerEnd, [ir.OpKind.ContainerStart, ir.OpKind.Container]],\n [ir.OpKind.I18nEnd, [ir.OpKind.I18nStart, ir.OpKind.I18n]],\n]);\n\n/**\n * Op kinds that should not prevent merging of start/end ops.\n */\nconst IGNORED_OP_KINDS = new Set([ir.OpKind.Pipe]);\n\n/**\n * Replace sequences of mergable instructions (e.g. `ElementStart` and `ElementEnd`) with a\n * consolidated instruction (e.g. `Element`).\n */\nexport function collapseEmptyInstructions(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.create) {\n // Find end ops that may be able to be merged.\n const opReplacements = REPLACEMENTS.get(op.kind);\n if (opReplacements === undefined) {\n continue;\n }\n const [startKind, mergedKind] = opReplacements;\n\n // Locate the previous (non-ignored) op.\n let prevOp: ir.CreateOp | null = op.prev;\n while (prevOp !== null && IGNORED_OP_KINDS.has(prevOp.kind)) {\n prevOp = prevOp.prev;\n }\n\n // If the previous op is the corresponding start op, we can megre.\n if (prevOp !== null && prevOp.kind === startKind) {\n // Transmute the start instruction to the merged version. This is safe as they're designed\n // to be identical apart from the `kind`.\n (prevOp as ir.Op).kind = mergedKind;\n\n // Remove the end instruction.\n ir.OpList.remove(op);\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\ninterface SafeTransformContext {\n job: CompilationJob;\n}\n\n/**\n * Safe read expressions such as `a?.b` have different semantics in Angular templates as\n * compared to JavaScript. In particular, they default to `null` instead of `undefined`. This phase\n * finds all unresolved safe read expressions, and converts them into the appropriate output AST\n * reads, guarded by null checks. We generate temporaries as needed, to avoid re-evaluating the same\n * sub-expression multiple times.\n */\nexport function expandSafeReads(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n ir.transformExpressionsInOp(op, (e) => safeTransform(e, {job}), ir.VisitorContextFlag.None);\n ir.transformExpressionsInOp(op, ternaryTransform, ir.VisitorContextFlag.None);\n }\n }\n}\n\n// A lookup set of all the expression kinds that require a temporary variable to be generated.\nconst requiresTemporary = [\n o.InvokeFunctionExpr,\n o.LiteralArrayExpr,\n o.LiteralMapExpr,\n ir.SafeInvokeFunctionExpr,\n ir.PipeBindingExpr,\n].map((e) => e.constructor.name);\n\nfunction needsTemporaryInSafeAccess(e: o.Expression): boolean {\n // TODO: We probably want to use an expression visitor to recursively visit all descendents.\n // However, that would potentially do a lot of extra work (because it cannot short circuit), so we\n // implement the logic ourselves for now.\n if (e instanceof o.UnaryOperatorExpr) {\n return needsTemporaryInSafeAccess(e.expr);\n } else if (e instanceof o.BinaryOperatorExpr) {\n return needsTemporaryInSafeAccess(e.lhs) || needsTemporaryInSafeAccess(e.rhs);\n } else if (e instanceof o.ConditionalExpr) {\n if (e.falseCase && needsTemporaryInSafeAccess(e.falseCase)) return true;\n return needsTemporaryInSafeAccess(e.condition) || needsTemporaryInSafeAccess(e.trueCase);\n } else if (e instanceof o.NotExpr) {\n return needsTemporaryInSafeAccess(e.condition);\n } else if (e instanceof ir.AssignTemporaryExpr) {\n return needsTemporaryInSafeAccess(e.expr);\n } else if (e instanceof o.ReadPropExpr) {\n return needsTemporaryInSafeAccess(e.receiver);\n } else if (e instanceof o.ReadKeyExpr) {\n return needsTemporaryInSafeAccess(e.receiver) || needsTemporaryInSafeAccess(e.index);\n }\n // TODO: Switch to a method which is exhaustive of newly added expression subtypes.\n return (\n e instanceof o.InvokeFunctionExpr ||\n e instanceof o.LiteralArrayExpr ||\n e instanceof o.LiteralMapExpr ||\n e instanceof ir.SafeInvokeFunctionExpr ||\n e instanceof ir.PipeBindingExpr\n );\n}\n\nfunction temporariesIn(e: o.Expression): Set {\n const temporaries = new Set();\n // TODO: Although it's not currently supported by the transform helper, we should be able to\n // short-circuit exploring the tree to do less work. In particular, we don't have to penetrate\n // into the subexpressions of temporary assignments.\n ir.transformExpressionsInExpression(\n e,\n (e) => {\n if (e instanceof ir.AssignTemporaryExpr) {\n temporaries.add(e.xref);\n }\n return e;\n },\n ir.VisitorContextFlag.None,\n );\n return temporaries;\n}\n\nfunction eliminateTemporaryAssignments(\n e: o.Expression,\n tmps: Set,\n ctx: SafeTransformContext,\n): o.Expression {\n // TODO: We can be more efficient than the transform helper here. We don't need to visit any\n // descendents of temporary assignments.\n ir.transformExpressionsInExpression(\n e,\n (e) => {\n if (e instanceof ir.AssignTemporaryExpr && tmps.has(e.xref)) {\n const read = new ir.ReadTemporaryExpr(e.xref);\n // `TemplateDefinitionBuilder` has the (accidental?) behavior of generating assignments of\n // temporary variables to themselves. This happens because some subexpression that the\n // temporary refers to, possibly through nested temporaries, has a function call. We copy that\n // behavior here.\n return ctx.job.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder\n ? new ir.AssignTemporaryExpr(read, read.xref)\n : read;\n }\n return e;\n },\n ir.VisitorContextFlag.None,\n );\n return e;\n}\n\n/**\n * Creates a safe ternary guarded by the input expression, and with a body generated by the provided\n * callback on the input expression. Generates a temporary variable assignment if needed, and\n * deduplicates nested temporary assignments if needed.\n */\nfunction safeTernaryWithTemporary(\n guard: o.Expression,\n body: (e: o.Expression) => o.Expression,\n ctx: SafeTransformContext,\n): ir.SafeTernaryExpr {\n let result: [o.Expression, o.Expression];\n if (needsTemporaryInSafeAccess(guard)) {\n const xref = ctx.job.allocateXrefId();\n result = [new ir.AssignTemporaryExpr(guard, xref), new ir.ReadTemporaryExpr(xref)];\n } else {\n result = [guard, guard.clone()];\n // Consider an expression like `a?.[b?.c()]?.d`. The `b?.c()` will be transformed first,\n // introducing a temporary assignment into the key. Then, as part of expanding the `?.d`. That\n // assignment will be duplicated into both the guard and expression sides. We de-duplicate it,\n // by transforming it from an assignment into a read on the expression side.\n eliminateTemporaryAssignments(result[1], temporariesIn(result[0]), ctx);\n }\n return new ir.SafeTernaryExpr(result[0], body(result[1]));\n}\n\nfunction isSafeAccessExpression(\n e: o.Expression,\n): e is ir.SafePropertyReadExpr | ir.SafeKeyedReadExpr | ir.SafeInvokeFunctionExpr {\n return (\n e instanceof ir.SafePropertyReadExpr ||\n e instanceof ir.SafeKeyedReadExpr ||\n e instanceof ir.SafeInvokeFunctionExpr\n );\n}\n\nfunction isUnsafeAccessExpression(\n e: o.Expression,\n): e is o.ReadPropExpr | o.ReadKeyExpr | o.InvokeFunctionExpr {\n return (\n e instanceof o.ReadPropExpr || e instanceof o.ReadKeyExpr || e instanceof o.InvokeFunctionExpr\n );\n}\n\nfunction isAccessExpression(\n e: o.Expression,\n): e is\n | o.ReadPropExpr\n | ir.SafePropertyReadExpr\n | o.ReadKeyExpr\n | ir.SafeKeyedReadExpr\n | o.InvokeFunctionExpr\n | ir.SafeInvokeFunctionExpr {\n return isSafeAccessExpression(e) || isUnsafeAccessExpression(e);\n}\n\nfunction deepestSafeTernary(e: o.Expression): ir.SafeTernaryExpr | null {\n if (isAccessExpression(e) && e.receiver instanceof ir.SafeTernaryExpr) {\n let st = e.receiver;\n while (st.expr instanceof ir.SafeTernaryExpr) {\n st = st.expr;\n }\n return st;\n }\n return null;\n}\n\n// TODO: When strict compatibility with TemplateDefinitionBuilder is not required, we can use `&&`\n// instead to save some code size.\nfunction safeTransform(e: o.Expression, ctx: SafeTransformContext): o.Expression {\n if (!isAccessExpression(e)) {\n return e;\n }\n\n const dst = deepestSafeTernary(e);\n\n if (dst) {\n if (e instanceof o.InvokeFunctionExpr) {\n dst.expr = dst.expr.callFn(e.args);\n return e.receiver;\n }\n if (e instanceof o.ReadPropExpr) {\n dst.expr = dst.expr.prop(e.name);\n return e.receiver;\n }\n if (e instanceof o.ReadKeyExpr) {\n dst.expr = dst.expr.key(e.index);\n return e.receiver;\n }\n if (e instanceof ir.SafeInvokeFunctionExpr) {\n dst.expr = safeTernaryWithTemporary(dst.expr, (r: o.Expression) => r.callFn(e.args), ctx);\n return e.receiver;\n }\n if (e instanceof ir.SafePropertyReadExpr) {\n dst.expr = safeTernaryWithTemporary(dst.expr, (r: o.Expression) => r.prop(e.name), ctx);\n return e.receiver;\n }\n if (e instanceof ir.SafeKeyedReadExpr) {\n dst.expr = safeTernaryWithTemporary(dst.expr, (r: o.Expression) => r.key(e.index), ctx);\n return e.receiver;\n }\n } else {\n if (e instanceof ir.SafeInvokeFunctionExpr) {\n return safeTernaryWithTemporary(e.receiver, (r: o.Expression) => r.callFn(e.args), ctx);\n }\n if (e instanceof ir.SafePropertyReadExpr) {\n return safeTernaryWithTemporary(e.receiver, (r: o.Expression) => r.prop(e.name), ctx);\n }\n if (e instanceof ir.SafeKeyedReadExpr) {\n return safeTernaryWithTemporary(e.receiver, (r: o.Expression) => r.key(e.index), ctx);\n }\n }\n\n return e;\n}\n\nfunction ternaryTransform(e: o.Expression): o.Expression {\n if (!(e instanceof ir.SafeTernaryExpr)) {\n return e;\n }\n return new o.ConditionalExpr(\n new o.BinaryOperatorExpr(o.BinaryOperator.Equals, e.guard, o.NULL_EXPR),\n o.NULL_EXPR,\n e.expr,\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * The escape sequence used indicate message param values.\n */\nconst ESCAPE = '\\uFFFD';\n\n/**\n * Marker used to indicate an element tag.\n */\nconst ELEMENT_MARKER = '#';\n\n/**\n * Marker used to indicate a template tag.\n */\nconst TEMPLATE_MARKER = '*';\n\n/**\n * Marker used to indicate closing of an element or template tag.\n */\nconst TAG_CLOSE_MARKER = '/';\n\n/**\n * Marker used to indicate the sub-template context.\n */\nconst CONTEXT_MARKER = ':';\n\n/**\n * Marker used to indicate the start of a list of values.\n */\nconst LIST_START_MARKER = '[';\n\n/**\n * Marker used to indicate the end of a list of values.\n */\nconst LIST_END_MARKER = ']';\n\n/**\n * Delimiter used to separate multiple values in a list.\n */\nconst LIST_DELIMITER = '|';\n\n/**\n * Formats the param maps on extracted message ops into a maps of `Expression` objects that can be\n * used in the final output.\n */\nexport function extractI18nMessages(job: CompilationJob): void {\n // Create an i18n message for each context.\n // TODO: Merge the context op with the message op since they're 1:1 anyways.\n const i18nMessagesByContext = new Map();\n const i18nBlocks = new Map();\n const i18nContexts = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nContext:\n const i18nMessageOp = createI18nMessage(job, op);\n unit.create.push(i18nMessageOp);\n i18nMessagesByContext.set(op.xref, i18nMessageOp);\n i18nContexts.set(op.xref, op);\n break;\n case ir.OpKind.I18nStart:\n i18nBlocks.set(op.xref, op);\n break;\n }\n }\n }\n\n // Associate sub-messages for ICUs with their root message. At this point we can also remove the\n // ICU start/end ops, as they are no longer needed.\n let currentIcu: ir.IcuStartOp | null = null;\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.IcuStart:\n currentIcu = op;\n ir.OpList.remove(op);\n // Skip any contexts not associated with an ICU.\n const icuContext = i18nContexts.get(op.context!)!;\n if (icuContext.contextKind !== ir.I18nContextKind.Icu) {\n continue;\n }\n // Skip ICUs that share a context with their i18n message. These represent root-level\n // ICUs, not sub-messages.\n const i18nBlock = i18nBlocks.get(icuContext.i18nBlock!)!;\n if (i18nBlock.context === icuContext.xref) {\n continue;\n }\n // Find the root message and push this ICUs message as a sub-message.\n const rootI18nBlock = i18nBlocks.get(i18nBlock.root)!;\n const rootMessage = i18nMessagesByContext.get(rootI18nBlock.context!);\n if (rootMessage === undefined) {\n throw Error('AssertionError: ICU sub-message should belong to a root message.');\n }\n const subMessage = i18nMessagesByContext.get(icuContext.xref)!;\n subMessage.messagePlaceholder = op.messagePlaceholder;\n rootMessage.subMessages.push(subMessage.xref);\n break;\n case ir.OpKind.IcuEnd:\n currentIcu = null;\n ir.OpList.remove(op);\n break;\n case ir.OpKind.IcuPlaceholder:\n // Add ICU placeholders to the message, then remove the ICU placeholder ops.\n if (currentIcu === null || currentIcu.context == null) {\n throw Error('AssertionError: Unexpected ICU placeholder outside of i18n context');\n }\n const msg = i18nMessagesByContext.get(currentIcu.context)!;\n msg.postprocessingParams.set(op.name, o.literal(formatIcuPlaceholder(op)));\n ir.OpList.remove(op);\n break;\n }\n }\n }\n}\n\n/**\n * Create an i18n message op from an i18n context op.\n */\nfunction createI18nMessage(\n job: CompilationJob,\n context: ir.I18nContextOp,\n messagePlaceholder?: string,\n): ir.I18nMessageOp {\n let formattedParams = formatParams(context.params);\n const formattedPostprocessingParams = formatParams(context.postprocessingParams);\n let needsPostprocessing = [...context.params.values()].some((v) => v.length > 1);\n return ir.createI18nMessageOp(\n job.allocateXrefId(),\n context.xref,\n context.i18nBlock,\n context.message,\n messagePlaceholder ?? null,\n formattedParams,\n formattedPostprocessingParams,\n needsPostprocessing,\n );\n}\n\n/**\n * Formats an ICU placeholder into a single string with expression placeholders.\n */\nfunction formatIcuPlaceholder(op: ir.IcuPlaceholderOp) {\n if (op.strings.length !== op.expressionPlaceholders.length + 1) {\n throw Error(\n `AssertionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`,\n );\n }\n const values = op.expressionPlaceholders.map(formatValue);\n return op.strings.flatMap((str, i) => [str, values[i] || '']).join('');\n}\n\n/**\n * Formats a map of `I18nParamValue[]` values into a map of `Expression` values.\n */\nfunction formatParams(params: Map) {\n const formattedParams = new Map();\n for (const [placeholder, placeholderValues] of params) {\n const serializedValues = formatParamValues(placeholderValues);\n if (serializedValues !== null) {\n formattedParams.set(placeholder, o.literal(serializedValues));\n }\n }\n return formattedParams;\n}\n\n/**\n * Formats an `I18nParamValue[]` into a string (or null for empty array).\n */\nfunction formatParamValues(values: ir.I18nParamValue[]): string | null {\n if (values.length === 0) {\n return null;\n }\n const serializedValues = values.map((value) => formatValue(value));\n return serializedValues.length === 1\n ? serializedValues[0]\n : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;\n}\n\n/**\n * Formats a single `I18nParamValue` into a string\n */\nfunction formatValue(value: ir.I18nParamValue): string {\n // Element tags with a structural directive use a special form that concatenates the element and\n // template values.\n if (\n value.flags & ir.I18nParamValueFlags.ElementTag &&\n value.flags & ir.I18nParamValueFlags.TemplateTag\n ) {\n if (typeof value.value !== 'object') {\n throw Error('AssertionError: Expected i18n param value to have an element and template slot');\n }\n const elementValue = formatValue({\n ...value,\n value: value.value.element,\n flags: value.flags & ~ir.I18nParamValueFlags.TemplateTag,\n });\n const templateValue = formatValue({\n ...value,\n value: value.value.template,\n flags: value.flags & ~ir.I18nParamValueFlags.ElementTag,\n });\n // TODO(mmalerba): This is likely a bug in TemplateDefinitionBuilder, we should not need to\n // record the template value twice. For now I'm re-implementing the behavior here to keep the\n // output consistent with TemplateDefinitionBuilder.\n if (\n value.flags & ir.I18nParamValueFlags.OpenTag &&\n value.flags & ir.I18nParamValueFlags.CloseTag\n ) {\n return `${templateValue}${elementValue}${templateValue}`;\n }\n // To match the TemplateDefinitionBuilder output, flip the order depending on whether the\n // values represent a closing or opening tag (or both).\n // TODO(mmalerba): Figure out if this makes a difference in terms of either functionality,\n // or the resulting message ID. If not, we can remove the special-casing in the future.\n return value.flags & ir.I18nParamValueFlags.CloseTag\n ? `${elementValue}${templateValue}`\n : `${templateValue}${elementValue}`;\n }\n\n // Self-closing tags use a special form that concatenates the start and close tag values.\n if (\n value.flags & ir.I18nParamValueFlags.OpenTag &&\n value.flags & ir.I18nParamValueFlags.CloseTag\n ) {\n return `${formatValue({\n ...value,\n flags: value.flags & ~ir.I18nParamValueFlags.CloseTag,\n })}${formatValue({...value, flags: value.flags & ~ir.I18nParamValueFlags.OpenTag})}`;\n }\n\n // If there are no special flags, just return the raw value.\n if (value.flags === ir.I18nParamValueFlags.None) {\n return `${value.value}`;\n }\n\n // Encode the remaining flags as part of the value.\n let tagMarker = '';\n let closeMarker = '';\n if (value.flags & ir.I18nParamValueFlags.ElementTag) {\n tagMarker = ELEMENT_MARKER;\n } else if (value.flags & ir.I18nParamValueFlags.TemplateTag) {\n tagMarker = TEMPLATE_MARKER;\n }\n if (tagMarker !== '') {\n closeMarker = value.flags & ir.I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : '';\n }\n const context =\n value.subTemplateIndex === null ? '' : `${CONTEXT_MARKER}${value.subTemplateIndex}`;\n return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Generate `ir.AdvanceOp`s in between `ir.UpdateOp`s that ensure the runtime's implicit slot\n * context will be advanced correctly.\n */\nexport function generateAdvance(job: CompilationJob): void {\n for (const unit of job.units) {\n // First build a map of all of the declarations in the view that have assigned slots.\n const slotMap = new Map();\n for (const op of unit.create) {\n if (!ir.hasConsumesSlotTrait(op)) {\n continue;\n } else if (op.handle.slot === null) {\n throw new Error(\n `AssertionError: expected slots to have been allocated before generating advance() calls`,\n );\n }\n\n slotMap.set(op.xref, op.handle.slot);\n }\n\n // Next, step through the update operations and generate `ir.AdvanceOp`s as required to ensure\n // the runtime's implicit slot counter will be set to the correct slot before executing each\n // update operation which depends on it.\n //\n // To do that, we track what the runtime's slot counter will be through the update operations.\n let slotContext = 0;\n for (const op of unit.update) {\n let consumer: ir.DependsOnSlotContextOpTrait | null = null;\n\n if (ir.hasDependsOnSlotContextTrait(op)) {\n consumer = op;\n } else {\n ir.visitExpressionsInOp(op, (expr) => {\n if (consumer === null && ir.hasDependsOnSlotContextTrait(expr)) {\n consumer = expr;\n }\n });\n }\n\n if (consumer === null) {\n continue;\n }\n\n if (!slotMap.has(consumer.target)) {\n // We expect ops that _do_ depend on the slot counter to point at declarations that exist in\n // the `slotMap`.\n throw new Error(`AssertionError: reference to unknown slot for target ${consumer.target}`);\n }\n\n const slot = slotMap.get(consumer.target)!;\n\n // Does the slot counter need to be adjusted?\n if (slotContext !== slot) {\n // If so, generate an `ir.AdvanceOp` to advance the counter.\n const delta = slot - slotContext;\n if (delta < 0) {\n throw new Error(`AssertionError: slot counter should never need to move backwards`);\n }\n\n ir.OpList.insertBefore(ir.createAdvanceOp(delta, consumer.sourceSpan), op);\n slotContext = slot;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {parseSelectorToR3Selector} from '../../../../core';\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport type {ComponentCompilationJob} from '../compilation';\nimport {literalOrArrayLiteral} from '../conversion';\n\n/**\n * Locate projection slots, populate the each component's `ngContentSelectors` literal field,\n * populate `project` arguments, and generate the required `projectionDef` instruction for the job's\n * root view.\n */\nexport function generateProjectionDefs(job: ComponentCompilationJob): void {\n // TODO: Why does TemplateDefinitionBuilder force a shared constant?\n const share = job.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder;\n\n // Collect all selectors from this component, and its nested views. Also, assign each projection a\n // unique ascending projection slot index.\n const selectors = [];\n let projectionSlotIndex = 0;\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.Projection) {\n selectors.push(op.selector);\n op.projectionSlotIndex = projectionSlotIndex++;\n }\n }\n }\n\n if (selectors.length > 0) {\n // Create the projectionDef array. If we only found a single wildcard selector, then we use the\n // default behavior with no arguments instead.\n let defExpr: o.Expression | null = null;\n if (selectors.length > 1 || selectors[0] !== '*') {\n const def = selectors.map((s) => (s === '*' ? s : parseSelectorToR3Selector(s)));\n defExpr = job.pool.getConstLiteral(literalOrArrayLiteral(def), share);\n }\n\n // Create the ngContentSelectors constant.\n job.contentSelectors = job.pool.getConstLiteral(literalOrArrayLiteral(selectors), share);\n\n // The projection def instruction goes at the beginning of the root view, before any\n // `projection` instructions.\n job.root.create.prepend([ir.createProjectionDefOp(defExpr)]);\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\n\nimport type {ComponentCompilationJob, ViewCompilationUnit} from '../compilation';\n\n/**\n * Generate a preamble sequence for each view creation block and listener function which declares\n * any variables that be referenced in other operations in the block.\n *\n * Variables generated include:\n * * a saved view context to be used to restore the current view in event listeners.\n * * the context of the restored view within event listener handlers.\n * * context variables from the current view as well as all parent views (including the root\n * context if needed).\n * * local references from elements within the current view and any lexical parents.\n *\n * Variables are generated here unconditionally, and may optimized away in future operations if it\n * turns out their values (and any side effects) are unused.\n */\nexport function generateVariables(job: ComponentCompilationJob): void {\n recursivelyProcessView(job.root, /* there is no parent scope for the root view */ null);\n}\n\n/**\n * Process the given `ViewCompilation` and generate preambles for it and any listeners that it\n * declares.\n *\n * @param `parentScope` a scope extracted from the parent view which captures any variables which\n * should be inherited by this view. `null` if the current view is the root view.\n */\nfunction recursivelyProcessView(view: ViewCompilationUnit, parentScope: Scope | null): void {\n // Extract a `Scope` from this view.\n const scope = getScopeForView(view, parentScope);\n\n for (const op of view.create) {\n switch (op.kind) {\n case ir.OpKind.Template:\n // Descend into child embedded views.\n recursivelyProcessView(view.job.views.get(op.xref)!, scope);\n break;\n case ir.OpKind.Projection:\n if (op.fallbackView !== null) {\n recursivelyProcessView(view.job.views.get(op.fallbackView)!, scope);\n }\n break;\n case ir.OpKind.RepeaterCreate:\n // Descend into child embedded views.\n recursivelyProcessView(view.job.views.get(op.xref)!, scope);\n if (op.emptyView) {\n recursivelyProcessView(view.job.views.get(op.emptyView)!, scope);\n }\n if (op.trackByOps !== null) {\n op.trackByOps.prepend(generateVariablesInScopeForView(view, scope, false));\n }\n break;\n case ir.OpKind.Listener:\n case ir.OpKind.TwoWayListener:\n // Prepend variables to listener handler functions.\n op.handlerOps.prepend(generateVariablesInScopeForView(view, scope, true));\n break;\n }\n }\n\n view.update.prepend(generateVariablesInScopeForView(view, scope, false));\n}\n\n/**\n * Lexical scope of a view, including a reference to its parent view's scope, if any.\n */\ninterface Scope {\n /**\n * `XrefId` of the view to which this scope corresponds.\n */\n view: ir.XrefId;\n\n viewContextVariable: ir.SemanticVariable;\n\n contextVariables: Map;\n\n aliases: Set;\n\n /**\n * Local references collected from elements within the view.\n */\n references: Reference[];\n\n /**\n * `@let` declarations collected from the view.\n */\n letDeclarations: LetDeclaration[];\n\n /**\n * `Scope` of the parent view, if any.\n */\n parent: Scope | null;\n}\n\n/**\n * Information needed about a local reference collected from an element within a view.\n */\ninterface Reference {\n /**\n * Name given to the local reference variable within the template.\n *\n * This is not the name which will be used for the variable declaration in the generated\n * template code.\n */\n name: string;\n\n /**\n * `XrefId` of the element-like node which this reference targets.\n *\n * The reference may be either to the element (or template) itself, or to a directive on it.\n */\n targetId: ir.XrefId;\n\n targetSlot: ir.SlotHandle;\n\n /**\n * A generated offset of this reference among all the references on a specific element.\n */\n offset: number;\n\n variable: ir.SemanticVariable;\n}\n\n/**\n * Information about `@let` declaration collected from a view.\n */\ninterface LetDeclaration {\n /** `XrefId` of the `@let` declaration that the reference is pointing to. */\n targetId: ir.XrefId;\n\n /** Slot in which the declaration is stored. */\n targetSlot: ir.SlotHandle;\n\n /** Variable referring to the declaration. */\n variable: ir.IdentifierVariable;\n}\n\n/**\n * Process a view and generate a `Scope` representing the variables available for reference within\n * that view.\n */\nfunction getScopeForView(view: ViewCompilationUnit, parent: Scope | null): Scope {\n const scope: Scope = {\n view: view.xref,\n viewContextVariable: {\n kind: ir.SemanticVariableKind.Context,\n name: null,\n view: view.xref,\n },\n contextVariables: new Map(),\n aliases: view.aliases,\n references: [],\n letDeclarations: [],\n parent,\n };\n\n for (const identifier of view.contextVariables.keys()) {\n scope.contextVariables.set(identifier, {\n kind: ir.SemanticVariableKind.Identifier,\n name: null,\n identifier,\n local: false,\n });\n }\n\n for (const op of view.create) {\n switch (op.kind) {\n case ir.OpKind.ElementStart:\n case ir.OpKind.Template:\n if (!Array.isArray(op.localRefs)) {\n throw new Error(`AssertionError: expected localRefs to be an array`);\n }\n\n // Record available local references from this element.\n for (let offset = 0; offset < op.localRefs.length; offset++) {\n scope.references.push({\n name: op.localRefs[offset].name,\n targetId: op.xref,\n targetSlot: op.handle,\n offset,\n variable: {\n kind: ir.SemanticVariableKind.Identifier,\n name: null,\n identifier: op.localRefs[offset].name,\n local: false,\n },\n });\n }\n break;\n\n case ir.OpKind.DeclareLet:\n scope.letDeclarations.push({\n targetId: op.xref,\n targetSlot: op.handle,\n variable: {\n kind: ir.SemanticVariableKind.Identifier,\n name: null,\n identifier: op.declaredName,\n local: false,\n },\n });\n break;\n }\n }\n\n return scope;\n}\n\n/**\n * Generate declarations for all variables that are in scope for a given view.\n *\n * This is a recursive process, as views inherit variables available from their parent view, which\n * itself may have inherited variables, etc.\n */\nfunction generateVariablesInScopeForView(\n view: ViewCompilationUnit,\n scope: Scope,\n isListener: boolean,\n): ir.VariableOp[] {\n const newOps: ir.VariableOp[] = [];\n\n if (scope.view !== view.xref) {\n // Before generating variables for a parent view, we need to switch to the context of the parent\n // view with a `nextContext` expression. This context switching operation itself declares a\n // variable, because the context of the view may be referenced directly.\n newOps.push(\n ir.createVariableOp(\n view.job.allocateXrefId(),\n scope.viewContextVariable,\n new ir.NextContextExpr(),\n ir.VariableFlags.None,\n ),\n );\n }\n\n // Add variables for all context variables available in this scope's view.\n const scopeView = view.job.views.get(scope.view)!;\n for (const [name, value] of scopeView.contextVariables) {\n const context = new ir.ContextExpr(scope.view);\n // We either read the context, or, if the variable is CTX_REF, use the context directly.\n const variable = value === ir.CTX_REF ? context : new o.ReadPropExpr(context, value);\n // Add the variable declaration.\n newOps.push(\n ir.createVariableOp(\n view.job.allocateXrefId(),\n scope.contextVariables.get(name)!,\n variable,\n ir.VariableFlags.None,\n ),\n );\n }\n\n for (const alias of scopeView.aliases) {\n newOps.push(\n ir.createVariableOp(\n view.job.allocateXrefId(),\n alias,\n alias.expression.clone(),\n ir.VariableFlags.AlwaysInline,\n ),\n );\n }\n\n // Add variables for all local references declared for elements in this scope.\n for (const ref of scope.references) {\n newOps.push(\n ir.createVariableOp(\n view.job.allocateXrefId(),\n ref.variable,\n new ir.ReferenceExpr(ref.targetId, ref.targetSlot, ref.offset),\n ir.VariableFlags.None,\n ),\n );\n }\n\n if (scope.view !== view.xref || isListener) {\n for (const decl of scope.letDeclarations) {\n newOps.push(\n ir.createVariableOp(\n view.job.allocateXrefId(),\n decl.variable,\n new ir.ContextLetReferenceExpr(decl.targetId, decl.targetSlot),\n ir.VariableFlags.None,\n ),\n );\n }\n }\n\n if (scope.parent !== null) {\n // Recursively add variables from the parent scope.\n newOps.push(...generateVariablesInScopeForView(view, scope.parent, false));\n }\n return newOps;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport type {ComponentCompilationJob} from '../compilation';\n\n/**\n * `ir.ConstCollectedExpr` may be present in any IR expression. This means that expression needs to\n * be lifted into the component const array, and replaced with a reference to the const array at its\n *\n * usage site. This phase walks the IR and performs this transformation.\n */\nexport function collectConstExpressions(job: ComponentCompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n ir.transformExpressionsInOp(\n op,\n (expr) => {\n if (!(expr instanceof ir.ConstCollectedExpr)) {\n return expr;\n }\n return o.literal(job.addConst(expr.expr));\n },\n ir.VisitorContextFlag.None,\n );\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\n\nimport type {CompilationJob} from '../compilation';\n\nconst STYLE_DOT = 'style.';\nconst CLASS_DOT = 'class.';\n\nconst STYLE_BANG = 'style!';\nconst CLASS_BANG = 'class!';\nconst BANG_IMPORTANT = '!important';\n\n/**\n * Host bindings are compiled using a different parser entrypoint, and are parsed quite differently\n * as a result. Therefore, we need to do some extra parsing for host style properties, as compared\n * to non-host style properties.\n * TODO: Unify host bindings and non-host bindings in the parser.\n */\nexport function parseHostStyleProperties(job: CompilationJob): void {\n for (const op of job.root.update) {\n if (!(op.kind === ir.OpKind.Binding && op.bindingKind === ir.BindingKind.Property)) {\n continue;\n }\n\n if (op.name.endsWith(BANG_IMPORTANT)) {\n // Delete any `!important` suffixes from the binding name.\n op.name = op.name.substring(0, op.name.length - BANG_IMPORTANT.length);\n }\n\n if (op.name.startsWith(STYLE_DOT)) {\n op.bindingKind = ir.BindingKind.StyleProperty;\n op.name = op.name.substring(STYLE_DOT.length);\n\n if (!isCssCustomProperty(op.name)) {\n op.name = hyphenate(op.name);\n }\n\n const {property, suffix} = parseProperty(op.name);\n op.name = property;\n op.unit = suffix;\n } else if (op.name.startsWith(STYLE_BANG)) {\n op.bindingKind = ir.BindingKind.StyleProperty;\n op.name = 'style';\n } else if (op.name.startsWith(CLASS_DOT)) {\n op.bindingKind = ir.BindingKind.ClassName;\n op.name = parseProperty(op.name.substring(CLASS_DOT.length)).property;\n } else if (op.name.startsWith(CLASS_BANG)) {\n op.bindingKind = ir.BindingKind.ClassName;\n op.name = parseProperty(op.name.substring(CLASS_BANG.length)).property;\n }\n }\n}\n\n/**\n * Checks whether property name is a custom CSS property.\n * See: https://www.w3.org/TR/css-variables-1\n */\nfunction isCssCustomProperty(name: string): boolean {\n return name.startsWith('--');\n}\n\nfunction hyphenate(value: string): string {\n return value\n .replace(/[a-z][A-Z]/g, (v) => {\n return v.charAt(0) + '-' + v.charAt(1);\n })\n .toLowerCase();\n}\n\nfunction parseProperty(name: string): {property: string; suffix: string | null} {\n const overrideIndex = name.indexOf('!important');\n if (overrideIndex !== -1) {\n name = overrideIndex > 0 ? name.substring(0, overrideIndex) : '';\n }\n\n let suffix: string | null = null;\n let property = name;\n const unitIndex = name.lastIndexOf('.');\n if (unitIndex > 0) {\n suffix = name.slice(unitIndex + 1);\n property = name.substring(0, unitIndex);\n }\n\n return {property, suffix};\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from './output_ast';\n\nexport type MapEntry = {\n key: string;\n quoted: boolean;\n value: o.Expression;\n};\n\nexport type MapLiteral = MapEntry[];\n\nexport function mapEntry(key: string, value: o.Expression): MapEntry {\n return {key, value, quoted: false};\n}\n\nexport function mapLiteral(\n obj: {[key: string]: o.Expression},\n quoted: boolean = false,\n): o.Expression {\n return o.literalMap(\n Object.keys(obj).map((key) => ({\n key,\n quoted,\n value: obj[key],\n })),\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as i18n from '../../../i18n/i18n_ast';\n\nimport {formatI18nPlaceholderName} from './util';\n\nclass IcuSerializerVisitor implements i18n.Visitor {\n visitText(text: i18n.Text): any {\n return text.value;\n }\n\n visitContainer(container: i18n.Container): any {\n return container.children.map((child) => child.visit(this)).join('');\n }\n\n visitIcu(icu: i18n.Icu): any {\n const strCases = Object.keys(icu.cases).map(\n (k: string) => `${k} {${icu.cases[k].visit(this)}}`,\n );\n const result = `{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(' ')}}`;\n return result;\n }\n\n visitTagPlaceholder(ph: i18n.TagPlaceholder): any {\n return ph.isVoid\n ? this.formatPh(ph.startName)\n : `${this.formatPh(ph.startName)}${ph.children\n .map((child) => child.visit(this))\n .join('')}${this.formatPh(ph.closeName)}`;\n }\n\n visitPlaceholder(ph: i18n.Placeholder): any {\n return this.formatPh(ph.name);\n }\n\n visitBlockPlaceholder(ph: i18n.BlockPlaceholder): any {\n return `${this.formatPh(ph.startName)}${ph.children\n .map((child) => child.visit(this))\n .join('')}${this.formatPh(ph.closeName)}`;\n }\n\n visitIcuPlaceholder(ph: i18n.IcuPlaceholder, context?: any): any {\n return this.formatPh(ph.name);\n }\n\n private formatPh(value: string): string {\n return `{${formatI18nPlaceholderName(value, /* useCamelCase */ false)}}`;\n }\n}\n\nconst serializer = new IcuSerializerVisitor();\nexport function serializeIcuNode(icu: i18n.Icu): string {\n return icu.visit(serializer);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {I18nMeta} from '../i18n/i18n_ast';\nimport {ParseSourceSpan} from '../parse_util';\n\nimport {InterpolatedAttributeToken, InterpolatedTextToken} from './tokens';\n\ninterface BaseNode {\n sourceSpan: ParseSourceSpan;\n visit(visitor: Visitor, context: any): any;\n}\n\nexport type Node =\n | Attribute\n | Comment\n | Element\n | Expansion\n | ExpansionCase\n | Text\n | Block\n | BlockParameter;\n\nexport abstract class NodeWithI18n implements BaseNode {\n constructor(\n public sourceSpan: ParseSourceSpan,\n public i18n?: I18nMeta,\n ) {}\n abstract visit(visitor: Visitor, context: any): any;\n}\n\nexport class Text extends NodeWithI18n {\n constructor(\n public value: string,\n sourceSpan: ParseSourceSpan,\n public tokens: InterpolatedTextToken[],\n i18n?: I18nMeta,\n ) {\n super(sourceSpan, i18n);\n }\n override visit(visitor: Visitor, context: any): any {\n return visitor.visitText(this, context);\n }\n}\n\nexport class Expansion extends NodeWithI18n {\n constructor(\n public switchValue: string,\n public type: string,\n public cases: ExpansionCase[],\n sourceSpan: ParseSourceSpan,\n public switchValueSourceSpan: ParseSourceSpan,\n i18n?: I18nMeta,\n ) {\n super(sourceSpan, i18n);\n }\n override visit(visitor: Visitor, context: any): any {\n return visitor.visitExpansion(this, context);\n }\n}\n\nexport class ExpansionCase implements BaseNode {\n constructor(\n public value: string,\n public expression: Node[],\n public sourceSpan: ParseSourceSpan,\n public valueSourceSpan: ParseSourceSpan,\n public expSourceSpan: ParseSourceSpan,\n ) {}\n\n visit(visitor: Visitor, context: any): any {\n return visitor.visitExpansionCase(this, context);\n }\n}\n\nexport class Attribute extends NodeWithI18n {\n constructor(\n public name: string,\n public value: string,\n sourceSpan: ParseSourceSpan,\n readonly keySpan: ParseSourceSpan | undefined,\n public valueSpan: ParseSourceSpan | undefined,\n public valueTokens: InterpolatedAttributeToken[] | undefined,\n i18n: I18nMeta | undefined,\n ) {\n super(sourceSpan, i18n);\n }\n override visit(visitor: Visitor, context: any): any {\n return visitor.visitAttribute(this, context);\n }\n}\n\nexport class Element extends NodeWithI18n {\n constructor(\n public name: string,\n public attrs: Attribute[],\n public children: Node[],\n sourceSpan: ParseSourceSpan,\n public startSourceSpan: ParseSourceSpan,\n public endSourceSpan: ParseSourceSpan | null = null,\n i18n?: I18nMeta,\n ) {\n super(sourceSpan, i18n);\n }\n override visit(visitor: Visitor, context: any): any {\n return visitor.visitElement(this, context);\n }\n}\n\nexport class Comment implements BaseNode {\n constructor(\n public value: string | null,\n public sourceSpan: ParseSourceSpan,\n ) {}\n visit(visitor: Visitor, context: any): any {\n return visitor.visitComment(this, context);\n }\n}\n\nexport class Block extends NodeWithI18n {\n constructor(\n public name: string,\n public parameters: BlockParameter[],\n public children: Node[],\n sourceSpan: ParseSourceSpan,\n public nameSpan: ParseSourceSpan,\n public startSourceSpan: ParseSourceSpan,\n public endSourceSpan: ParseSourceSpan | null = null,\n i18n?: I18nMeta,\n ) {\n super(sourceSpan, i18n);\n }\n\n override visit(visitor: Visitor, context: any) {\n return visitor.visitBlock(this, context);\n }\n}\n\nexport class BlockParameter implements BaseNode {\n constructor(\n public expression: string,\n public sourceSpan: ParseSourceSpan,\n ) {}\n\n visit(visitor: Visitor, context: any): any {\n return visitor.visitBlockParameter(this, context);\n }\n}\n\nexport class LetDeclaration implements BaseNode {\n constructor(\n public name: string,\n public value: string,\n public sourceSpan: ParseSourceSpan,\n readonly nameSpan: ParseSourceSpan,\n public valueSpan: ParseSourceSpan,\n ) {}\n\n visit(visitor: Visitor, context: any): any {\n return visitor.visitLetDeclaration(this, context);\n }\n}\n\nexport interface Visitor {\n // Returning a truthy value from `visit()` will prevent `visitAll()` from the call to the typed\n // method and result returned will become the result included in `visitAll()`s result array.\n visit?(node: Node, context: any): any;\n\n visitElement(element: Element, context: any): any;\n visitAttribute(attribute: Attribute, context: any): any;\n visitText(text: Text, context: any): any;\n visitComment(comment: Comment, context: any): any;\n visitExpansion(expansion: Expansion, context: any): any;\n visitExpansionCase(expansionCase: ExpansionCase, context: any): any;\n visitBlock(block: Block, context: any): any;\n visitBlockParameter(parameter: BlockParameter, context: any): any;\n visitLetDeclaration(decl: LetDeclaration, context: any): any;\n}\n\nexport function visitAll(visitor: Visitor, nodes: Node[], context: any = null): any[] {\n const result: any[] = [];\n\n const visit = visitor.visit\n ? (ast: Node) => visitor.visit!(ast, context) || ast.visit(visitor, context)\n : (ast: Node) => ast.visit(visitor, context);\n nodes.forEach((ast) => {\n const astResult = visit(ast);\n if (astResult) {\n result.push(astResult);\n }\n });\n return result;\n}\n\nexport class RecursiveVisitor implements Visitor {\n constructor() {}\n\n visitElement(ast: Element, context: any): any {\n this.visitChildren(context, (visit) => {\n visit(ast.attrs);\n visit(ast.children);\n });\n }\n\n visitAttribute(ast: Attribute, context: any): any {}\n visitText(ast: Text, context: any): any {}\n visitComment(ast: Comment, context: any): any {}\n\n visitExpansion(ast: Expansion, context: any): any {\n return this.visitChildren(context, (visit) => {\n visit(ast.cases);\n });\n }\n\n visitExpansionCase(ast: ExpansionCase, context: any): any {}\n\n visitBlock(block: Block, context: any): any {\n this.visitChildren(context, (visit) => {\n visit(block.parameters);\n visit(block.children);\n });\n }\n\n visitBlockParameter(ast: BlockParameter, context: any): any {}\n\n visitLetDeclaration(decl: LetDeclaration, context: any) {}\n\n private visitChildren(\n context: any,\n cb: (visit: (children: V[] | undefined) => void) => void,\n ) {\n let results: any[][] = [];\n let t = this;\n function visit(children: T[] | undefined) {\n if (children) results.push(visitAll(t, children, context));\n }\n cb(visit);\n return Array.prototype.concat.apply([], results);\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n// Mapping between all HTML entity names and their unicode representation.\n// Generated from https://html.spec.whatwg.org/multipage/entities.json by stripping\n// the `&` and `;` from the keys and removing the duplicates.\n// see https://www.w3.org/TR/html51/syntax.html#named-character-references\nexport const NAMED_ENTITIES: Record = {\n 'AElig': '\\u00C6',\n 'AMP': '\\u0026',\n 'amp': '\\u0026',\n 'Aacute': '\\u00C1',\n 'Abreve': '\\u0102',\n 'Acirc': '\\u00C2',\n 'Acy': '\\u0410',\n 'Afr': '\\uD835\\uDD04',\n 'Agrave': '\\u00C0',\n 'Alpha': '\\u0391',\n 'Amacr': '\\u0100',\n 'And': '\\u2A53',\n 'Aogon': '\\u0104',\n 'Aopf': '\\uD835\\uDD38',\n 'ApplyFunction': '\\u2061',\n 'af': '\\u2061',\n 'Aring': '\\u00C5',\n 'angst': '\\u00C5',\n 'Ascr': '\\uD835\\uDC9C',\n 'Assign': '\\u2254',\n 'colone': '\\u2254',\n 'coloneq': '\\u2254',\n 'Atilde': '\\u00C3',\n 'Auml': '\\u00C4',\n 'Backslash': '\\u2216',\n 'setminus': '\\u2216',\n 'setmn': '\\u2216',\n 'smallsetminus': '\\u2216',\n 'ssetmn': '\\u2216',\n 'Barv': '\\u2AE7',\n 'Barwed': '\\u2306',\n 'doublebarwedge': '\\u2306',\n 'Bcy': '\\u0411',\n 'Because': '\\u2235',\n 'becaus': '\\u2235',\n 'because': '\\u2235',\n 'Bernoullis': '\\u212C',\n 'Bscr': '\\u212C',\n 'bernou': '\\u212C',\n 'Beta': '\\u0392',\n 'Bfr': '\\uD835\\uDD05',\n 'Bopf': '\\uD835\\uDD39',\n 'Breve': '\\u02D8',\n 'breve': '\\u02D8',\n 'Bumpeq': '\\u224E',\n 'HumpDownHump': '\\u224E',\n 'bump': '\\u224E',\n 'CHcy': '\\u0427',\n 'COPY': '\\u00A9',\n 'copy': '\\u00A9',\n 'Cacute': '\\u0106',\n 'Cap': '\\u22D2',\n 'CapitalDifferentialD': '\\u2145',\n 'DD': '\\u2145',\n 'Cayleys': '\\u212D',\n 'Cfr': '\\u212D',\n 'Ccaron': '\\u010C',\n 'Ccedil': '\\u00C7',\n 'Ccirc': '\\u0108',\n 'Cconint': '\\u2230',\n 'Cdot': '\\u010A',\n 'Cedilla': '\\u00B8',\n 'cedil': '\\u00B8',\n 'CenterDot': '\\u00B7',\n 'centerdot': '\\u00B7',\n 'middot': '\\u00B7',\n 'Chi': '\\u03A7',\n 'CircleDot': '\\u2299',\n 'odot': '\\u2299',\n 'CircleMinus': '\\u2296',\n 'ominus': '\\u2296',\n 'CirclePlus': '\\u2295',\n 'oplus': '\\u2295',\n 'CircleTimes': '\\u2297',\n 'otimes': '\\u2297',\n 'ClockwiseContourIntegral': '\\u2232',\n 'cwconint': '\\u2232',\n 'CloseCurlyDoubleQuote': '\\u201D',\n 'rdquo': '\\u201D',\n 'rdquor': '\\u201D',\n 'CloseCurlyQuote': '\\u2019',\n 'rsquo': '\\u2019',\n 'rsquor': '\\u2019',\n 'Colon': '\\u2237',\n 'Proportion': '\\u2237',\n 'Colone': '\\u2A74',\n 'Congruent': '\\u2261',\n 'equiv': '\\u2261',\n 'Conint': '\\u222F',\n 'DoubleContourIntegral': '\\u222F',\n 'ContourIntegral': '\\u222E',\n 'conint': '\\u222E',\n 'oint': '\\u222E',\n 'Copf': '\\u2102',\n 'complexes': '\\u2102',\n 'Coproduct': '\\u2210',\n 'coprod': '\\u2210',\n 'CounterClockwiseContourIntegral': '\\u2233',\n 'awconint': '\\u2233',\n 'Cross': '\\u2A2F',\n 'Cscr': '\\uD835\\uDC9E',\n 'Cup': '\\u22D3',\n 'CupCap': '\\u224D',\n 'asympeq': '\\u224D',\n 'DDotrahd': '\\u2911',\n 'DJcy': '\\u0402',\n 'DScy': '\\u0405',\n 'DZcy': '\\u040F',\n 'Dagger': '\\u2021',\n 'ddagger': '\\u2021',\n 'Darr': '\\u21A1',\n 'Dashv': '\\u2AE4',\n 'DoubleLeftTee': '\\u2AE4',\n 'Dcaron': '\\u010E',\n 'Dcy': '\\u0414',\n 'Del': '\\u2207',\n 'nabla': '\\u2207',\n 'Delta': '\\u0394',\n 'Dfr': '\\uD835\\uDD07',\n 'DiacriticalAcute': '\\u00B4',\n 'acute': '\\u00B4',\n 'DiacriticalDot': '\\u02D9',\n 'dot': '\\u02D9',\n 'DiacriticalDoubleAcute': '\\u02DD',\n 'dblac': '\\u02DD',\n 'DiacriticalGrave': '\\u0060',\n 'grave': '\\u0060',\n 'DiacriticalTilde': '\\u02DC',\n 'tilde': '\\u02DC',\n 'Diamond': '\\u22C4',\n 'diam': '\\u22C4',\n 'diamond': '\\u22C4',\n 'DifferentialD': '\\u2146',\n 'dd': '\\u2146',\n 'Dopf': '\\uD835\\uDD3B',\n 'Dot': '\\u00A8',\n 'DoubleDot': '\\u00A8',\n 'die': '\\u00A8',\n 'uml': '\\u00A8',\n 'DotDot': '\\u20DC',\n 'DotEqual': '\\u2250',\n 'doteq': '\\u2250',\n 'esdot': '\\u2250',\n 'DoubleDownArrow': '\\u21D3',\n 'Downarrow': '\\u21D3',\n 'dArr': '\\u21D3',\n 'DoubleLeftArrow': '\\u21D0',\n 'Leftarrow': '\\u21D0',\n 'lArr': '\\u21D0',\n 'DoubleLeftRightArrow': '\\u21D4',\n 'Leftrightarrow': '\\u21D4',\n 'hArr': '\\u21D4',\n 'iff': '\\u21D4',\n 'DoubleLongLeftArrow': '\\u27F8',\n 'Longleftarrow': '\\u27F8',\n 'xlArr': '\\u27F8',\n 'DoubleLongLeftRightArrow': '\\u27FA',\n 'Longleftrightarrow': '\\u27FA',\n 'xhArr': '\\u27FA',\n 'DoubleLongRightArrow': '\\u27F9',\n 'Longrightarrow': '\\u27F9',\n 'xrArr': '\\u27F9',\n 'DoubleRightArrow': '\\u21D2',\n 'Implies': '\\u21D2',\n 'Rightarrow': '\\u21D2',\n 'rArr': '\\u21D2',\n 'DoubleRightTee': '\\u22A8',\n 'vDash': '\\u22A8',\n 'DoubleUpArrow': '\\u21D1',\n 'Uparrow': '\\u21D1',\n 'uArr': '\\u21D1',\n 'DoubleUpDownArrow': '\\u21D5',\n 'Updownarrow': '\\u21D5',\n 'vArr': '\\u21D5',\n 'DoubleVerticalBar': '\\u2225',\n 'par': '\\u2225',\n 'parallel': '\\u2225',\n 'shortparallel': '\\u2225',\n 'spar': '\\u2225',\n 'DownArrow': '\\u2193',\n 'ShortDownArrow': '\\u2193',\n 'darr': '\\u2193',\n 'downarrow': '\\u2193',\n 'DownArrowBar': '\\u2913',\n 'DownArrowUpArrow': '\\u21F5',\n 'duarr': '\\u21F5',\n 'DownBreve': '\\u0311',\n 'DownLeftRightVector': '\\u2950',\n 'DownLeftTeeVector': '\\u295E',\n 'DownLeftVector': '\\u21BD',\n 'leftharpoondown': '\\u21BD',\n 'lhard': '\\u21BD',\n 'DownLeftVectorBar': '\\u2956',\n 'DownRightTeeVector': '\\u295F',\n 'DownRightVector': '\\u21C1',\n 'rhard': '\\u21C1',\n 'rightharpoondown': '\\u21C1',\n 'DownRightVectorBar': '\\u2957',\n 'DownTee': '\\u22A4',\n 'top': '\\u22A4',\n 'DownTeeArrow': '\\u21A7',\n 'mapstodown': '\\u21A7',\n 'Dscr': '\\uD835\\uDC9F',\n 'Dstrok': '\\u0110',\n 'ENG': '\\u014A',\n 'ETH': '\\u00D0',\n 'Eacute': '\\u00C9',\n 'Ecaron': '\\u011A',\n 'Ecirc': '\\u00CA',\n 'Ecy': '\\u042D',\n 'Edot': '\\u0116',\n 'Efr': '\\uD835\\uDD08',\n 'Egrave': '\\u00C8',\n 'Element': '\\u2208',\n 'in': '\\u2208',\n 'isin': '\\u2208',\n 'isinv': '\\u2208',\n 'Emacr': '\\u0112',\n 'EmptySmallSquare': '\\u25FB',\n 'EmptyVerySmallSquare': '\\u25AB',\n 'Eogon': '\\u0118',\n 'Eopf': '\\uD835\\uDD3C',\n 'Epsilon': '\\u0395',\n 'Equal': '\\u2A75',\n 'EqualTilde': '\\u2242',\n 'eqsim': '\\u2242',\n 'esim': '\\u2242',\n 'Equilibrium': '\\u21CC',\n 'rightleftharpoons': '\\u21CC',\n 'rlhar': '\\u21CC',\n 'Escr': '\\u2130',\n 'expectation': '\\u2130',\n 'Esim': '\\u2A73',\n 'Eta': '\\u0397',\n 'Euml': '\\u00CB',\n 'Exists': '\\u2203',\n 'exist': '\\u2203',\n 'ExponentialE': '\\u2147',\n 'ee': '\\u2147',\n 'exponentiale': '\\u2147',\n 'Fcy': '\\u0424',\n 'Ffr': '\\uD835\\uDD09',\n 'FilledSmallSquare': '\\u25FC',\n 'FilledVerySmallSquare': '\\u25AA',\n 'blacksquare': '\\u25AA',\n 'squarf': '\\u25AA',\n 'squf': '\\u25AA',\n 'Fopf': '\\uD835\\uDD3D',\n 'ForAll': '\\u2200',\n 'forall': '\\u2200',\n 'Fouriertrf': '\\u2131',\n 'Fscr': '\\u2131',\n 'GJcy': '\\u0403',\n 'GT': '\\u003E',\n 'gt': '\\u003E',\n 'Gamma': '\\u0393',\n 'Gammad': '\\u03DC',\n 'Gbreve': '\\u011E',\n 'Gcedil': '\\u0122',\n 'Gcirc': '\\u011C',\n 'Gcy': '\\u0413',\n 'Gdot': '\\u0120',\n 'Gfr': '\\uD835\\uDD0A',\n 'Gg': '\\u22D9',\n 'ggg': '\\u22D9',\n 'Gopf': '\\uD835\\uDD3E',\n 'GreaterEqual': '\\u2265',\n 'ge': '\\u2265',\n 'geq': '\\u2265',\n 'GreaterEqualLess': '\\u22DB',\n 'gel': '\\u22DB',\n 'gtreqless': '\\u22DB',\n 'GreaterFullEqual': '\\u2267',\n 'gE': '\\u2267',\n 'geqq': '\\u2267',\n 'GreaterGreater': '\\u2AA2',\n 'GreaterLess': '\\u2277',\n 'gl': '\\u2277',\n 'gtrless': '\\u2277',\n 'GreaterSlantEqual': '\\u2A7E',\n 'geqslant': '\\u2A7E',\n 'ges': '\\u2A7E',\n 'GreaterTilde': '\\u2273',\n 'gsim': '\\u2273',\n 'gtrsim': '\\u2273',\n 'Gscr': '\\uD835\\uDCA2',\n 'Gt': '\\u226B',\n 'NestedGreaterGreater': '\\u226B',\n 'gg': '\\u226B',\n 'HARDcy': '\\u042A',\n 'Hacek': '\\u02C7',\n 'caron': '\\u02C7',\n 'Hat': '\\u005E',\n 'Hcirc': '\\u0124',\n 'Hfr': '\\u210C',\n 'Poincareplane': '\\u210C',\n 'HilbertSpace': '\\u210B',\n 'Hscr': '\\u210B',\n 'hamilt': '\\u210B',\n 'Hopf': '\\u210D',\n 'quaternions': '\\u210D',\n 'HorizontalLine': '\\u2500',\n 'boxh': '\\u2500',\n 'Hstrok': '\\u0126',\n 'HumpEqual': '\\u224F',\n 'bumpe': '\\u224F',\n 'bumpeq': '\\u224F',\n 'IEcy': '\\u0415',\n 'IJlig': '\\u0132',\n 'IOcy': '\\u0401',\n 'Iacute': '\\u00CD',\n 'Icirc': '\\u00CE',\n 'Icy': '\\u0418',\n 'Idot': '\\u0130',\n 'Ifr': '\\u2111',\n 'Im': '\\u2111',\n 'image': '\\u2111',\n 'imagpart': '\\u2111',\n 'Igrave': '\\u00CC',\n 'Imacr': '\\u012A',\n 'ImaginaryI': '\\u2148',\n 'ii': '\\u2148',\n 'Int': '\\u222C',\n 'Integral': '\\u222B',\n 'int': '\\u222B',\n 'Intersection': '\\u22C2',\n 'bigcap': '\\u22C2',\n 'xcap': '\\u22C2',\n 'InvisibleComma': '\\u2063',\n 'ic': '\\u2063',\n 'InvisibleTimes': '\\u2062',\n 'it': '\\u2062',\n 'Iogon': '\\u012E',\n 'Iopf': '\\uD835\\uDD40',\n 'Iota': '\\u0399',\n 'Iscr': '\\u2110',\n 'imagline': '\\u2110',\n 'Itilde': '\\u0128',\n 'Iukcy': '\\u0406',\n 'Iuml': '\\u00CF',\n 'Jcirc': '\\u0134',\n 'Jcy': '\\u0419',\n 'Jfr': '\\uD835\\uDD0D',\n 'Jopf': '\\uD835\\uDD41',\n 'Jscr': '\\uD835\\uDCA5',\n 'Jsercy': '\\u0408',\n 'Jukcy': '\\u0404',\n 'KHcy': '\\u0425',\n 'KJcy': '\\u040C',\n 'Kappa': '\\u039A',\n 'Kcedil': '\\u0136',\n 'Kcy': '\\u041A',\n 'Kfr': '\\uD835\\uDD0E',\n 'Kopf': '\\uD835\\uDD42',\n 'Kscr': '\\uD835\\uDCA6',\n 'LJcy': '\\u0409',\n 'LT': '\\u003C',\n 'lt': '\\u003C',\n 'Lacute': '\\u0139',\n 'Lambda': '\\u039B',\n 'Lang': '\\u27EA',\n 'Laplacetrf': '\\u2112',\n 'Lscr': '\\u2112',\n 'lagran': '\\u2112',\n 'Larr': '\\u219E',\n 'twoheadleftarrow': '\\u219E',\n 'Lcaron': '\\u013D',\n 'Lcedil': '\\u013B',\n 'Lcy': '\\u041B',\n 'LeftAngleBracket': '\\u27E8',\n 'lang': '\\u27E8',\n 'langle': '\\u27E8',\n 'LeftArrow': '\\u2190',\n 'ShortLeftArrow': '\\u2190',\n 'larr': '\\u2190',\n 'leftarrow': '\\u2190',\n 'slarr': '\\u2190',\n 'LeftArrowBar': '\\u21E4',\n 'larrb': '\\u21E4',\n 'LeftArrowRightArrow': '\\u21C6',\n 'leftrightarrows': '\\u21C6',\n 'lrarr': '\\u21C6',\n 'LeftCeiling': '\\u2308',\n 'lceil': '\\u2308',\n 'LeftDoubleBracket': '\\u27E6',\n 'lobrk': '\\u27E6',\n 'LeftDownTeeVector': '\\u2961',\n 'LeftDownVector': '\\u21C3',\n 'dharl': '\\u21C3',\n 'downharpoonleft': '\\u21C3',\n 'LeftDownVectorBar': '\\u2959',\n 'LeftFloor': '\\u230A',\n 'lfloor': '\\u230A',\n 'LeftRightArrow': '\\u2194',\n 'harr': '\\u2194',\n 'leftrightarrow': '\\u2194',\n 'LeftRightVector': '\\u294E',\n 'LeftTee': '\\u22A3',\n 'dashv': '\\u22A3',\n 'LeftTeeArrow': '\\u21A4',\n 'mapstoleft': '\\u21A4',\n 'LeftTeeVector': '\\u295A',\n 'LeftTriangle': '\\u22B2',\n 'vartriangleleft': '\\u22B2',\n 'vltri': '\\u22B2',\n 'LeftTriangleBar': '\\u29CF',\n 'LeftTriangleEqual': '\\u22B4',\n 'ltrie': '\\u22B4',\n 'trianglelefteq': '\\u22B4',\n 'LeftUpDownVector': '\\u2951',\n 'LeftUpTeeVector': '\\u2960',\n 'LeftUpVector': '\\u21BF',\n 'uharl': '\\u21BF',\n 'upharpoonleft': '\\u21BF',\n 'LeftUpVectorBar': '\\u2958',\n 'LeftVector': '\\u21BC',\n 'leftharpoonup': '\\u21BC',\n 'lharu': '\\u21BC',\n 'LeftVectorBar': '\\u2952',\n 'LessEqualGreater': '\\u22DA',\n 'leg': '\\u22DA',\n 'lesseqgtr': '\\u22DA',\n 'LessFullEqual': '\\u2266',\n 'lE': '\\u2266',\n 'leqq': '\\u2266',\n 'LessGreater': '\\u2276',\n 'lessgtr': '\\u2276',\n 'lg': '\\u2276',\n 'LessLess': '\\u2AA1',\n 'LessSlantEqual': '\\u2A7D',\n 'leqslant': '\\u2A7D',\n 'les': '\\u2A7D',\n 'LessTilde': '\\u2272',\n 'lesssim': '\\u2272',\n 'lsim': '\\u2272',\n 'Lfr': '\\uD835\\uDD0F',\n 'Ll': '\\u22D8',\n 'Lleftarrow': '\\u21DA',\n 'lAarr': '\\u21DA',\n 'Lmidot': '\\u013F',\n 'LongLeftArrow': '\\u27F5',\n 'longleftarrow': '\\u27F5',\n 'xlarr': '\\u27F5',\n 'LongLeftRightArrow': '\\u27F7',\n 'longleftrightarrow': '\\u27F7',\n 'xharr': '\\u27F7',\n 'LongRightArrow': '\\u27F6',\n 'longrightarrow': '\\u27F6',\n 'xrarr': '\\u27F6',\n 'Lopf': '\\uD835\\uDD43',\n 'LowerLeftArrow': '\\u2199',\n 'swarr': '\\u2199',\n 'swarrow': '\\u2199',\n 'LowerRightArrow': '\\u2198',\n 'searr': '\\u2198',\n 'searrow': '\\u2198',\n 'Lsh': '\\u21B0',\n 'lsh': '\\u21B0',\n 'Lstrok': '\\u0141',\n 'Lt': '\\u226A',\n 'NestedLessLess': '\\u226A',\n 'll': '\\u226A',\n 'Map': '\\u2905',\n 'Mcy': '\\u041C',\n 'MediumSpace': '\\u205F',\n 'Mellintrf': '\\u2133',\n 'Mscr': '\\u2133',\n 'phmmat': '\\u2133',\n 'Mfr': '\\uD835\\uDD10',\n 'MinusPlus': '\\u2213',\n 'mnplus': '\\u2213',\n 'mp': '\\u2213',\n 'Mopf': '\\uD835\\uDD44',\n 'Mu': '\\u039C',\n 'NJcy': '\\u040A',\n 'Nacute': '\\u0143',\n 'Ncaron': '\\u0147',\n 'Ncedil': '\\u0145',\n 'Ncy': '\\u041D',\n 'NegativeMediumSpace': '\\u200B',\n 'NegativeThickSpace': '\\u200B',\n 'NegativeThinSpace': '\\u200B',\n 'NegativeVeryThinSpace': '\\u200B',\n 'ZeroWidthSpace': '\\u200B',\n 'NewLine': '\\u000A',\n 'Nfr': '\\uD835\\uDD11',\n 'NoBreak': '\\u2060',\n 'NonBreakingSpace': '\\u00A0',\n 'nbsp': '\\u00A0',\n 'Nopf': '\\u2115',\n 'naturals': '\\u2115',\n 'Not': '\\u2AEC',\n 'NotCongruent': '\\u2262',\n 'nequiv': '\\u2262',\n 'NotCupCap': '\\u226D',\n 'NotDoubleVerticalBar': '\\u2226',\n 'npar': '\\u2226',\n 'nparallel': '\\u2226',\n 'nshortparallel': '\\u2226',\n 'nspar': '\\u2226',\n 'NotElement': '\\u2209',\n 'notin': '\\u2209',\n 'notinva': '\\u2209',\n 'NotEqual': '\\u2260',\n 'ne': '\\u2260',\n 'NotEqualTilde': '\\u2242\\u0338',\n 'nesim': '\\u2242\\u0338',\n 'NotExists': '\\u2204',\n 'nexist': '\\u2204',\n 'nexists': '\\u2204',\n 'NotGreater': '\\u226F',\n 'ngt': '\\u226F',\n 'ngtr': '\\u226F',\n 'NotGreaterEqual': '\\u2271',\n 'nge': '\\u2271',\n 'ngeq': '\\u2271',\n 'NotGreaterFullEqual': '\\u2267\\u0338',\n 'ngE': '\\u2267\\u0338',\n 'ngeqq': '\\u2267\\u0338',\n 'NotGreaterGreater': '\\u226B\\u0338',\n 'nGtv': '\\u226B\\u0338',\n 'NotGreaterLess': '\\u2279',\n 'ntgl': '\\u2279',\n 'NotGreaterSlantEqual': '\\u2A7E\\u0338',\n 'ngeqslant': '\\u2A7E\\u0338',\n 'nges': '\\u2A7E\\u0338',\n 'NotGreaterTilde': '\\u2275',\n 'ngsim': '\\u2275',\n 'NotHumpDownHump': '\\u224E\\u0338',\n 'nbump': '\\u224E\\u0338',\n 'NotHumpEqual': '\\u224F\\u0338',\n 'nbumpe': '\\u224F\\u0338',\n 'NotLeftTriangle': '\\u22EA',\n 'nltri': '\\u22EA',\n 'ntriangleleft': '\\u22EA',\n 'NotLeftTriangleBar': '\\u29CF\\u0338',\n 'NotLeftTriangleEqual': '\\u22EC',\n 'nltrie': '\\u22EC',\n 'ntrianglelefteq': '\\u22EC',\n 'NotLess': '\\u226E',\n 'nless': '\\u226E',\n 'nlt': '\\u226E',\n 'NotLessEqual': '\\u2270',\n 'nle': '\\u2270',\n 'nleq': '\\u2270',\n 'NotLessGreater': '\\u2278',\n 'ntlg': '\\u2278',\n 'NotLessLess': '\\u226A\\u0338',\n 'nLtv': '\\u226A\\u0338',\n 'NotLessSlantEqual': '\\u2A7D\\u0338',\n 'nleqslant': '\\u2A7D\\u0338',\n 'nles': '\\u2A7D\\u0338',\n 'NotLessTilde': '\\u2274',\n 'nlsim': '\\u2274',\n 'NotNestedGreaterGreater': '\\u2AA2\\u0338',\n 'NotNestedLessLess': '\\u2AA1\\u0338',\n 'NotPrecedes': '\\u2280',\n 'npr': '\\u2280',\n 'nprec': '\\u2280',\n 'NotPrecedesEqual': '\\u2AAF\\u0338',\n 'npre': '\\u2AAF\\u0338',\n 'npreceq': '\\u2AAF\\u0338',\n 'NotPrecedesSlantEqual': '\\u22E0',\n 'nprcue': '\\u22E0',\n 'NotReverseElement': '\\u220C',\n 'notni': '\\u220C',\n 'notniva': '\\u220C',\n 'NotRightTriangle': '\\u22EB',\n 'nrtri': '\\u22EB',\n 'ntriangleright': '\\u22EB',\n 'NotRightTriangleBar': '\\u29D0\\u0338',\n 'NotRightTriangleEqual': '\\u22ED',\n 'nrtrie': '\\u22ED',\n 'ntrianglerighteq': '\\u22ED',\n 'NotSquareSubset': '\\u228F\\u0338',\n 'NotSquareSubsetEqual': '\\u22E2',\n 'nsqsube': '\\u22E2',\n 'NotSquareSuperset': '\\u2290\\u0338',\n 'NotSquareSupersetEqual': '\\u22E3',\n 'nsqsupe': '\\u22E3',\n 'NotSubset': '\\u2282\\u20D2',\n 'nsubset': '\\u2282\\u20D2',\n 'vnsub': '\\u2282\\u20D2',\n 'NotSubsetEqual': '\\u2288',\n 'nsube': '\\u2288',\n 'nsubseteq': '\\u2288',\n 'NotSucceeds': '\\u2281',\n 'nsc': '\\u2281',\n 'nsucc': '\\u2281',\n 'NotSucceedsEqual': '\\u2AB0\\u0338',\n 'nsce': '\\u2AB0\\u0338',\n 'nsucceq': '\\u2AB0\\u0338',\n 'NotSucceedsSlantEqual': '\\u22E1',\n 'nsccue': '\\u22E1',\n 'NotSucceedsTilde': '\\u227F\\u0338',\n 'NotSuperset': '\\u2283\\u20D2',\n 'nsupset': '\\u2283\\u20D2',\n 'vnsup': '\\u2283\\u20D2',\n 'NotSupersetEqual': '\\u2289',\n 'nsupe': '\\u2289',\n 'nsupseteq': '\\u2289',\n 'NotTilde': '\\u2241',\n 'nsim': '\\u2241',\n 'NotTildeEqual': '\\u2244',\n 'nsime': '\\u2244',\n 'nsimeq': '\\u2244',\n 'NotTildeFullEqual': '\\u2247',\n 'ncong': '\\u2247',\n 'NotTildeTilde': '\\u2249',\n 'nap': '\\u2249',\n 'napprox': '\\u2249',\n 'NotVerticalBar': '\\u2224',\n 'nmid': '\\u2224',\n 'nshortmid': '\\u2224',\n 'nsmid': '\\u2224',\n 'Nscr': '\\uD835\\uDCA9',\n 'Ntilde': '\\u00D1',\n 'Nu': '\\u039D',\n 'OElig': '\\u0152',\n 'Oacute': '\\u00D3',\n 'Ocirc': '\\u00D4',\n 'Ocy': '\\u041E',\n 'Odblac': '\\u0150',\n 'Ofr': '\\uD835\\uDD12',\n 'Ograve': '\\u00D2',\n 'Omacr': '\\u014C',\n 'Omega': '\\u03A9',\n 'ohm': '\\u03A9',\n 'Omicron': '\\u039F',\n 'Oopf': '\\uD835\\uDD46',\n 'OpenCurlyDoubleQuote': '\\u201C',\n 'ldquo': '\\u201C',\n 'OpenCurlyQuote': '\\u2018',\n 'lsquo': '\\u2018',\n 'Or': '\\u2A54',\n 'Oscr': '\\uD835\\uDCAA',\n 'Oslash': '\\u00D8',\n 'Otilde': '\\u00D5',\n 'Otimes': '\\u2A37',\n 'Ouml': '\\u00D6',\n 'OverBar': '\\u203E',\n 'oline': '\\u203E',\n 'OverBrace': '\\u23DE',\n 'OverBracket': '\\u23B4',\n 'tbrk': '\\u23B4',\n 'OverParenthesis': '\\u23DC',\n 'PartialD': '\\u2202',\n 'part': '\\u2202',\n 'Pcy': '\\u041F',\n 'Pfr': '\\uD835\\uDD13',\n 'Phi': '\\u03A6',\n 'Pi': '\\u03A0',\n 'PlusMinus': '\\u00B1',\n 'plusmn': '\\u00B1',\n 'pm': '\\u00B1',\n 'Popf': '\\u2119',\n 'primes': '\\u2119',\n 'Pr': '\\u2ABB',\n 'Precedes': '\\u227A',\n 'pr': '\\u227A',\n 'prec': '\\u227A',\n 'PrecedesEqual': '\\u2AAF',\n 'pre': '\\u2AAF',\n 'preceq': '\\u2AAF',\n 'PrecedesSlantEqual': '\\u227C',\n 'prcue': '\\u227C',\n 'preccurlyeq': '\\u227C',\n 'PrecedesTilde': '\\u227E',\n 'precsim': '\\u227E',\n 'prsim': '\\u227E',\n 'Prime': '\\u2033',\n 'Product': '\\u220F',\n 'prod': '\\u220F',\n 'Proportional': '\\u221D',\n 'prop': '\\u221D',\n 'propto': '\\u221D',\n 'varpropto': '\\u221D',\n 'vprop': '\\u221D',\n 'Pscr': '\\uD835\\uDCAB',\n 'Psi': '\\u03A8',\n 'QUOT': '\\u0022',\n 'quot': '\\u0022',\n 'Qfr': '\\uD835\\uDD14',\n 'Qopf': '\\u211A',\n 'rationals': '\\u211A',\n 'Qscr': '\\uD835\\uDCAC',\n 'RBarr': '\\u2910',\n 'drbkarow': '\\u2910',\n 'REG': '\\u00AE',\n 'circledR': '\\u00AE',\n 'reg': '\\u00AE',\n 'Racute': '\\u0154',\n 'Rang': '\\u27EB',\n 'Rarr': '\\u21A0',\n 'twoheadrightarrow': '\\u21A0',\n 'Rarrtl': '\\u2916',\n 'Rcaron': '\\u0158',\n 'Rcedil': '\\u0156',\n 'Rcy': '\\u0420',\n 'Re': '\\u211C',\n 'Rfr': '\\u211C',\n 'real': '\\u211C',\n 'realpart': '\\u211C',\n 'ReverseElement': '\\u220B',\n 'SuchThat': '\\u220B',\n 'ni': '\\u220B',\n 'niv': '\\u220B',\n 'ReverseEquilibrium': '\\u21CB',\n 'leftrightharpoons': '\\u21CB',\n 'lrhar': '\\u21CB',\n 'ReverseUpEquilibrium': '\\u296F',\n 'duhar': '\\u296F',\n 'Rho': '\\u03A1',\n 'RightAngleBracket': '\\u27E9',\n 'rang': '\\u27E9',\n 'rangle': '\\u27E9',\n 'RightArrow': '\\u2192',\n 'ShortRightArrow': '\\u2192',\n 'rarr': '\\u2192',\n 'rightarrow': '\\u2192',\n 'srarr': '\\u2192',\n 'RightArrowBar': '\\u21E5',\n 'rarrb': '\\u21E5',\n 'RightArrowLeftArrow': '\\u21C4',\n 'rightleftarrows': '\\u21C4',\n 'rlarr': '\\u21C4',\n 'RightCeiling': '\\u2309',\n 'rceil': '\\u2309',\n 'RightDoubleBracket': '\\u27E7',\n 'robrk': '\\u27E7',\n 'RightDownTeeVector': '\\u295D',\n 'RightDownVector': '\\u21C2',\n 'dharr': '\\u21C2',\n 'downharpoonright': '\\u21C2',\n 'RightDownVectorBar': '\\u2955',\n 'RightFloor': '\\u230B',\n 'rfloor': '\\u230B',\n 'RightTee': '\\u22A2',\n 'vdash': '\\u22A2',\n 'RightTeeArrow': '\\u21A6',\n 'map': '\\u21A6',\n 'mapsto': '\\u21A6',\n 'RightTeeVector': '\\u295B',\n 'RightTriangle': '\\u22B3',\n 'vartriangleright': '\\u22B3',\n 'vrtri': '\\u22B3',\n 'RightTriangleBar': '\\u29D0',\n 'RightTriangleEqual': '\\u22B5',\n 'rtrie': '\\u22B5',\n 'trianglerighteq': '\\u22B5',\n 'RightUpDownVector': '\\u294F',\n 'RightUpTeeVector': '\\u295C',\n 'RightUpVector': '\\u21BE',\n 'uharr': '\\u21BE',\n 'upharpoonright': '\\u21BE',\n 'RightUpVectorBar': '\\u2954',\n 'RightVector': '\\u21C0',\n 'rharu': '\\u21C0',\n 'rightharpoonup': '\\u21C0',\n 'RightVectorBar': '\\u2953',\n 'Ropf': '\\u211D',\n 'reals': '\\u211D',\n 'RoundImplies': '\\u2970',\n 'Rrightarrow': '\\u21DB',\n 'rAarr': '\\u21DB',\n 'Rscr': '\\u211B',\n 'realine': '\\u211B',\n 'Rsh': '\\u21B1',\n 'rsh': '\\u21B1',\n 'RuleDelayed': '\\u29F4',\n 'SHCHcy': '\\u0429',\n 'SHcy': '\\u0428',\n 'SOFTcy': '\\u042C',\n 'Sacute': '\\u015A',\n 'Sc': '\\u2ABC',\n 'Scaron': '\\u0160',\n 'Scedil': '\\u015E',\n 'Scirc': '\\u015C',\n 'Scy': '\\u0421',\n 'Sfr': '\\uD835\\uDD16',\n 'ShortUpArrow': '\\u2191',\n 'UpArrow': '\\u2191',\n 'uarr': '\\u2191',\n 'uparrow': '\\u2191',\n 'Sigma': '\\u03A3',\n 'SmallCircle': '\\u2218',\n 'compfn': '\\u2218',\n 'Sopf': '\\uD835\\uDD4A',\n 'Sqrt': '\\u221A',\n 'radic': '\\u221A',\n 'Square': '\\u25A1',\n 'squ': '\\u25A1',\n 'square': '\\u25A1',\n 'SquareIntersection': '\\u2293',\n 'sqcap': '\\u2293',\n 'SquareSubset': '\\u228F',\n 'sqsub': '\\u228F',\n 'sqsubset': '\\u228F',\n 'SquareSubsetEqual': '\\u2291',\n 'sqsube': '\\u2291',\n 'sqsubseteq': '\\u2291',\n 'SquareSuperset': '\\u2290',\n 'sqsup': '\\u2290',\n 'sqsupset': '\\u2290',\n 'SquareSupersetEqual': '\\u2292',\n 'sqsupe': '\\u2292',\n 'sqsupseteq': '\\u2292',\n 'SquareUnion': '\\u2294',\n 'sqcup': '\\u2294',\n 'Sscr': '\\uD835\\uDCAE',\n 'Star': '\\u22C6',\n 'sstarf': '\\u22C6',\n 'Sub': '\\u22D0',\n 'Subset': '\\u22D0',\n 'SubsetEqual': '\\u2286',\n 'sube': '\\u2286',\n 'subseteq': '\\u2286',\n 'Succeeds': '\\u227B',\n 'sc': '\\u227B',\n 'succ': '\\u227B',\n 'SucceedsEqual': '\\u2AB0',\n 'sce': '\\u2AB0',\n 'succeq': '\\u2AB0',\n 'SucceedsSlantEqual': '\\u227D',\n 'sccue': '\\u227D',\n 'succcurlyeq': '\\u227D',\n 'SucceedsTilde': '\\u227F',\n 'scsim': '\\u227F',\n 'succsim': '\\u227F',\n 'Sum': '\\u2211',\n 'sum': '\\u2211',\n 'Sup': '\\u22D1',\n 'Supset': '\\u22D1',\n 'Superset': '\\u2283',\n 'sup': '\\u2283',\n 'supset': '\\u2283',\n 'SupersetEqual': '\\u2287',\n 'supe': '\\u2287',\n 'supseteq': '\\u2287',\n 'THORN': '\\u00DE',\n 'TRADE': '\\u2122',\n 'trade': '\\u2122',\n 'TSHcy': '\\u040B',\n 'TScy': '\\u0426',\n 'Tab': '\\u0009',\n 'Tau': '\\u03A4',\n 'Tcaron': '\\u0164',\n 'Tcedil': '\\u0162',\n 'Tcy': '\\u0422',\n 'Tfr': '\\uD835\\uDD17',\n 'Therefore': '\\u2234',\n 'there4': '\\u2234',\n 'therefore': '\\u2234',\n 'Theta': '\\u0398',\n 'ThickSpace': '\\u205F\\u200A',\n 'ThinSpace': '\\u2009',\n 'thinsp': '\\u2009',\n 'Tilde': '\\u223C',\n 'sim': '\\u223C',\n 'thicksim': '\\u223C',\n 'thksim': '\\u223C',\n 'TildeEqual': '\\u2243',\n 'sime': '\\u2243',\n 'simeq': '\\u2243',\n 'TildeFullEqual': '\\u2245',\n 'cong': '\\u2245',\n 'TildeTilde': '\\u2248',\n 'ap': '\\u2248',\n 'approx': '\\u2248',\n 'asymp': '\\u2248',\n 'thickapprox': '\\u2248',\n 'thkap': '\\u2248',\n 'Topf': '\\uD835\\uDD4B',\n 'TripleDot': '\\u20DB',\n 'tdot': '\\u20DB',\n 'Tscr': '\\uD835\\uDCAF',\n 'Tstrok': '\\u0166',\n 'Uacute': '\\u00DA',\n 'Uarr': '\\u219F',\n 'Uarrocir': '\\u2949',\n 'Ubrcy': '\\u040E',\n 'Ubreve': '\\u016C',\n 'Ucirc': '\\u00DB',\n 'Ucy': '\\u0423',\n 'Udblac': '\\u0170',\n 'Ufr': '\\uD835\\uDD18',\n 'Ugrave': '\\u00D9',\n 'Umacr': '\\u016A',\n 'UnderBar': '\\u005F',\n 'lowbar': '\\u005F',\n 'UnderBrace': '\\u23DF',\n 'UnderBracket': '\\u23B5',\n 'bbrk': '\\u23B5',\n 'UnderParenthesis': '\\u23DD',\n 'Union': '\\u22C3',\n 'bigcup': '\\u22C3',\n 'xcup': '\\u22C3',\n 'UnionPlus': '\\u228E',\n 'uplus': '\\u228E',\n 'Uogon': '\\u0172',\n 'Uopf': '\\uD835\\uDD4C',\n 'UpArrowBar': '\\u2912',\n 'UpArrowDownArrow': '\\u21C5',\n 'udarr': '\\u21C5',\n 'UpDownArrow': '\\u2195',\n 'updownarrow': '\\u2195',\n 'varr': '\\u2195',\n 'UpEquilibrium': '\\u296E',\n 'udhar': '\\u296E',\n 'UpTee': '\\u22A5',\n 'bot': '\\u22A5',\n 'bottom': '\\u22A5',\n 'perp': '\\u22A5',\n 'UpTeeArrow': '\\u21A5',\n 'mapstoup': '\\u21A5',\n 'UpperLeftArrow': '\\u2196',\n 'nwarr': '\\u2196',\n 'nwarrow': '\\u2196',\n 'UpperRightArrow': '\\u2197',\n 'nearr': '\\u2197',\n 'nearrow': '\\u2197',\n 'Upsi': '\\u03D2',\n 'upsih': '\\u03D2',\n 'Upsilon': '\\u03A5',\n 'Uring': '\\u016E',\n 'Uscr': '\\uD835\\uDCB0',\n 'Utilde': '\\u0168',\n 'Uuml': '\\u00DC',\n 'VDash': '\\u22AB',\n 'Vbar': '\\u2AEB',\n 'Vcy': '\\u0412',\n 'Vdash': '\\u22A9',\n 'Vdashl': '\\u2AE6',\n 'Vee': '\\u22C1',\n 'bigvee': '\\u22C1',\n 'xvee': '\\u22C1',\n 'Verbar': '\\u2016',\n 'Vert': '\\u2016',\n 'VerticalBar': '\\u2223',\n 'mid': '\\u2223',\n 'shortmid': '\\u2223',\n 'smid': '\\u2223',\n 'VerticalLine': '\\u007C',\n 'verbar': '\\u007C',\n 'vert': '\\u007C',\n 'VerticalSeparator': '\\u2758',\n 'VerticalTilde': '\\u2240',\n 'wr': '\\u2240',\n 'wreath': '\\u2240',\n 'VeryThinSpace': '\\u200A',\n 'hairsp': '\\u200A',\n 'Vfr': '\\uD835\\uDD19',\n 'Vopf': '\\uD835\\uDD4D',\n 'Vscr': '\\uD835\\uDCB1',\n 'Vvdash': '\\u22AA',\n 'Wcirc': '\\u0174',\n 'Wedge': '\\u22C0',\n 'bigwedge': '\\u22C0',\n 'xwedge': '\\u22C0',\n 'Wfr': '\\uD835\\uDD1A',\n 'Wopf': '\\uD835\\uDD4E',\n 'Wscr': '\\uD835\\uDCB2',\n 'Xfr': '\\uD835\\uDD1B',\n 'Xi': '\\u039E',\n 'Xopf': '\\uD835\\uDD4F',\n 'Xscr': '\\uD835\\uDCB3',\n 'YAcy': '\\u042F',\n 'YIcy': '\\u0407',\n 'YUcy': '\\u042E',\n 'Yacute': '\\u00DD',\n 'Ycirc': '\\u0176',\n 'Ycy': '\\u042B',\n 'Yfr': '\\uD835\\uDD1C',\n 'Yopf': '\\uD835\\uDD50',\n 'Yscr': '\\uD835\\uDCB4',\n 'Yuml': '\\u0178',\n 'ZHcy': '\\u0416',\n 'Zacute': '\\u0179',\n 'Zcaron': '\\u017D',\n 'Zcy': '\\u0417',\n 'Zdot': '\\u017B',\n 'Zeta': '\\u0396',\n 'Zfr': '\\u2128',\n 'zeetrf': '\\u2128',\n 'Zopf': '\\u2124',\n 'integers': '\\u2124',\n 'Zscr': '\\uD835\\uDCB5',\n 'aacute': '\\u00E1',\n 'abreve': '\\u0103',\n 'ac': '\\u223E',\n 'mstpos': '\\u223E',\n 'acE': '\\u223E\\u0333',\n 'acd': '\\u223F',\n 'acirc': '\\u00E2',\n 'acy': '\\u0430',\n 'aelig': '\\u00E6',\n 'afr': '\\uD835\\uDD1E',\n 'agrave': '\\u00E0',\n 'alefsym': '\\u2135',\n 'aleph': '\\u2135',\n 'alpha': '\\u03B1',\n 'amacr': '\\u0101',\n 'amalg': '\\u2A3F',\n 'and': '\\u2227',\n 'wedge': '\\u2227',\n 'andand': '\\u2A55',\n 'andd': '\\u2A5C',\n 'andslope': '\\u2A58',\n 'andv': '\\u2A5A',\n 'ang': '\\u2220',\n 'angle': '\\u2220',\n 'ange': '\\u29A4',\n 'angmsd': '\\u2221',\n 'measuredangle': '\\u2221',\n 'angmsdaa': '\\u29A8',\n 'angmsdab': '\\u29A9',\n 'angmsdac': '\\u29AA',\n 'angmsdad': '\\u29AB',\n 'angmsdae': '\\u29AC',\n 'angmsdaf': '\\u29AD',\n 'angmsdag': '\\u29AE',\n 'angmsdah': '\\u29AF',\n 'angrt': '\\u221F',\n 'angrtvb': '\\u22BE',\n 'angrtvbd': '\\u299D',\n 'angsph': '\\u2222',\n 'angzarr': '\\u237C',\n 'aogon': '\\u0105',\n 'aopf': '\\uD835\\uDD52',\n 'apE': '\\u2A70',\n 'apacir': '\\u2A6F',\n 'ape': '\\u224A',\n 'approxeq': '\\u224A',\n 'apid': '\\u224B',\n 'apos': '\\u0027',\n 'aring': '\\u00E5',\n 'ascr': '\\uD835\\uDCB6',\n 'ast': '\\u002A',\n 'midast': '\\u002A',\n 'atilde': '\\u00E3',\n 'auml': '\\u00E4',\n 'awint': '\\u2A11',\n 'bNot': '\\u2AED',\n 'backcong': '\\u224C',\n 'bcong': '\\u224C',\n 'backepsilon': '\\u03F6',\n 'bepsi': '\\u03F6',\n 'backprime': '\\u2035',\n 'bprime': '\\u2035',\n 'backsim': '\\u223D',\n 'bsim': '\\u223D',\n 'backsimeq': '\\u22CD',\n 'bsime': '\\u22CD',\n 'barvee': '\\u22BD',\n 'barwed': '\\u2305',\n 'barwedge': '\\u2305',\n 'bbrktbrk': '\\u23B6',\n 'bcy': '\\u0431',\n 'bdquo': '\\u201E',\n 'ldquor': '\\u201E',\n 'bemptyv': '\\u29B0',\n 'beta': '\\u03B2',\n 'beth': '\\u2136',\n 'between': '\\u226C',\n 'twixt': '\\u226C',\n 'bfr': '\\uD835\\uDD1F',\n 'bigcirc': '\\u25EF',\n 'xcirc': '\\u25EF',\n 'bigodot': '\\u2A00',\n 'xodot': '\\u2A00',\n 'bigoplus': '\\u2A01',\n 'xoplus': '\\u2A01',\n 'bigotimes': '\\u2A02',\n 'xotime': '\\u2A02',\n 'bigsqcup': '\\u2A06',\n 'xsqcup': '\\u2A06',\n 'bigstar': '\\u2605',\n 'starf': '\\u2605',\n 'bigtriangledown': '\\u25BD',\n 'xdtri': '\\u25BD',\n 'bigtriangleup': '\\u25B3',\n 'xutri': '\\u25B3',\n 'biguplus': '\\u2A04',\n 'xuplus': '\\u2A04',\n 'bkarow': '\\u290D',\n 'rbarr': '\\u290D',\n 'blacklozenge': '\\u29EB',\n 'lozf': '\\u29EB',\n 'blacktriangle': '\\u25B4',\n 'utrif': '\\u25B4',\n 'blacktriangledown': '\\u25BE',\n 'dtrif': '\\u25BE',\n 'blacktriangleleft': '\\u25C2',\n 'ltrif': '\\u25C2',\n 'blacktriangleright': '\\u25B8',\n 'rtrif': '\\u25B8',\n 'blank': '\\u2423',\n 'blk12': '\\u2592',\n 'blk14': '\\u2591',\n 'blk34': '\\u2593',\n 'block': '\\u2588',\n 'bne': '\\u003D\\u20E5',\n 'bnequiv': '\\u2261\\u20E5',\n 'bnot': '\\u2310',\n 'bopf': '\\uD835\\uDD53',\n 'bowtie': '\\u22C8',\n 'boxDL': '\\u2557',\n 'boxDR': '\\u2554',\n 'boxDl': '\\u2556',\n 'boxDr': '\\u2553',\n 'boxH': '\\u2550',\n 'boxHD': '\\u2566',\n 'boxHU': '\\u2569',\n 'boxHd': '\\u2564',\n 'boxHu': '\\u2567',\n 'boxUL': '\\u255D',\n 'boxUR': '\\u255A',\n 'boxUl': '\\u255C',\n 'boxUr': '\\u2559',\n 'boxV': '\\u2551',\n 'boxVH': '\\u256C',\n 'boxVL': '\\u2563',\n 'boxVR': '\\u2560',\n 'boxVh': '\\u256B',\n 'boxVl': '\\u2562',\n 'boxVr': '\\u255F',\n 'boxbox': '\\u29C9',\n 'boxdL': '\\u2555',\n 'boxdR': '\\u2552',\n 'boxdl': '\\u2510',\n 'boxdr': '\\u250C',\n 'boxhD': '\\u2565',\n 'boxhU': '\\u2568',\n 'boxhd': '\\u252C',\n 'boxhu': '\\u2534',\n 'boxminus': '\\u229F',\n 'minusb': '\\u229F',\n 'boxplus': '\\u229E',\n 'plusb': '\\u229E',\n 'boxtimes': '\\u22A0',\n 'timesb': '\\u22A0',\n 'boxuL': '\\u255B',\n 'boxuR': '\\u2558',\n 'boxul': '\\u2518',\n 'boxur': '\\u2514',\n 'boxv': '\\u2502',\n 'boxvH': '\\u256A',\n 'boxvL': '\\u2561',\n 'boxvR': '\\u255E',\n 'boxvh': '\\u253C',\n 'boxvl': '\\u2524',\n 'boxvr': '\\u251C',\n 'brvbar': '\\u00A6',\n 'bscr': '\\uD835\\uDCB7',\n 'bsemi': '\\u204F',\n 'bsol': '\\u005C',\n 'bsolb': '\\u29C5',\n 'bsolhsub': '\\u27C8',\n 'bull': '\\u2022',\n 'bullet': '\\u2022',\n 'bumpE': '\\u2AAE',\n 'cacute': '\\u0107',\n 'cap': '\\u2229',\n 'capand': '\\u2A44',\n 'capbrcup': '\\u2A49',\n 'capcap': '\\u2A4B',\n 'capcup': '\\u2A47',\n 'capdot': '\\u2A40',\n 'caps': '\\u2229\\uFE00',\n 'caret': '\\u2041',\n 'ccaps': '\\u2A4D',\n 'ccaron': '\\u010D',\n 'ccedil': '\\u00E7',\n 'ccirc': '\\u0109',\n 'ccups': '\\u2A4C',\n 'ccupssm': '\\u2A50',\n 'cdot': '\\u010B',\n 'cemptyv': '\\u29B2',\n 'cent': '\\u00A2',\n 'cfr': '\\uD835\\uDD20',\n 'chcy': '\\u0447',\n 'check': '\\u2713',\n 'checkmark': '\\u2713',\n 'chi': '\\u03C7',\n 'cir': '\\u25CB',\n 'cirE': '\\u29C3',\n 'circ': '\\u02C6',\n 'circeq': '\\u2257',\n 'cire': '\\u2257',\n 'circlearrowleft': '\\u21BA',\n 'olarr': '\\u21BA',\n 'circlearrowright': '\\u21BB',\n 'orarr': '\\u21BB',\n 'circledS': '\\u24C8',\n 'oS': '\\u24C8',\n 'circledast': '\\u229B',\n 'oast': '\\u229B',\n 'circledcirc': '\\u229A',\n 'ocir': '\\u229A',\n 'circleddash': '\\u229D',\n 'odash': '\\u229D',\n 'cirfnint': '\\u2A10',\n 'cirmid': '\\u2AEF',\n 'cirscir': '\\u29C2',\n 'clubs': '\\u2663',\n 'clubsuit': '\\u2663',\n 'colon': '\\u003A',\n 'comma': '\\u002C',\n 'commat': '\\u0040',\n 'comp': '\\u2201',\n 'complement': '\\u2201',\n 'congdot': '\\u2A6D',\n 'copf': '\\uD835\\uDD54',\n 'copysr': '\\u2117',\n 'crarr': '\\u21B5',\n 'cross': '\\u2717',\n 'cscr': '\\uD835\\uDCB8',\n 'csub': '\\u2ACF',\n 'csube': '\\u2AD1',\n 'csup': '\\u2AD0',\n 'csupe': '\\u2AD2',\n 'ctdot': '\\u22EF',\n 'cudarrl': '\\u2938',\n 'cudarrr': '\\u2935',\n 'cuepr': '\\u22DE',\n 'curlyeqprec': '\\u22DE',\n 'cuesc': '\\u22DF',\n 'curlyeqsucc': '\\u22DF',\n 'cularr': '\\u21B6',\n 'curvearrowleft': '\\u21B6',\n 'cularrp': '\\u293D',\n 'cup': '\\u222A',\n 'cupbrcap': '\\u2A48',\n 'cupcap': '\\u2A46',\n 'cupcup': '\\u2A4A',\n 'cupdot': '\\u228D',\n 'cupor': '\\u2A45',\n 'cups': '\\u222A\\uFE00',\n 'curarr': '\\u21B7',\n 'curvearrowright': '\\u21B7',\n 'curarrm': '\\u293C',\n 'curlyvee': '\\u22CE',\n 'cuvee': '\\u22CE',\n 'curlywedge': '\\u22CF',\n 'cuwed': '\\u22CF',\n 'curren': '\\u00A4',\n 'cwint': '\\u2231',\n 'cylcty': '\\u232D',\n 'dHar': '\\u2965',\n 'dagger': '\\u2020',\n 'daleth': '\\u2138',\n 'dash': '\\u2010',\n 'hyphen': '\\u2010',\n 'dbkarow': '\\u290F',\n 'rBarr': '\\u290F',\n 'dcaron': '\\u010F',\n 'dcy': '\\u0434',\n 'ddarr': '\\u21CA',\n 'downdownarrows': '\\u21CA',\n 'ddotseq': '\\u2A77',\n 'eDDot': '\\u2A77',\n 'deg': '\\u00B0',\n 'delta': '\\u03B4',\n 'demptyv': '\\u29B1',\n 'dfisht': '\\u297F',\n 'dfr': '\\uD835\\uDD21',\n 'diamondsuit': '\\u2666',\n 'diams': '\\u2666',\n 'digamma': '\\u03DD',\n 'gammad': '\\u03DD',\n 'disin': '\\u22F2',\n 'div': '\\u00F7',\n 'divide': '\\u00F7',\n 'divideontimes': '\\u22C7',\n 'divonx': '\\u22C7',\n 'djcy': '\\u0452',\n 'dlcorn': '\\u231E',\n 'llcorner': '\\u231E',\n 'dlcrop': '\\u230D',\n 'dollar': '\\u0024',\n 'dopf': '\\uD835\\uDD55',\n 'doteqdot': '\\u2251',\n 'eDot': '\\u2251',\n 'dotminus': '\\u2238',\n 'minusd': '\\u2238',\n 'dotplus': '\\u2214',\n 'plusdo': '\\u2214',\n 'dotsquare': '\\u22A1',\n 'sdotb': '\\u22A1',\n 'drcorn': '\\u231F',\n 'lrcorner': '\\u231F',\n 'drcrop': '\\u230C',\n 'dscr': '\\uD835\\uDCB9',\n 'dscy': '\\u0455',\n 'dsol': '\\u29F6',\n 'dstrok': '\\u0111',\n 'dtdot': '\\u22F1',\n 'dtri': '\\u25BF',\n 'triangledown': '\\u25BF',\n 'dwangle': '\\u29A6',\n 'dzcy': '\\u045F',\n 'dzigrarr': '\\u27FF',\n 'eacute': '\\u00E9',\n 'easter': '\\u2A6E',\n 'ecaron': '\\u011B',\n 'ecir': '\\u2256',\n 'eqcirc': '\\u2256',\n 'ecirc': '\\u00EA',\n 'ecolon': '\\u2255',\n 'eqcolon': '\\u2255',\n 'ecy': '\\u044D',\n 'edot': '\\u0117',\n 'efDot': '\\u2252',\n 'fallingdotseq': '\\u2252',\n 'efr': '\\uD835\\uDD22',\n 'eg': '\\u2A9A',\n 'egrave': '\\u00E8',\n 'egs': '\\u2A96',\n 'eqslantgtr': '\\u2A96',\n 'egsdot': '\\u2A98',\n 'el': '\\u2A99',\n 'elinters': '\\u23E7',\n 'ell': '\\u2113',\n 'els': '\\u2A95',\n 'eqslantless': '\\u2A95',\n 'elsdot': '\\u2A97',\n 'emacr': '\\u0113',\n 'empty': '\\u2205',\n 'emptyset': '\\u2205',\n 'emptyv': '\\u2205',\n 'varnothing': '\\u2205',\n 'emsp13': '\\u2004',\n 'emsp14': '\\u2005',\n 'emsp': '\\u2003',\n 'eng': '\\u014B',\n 'ensp': '\\u2002',\n 'eogon': '\\u0119',\n 'eopf': '\\uD835\\uDD56',\n 'epar': '\\u22D5',\n 'eparsl': '\\u29E3',\n 'eplus': '\\u2A71',\n 'epsi': '\\u03B5',\n 'epsilon': '\\u03B5',\n 'epsiv': '\\u03F5',\n 'straightepsilon': '\\u03F5',\n 'varepsilon': '\\u03F5',\n 'equals': '\\u003D',\n 'equest': '\\u225F',\n 'questeq': '\\u225F',\n 'equivDD': '\\u2A78',\n 'eqvparsl': '\\u29E5',\n 'erDot': '\\u2253',\n 'risingdotseq': '\\u2253',\n 'erarr': '\\u2971',\n 'escr': '\\u212F',\n 'eta': '\\u03B7',\n 'eth': '\\u00F0',\n 'euml': '\\u00EB',\n 'euro': '\\u20AC',\n 'excl': '\\u0021',\n 'fcy': '\\u0444',\n 'female': '\\u2640',\n 'ffilig': '\\uFB03',\n 'fflig': '\\uFB00',\n 'ffllig': '\\uFB04',\n 'ffr': '\\uD835\\uDD23',\n 'filig': '\\uFB01',\n 'fjlig': '\\u0066\\u006A',\n 'flat': '\\u266D',\n 'fllig': '\\uFB02',\n 'fltns': '\\u25B1',\n 'fnof': '\\u0192',\n 'fopf': '\\uD835\\uDD57',\n 'fork': '\\u22D4',\n 'pitchfork': '\\u22D4',\n 'forkv': '\\u2AD9',\n 'fpartint': '\\u2A0D',\n 'frac12': '\\u00BD',\n 'half': '\\u00BD',\n 'frac13': '\\u2153',\n 'frac14': '\\u00BC',\n 'frac15': '\\u2155',\n 'frac16': '\\u2159',\n 'frac18': '\\u215B',\n 'frac23': '\\u2154',\n 'frac25': '\\u2156',\n 'frac34': '\\u00BE',\n 'frac35': '\\u2157',\n 'frac38': '\\u215C',\n 'frac45': '\\u2158',\n 'frac56': '\\u215A',\n 'frac58': '\\u215D',\n 'frac78': '\\u215E',\n 'frasl': '\\u2044',\n 'frown': '\\u2322',\n 'sfrown': '\\u2322',\n 'fscr': '\\uD835\\uDCBB',\n 'gEl': '\\u2A8C',\n 'gtreqqless': '\\u2A8C',\n 'gacute': '\\u01F5',\n 'gamma': '\\u03B3',\n 'gap': '\\u2A86',\n 'gtrapprox': '\\u2A86',\n 'gbreve': '\\u011F',\n 'gcirc': '\\u011D',\n 'gcy': '\\u0433',\n 'gdot': '\\u0121',\n 'gescc': '\\u2AA9',\n 'gesdot': '\\u2A80',\n 'gesdoto': '\\u2A82',\n 'gesdotol': '\\u2A84',\n 'gesl': '\\u22DB\\uFE00',\n 'gesles': '\\u2A94',\n 'gfr': '\\uD835\\uDD24',\n 'gimel': '\\u2137',\n 'gjcy': '\\u0453',\n 'glE': '\\u2A92',\n 'gla': '\\u2AA5',\n 'glj': '\\u2AA4',\n 'gnE': '\\u2269',\n 'gneqq': '\\u2269',\n 'gnap': '\\u2A8A',\n 'gnapprox': '\\u2A8A',\n 'gne': '\\u2A88',\n 'gneq': '\\u2A88',\n 'gnsim': '\\u22E7',\n 'gopf': '\\uD835\\uDD58',\n 'gscr': '\\u210A',\n 'gsime': '\\u2A8E',\n 'gsiml': '\\u2A90',\n 'gtcc': '\\u2AA7',\n 'gtcir': '\\u2A7A',\n 'gtdot': '\\u22D7',\n 'gtrdot': '\\u22D7',\n 'gtlPar': '\\u2995',\n 'gtquest': '\\u2A7C',\n 'gtrarr': '\\u2978',\n 'gvertneqq': '\\u2269\\uFE00',\n 'gvnE': '\\u2269\\uFE00',\n 'hardcy': '\\u044A',\n 'harrcir': '\\u2948',\n 'harrw': '\\u21AD',\n 'leftrightsquigarrow': '\\u21AD',\n 'hbar': '\\u210F',\n 'hslash': '\\u210F',\n 'planck': '\\u210F',\n 'plankv': '\\u210F',\n 'hcirc': '\\u0125',\n 'hearts': '\\u2665',\n 'heartsuit': '\\u2665',\n 'hellip': '\\u2026',\n 'mldr': '\\u2026',\n 'hercon': '\\u22B9',\n 'hfr': '\\uD835\\uDD25',\n 'hksearow': '\\u2925',\n 'searhk': '\\u2925',\n 'hkswarow': '\\u2926',\n 'swarhk': '\\u2926',\n 'hoarr': '\\u21FF',\n 'homtht': '\\u223B',\n 'hookleftarrow': '\\u21A9',\n 'larrhk': '\\u21A9',\n 'hookrightarrow': '\\u21AA',\n 'rarrhk': '\\u21AA',\n 'hopf': '\\uD835\\uDD59',\n 'horbar': '\\u2015',\n 'hscr': '\\uD835\\uDCBD',\n 'hstrok': '\\u0127',\n 'hybull': '\\u2043',\n 'iacute': '\\u00ED',\n 'icirc': '\\u00EE',\n 'icy': '\\u0438',\n 'iecy': '\\u0435',\n 'iexcl': '\\u00A1',\n 'ifr': '\\uD835\\uDD26',\n 'igrave': '\\u00EC',\n 'iiiint': '\\u2A0C',\n 'qint': '\\u2A0C',\n 'iiint': '\\u222D',\n 'tint': '\\u222D',\n 'iinfin': '\\u29DC',\n 'iiota': '\\u2129',\n 'ijlig': '\\u0133',\n 'imacr': '\\u012B',\n 'imath': '\\u0131',\n 'inodot': '\\u0131',\n 'imof': '\\u22B7',\n 'imped': '\\u01B5',\n 'incare': '\\u2105',\n 'infin': '\\u221E',\n 'infintie': '\\u29DD',\n 'intcal': '\\u22BA',\n 'intercal': '\\u22BA',\n 'intlarhk': '\\u2A17',\n 'intprod': '\\u2A3C',\n 'iprod': '\\u2A3C',\n 'iocy': '\\u0451',\n 'iogon': '\\u012F',\n 'iopf': '\\uD835\\uDD5A',\n 'iota': '\\u03B9',\n 'iquest': '\\u00BF',\n 'iscr': '\\uD835\\uDCBE',\n 'isinE': '\\u22F9',\n 'isindot': '\\u22F5',\n 'isins': '\\u22F4',\n 'isinsv': '\\u22F3',\n 'itilde': '\\u0129',\n 'iukcy': '\\u0456',\n 'iuml': '\\u00EF',\n 'jcirc': '\\u0135',\n 'jcy': '\\u0439',\n 'jfr': '\\uD835\\uDD27',\n 'jmath': '\\u0237',\n 'jopf': '\\uD835\\uDD5B',\n 'jscr': '\\uD835\\uDCBF',\n 'jsercy': '\\u0458',\n 'jukcy': '\\u0454',\n 'kappa': '\\u03BA',\n 'kappav': '\\u03F0',\n 'varkappa': '\\u03F0',\n 'kcedil': '\\u0137',\n 'kcy': '\\u043A',\n 'kfr': '\\uD835\\uDD28',\n 'kgreen': '\\u0138',\n 'khcy': '\\u0445',\n 'kjcy': '\\u045C',\n 'kopf': '\\uD835\\uDD5C',\n 'kscr': '\\uD835\\uDCC0',\n 'lAtail': '\\u291B',\n 'lBarr': '\\u290E',\n 'lEg': '\\u2A8B',\n 'lesseqqgtr': '\\u2A8B',\n 'lHar': '\\u2962',\n 'lacute': '\\u013A',\n 'laemptyv': '\\u29B4',\n 'lambda': '\\u03BB',\n 'langd': '\\u2991',\n 'lap': '\\u2A85',\n 'lessapprox': '\\u2A85',\n 'laquo': '\\u00AB',\n 'larrbfs': '\\u291F',\n 'larrfs': '\\u291D',\n 'larrlp': '\\u21AB',\n 'looparrowleft': '\\u21AB',\n 'larrpl': '\\u2939',\n 'larrsim': '\\u2973',\n 'larrtl': '\\u21A2',\n 'leftarrowtail': '\\u21A2',\n 'lat': '\\u2AAB',\n 'latail': '\\u2919',\n 'late': '\\u2AAD',\n 'lates': '\\u2AAD\\uFE00',\n 'lbarr': '\\u290C',\n 'lbbrk': '\\u2772',\n 'lbrace': '\\u007B',\n 'lcub': '\\u007B',\n 'lbrack': '\\u005B',\n 'lsqb': '\\u005B',\n 'lbrke': '\\u298B',\n 'lbrksld': '\\u298F',\n 'lbrkslu': '\\u298D',\n 'lcaron': '\\u013E',\n 'lcedil': '\\u013C',\n 'lcy': '\\u043B',\n 'ldca': '\\u2936',\n 'ldrdhar': '\\u2967',\n 'ldrushar': '\\u294B',\n 'ldsh': '\\u21B2',\n 'le': '\\u2264',\n 'leq': '\\u2264',\n 'leftleftarrows': '\\u21C7',\n 'llarr': '\\u21C7',\n 'leftthreetimes': '\\u22CB',\n 'lthree': '\\u22CB',\n 'lescc': '\\u2AA8',\n 'lesdot': '\\u2A7F',\n 'lesdoto': '\\u2A81',\n 'lesdotor': '\\u2A83',\n 'lesg': '\\u22DA\\uFE00',\n 'lesges': '\\u2A93',\n 'lessdot': '\\u22D6',\n 'ltdot': '\\u22D6',\n 'lfisht': '\\u297C',\n 'lfr': '\\uD835\\uDD29',\n 'lgE': '\\u2A91',\n 'lharul': '\\u296A',\n 'lhblk': '\\u2584',\n 'ljcy': '\\u0459',\n 'llhard': '\\u296B',\n 'lltri': '\\u25FA',\n 'lmidot': '\\u0140',\n 'lmoust': '\\u23B0',\n 'lmoustache': '\\u23B0',\n 'lnE': '\\u2268',\n 'lneqq': '\\u2268',\n 'lnap': '\\u2A89',\n 'lnapprox': '\\u2A89',\n 'lne': '\\u2A87',\n 'lneq': '\\u2A87',\n 'lnsim': '\\u22E6',\n 'loang': '\\u27EC',\n 'loarr': '\\u21FD',\n 'longmapsto': '\\u27FC',\n 'xmap': '\\u27FC',\n 'looparrowright': '\\u21AC',\n 'rarrlp': '\\u21AC',\n 'lopar': '\\u2985',\n 'lopf': '\\uD835\\uDD5D',\n 'loplus': '\\u2A2D',\n 'lotimes': '\\u2A34',\n 'lowast': '\\u2217',\n 'loz': '\\u25CA',\n 'lozenge': '\\u25CA',\n 'lpar': '\\u0028',\n 'lparlt': '\\u2993',\n 'lrhard': '\\u296D',\n 'lrm': '\\u200E',\n 'lrtri': '\\u22BF',\n 'lsaquo': '\\u2039',\n 'lscr': '\\uD835\\uDCC1',\n 'lsime': '\\u2A8D',\n 'lsimg': '\\u2A8F',\n 'lsquor': '\\u201A',\n 'sbquo': '\\u201A',\n 'lstrok': '\\u0142',\n 'ltcc': '\\u2AA6',\n 'ltcir': '\\u2A79',\n 'ltimes': '\\u22C9',\n 'ltlarr': '\\u2976',\n 'ltquest': '\\u2A7B',\n 'ltrPar': '\\u2996',\n 'ltri': '\\u25C3',\n 'triangleleft': '\\u25C3',\n 'lurdshar': '\\u294A',\n 'luruhar': '\\u2966',\n 'lvertneqq': '\\u2268\\uFE00',\n 'lvnE': '\\u2268\\uFE00',\n 'mDDot': '\\u223A',\n 'macr': '\\u00AF',\n 'strns': '\\u00AF',\n 'male': '\\u2642',\n 'malt': '\\u2720',\n 'maltese': '\\u2720',\n 'marker': '\\u25AE',\n 'mcomma': '\\u2A29',\n 'mcy': '\\u043C',\n 'mdash': '\\u2014',\n 'mfr': '\\uD835\\uDD2A',\n 'mho': '\\u2127',\n 'micro': '\\u00B5',\n 'midcir': '\\u2AF0',\n 'minus': '\\u2212',\n 'minusdu': '\\u2A2A',\n 'mlcp': '\\u2ADB',\n 'models': '\\u22A7',\n 'mopf': '\\uD835\\uDD5E',\n 'mscr': '\\uD835\\uDCC2',\n 'mu': '\\u03BC',\n 'multimap': '\\u22B8',\n 'mumap': '\\u22B8',\n 'nGg': '\\u22D9\\u0338',\n 'nGt': '\\u226B\\u20D2',\n 'nLeftarrow': '\\u21CD',\n 'nlArr': '\\u21CD',\n 'nLeftrightarrow': '\\u21CE',\n 'nhArr': '\\u21CE',\n 'nLl': '\\u22D8\\u0338',\n 'nLt': '\\u226A\\u20D2',\n 'nRightarrow': '\\u21CF',\n 'nrArr': '\\u21CF',\n 'nVDash': '\\u22AF',\n 'nVdash': '\\u22AE',\n 'nacute': '\\u0144',\n 'nang': '\\u2220\\u20D2',\n 'napE': '\\u2A70\\u0338',\n 'napid': '\\u224B\\u0338',\n 'napos': '\\u0149',\n 'natur': '\\u266E',\n 'natural': '\\u266E',\n 'ncap': '\\u2A43',\n 'ncaron': '\\u0148',\n 'ncedil': '\\u0146',\n 'ncongdot': '\\u2A6D\\u0338',\n 'ncup': '\\u2A42',\n 'ncy': '\\u043D',\n 'ndash': '\\u2013',\n 'neArr': '\\u21D7',\n 'nearhk': '\\u2924',\n 'nedot': '\\u2250\\u0338',\n 'nesear': '\\u2928',\n 'toea': '\\u2928',\n 'nfr': '\\uD835\\uDD2B',\n 'nharr': '\\u21AE',\n 'nleftrightarrow': '\\u21AE',\n 'nhpar': '\\u2AF2',\n 'nis': '\\u22FC',\n 'nisd': '\\u22FA',\n 'njcy': '\\u045A',\n 'nlE': '\\u2266\\u0338',\n 'nleqq': '\\u2266\\u0338',\n 'nlarr': '\\u219A',\n 'nleftarrow': '\\u219A',\n 'nldr': '\\u2025',\n 'nopf': '\\uD835\\uDD5F',\n 'not': '\\u00AC',\n 'notinE': '\\u22F9\\u0338',\n 'notindot': '\\u22F5\\u0338',\n 'notinvb': '\\u22F7',\n 'notinvc': '\\u22F6',\n 'notnivb': '\\u22FE',\n 'notnivc': '\\u22FD',\n 'nparsl': '\\u2AFD\\u20E5',\n 'npart': '\\u2202\\u0338',\n 'npolint': '\\u2A14',\n 'nrarr': '\\u219B',\n 'nrightarrow': '\\u219B',\n 'nrarrc': '\\u2933\\u0338',\n 'nrarrw': '\\u219D\\u0338',\n 'nscr': '\\uD835\\uDCC3',\n 'nsub': '\\u2284',\n 'nsubE': '\\u2AC5\\u0338',\n 'nsubseteqq': '\\u2AC5\\u0338',\n 'nsup': '\\u2285',\n 'nsupE': '\\u2AC6\\u0338',\n 'nsupseteqq': '\\u2AC6\\u0338',\n 'ntilde': '\\u00F1',\n 'nu': '\\u03BD',\n 'num': '\\u0023',\n 'numero': '\\u2116',\n 'numsp': '\\u2007',\n 'nvDash': '\\u22AD',\n 'nvHarr': '\\u2904',\n 'nvap': '\\u224D\\u20D2',\n 'nvdash': '\\u22AC',\n 'nvge': '\\u2265\\u20D2',\n 'nvgt': '\\u003E\\u20D2',\n 'nvinfin': '\\u29DE',\n 'nvlArr': '\\u2902',\n 'nvle': '\\u2264\\u20D2',\n 'nvlt': '\\u003C\\u20D2',\n 'nvltrie': '\\u22B4\\u20D2',\n 'nvrArr': '\\u2903',\n 'nvrtrie': '\\u22B5\\u20D2',\n 'nvsim': '\\u223C\\u20D2',\n 'nwArr': '\\u21D6',\n 'nwarhk': '\\u2923',\n 'nwnear': '\\u2927',\n 'oacute': '\\u00F3',\n 'ocirc': '\\u00F4',\n 'ocy': '\\u043E',\n 'odblac': '\\u0151',\n 'odiv': '\\u2A38',\n 'odsold': '\\u29BC',\n 'oelig': '\\u0153',\n 'ofcir': '\\u29BF',\n 'ofr': '\\uD835\\uDD2C',\n 'ogon': '\\u02DB',\n 'ograve': '\\u00F2',\n 'ogt': '\\u29C1',\n 'ohbar': '\\u29B5',\n 'olcir': '\\u29BE',\n 'olcross': '\\u29BB',\n 'olt': '\\u29C0',\n 'omacr': '\\u014D',\n 'omega': '\\u03C9',\n 'omicron': '\\u03BF',\n 'omid': '\\u29B6',\n 'oopf': '\\uD835\\uDD60',\n 'opar': '\\u29B7',\n 'operp': '\\u29B9',\n 'or': '\\u2228',\n 'vee': '\\u2228',\n 'ord': '\\u2A5D',\n 'order': '\\u2134',\n 'orderof': '\\u2134',\n 'oscr': '\\u2134',\n 'ordf': '\\u00AA',\n 'ordm': '\\u00BA',\n 'origof': '\\u22B6',\n 'oror': '\\u2A56',\n 'orslope': '\\u2A57',\n 'orv': '\\u2A5B',\n 'oslash': '\\u00F8',\n 'osol': '\\u2298',\n 'otilde': '\\u00F5',\n 'otimesas': '\\u2A36',\n 'ouml': '\\u00F6',\n 'ovbar': '\\u233D',\n 'para': '\\u00B6',\n 'parsim': '\\u2AF3',\n 'parsl': '\\u2AFD',\n 'pcy': '\\u043F',\n 'percnt': '\\u0025',\n 'period': '\\u002E',\n 'permil': '\\u2030',\n 'pertenk': '\\u2031',\n 'pfr': '\\uD835\\uDD2D',\n 'phi': '\\u03C6',\n 'phiv': '\\u03D5',\n 'straightphi': '\\u03D5',\n 'varphi': '\\u03D5',\n 'phone': '\\u260E',\n 'pi': '\\u03C0',\n 'piv': '\\u03D6',\n 'varpi': '\\u03D6',\n 'planckh': '\\u210E',\n 'plus': '\\u002B',\n 'plusacir': '\\u2A23',\n 'pluscir': '\\u2A22',\n 'plusdu': '\\u2A25',\n 'pluse': '\\u2A72',\n 'plussim': '\\u2A26',\n 'plustwo': '\\u2A27',\n 'pointint': '\\u2A15',\n 'popf': '\\uD835\\uDD61',\n 'pound': '\\u00A3',\n 'prE': '\\u2AB3',\n 'prap': '\\u2AB7',\n 'precapprox': '\\u2AB7',\n 'precnapprox': '\\u2AB9',\n 'prnap': '\\u2AB9',\n 'precneqq': '\\u2AB5',\n 'prnE': '\\u2AB5',\n 'precnsim': '\\u22E8',\n 'prnsim': '\\u22E8',\n 'prime': '\\u2032',\n 'profalar': '\\u232E',\n 'profline': '\\u2312',\n 'profsurf': '\\u2313',\n 'prurel': '\\u22B0',\n 'pscr': '\\uD835\\uDCC5',\n 'psi': '\\u03C8',\n 'puncsp': '\\u2008',\n 'qfr': '\\uD835\\uDD2E',\n 'qopf': '\\uD835\\uDD62',\n 'qprime': '\\u2057',\n 'qscr': '\\uD835\\uDCC6',\n 'quatint': '\\u2A16',\n 'quest': '\\u003F',\n 'rAtail': '\\u291C',\n 'rHar': '\\u2964',\n 'race': '\\u223D\\u0331',\n 'racute': '\\u0155',\n 'raemptyv': '\\u29B3',\n 'rangd': '\\u2992',\n 'range': '\\u29A5',\n 'raquo': '\\u00BB',\n 'rarrap': '\\u2975',\n 'rarrbfs': '\\u2920',\n 'rarrc': '\\u2933',\n 'rarrfs': '\\u291E',\n 'rarrpl': '\\u2945',\n 'rarrsim': '\\u2974',\n 'rarrtl': '\\u21A3',\n 'rightarrowtail': '\\u21A3',\n 'rarrw': '\\u219D',\n 'rightsquigarrow': '\\u219D',\n 'ratail': '\\u291A',\n 'ratio': '\\u2236',\n 'rbbrk': '\\u2773',\n 'rbrace': '\\u007D',\n 'rcub': '\\u007D',\n 'rbrack': '\\u005D',\n 'rsqb': '\\u005D',\n 'rbrke': '\\u298C',\n 'rbrksld': '\\u298E',\n 'rbrkslu': '\\u2990',\n 'rcaron': '\\u0159',\n 'rcedil': '\\u0157',\n 'rcy': '\\u0440',\n 'rdca': '\\u2937',\n 'rdldhar': '\\u2969',\n 'rdsh': '\\u21B3',\n 'rect': '\\u25AD',\n 'rfisht': '\\u297D',\n 'rfr': '\\uD835\\uDD2F',\n 'rharul': '\\u296C',\n 'rho': '\\u03C1',\n 'rhov': '\\u03F1',\n 'varrho': '\\u03F1',\n 'rightrightarrows': '\\u21C9',\n 'rrarr': '\\u21C9',\n 'rightthreetimes': '\\u22CC',\n 'rthree': '\\u22CC',\n 'ring': '\\u02DA',\n 'rlm': '\\u200F',\n 'rmoust': '\\u23B1',\n 'rmoustache': '\\u23B1',\n 'rnmid': '\\u2AEE',\n 'roang': '\\u27ED',\n 'roarr': '\\u21FE',\n 'ropar': '\\u2986',\n 'ropf': '\\uD835\\uDD63',\n 'roplus': '\\u2A2E',\n 'rotimes': '\\u2A35',\n 'rpar': '\\u0029',\n 'rpargt': '\\u2994',\n 'rppolint': '\\u2A12',\n 'rsaquo': '\\u203A',\n 'rscr': '\\uD835\\uDCC7',\n 'rtimes': '\\u22CA',\n 'rtri': '\\u25B9',\n 'triangleright': '\\u25B9',\n 'rtriltri': '\\u29CE',\n 'ruluhar': '\\u2968',\n 'rx': '\\u211E',\n 'sacute': '\\u015B',\n 'scE': '\\u2AB4',\n 'scap': '\\u2AB8',\n 'succapprox': '\\u2AB8',\n 'scaron': '\\u0161',\n 'scedil': '\\u015F',\n 'scirc': '\\u015D',\n 'scnE': '\\u2AB6',\n 'succneqq': '\\u2AB6',\n 'scnap': '\\u2ABA',\n 'succnapprox': '\\u2ABA',\n 'scnsim': '\\u22E9',\n 'succnsim': '\\u22E9',\n 'scpolint': '\\u2A13',\n 'scy': '\\u0441',\n 'sdot': '\\u22C5',\n 'sdote': '\\u2A66',\n 'seArr': '\\u21D8',\n 'sect': '\\u00A7',\n 'semi': '\\u003B',\n 'seswar': '\\u2929',\n 'tosa': '\\u2929',\n 'sext': '\\u2736',\n 'sfr': '\\uD835\\uDD30',\n 'sharp': '\\u266F',\n 'shchcy': '\\u0449',\n 'shcy': '\\u0448',\n 'shy': '\\u00AD',\n 'sigma': '\\u03C3',\n 'sigmaf': '\\u03C2',\n 'sigmav': '\\u03C2',\n 'varsigma': '\\u03C2',\n 'simdot': '\\u2A6A',\n 'simg': '\\u2A9E',\n 'simgE': '\\u2AA0',\n 'siml': '\\u2A9D',\n 'simlE': '\\u2A9F',\n 'simne': '\\u2246',\n 'simplus': '\\u2A24',\n 'simrarr': '\\u2972',\n 'smashp': '\\u2A33',\n 'smeparsl': '\\u29E4',\n 'smile': '\\u2323',\n 'ssmile': '\\u2323',\n 'smt': '\\u2AAA',\n 'smte': '\\u2AAC',\n 'smtes': '\\u2AAC\\uFE00',\n 'softcy': '\\u044C',\n 'sol': '\\u002F',\n 'solb': '\\u29C4',\n 'solbar': '\\u233F',\n 'sopf': '\\uD835\\uDD64',\n 'spades': '\\u2660',\n 'spadesuit': '\\u2660',\n 'sqcaps': '\\u2293\\uFE00',\n 'sqcups': '\\u2294\\uFE00',\n 'sscr': '\\uD835\\uDCC8',\n 'star': '\\u2606',\n 'sub': '\\u2282',\n 'subset': '\\u2282',\n 'subE': '\\u2AC5',\n 'subseteqq': '\\u2AC5',\n 'subdot': '\\u2ABD',\n 'subedot': '\\u2AC3',\n 'submult': '\\u2AC1',\n 'subnE': '\\u2ACB',\n 'subsetneqq': '\\u2ACB',\n 'subne': '\\u228A',\n 'subsetneq': '\\u228A',\n 'subplus': '\\u2ABF',\n 'subrarr': '\\u2979',\n 'subsim': '\\u2AC7',\n 'subsub': '\\u2AD5',\n 'subsup': '\\u2AD3',\n 'sung': '\\u266A',\n 'sup1': '\\u00B9',\n 'sup2': '\\u00B2',\n 'sup3': '\\u00B3',\n 'supE': '\\u2AC6',\n 'supseteqq': '\\u2AC6',\n 'supdot': '\\u2ABE',\n 'supdsub': '\\u2AD8',\n 'supedot': '\\u2AC4',\n 'suphsol': '\\u27C9',\n 'suphsub': '\\u2AD7',\n 'suplarr': '\\u297B',\n 'supmult': '\\u2AC2',\n 'supnE': '\\u2ACC',\n 'supsetneqq': '\\u2ACC',\n 'supne': '\\u228B',\n 'supsetneq': '\\u228B',\n 'supplus': '\\u2AC0',\n 'supsim': '\\u2AC8',\n 'supsub': '\\u2AD4',\n 'supsup': '\\u2AD6',\n 'swArr': '\\u21D9',\n 'swnwar': '\\u292A',\n 'szlig': '\\u00DF',\n 'target': '\\u2316',\n 'tau': '\\u03C4',\n 'tcaron': '\\u0165',\n 'tcedil': '\\u0163',\n 'tcy': '\\u0442',\n 'telrec': '\\u2315',\n 'tfr': '\\uD835\\uDD31',\n 'theta': '\\u03B8',\n 'thetasym': '\\u03D1',\n 'thetav': '\\u03D1',\n 'vartheta': '\\u03D1',\n 'thorn': '\\u00FE',\n 'times': '\\u00D7',\n 'timesbar': '\\u2A31',\n 'timesd': '\\u2A30',\n 'topbot': '\\u2336',\n 'topcir': '\\u2AF1',\n 'topf': '\\uD835\\uDD65',\n 'topfork': '\\u2ADA',\n 'tprime': '\\u2034',\n 'triangle': '\\u25B5',\n 'utri': '\\u25B5',\n 'triangleq': '\\u225C',\n 'trie': '\\u225C',\n 'tridot': '\\u25EC',\n 'triminus': '\\u2A3A',\n 'triplus': '\\u2A39',\n 'trisb': '\\u29CD',\n 'tritime': '\\u2A3B',\n 'trpezium': '\\u23E2',\n 'tscr': '\\uD835\\uDCC9',\n 'tscy': '\\u0446',\n 'tshcy': '\\u045B',\n 'tstrok': '\\u0167',\n 'uHar': '\\u2963',\n 'uacute': '\\u00FA',\n 'ubrcy': '\\u045E',\n 'ubreve': '\\u016D',\n 'ucirc': '\\u00FB',\n 'ucy': '\\u0443',\n 'udblac': '\\u0171',\n 'ufisht': '\\u297E',\n 'ufr': '\\uD835\\uDD32',\n 'ugrave': '\\u00F9',\n 'uhblk': '\\u2580',\n 'ulcorn': '\\u231C',\n 'ulcorner': '\\u231C',\n 'ulcrop': '\\u230F',\n 'ultri': '\\u25F8',\n 'umacr': '\\u016B',\n 'uogon': '\\u0173',\n 'uopf': '\\uD835\\uDD66',\n 'upsi': '\\u03C5',\n 'upsilon': '\\u03C5',\n 'upuparrows': '\\u21C8',\n 'uuarr': '\\u21C8',\n 'urcorn': '\\u231D',\n 'urcorner': '\\u231D',\n 'urcrop': '\\u230E',\n 'uring': '\\u016F',\n 'urtri': '\\u25F9',\n 'uscr': '\\uD835\\uDCCA',\n 'utdot': '\\u22F0',\n 'utilde': '\\u0169',\n 'uuml': '\\u00FC',\n 'uwangle': '\\u29A7',\n 'vBar': '\\u2AE8',\n 'vBarv': '\\u2AE9',\n 'vangrt': '\\u299C',\n 'varsubsetneq': '\\u228A\\uFE00',\n 'vsubne': '\\u228A\\uFE00',\n 'varsubsetneqq': '\\u2ACB\\uFE00',\n 'vsubnE': '\\u2ACB\\uFE00',\n 'varsupsetneq': '\\u228B\\uFE00',\n 'vsupne': '\\u228B\\uFE00',\n 'varsupsetneqq': '\\u2ACC\\uFE00',\n 'vsupnE': '\\u2ACC\\uFE00',\n 'vcy': '\\u0432',\n 'veebar': '\\u22BB',\n 'veeeq': '\\u225A',\n 'vellip': '\\u22EE',\n 'vfr': '\\uD835\\uDD33',\n 'vopf': '\\uD835\\uDD67',\n 'vscr': '\\uD835\\uDCCB',\n 'vzigzag': '\\u299A',\n 'wcirc': '\\u0175',\n 'wedbar': '\\u2A5F',\n 'wedgeq': '\\u2259',\n 'weierp': '\\u2118',\n 'wp': '\\u2118',\n 'wfr': '\\uD835\\uDD34',\n 'wopf': '\\uD835\\uDD68',\n 'wscr': '\\uD835\\uDCCC',\n 'xfr': '\\uD835\\uDD35',\n 'xi': '\\u03BE',\n 'xnis': '\\u22FB',\n 'xopf': '\\uD835\\uDD69',\n 'xscr': '\\uD835\\uDCCD',\n 'yacute': '\\u00FD',\n 'yacy': '\\u044F',\n 'ycirc': '\\u0177',\n 'ycy': '\\u044B',\n 'yen': '\\u00A5',\n 'yfr': '\\uD835\\uDD36',\n 'yicy': '\\u0457',\n 'yopf': '\\uD835\\uDD6A',\n 'yscr': '\\uD835\\uDCCE',\n 'yucy': '\\u044E',\n 'yuml': '\\u00FF',\n 'zacute': '\\u017A',\n 'zcaron': '\\u017E',\n 'zcy': '\\u0437',\n 'zdot': '\\u017C',\n 'zeta': '\\u03B6',\n 'zfr': '\\uD835\\uDD37',\n 'zhcy': '\\u0436',\n 'zigrarr': '\\u21DD',\n 'zopf': '\\uD835\\uDD6B',\n 'zscr': '\\uD835\\uDCCF',\n 'zwj': '\\u200D',\n 'zwnj': '\\u200C',\n};\n\n// The &ngsp; pseudo-entity is denoting a space.\n// 0xE500 is a PUA (Private Use Areas) unicode character\n// This is inspired by the Angular Dart implementation.\nexport const NGSP_UNICODE = '\\uE500';\n\nNAMED_ENTITIES['ngsp'] = NGSP_UNICODE;\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as chars from '../chars';\nimport {ParseError, ParseLocation, ParseSourceFile, ParseSourceSpan} from '../parse_util';\n\nimport {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from './defaults';\nimport {NAMED_ENTITIES} from './entities';\nimport {TagContentType, TagDefinition} from './tags';\nimport {IncompleteTagOpenToken, TagOpenStartToken, Token, TokenType} from './tokens';\n\nexport class TokenError extends ParseError {\n constructor(\n errorMsg: string,\n public tokenType: TokenType | null,\n span: ParseSourceSpan,\n ) {\n super(span, errorMsg);\n }\n}\n\nexport class TokenizeResult {\n constructor(\n public tokens: Token[],\n public errors: TokenError[],\n public nonNormalizedIcuExpressions: Token[],\n ) {}\n}\n\nexport interface LexerRange {\n startPos: number;\n startLine: number;\n startCol: number;\n endPos: number;\n}\n\n/**\n * Options that modify how the text is tokenized.\n */\nexport interface TokenizeOptions {\n /** Whether to tokenize ICU messages (considered as text nodes when false). */\n tokenizeExpansionForms?: boolean;\n /** How to tokenize interpolation markers. */\n interpolationConfig?: InterpolationConfig;\n /**\n * The start and end point of the text to parse within the `source` string.\n * The entire `source` string is parsed if this is not provided.\n * */\n range?: LexerRange;\n /**\n * If this text is stored in a JavaScript string, then we have to deal with escape sequences.\n *\n * **Example 1:**\n *\n * ```\n * \"abc\\\"def\\nghi\"\n * ```\n *\n * - The `\\\"` must be converted to `\"`.\n * - The `\\n` must be converted to a new line character in a token,\n * but it should not increment the current line for source mapping.\n *\n * **Example 2:**\n *\n * ```\n * \"abc\\\n * def\"\n * ```\n *\n * The line continuation (`\\` followed by a newline) should be removed from a token\n * but the new line should increment the current line for source mapping.\n */\n escapedString?: boolean;\n /**\n * If this text is stored in an external template (e.g. via `templateUrl`) then we need to decide\n * whether or not to normalize the line-endings (from `\\r\\n` to `\\n`) when processing ICU\n * expressions.\n *\n * If `true` then we will normalize ICU expression line endings.\n * The default is `false`, but this will be switched in a future major release.\n */\n i18nNormalizeLineEndingsInICUs?: boolean;\n /**\n * An array of characters that should be considered as leading trivia.\n * Leading trivia are characters that are not important to the developer, and so should not be\n * included in source-map segments. A common example is whitespace.\n */\n leadingTriviaChars?: string[];\n /**\n * If true, do not convert CRLF to LF.\n */\n preserveLineEndings?: boolean;\n\n /**\n * Whether to tokenize @ block syntax. Otherwise considered text,\n * or ICU tokens if `tokenizeExpansionForms` is enabled.\n */\n tokenizeBlocks?: boolean;\n\n /**\n * Whether to tokenize the `@let` syntax. Otherwise will be considered either\n * text or an incomplete block, depending on whether `tokenizeBlocks` is enabled.\n */\n tokenizeLet?: boolean;\n}\n\nexport function tokenize(\n source: string,\n url: string,\n getTagDefinition: (tagName: string) => TagDefinition,\n options: TokenizeOptions = {},\n): TokenizeResult {\n const tokenizer = new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, options);\n tokenizer.tokenize();\n return new TokenizeResult(\n mergeTextTokens(tokenizer.tokens),\n tokenizer.errors,\n tokenizer.nonNormalizedIcuExpressions,\n );\n}\n\nconst _CR_OR_CRLF_REGEXP = /\\r\\n?/g;\n\nfunction _unexpectedCharacterErrorMsg(charCode: number): string {\n const char = charCode === chars.$EOF ? 'EOF' : String.fromCharCode(charCode);\n return `Unexpected character \"${char}\"`;\n}\n\nfunction _unknownEntityErrorMsg(entitySrc: string): string {\n return `Unknown entity \"${entitySrc}\" - use the \"&#;\" or \"&#x;\" syntax`;\n}\n\nfunction _unparsableEntityErrorMsg(type: CharacterReferenceType, entityStr: string): string {\n return `Unable to parse entity \"${entityStr}\" - ${type} character reference entities must end with \";\"`;\n}\n\nenum CharacterReferenceType {\n HEX = 'hexadecimal',\n DEC = 'decimal',\n}\n\nclass _ControlFlowError {\n constructor(public error: TokenError) {}\n}\n\n// See https://www.w3.org/TR/html51/syntax.html#writing-html-documents\nclass _Tokenizer {\n private _cursor: CharacterCursor;\n private _tokenizeIcu: boolean;\n private _interpolationConfig: InterpolationConfig;\n private _leadingTriviaCodePoints: number[] | undefined;\n private _currentTokenStart: CharacterCursor | null = null;\n private _currentTokenType: TokenType | null = null;\n private _expansionCaseStack: TokenType[] = [];\n private _inInterpolation: boolean = false;\n private readonly _preserveLineEndings: boolean;\n private readonly _i18nNormalizeLineEndingsInICUs: boolean;\n private readonly _tokenizeBlocks: boolean;\n private readonly _tokenizeLet: boolean;\n tokens: Token[] = [];\n errors: TokenError[] = [];\n nonNormalizedIcuExpressions: Token[] = [];\n\n /**\n * @param _file The html source file being tokenized.\n * @param _getTagDefinition A function that will retrieve a tag definition for a given tag name.\n * @param options Configuration of the tokenization.\n */\n constructor(\n _file: ParseSourceFile,\n private _getTagDefinition: (tagName: string) => TagDefinition,\n options: TokenizeOptions,\n ) {\n this._tokenizeIcu = options.tokenizeExpansionForms || false;\n this._interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG;\n this._leadingTriviaCodePoints =\n options.leadingTriviaChars && options.leadingTriviaChars.map((c) => c.codePointAt(0) || 0);\n const range = options.range || {\n endPos: _file.content.length,\n startPos: 0,\n startLine: 0,\n startCol: 0,\n };\n this._cursor = options.escapedString\n ? new EscapedCharacterCursor(_file, range)\n : new PlainCharacterCursor(_file, range);\n this._preserveLineEndings = options.preserveLineEndings || false;\n this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false;\n this._tokenizeBlocks = options.tokenizeBlocks ?? true;\n this._tokenizeLet = options.tokenizeLet ?? true;\n try {\n this._cursor.init();\n } catch (e) {\n this.handleError(e);\n }\n }\n\n private _processCarriageReturns(content: string): string {\n if (this._preserveLineEndings) {\n return content;\n }\n // https://www.w3.org/TR/html51/syntax.html#preprocessing-the-input-stream\n // In order to keep the original position in the source, we can not\n // pre-process it.\n // Instead CRs are processed right before instantiating the tokens.\n return content.replace(_CR_OR_CRLF_REGEXP, '\\n');\n }\n\n tokenize(): void {\n while (this._cursor.peek() !== chars.$EOF) {\n const start = this._cursor.clone();\n try {\n if (this._attemptCharCode(chars.$LT)) {\n if (this._attemptCharCode(chars.$BANG)) {\n if (this._attemptCharCode(chars.$LBRACKET)) {\n this._consumeCdata(start);\n } else if (this._attemptCharCode(chars.$MINUS)) {\n this._consumeComment(start);\n } else {\n this._consumeDocType(start);\n }\n } else if (this._attemptCharCode(chars.$SLASH)) {\n this._consumeTagClose(start);\n } else {\n this._consumeTagOpen(start);\n }\n } else if (\n this._tokenizeLet &&\n // Use `peek` instead of `attempCharCode` since we\n // don't want to advance in case it's not `@let`.\n this._cursor.peek() === chars.$AT &&\n !this._inInterpolation &&\n this._attemptStr('@let')\n ) {\n this._consumeLetDeclaration(start);\n } else if (this._tokenizeBlocks && this._attemptCharCode(chars.$AT)) {\n this._consumeBlockStart(start);\n } else if (\n this._tokenizeBlocks &&\n !this._inInterpolation &&\n !this._isInExpansionCase() &&\n !this._isInExpansionForm() &&\n this._attemptCharCode(chars.$RBRACE)\n ) {\n this._consumeBlockEnd(start);\n } else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {\n // In (possibly interpolated) text the end of the text is given by `isTextEnd()`, while\n // the premature end of an interpolation is given by the start of a new HTML element.\n this._consumeWithInterpolation(\n TokenType.TEXT,\n TokenType.INTERPOLATION,\n () => this._isTextEnd(),\n () => this._isTagStart(),\n );\n }\n } catch (e) {\n this.handleError(e);\n }\n }\n this._beginToken(TokenType.EOF);\n this._endToken([]);\n }\n\n private _getBlockName(): string {\n // This allows us to capture up something like `@else if`, but not `@ if`.\n let spacesInNameAllowed = false;\n const nameCursor = this._cursor.clone();\n\n this._attemptCharCodeUntilFn((code) => {\n if (chars.isWhitespace(code)) {\n return !spacesInNameAllowed;\n }\n if (isBlockNameChar(code)) {\n spacesInNameAllowed = true;\n return false;\n }\n return true;\n });\n return this._cursor.getChars(nameCursor).trim();\n }\n\n private _consumeBlockStart(start: CharacterCursor) {\n this._beginToken(TokenType.BLOCK_OPEN_START, start);\n const startToken = this._endToken([this._getBlockName()]);\n\n if (this._cursor.peek() === chars.$LPAREN) {\n // Advance past the opening paren.\n this._cursor.advance();\n // Capture the parameters.\n this._consumeBlockParameters();\n // Allow spaces before the closing paren.\n this._attemptCharCodeUntilFn(isNotWhitespace);\n\n if (this._attemptCharCode(chars.$RPAREN)) {\n // Allow spaces after the paren.\n this._attemptCharCodeUntilFn(isNotWhitespace);\n } else {\n startToken.type = TokenType.INCOMPLETE_BLOCK_OPEN;\n return;\n }\n }\n\n if (this._attemptCharCode(chars.$LBRACE)) {\n this._beginToken(TokenType.BLOCK_OPEN_END);\n this._endToken([]);\n } else {\n startToken.type = TokenType.INCOMPLETE_BLOCK_OPEN;\n }\n }\n\n private _consumeBlockEnd(start: CharacterCursor) {\n this._beginToken(TokenType.BLOCK_CLOSE, start);\n this._endToken([]);\n }\n\n private _consumeBlockParameters() {\n // Trim the whitespace until the first parameter.\n this._attemptCharCodeUntilFn(isBlockParameterChar);\n\n while (this._cursor.peek() !== chars.$RPAREN && this._cursor.peek() !== chars.$EOF) {\n this._beginToken(TokenType.BLOCK_PARAMETER);\n const start = this._cursor.clone();\n let inQuote: number | null = null;\n let openParens = 0;\n\n // Consume the parameter until the next semicolon or brace.\n // Note that we skip over semicolons/braces inside of strings.\n while (\n (this._cursor.peek() !== chars.$SEMICOLON && this._cursor.peek() !== chars.$EOF) ||\n inQuote !== null\n ) {\n const char = this._cursor.peek();\n\n // Skip to the next character if it was escaped.\n if (char === chars.$BACKSLASH) {\n this._cursor.advance();\n } else if (char === inQuote) {\n inQuote = null;\n } else if (inQuote === null && chars.isQuote(char)) {\n inQuote = char;\n } else if (char === chars.$LPAREN && inQuote === null) {\n openParens++;\n } else if (char === chars.$RPAREN && inQuote === null) {\n if (openParens === 0) {\n break;\n } else if (openParens > 0) {\n openParens--;\n }\n }\n\n this._cursor.advance();\n }\n\n this._endToken([this._cursor.getChars(start)]);\n\n // Skip to the next parameter.\n this._attemptCharCodeUntilFn(isBlockParameterChar);\n }\n }\n\n private _consumeLetDeclaration(start: CharacterCursor) {\n this._beginToken(TokenType.LET_START, start);\n\n // Require at least one white space after the `@let`.\n if (chars.isWhitespace(this._cursor.peek())) {\n this._attemptCharCodeUntilFn(isNotWhitespace);\n } else {\n const token = this._endToken([this._cursor.getChars(start)]);\n token.type = TokenType.INCOMPLETE_LET;\n return;\n }\n\n const startToken = this._endToken([this._getLetDeclarationName()]);\n\n // Skip over white space before the equals character.\n this._attemptCharCodeUntilFn(isNotWhitespace);\n\n // Expect an equals sign.\n if (!this._attemptCharCode(chars.$EQ)) {\n startToken.type = TokenType.INCOMPLETE_LET;\n return;\n }\n\n // Skip spaces after the equals.\n this._attemptCharCodeUntilFn((code) => isNotWhitespace(code) && !chars.isNewLine(code));\n this._consumeLetDeclarationValue();\n\n // Terminate the `@let` with a semicolon.\n const endChar = this._cursor.peek();\n if (endChar === chars.$SEMICOLON) {\n this._beginToken(TokenType.LET_END);\n this._endToken([]);\n this._cursor.advance();\n } else {\n startToken.type = TokenType.INCOMPLETE_LET;\n startToken.sourceSpan = this._cursor.getSpan(start);\n }\n }\n\n private _getLetDeclarationName(): string {\n const nameCursor = this._cursor.clone();\n let allowDigit = false;\n\n this._attemptCharCodeUntilFn((code) => {\n if (\n chars.isAsciiLetter(code) ||\n code === chars.$$ ||\n code === chars.$_ ||\n // `@let` names can't start with a digit, but digits are valid anywhere else in the name.\n (allowDigit && chars.isDigit(code))\n ) {\n allowDigit = true;\n return false;\n }\n return true;\n });\n\n return this._cursor.getChars(nameCursor).trim();\n }\n\n private _consumeLetDeclarationValue(): void {\n const start = this._cursor.clone();\n this._beginToken(TokenType.LET_VALUE, start);\n\n while (this._cursor.peek() !== chars.$EOF) {\n const char = this._cursor.peek();\n\n // `@let` declarations terminate with a semicolon.\n if (char === chars.$SEMICOLON) {\n break;\n }\n\n // If we hit a quote, skip over its content since we don't care what's inside.\n if (chars.isQuote(char)) {\n this._cursor.advance();\n this._attemptCharCodeUntilFn((inner) => {\n if (inner === chars.$BACKSLASH) {\n this._cursor.advance();\n return false;\n }\n return inner === char;\n });\n }\n\n this._cursor.advance();\n }\n\n this._endToken([this._cursor.getChars(start)]);\n }\n\n /**\n * @returns whether an ICU token has been created\n * @internal\n */\n private _tokenizeExpansionForm(): boolean {\n if (this.isExpansionFormStart()) {\n this._consumeExpansionFormStart();\n return true;\n }\n\n if (isExpansionCaseStart(this._cursor.peek()) && this._isInExpansionForm()) {\n this._consumeExpansionCaseStart();\n return true;\n }\n\n if (this._cursor.peek() === chars.$RBRACE) {\n if (this._isInExpansionCase()) {\n this._consumeExpansionCaseEnd();\n return true;\n }\n\n if (this._isInExpansionForm()) {\n this._consumeExpansionFormEnd();\n return true;\n }\n }\n\n return false;\n }\n\n private _beginToken(type: TokenType, start = this._cursor.clone()) {\n this._currentTokenStart = start;\n this._currentTokenType = type;\n }\n\n private _endToken(parts: string[], end?: CharacterCursor): Token {\n if (this._currentTokenStart === null) {\n throw new TokenError(\n 'Programming error - attempted to end a token when there was no start to the token',\n this._currentTokenType,\n this._cursor.getSpan(end),\n );\n }\n if (this._currentTokenType === null) {\n throw new TokenError(\n 'Programming error - attempted to end a token which has no token type',\n null,\n this._cursor.getSpan(this._currentTokenStart),\n );\n }\n const token = {\n type: this._currentTokenType,\n parts,\n sourceSpan: (end ?? this._cursor).getSpan(\n this._currentTokenStart,\n this._leadingTriviaCodePoints,\n ),\n } as Token;\n this.tokens.push(token);\n this._currentTokenStart = null;\n this._currentTokenType = null;\n return token;\n }\n\n private _createError(msg: string, span: ParseSourceSpan): _ControlFlowError {\n if (this._isInExpansionForm()) {\n msg += ` (Do you have an unescaped \"{\" in your template? Use \"{{ '{' }}\") to escape it.)`;\n }\n const error = new TokenError(msg, this._currentTokenType, span);\n this._currentTokenStart = null;\n this._currentTokenType = null;\n return new _ControlFlowError(error);\n }\n\n private handleError(e: any) {\n if (e instanceof CursorError) {\n e = this._createError(e.msg, this._cursor.getSpan(e.cursor));\n }\n if (e instanceof _ControlFlowError) {\n this.errors.push(e.error);\n } else {\n throw e;\n }\n }\n\n private _attemptCharCode(charCode: number): boolean {\n if (this._cursor.peek() === charCode) {\n this._cursor.advance();\n return true;\n }\n return false;\n }\n\n private _attemptCharCodeCaseInsensitive(charCode: number): boolean {\n if (compareCharCodeCaseInsensitive(this._cursor.peek(), charCode)) {\n this._cursor.advance();\n return true;\n }\n return false;\n }\n\n private _requireCharCode(charCode: number) {\n const location = this._cursor.clone();\n if (!this._attemptCharCode(charCode)) {\n throw this._createError(\n _unexpectedCharacterErrorMsg(this._cursor.peek()),\n this._cursor.getSpan(location),\n );\n }\n }\n\n private _attemptStr(chars: string): boolean {\n const len = chars.length;\n if (this._cursor.charsLeft() < len) {\n return false;\n }\n const initialPosition = this._cursor.clone();\n for (let i = 0; i < len; i++) {\n if (!this._attemptCharCode(chars.charCodeAt(i))) {\n // If attempting to parse the string fails, we want to reset the parser\n // to where it was before the attempt\n this._cursor = initialPosition;\n return false;\n }\n }\n return true;\n }\n\n private _attemptStrCaseInsensitive(chars: string): boolean {\n for (let i = 0; i < chars.length; i++) {\n if (!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))) {\n return false;\n }\n }\n return true;\n }\n\n private _requireStr(chars: string) {\n const location = this._cursor.clone();\n if (!this._attemptStr(chars)) {\n throw this._createError(\n _unexpectedCharacterErrorMsg(this._cursor.peek()),\n this._cursor.getSpan(location),\n );\n }\n }\n\n private _attemptCharCodeUntilFn(predicate: (code: number) => boolean) {\n while (!predicate(this._cursor.peek())) {\n this._cursor.advance();\n }\n }\n\n private _requireCharCodeUntilFn(predicate: (code: number) => boolean, len: number) {\n const start = this._cursor.clone();\n this._attemptCharCodeUntilFn(predicate);\n if (this._cursor.diff(start) < len) {\n throw this._createError(\n _unexpectedCharacterErrorMsg(this._cursor.peek()),\n this._cursor.getSpan(start),\n );\n }\n }\n\n private _attemptUntilChar(char: number) {\n while (this._cursor.peek() !== char) {\n this._cursor.advance();\n }\n }\n\n private _readChar(): string {\n // Don't rely upon reading directly from `_input` as the actual char value\n // may have been generated from an escape sequence.\n const char = String.fromCodePoint(this._cursor.peek());\n this._cursor.advance();\n return char;\n }\n\n private _consumeEntity(textTokenType: TokenType): void {\n this._beginToken(TokenType.ENCODED_ENTITY);\n const start = this._cursor.clone();\n this._cursor.advance();\n if (this._attemptCharCode(chars.$HASH)) {\n const isHex = this._attemptCharCode(chars.$x) || this._attemptCharCode(chars.$X);\n const codeStart = this._cursor.clone();\n this._attemptCharCodeUntilFn(isDigitEntityEnd);\n if (this._cursor.peek() != chars.$SEMICOLON) {\n // Advance cursor to include the peeked character in the string provided to the error\n // message.\n this._cursor.advance();\n const entityType = isHex ? CharacterReferenceType.HEX : CharacterReferenceType.DEC;\n throw this._createError(\n _unparsableEntityErrorMsg(entityType, this._cursor.getChars(start)),\n this._cursor.getSpan(),\n );\n }\n const strNum = this._cursor.getChars(codeStart);\n this._cursor.advance();\n try {\n const charCode = parseInt(strNum, isHex ? 16 : 10);\n this._endToken([String.fromCharCode(charCode), this._cursor.getChars(start)]);\n } catch {\n throw this._createError(\n _unknownEntityErrorMsg(this._cursor.getChars(start)),\n this._cursor.getSpan(),\n );\n }\n } else {\n const nameStart = this._cursor.clone();\n this._attemptCharCodeUntilFn(isNamedEntityEnd);\n if (this._cursor.peek() != chars.$SEMICOLON) {\n // No semicolon was found so abort the encoded entity token that was in progress, and treat\n // this as a text token\n this._beginToken(textTokenType, start);\n this._cursor = nameStart;\n this._endToken(['&']);\n } else {\n const name = this._cursor.getChars(nameStart);\n this._cursor.advance();\n const char = NAMED_ENTITIES.hasOwnProperty(name) && NAMED_ENTITIES[name];\n if (!char) {\n throw this._createError(_unknownEntityErrorMsg(name), this._cursor.getSpan(start));\n }\n this._endToken([char, `&${name};`]);\n }\n }\n }\n\n private _consumeRawText(consumeEntities: boolean, endMarkerPredicate: () => boolean): void {\n this._beginToken(consumeEntities ? TokenType.ESCAPABLE_RAW_TEXT : TokenType.RAW_TEXT);\n const parts: string[] = [];\n while (true) {\n const tagCloseStart = this._cursor.clone();\n const foundEndMarker = endMarkerPredicate();\n this._cursor = tagCloseStart;\n if (foundEndMarker) {\n break;\n }\n if (consumeEntities && this._cursor.peek() === chars.$AMPERSAND) {\n this._endToken([this._processCarriageReturns(parts.join(''))]);\n parts.length = 0;\n this._consumeEntity(TokenType.ESCAPABLE_RAW_TEXT);\n this._beginToken(TokenType.ESCAPABLE_RAW_TEXT);\n } else {\n parts.push(this._readChar());\n }\n }\n this._endToken([this._processCarriageReturns(parts.join(''))]);\n }\n\n private _consumeComment(start: CharacterCursor) {\n this._beginToken(TokenType.COMMENT_START, start);\n this._requireCharCode(chars.$MINUS);\n this._endToken([]);\n this._consumeRawText(false, () => this._attemptStr('-->'));\n this._beginToken(TokenType.COMMENT_END);\n this._requireStr('-->');\n this._endToken([]);\n }\n\n private _consumeCdata(start: CharacterCursor) {\n this._beginToken(TokenType.CDATA_START, start);\n this._requireStr('CDATA[');\n this._endToken([]);\n this._consumeRawText(false, () => this._attemptStr(']]>'));\n this._beginToken(TokenType.CDATA_END);\n this._requireStr(']]>');\n this._endToken([]);\n }\n\n private _consumeDocType(start: CharacterCursor) {\n this._beginToken(TokenType.DOC_TYPE, start);\n const contentStart = this._cursor.clone();\n this._attemptUntilChar(chars.$GT);\n const content = this._cursor.getChars(contentStart);\n this._cursor.advance();\n this._endToken([content]);\n }\n\n private _consumePrefixAndName(): string[] {\n const nameOrPrefixStart = this._cursor.clone();\n let prefix: string = '';\n while (this._cursor.peek() !== chars.$COLON && !isPrefixEnd(this._cursor.peek())) {\n this._cursor.advance();\n }\n let nameStart: CharacterCursor;\n if (this._cursor.peek() === chars.$COLON) {\n prefix = this._cursor.getChars(nameOrPrefixStart);\n this._cursor.advance();\n nameStart = this._cursor.clone();\n } else {\n nameStart = nameOrPrefixStart;\n }\n this._requireCharCodeUntilFn(isNameEnd, prefix === '' ? 0 : 1);\n const name = this._cursor.getChars(nameStart);\n return [prefix, name];\n }\n\n private _consumeTagOpen(start: CharacterCursor) {\n let tagName: string;\n let prefix: string;\n let openTagToken: TagOpenStartToken | IncompleteTagOpenToken | undefined;\n try {\n if (!chars.isAsciiLetter(this._cursor.peek())) {\n throw this._createError(\n _unexpectedCharacterErrorMsg(this._cursor.peek()),\n this._cursor.getSpan(start),\n );\n }\n\n openTagToken = this._consumeTagOpenStart(start);\n prefix = openTagToken.parts[0];\n tagName = openTagToken.parts[1];\n this._attemptCharCodeUntilFn(isNotWhitespace);\n while (\n this._cursor.peek() !== chars.$SLASH &&\n this._cursor.peek() !== chars.$GT &&\n this._cursor.peek() !== chars.$LT &&\n this._cursor.peek() !== chars.$EOF\n ) {\n this._consumeAttributeName();\n this._attemptCharCodeUntilFn(isNotWhitespace);\n if (this._attemptCharCode(chars.$EQ)) {\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._consumeAttributeValue();\n }\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n this._consumeTagOpenEnd();\n } catch (e) {\n if (e instanceof _ControlFlowError) {\n if (openTagToken) {\n // We errored before we could close the opening tag, so it is incomplete.\n openTagToken.type = TokenType.INCOMPLETE_TAG_OPEN;\n } else {\n // When the start tag is invalid, assume we want a \"<\" as text.\n // Back to back text tokens are merged at the end.\n this._beginToken(TokenType.TEXT, start);\n this._endToken(['<']);\n }\n return;\n }\n\n throw e;\n }\n\n const contentTokenType = this._getTagDefinition(tagName).getContentType(prefix);\n\n if (contentTokenType === TagContentType.RAW_TEXT) {\n this._consumeRawTextWithTagClose(prefix, tagName, false);\n } else if (contentTokenType === TagContentType.ESCAPABLE_RAW_TEXT) {\n this._consumeRawTextWithTagClose(prefix, tagName, true);\n }\n }\n\n private _consumeRawTextWithTagClose(prefix: string, tagName: string, consumeEntities: boolean) {\n this._consumeRawText(consumeEntities, () => {\n if (!this._attemptCharCode(chars.$LT)) return false;\n if (!this._attemptCharCode(chars.$SLASH)) return false;\n this._attemptCharCodeUntilFn(isNotWhitespace);\n if (!this._attemptStrCaseInsensitive(tagName)) return false;\n this._attemptCharCodeUntilFn(isNotWhitespace);\n return this._attemptCharCode(chars.$GT);\n });\n this._beginToken(TokenType.TAG_CLOSE);\n this._requireCharCodeUntilFn((code) => code === chars.$GT, 3);\n this._cursor.advance(); // Consume the `>`\n this._endToken([prefix, tagName]);\n }\n\n private _consumeTagOpenStart(start: CharacterCursor): TagOpenStartToken {\n this._beginToken(TokenType.TAG_OPEN_START, start);\n const parts = this._consumePrefixAndName();\n return this._endToken(parts) as TagOpenStartToken;\n }\n\n private _consumeAttributeName() {\n const attrNameStart = this._cursor.peek();\n if (attrNameStart === chars.$SQ || attrNameStart === chars.$DQ) {\n throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart), this._cursor.getSpan());\n }\n this._beginToken(TokenType.ATTR_NAME);\n const prefixAndName = this._consumePrefixAndName();\n this._endToken(prefixAndName);\n }\n\n private _consumeAttributeValue() {\n if (this._cursor.peek() === chars.$SQ || this._cursor.peek() === chars.$DQ) {\n const quoteChar = this._cursor.peek();\n this._consumeQuote(quoteChar);\n // In an attribute then end of the attribute value and the premature end to an interpolation\n // are both triggered by the `quoteChar`.\n const endPredicate = () => this._cursor.peek() === quoteChar;\n this._consumeWithInterpolation(\n TokenType.ATTR_VALUE_TEXT,\n TokenType.ATTR_VALUE_INTERPOLATION,\n endPredicate,\n endPredicate,\n );\n this._consumeQuote(quoteChar);\n } else {\n const endPredicate = () => isNameEnd(this._cursor.peek());\n this._consumeWithInterpolation(\n TokenType.ATTR_VALUE_TEXT,\n TokenType.ATTR_VALUE_INTERPOLATION,\n endPredicate,\n endPredicate,\n );\n }\n }\n\n private _consumeQuote(quoteChar: number) {\n this._beginToken(TokenType.ATTR_QUOTE);\n this._requireCharCode(quoteChar);\n this._endToken([String.fromCodePoint(quoteChar)]);\n }\n\n private _consumeTagOpenEnd() {\n const tokenType = this._attemptCharCode(chars.$SLASH)\n ? TokenType.TAG_OPEN_END_VOID\n : TokenType.TAG_OPEN_END;\n this._beginToken(tokenType);\n this._requireCharCode(chars.$GT);\n this._endToken([]);\n }\n\n private _consumeTagClose(start: CharacterCursor) {\n this._beginToken(TokenType.TAG_CLOSE, start);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n const prefixAndName = this._consumePrefixAndName();\n this._attemptCharCodeUntilFn(isNotWhitespace);\n this._requireCharCode(chars.$GT);\n this._endToken(prefixAndName);\n }\n\n private _consumeExpansionFormStart() {\n this._beginToken(TokenType.EXPANSION_FORM_START);\n this._requireCharCode(chars.$LBRACE);\n this._endToken([]);\n\n this._expansionCaseStack.push(TokenType.EXPANSION_FORM_START);\n\n this._beginToken(TokenType.RAW_TEXT);\n const condition = this._readUntil(chars.$COMMA);\n const normalizedCondition = this._processCarriageReturns(condition);\n if (this._i18nNormalizeLineEndingsInICUs) {\n // We explicitly want to normalize line endings for this text.\n this._endToken([normalizedCondition]);\n } else {\n // We are not normalizing line endings.\n const conditionToken = this._endToken([condition]);\n if (normalizedCondition !== condition) {\n this.nonNormalizedIcuExpressions.push(conditionToken);\n }\n }\n this._requireCharCode(chars.$COMMA);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n\n this._beginToken(TokenType.RAW_TEXT);\n const type = this._readUntil(chars.$COMMA);\n this._endToken([type]);\n this._requireCharCode(chars.$COMMA);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n }\n\n private _consumeExpansionCaseStart() {\n this._beginToken(TokenType.EXPANSION_CASE_VALUE);\n const value = this._readUntil(chars.$LBRACE).trim();\n this._endToken([value]);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n\n this._beginToken(TokenType.EXPANSION_CASE_EXP_START);\n this._requireCharCode(chars.$LBRACE);\n this._endToken([]);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n\n this._expansionCaseStack.push(TokenType.EXPANSION_CASE_EXP_START);\n }\n\n private _consumeExpansionCaseEnd() {\n this._beginToken(TokenType.EXPANSION_CASE_EXP_END);\n this._requireCharCode(chars.$RBRACE);\n this._endToken([]);\n this._attemptCharCodeUntilFn(isNotWhitespace);\n\n this._expansionCaseStack.pop();\n }\n\n private _consumeExpansionFormEnd() {\n this._beginToken(TokenType.EXPANSION_FORM_END);\n this._requireCharCode(chars.$RBRACE);\n this._endToken([]);\n\n this._expansionCaseStack.pop();\n }\n\n /**\n * Consume a string that may contain interpolation expressions.\n *\n * The first token consumed will be of `tokenType` and then there will be alternating\n * `interpolationTokenType` and `tokenType` tokens until the `endPredicate()` returns true.\n *\n * If an interpolation token ends prematurely it will have no end marker in its `parts` array.\n *\n * @param textTokenType the kind of tokens to interleave around interpolation tokens.\n * @param interpolationTokenType the kind of tokens that contain interpolation.\n * @param endPredicate a function that should return true when we should stop consuming.\n * @param endInterpolation a function that should return true if there is a premature end to an\n * interpolation expression - i.e. before we get to the normal interpolation closing marker.\n */\n private _consumeWithInterpolation(\n textTokenType: TokenType,\n interpolationTokenType: TokenType,\n endPredicate: () => boolean,\n endInterpolation: () => boolean,\n ) {\n this._beginToken(textTokenType);\n const parts: string[] = [];\n\n while (!endPredicate()) {\n const current = this._cursor.clone();\n if (this._interpolationConfig && this._attemptStr(this._interpolationConfig.start)) {\n this._endToken([this._processCarriageReturns(parts.join(''))], current);\n parts.length = 0;\n this._consumeInterpolation(interpolationTokenType, current, endInterpolation);\n this._beginToken(textTokenType);\n } else if (this._cursor.peek() === chars.$AMPERSAND) {\n this._endToken([this._processCarriageReturns(parts.join(''))]);\n parts.length = 0;\n this._consumeEntity(textTokenType);\n this._beginToken(textTokenType);\n } else {\n parts.push(this._readChar());\n }\n }\n\n // It is possible that an interpolation was started but not ended inside this text token.\n // Make sure that we reset the state of the lexer correctly.\n this._inInterpolation = false;\n\n this._endToken([this._processCarriageReturns(parts.join(''))]);\n }\n\n /**\n * Consume a block of text that has been interpreted as an Angular interpolation.\n *\n * @param interpolationTokenType the type of the interpolation token to generate.\n * @param interpolationStart a cursor that points to the start of this interpolation.\n * @param prematureEndPredicate a function that should return true if the next characters indicate\n * an end to the interpolation before its normal closing marker.\n */\n private _consumeInterpolation(\n interpolationTokenType: TokenType,\n interpolationStart: CharacterCursor,\n prematureEndPredicate: (() => boolean) | null,\n ): void {\n const parts: string[] = [];\n this._beginToken(interpolationTokenType, interpolationStart);\n parts.push(this._interpolationConfig.start);\n\n // Find the end of the interpolation, ignoring content inside quotes.\n const expressionStart = this._cursor.clone();\n let inQuote: number | null = null;\n let inComment = false;\n while (\n this._cursor.peek() !== chars.$EOF &&\n (prematureEndPredicate === null || !prematureEndPredicate())\n ) {\n const current = this._cursor.clone();\n\n if (this._isTagStart()) {\n // We are starting what looks like an HTML element in the middle of this interpolation.\n // Reset the cursor to before the `<` character and end the interpolation token.\n // (This is actually wrong but here for backward compatibility).\n this._cursor = current;\n parts.push(this._getProcessedChars(expressionStart, current));\n this._endToken(parts);\n return;\n }\n\n if (inQuote === null) {\n if (this._attemptStr(this._interpolationConfig.end)) {\n // We are not in a string, and we hit the end interpolation marker\n parts.push(this._getProcessedChars(expressionStart, current));\n parts.push(this._interpolationConfig.end);\n this._endToken(parts);\n return;\n } else if (this._attemptStr('//')) {\n // Once we are in a comment we ignore any quotes\n inComment = true;\n }\n }\n\n const char = this._cursor.peek();\n this._cursor.advance();\n if (char === chars.$BACKSLASH) {\n // Skip the next character because it was escaped.\n this._cursor.advance();\n } else if (char === inQuote) {\n // Exiting the current quoted string\n inQuote = null;\n } else if (!inComment && inQuote === null && chars.isQuote(char)) {\n // Entering a new quoted string\n inQuote = char;\n }\n }\n\n // We hit EOF without finding a closing interpolation marker\n parts.push(this._getProcessedChars(expressionStart, this._cursor));\n this._endToken(parts);\n }\n\n private _getProcessedChars(start: CharacterCursor, end: CharacterCursor): string {\n return this._processCarriageReturns(end.getChars(start));\n }\n\n private _isTextEnd(): boolean {\n if (this._isTagStart() || this._cursor.peek() === chars.$EOF) {\n return true;\n }\n\n if (this._tokenizeIcu && !this._inInterpolation) {\n if (this.isExpansionFormStart()) {\n // start of an expansion form\n return true;\n }\n\n if (this._cursor.peek() === chars.$RBRACE && this._isInExpansionCase()) {\n // end of and expansion case\n return true;\n }\n }\n\n if (\n this._tokenizeBlocks &&\n !this._inInterpolation &&\n !this._isInExpansion() &&\n (this._cursor.peek() === chars.$AT || this._cursor.peek() === chars.$RBRACE)\n ) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Returns true if the current cursor is pointing to the start of a tag\n * (opening/closing/comments/cdata/etc).\n */\n private _isTagStart(): boolean {\n if (this._cursor.peek() === chars.$LT) {\n // We assume that `<` followed by whitespace is not the start of an HTML element.\n const tmp = this._cursor.clone();\n tmp.advance();\n // If the next character is alphabetic, ! nor / then it is a tag start\n const code = tmp.peek();\n if (\n (chars.$a <= code && code <= chars.$z) ||\n (chars.$A <= code && code <= chars.$Z) ||\n code === chars.$SLASH ||\n code === chars.$BANG\n ) {\n return true;\n }\n }\n return false;\n }\n\n private _readUntil(char: number): string {\n const start = this._cursor.clone();\n this._attemptUntilChar(char);\n return this._cursor.getChars(start);\n }\n\n private _isInExpansion(): boolean {\n return this._isInExpansionCase() || this._isInExpansionForm();\n }\n\n private _isInExpansionCase(): boolean {\n return (\n this._expansionCaseStack.length > 0 &&\n this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n TokenType.EXPANSION_CASE_EXP_START\n );\n }\n\n private _isInExpansionForm(): boolean {\n return (\n this._expansionCaseStack.length > 0 &&\n this._expansionCaseStack[this._expansionCaseStack.length - 1] ===\n TokenType.EXPANSION_FORM_START\n );\n }\n\n private isExpansionFormStart(): boolean {\n if (this._cursor.peek() !== chars.$LBRACE) {\n return false;\n }\n if (this._interpolationConfig) {\n const start = this._cursor.clone();\n const isInterpolation = this._attemptStr(this._interpolationConfig.start);\n this._cursor = start;\n return !isInterpolation;\n }\n return true;\n }\n}\n\nfunction isNotWhitespace(code: number): boolean {\n return !chars.isWhitespace(code) || code === chars.$EOF;\n}\n\nfunction isNameEnd(code: number): boolean {\n return (\n chars.isWhitespace(code) ||\n code === chars.$GT ||\n code === chars.$LT ||\n code === chars.$SLASH ||\n code === chars.$SQ ||\n code === chars.$DQ ||\n code === chars.$EQ ||\n code === chars.$EOF\n );\n}\n\nfunction isPrefixEnd(code: number): boolean {\n return (\n (code < chars.$a || chars.$z < code) &&\n (code < chars.$A || chars.$Z < code) &&\n (code < chars.$0 || code > chars.$9)\n );\n}\n\nfunction isDigitEntityEnd(code: number): boolean {\n return code === chars.$SEMICOLON || code === chars.$EOF || !chars.isAsciiHexDigit(code);\n}\n\nfunction isNamedEntityEnd(code: number): boolean {\n return code === chars.$SEMICOLON || code === chars.$EOF || !chars.isAsciiLetter(code);\n}\n\nfunction isExpansionCaseStart(peek: number): boolean {\n return peek !== chars.$RBRACE;\n}\n\nfunction compareCharCodeCaseInsensitive(code1: number, code2: number): boolean {\n return toUpperCaseCharCode(code1) === toUpperCaseCharCode(code2);\n}\n\nfunction toUpperCaseCharCode(code: number): number {\n return code >= chars.$a && code <= chars.$z ? code - chars.$a + chars.$A : code;\n}\n\nfunction isBlockNameChar(code: number): boolean {\n return chars.isAsciiLetter(code) || chars.isDigit(code) || code === chars.$_;\n}\n\nfunction isBlockParameterChar(code: number): boolean {\n return code !== chars.$SEMICOLON && isNotWhitespace(code);\n}\n\nfunction mergeTextTokens(srcTokens: Token[]): Token[] {\n const dstTokens: Token[] = [];\n let lastDstToken: Token | undefined = undefined;\n for (let i = 0; i < srcTokens.length; i++) {\n const token = srcTokens[i];\n if (\n (lastDstToken && lastDstToken.type === TokenType.TEXT && token.type === TokenType.TEXT) ||\n (lastDstToken &&\n lastDstToken.type === TokenType.ATTR_VALUE_TEXT &&\n token.type === TokenType.ATTR_VALUE_TEXT)\n ) {\n lastDstToken.parts[0]! += token.parts[0];\n lastDstToken.sourceSpan.end = token.sourceSpan.end;\n } else {\n lastDstToken = token;\n dstTokens.push(lastDstToken);\n }\n }\n\n return dstTokens;\n}\n\n/**\n * The _Tokenizer uses objects of this type to move through the input text,\n * extracting \"parsed characters\". These could be more than one actual character\n * if the text contains escape sequences.\n */\ninterface CharacterCursor {\n /** Initialize the cursor. */\n init(): void;\n /** The parsed character at the current cursor position. */\n peek(): number;\n /** Advance the cursor by one parsed character. */\n advance(): void;\n /** Get a span from the marked start point to the current point. */\n getSpan(start?: this, leadingTriviaCodePoints?: number[]): ParseSourceSpan;\n /** Get the parsed characters from the marked start point to the current point. */\n getChars(start: this): string;\n /** The number of characters left before the end of the cursor. */\n charsLeft(): number;\n /** The number of characters between `this` cursor and `other` cursor. */\n diff(other: this): number;\n /** Make a copy of this cursor */\n clone(): CharacterCursor;\n}\n\ninterface CursorState {\n peek: number;\n offset: number;\n line: number;\n column: number;\n}\n\nclass PlainCharacterCursor implements CharacterCursor {\n protected state: CursorState;\n protected file: ParseSourceFile;\n protected input: string;\n protected end: number;\n\n constructor(fileOrCursor: PlainCharacterCursor);\n constructor(fileOrCursor: ParseSourceFile, range: LexerRange);\n constructor(fileOrCursor: ParseSourceFile | PlainCharacterCursor, range?: LexerRange) {\n if (fileOrCursor instanceof PlainCharacterCursor) {\n this.file = fileOrCursor.file;\n this.input = fileOrCursor.input;\n this.end = fileOrCursor.end;\n\n const state = fileOrCursor.state;\n // Note: avoid using `{...fileOrCursor.state}` here as that has a severe performance penalty.\n // In ES5 bundles the object spread operator is translated into the `__assign` helper, which\n // is not optimized by VMs as efficiently as a raw object literal. Since this constructor is\n // called in tight loops, this difference matters.\n this.state = {\n peek: state.peek,\n offset: state.offset,\n line: state.line,\n column: state.column,\n };\n } else {\n if (!range) {\n throw new Error(\n 'Programming error: the range argument must be provided with a file argument.',\n );\n }\n this.file = fileOrCursor;\n this.input = fileOrCursor.content;\n this.end = range.endPos;\n this.state = {\n peek: -1,\n offset: range.startPos,\n line: range.startLine,\n column: range.startCol,\n };\n }\n }\n\n clone(): PlainCharacterCursor {\n return new PlainCharacterCursor(this);\n }\n\n peek() {\n return this.state.peek;\n }\n charsLeft() {\n return this.end - this.state.offset;\n }\n diff(other: this) {\n return this.state.offset - other.state.offset;\n }\n\n advance(): void {\n this.advanceState(this.state);\n }\n\n init(): void {\n this.updatePeek(this.state);\n }\n\n getSpan(start?: this, leadingTriviaCodePoints?: number[]): ParseSourceSpan {\n start = start || this;\n let fullStart = start;\n if (leadingTriviaCodePoints) {\n while (this.diff(start) > 0 && leadingTriviaCodePoints.indexOf(start.peek()) !== -1) {\n if (fullStart === start) {\n start = start.clone() as this;\n }\n start.advance();\n }\n }\n const startLocation = this.locationFromCursor(start);\n const endLocation = this.locationFromCursor(this);\n const fullStartLocation =\n fullStart !== start ? this.locationFromCursor(fullStart) : startLocation;\n return new ParseSourceSpan(startLocation, endLocation, fullStartLocation);\n }\n\n getChars(start: this): string {\n return this.input.substring(start.state.offset, this.state.offset);\n }\n\n charAt(pos: number): number {\n return this.input.charCodeAt(pos);\n }\n\n protected advanceState(state: CursorState) {\n if (state.offset >= this.end) {\n this.state = state;\n throw new CursorError('Unexpected character \"EOF\"', this);\n }\n const currentChar = this.charAt(state.offset);\n if (currentChar === chars.$LF) {\n state.line++;\n state.column = 0;\n } else if (!chars.isNewLine(currentChar)) {\n state.column++;\n }\n state.offset++;\n this.updatePeek(state);\n }\n\n protected updatePeek(state: CursorState): void {\n state.peek = state.offset >= this.end ? chars.$EOF : this.charAt(state.offset);\n }\n\n private locationFromCursor(cursor: this): ParseLocation {\n return new ParseLocation(\n cursor.file,\n cursor.state.offset,\n cursor.state.line,\n cursor.state.column,\n );\n }\n}\n\nclass EscapedCharacterCursor extends PlainCharacterCursor {\n protected internalState: CursorState;\n\n constructor(fileOrCursor: EscapedCharacterCursor);\n constructor(fileOrCursor: ParseSourceFile, range: LexerRange);\n constructor(fileOrCursor: ParseSourceFile | EscapedCharacterCursor, range?: LexerRange) {\n if (fileOrCursor instanceof EscapedCharacterCursor) {\n super(fileOrCursor);\n this.internalState = {...fileOrCursor.internalState};\n } else {\n super(fileOrCursor, range!);\n this.internalState = this.state;\n }\n }\n\n override advance(): void {\n this.state = this.internalState;\n super.advance();\n this.processEscapeSequence();\n }\n\n override init(): void {\n super.init();\n this.processEscapeSequence();\n }\n\n override clone(): EscapedCharacterCursor {\n return new EscapedCharacterCursor(this);\n }\n\n override getChars(start: this): string {\n const cursor = start.clone();\n let chars = '';\n while (cursor.internalState.offset < this.internalState.offset) {\n chars += String.fromCodePoint(cursor.peek());\n cursor.advance();\n }\n return chars;\n }\n\n /**\n * Process the escape sequence that starts at the current position in the text.\n *\n * This method is called to ensure that `peek` has the unescaped value of escape sequences.\n */\n protected processEscapeSequence(): void {\n const peek = () => this.internalState.peek;\n\n if (peek() === chars.$BACKSLASH) {\n // We have hit an escape sequence so we need the internal state to become independent\n // of the external state.\n this.internalState = {...this.state};\n\n // Move past the backslash\n this.advanceState(this.internalState);\n\n // First check for standard control char sequences\n if (peek() === chars.$n) {\n this.state.peek = chars.$LF;\n } else if (peek() === chars.$r) {\n this.state.peek = chars.$CR;\n } else if (peek() === chars.$v) {\n this.state.peek = chars.$VTAB;\n } else if (peek() === chars.$t) {\n this.state.peek = chars.$TAB;\n } else if (peek() === chars.$b) {\n this.state.peek = chars.$BSPACE;\n } else if (peek() === chars.$f) {\n this.state.peek = chars.$FF;\n }\n\n // Now consider more complex sequences\n else if (peek() === chars.$u) {\n // Unicode code-point sequence\n this.advanceState(this.internalState); // advance past the `u` char\n if (peek() === chars.$LBRACE) {\n // Variable length Unicode, e.g. `\\x{123}`\n this.advanceState(this.internalState); // advance past the `{` char\n // Advance past the variable number of hex digits until we hit a `}` char\n const digitStart = this.clone();\n let length = 0;\n while (peek() !== chars.$RBRACE) {\n this.advanceState(this.internalState);\n length++;\n }\n this.state.peek = this.decodeHexDigits(digitStart, length);\n } else {\n // Fixed length Unicode, e.g. `\\u1234`\n const digitStart = this.clone();\n this.advanceState(this.internalState);\n this.advanceState(this.internalState);\n this.advanceState(this.internalState);\n this.state.peek = this.decodeHexDigits(digitStart, 4);\n }\n } else if (peek() === chars.$x) {\n // Hex char code, e.g. `\\x2F`\n this.advanceState(this.internalState); // advance past the `x` char\n const digitStart = this.clone();\n this.advanceState(this.internalState);\n this.state.peek = this.decodeHexDigits(digitStart, 2);\n } else if (chars.isOctalDigit(peek())) {\n // Octal char code, e.g. `\\012`,\n let octal = '';\n let length = 0;\n let previous = this.clone();\n while (chars.isOctalDigit(peek()) && length < 3) {\n previous = this.clone();\n octal += String.fromCodePoint(peek());\n this.advanceState(this.internalState);\n length++;\n }\n this.state.peek = parseInt(octal, 8);\n // Backup one char\n this.internalState = previous.internalState;\n } else if (chars.isNewLine(this.internalState.peek)) {\n // Line continuation `\\` followed by a new line\n this.advanceState(this.internalState); // advance over the newline\n this.state = this.internalState;\n } else {\n // If none of the `if` blocks were executed then we just have an escaped normal character.\n // In that case we just, effectively, skip the backslash from the character.\n this.state.peek = this.internalState.peek;\n }\n }\n }\n\n protected decodeHexDigits(start: EscapedCharacterCursor, length: number): number {\n const hex = this.input.slice(start.internalState.offset, start.internalState.offset + length);\n const charCode = parseInt(hex, 16);\n if (!isNaN(charCode)) {\n return charCode;\n } else {\n start.state = start.internalState;\n throw new CursorError('Invalid hexadecimal escape sequence', start);\n }\n }\n}\n\nexport class CursorError {\n constructor(\n public msg: string,\n public cursor: CharacterCursor,\n ) {}\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ParseError, ParseLocation, ParseSourceSpan} from '../parse_util';\n\nimport * as html from './ast';\nimport {NAMED_ENTITIES} from './entities';\nimport {tokenize, TokenizeOptions} from './lexer';\nimport {getNsPrefix, mergeNsAndName, splitNsName, TagDefinition} from './tags';\nimport {\n AttributeNameToken,\n AttributeQuoteToken,\n BlockCloseToken,\n BlockOpenStartToken,\n BlockParameterToken,\n CdataStartToken,\n CommentStartToken,\n ExpansionCaseExpressionEndToken,\n ExpansionCaseExpressionStartToken,\n ExpansionCaseValueToken,\n ExpansionFormStartToken,\n IncompleteBlockOpenToken,\n IncompleteLetToken,\n IncompleteTagOpenToken,\n InterpolatedAttributeToken,\n InterpolatedTextToken,\n LetEndToken,\n LetStartToken,\n LetValueToken,\n TagCloseToken,\n TagOpenStartToken,\n TextToken,\n Token,\n TokenType,\n} from './tokens';\n\n/** Nodes that can contain other nodes. */\ntype NodeContainer = html.Element | html.Block;\n\n/** Class that can construct a `NodeContainer`. */\ninterface NodeContainerConstructor extends Function {\n new (...args: any[]): NodeContainer;\n}\n\nexport class TreeError extends ParseError {\n static create(elementName: string | null, span: ParseSourceSpan, msg: string): TreeError {\n return new TreeError(elementName, span, msg);\n }\n\n constructor(\n public elementName: string | null,\n span: ParseSourceSpan,\n msg: string,\n ) {\n super(span, msg);\n }\n}\n\nexport class ParseTreeResult {\n constructor(\n public rootNodes: html.Node[],\n public errors: ParseError[],\n ) {}\n}\n\nexport class Parser {\n constructor(public getTagDefinition: (tagName: string) => TagDefinition) {}\n\n parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult {\n const tokenizeResult = tokenize(source, url, this.getTagDefinition, options);\n const parser = new _TreeBuilder(tokenizeResult.tokens, this.getTagDefinition);\n parser.build();\n return new ParseTreeResult(\n parser.rootNodes,\n (tokenizeResult.errors as ParseError[]).concat(parser.errors),\n );\n }\n}\n\nclass _TreeBuilder {\n private _index: number = -1;\n // `_peek` will be initialized by the call to `_advance()` in the constructor.\n private _peek!: Token;\n private _containerStack: NodeContainer[] = [];\n\n rootNodes: html.Node[] = [];\n errors: TreeError[] = [];\n\n constructor(\n private tokens: Token[],\n private getTagDefinition: (tagName: string) => TagDefinition,\n ) {\n this._advance();\n }\n\n build(): void {\n while (this._peek.type !== TokenType.EOF) {\n if (\n this._peek.type === TokenType.TAG_OPEN_START ||\n this._peek.type === TokenType.INCOMPLETE_TAG_OPEN\n ) {\n this._consumeStartTag(this._advance());\n } else if (this._peek.type === TokenType.TAG_CLOSE) {\n this._consumeEndTag(this._advance());\n } else if (this._peek.type === TokenType.CDATA_START) {\n this._closeVoidElement();\n this._consumeCdata(this._advance());\n } else if (this._peek.type === TokenType.COMMENT_START) {\n this._closeVoidElement();\n this._consumeComment(this._advance());\n } else if (\n this._peek.type === TokenType.TEXT ||\n this._peek.type === TokenType.RAW_TEXT ||\n this._peek.type === TokenType.ESCAPABLE_RAW_TEXT\n ) {\n this._closeVoidElement();\n this._consumeText(this._advance());\n } else if (this._peek.type === TokenType.EXPANSION_FORM_START) {\n this._consumeExpansion(this._advance());\n } else if (this._peek.type === TokenType.BLOCK_OPEN_START) {\n this._closeVoidElement();\n this._consumeBlockOpen(this._advance());\n } else if (this._peek.type === TokenType.BLOCK_CLOSE) {\n this._closeVoidElement();\n this._consumeBlockClose(this._advance());\n } else if (this._peek.type === TokenType.INCOMPLETE_BLOCK_OPEN) {\n this._closeVoidElement();\n this._consumeIncompleteBlock(this._advance());\n } else if (this._peek.type === TokenType.LET_START) {\n this._closeVoidElement();\n this._consumeLet(this._advance());\n } else if (this._peek.type === TokenType.INCOMPLETE_LET) {\n this._closeVoidElement();\n this._consumeIncompleteLet(this._advance());\n } else {\n // Skip all other tokens...\n this._advance();\n }\n }\n\n for (const leftoverContainer of this._containerStack) {\n // Unlike HTML elements, blocks aren't closed implicitly by the end of the file.\n if (leftoverContainer instanceof html.Block) {\n this.errors.push(\n TreeError.create(\n leftoverContainer.name,\n leftoverContainer.sourceSpan,\n `Unclosed block \"${leftoverContainer.name}\"`,\n ),\n );\n }\n }\n }\n\n private _advance(): T {\n const prev = this._peek;\n if (this._index < this.tokens.length - 1) {\n // Note: there is always an EOF token at the end\n this._index++;\n }\n this._peek = this.tokens[this._index];\n return prev as T;\n }\n\n private _advanceIf(type: T): (Token & {type: T}) | null {\n if (this._peek.type === type) {\n return this._advance();\n }\n return null;\n }\n\n private _consumeCdata(_startToken: CdataStartToken) {\n this._consumeText(this._advance());\n this._advanceIf(TokenType.CDATA_END);\n }\n\n private _consumeComment(token: CommentStartToken) {\n const text = this._advanceIf(TokenType.RAW_TEXT);\n const endToken = this._advanceIf(TokenType.COMMENT_END);\n const value = text != null ? text.parts[0].trim() : null;\n const sourceSpan =\n endToken == null\n ? token.sourceSpan\n : new ParseSourceSpan(\n token.sourceSpan.start,\n endToken.sourceSpan.end,\n token.sourceSpan.fullStart,\n );\n this._addToParent(new html.Comment(value, sourceSpan));\n }\n\n private _consumeExpansion(token: ExpansionFormStartToken) {\n const switchValue = this._advance();\n\n const type = this._advance();\n const cases: html.ExpansionCase[] = [];\n\n // read =\n while (this._peek.type === TokenType.EXPANSION_CASE_VALUE) {\n const expCase = this._parseExpansionCase();\n if (!expCase) return; // error\n cases.push(expCase);\n }\n\n // read the final }\n if (this._peek.type !== TokenType.EXPANSION_FORM_END) {\n this.errors.push(\n TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`),\n );\n return;\n }\n const sourceSpan = new ParseSourceSpan(\n token.sourceSpan.start,\n this._peek.sourceSpan.end,\n token.sourceSpan.fullStart,\n );\n this._addToParent(\n new html.Expansion(\n switchValue.parts[0],\n type.parts[0],\n cases,\n sourceSpan,\n switchValue.sourceSpan,\n ),\n );\n\n this._advance();\n }\n\n private _parseExpansionCase(): html.ExpansionCase | null {\n const value = this._advance();\n\n // read {\n if (this._peek.type !== TokenType.EXPANSION_CASE_EXP_START) {\n this.errors.push(\n TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '{'.`),\n );\n return null;\n }\n\n // read until }\n const start = this._advance();\n\n const exp = this._collectExpansionExpTokens(start);\n if (!exp) return null;\n\n const end = this._advance();\n exp.push({type: TokenType.EOF, parts: [], sourceSpan: end.sourceSpan});\n\n // parse everything in between { and }\n const expansionCaseParser = new _TreeBuilder(exp, this.getTagDefinition);\n expansionCaseParser.build();\n if (expansionCaseParser.errors.length > 0) {\n this.errors = this.errors.concat(expansionCaseParser.errors);\n return null;\n }\n\n const sourceSpan = new ParseSourceSpan(\n value.sourceSpan.start,\n end.sourceSpan.end,\n value.sourceSpan.fullStart,\n );\n const expSourceSpan = new ParseSourceSpan(\n start.sourceSpan.start,\n end.sourceSpan.end,\n start.sourceSpan.fullStart,\n );\n return new html.ExpansionCase(\n value.parts[0],\n expansionCaseParser.rootNodes,\n sourceSpan,\n value.sourceSpan,\n expSourceSpan,\n );\n }\n\n private _collectExpansionExpTokens(start: Token): Token[] | null {\n const exp: Token[] = [];\n const expansionFormStack = [TokenType.EXPANSION_CASE_EXP_START];\n\n while (true) {\n if (\n this._peek.type === TokenType.EXPANSION_FORM_START ||\n this._peek.type === TokenType.EXPANSION_CASE_EXP_START\n ) {\n expansionFormStack.push(this._peek.type);\n }\n\n if (this._peek.type === TokenType.EXPANSION_CASE_EXP_END) {\n if (lastOnStack(expansionFormStack, TokenType.EXPANSION_CASE_EXP_START)) {\n expansionFormStack.pop();\n if (expansionFormStack.length === 0) return exp;\n } else {\n this.errors.push(\n TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`),\n );\n return null;\n }\n }\n\n if (this._peek.type === TokenType.EXPANSION_FORM_END) {\n if (lastOnStack(expansionFormStack, TokenType.EXPANSION_FORM_START)) {\n expansionFormStack.pop();\n } else {\n this.errors.push(\n TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`),\n );\n return null;\n }\n }\n\n if (this._peek.type === TokenType.EOF) {\n this.errors.push(\n TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`),\n );\n return null;\n }\n\n exp.push(this._advance());\n }\n }\n\n private _consumeText(token: InterpolatedTextToken) {\n const tokens = [token];\n const startSpan = token.sourceSpan;\n let text = token.parts[0];\n if (text.length > 0 && text[0] === '\\n') {\n const parent = this._getContainer();\n\n if (\n parent != null &&\n parent.children.length === 0 &&\n this.getTagDefinition(parent.name).ignoreFirstLf\n ) {\n text = text.substring(1);\n tokens[0] = {type: token.type, sourceSpan: token.sourceSpan, parts: [text]} as typeof token;\n }\n }\n\n while (\n this._peek.type === TokenType.INTERPOLATION ||\n this._peek.type === TokenType.TEXT ||\n this._peek.type === TokenType.ENCODED_ENTITY\n ) {\n token = this._advance();\n tokens.push(token);\n if (token.type === TokenType.INTERPOLATION) {\n // For backward compatibility we decode HTML entities that appear in interpolation\n // expressions. This is arguably a bug, but it could be a considerable breaking change to\n // fix it. It should be addressed in a larger project to refactor the entire parser/lexer\n // chain after View Engine has been removed.\n text += token.parts.join('').replace(/&([^;]+);/g, decodeEntity);\n } else if (token.type === TokenType.ENCODED_ENTITY) {\n text += token.parts[0];\n } else {\n text += token.parts.join('');\n }\n }\n\n if (text.length > 0) {\n const endSpan = token.sourceSpan;\n this._addToParent(\n new html.Text(\n text,\n new ParseSourceSpan(startSpan.start, endSpan.end, startSpan.fullStart, startSpan.details),\n tokens,\n ),\n );\n }\n }\n\n private _closeVoidElement(): void {\n const el = this._getContainer();\n if (el instanceof html.Element && this.getTagDefinition(el.name).isVoid) {\n this._containerStack.pop();\n }\n }\n\n private _consumeStartTag(startTagToken: TagOpenStartToken | IncompleteTagOpenToken) {\n const [prefix, name] = startTagToken.parts;\n const attrs: html.Attribute[] = [];\n while (this._peek.type === TokenType.ATTR_NAME) {\n attrs.push(this._consumeAttr(this._advance()));\n }\n const fullName = this._getElementFullName(prefix, name, this._getClosestParentElement());\n let selfClosing = false;\n // Note: There could have been a tokenizer error\n // so that we don't get a token for the end tag...\n if (this._peek.type === TokenType.TAG_OPEN_END_VOID) {\n this._advance();\n selfClosing = true;\n const tagDef = this.getTagDefinition(fullName);\n if (!(tagDef.canSelfClose || getNsPrefix(fullName) !== null || tagDef.isVoid)) {\n this.errors.push(\n TreeError.create(\n fullName,\n startTagToken.sourceSpan,\n `Only void, custom and foreign elements can be self closed \"${startTagToken.parts[1]}\"`,\n ),\n );\n }\n } else if (this._peek.type === TokenType.TAG_OPEN_END) {\n this._advance();\n selfClosing = false;\n }\n const end = this._peek.sourceSpan.fullStart;\n const span = new ParseSourceSpan(\n startTagToken.sourceSpan.start,\n end,\n startTagToken.sourceSpan.fullStart,\n );\n // Create a separate `startSpan` because `span` will be modified when there is an `end` span.\n const startSpan = new ParseSourceSpan(\n startTagToken.sourceSpan.start,\n end,\n startTagToken.sourceSpan.fullStart,\n );\n const el = new html.Element(fullName, attrs, [], span, startSpan, undefined);\n const parentEl = this._getContainer();\n this._pushContainer(\n el,\n parentEl instanceof html.Element &&\n this.getTagDefinition(parentEl.name).isClosedByChild(el.name),\n );\n if (selfClosing) {\n // Elements that are self-closed have their `endSourceSpan` set to the full span, as the\n // element start tag also represents the end tag.\n this._popContainer(fullName, html.Element, span);\n } else if (startTagToken.type === TokenType.INCOMPLETE_TAG_OPEN) {\n // We already know the opening tag is not complete, so it is unlikely it has a corresponding\n // close tag. Let's optimistically parse it as a full element and emit an error.\n this._popContainer(fullName, html.Element, null);\n this.errors.push(\n TreeError.create(fullName, span, `Opening tag \"${fullName}\" not terminated.`),\n );\n }\n }\n\n private _pushContainer(node: NodeContainer, isClosedByChild: boolean) {\n if (isClosedByChild) {\n this._containerStack.pop();\n }\n\n this._addToParent(node);\n this._containerStack.push(node);\n }\n\n private _consumeEndTag(endTagToken: TagCloseToken) {\n const fullName = this._getElementFullName(\n endTagToken.parts[0],\n endTagToken.parts[1],\n this._getClosestParentElement(),\n );\n\n if (this.getTagDefinition(fullName).isVoid) {\n this.errors.push(\n TreeError.create(\n fullName,\n endTagToken.sourceSpan,\n `Void elements do not have end tags \"${endTagToken.parts[1]}\"`,\n ),\n );\n } else if (!this._popContainer(fullName, html.Element, endTagToken.sourceSpan)) {\n const errMsg = `Unexpected closing tag \"${fullName}\". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;\n this.errors.push(TreeError.create(fullName, endTagToken.sourceSpan, errMsg));\n }\n }\n\n /**\n * Closes the nearest element with the tag name `fullName` in the parse tree.\n * `endSourceSpan` is the span of the closing tag, or null if the element does\n * not have a closing tag (for example, this happens when an incomplete\n * opening tag is recovered).\n */\n private _popContainer(\n expectedName: string | null,\n expectedType: NodeContainerConstructor,\n endSourceSpan: ParseSourceSpan | null,\n ): boolean {\n let unexpectedCloseTagDetected = false;\n for (let stackIndex = this._containerStack.length - 1; stackIndex >= 0; stackIndex--) {\n const node = this._containerStack[stackIndex];\n\n if ((node.name === expectedName || expectedName === null) && node instanceof expectedType) {\n // Record the parse span with the element that is being closed. Any elements that are\n // removed from the element stack at this point are closed implicitly, so they won't get\n // an end source span (as there is no explicit closing element).\n node.endSourceSpan = endSourceSpan;\n node.sourceSpan.end = endSourceSpan !== null ? endSourceSpan.end : node.sourceSpan.end;\n this._containerStack.splice(stackIndex, this._containerStack.length - stackIndex);\n return !unexpectedCloseTagDetected;\n }\n\n // Blocks and most elements are not self closing.\n if (\n node instanceof html.Block ||\n (node instanceof html.Element && !this.getTagDefinition(node.name).closedByParent)\n ) {\n // Note that we encountered an unexpected close tag but continue processing the element\n // stack so we can assign an `endSourceSpan` if there is a corresponding start tag for this\n // end tag in the stack.\n unexpectedCloseTagDetected = true;\n }\n }\n return false;\n }\n\n private _consumeAttr(attrName: AttributeNameToken): html.Attribute {\n const fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);\n let attrEnd = attrName.sourceSpan.end;\n\n // Consume any quote\n if (this._peek.type === TokenType.ATTR_QUOTE) {\n this._advance();\n }\n\n // Consume the attribute value\n let value = '';\n const valueTokens: InterpolatedAttributeToken[] = [];\n let valueStartSpan: ParseSourceSpan | undefined = undefined;\n let valueEnd: ParseLocation | undefined = undefined;\n // NOTE: We need to use a new variable `nextTokenType` here to hide the actual type of\n // `_peek.type` from TS. Otherwise TS will narrow the type of `_peek.type` preventing it from\n // being able to consider `ATTR_VALUE_INTERPOLATION` as an option. This is because TS is not\n // able to see that `_advance()` will actually mutate `_peek`.\n const nextTokenType = this._peek.type as TokenType;\n if (nextTokenType === TokenType.ATTR_VALUE_TEXT) {\n valueStartSpan = this._peek.sourceSpan;\n valueEnd = this._peek.sourceSpan.end;\n while (\n this._peek.type === TokenType.ATTR_VALUE_TEXT ||\n this._peek.type === TokenType.ATTR_VALUE_INTERPOLATION ||\n this._peek.type === TokenType.ENCODED_ENTITY\n ) {\n const valueToken = this._advance();\n valueTokens.push(valueToken);\n if (valueToken.type === TokenType.ATTR_VALUE_INTERPOLATION) {\n // For backward compatibility we decode HTML entities that appear in interpolation\n // expressions. This is arguably a bug, but it could be a considerable breaking change to\n // fix it. It should be addressed in a larger project to refactor the entire parser/lexer\n // chain after View Engine has been removed.\n value += valueToken.parts.join('').replace(/&([^;]+);/g, decodeEntity);\n } else if (valueToken.type === TokenType.ENCODED_ENTITY) {\n value += valueToken.parts[0];\n } else {\n value += valueToken.parts.join('');\n }\n valueEnd = attrEnd = valueToken.sourceSpan.end;\n }\n }\n\n // Consume any quote\n if (this._peek.type === TokenType.ATTR_QUOTE) {\n const quoteToken = this._advance();\n attrEnd = quoteToken.sourceSpan.end;\n }\n\n const valueSpan =\n valueStartSpan &&\n valueEnd &&\n new ParseSourceSpan(valueStartSpan.start, valueEnd, valueStartSpan.fullStart);\n return new html.Attribute(\n fullName,\n value,\n new ParseSourceSpan(attrName.sourceSpan.start, attrEnd, attrName.sourceSpan.fullStart),\n attrName.sourceSpan,\n valueSpan,\n valueTokens.length > 0 ? valueTokens : undefined,\n undefined,\n );\n }\n\n private _consumeBlockOpen(token: BlockOpenStartToken) {\n const parameters: html.BlockParameter[] = [];\n\n while (this._peek.type === TokenType.BLOCK_PARAMETER) {\n const paramToken = this._advance();\n parameters.push(new html.BlockParameter(paramToken.parts[0], paramToken.sourceSpan));\n }\n\n if (this._peek.type === TokenType.BLOCK_OPEN_END) {\n this._advance();\n }\n\n const end = this._peek.sourceSpan.fullStart;\n const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);\n // Create a separate `startSpan` because `span` will be modified when there is an `end` span.\n const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);\n const block = new html.Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);\n this._pushContainer(block, false);\n }\n\n private _consumeBlockClose(token: BlockCloseToken) {\n if (!this._popContainer(null, html.Block, token.sourceSpan)) {\n this.errors.push(\n TreeError.create(\n null,\n token.sourceSpan,\n `Unexpected closing block. The block may have been closed earlier. ` +\n `If you meant to write the } character, you should use the \"}\" ` +\n `HTML entity instead.`,\n ),\n );\n }\n }\n\n private _consumeIncompleteBlock(token: IncompleteBlockOpenToken) {\n const parameters: html.BlockParameter[] = [];\n\n while (this._peek.type === TokenType.BLOCK_PARAMETER) {\n const paramToken = this._advance();\n parameters.push(new html.BlockParameter(paramToken.parts[0], paramToken.sourceSpan));\n }\n\n const end = this._peek.sourceSpan.fullStart;\n const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);\n // Create a separate `startSpan` because `span` will be modified when there is an `end` span.\n const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);\n const block = new html.Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);\n this._pushContainer(block, false);\n\n // Incomplete blocks don't have children so we close them immediately and report an error.\n this._popContainer(null, html.Block, null);\n\n this.errors.push(\n TreeError.create(\n token.parts[0],\n span,\n `Incomplete block \"${token.parts[0]}\". If you meant to write the @ character, ` +\n `you should use the \"@\" HTML entity instead.`,\n ),\n );\n }\n\n private _consumeLet(startToken: LetStartToken) {\n const name = startToken.parts[0];\n let valueToken: LetValueToken;\n let endToken: LetEndToken;\n\n if (this._peek.type !== TokenType.LET_VALUE) {\n this.errors.push(\n TreeError.create(\n startToken.parts[0],\n startToken.sourceSpan,\n `Invalid @let declaration \"${name}\". Declaration must have a value.`,\n ),\n );\n return;\n } else {\n valueToken = this._advance();\n }\n\n // Type cast is necessary here since TS narrowed the type of `peek` above.\n if ((this._peek as Token).type !== TokenType.LET_END) {\n this.errors.push(\n TreeError.create(\n startToken.parts[0],\n startToken.sourceSpan,\n `Unterminated @let declaration \"${name}\". Declaration must be terminated with a semicolon.`,\n ),\n );\n return;\n } else {\n endToken = this._advance();\n }\n\n const end = endToken.sourceSpan.fullStart;\n const span = new ParseSourceSpan(\n startToken.sourceSpan.start,\n end,\n startToken.sourceSpan.fullStart,\n );\n\n // The start token usually captures the `@let`. Construct a name span by\n // offsetting the start by the length of any text before the name.\n const startOffset = startToken.sourceSpan.toString().lastIndexOf(name);\n const nameStart = startToken.sourceSpan.start.moveBy(startOffset);\n const nameSpan = new ParseSourceSpan(nameStart, startToken.sourceSpan.end);\n const node = new html.LetDeclaration(\n name,\n valueToken.parts[0],\n span,\n nameSpan,\n valueToken.sourceSpan,\n );\n\n this._addToParent(node);\n }\n\n private _consumeIncompleteLet(token: IncompleteLetToken) {\n // Incomplete `@let` declaration may end up with an empty name.\n const name = token.parts[0] ?? '';\n const nameString = name ? ` \"${name}\"` : '';\n\n // If there's at least a name, we can salvage an AST node that can be used for completions.\n if (name.length > 0) {\n const startOffset = token.sourceSpan.toString().lastIndexOf(name);\n const nameStart = token.sourceSpan.start.moveBy(startOffset);\n const nameSpan = new ParseSourceSpan(nameStart, token.sourceSpan.end);\n const valueSpan = new ParseSourceSpan(\n token.sourceSpan.start,\n token.sourceSpan.start.moveBy(0),\n );\n const node = new html.LetDeclaration(name, '', token.sourceSpan, nameSpan, valueSpan);\n this._addToParent(node);\n }\n\n this.errors.push(\n TreeError.create(\n token.parts[0],\n token.sourceSpan,\n `Incomplete @let declaration${nameString}. ` +\n `@let declarations must be written as \\`@let = ;\\``,\n ),\n );\n }\n\n private _getContainer(): NodeContainer | null {\n return this._containerStack.length > 0\n ? this._containerStack[this._containerStack.length - 1]\n : null;\n }\n\n private _getClosestParentElement(): html.Element | null {\n for (let i = this._containerStack.length - 1; i > -1; i--) {\n if (this._containerStack[i] instanceof html.Element) {\n return this._containerStack[i] as html.Element;\n }\n }\n\n return null;\n }\n\n private _addToParent(node: html.Node) {\n const parent = this._getContainer();\n\n if (parent === null) {\n this.rootNodes.push(node);\n } else {\n parent.children.push(node);\n }\n }\n\n private _getElementFullName(\n prefix: string,\n localName: string,\n parentElement: html.Element | null,\n ): string {\n if (prefix === '') {\n prefix = this.getTagDefinition(localName).implicitNamespacePrefix || '';\n if (prefix === '' && parentElement != null) {\n const parentTagName = splitNsName(parentElement.name)[1];\n const parentTagDefinition = this.getTagDefinition(parentTagName);\n if (!parentTagDefinition.preventNamespaceInheritance) {\n prefix = getNsPrefix(parentElement.name);\n }\n }\n }\n\n return mergeNsAndName(prefix, localName);\n }\n}\n\nfunction lastOnStack(stack: any[], element: any): boolean {\n return stack.length > 0 && stack[stack.length - 1] === element;\n}\n\n/**\n * Decode the `entity` string, which we believe is the contents of an HTML entity.\n *\n * If the string is not actually a valid/known entity then just return the original `match` string.\n */\nfunction decodeEntity(match: string, entity: string): string {\n if (NAMED_ENTITIES[entity] !== undefined) {\n return NAMED_ENTITIES[entity] || match;\n }\n if (/^#x[a-f0-9]+$/i.test(entity)) {\n return String.fromCodePoint(parseInt(entity.slice(2), 16));\n }\n if (/^#\\d+$/.test(entity)) {\n return String.fromCodePoint(parseInt(entity.slice(1), 10));\n }\n return match;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as html from './ast';\nimport {NGSP_UNICODE} from './entities';\nimport {ParseTreeResult} from './parser';\nimport {InterpolatedTextToken, TextToken, TokenType} from './tokens';\n\nexport const PRESERVE_WS_ATTR_NAME = 'ngPreserveWhitespaces';\n\nconst SKIP_WS_TRIM_TAGS = new Set(['pre', 'template', 'textarea', 'script', 'style']);\n\n// Equivalent to \\s with \\u00a0 (non-breaking space) excluded.\n// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\nconst WS_CHARS = ' \\f\\n\\r\\t\\v\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff';\nconst NO_WS_REGEXP = new RegExp(`[^${WS_CHARS}]`);\nconst WS_REPLACE_REGEXP = new RegExp(`[${WS_CHARS}]{2,}`, 'g');\n\nfunction hasPreserveWhitespacesAttr(attrs: html.Attribute[]): boolean {\n return attrs.some((attr: html.Attribute) => attr.name === PRESERVE_WS_ATTR_NAME);\n}\n\n/**\n * &ngsp; is a placeholder for non-removable space\n * &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character\n * and later on replaced by a space.\n */\nexport function replaceNgsp(value: string): string {\n // lexer is replacing the &ngsp; pseudo-entity with NGSP_UNICODE\n return value.replace(new RegExp(NGSP_UNICODE, 'g'), ' ');\n}\n\n/**\n * This visitor can walk HTML parse tree and remove / trim text nodes using the following rules:\n * - consider spaces, tabs and new lines as whitespace characters;\n * - drop text nodes consisting of whitespace characters only;\n * - for all other text nodes replace consecutive whitespace characters with one space;\n * - convert &ngsp; pseudo-entity to a single space;\n *\n * Removal and trimming of whitespaces have positive performance impact (less code to generate\n * while compiling templates, faster view creation). At the same time it can be \"destructive\"\n * in some cases (whitespaces can influence layout). Because of the potential of breaking layout\n * this visitor is not activated by default in Angular 5 and people need to explicitly opt-in for\n * whitespace removal. The default option for whitespace removal will be revisited in Angular 6\n * and might be changed to \"on\" by default.\n *\n * If `originalNodeMap` is provided, the transformed nodes will be mapped back to their original\n * inputs. Any output nodes not in the map were not transformed. This supports correlating and\n * porting information between the trimmed nodes and original nodes (such as `i18n` properties)\n * such that trimming whitespace does not does not drop required information from the node.\n */\nexport class WhitespaceVisitor implements html.Visitor {\n // How many ICU expansions which are currently being visited. ICUs can be nested, so this\n // tracks the current depth of nesting. If this depth is greater than 0, then this visitor is\n // currently processing content inside an ICU expansion.\n private icuExpansionDepth = 0;\n\n constructor(\n private readonly preserveSignificantWhitespace: boolean,\n private readonly originalNodeMap?: Map,\n private readonly requireContext = true,\n ) {}\n\n visitElement(element: html.Element, context: any): any {\n if (SKIP_WS_TRIM_TAGS.has(element.name) || hasPreserveWhitespacesAttr(element.attrs)) {\n // don't descent into elements where we need to preserve whitespaces\n // but still visit all attributes to eliminate one used as a market to preserve WS\n const newElement = new html.Element(\n element.name,\n visitAllWithSiblings(this, element.attrs),\n element.children,\n element.sourceSpan,\n element.startSourceSpan,\n element.endSourceSpan,\n element.i18n,\n );\n this.originalNodeMap?.set(newElement, element);\n return newElement;\n }\n\n const newElement = new html.Element(\n element.name,\n element.attrs,\n visitAllWithSiblings(this, element.children),\n element.sourceSpan,\n element.startSourceSpan,\n element.endSourceSpan,\n element.i18n,\n );\n this.originalNodeMap?.set(newElement, element);\n return newElement;\n }\n\n visitAttribute(attribute: html.Attribute, context: any): any {\n return attribute.name !== PRESERVE_WS_ATTR_NAME ? attribute : null;\n }\n\n visitText(text: html.Text, context: SiblingVisitorContext | null): any {\n const isNotBlank = text.value.match(NO_WS_REGEXP);\n const hasExpansionSibling =\n context && (context.prev instanceof html.Expansion || context.next instanceof html.Expansion);\n\n // Do not trim whitespace within ICU expansions when preserving significant whitespace.\n // Historically, ICU whitespace was never trimmed and this is really a bug. However fixing it\n // would change message IDs which we can't easily do. Instead we only trim ICU whitespace within\n // ICU expansions when not preserving significant whitespace, which is the new behavior where it\n // most matters.\n const inIcuExpansion = this.icuExpansionDepth > 0;\n if (inIcuExpansion && this.preserveSignificantWhitespace) return text;\n\n if (isNotBlank || hasExpansionSibling) {\n // Process the whitespace in the tokens of this Text node\n const tokens = text.tokens.map((token) =>\n token.type === TokenType.TEXT ? createWhitespaceProcessedTextToken(token) : token,\n );\n\n // Fully trim message when significant whitespace is not preserved.\n if (!this.preserveSignificantWhitespace && tokens.length > 0) {\n // The first token should only call `.trimStart()` and the last token\n // should only call `.trimEnd()`, but there might be only one token which\n // needs to call both.\n const firstToken = tokens[0]!;\n tokens.splice(0, 1, trimLeadingWhitespace(firstToken, context));\n\n const lastToken = tokens[tokens.length - 1]; // Could be the same as the first token.\n tokens.splice(tokens.length - 1, 1, trimTrailingWhitespace(lastToken, context));\n }\n\n // Process the whitespace of the value of this Text node. Also trim the leading/trailing\n // whitespace when we don't need to preserve significant whitespace.\n const processed = processWhitespace(text.value);\n const value = this.preserveSignificantWhitespace\n ? processed\n : trimLeadingAndTrailingWhitespace(processed, context);\n const result = new html.Text(value, text.sourceSpan, tokens, text.i18n);\n this.originalNodeMap?.set(result, text);\n return result;\n }\n\n return null;\n }\n\n visitComment(comment: html.Comment, context: any): any {\n return comment;\n }\n\n visitExpansion(expansion: html.Expansion, context: any): any {\n this.icuExpansionDepth++;\n let newExpansion: html.Expansion;\n try {\n newExpansion = new html.Expansion(\n expansion.switchValue,\n expansion.type,\n visitAllWithSiblings(this, expansion.cases),\n expansion.sourceSpan,\n expansion.switchValueSourceSpan,\n expansion.i18n,\n );\n } finally {\n this.icuExpansionDepth--;\n }\n\n this.originalNodeMap?.set(newExpansion, expansion);\n\n return newExpansion;\n }\n\n visitExpansionCase(expansionCase: html.ExpansionCase, context: any): any {\n const newExpansionCase = new html.ExpansionCase(\n expansionCase.value,\n visitAllWithSiblings(this, expansionCase.expression),\n expansionCase.sourceSpan,\n expansionCase.valueSourceSpan,\n expansionCase.expSourceSpan,\n );\n this.originalNodeMap?.set(newExpansionCase, expansionCase);\n return newExpansionCase;\n }\n\n visitBlock(block: html.Block, context: any): any {\n const newBlock = new html.Block(\n block.name,\n block.parameters,\n visitAllWithSiblings(this, block.children),\n block.sourceSpan,\n block.nameSpan,\n block.startSourceSpan,\n block.endSourceSpan,\n );\n this.originalNodeMap?.set(newBlock, block);\n return newBlock;\n }\n\n visitBlockParameter(parameter: html.BlockParameter, context: any) {\n return parameter;\n }\n\n visitLetDeclaration(decl: html.LetDeclaration, context: any) {\n return decl;\n }\n\n visit(_node: html.Node, context: any) {\n // `visitAllWithSiblings` provides context necessary for ICU messages to be handled correctly.\n // Prefer that over calling `html.visitAll` directly on this visitor.\n if (this.requireContext && !context) {\n throw new Error(\n `WhitespaceVisitor requires context. Visit via \\`visitAllWithSiblings\\` to get this context.`,\n );\n }\n\n return false;\n }\n}\n\nfunction trimLeadingWhitespace(\n token: InterpolatedTextToken,\n context: SiblingVisitorContext | null,\n): InterpolatedTextToken {\n if (token.type !== TokenType.TEXT) return token;\n\n const isFirstTokenInTag = !context?.prev;\n if (!isFirstTokenInTag) return token;\n\n return transformTextToken(token, (text) => text.trimStart());\n}\n\nfunction trimTrailingWhitespace(\n token: InterpolatedTextToken,\n context: SiblingVisitorContext | null,\n): InterpolatedTextToken {\n if (token.type !== TokenType.TEXT) return token;\n\n const isLastTokenInTag = !context?.next;\n if (!isLastTokenInTag) return token;\n\n return transformTextToken(token, (text) => text.trimEnd());\n}\n\nfunction trimLeadingAndTrailingWhitespace(\n text: string,\n context: SiblingVisitorContext | null,\n): string {\n const isFirstTokenInTag = !context?.prev;\n const isLastTokenInTag = !context?.next;\n\n const maybeTrimmedStart = isFirstTokenInTag ? text.trimStart() : text;\n const maybeTrimmed = isLastTokenInTag ? maybeTrimmedStart.trimEnd() : maybeTrimmedStart;\n return maybeTrimmed;\n}\n\nfunction createWhitespaceProcessedTextToken({type, parts, sourceSpan}: TextToken): TextToken {\n return {type, parts: [processWhitespace(parts[0])], sourceSpan};\n}\n\nfunction transformTextToken(\n {type, parts, sourceSpan}: TextToken,\n transform: (parts: string) => string,\n): TextToken {\n // `TextToken` only ever has one part as defined in its type, so we just transform the first element.\n return {type, parts: [transform(parts[0])], sourceSpan};\n}\n\nfunction processWhitespace(text: string): string {\n return replaceNgsp(text).replace(WS_REPLACE_REGEXP, ' ');\n}\n\nexport function removeWhitespaces(\n htmlAstWithErrors: ParseTreeResult,\n preserveSignificantWhitespace: boolean,\n): ParseTreeResult {\n return new ParseTreeResult(\n visitAllWithSiblings(\n new WhitespaceVisitor(preserveSignificantWhitespace),\n htmlAstWithErrors.rootNodes,\n ),\n htmlAstWithErrors.errors,\n );\n}\n\ninterface SiblingVisitorContext {\n prev: html.Node | undefined;\n next: html.Node | undefined;\n}\n\nexport function visitAllWithSiblings(visitor: WhitespaceVisitor, nodes: html.Node[]): any[] {\n const result: any[] = [];\n\n nodes.forEach((ast, i) => {\n const context: SiblingVisitorContext = {prev: nodes[i - 1], next: nodes[i + 1]};\n const astResult = ast.visit(visitor, context);\n if (astResult) {\n result.push(astResult);\n }\n });\n return result;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as chars from '../chars';\n\nexport enum TokenType {\n Character,\n Identifier,\n PrivateIdentifier,\n Keyword,\n String,\n Operator,\n Number,\n Error,\n}\n\nexport enum StringTokenKind {\n Plain,\n TemplateLiteralPart,\n TemplateLiteralEnd,\n}\n\nconst KEYWORDS = [\n 'var',\n 'let',\n 'as',\n 'null',\n 'undefined',\n 'true',\n 'false',\n 'if',\n 'else',\n 'this',\n 'typeof',\n];\n\nexport class Lexer {\n tokenize(text: string): Token[] {\n return new _Scanner(text).scan();\n }\n}\n\nexport class Token {\n constructor(\n public index: number,\n public end: number,\n public type: TokenType,\n public numValue: number,\n public strValue: string,\n ) {}\n\n isCharacter(code: number): boolean {\n return this.type === TokenType.Character && this.numValue === code;\n }\n\n isNumber(): boolean {\n return this.type === TokenType.Number;\n }\n\n isString(): this is StringToken {\n return this.type === TokenType.String;\n }\n\n isOperator(operator: string): boolean {\n return this.type === TokenType.Operator && this.strValue === operator;\n }\n\n isIdentifier(): boolean {\n return this.type === TokenType.Identifier;\n }\n\n isPrivateIdentifier(): boolean {\n return this.type === TokenType.PrivateIdentifier;\n }\n\n isKeyword(): boolean {\n return this.type === TokenType.Keyword;\n }\n\n isKeywordLet(): boolean {\n return this.type === TokenType.Keyword && this.strValue === 'let';\n }\n\n isKeywordAs(): boolean {\n return this.type === TokenType.Keyword && this.strValue === 'as';\n }\n\n isKeywordNull(): boolean {\n return this.type === TokenType.Keyword && this.strValue === 'null';\n }\n\n isKeywordUndefined(): boolean {\n return this.type === TokenType.Keyword && this.strValue === 'undefined';\n }\n\n isKeywordTrue(): boolean {\n return this.type === TokenType.Keyword && this.strValue === 'true';\n }\n\n isKeywordFalse(): boolean {\n return this.type === TokenType.Keyword && this.strValue === 'false';\n }\n\n isKeywordThis(): boolean {\n return this.type === TokenType.Keyword && this.strValue === 'this';\n }\n\n isKeywordTypeof(): boolean {\n return this.type === TokenType.Keyword && this.strValue === 'typeof';\n }\n\n isError(): boolean {\n return this.type === TokenType.Error;\n }\n\n toNumber(): number {\n return this.type === TokenType.Number ? this.numValue : -1;\n }\n\n isTemplateLiteralPart(): this is StringToken {\n return this.isString() && this.kind === StringTokenKind.TemplateLiteralPart;\n }\n\n isTemplateLiteralEnd(): this is StringToken {\n return this.isString() && this.kind === StringTokenKind.TemplateLiteralEnd;\n }\n\n isTemplateLiteralInterpolationStart(): boolean {\n return this.isOperator('${');\n }\n\n isTemplateLiteralInterpolationEnd(): boolean {\n return this.isOperator('}');\n }\n\n toString(): string | null {\n switch (this.type) {\n case TokenType.Character:\n case TokenType.Identifier:\n case TokenType.Keyword:\n case TokenType.Operator:\n case TokenType.PrivateIdentifier:\n case TokenType.String:\n case TokenType.Error:\n return this.strValue;\n case TokenType.Number:\n return this.numValue.toString();\n default:\n return null;\n }\n }\n}\n\nexport class StringToken extends Token {\n constructor(\n index: number,\n end: number,\n strValue: string,\n readonly kind: StringTokenKind,\n ) {\n super(index, end, TokenType.String, 0, strValue);\n }\n}\n\nfunction newCharacterToken(index: number, end: number, code: number): Token {\n return new Token(index, end, TokenType.Character, code, String.fromCharCode(code));\n}\n\nfunction newIdentifierToken(index: number, end: number, text: string): Token {\n return new Token(index, end, TokenType.Identifier, 0, text);\n}\n\nfunction newPrivateIdentifierToken(index: number, end: number, text: string): Token {\n return new Token(index, end, TokenType.PrivateIdentifier, 0, text);\n}\n\nfunction newKeywordToken(index: number, end: number, text: string): Token {\n return new Token(index, end, TokenType.Keyword, 0, text);\n}\n\nfunction newOperatorToken(index: number, end: number, text: string): Token {\n return new Token(index, end, TokenType.Operator, 0, text);\n}\n\nfunction newNumberToken(index: number, end: number, n: number): Token {\n return new Token(index, end, TokenType.Number, n, '');\n}\n\nfunction newErrorToken(index: number, end: number, message: string): Token {\n return new Token(index, end, TokenType.Error, 0, message);\n}\n\nexport const EOF: Token = new Token(-1, -1, TokenType.Character, 0, '');\n\nclass _Scanner {\n private readonly tokens: Token[] = [];\n private readonly length: number;\n private peek = 0;\n private index = -1;\n private braceStack: ('interpolation' | 'expression')[] = [];\n\n constructor(private readonly input: string) {\n this.length = input.length;\n this.advance();\n }\n\n scan(): Token[] {\n let token = this.scanToken();\n\n while (token !== null) {\n this.tokens.push(token);\n token = this.scanToken();\n }\n\n return this.tokens;\n }\n\n private advance() {\n this.peek = ++this.index >= this.length ? chars.$EOF : this.input.charCodeAt(this.index);\n }\n\n private scanToken(): Token | null {\n const input = this.input;\n const length = this.length;\n let peek = this.peek;\n let index = this.index;\n\n // Skip whitespace.\n while (peek <= chars.$SPACE) {\n if (++index >= length) {\n peek = chars.$EOF;\n break;\n } else {\n peek = input.charCodeAt(index);\n }\n }\n\n this.peek = peek;\n this.index = index;\n\n if (index >= length) {\n return null;\n }\n\n // Handle identifiers and numbers.\n if (isIdentifierStart(peek)) {\n return this.scanIdentifier();\n }\n\n if (chars.isDigit(peek)) {\n return this.scanNumber(index);\n }\n\n const start: number = index;\n switch (peek) {\n case chars.$PERIOD:\n this.advance();\n return chars.isDigit(this.peek)\n ? this.scanNumber(start)\n : newCharacterToken(start, this.index, chars.$PERIOD);\n case chars.$LPAREN:\n case chars.$RPAREN:\n case chars.$LBRACKET:\n case chars.$RBRACKET:\n case chars.$COMMA:\n case chars.$COLON:\n case chars.$SEMICOLON:\n return this.scanCharacter(start, peek);\n case chars.$LBRACE:\n return this.scanOpenBrace(start, peek);\n case chars.$RBRACE:\n return this.scanCloseBrace(start, peek);\n case chars.$SQ:\n case chars.$DQ:\n return this.scanString();\n case chars.$BT:\n this.advance();\n return this.scanTemplateLiteralPart(start);\n case chars.$HASH:\n return this.scanPrivateIdentifier();\n case chars.$PLUS:\n case chars.$MINUS:\n case chars.$STAR:\n case chars.$SLASH:\n case chars.$PERCENT:\n case chars.$CARET:\n return this.scanOperator(start, String.fromCharCode(peek));\n case chars.$QUESTION:\n return this.scanQuestion(start);\n case chars.$LT:\n case chars.$GT:\n return this.scanComplexOperator(start, String.fromCharCode(peek), chars.$EQ, '=');\n case chars.$BANG:\n case chars.$EQ:\n return this.scanComplexOperator(\n start,\n String.fromCharCode(peek),\n chars.$EQ,\n '=',\n chars.$EQ,\n '=',\n );\n case chars.$AMPERSAND:\n return this.scanComplexOperator(start, '&', chars.$AMPERSAND, '&');\n case chars.$BAR:\n return this.scanComplexOperator(start, '|', chars.$BAR, '|');\n case chars.$NBSP:\n while (chars.isWhitespace(this.peek)) this.advance();\n return this.scanToken();\n }\n\n this.advance();\n return this.error(`Unexpected character [${String.fromCharCode(peek)}]`, 0);\n }\n\n private scanCharacter(start: number, code: number): Token {\n this.advance();\n return newCharacterToken(start, this.index, code);\n }\n\n private scanOperator(start: number, str: string): Token {\n this.advance();\n return newOperatorToken(start, this.index, str);\n }\n\n private scanOpenBrace(start: number, code: number): Token {\n this.braceStack.push('expression');\n this.advance();\n return newCharacterToken(start, this.index, code);\n }\n\n private scanCloseBrace(start: number, code: number): Token {\n this.advance();\n\n const currentBrace = this.braceStack.pop();\n if (currentBrace === 'interpolation') {\n this.tokens.push(newOperatorToken(start, this.index, '}'));\n return this.scanTemplateLiteralPart(this.index);\n }\n\n return newCharacterToken(start, this.index, code);\n }\n\n /**\n * Tokenize a 2/3 char long operator\n *\n * @param start start index in the expression\n * @param one first symbol (always part of the operator)\n * @param twoCode code point for the second symbol\n * @param two second symbol (part of the operator when the second code point matches)\n * @param threeCode code point for the third symbol\n * @param three third symbol (part of the operator when provided and matches source expression)\n */\n private scanComplexOperator(\n start: number,\n one: string,\n twoCode: number,\n two: string,\n threeCode?: number,\n three?: string,\n ): Token {\n this.advance();\n let str: string = one;\n if (this.peek == twoCode) {\n this.advance();\n str += two;\n }\n if (threeCode != null && this.peek == threeCode) {\n this.advance();\n str += three;\n }\n return newOperatorToken(start, this.index, str);\n }\n\n private scanIdentifier(): Token {\n const start: number = this.index;\n this.advance();\n while (isIdentifierPart(this.peek)) this.advance();\n const str: string = this.input.substring(start, this.index);\n return KEYWORDS.indexOf(str) > -1\n ? newKeywordToken(start, this.index, str)\n : newIdentifierToken(start, this.index, str);\n }\n\n /** Scans an ECMAScript private identifier. */\n private scanPrivateIdentifier(): Token {\n const start: number = this.index;\n this.advance();\n if (!isIdentifierStart(this.peek)) {\n return this.error('Invalid character [#]', -1);\n }\n while (isIdentifierPart(this.peek)) this.advance();\n const identifierName: string = this.input.substring(start, this.index);\n return newPrivateIdentifierToken(start, this.index, identifierName);\n }\n\n private scanNumber(start: number): Token {\n let simple = this.index === start;\n let hasSeparators = false;\n this.advance(); // Skip initial digit.\n while (true) {\n if (chars.isDigit(this.peek)) {\n // Do nothing.\n } else if (this.peek === chars.$_) {\n // Separators are only valid when they're surrounded by digits. E.g. `1_0_1` is\n // valid while `_101` and `101_` are not. The separator can't be next to the decimal\n // point or another separator either. Note that it's unlikely that we'll hit a case where\n // the underscore is at the start, because that's a valid identifier and it will be picked\n // up earlier in the parsing. We validate for it anyway just in case.\n if (\n !chars.isDigit(this.input.charCodeAt(this.index - 1)) ||\n !chars.isDigit(this.input.charCodeAt(this.index + 1))\n ) {\n return this.error('Invalid numeric separator', 0);\n }\n hasSeparators = true;\n } else if (this.peek === chars.$PERIOD) {\n simple = false;\n } else if (isExponentStart(this.peek)) {\n this.advance();\n if (isExponentSign(this.peek)) this.advance();\n if (!chars.isDigit(this.peek)) return this.error('Invalid exponent', -1);\n simple = false;\n } else {\n break;\n }\n this.advance();\n }\n\n let str = this.input.substring(start, this.index);\n if (hasSeparators) {\n str = str.replace(/_/g, '');\n }\n const value = simple ? parseIntAutoRadix(str) : parseFloat(str);\n return newNumberToken(start, this.index, value);\n }\n\n private scanString(): Token {\n const start = this.index;\n const quote = this.peek;\n this.advance(); // Skip initial quote.\n\n let buffer = '';\n let marker = this.index;\n const input = this.input;\n\n while (this.peek != quote) {\n if (this.peek == chars.$BACKSLASH) {\n const result = this.scanStringBackslash(buffer, marker);\n if (typeof result !== 'string') {\n return result; // Error\n }\n buffer = result;\n marker = this.index;\n } else if (this.peek == chars.$EOF) {\n return this.error('Unterminated quote', 0);\n } else {\n this.advance();\n }\n }\n\n const last: string = input.substring(marker, this.index);\n this.advance(); // Skip terminating quote.\n\n return new StringToken(start, this.index, buffer + last, StringTokenKind.Plain);\n }\n\n private scanQuestion(start: number): Token {\n this.advance();\n let str: string = '?';\n // Either `a ?? b` or 'a?.b'.\n if (this.peek === chars.$QUESTION || this.peek === chars.$PERIOD) {\n str += this.peek === chars.$PERIOD ? '.' : '?';\n this.advance();\n }\n return newOperatorToken(start, this.index, str);\n }\n\n private scanTemplateLiteralPart(start: number): Token {\n let buffer = '';\n let marker = this.index;\n\n while (this.peek !== chars.$BT) {\n if (this.peek === chars.$BACKSLASH) {\n const result = this.scanStringBackslash(buffer, marker);\n if (typeof result !== 'string') {\n return result; // Error\n }\n buffer = result;\n marker = this.index;\n } else if (this.peek === chars.$$) {\n const dollar = this.index;\n this.advance();\n\n // @ts-expect-error\n if (this.peek === chars.$LBRACE) {\n this.braceStack.push('interpolation');\n this.tokens.push(\n new StringToken(\n start,\n dollar,\n buffer + this.input.substring(marker, dollar),\n StringTokenKind.TemplateLiteralPart,\n ),\n );\n this.advance();\n return newOperatorToken(dollar, this.index, this.input.substring(dollar, this.index));\n }\n } else if (this.peek === chars.$EOF) {\n return this.error('Unterminated template literal', 0);\n } else {\n this.advance();\n }\n }\n\n const last = this.input.substring(marker, this.index);\n this.advance();\n return new StringToken(start, this.index, buffer + last, StringTokenKind.TemplateLiteralEnd);\n }\n\n private error(message: string, offset: number): Token & {type: TokenType.Error} {\n const position: number = this.index + offset;\n return newErrorToken(\n position,\n this.index,\n `Lexer Error: ${message} at column ${position} in expression [${this.input}]`,\n ) as Token & {type: TokenType.Error};\n }\n\n private scanStringBackslash(\n buffer: string,\n marker: number,\n ): string | (Token & {type: TokenType.Error}) {\n buffer += this.input.substring(marker, this.index);\n let unescapedCode: number;\n this.advance();\n if (this.peek === chars.$u) {\n // 4 character hex code for unicode character.\n const hex: string = this.input.substring(this.index + 1, this.index + 5);\n if (/^[0-9a-f]+$/i.test(hex)) {\n unescapedCode = parseInt(hex, 16);\n } else {\n return this.error(`Invalid unicode escape [\\\\u${hex}]`, 0);\n }\n for (let i = 0; i < 5; i++) {\n this.advance();\n }\n } else {\n unescapedCode = unescape(this.peek);\n this.advance();\n }\n buffer += String.fromCharCode(unescapedCode);\n return buffer;\n }\n}\n\nfunction isIdentifierStart(code: number): boolean {\n return (\n (chars.$a <= code && code <= chars.$z) ||\n (chars.$A <= code && code <= chars.$Z) ||\n code == chars.$_ ||\n code == chars.$$\n );\n}\n\nfunction isIdentifierPart(code: number): boolean {\n return chars.isAsciiLetter(code) || chars.isDigit(code) || code == chars.$_ || code == chars.$$;\n}\n\nfunction isExponentStart(code: number): boolean {\n return code == chars.$e || code == chars.$E;\n}\n\nfunction isExponentSign(code: number): boolean {\n return code == chars.$MINUS || code == chars.$PLUS;\n}\n\nfunction unescape(code: number): number {\n switch (code) {\n case chars.$n:\n return chars.$LF;\n case chars.$f:\n return chars.$FF;\n case chars.$r:\n return chars.$CR;\n case chars.$t:\n return chars.$TAB;\n case chars.$v:\n return chars.$VTAB;\n default:\n return code;\n }\n}\n\nfunction parseIntAutoRadix(text: string): number {\n const result: number = parseInt(text);\n if (isNaN(result)) {\n throw new Error('Invalid integer literal when parsing ' + text);\n }\n return result;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as chars from '../chars';\nimport {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../ml_parser/defaults';\nimport {\n InterpolatedAttributeToken,\n InterpolatedTextToken,\n TokenType as MlParserTokenType,\n} from '../ml_parser/tokens';\n\nimport {\n AbsoluteSourceSpan,\n AST,\n ASTWithSource,\n Binary,\n BindingPipe,\n Call,\n Chain,\n Conditional,\n EmptyExpr,\n ExpressionBinding,\n ImplicitReceiver,\n Interpolation,\n KeyedRead,\n KeyedWrite,\n LiteralArray,\n LiteralMap,\n LiteralMapKey,\n LiteralPrimitive,\n NonNullAssert,\n ParserError,\n ParseSpan,\n PrefixNot,\n TypeofExpression,\n PropertyRead,\n PropertyWrite,\n RecursiveAstVisitor,\n SafeCall,\n SafeKeyedRead,\n SafePropertyRead,\n TemplateBinding,\n TemplateBindingIdentifier,\n ThisReceiver,\n Unary,\n VariableBinding,\n TemplateLiteral,\n TemplateLiteralElement,\n} from './ast';\nimport {EOF, Lexer, StringTokenKind, Token, TokenType} from './lexer';\n\nexport interface InterpolationPiece {\n text: string;\n start: number;\n end: number;\n}\nexport class SplitInterpolation {\n constructor(\n public strings: InterpolationPiece[],\n public expressions: InterpolationPiece[],\n public offsets: number[],\n ) {}\n}\n\nexport class TemplateBindingParseResult {\n constructor(\n public templateBindings: TemplateBinding[],\n public warnings: string[],\n public errors: ParserError[],\n ) {}\n}\n\n/**\n * Represents the possible parse modes to be used as a bitmask.\n */\nexport const enum ParseFlags {\n None = 0,\n\n /**\n * Whether an output binding is being parsed.\n */\n Action = 1 << 0,\n}\n\nexport class Parser {\n private errors: ParserError[] = [];\n\n constructor(private _lexer: Lexer) {}\n\n parseAction(\n input: string,\n location: string,\n absoluteOffset: number,\n interpolationConfig: InterpolationConfig = DEFAULT_INTERPOLATION_CONFIG,\n ): ASTWithSource {\n this._checkNoInterpolation(input, location, interpolationConfig);\n const sourceToLex = this._stripComments(input);\n const tokens = this._lexer.tokenize(sourceToLex);\n const ast = new _ParseAST(\n input,\n location,\n absoluteOffset,\n tokens,\n ParseFlags.Action,\n this.errors,\n 0,\n ).parseChain();\n\n return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);\n }\n\n parseBinding(\n input: string,\n location: string,\n absoluteOffset: number,\n interpolationConfig: InterpolationConfig = DEFAULT_INTERPOLATION_CONFIG,\n ): ASTWithSource {\n const ast = this._parseBindingAst(input, location, absoluteOffset, interpolationConfig);\n return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);\n }\n\n private checkSimpleExpression(ast: AST): string[] {\n const checker = new SimpleExpressionChecker();\n ast.visit(checker);\n return checker.errors;\n }\n\n // Host bindings parsed here\n parseSimpleBinding(\n input: string,\n location: string,\n absoluteOffset: number,\n interpolationConfig: InterpolationConfig = DEFAULT_INTERPOLATION_CONFIG,\n ): ASTWithSource {\n const ast = this._parseBindingAst(input, location, absoluteOffset, interpolationConfig);\n const errors = this.checkSimpleExpression(ast);\n if (errors.length > 0) {\n this._reportError(\n `Host binding expression cannot contain ${errors.join(' ')}`,\n input,\n location,\n );\n }\n return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);\n }\n\n private _reportError(message: string, input: string, errLocation: string, ctxLocation?: string) {\n this.errors.push(new ParserError(message, input, errLocation, ctxLocation));\n }\n\n private _parseBindingAst(\n input: string,\n location: string,\n absoluteOffset: number,\n interpolationConfig: InterpolationConfig,\n ): AST {\n this._checkNoInterpolation(input, location, interpolationConfig);\n const sourceToLex = this._stripComments(input);\n const tokens = this._lexer.tokenize(sourceToLex);\n return new _ParseAST(\n input,\n location,\n absoluteOffset,\n tokens,\n ParseFlags.None,\n this.errors,\n 0,\n ).parseChain();\n }\n\n /**\n * Parse microsyntax template expression and return a list of bindings or\n * parsing errors in case the given expression is invalid.\n *\n * For example,\n * ```html\n *
\n * ^ ^ absoluteValueOffset for `templateValue`\n * absoluteKeyOffset for `templateKey`\n * ```\n * contains three bindings:\n * 1. ngFor -> null\n * 2. item -> NgForOfContext.$implicit\n * 3. ngForOf -> items\n *\n * This is apparent from the de-sugared template:\n * ```html\n * \n * ```\n *\n * @param templateKey name of directive, without the * prefix. For example: ngIf, ngFor\n * @param templateValue RHS of the microsyntax attribute\n * @param templateUrl template filename if it's external, component filename if it's inline\n * @param absoluteKeyOffset start of the `templateKey`\n * @param absoluteValueOffset start of the `templateValue`\n */\n parseTemplateBindings(\n templateKey: string,\n templateValue: string,\n templateUrl: string,\n absoluteKeyOffset: number,\n absoluteValueOffset: number,\n ): TemplateBindingParseResult {\n const tokens = this._lexer.tokenize(templateValue);\n const parser = new _ParseAST(\n templateValue,\n templateUrl,\n absoluteValueOffset,\n tokens,\n ParseFlags.None,\n this.errors,\n 0 /* relative offset */,\n );\n return parser.parseTemplateBindings({\n source: templateKey,\n span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),\n });\n }\n\n parseInterpolation(\n input: string,\n location: string,\n absoluteOffset: number,\n interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null,\n interpolationConfig: InterpolationConfig = DEFAULT_INTERPOLATION_CONFIG,\n ): ASTWithSource | null {\n const {strings, expressions, offsets} = this.splitInterpolation(\n input,\n location,\n interpolatedTokens,\n interpolationConfig,\n );\n if (expressions.length === 0) return null;\n\n const expressionNodes: AST[] = [];\n\n for (let i = 0; i < expressions.length; ++i) {\n const expressionText = expressions[i].text;\n const sourceToLex = this._stripComments(expressionText);\n const tokens = this._lexer.tokenize(sourceToLex);\n const ast = new _ParseAST(\n input,\n location,\n absoluteOffset,\n tokens,\n ParseFlags.None,\n this.errors,\n offsets[i],\n ).parseChain();\n expressionNodes.push(ast);\n }\n\n return this.createInterpolationAst(\n strings.map((s) => s.text),\n expressionNodes,\n input,\n location,\n absoluteOffset,\n );\n }\n\n /**\n * Similar to `parseInterpolation`, but treats the provided string as a single expression\n * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).\n * This is used for parsing the switch expression in ICUs.\n */\n parseInterpolationExpression(\n expression: string,\n location: string,\n absoluteOffset: number,\n ): ASTWithSource {\n const sourceToLex = this._stripComments(expression);\n const tokens = this._lexer.tokenize(sourceToLex);\n const ast = new _ParseAST(\n expression,\n location,\n absoluteOffset,\n tokens,\n ParseFlags.None,\n this.errors,\n 0,\n ).parseChain();\n const strings = ['', '']; // The prefix and suffix strings are both empty\n return this.createInterpolationAst(strings, [ast], expression, location, absoluteOffset);\n }\n\n private createInterpolationAst(\n strings: string[],\n expressions: AST[],\n input: string,\n location: string,\n absoluteOffset: number,\n ): ASTWithSource {\n const span = new ParseSpan(0, input.length);\n const interpolation = new Interpolation(\n span,\n span.toAbsolute(absoluteOffset),\n strings,\n expressions,\n );\n return new ASTWithSource(interpolation, input, location, absoluteOffset, this.errors);\n }\n\n /**\n * Splits a string of text into \"raw\" text segments and expressions present in interpolations in\n * the string.\n * Returns `null` if there are no interpolations, otherwise a\n * `SplitInterpolation` with splits that look like\n * ... \n */\n splitInterpolation(\n input: string,\n location: string,\n interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null,\n interpolationConfig: InterpolationConfig = DEFAULT_INTERPOLATION_CONFIG,\n ): SplitInterpolation {\n const strings: InterpolationPiece[] = [];\n const expressions: InterpolationPiece[] = [];\n const offsets: number[] = [];\n const inputToTemplateIndexMap = interpolatedTokens\n ? getIndexMapForOriginalTemplate(interpolatedTokens)\n : null;\n let i = 0;\n let atInterpolation = false;\n let extendLastString = false;\n let {start: interpStart, end: interpEnd} = interpolationConfig;\n while (i < input.length) {\n if (!atInterpolation) {\n // parse until starting {{\n const start = i;\n i = input.indexOf(interpStart, i);\n if (i === -1) {\n i = input.length;\n }\n const text = input.substring(start, i);\n strings.push({text, start, end: i});\n\n atInterpolation = true;\n } else {\n // parse from starting {{ to ending }} while ignoring content inside quotes.\n const fullStart = i;\n const exprStart = fullStart + interpStart.length;\n const exprEnd = this._getInterpolationEndIndex(input, interpEnd, exprStart);\n if (exprEnd === -1) {\n // Could not find the end of the interpolation; do not parse an expression.\n // Instead we should extend the content on the last raw string.\n atInterpolation = false;\n extendLastString = true;\n break;\n }\n const fullEnd = exprEnd + interpEnd.length;\n\n const text = input.substring(exprStart, exprEnd);\n if (text.trim().length === 0) {\n this._reportError(\n 'Blank expressions are not allowed in interpolated strings',\n input,\n `at column ${i} in`,\n location,\n );\n }\n expressions.push({text, start: fullStart, end: fullEnd});\n const startInOriginalTemplate = inputToTemplateIndexMap?.get(fullStart) ?? fullStart;\n const offset = startInOriginalTemplate + interpStart.length;\n offsets.push(offset);\n\n i = fullEnd;\n atInterpolation = false;\n }\n }\n if (!atInterpolation) {\n // If we are now at a text section, add the remaining content as a raw string.\n if (extendLastString) {\n const piece = strings[strings.length - 1];\n piece.text += input.substring(i);\n piece.end = input.length;\n } else {\n strings.push({text: input.substring(i), start: i, end: input.length});\n }\n }\n return new SplitInterpolation(strings, expressions, offsets);\n }\n\n wrapLiteralPrimitive(\n input: string | null,\n location: string,\n absoluteOffset: number,\n ): ASTWithSource {\n const span = new ParseSpan(0, input == null ? 0 : input.length);\n return new ASTWithSource(\n new LiteralPrimitive(span, span.toAbsolute(absoluteOffset), input),\n input,\n location,\n absoluteOffset,\n this.errors,\n );\n }\n\n private _stripComments(input: string): string {\n const i = this._commentStart(input);\n return i != null ? input.substring(0, i) : input;\n }\n\n private _commentStart(input: string): number | null {\n let outerQuote: number | null = null;\n for (let i = 0; i < input.length - 1; i++) {\n const char = input.charCodeAt(i);\n const nextChar = input.charCodeAt(i + 1);\n\n if (char === chars.$SLASH && nextChar == chars.$SLASH && outerQuote == null) return i;\n\n if (outerQuote === char) {\n outerQuote = null;\n } else if (outerQuote == null && chars.isQuote(char)) {\n outerQuote = char;\n }\n }\n return null;\n }\n\n private _checkNoInterpolation(\n input: string,\n location: string,\n {start, end}: InterpolationConfig,\n ): void {\n let startIndex = -1;\n let endIndex = -1;\n\n for (const charIndex of this._forEachUnquotedChar(input, 0)) {\n if (startIndex === -1) {\n if (input.startsWith(start)) {\n startIndex = charIndex;\n }\n } else {\n endIndex = this._getInterpolationEndIndex(input, end, charIndex);\n if (endIndex > -1) {\n break;\n }\n }\n }\n\n if (startIndex > -1 && endIndex > -1) {\n this._reportError(\n `Got interpolation (${start}${end}) where expression was expected`,\n input,\n `at column ${startIndex} in`,\n location,\n );\n }\n }\n\n /**\n * Finds the index of the end of an interpolation expression\n * while ignoring comments and quoted content.\n */\n private _getInterpolationEndIndex(input: string, expressionEnd: string, start: number): number {\n for (const charIndex of this._forEachUnquotedChar(input, start)) {\n if (input.startsWith(expressionEnd, charIndex)) {\n return charIndex;\n }\n\n // Nothing else in the expression matters after we've\n // hit a comment so look directly for the end token.\n if (input.startsWith('//', charIndex)) {\n return input.indexOf(expressionEnd, charIndex);\n }\n }\n\n return -1;\n }\n\n /**\n * Generator used to iterate over the character indexes of a string that are outside of quotes.\n * @param input String to loop through.\n * @param start Index within the string at which to start.\n */\n private *_forEachUnquotedChar(input: string, start: number) {\n let currentQuote: string | null = null;\n let escapeCount = 0;\n for (let i = start; i < input.length; i++) {\n const char = input[i];\n // Skip the characters inside quotes. Note that we only care about the outer-most\n // quotes matching up and we need to account for escape characters.\n if (\n chars.isQuote(input.charCodeAt(i)) &&\n (currentQuote === null || currentQuote === char) &&\n escapeCount % 2 === 0\n ) {\n currentQuote = currentQuote === null ? char : null;\n } else if (currentQuote === null) {\n yield i;\n }\n escapeCount = char === '\\\\' ? escapeCount + 1 : 0;\n }\n }\n}\n\n/** Describes a stateful context an expression parser is in. */\nenum ParseContextFlags {\n None = 0,\n /**\n * A Writable context is one in which a value may be written to an lvalue.\n * For example, after we see a property access, we may expect a write to the\n * property via the \"=\" operator.\n * prop\n * ^ possible \"=\" after\n */\n Writable = 1,\n}\n\nclass _ParseAST {\n private rparensExpected = 0;\n private rbracketsExpected = 0;\n private rbracesExpected = 0;\n private context = ParseContextFlags.None;\n\n // Cache of expression start and input indeces to the absolute source span they map to, used to\n // prevent creating superfluous source spans in `sourceSpan`.\n // A serial of the expression start and input index is used for mapping because both are stateful\n // and may change for subsequent expressions visited by the parser.\n private sourceSpanCache = new Map();\n\n private index: number = 0;\n\n constructor(\n private input: string,\n private location: string,\n private absoluteOffset: number,\n private tokens: Token[],\n private parseFlags: ParseFlags,\n private errors: ParserError[],\n private offset: number,\n ) {}\n\n private peek(offset: number): Token {\n const i = this.index + offset;\n return i < this.tokens.length ? this.tokens[i] : EOF;\n }\n\n private get next(): Token {\n return this.peek(0);\n }\n\n /** Whether all the parser input has been processed. */\n private get atEOF(): boolean {\n return this.index >= this.tokens.length;\n }\n\n /**\n * Index of the next token to be processed, or the end of the last token if all have been\n * processed.\n */\n private get inputIndex(): number {\n return this.atEOF ? this.currentEndIndex : this.next.index + this.offset;\n }\n\n /**\n * End index of the last processed token, or the start of the first token if none have been\n * processed.\n */\n private get currentEndIndex(): number {\n if (this.index > 0) {\n const curToken = this.peek(-1);\n return curToken.end + this.offset;\n }\n // No tokens have been processed yet; return the next token's start or the length of the input\n // if there is no token.\n if (this.tokens.length === 0) {\n return this.input.length + this.offset;\n }\n return this.next.index + this.offset;\n }\n\n /**\n * Returns the absolute offset of the start of the current token.\n */\n private get currentAbsoluteOffset(): number {\n return this.absoluteOffset + this.inputIndex;\n }\n\n /**\n * Retrieve a `ParseSpan` from `start` to the current position (or to `artificialEndIndex` if\n * provided).\n *\n * @param start Position from which the `ParseSpan` will start.\n * @param artificialEndIndex Optional ending index to be used if provided (and if greater than the\n * natural ending index)\n */\n private span(start: number, artificialEndIndex?: number): ParseSpan {\n let endIndex = this.currentEndIndex;\n if (artificialEndIndex !== undefined && artificialEndIndex > this.currentEndIndex) {\n endIndex = artificialEndIndex;\n }\n\n // In some unusual parsing scenarios (like when certain tokens are missing and an `EmptyExpr` is\n // being created), the current token may already be advanced beyond the `currentEndIndex`. This\n // appears to be a deep-seated parser bug.\n //\n // As a workaround for now, swap the start and end indices to ensure a valid `ParseSpan`.\n // TODO(alxhub): fix the bug upstream in the parser state, and remove this workaround.\n if (start > endIndex) {\n const tmp = endIndex;\n endIndex = start;\n start = tmp;\n }\n\n return new ParseSpan(start, endIndex);\n }\n\n private sourceSpan(start: number, artificialEndIndex?: number): AbsoluteSourceSpan {\n const serial = `${start}@${this.inputIndex}:${artificialEndIndex}`;\n if (!this.sourceSpanCache.has(serial)) {\n this.sourceSpanCache.set(\n serial,\n this.span(start, artificialEndIndex).toAbsolute(this.absoluteOffset),\n );\n }\n return this.sourceSpanCache.get(serial)!;\n }\n\n private advance() {\n this.index++;\n }\n\n /**\n * Executes a callback in the provided context.\n */\n private withContext(context: ParseContextFlags, cb: () => T): T {\n this.context |= context;\n const ret = cb();\n this.context ^= context;\n return ret;\n }\n\n private consumeOptionalCharacter(code: number): boolean {\n if (this.next.isCharacter(code)) {\n this.advance();\n return true;\n } else {\n return false;\n }\n }\n\n private peekKeywordLet(): boolean {\n return this.next.isKeywordLet();\n }\n\n private peekKeywordAs(): boolean {\n return this.next.isKeywordAs();\n }\n\n /**\n * Consumes an expected character, otherwise emits an error about the missing expected character\n * and skips over the token stream until reaching a recoverable point.\n *\n * See `this.error` and `this.skip` for more details.\n */\n private expectCharacter(code: number) {\n if (this.consumeOptionalCharacter(code)) return;\n this.error(`Missing expected ${String.fromCharCode(code)}`);\n }\n\n private consumeOptionalOperator(op: string): boolean {\n if (this.next.isOperator(op)) {\n this.advance();\n return true;\n } else {\n return false;\n }\n }\n\n private expectOperator(operator: string) {\n if (this.consumeOptionalOperator(operator)) return;\n this.error(`Missing expected operator ${operator}`);\n }\n\n private prettyPrintToken(tok: Token): string {\n return tok === EOF ? 'end of input' : `token ${tok}`;\n }\n\n private expectIdentifierOrKeyword(): string | null {\n const n = this.next;\n if (!n.isIdentifier() && !n.isKeyword()) {\n if (n.isPrivateIdentifier()) {\n this._reportErrorForPrivateIdentifier(n, 'expected identifier or keyword');\n } else {\n this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`);\n }\n return null;\n }\n this.advance();\n return n.toString() as string;\n }\n\n private expectIdentifierOrKeywordOrString(): string {\n const n = this.next;\n if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) {\n if (n.isPrivateIdentifier()) {\n this._reportErrorForPrivateIdentifier(n, 'expected identifier, keyword or string');\n } else {\n this.error(\n `Unexpected ${this.prettyPrintToken(n)}, expected identifier, keyword, or string`,\n );\n }\n return '';\n }\n this.advance();\n return n.toString() as string;\n }\n\n parseChain(): AST {\n const exprs: AST[] = [];\n const start = this.inputIndex;\n while (this.index < this.tokens.length) {\n const expr = this.parsePipe();\n exprs.push(expr);\n\n if (this.consumeOptionalCharacter(chars.$SEMICOLON)) {\n if (!(this.parseFlags & ParseFlags.Action)) {\n this.error('Binding expression cannot contain chained expression');\n }\n while (this.consumeOptionalCharacter(chars.$SEMICOLON)) {} // read all semicolons\n } else if (this.index < this.tokens.length) {\n const errorIndex = this.index;\n this.error(`Unexpected token '${this.next}'`);\n // The `error` call above will skip ahead to the next recovery point in an attempt to\n // recover part of the expression, but that might be the token we started from which will\n // lead to an infinite loop. If that's the case, break the loop assuming that we can't\n // parse further.\n if (this.index === errorIndex) {\n break;\n }\n }\n }\n if (exprs.length === 0) {\n // We have no expressions so create an empty expression that spans the entire input length\n const artificialStart = this.offset;\n const artificialEnd = this.offset + this.input.length;\n return new EmptyExpr(\n this.span(artificialStart, artificialEnd),\n this.sourceSpan(artificialStart, artificialEnd),\n );\n }\n if (exprs.length == 1) return exprs[0];\n return new Chain(this.span(start), this.sourceSpan(start), exprs);\n }\n\n private parsePipe(): AST {\n const start = this.inputIndex;\n let result = this.parseExpression();\n if (this.consumeOptionalOperator('|')) {\n if (this.parseFlags & ParseFlags.Action) {\n this.error(`Cannot have a pipe in an action expression`);\n }\n\n do {\n const nameStart = this.inputIndex;\n let nameId = this.expectIdentifierOrKeyword();\n let nameSpan: AbsoluteSourceSpan;\n let fullSpanEnd: number | undefined = undefined;\n if (nameId !== null) {\n nameSpan = this.sourceSpan(nameStart);\n } else {\n // No valid identifier was found, so we'll assume an empty pipe name ('').\n nameId = '';\n\n // However, there may have been whitespace present between the pipe character and the next\n // token in the sequence (or the end of input). We want to track this whitespace so that\n // the `BindingPipe` we produce covers not just the pipe character, but any trailing\n // whitespace beyond it. Another way of thinking about this is that the zero-length name\n // is assumed to be at the end of any whitespace beyond the pipe character.\n //\n // Therefore, we push the end of the `ParseSpan` for this pipe all the way up to the\n // beginning of the next token, or until the end of input if the next token is EOF.\n fullSpanEnd = this.next.index !== -1 ? this.next.index : this.input.length + this.offset;\n\n // The `nameSpan` for an empty pipe name is zero-length at the end of any whitespace\n // beyond the pipe character.\n nameSpan = new ParseSpan(fullSpanEnd, fullSpanEnd).toAbsolute(this.absoluteOffset);\n }\n\n const args: AST[] = [];\n while (this.consumeOptionalCharacter(chars.$COLON)) {\n args.push(this.parseExpression());\n\n // If there are additional expressions beyond the name, then the artificial end for the\n // name is no longer relevant.\n }\n result = new BindingPipe(\n this.span(start),\n this.sourceSpan(start, fullSpanEnd),\n result,\n nameId,\n args,\n nameSpan,\n );\n } while (this.consumeOptionalOperator('|'));\n }\n\n return result;\n }\n\n private parseExpression(): AST {\n return this.parseConditional();\n }\n\n private parseConditional(): AST {\n const start = this.inputIndex;\n const result = this.parseLogicalOr();\n\n if (this.consumeOptionalOperator('?')) {\n const yes = this.parsePipe();\n let no: AST;\n if (!this.consumeOptionalCharacter(chars.$COLON)) {\n const end = this.inputIndex;\n const expression = this.input.substring(start, end);\n this.error(`Conditional expression ${expression} requires all 3 expressions`);\n no = new EmptyExpr(this.span(start), this.sourceSpan(start));\n } else {\n no = this.parsePipe();\n }\n return new Conditional(this.span(start), this.sourceSpan(start), result, yes, no);\n } else {\n return result;\n }\n }\n\n private parseLogicalOr(): AST {\n // '||'\n const start = this.inputIndex;\n let result = this.parseLogicalAnd();\n while (this.consumeOptionalOperator('||')) {\n const right = this.parseLogicalAnd();\n result = new Binary(this.span(start), this.sourceSpan(start), '||', result, right);\n }\n return result;\n }\n\n private parseLogicalAnd(): AST {\n // '&&'\n const start = this.inputIndex;\n let result = this.parseNullishCoalescing();\n while (this.consumeOptionalOperator('&&')) {\n const right = this.parseNullishCoalescing();\n result = new Binary(this.span(start), this.sourceSpan(start), '&&', result, right);\n }\n return result;\n }\n\n private parseNullishCoalescing(): AST {\n // '??'\n const start = this.inputIndex;\n let result = this.parseEquality();\n while (this.consumeOptionalOperator('??')) {\n const right = this.parseEquality();\n result = new Binary(this.span(start), this.sourceSpan(start), '??', result, right);\n }\n return result;\n }\n\n private parseEquality(): AST {\n // '==','!=','===','!=='\n const start = this.inputIndex;\n let result = this.parseRelational();\n while (this.next.type == TokenType.Operator) {\n const operator = this.next.strValue;\n switch (operator) {\n case '==':\n case '===':\n case '!=':\n case '!==':\n this.advance();\n const right = this.parseRelational();\n result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n\n private parseRelational(): AST {\n // '<', '>', '<=', '>='\n const start = this.inputIndex;\n let result = this.parseAdditive();\n while (this.next.type == TokenType.Operator) {\n const operator = this.next.strValue;\n switch (operator) {\n case '<':\n case '>':\n case '<=':\n case '>=':\n this.advance();\n const right = this.parseAdditive();\n result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n\n private parseAdditive(): AST {\n // '+', '-'\n const start = this.inputIndex;\n let result = this.parseMultiplicative();\n while (this.next.type == TokenType.Operator) {\n const operator = this.next.strValue;\n switch (operator) {\n case '+':\n case '-':\n this.advance();\n let right = this.parseMultiplicative();\n result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n\n private parseMultiplicative(): AST {\n // '*', '%', '/'\n const start = this.inputIndex;\n let result = this.parsePrefix();\n while (this.next.type == TokenType.Operator) {\n const operator = this.next.strValue;\n switch (operator) {\n case '*':\n case '%':\n case '/':\n this.advance();\n let right = this.parsePrefix();\n result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right);\n continue;\n }\n break;\n }\n return result;\n }\n\n private parsePrefix(): AST {\n if (this.next.type == TokenType.Operator) {\n const start = this.inputIndex;\n const operator = this.next.strValue;\n let result: AST;\n switch (operator) {\n case '+':\n this.advance();\n result = this.parsePrefix();\n return Unary.createPlus(this.span(start), this.sourceSpan(start), result);\n case '-':\n this.advance();\n result = this.parsePrefix();\n return Unary.createMinus(this.span(start), this.sourceSpan(start), result);\n case '!':\n this.advance();\n result = this.parsePrefix();\n return new PrefixNot(this.span(start), this.sourceSpan(start), result);\n }\n } else if (this.next.isKeywordTypeof()) {\n this.advance();\n const start = this.inputIndex;\n let result = this.parsePrefix();\n return new TypeofExpression(this.span(start), this.sourceSpan(start), result);\n }\n return this.parseCallChain();\n }\n\n private parseCallChain(): AST {\n const start = this.inputIndex;\n let result = this.parsePrimary();\n while (true) {\n if (this.consumeOptionalCharacter(chars.$PERIOD)) {\n result = this.parseAccessMember(result, start, false);\n } else if (this.consumeOptionalOperator('?.')) {\n if (this.consumeOptionalCharacter(chars.$LPAREN)) {\n result = this.parseCall(result, start, true);\n } else {\n result = this.consumeOptionalCharacter(chars.$LBRACKET)\n ? this.parseKeyedReadOrWrite(result, start, true)\n : this.parseAccessMember(result, start, true);\n }\n } else if (this.consumeOptionalCharacter(chars.$LBRACKET)) {\n result = this.parseKeyedReadOrWrite(result, start, false);\n } else if (this.consumeOptionalCharacter(chars.$LPAREN)) {\n result = this.parseCall(result, start, false);\n } else if (this.consumeOptionalOperator('!')) {\n result = new NonNullAssert(this.span(start), this.sourceSpan(start), result);\n } else {\n return result;\n }\n }\n }\n\n private parsePrimary(): AST {\n const start = this.inputIndex;\n if (this.consumeOptionalCharacter(chars.$LPAREN)) {\n this.rparensExpected++;\n const result = this.parsePipe();\n this.rparensExpected--;\n this.expectCharacter(chars.$RPAREN);\n return result;\n } else if (this.next.isKeywordNull()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), null);\n } else if (this.next.isKeywordUndefined()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), void 0);\n } else if (this.next.isKeywordTrue()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), true);\n } else if (this.next.isKeywordFalse()) {\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), false);\n } else if (this.next.isKeywordThis()) {\n this.advance();\n return new ThisReceiver(this.span(start), this.sourceSpan(start));\n } else if (this.consumeOptionalCharacter(chars.$LBRACKET)) {\n this.rbracketsExpected++;\n const elements = this.parseExpressionList(chars.$RBRACKET);\n this.rbracketsExpected--;\n this.expectCharacter(chars.$RBRACKET);\n return new LiteralArray(this.span(start), this.sourceSpan(start), elements);\n } else if (this.next.isCharacter(chars.$LBRACE)) {\n return this.parseLiteralMap();\n } else if (this.next.isIdentifier()) {\n return this.parseAccessMember(\n new ImplicitReceiver(this.span(start), this.sourceSpan(start)),\n start,\n false,\n );\n } else if (this.next.isNumber()) {\n const value = this.next.toNumber();\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), value);\n } else if (this.next.isTemplateLiteralEnd()) {\n return this.parseNoInterpolationTemplateLiteral();\n } else if (this.next.isTemplateLiteralPart()) {\n return this.parseTemplateLiteral();\n } else if (this.next.isString() && this.next.kind === StringTokenKind.Plain) {\n const literalValue = this.next.toString();\n this.advance();\n return new LiteralPrimitive(this.span(start), this.sourceSpan(start), literalValue);\n } else if (this.next.isPrivateIdentifier()) {\n this._reportErrorForPrivateIdentifier(this.next, null);\n return new EmptyExpr(this.span(start), this.sourceSpan(start));\n } else if (this.index >= this.tokens.length) {\n this.error(`Unexpected end of expression: ${this.input}`);\n return new EmptyExpr(this.span(start), this.sourceSpan(start));\n } else {\n this.error(`Unexpected token ${this.next}`);\n return new EmptyExpr(this.span(start), this.sourceSpan(start));\n }\n }\n\n private parseExpressionList(terminator: number): AST[] {\n const result: AST[] = [];\n\n do {\n if (!this.next.isCharacter(terminator)) {\n result.push(this.parsePipe());\n } else {\n break;\n }\n } while (this.consumeOptionalCharacter(chars.$COMMA));\n return result;\n }\n\n private parseLiteralMap(): LiteralMap {\n const keys: LiteralMapKey[] = [];\n const values: AST[] = [];\n const start = this.inputIndex;\n this.expectCharacter(chars.$LBRACE);\n if (!this.consumeOptionalCharacter(chars.$RBRACE)) {\n this.rbracesExpected++;\n do {\n const keyStart = this.inputIndex;\n const quoted = this.next.isString();\n const key = this.expectIdentifierOrKeywordOrString();\n const literalMapKey: LiteralMapKey = {key, quoted};\n keys.push(literalMapKey);\n\n // Properties with quoted keys can't use the shorthand syntax.\n if (quoted) {\n this.expectCharacter(chars.$COLON);\n values.push(this.parsePipe());\n } else if (this.consumeOptionalCharacter(chars.$COLON)) {\n values.push(this.parsePipe());\n } else {\n literalMapKey.isShorthandInitialized = true;\n\n const span = this.span(keyStart);\n const sourceSpan = this.sourceSpan(keyStart);\n values.push(\n new PropertyRead(\n span,\n sourceSpan,\n sourceSpan,\n new ImplicitReceiver(span, sourceSpan),\n key,\n ),\n );\n }\n } while (\n this.consumeOptionalCharacter(chars.$COMMA) &&\n !this.next.isCharacter(chars.$RBRACE)\n );\n this.rbracesExpected--;\n this.expectCharacter(chars.$RBRACE);\n }\n return new LiteralMap(this.span(start), this.sourceSpan(start), keys, values);\n }\n\n private parseAccessMember(readReceiver: AST, start: number, isSafe: boolean): AST {\n const nameStart = this.inputIndex;\n const id = this.withContext(ParseContextFlags.Writable, () => {\n const id = this.expectIdentifierOrKeyword() ?? '';\n if (id.length === 0) {\n this.error(`Expected identifier for property access`, readReceiver.span.end);\n }\n return id;\n });\n const nameSpan = this.sourceSpan(nameStart);\n let receiver: AST;\n\n if (isSafe) {\n if (this.consumeOptionalOperator('=')) {\n this.error(\"The '?.' operator cannot be used in the assignment\");\n receiver = new EmptyExpr(this.span(start), this.sourceSpan(start));\n } else {\n receiver = new SafePropertyRead(\n this.span(start),\n this.sourceSpan(start),\n nameSpan,\n readReceiver,\n id,\n );\n }\n } else {\n if (this.consumeOptionalOperator('=')) {\n if (!(this.parseFlags & ParseFlags.Action)) {\n this.error('Bindings cannot contain assignments');\n return new EmptyExpr(this.span(start), this.sourceSpan(start));\n }\n\n const value = this.parseConditional();\n receiver = new PropertyWrite(\n this.span(start),\n this.sourceSpan(start),\n nameSpan,\n readReceiver,\n id,\n value,\n );\n } else {\n receiver = new PropertyRead(\n this.span(start),\n this.sourceSpan(start),\n nameSpan,\n readReceiver,\n id,\n );\n }\n }\n\n return receiver;\n }\n\n private parseCall(receiver: AST, start: number, isSafe: boolean): AST {\n const argumentStart = this.inputIndex;\n this.rparensExpected++;\n const args = this.parseCallArguments();\n const argumentSpan = this.span(argumentStart, this.inputIndex).toAbsolute(this.absoluteOffset);\n this.expectCharacter(chars.$RPAREN);\n this.rparensExpected--;\n const span = this.span(start);\n const sourceSpan = this.sourceSpan(start);\n return isSafe\n ? new SafeCall(span, sourceSpan, receiver, args, argumentSpan)\n : new Call(span, sourceSpan, receiver, args, argumentSpan);\n }\n\n private parseCallArguments(): BindingPipe[] {\n if (this.next.isCharacter(chars.$RPAREN)) return [];\n const positionals: AST[] = [];\n do {\n positionals.push(this.parsePipe());\n } while (this.consumeOptionalCharacter(chars.$COMMA));\n return positionals as BindingPipe[];\n }\n\n /**\n * Parses an identifier, a keyword, a string with an optional `-` in between,\n * and returns the string along with its absolute source span.\n */\n private expectTemplateBindingKey(): TemplateBindingIdentifier {\n let result = '';\n let operatorFound = false;\n const start = this.currentAbsoluteOffset;\n do {\n result += this.expectIdentifierOrKeywordOrString();\n operatorFound = this.consumeOptionalOperator('-');\n if (operatorFound) {\n result += '-';\n }\n } while (operatorFound);\n return {\n source: result,\n span: new AbsoluteSourceSpan(start, start + result.length),\n };\n }\n\n /**\n * Parse microsyntax template expression and return a list of bindings or\n * parsing errors in case the given expression is invalid.\n *\n * For example,\n * ```html\n *
\n * ```\n * contains five bindings:\n * 1. ngFor -> null\n * 2. item -> NgForOfContext.$implicit\n * 3. ngForOf -> items\n * 4. i -> NgForOfContext.index\n * 5. ngForTrackBy -> func\n *\n * For a full description of the microsyntax grammar, see\n * https://gist.github.com/mhevery/d3530294cff2e4a1b3fe15ff75d08855\n *\n * @param templateKey name of the microsyntax directive, like ngIf, ngFor,\n * without the *, along with its absolute span.\n */\n parseTemplateBindings(templateKey: TemplateBindingIdentifier): TemplateBindingParseResult {\n const bindings: TemplateBinding[] = [];\n\n // The first binding is for the template key itself\n // In *ngFor=\"let item of items\", key = \"ngFor\", value = null\n // In *ngIf=\"cond | pipe\", key = \"ngIf\", value = \"cond | pipe\"\n bindings.push(...this.parseDirectiveKeywordBindings(templateKey));\n\n while (this.index < this.tokens.length) {\n // If it starts with 'let', then this must be variable declaration\n const letBinding = this.parseLetBinding();\n if (letBinding) {\n bindings.push(letBinding);\n } else {\n // Two possible cases here, either `value \"as\" key` or\n // \"directive-keyword expression\". We don't know which case, but both\n // \"value\" and \"directive-keyword\" are template binding key, so consume\n // the key first.\n const key = this.expectTemplateBindingKey();\n // Peek at the next token, if it is \"as\" then this must be variable\n // declaration.\n const binding = this.parseAsBinding(key);\n if (binding) {\n bindings.push(binding);\n } else {\n // Otherwise the key must be a directive keyword, like \"of\". Transform\n // the key to actual key. Eg. of -> ngForOf, trackBy -> ngForTrackBy\n key.source =\n templateKey.source + key.source.charAt(0).toUpperCase() + key.source.substring(1);\n bindings.push(...this.parseDirectiveKeywordBindings(key));\n }\n }\n this.consumeStatementTerminator();\n }\n\n return new TemplateBindingParseResult(bindings, [] /* warnings */, this.errors);\n }\n\n private parseKeyedReadOrWrite(receiver: AST, start: number, isSafe: boolean): AST {\n return this.withContext(ParseContextFlags.Writable, () => {\n this.rbracketsExpected++;\n const key = this.parsePipe();\n if (key instanceof EmptyExpr) {\n this.error(`Key access cannot be empty`);\n }\n this.rbracketsExpected--;\n this.expectCharacter(chars.$RBRACKET);\n if (this.consumeOptionalOperator('=')) {\n if (isSafe) {\n this.error(\"The '?.' operator cannot be used in the assignment\");\n } else {\n const value = this.parseConditional();\n return new KeyedWrite(this.span(start), this.sourceSpan(start), receiver, key, value);\n }\n } else {\n return isSafe\n ? new SafeKeyedRead(this.span(start), this.sourceSpan(start), receiver, key)\n : new KeyedRead(this.span(start), this.sourceSpan(start), receiver, key);\n }\n\n return new EmptyExpr(this.span(start), this.sourceSpan(start));\n });\n }\n\n /**\n * Parse a directive keyword, followed by a mandatory expression.\n * For example, \"of items\", \"trackBy: func\".\n * The bindings are: ngForOf -> items, ngForTrackBy -> func\n * There could be an optional \"as\" binding that follows the expression.\n * For example,\n * ```\n * *ngFor=\"let item of items | slice:0:1 as collection\".\n * ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^\n * keyword bound target optional 'as' binding\n * ```\n *\n * @param key binding key, for example, ngFor, ngIf, ngForOf, along with its\n * absolute span.\n */\n private parseDirectiveKeywordBindings(key: TemplateBindingIdentifier): TemplateBinding[] {\n const bindings: TemplateBinding[] = [];\n this.consumeOptionalCharacter(chars.$COLON); // trackBy: trackByFunction\n const value = this.getDirectiveBoundTarget();\n let spanEnd = this.currentAbsoluteOffset;\n // The binding could optionally be followed by \"as\". For example,\n // *ngIf=\"cond | pipe as x\". In this case, the key in the \"as\" binding\n // is \"x\" and the value is the template key itself (\"ngIf\"). Note that the\n // 'key' in the current context now becomes the \"value\" in the next binding.\n const asBinding = this.parseAsBinding(key);\n if (!asBinding) {\n this.consumeStatementTerminator();\n spanEnd = this.currentAbsoluteOffset;\n }\n const sourceSpan = new AbsoluteSourceSpan(key.span.start, spanEnd);\n bindings.push(new ExpressionBinding(sourceSpan, key, value));\n if (asBinding) {\n bindings.push(asBinding);\n }\n return bindings;\n }\n\n /**\n * Return the expression AST for the bound target of a directive keyword\n * binding. For example,\n * ```\n * *ngIf=\"condition | pipe\"\n * ^^^^^^^^^^^^^^^^ bound target for \"ngIf\"\n * *ngFor=\"let item of items\"\n * ^^^^^ bound target for \"ngForOf\"\n * ```\n */\n private getDirectiveBoundTarget(): ASTWithSource | null {\n if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) {\n return null;\n }\n const ast = this.parsePipe(); // example: \"condition | async\"\n const {start, end} = ast.span;\n const value = this.input.substring(start, end);\n return new ASTWithSource(ast, value, this.location, this.absoluteOffset + start, this.errors);\n }\n\n /**\n * Return the binding for a variable declared using `as`. Note that the order\n * of the key-value pair in this declaration is reversed. For example,\n * ```\n * *ngFor=\"let item of items; index as i\"\n * ^^^^^ ^\n * value key\n * ```\n *\n * @param value name of the value in the declaration, \"ngIf\" in the example\n * above, along with its absolute span.\n */\n private parseAsBinding(value: TemplateBindingIdentifier): TemplateBinding | null {\n if (!this.peekKeywordAs()) {\n return null;\n }\n this.advance(); // consume the 'as' keyword\n const key = this.expectTemplateBindingKey();\n this.consumeStatementTerminator();\n const sourceSpan = new AbsoluteSourceSpan(value.span.start, this.currentAbsoluteOffset);\n return new VariableBinding(sourceSpan, key, value);\n }\n\n /**\n * Return the binding for a variable declared using `let`. For example,\n * ```\n * *ngFor=\"let item of items; let i=index;\"\n * ^^^^^^^^ ^^^^^^^^^^^\n * ```\n * In the first binding, `item` is bound to `NgForOfContext.$implicit`.\n * In the second binding, `i` is bound to `NgForOfContext.index`.\n */\n private parseLetBinding(): TemplateBinding | null {\n if (!this.peekKeywordLet()) {\n return null;\n }\n const spanStart = this.currentAbsoluteOffset;\n this.advance(); // consume the 'let' keyword\n const key = this.expectTemplateBindingKey();\n let value: TemplateBindingIdentifier | null = null;\n if (this.consumeOptionalOperator('=')) {\n value = this.expectTemplateBindingKey();\n }\n this.consumeStatementTerminator();\n const sourceSpan = new AbsoluteSourceSpan(spanStart, this.currentAbsoluteOffset);\n return new VariableBinding(sourceSpan, key, value);\n }\n\n private parseNoInterpolationTemplateLiteral(): AST {\n const text = this.next.strValue;\n const start = this.inputIndex;\n this.advance();\n const span = this.span(start);\n const sourceSpan = this.sourceSpan(start);\n return new TemplateLiteral(\n span,\n sourceSpan,\n [new TemplateLiteralElement(span, sourceSpan, text)],\n [],\n );\n }\n\n private parseTemplateLiteral(): AST {\n const start = this.inputIndex;\n const elements: TemplateLiteralElement[] = [];\n const expressions: AST[] = [];\n\n while (this.next !== EOF) {\n const token = this.next;\n\n if (token.isTemplateLiteralPart() || token.isTemplateLiteralEnd()) {\n const partStart = this.inputIndex;\n this.advance();\n elements.push(\n new TemplateLiteralElement(\n this.span(partStart),\n this.sourceSpan(partStart),\n token.strValue,\n ),\n );\n if (token.isTemplateLiteralEnd()) {\n break;\n }\n } else if (token.isTemplateLiteralInterpolationStart()) {\n this.advance();\n const expression = this.parsePipe();\n if (expression instanceof EmptyExpr) {\n this.error('Template literal interpolation cannot be empty');\n } else {\n expressions.push(expression);\n }\n } else {\n this.advance();\n }\n }\n\n return new TemplateLiteral(this.span(start), this.sourceSpan(start), elements, expressions);\n }\n\n /**\n * Consume the optional statement terminator: semicolon or comma.\n */\n private consumeStatementTerminator() {\n this.consumeOptionalCharacter(chars.$SEMICOLON) || this.consumeOptionalCharacter(chars.$COMMA);\n }\n\n /**\n * Records an error and skips over the token stream until reaching a recoverable point. See\n * `this.skip` for more details on token skipping.\n */\n private error(message: string, index: number | null = null) {\n this.errors.push(new ParserError(message, this.input, this.locationText(index), this.location));\n this.skip();\n }\n\n private locationText(index: number | null = null) {\n if (index == null) index = this.index;\n return index < this.tokens.length\n ? `at column ${this.tokens[index].index + 1} in`\n : `at the end of the expression`;\n }\n\n /**\n * Records an error for an unexpected private identifier being discovered.\n * @param token Token representing a private identifier.\n * @param extraMessage Optional additional message being appended to the error.\n */\n private _reportErrorForPrivateIdentifier(token: Token, extraMessage: string | null) {\n let errorMessage = `Private identifiers are not supported. Unexpected private identifier: ${token}`;\n if (extraMessage !== null) {\n errorMessage += `, ${extraMessage}`;\n }\n this.error(errorMessage);\n }\n\n /**\n * Error recovery should skip tokens until it encounters a recovery point.\n *\n * The following are treated as unconditional recovery points:\n * - end of input\n * - ';' (parseChain() is always the root production, and it expects a ';')\n * - '|' (since pipes may be chained and each pipe expression may be treated independently)\n *\n * The following are conditional recovery points:\n * - ')', '}', ']' if one of calling productions is expecting one of these symbols\n * - This allows skip() to recover from errors such as '(a.) + 1' allowing more of the AST to\n * be retained (it doesn't skip any tokens as the ')' is retained because of the '(' begins\n * an '(' ')' production).\n * The recovery points of grouping symbols must be conditional as they must be skipped if\n * none of the calling productions are not expecting the closing token else we will never\n * make progress in the case of an extraneous group closing symbol (such as a stray ')').\n * That is, we skip a closing symbol if we are not in a grouping production.\n * - '=' in a `Writable` context\n * - In this context, we are able to recover after seeing the `=` operator, which\n * signals the presence of an independent rvalue expression following the `=` operator.\n *\n * If a production expects one of these token it increments the corresponding nesting count,\n * and then decrements it just prior to checking if the token is in the input.\n */\n private skip() {\n let n = this.next;\n while (\n this.index < this.tokens.length &&\n !n.isCharacter(chars.$SEMICOLON) &&\n !n.isOperator('|') &&\n (this.rparensExpected <= 0 || !n.isCharacter(chars.$RPAREN)) &&\n (this.rbracesExpected <= 0 || !n.isCharacter(chars.$RBRACE)) &&\n (this.rbracketsExpected <= 0 || !n.isCharacter(chars.$RBRACKET)) &&\n (!(this.context & ParseContextFlags.Writable) || !n.isOperator('='))\n ) {\n if (this.next.isError()) {\n this.errors.push(\n new ParserError(this.next.toString()!, this.input, this.locationText(), this.location),\n );\n }\n this.advance();\n n = this.next;\n }\n }\n}\n\nclass SimpleExpressionChecker extends RecursiveAstVisitor {\n errors: string[] = [];\n\n override visitPipe() {\n this.errors.push('pipes');\n }\n}\n/**\n * Computes the real offset in the original template for indexes in an interpolation.\n *\n * Because templates can have encoded HTML entities and the input passed to the parser at this stage\n * of the compiler is the _decoded_ value, we need to compute the real offset using the original\n * encoded values in the interpolated tokens. Note that this is only a special case handling for\n * `MlParserTokenType.ENCODED_ENTITY` token types. All other interpolated tokens are expected to\n * have parts which exactly match the input string for parsing the interpolation.\n *\n * @param interpolatedTokens The tokens for the interpolated value.\n *\n * @returns A map of index locations in the decoded template to indexes in the original template\n */\nfunction getIndexMapForOriginalTemplate(\n interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[],\n): Map {\n let offsetMap = new Map();\n let consumedInOriginalTemplate = 0;\n let consumedInInput = 0;\n let tokenIndex = 0;\n while (tokenIndex < interpolatedTokens.length) {\n const currentToken = interpolatedTokens[tokenIndex];\n if (currentToken.type === MlParserTokenType.ENCODED_ENTITY) {\n const [decoded, encoded] = currentToken.parts;\n consumedInOriginalTemplate += encoded.length;\n consumedInInput += decoded.length;\n } else {\n const lengthOfParts = currentToken.parts.reduce((sum, current) => sum + current.length, 0);\n consumedInInput += lengthOfParts;\n consumedInOriginalTemplate += lengthOfParts;\n }\n offsetMap.set(consumedInInput, consumedInOriginalTemplate);\n tokenIndex++;\n }\n return offsetMap;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as expr from './ast';\n\n/** Serializes the given AST into a normalized string format. */\nexport function serialize(expression: expr.ASTWithSource): string {\n return expression.visit(new SerializeExpressionVisitor());\n}\n\nclass SerializeExpressionVisitor implements expr.AstVisitor {\n visitUnary(ast: expr.Unary, context: any): string {\n return `${ast.operator}${ast.expr.visit(this, context)}`;\n }\n\n visitBinary(ast: expr.Binary, context: any): string {\n return `${ast.left.visit(this, context)} ${ast.operation} ${ast.right.visit(this, context)}`;\n }\n\n visitChain(ast: expr.Chain, context: any): string {\n return ast.expressions.map((e) => e.visit(this, context)).join('; ');\n }\n\n visitConditional(ast: expr.Conditional, context: any): string {\n return `${ast.condition.visit(this, context)} ? ${ast.trueExp.visit(\n this,\n context,\n )} : ${ast.falseExp.visit(this, context)}`;\n }\n\n visitThisReceiver(): string {\n return 'this';\n }\n\n visitImplicitReceiver(): string {\n return '';\n }\n\n visitInterpolation(ast: expr.Interpolation, context: any): string {\n return interleave(\n ast.strings,\n ast.expressions.map((e) => e.visit(this, context)),\n ).join('');\n }\n\n visitKeyedRead(ast: expr.KeyedRead, context: any): string {\n return `${ast.receiver.visit(this, context)}[${ast.key.visit(this, context)}]`;\n }\n\n visitKeyedWrite(ast: expr.KeyedWrite, context: any): string {\n return `${ast.receiver.visit(this, context)}[${ast.key.visit(\n this,\n context,\n )}] = ${ast.value.visit(this, context)}`;\n }\n\n visitLiteralArray(ast: expr.LiteralArray, context: any): string {\n return `[${ast.expressions.map((e) => e.visit(this, context)).join(', ')}]`;\n }\n\n visitLiteralMap(ast: expr.LiteralMap, context: any): string {\n return `{${zip(\n ast.keys.map((literal) => (literal.quoted ? `'${literal.key}'` : literal.key)),\n ast.values.map((value) => value.visit(this, context)),\n )\n .map(([key, value]) => `${key}: ${value}`)\n .join(', ')}}`;\n }\n\n visitLiteralPrimitive(ast: expr.LiteralPrimitive): string {\n if (ast.value === null) return 'null';\n\n switch (typeof ast.value) {\n case 'number':\n case 'boolean':\n return ast.value.toString();\n case 'undefined':\n return 'undefined';\n case 'string':\n return `'${ast.value.replace(/'/g, `\\\\'`)}'`;\n default:\n throw new Error(`Unsupported primitive type: ${ast.value}`);\n }\n }\n\n visitPipe(ast: expr.BindingPipe, context: any): string {\n return `${ast.exp.visit(this, context)} | ${ast.name}`;\n }\n\n visitPrefixNot(ast: expr.PrefixNot, context: any): string {\n return `!${ast.expression.visit(this, context)}`;\n }\n\n visitNonNullAssert(ast: expr.NonNullAssert, context: any): string {\n return `${ast.expression.visit(this, context)}!`;\n }\n\n visitPropertyRead(ast: expr.PropertyRead, context: any): string {\n if (ast.receiver instanceof expr.ImplicitReceiver) {\n return ast.name;\n } else {\n return `${ast.receiver.visit(this, context)}.${ast.name}`;\n }\n }\n\n visitPropertyWrite(ast: expr.PropertyWrite, context: any): string {\n if (ast.receiver instanceof expr.ImplicitReceiver) {\n return `${ast.name} = ${ast.value.visit(this, context)}`;\n } else {\n return `${ast.receiver.visit(this, context)}.${ast.name} = ${ast.value.visit(this, context)}`;\n }\n }\n\n visitSafePropertyRead(ast: expr.SafePropertyRead, context: any): string {\n return `${ast.receiver.visit(this, context)}?.${ast.name}`;\n }\n\n visitSafeKeyedRead(ast: expr.SafeKeyedRead, context: any): string {\n return `${ast.receiver.visit(this, context)}?.[${ast.key.visit(this, context)}]`;\n }\n\n visitCall(ast: expr.Call, context: any): string {\n return `${ast.receiver.visit(this, context)}(${ast.args\n .map((e) => e.visit(this, context))\n .join(', ')})`;\n }\n\n visitSafeCall(ast: expr.SafeCall, context: any): string {\n return `${ast.receiver.visit(this, context)}?.(${ast.args\n .map((e) => e.visit(this, context))\n .join(', ')})`;\n }\n\n visitTypeofExpression(ast: expr.TypeofExpression, context: any) {\n return `typeof ${ast.expression.visit(this, context)}`;\n }\n\n visitASTWithSource(ast: expr.ASTWithSource, context: any): string {\n return ast.ast.visit(this, context);\n }\n\n visitTemplateLiteral(ast: expr.TemplateLiteral, context: any) {\n let result = '';\n for (let i = 0; i < ast.elements.length; i++) {\n result += ast.elements[i].visit(this, context);\n const expression = i < ast.expressions.length ? ast.expressions[i] : null;\n if (expression !== null) {\n result += '${' + expression.visit(this, context) + '}';\n }\n }\n return '`' + result + '`';\n }\n\n visitTemplateLiteralElement(ast: expr.TemplateLiteralElement, context: any) {\n return ast.text;\n }\n}\n\n/** Zips the two input arrays into a single array of pairs of elements at the same index. */\nfunction zip(left: Left[], right: Right[]): Array<[Left, Right]> {\n if (left.length !== right.length) throw new Error('Array lengths must match');\n\n return left.map((l, i) => [l, right[i]]);\n}\n\n/**\n * Interleaves the two arrays, starting with the first item on the left, then the first item\n * on the right, second item from the left, and so on. When the first array's items are exhausted,\n * the remaining items from the other array are included with no interleaving.\n */\nfunction interleave(left: Left[], right: Right[]): Array {\n const result: Array = [];\n\n for (let index = 0; index < Math.max(left.length, right.length); index++) {\n if (index < left.length) result.push(left[index]);\n if (index < right.length) result.push(right[index]);\n }\n\n return result;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport const SVG_NAMESPACE = 'svg';\nexport const MATH_ML_NAMESPACE = 'math';\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SchemaMetadata, SecurityContext} from '../core';\n\nexport abstract class ElementSchemaRegistry {\n abstract hasProperty(tagName: string, propName: string, schemaMetas: SchemaMetadata[]): boolean;\n abstract hasElement(tagName: string, schemaMetas: SchemaMetadata[]): boolean;\n abstract securityContext(\n elementName: string,\n propName: string,\n isAttribute: boolean,\n ): SecurityContext;\n abstract allKnownElementNames(): string[];\n abstract getMappedPropName(propName: string): string;\n abstract getDefaultComponentElementName(): string;\n abstract validateProperty(name: string): {error: boolean; msg?: string};\n abstract validateAttribute(name: string): {error: boolean; msg?: string};\n abstract normalizeAnimationStyleProperty(propName: string): string;\n abstract normalizeAnimationStyleValue(\n camelCaseProp: string,\n userProvidedProp: string,\n val: string | number,\n ): {error: string; value: string};\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, SchemaMetadata, SecurityContext} from '../core';\nimport {isNgContainer, isNgContent, splitNsName} from '../ml_parser/tags';\nimport {MATH_ML_NAMESPACE, SVG_NAMESPACE} from '../template/pipeline/src/namespaces';\nimport {dashCaseToCamelCase} from '../util';\n\nimport {SECURITY_SCHEMA} from './dom_security_schema';\nimport {ElementSchemaRegistry} from './element_schema_registry';\n\nconst BOOLEAN = 'boolean';\nconst NUMBER = 'number';\nconst STRING = 'string';\nconst OBJECT = 'object';\n\nfunction normalizeTagName(tagName: string): string {\n const tagNameLower = tagName.toLowerCase();\n const [ns, name] = splitNsName(tagNameLower, false);\n\n return ns === SVG_NAMESPACE || ns === MATH_ML_NAMESPACE ? `:${ns}:${name}` : name;\n}\n\n/**\n * This array represents the DOM schema. It encodes inheritance, properties, and events.\n *\n * ## Overview\n *\n * Each line represents one kind of element. The `element_inheritance` and properties are joined\n * using `element_inheritance|properties` syntax.\n *\n * ## Element Inheritance\n *\n * The `element_inheritance` can be further subdivided as `element1,element2,...^parentElement`.\n * Here the individual elements are separated by `,` (commas). Every element in the list\n * has identical properties.\n *\n * An `element` may inherit additional properties from `parentElement` If no `^parentElement` is\n * specified then `\"\"` (blank) element is assumed.\n *\n * NOTE: The blank element inherits from root `[Element]` element, the super element of all\n * elements.\n *\n * NOTE an element prefix such as `:svg:` has no special meaning to the schema.\n *\n * ## Properties\n *\n * Each element has a set of properties separated by `,` (commas). Each property can be prefixed\n * by a special character designating its type:\n *\n * - (no prefix): property is a string.\n * - `*`: property represents an event.\n * - `!`: property is a boolean.\n * - `#`: property is a number.\n * - `%`: property is an object.\n *\n * ## Query\n *\n * The class creates an internal squas representation which allows to easily answer the query of\n * if a given property exist on a given element.\n *\n * NOTE: We don't yet support querying for types or events.\n * NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder,\n * see dom_element_schema_registry_spec.ts\n */\n\n// =================================================================================================\n// =================================================================================================\n// =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========\n// =================================================================================================\n// =================================================================================================\n//\n// DO NOT EDIT THIS DOM SCHEMA WITHOUT A SECURITY REVIEW!\n//\n// Newly added properties must be security reviewed and assigned an appropriate SecurityContext in\n// dom_security_schema.ts. Reach out to mprobst & rjamet for details.\n//\n// =================================================================================================\n\nconst SCHEMA: string[] = [\n '[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot' +\n /* added manually to avoid breaking changes */\n ',*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored',\n '[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy',\n 'abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,search,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy',\n 'media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume',\n ':svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex',\n ':svg:graphics^:svg:|',\n ':svg:animation^:svg:|*begin,*end,*repeat',\n ':svg:geometry^:svg:|',\n ':svg:componentTransferFunction^:svg:|',\n ':svg:gradient^:svg:|',\n ':svg:textContent^:svg:graphics|',\n ':svg:textPositioning^:svg:textContent|',\n 'a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username',\n 'area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username',\n 'audio^media|',\n 'br^[HTMLElement]|clear',\n 'base^[HTMLElement]|href,target',\n 'body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',\n 'button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',\n 'canvas^[HTMLElement]|#height,#width',\n 'content^[HTMLElement]|select',\n 'dl^[HTMLElement]|!compact',\n 'data^[HTMLElement]|value',\n 'datalist^[HTMLElement]|',\n 'details^[HTMLElement]|!open',\n 'dialog^[HTMLElement]|!open,returnValue',\n 'dir^[HTMLElement]|!compact',\n 'div^[HTMLElement]|align',\n 'embed^[HTMLElement]|align,height,name,src,type,width',\n 'fieldset^[HTMLElement]|!disabled,name',\n 'font^[HTMLElement]|color,face,size',\n 'form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',\n 'frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',\n 'frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',\n 'hr^[HTMLElement]|align,color,!noShade,size,width',\n 'head^[HTMLElement]|',\n 'h1,h2,h3,h4,h5,h6^[HTMLElement]|align',\n 'html^[HTMLElement]|version',\n 'iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width',\n 'img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width',\n 'input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',\n 'li^[HTMLElement]|type,#value',\n 'label^[HTMLElement]|htmlFor',\n 'legend^[HTMLElement]|align',\n 'link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type',\n 'map^[HTMLElement]|name',\n 'marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',\n 'menu^[HTMLElement]|!compact',\n 'meta^[HTMLElement]|content,httpEquiv,media,name,scheme',\n 'meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value',\n 'ins,del^[HTMLElement]|cite,dateTime',\n 'ol^[HTMLElement]|!compact,!reversed,#start,type',\n 'object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',\n 'optgroup^[HTMLElement]|!disabled,label',\n 'option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value',\n 'output^[HTMLElement]|defaultValue,%htmlFor,name,value',\n 'p^[HTMLElement]|align',\n 'param^[HTMLElement]|name,type,value,valueType',\n 'picture^[HTMLElement]|',\n 'pre^[HTMLElement]|#width',\n 'progress^[HTMLElement]|#max,#value',\n 'q,blockquote,cite^[HTMLElement]|',\n 'script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type',\n 'select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',\n 'slot^[HTMLElement]|name',\n 'source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width',\n 'span^[HTMLElement]|',\n 'style^[HTMLElement]|!disabled,media,type',\n 'search^[HTMLELement]|',\n 'caption^[HTMLElement]|align',\n 'th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',\n 'col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width',\n 'table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',\n 'tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign',\n 'tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign',\n 'template^[HTMLElement]|',\n 'textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',\n 'time^[HTMLElement]|dateTime',\n 'title^[HTMLElement]|text',\n 'track^[HTMLElement]|!default,kind,label,src,srclang',\n 'ul^[HTMLElement]|!compact,type',\n 'unknown^[HTMLElement]|',\n 'video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width',\n ':svg:a^:svg:graphics|',\n ':svg:animate^:svg:animation|',\n ':svg:animateMotion^:svg:animation|',\n ':svg:animateTransform^:svg:animation|',\n ':svg:circle^:svg:geometry|',\n ':svg:clipPath^:svg:graphics|',\n ':svg:defs^:svg:graphics|',\n ':svg:desc^:svg:|',\n ':svg:discard^:svg:|',\n ':svg:ellipse^:svg:geometry|',\n ':svg:feBlend^:svg:|',\n ':svg:feColorMatrix^:svg:|',\n ':svg:feComponentTransfer^:svg:|',\n ':svg:feComposite^:svg:|',\n ':svg:feConvolveMatrix^:svg:|',\n ':svg:feDiffuseLighting^:svg:|',\n ':svg:feDisplacementMap^:svg:|',\n ':svg:feDistantLight^:svg:|',\n ':svg:feDropShadow^:svg:|',\n ':svg:feFlood^:svg:|',\n ':svg:feFuncA^:svg:componentTransferFunction|',\n ':svg:feFuncB^:svg:componentTransferFunction|',\n ':svg:feFuncG^:svg:componentTransferFunction|',\n ':svg:feFuncR^:svg:componentTransferFunction|',\n ':svg:feGaussianBlur^:svg:|',\n ':svg:feImage^:svg:|',\n ':svg:feMerge^:svg:|',\n ':svg:feMergeNode^:svg:|',\n ':svg:feMorphology^:svg:|',\n ':svg:feOffset^:svg:|',\n ':svg:fePointLight^:svg:|',\n ':svg:feSpecularLighting^:svg:|',\n ':svg:feSpotLight^:svg:|',\n ':svg:feTile^:svg:|',\n ':svg:feTurbulence^:svg:|',\n ':svg:filter^:svg:|',\n ':svg:foreignObject^:svg:graphics|',\n ':svg:g^:svg:graphics|',\n ':svg:image^:svg:graphics|decoding',\n ':svg:line^:svg:geometry|',\n ':svg:linearGradient^:svg:gradient|',\n ':svg:mpath^:svg:|',\n ':svg:marker^:svg:|',\n ':svg:mask^:svg:|',\n ':svg:metadata^:svg:|',\n ':svg:path^:svg:geometry|',\n ':svg:pattern^:svg:|',\n ':svg:polygon^:svg:geometry|',\n ':svg:polyline^:svg:geometry|',\n ':svg:radialGradient^:svg:gradient|',\n ':svg:rect^:svg:geometry|',\n ':svg:svg^:svg:graphics|#currentScale,#zoomAndPan',\n ':svg:script^:svg:|type',\n ':svg:set^:svg:animation|',\n ':svg:stop^:svg:|',\n ':svg:style^:svg:|!disabled,media,title,type',\n ':svg:switch^:svg:graphics|',\n ':svg:symbol^:svg:|',\n ':svg:tspan^:svg:textPositioning|',\n ':svg:text^:svg:textPositioning|',\n ':svg:textPath^:svg:textContent|',\n ':svg:title^:svg:|',\n ':svg:use^:svg:graphics|',\n ':svg:view^:svg:|#zoomAndPan',\n 'data^[HTMLElement]|value',\n 'keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name',\n 'menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default',\n 'summary^[HTMLElement]|',\n 'time^[HTMLElement]|dateTime',\n ':svg:cursor^:svg:|',\n ':math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex',\n ':math:math^:math:|',\n ':math:maction^:math:|',\n ':math:menclose^:math:|',\n ':math:merror^:math:|',\n ':math:mfenced^:math:|',\n ':math:mfrac^:math:|',\n ':math:mi^:math:|',\n ':math:mmultiscripts^:math:|',\n ':math:mn^:math:|',\n ':math:mo^:math:|',\n ':math:mover^:math:|',\n ':math:mpadded^:math:|',\n ':math:mphantom^:math:|',\n ':math:mroot^:math:|',\n ':math:mrow^:math:|',\n ':math:ms^:math:|',\n ':math:mspace^:math:|',\n ':math:msqrt^:math:|',\n ':math:mstyle^:math:|',\n ':math:msub^:math:|',\n ':math:msubsup^:math:|',\n ':math:msup^:math:|',\n ':math:mtable^:math:|',\n ':math:mtd^:math:|',\n ':math:mtext^:math:|',\n ':math:mtr^:math:|',\n ':math:munder^:math:|',\n ':math:munderover^:math:|',\n ':math:semantics^:math:|',\n];\n\nconst _ATTR_TO_PROP = new Map(\n Object.entries({\n 'class': 'className',\n 'for': 'htmlFor',\n 'formaction': 'formAction',\n 'innerHtml': 'innerHTML',\n 'readonly': 'readOnly',\n 'tabindex': 'tabIndex',\n }),\n);\n\n// Invert _ATTR_TO_PROP.\nconst _PROP_TO_ATTR = Array.from(_ATTR_TO_PROP).reduce(\n (inverted, [propertyName, attributeName]) => {\n inverted.set(propertyName, attributeName);\n return inverted;\n },\n new Map(),\n);\n\nexport class DomElementSchemaRegistry extends ElementSchemaRegistry {\n private _schema = new Map>();\n // We don't allow binding to events for security reasons. Allowing event bindings would almost\n // certainly introduce bad XSS vulnerabilities. Instead, we store events in a separate schema.\n private _eventSchema = new Map>();\n\n constructor() {\n super();\n SCHEMA.forEach((encodedType) => {\n const type = new Map();\n const events: Set = new Set();\n const [strType, strProperties] = encodedType.split('|');\n const properties = strProperties.split(',');\n const [typeNames, superName] = strType.split('^');\n typeNames.split(',').forEach((tag) => {\n this._schema.set(tag.toLowerCase(), type);\n this._eventSchema.set(tag.toLowerCase(), events);\n });\n const superType = superName && this._schema.get(superName.toLowerCase());\n if (superType) {\n for (const [prop, value] of superType) {\n type.set(prop, value);\n }\n for (const superEvent of this._eventSchema.get(superName.toLowerCase())!) {\n events.add(superEvent);\n }\n }\n properties.forEach((property: string) => {\n if (property.length > 0) {\n switch (property[0]) {\n case '*':\n events.add(property.substring(1));\n break;\n case '!':\n type.set(property.substring(1), BOOLEAN);\n break;\n case '#':\n type.set(property.substring(1), NUMBER);\n break;\n case '%':\n type.set(property.substring(1), OBJECT);\n break;\n default:\n type.set(property, STRING);\n }\n }\n });\n });\n }\n\n override hasProperty(tagName: string, propName: string, schemaMetas: SchemaMetadata[]): boolean {\n if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) {\n return true;\n }\n\n const normalizedTag = normalizeTagName(tagName);\n if (normalizedTag.includes('-')) {\n if (isNgContainer(normalizedTag) || isNgContent(normalizedTag)) {\n return false;\n }\n\n if (schemaMetas.some((schema) => schema.name === CUSTOM_ELEMENTS_SCHEMA.name)) {\n // Can't tell now as we don't know which properties a custom element will get\n // once it is instantiated\n return true;\n }\n }\n\n const elementProperties = this._schema.get(normalizedTag) || this._schema.get('unknown')!;\n return elementProperties.has(propName);\n }\n\n override hasElement(tagName: string, schemaMetas: SchemaMetadata[]): boolean {\n if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) {\n return true;\n }\n\n const normalizedTag = normalizeTagName(tagName);\n if (normalizedTag.includes('-')) {\n if (isNgContainer(normalizedTag) || isNgContent(normalizedTag)) {\n return true;\n }\n\n if (schemaMetas.some((schema) => schema.name === CUSTOM_ELEMENTS_SCHEMA.name)) {\n // Allow any custom elements\n return true;\n }\n }\n\n return this._schema.has(normalizedTag);\n }\n\n /**\n * securityContext returns the security context for the given property on the given DOM tag.\n *\n * Tag and property name are statically known and cannot change at runtime, i.e. it is not\n * possible to bind a value into a changing attribute or tag name.\n *\n * The filtering is based on a list of allowed tags|attributes. All attributes in the schema\n * above are assumed to have the 'NONE' security context, i.e. that they are safe inert\n * string values. Only specific well known attack vectors are assigned their appropriate context.\n */\n override securityContext(\n tagName: string,\n propName: string,\n isAttribute: boolean,\n ): SecurityContext {\n if (isAttribute) {\n // NB: For security purposes, use the mapped property name, not the attribute name.\n propName = this.getMappedPropName(propName);\n }\n\n const normalizedTag = normalizeTagName(tagName);\n propName = propName.toLowerCase();\n\n const securitySchema = SECURITY_SCHEMA();\n const ctx =\n securitySchema[normalizedTag + '|' + propName] ??\n securitySchema['*|' + propName] ??\n SecurityContext.NONE;\n\n return ctx;\n }\n\n override getMappedPropName(propName: string): string {\n return _ATTR_TO_PROP.get(propName) ?? propName;\n }\n\n override getDefaultComponentElementName(): string {\n return 'ng-component';\n }\n\n override validateProperty(name: string): {error: boolean; msg?: string} {\n if (name.toLowerCase().startsWith('on')) {\n const msg =\n `Binding to event property '${name}' is disallowed for security reasons, ` +\n `please use (${name.slice(2)})=...` +\n `\\nIf '${name}' is a directive input, make sure the directive is imported by the` +\n ` current module.`;\n return {error: true, msg: msg};\n } else {\n return {error: false};\n }\n }\n\n override validateAttribute(name: string): {error: boolean; msg?: string} {\n if (name.toLowerCase().startsWith('on')) {\n const msg =\n `Binding to event attribute '${name}' is disallowed for security reasons, ` +\n `please use (${name.slice(2)})=...`;\n return {error: true, msg: msg};\n } else {\n return {error: false};\n }\n }\n\n override allKnownElementNames(): string[] {\n return Array.from(this._schema.keys());\n }\n\n allKnownAttributesOfElement(tagName: string): string[] {\n const normalizedTag = normalizeTagName(tagName);\n const elementProperties = this._schema.get(normalizedTag) || this._schema.get('unknown')!;\n // Convert properties to attributes.\n return Array.from(elementProperties.keys()).map((prop) => _PROP_TO_ATTR.get(prop) ?? prop);\n }\n\n allKnownEventsOfElement(tagName: string): string[] {\n const normalizedTag = normalizeTagName(tagName);\n return Array.from(this._eventSchema.get(normalizedTag) ?? []);\n }\n\n override normalizeAnimationStyleProperty(propName: string): string {\n return dashCaseToCamelCase(propName);\n }\n\n override normalizeAnimationStyleValue(\n camelCaseProp: string,\n userProvidedProp: string,\n val: string | number,\n ): {error: string; value: string} {\n let unit: string = '';\n const strVal = val.toString().trim();\n let errorMsg: string = null!;\n\n if (_isPixelDimensionStyle(camelCaseProp) && val !== 0 && val !== '0') {\n if (typeof val === 'number') {\n unit = 'px';\n } else {\n const valAndSuffixMatch = val.match(/^[+-]?[\\d\\.]+([a-z]*)$/);\n if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {\n errorMsg = `Please provide a CSS unit value for ${userProvidedProp}:${val}`;\n }\n }\n }\n return {error: errorMsg, value: strVal + unit};\n }\n}\n\nfunction _isPixelDimensionStyle(prop: string): boolean {\n switch (prop) {\n case 'width':\n case 'height':\n case 'minWidth':\n case 'minHeight':\n case 'maxWidth':\n case 'maxHeight':\n case 'left':\n case 'top':\n case 'bottom':\n case 'right':\n case 'fontSize':\n case 'outlineWidth':\n case 'outlineOffset':\n case 'paddingTop':\n case 'paddingLeft':\n case 'paddingBottom':\n case 'paddingRight':\n case 'marginTop':\n case 'marginLeft':\n case 'marginBottom':\n case 'marginRight':\n case 'borderRadius':\n case 'borderWidth':\n case 'borderTopWidth':\n case 'borderLeftWidth':\n case 'borderRightWidth':\n case 'borderBottomWidth':\n case 'textIndent':\n return true;\n\n default:\n return false;\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {DomElementSchemaRegistry} from '../schema/dom_element_schema_registry';\n\nimport {getNsPrefix, TagContentType, TagDefinition} from './tags';\n\nexport class HtmlTagDefinition implements TagDefinition {\n private closedByChildren: {[key: string]: boolean} = {};\n private contentType:\n | TagContentType\n | {default: TagContentType; [namespace: string]: TagContentType};\n\n closedByParent = false;\n implicitNamespacePrefix: string | null;\n isVoid: boolean;\n ignoreFirstLf: boolean;\n canSelfClose: boolean;\n preventNamespaceInheritance: boolean;\n\n constructor({\n closedByChildren,\n implicitNamespacePrefix,\n contentType = TagContentType.PARSABLE_DATA,\n closedByParent = false,\n isVoid = false,\n ignoreFirstLf = false,\n preventNamespaceInheritance = false,\n canSelfClose = false,\n }: {\n closedByChildren?: string[];\n closedByParent?: boolean;\n implicitNamespacePrefix?: string;\n contentType?: TagContentType | {default: TagContentType; [namespace: string]: TagContentType};\n isVoid?: boolean;\n ignoreFirstLf?: boolean;\n preventNamespaceInheritance?: boolean;\n canSelfClose?: boolean;\n } = {}) {\n if (closedByChildren && closedByChildren.length > 0) {\n closedByChildren.forEach((tagName) => (this.closedByChildren[tagName] = true));\n }\n this.isVoid = isVoid;\n this.closedByParent = closedByParent || isVoid;\n this.implicitNamespacePrefix = implicitNamespacePrefix || null;\n this.contentType = contentType;\n this.ignoreFirstLf = ignoreFirstLf;\n this.preventNamespaceInheritance = preventNamespaceInheritance;\n this.canSelfClose = canSelfClose ?? isVoid;\n }\n\n isClosedByChild(name: string): boolean {\n return this.isVoid || name.toLowerCase() in this.closedByChildren;\n }\n\n getContentType(prefix?: string): TagContentType {\n if (typeof this.contentType === 'object') {\n const overrideType = prefix === undefined ? undefined : this.contentType[prefix];\n return overrideType ?? this.contentType.default;\n }\n return this.contentType;\n }\n}\n\nlet DEFAULT_TAG_DEFINITION!: HtmlTagDefinition;\n\n// see https://www.w3.org/TR/html51/syntax.html#optional-tags\n// This implementation does not fully conform to the HTML5 spec.\nlet TAG_DEFINITIONS!: {[key: string]: HtmlTagDefinition};\n\nexport function getHtmlTagDefinition(tagName: string): HtmlTagDefinition {\n if (!TAG_DEFINITIONS) {\n DEFAULT_TAG_DEFINITION = new HtmlTagDefinition({canSelfClose: true});\n TAG_DEFINITIONS = Object.assign(Object.create(null), {\n 'base': new HtmlTagDefinition({isVoid: true}),\n 'meta': new HtmlTagDefinition({isVoid: true}),\n 'area': new HtmlTagDefinition({isVoid: true}),\n 'embed': new HtmlTagDefinition({isVoid: true}),\n 'link': new HtmlTagDefinition({isVoid: true}),\n 'img': new HtmlTagDefinition({isVoid: true}),\n 'input': new HtmlTagDefinition({isVoid: true}),\n 'param': new HtmlTagDefinition({isVoid: true}),\n 'hr': new HtmlTagDefinition({isVoid: true}),\n 'br': new HtmlTagDefinition({isVoid: true}),\n 'source': new HtmlTagDefinition({isVoid: true}),\n 'track': new HtmlTagDefinition({isVoid: true}),\n 'wbr': new HtmlTagDefinition({isVoid: true}),\n 'p': new HtmlTagDefinition({\n closedByChildren: [\n 'address',\n 'article',\n 'aside',\n 'blockquote',\n 'div',\n 'dl',\n 'fieldset',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'hgroup',\n 'hr',\n 'main',\n 'nav',\n 'ol',\n 'p',\n 'pre',\n 'section',\n 'table',\n 'ul',\n ],\n closedByParent: true,\n }),\n 'thead': new HtmlTagDefinition({closedByChildren: ['tbody', 'tfoot']}),\n 'tbody': new HtmlTagDefinition({closedByChildren: ['tbody', 'tfoot'], closedByParent: true}),\n 'tfoot': new HtmlTagDefinition({closedByChildren: ['tbody'], closedByParent: true}),\n 'tr': new HtmlTagDefinition({closedByChildren: ['tr'], closedByParent: true}),\n 'td': new HtmlTagDefinition({closedByChildren: ['td', 'th'], closedByParent: true}),\n 'th': new HtmlTagDefinition({closedByChildren: ['td', 'th'], closedByParent: true}),\n 'col': new HtmlTagDefinition({isVoid: true}),\n 'svg': new HtmlTagDefinition({implicitNamespacePrefix: 'svg'}),\n 'foreignObject': new HtmlTagDefinition({\n // Usually the implicit namespace here would be redundant since it will be inherited from\n // the parent `svg`, but we have to do it for `foreignObject`, because the way the parser\n // works is that the parent node of an end tag is its own start tag which means that\n // the `preventNamespaceInheritance` on `foreignObject` would have it default to the\n // implicit namespace which is `html`, unless specified otherwise.\n implicitNamespacePrefix: 'svg',\n // We want to prevent children of foreignObject from inheriting its namespace, because\n // the point of the element is to allow nodes from other namespaces to be inserted.\n preventNamespaceInheritance: true,\n }),\n 'math': new HtmlTagDefinition({implicitNamespacePrefix: 'math'}),\n 'li': new HtmlTagDefinition({closedByChildren: ['li'], closedByParent: true}),\n 'dt': new HtmlTagDefinition({closedByChildren: ['dt', 'dd']}),\n 'dd': new HtmlTagDefinition({closedByChildren: ['dt', 'dd'], closedByParent: true}),\n 'rb': new HtmlTagDefinition({\n closedByChildren: ['rb', 'rt', 'rtc', 'rp'],\n closedByParent: true,\n }),\n 'rt': new HtmlTagDefinition({\n closedByChildren: ['rb', 'rt', 'rtc', 'rp'],\n closedByParent: true,\n }),\n 'rtc': new HtmlTagDefinition({closedByChildren: ['rb', 'rtc', 'rp'], closedByParent: true}),\n 'rp': new HtmlTagDefinition({\n closedByChildren: ['rb', 'rt', 'rtc', 'rp'],\n closedByParent: true,\n }),\n 'optgroup': new HtmlTagDefinition({closedByChildren: ['optgroup'], closedByParent: true}),\n 'option': new HtmlTagDefinition({\n closedByChildren: ['option', 'optgroup'],\n closedByParent: true,\n }),\n 'pre': new HtmlTagDefinition({ignoreFirstLf: true}),\n 'listing': new HtmlTagDefinition({ignoreFirstLf: true}),\n 'style': new HtmlTagDefinition({contentType: TagContentType.RAW_TEXT}),\n 'script': new HtmlTagDefinition({contentType: TagContentType.RAW_TEXT}),\n 'title': new HtmlTagDefinition({\n // The browser supports two separate `title` tags which have to use\n // a different content type: `HTMLTitleElement` and `SVGTitleElement`\n contentType: {\n default: TagContentType.ESCAPABLE_RAW_TEXT,\n svg: TagContentType.PARSABLE_DATA,\n },\n }),\n 'textarea': new HtmlTagDefinition({\n contentType: TagContentType.ESCAPABLE_RAW_TEXT,\n ignoreFirstLf: true,\n }),\n });\n\n new DomElementSchemaRegistry().allKnownElementNames().forEach((knownTagName) => {\n if (!TAG_DEFINITIONS[knownTagName] && getNsPrefix(knownTagName) === null) {\n TAG_DEFINITIONS[knownTagName] = new HtmlTagDefinition({canSelfClose: false});\n }\n });\n }\n // We have to make both a case-sensitive and a case-insensitive lookup, because\n // HTML tag names are case insensitive, whereas some SVG tags are case sensitive.\n return (\n TAG_DEFINITIONS[tagName] ?? TAG_DEFINITIONS[tagName.toLowerCase()] ?? DEFAULT_TAG_DEFINITION\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nconst TAG_TO_PLACEHOLDER_NAMES: {[k: string]: string} = {\n 'A': 'LINK',\n 'B': 'BOLD_TEXT',\n 'BR': 'LINE_BREAK',\n 'EM': 'EMPHASISED_TEXT',\n 'H1': 'HEADING_LEVEL1',\n 'H2': 'HEADING_LEVEL2',\n 'H3': 'HEADING_LEVEL3',\n 'H4': 'HEADING_LEVEL4',\n 'H5': 'HEADING_LEVEL5',\n 'H6': 'HEADING_LEVEL6',\n 'HR': 'HORIZONTAL_RULE',\n 'I': 'ITALIC_TEXT',\n 'LI': 'LIST_ITEM',\n 'LINK': 'MEDIA_LINK',\n 'OL': 'ORDERED_LIST',\n 'P': 'PARAGRAPH',\n 'Q': 'QUOTATION',\n 'S': 'STRIKETHROUGH_TEXT',\n 'SMALL': 'SMALL_TEXT',\n 'SUB': 'SUBSTRIPT',\n 'SUP': 'SUPERSCRIPT',\n 'TBODY': 'TABLE_BODY',\n 'TD': 'TABLE_CELL',\n 'TFOOT': 'TABLE_FOOTER',\n 'TH': 'TABLE_HEADER_CELL',\n 'THEAD': 'TABLE_HEADER',\n 'TR': 'TABLE_ROW',\n 'TT': 'MONOSPACED_TEXT',\n 'U': 'UNDERLINED_TEXT',\n 'UL': 'UNORDERED_LIST',\n};\n\n/**\n * Creates unique names for placeholder with different content.\n *\n * Returns the same placeholder name when the content is identical.\n */\nexport class PlaceholderRegistry {\n // Count the occurrence of the base name top generate a unique name\n private _placeHolderNameCounts: {[k: string]: number} = {};\n // Maps signature to placeholder names\n private _signatureToName: {[k: string]: string} = {};\n\n getStartTagPlaceholderName(tag: string, attrs: {[k: string]: string}, isVoid: boolean): string {\n const signature = this._hashTag(tag, attrs, isVoid);\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n\n const upperTag = tag.toUpperCase();\n const baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || `TAG_${upperTag}`;\n const name = this._generateUniqueName(isVoid ? baseName : `START_${baseName}`);\n\n this._signatureToName[signature] = name;\n\n return name;\n }\n\n getCloseTagPlaceholderName(tag: string): string {\n const signature = this._hashClosingTag(tag);\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n\n const upperTag = tag.toUpperCase();\n const baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || `TAG_${upperTag}`;\n const name = this._generateUniqueName(`CLOSE_${baseName}`);\n\n this._signatureToName[signature] = name;\n\n return name;\n }\n\n getPlaceholderName(name: string, content: string): string {\n const upperName = name.toUpperCase();\n const signature = `PH: ${upperName}=${content}`;\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n\n const uniqueName = this._generateUniqueName(upperName);\n this._signatureToName[signature] = uniqueName;\n\n return uniqueName;\n }\n\n getUniquePlaceholder(name: string): string {\n return this._generateUniqueName(name.toUpperCase());\n }\n\n getStartBlockPlaceholderName(name: string, parameters: string[]): string {\n const signature = this._hashBlock(name, parameters);\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n\n const placeholder = this._generateUniqueName(`START_BLOCK_${this._toSnakeCase(name)}`);\n this._signatureToName[signature] = placeholder;\n return placeholder;\n }\n\n getCloseBlockPlaceholderName(name: string): string {\n const signature = this._hashClosingBlock(name);\n if (this._signatureToName[signature]) {\n return this._signatureToName[signature];\n }\n\n const placeholder = this._generateUniqueName(`CLOSE_BLOCK_${this._toSnakeCase(name)}`);\n this._signatureToName[signature] = placeholder;\n return placeholder;\n }\n\n // Generate a hash for a tag - does not take attribute order into account\n private _hashTag(tag: string, attrs: {[k: string]: string}, isVoid: boolean): string {\n const start = `<${tag}`;\n const strAttrs = Object.keys(attrs)\n .sort()\n .map((name) => ` ${name}=${attrs[name]}`)\n .join('');\n const end = isVoid ? '/>' : `>`;\n\n return start + strAttrs + end;\n }\n\n private _hashClosingTag(tag: string): string {\n return this._hashTag(`/${tag}`, {}, false);\n }\n\n private _hashBlock(name: string, parameters: string[]): string {\n const params = parameters.length === 0 ? '' : ` (${parameters.sort().join('; ')})`;\n return `@${name}${params} {}`;\n }\n\n private _hashClosingBlock(name: string): string {\n return this._hashBlock(`close_${name}`, []);\n }\n\n private _toSnakeCase(name: string) {\n return name.toUpperCase().replace(/[^A-Z0-9]/g, '_');\n }\n\n private _generateUniqueName(base: string): string {\n const seen = this._placeHolderNameCounts.hasOwnProperty(base);\n if (!seen) {\n this._placeHolderNameCounts[base] = 1;\n return base;\n }\n\n const id = this._placeHolderNameCounts[base];\n this._placeHolderNameCounts[base] = id + 1;\n return `${base}_${id}`;\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Lexer as ExpressionLexer} from '../expression_parser/lexer';\nimport {Parser as ExpressionParser} from '../expression_parser/parser';\nimport {serialize as serializeExpression} from '../expression_parser/serializer';\nimport * as html from '../ml_parser/ast';\nimport {InterpolationConfig} from '../ml_parser/defaults';\nimport {getHtmlTagDefinition} from '../ml_parser/html_tags';\nimport {\n AttributeValueInterpolationToken,\n InterpolatedAttributeToken,\n InterpolatedTextToken,\n InterpolationToken,\n TokenType,\n} from '../ml_parser/tokens';\nimport {ParseSourceSpan} from '../parse_util';\n\nimport * as i18n from './i18n_ast';\nimport {PlaceholderRegistry} from './serializers/placeholder';\n\nconst _expParser = new ExpressionParser(new ExpressionLexer());\n\nexport type VisitNodeFn = (html: html.Node, i18n: i18n.Node) => i18n.Node;\n\nexport interface I18nMessageFactory {\n (\n nodes: html.Node[],\n meaning: string | undefined,\n description: string | undefined,\n customId: string | undefined,\n visitNodeFn?: VisitNodeFn,\n ): i18n.Message;\n}\n\n/**\n * Returns a function converting html nodes to an i18n Message given an interpolationConfig\n */\nexport function createI18nMessageFactory(\n interpolationConfig: InterpolationConfig,\n containerBlocks: Set,\n retainEmptyTokens: boolean,\n preserveExpressionWhitespace: boolean,\n): I18nMessageFactory {\n const visitor = new _I18nVisitor(\n _expParser,\n interpolationConfig,\n containerBlocks,\n retainEmptyTokens,\n preserveExpressionWhitespace,\n );\n return (nodes, meaning, description, customId, visitNodeFn) =>\n visitor.toI18nMessage(nodes, meaning, description, customId, visitNodeFn);\n}\n\ninterface I18nMessageVisitorContext {\n isIcu: boolean;\n icuDepth: number;\n placeholderRegistry: PlaceholderRegistry;\n placeholderToContent: {[phName: string]: i18n.MessagePlaceholder};\n placeholderToMessage: {[phName: string]: i18n.Message};\n visitNodeFn: VisitNodeFn;\n}\n\nfunction noopVisitNodeFn(_html: html.Node, i18n: i18n.Node): i18n.Node {\n return i18n;\n}\n\nclass _I18nVisitor implements html.Visitor {\n constructor(\n private _expressionParser: ExpressionParser,\n private _interpolationConfig: InterpolationConfig,\n private _containerBlocks: Set,\n private readonly _retainEmptyTokens: boolean,\n private readonly _preserveExpressionWhitespace: boolean,\n ) {}\n\n public toI18nMessage(\n nodes: html.Node[],\n meaning = '',\n description = '',\n customId = '',\n visitNodeFn: VisitNodeFn | undefined,\n ): i18n.Message {\n const context: I18nMessageVisitorContext = {\n isIcu: nodes.length == 1 && nodes[0] instanceof html.Expansion,\n icuDepth: 0,\n placeholderRegistry: new PlaceholderRegistry(),\n placeholderToContent: {},\n placeholderToMessage: {},\n visitNodeFn: visitNodeFn || noopVisitNodeFn,\n };\n\n const i18nodes: i18n.Node[] = html.visitAll(this, nodes, context);\n\n return new i18n.Message(\n i18nodes,\n context.placeholderToContent,\n context.placeholderToMessage,\n meaning,\n description,\n customId,\n );\n }\n\n visitElement(el: html.Element, context: I18nMessageVisitorContext): i18n.Node {\n const children = html.visitAll(this, el.children, context);\n const attrs: {[k: string]: string} = {};\n el.attrs.forEach((attr) => {\n // Do not visit the attributes, translatable ones are top-level ASTs\n attrs[attr.name] = attr.value;\n });\n\n const isVoid: boolean = getHtmlTagDefinition(el.name).isVoid;\n const startPhName = context.placeholderRegistry.getStartTagPlaceholderName(\n el.name,\n attrs,\n isVoid,\n );\n context.placeholderToContent[startPhName] = {\n text: el.startSourceSpan.toString(),\n sourceSpan: el.startSourceSpan,\n };\n\n let closePhName = '';\n\n if (!isVoid) {\n closePhName = context.placeholderRegistry.getCloseTagPlaceholderName(el.name);\n context.placeholderToContent[closePhName] = {\n text: ``,\n sourceSpan: el.endSourceSpan ?? el.sourceSpan,\n };\n }\n\n const node = new i18n.TagPlaceholder(\n el.name,\n attrs,\n startPhName,\n closePhName,\n children,\n isVoid,\n el.sourceSpan,\n el.startSourceSpan,\n el.endSourceSpan,\n );\n return context.visitNodeFn(el, node);\n }\n\n visitAttribute(attribute: html.Attribute, context: I18nMessageVisitorContext): i18n.Node {\n const node =\n attribute.valueTokens === undefined || attribute.valueTokens.length === 1\n ? new i18n.Text(attribute.value, attribute.valueSpan || attribute.sourceSpan)\n : this._visitTextWithInterpolation(\n attribute.valueTokens,\n attribute.valueSpan || attribute.sourceSpan,\n context,\n attribute.i18n,\n );\n return context.visitNodeFn(attribute, node);\n }\n\n visitText(text: html.Text, context: I18nMessageVisitorContext): i18n.Node {\n const node =\n text.tokens.length === 1\n ? new i18n.Text(text.value, text.sourceSpan)\n : this._visitTextWithInterpolation(text.tokens, text.sourceSpan, context, text.i18n);\n return context.visitNodeFn(text, node);\n }\n\n visitComment(comment: html.Comment, context: I18nMessageVisitorContext): i18n.Node | null {\n return null;\n }\n\n visitExpansion(icu: html.Expansion, context: I18nMessageVisitorContext): i18n.Node {\n context.icuDepth++;\n const i18nIcuCases: {[k: string]: i18n.Node} = {};\n const i18nIcu = new i18n.Icu(icu.switchValue, icu.type, i18nIcuCases, icu.sourceSpan);\n icu.cases.forEach((caze): void => {\n i18nIcuCases[caze.value] = new i18n.Container(\n caze.expression.map((node) => node.visit(this, context)),\n caze.expSourceSpan,\n );\n });\n context.icuDepth--;\n\n if (context.isIcu || context.icuDepth > 0) {\n // Returns an ICU node when:\n // - the message (vs a part of the message) is an ICU message, or\n // - the ICU message is nested.\n const expPh = context.placeholderRegistry.getUniquePlaceholder(`VAR_${icu.type}`);\n i18nIcu.expressionPlaceholder = expPh;\n context.placeholderToContent[expPh] = {\n text: icu.switchValue,\n sourceSpan: icu.switchValueSourceSpan,\n };\n return context.visitNodeFn(icu, i18nIcu);\n }\n\n // Else returns a placeholder\n // ICU placeholders should not be replaced with their original content but with the their\n // translations.\n // TODO(vicb): add a html.Node -> i18n.Message cache to avoid having to re-create the msg\n const phName = context.placeholderRegistry.getPlaceholderName('ICU', icu.sourceSpan.toString());\n context.placeholderToMessage[phName] = this.toI18nMessage([icu], '', '', '', undefined);\n const node = new i18n.IcuPlaceholder(i18nIcu, phName, icu.sourceSpan);\n return context.visitNodeFn(icu, node);\n }\n\n visitExpansionCase(_icuCase: html.ExpansionCase, _context: I18nMessageVisitorContext): i18n.Node {\n throw new Error('Unreachable code');\n }\n\n visitBlock(block: html.Block, context: I18nMessageVisitorContext) {\n const children = html.visitAll(this, block.children, context);\n\n if (this._containerBlocks.has(block.name)) {\n return new i18n.Container(children, block.sourceSpan);\n }\n\n const parameters = block.parameters.map((param) => param.expression);\n const startPhName = context.placeholderRegistry.getStartBlockPlaceholderName(\n block.name,\n parameters,\n );\n const closePhName = context.placeholderRegistry.getCloseBlockPlaceholderName(block.name);\n\n context.placeholderToContent[startPhName] = {\n text: block.startSourceSpan.toString(),\n sourceSpan: block.startSourceSpan,\n };\n\n context.placeholderToContent[closePhName] = {\n text: block.endSourceSpan ? block.endSourceSpan.toString() : '}',\n sourceSpan: block.endSourceSpan ?? block.sourceSpan,\n };\n\n const node = new i18n.BlockPlaceholder(\n block.name,\n parameters,\n startPhName,\n closePhName,\n children,\n block.sourceSpan,\n block.startSourceSpan,\n block.endSourceSpan,\n );\n return context.visitNodeFn(block, node);\n }\n\n visitBlockParameter(_parameter: html.BlockParameter, _context: I18nMessageVisitorContext) {\n throw new Error('Unreachable code');\n }\n\n visitLetDeclaration(decl: html.LetDeclaration, context: any) {\n return null;\n }\n\n /**\n * Convert, text and interpolated tokens up into text and placeholder pieces.\n *\n * @param tokens The text and interpolated tokens.\n * @param sourceSpan The span of the whole of the `text` string.\n * @param context The current context of the visitor, used to compute and store placeholders.\n * @param previousI18n Any i18n metadata associated with this `text` from a previous pass.\n */\n private _visitTextWithInterpolation(\n tokens: (InterpolatedTextToken | InterpolatedAttributeToken)[],\n sourceSpan: ParseSourceSpan,\n context: I18nMessageVisitorContext,\n previousI18n: i18n.I18nMeta | undefined,\n ): i18n.Node {\n // Return a sequence of `Text` and `Placeholder` nodes grouped in a `Container`.\n const nodes: i18n.Node[] = [];\n // We will only create a container if there are actually interpolations,\n // so this flag tracks that.\n let hasInterpolation = false;\n for (const token of tokens) {\n switch (token.type) {\n case TokenType.INTERPOLATION:\n case TokenType.ATTR_VALUE_INTERPOLATION:\n hasInterpolation = true;\n const [startMarker, expression, endMarker] = token.parts;\n const baseName = extractPlaceholderName(expression) || 'INTERPOLATION';\n const phName = context.placeholderRegistry.getPlaceholderName(baseName, expression);\n\n if (this._preserveExpressionWhitespace) {\n context.placeholderToContent[phName] = {\n text: token.parts.join(''),\n sourceSpan: token.sourceSpan,\n };\n nodes.push(new i18n.Placeholder(expression, phName, token.sourceSpan));\n } else {\n const normalized = this.normalizeExpression(token);\n context.placeholderToContent[phName] = {\n text: `${startMarker}${normalized}${endMarker}`,\n sourceSpan: token.sourceSpan,\n };\n nodes.push(new i18n.Placeholder(normalized, phName, token.sourceSpan));\n }\n break;\n default:\n // Try to merge text tokens with previous tokens. We do this even for all tokens\n // when `retainEmptyTokens == true` because whitespace tokens may have non-zero\n // length, but will be trimmed by `WhitespaceVisitor` in one extraction pass and\n // be considered \"empty\" there. Therefore a whitespace token with\n // `retainEmptyTokens === true` should be treated like an empty token and either\n // retained or merged into the previous node. Since extraction does two passes with\n // different trimming behavior, the second pass needs to have identical node count\n // to reuse source spans, so we need this check to get the same answer when both\n // trimming and not trimming.\n if (token.parts[0].length > 0 || this._retainEmptyTokens) {\n // This token is text or an encoded entity.\n // If it is following on from a previous text node then merge it into that node\n // Otherwise, if it is following an interpolation, then add a new node.\n const previous = nodes[nodes.length - 1];\n if (previous instanceof i18n.Text) {\n previous.value += token.parts[0];\n previous.sourceSpan = new ParseSourceSpan(\n previous.sourceSpan.start,\n token.sourceSpan.end,\n previous.sourceSpan.fullStart,\n previous.sourceSpan.details,\n );\n } else {\n nodes.push(new i18n.Text(token.parts[0], token.sourceSpan));\n }\n } else {\n // Retain empty tokens to avoid breaking dropping entire nodes such that source\n // spans should not be reusable across multiple parses of a template. We *should*\n // do this all the time, however we need to maintain backwards compatibility\n // with existing message IDs so we can't do it by default and should only enable\n // this when removing significant whitespace.\n if (this._retainEmptyTokens) {\n nodes.push(new i18n.Text(token.parts[0], token.sourceSpan));\n }\n }\n\n break;\n }\n }\n\n if (hasInterpolation) {\n // Whitespace removal may have invalidated the interpolation source-spans.\n reusePreviousSourceSpans(nodes, previousI18n);\n return new i18n.Container(nodes, sourceSpan);\n } else {\n return nodes[0];\n }\n }\n\n // Normalize expression whitespace by parsing and re-serializing it. This makes\n // message IDs more durable to insignificant whitespace changes.\n normalizeExpression(token: InterpolationToken | AttributeValueInterpolationToken): string {\n const expression = token.parts[1];\n const expr = this._expressionParser.parseBinding(\n expression,\n /* location */ token.sourceSpan.start.toString(),\n /* absoluteOffset */ token.sourceSpan.start.offset,\n this._interpolationConfig,\n );\n return serializeExpression(expr);\n }\n}\n\n/**\n * Re-use the source-spans from `previousI18n` metadata for the `nodes`.\n *\n * Whitespace removal can invalidate the source-spans of interpolation nodes, so we\n * reuse the source-span stored from a previous pass before the whitespace was removed.\n *\n * @param nodes The `Text` and `Placeholder` nodes to be processed.\n * @param previousI18n Any i18n metadata for these `nodes` stored from a previous pass.\n */\nfunction reusePreviousSourceSpans(\n nodes: i18n.Node[],\n previousI18n: i18n.I18nMeta | undefined,\n): void {\n if (previousI18n instanceof i18n.Message) {\n // The `previousI18n` is an i18n `Message`, so we are processing an `Attribute` with i18n\n // metadata. The `Message` should consist only of a single `Container` that contains the\n // parts (`Text` and `Placeholder`) to process.\n assertSingleContainerMessage(previousI18n);\n previousI18n = previousI18n.nodes[0];\n }\n\n if (previousI18n instanceof i18n.Container) {\n // The `previousI18n` is a `Container`, which means that this is a second i18n extraction pass\n // after whitespace has been removed from the AST nodes.\n assertEquivalentNodes(previousI18n.children, nodes);\n\n // Reuse the source-spans from the first pass.\n for (let i = 0; i < nodes.length; i++) {\n nodes[i].sourceSpan = previousI18n.children[i].sourceSpan;\n }\n }\n}\n\n/**\n * Asserts that the `message` contains exactly one `Container` node.\n */\nfunction assertSingleContainerMessage(message: i18n.Message): void {\n const nodes = message.nodes;\n if (nodes.length !== 1 || !(nodes[0] instanceof i18n.Container)) {\n throw new Error(\n 'Unexpected previous i18n message - expected it to consist of only a single `Container` node.',\n );\n }\n}\n\n/**\n * Asserts that the `previousNodes` and `node` collections have the same number of elements and\n * corresponding elements have the same node type.\n */\nfunction assertEquivalentNodes(previousNodes: i18n.Node[], nodes: i18n.Node[]): void {\n if (previousNodes.length !== nodes.length) {\n throw new Error(\n `\nThe number of i18n message children changed between first and second pass.\n\nFirst pass (${previousNodes.length} tokens):\n${previousNodes.map((node) => `\"${node.sourceSpan.toString()}\"`).join('\\n')}\n\nSecond pass (${nodes.length} tokens):\n${nodes.map((node) => `\"${node.sourceSpan.toString()}\"`).join('\\n')}\n `.trim(),\n );\n }\n if (previousNodes.some((node, i) => nodes[i].constructor !== node.constructor)) {\n throw new Error(\n 'The types of the i18n message children changed between first and second pass.',\n );\n }\n}\n\nconst _CUSTOM_PH_EXP =\n /\\/\\/[\\s\\S]*i18n[\\s\\S]*\\([\\s\\S]*ph[\\s\\S]*=[\\s\\S]*(\"|')([\\s\\S]*?)\\1[\\s\\S]*\\)/g;\n\nfunction extractPlaceholderName(input: string): string {\n return input.split(_CUSTOM_PH_EXP)[2];\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ParseError, ParseSourceSpan} from '../parse_util';\n\n/**\n * An i18n error.\n */\nexport class I18nError extends ParseError {\n constructor(span: ParseSourceSpan, msg: string) {\n super(span, msg);\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Set of tagName|propertyName corresponding to Trusted Types sinks. Properties applying to all\n * tags use '*'.\n *\n * Extracted from, and should be kept in sync with\n * https://www.w3.org/TR/trusted-types/#integrations\n */\nconst TRUSTED_TYPES_SINKS = new Set([\n // NOTE: All strings in this set *must* be lowercase!\n\n // TrustedHTML\n 'iframe|srcdoc',\n '*|innerhtml',\n '*|outerhtml',\n\n // NB: no TrustedScript here, as the corresponding tags are stripped by the compiler.\n\n // TrustedScriptURL\n 'embed|src',\n 'iframe|src',\n 'object|codebase',\n 'object|data',\n]);\n\n/**\n * isTrustedTypesSink returns true if the given property on the given DOM tag is a Trusted Types\n * sink. In that case, use `ElementSchemaRegistry.securityContext` to determine which particular\n * Trusted Type is required for values passed to the sink:\n * - SecurityContext.HTML corresponds to TrustedHTML\n * - SecurityContext.RESOURCE_URL corresponds to TrustedScriptURL\n */\nexport function isTrustedTypesSink(tagName: string, propName: string): boolean {\n // Make sure comparisons are case insensitive, so that case differences between attribute and\n // property names do not have a security impact.\n tagName = tagName.toLowerCase();\n propName = propName.toLowerCase();\n\n return (\n TRUSTED_TYPES_SINKS.has(tagName + '|' + propName) || TRUSTED_TYPES_SINKS.has('*|' + propName)\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {WhitespaceVisitor, visitAllWithSiblings} from '../../../ml_parser/html_whitespaces';\nimport {computeDecimalDigest, computeDigest, decimalDigest} from '../../../i18n/digest';\nimport * as i18n from '../../../i18n/i18n_ast';\nimport {createI18nMessageFactory, VisitNodeFn} from '../../../i18n/i18n_parser';\nimport {I18nError} from '../../../i18n/parse_util';\nimport * as html from '../../../ml_parser/ast';\nimport {\n DEFAULT_CONTAINER_BLOCKS,\n DEFAULT_INTERPOLATION_CONFIG,\n InterpolationConfig,\n} from '../../../ml_parser/defaults';\nimport {ParseTreeResult} from '../../../ml_parser/parser';\nimport * as o from '../../../output/output_ast';\nimport {isTrustedTypesSink} from '../../../schema/trusted_types_sinks';\n\nimport {hasI18nAttrs, I18N_ATTR, I18N_ATTR_PREFIX, icuFromI18nMessage} from './util';\n\nexport type I18nMeta = {\n id?: string;\n customId?: string;\n legacyIds?: string[];\n description?: string;\n meaning?: string;\n};\n\nconst setI18nRefs = (originalNodeMap: Map): VisitNodeFn => {\n return (trimmedNode, i18nNode) => {\n // We need to set i18n properties on the original, untrimmed AST nodes. The i18n nodes needs to\n // use the trimmed content for message IDs to make messages more stable to whitespace changes.\n // But we don't want to actually trim the content, so we can't use the trimmed HTML AST for\n // general code gen. Instead we map the trimmed HTML AST back to the original AST and then\n // attach the i18n nodes so we get trimmed i18n nodes on the original (untrimmed) HTML AST.\n const originalNode = originalNodeMap.get(trimmedNode) ?? trimmedNode;\n\n if (originalNode instanceof html.NodeWithI18n) {\n if (i18nNode instanceof i18n.IcuPlaceholder && originalNode.i18n instanceof i18n.Message) {\n // This html node represents an ICU but this is a second processing pass, and the legacy id\n // was computed in the previous pass and stored in the `i18n` property as a message.\n // We are about to wipe out that property so capture the previous message to be reused when\n // generating the message for this ICU later. See `_generateI18nMessage()`.\n i18nNode.previousMessage = originalNode.i18n;\n }\n originalNode.i18n = i18nNode;\n }\n return i18nNode;\n };\n};\n\n/**\n * This visitor walks over HTML parse tree and converts information stored in\n * i18n-related attributes (\"i18n\" and \"i18n-*\") into i18n meta object that is\n * stored with other element's and attribute's information.\n */\nexport class I18nMetaVisitor implements html.Visitor {\n // whether visited nodes contain i18n information\n public hasI18nMeta: boolean = false;\n private _errors: I18nError[] = [];\n\n constructor(\n private interpolationConfig: InterpolationConfig = DEFAULT_INTERPOLATION_CONFIG,\n private keepI18nAttrs = false,\n private enableI18nLegacyMessageIdFormat = false,\n private containerBlocks: Set = DEFAULT_CONTAINER_BLOCKS,\n private readonly preserveSignificantWhitespace: boolean = true,\n\n // When dropping significant whitespace we need to retain empty tokens or\n // else we won't be able to reuse source spans because empty tokens would be\n // removed and cause a mismatch. Unfortunately this still needs to be\n // configurable and sometimes needs to be set independently in order to make\n // sure the number of nodes don't change between parses, even when\n // `preserveSignificantWhitespace` changes.\n private readonly retainEmptyTokens: boolean = !preserveSignificantWhitespace,\n ) {}\n\n private _generateI18nMessage(\n nodes: html.Node[],\n meta: string | i18n.I18nMeta = '',\n visitNodeFn?: VisitNodeFn,\n ): i18n.Message {\n const {meaning, description, customId} = this._parseMetadata(meta);\n const createI18nMessage = createI18nMessageFactory(\n this.interpolationConfig,\n this.containerBlocks,\n this.retainEmptyTokens,\n /* preserveExpressionWhitespace */ this.preserveSignificantWhitespace,\n );\n const message = createI18nMessage(nodes, meaning, description, customId, visitNodeFn);\n this._setMessageId(message, meta);\n this._setLegacyIds(message, meta);\n return message;\n }\n\n visitAllWithErrors(nodes: html.Node[]): ParseTreeResult {\n const result = nodes.map((node) => node.visit(this, null));\n return new ParseTreeResult(result, this._errors);\n }\n\n visitElement(element: html.Element): any {\n let message: i18n.Message | undefined = undefined;\n\n if (hasI18nAttrs(element)) {\n this.hasI18nMeta = true;\n const attrs: html.Attribute[] = [];\n const attrsMeta: {[key: string]: string} = {};\n\n for (const attr of element.attrs) {\n if (attr.name === I18N_ATTR) {\n // root 'i18n' node attribute\n const i18n = element.i18n || attr.value;\n\n // Generate a new AST with whitespace trimmed, but also generate a map\n // to correlate each new node to its original so we can apply i18n\n // information to the original node based on the trimmed content.\n //\n // `WhitespaceVisitor` removes *insignificant* whitespace as well as\n // significant whitespace. Enabling this visitor should be conditional\n // on `preserveWhitespace` rather than `preserveSignificantWhitespace`,\n // however this would be a breaking change for existing behavior where\n // `preserveWhitespace` was not respected correctly when generating\n // message IDs. This is really a bug but one we need to keep to maintain\n // backwards compatibility.\n const originalNodeMap = new Map();\n const trimmedNodes = this.preserveSignificantWhitespace\n ? element.children\n : visitAllWithSiblings(\n new WhitespaceVisitor(false /* preserveSignificantWhitespace */, originalNodeMap),\n element.children,\n );\n message = this._generateI18nMessage(trimmedNodes, i18n, setI18nRefs(originalNodeMap));\n if (message.nodes.length === 0) {\n // Ignore the message if it is empty.\n message = undefined;\n }\n // Store the message on the element\n element.i18n = message;\n } else if (attr.name.startsWith(I18N_ATTR_PREFIX)) {\n // 'i18n-*' attributes\n const name = attr.name.slice(I18N_ATTR_PREFIX.length);\n if (isTrustedTypesSink(element.name, name)) {\n this._reportError(\n attr,\n `Translating attribute '${name}' is disallowed for security reasons.`,\n );\n } else {\n attrsMeta[name] = attr.value;\n }\n } else {\n // non-i18n attributes\n attrs.push(attr);\n }\n }\n\n // set i18n meta for attributes\n if (Object.keys(attrsMeta).length) {\n for (const attr of attrs) {\n const meta = attrsMeta[attr.name];\n // do not create translation for empty attributes\n if (meta !== undefined && attr.value) {\n attr.i18n = this._generateI18nMessage([attr], attr.i18n || meta);\n }\n }\n }\n\n if (!this.keepI18nAttrs) {\n // update element's attributes,\n // keeping only non-i18n related ones\n element.attrs = attrs;\n }\n }\n html.visitAll(this, element.children, message);\n return element;\n }\n\n visitExpansion(expansion: html.Expansion, currentMessage: i18n.Message | null): any {\n let message;\n const meta = expansion.i18n;\n this.hasI18nMeta = true;\n if (meta instanceof i18n.IcuPlaceholder) {\n // set ICU placeholder name (e.g. \"ICU_1\"),\n // generated while processing root element contents,\n // so we can reference it when we output translation\n const name = meta.name;\n message = this._generateI18nMessage([expansion], meta);\n const icu = icuFromI18nMessage(message);\n icu.name = name;\n if (currentMessage !== null) {\n // Also update the placeholderToMessage map with this new message\n currentMessage.placeholderToMessage[name] = message;\n }\n } else {\n // ICU is a top level message, try to use metadata from container element if provided via\n // `context` argument. Note: context may not be available for standalone ICUs (without\n // wrapping element), so fallback to ICU metadata in this case.\n message = this._generateI18nMessage([expansion], currentMessage || meta);\n }\n expansion.i18n = message;\n return expansion;\n }\n\n visitText(text: html.Text): any {\n return text;\n }\n visitAttribute(attribute: html.Attribute): any {\n return attribute;\n }\n visitComment(comment: html.Comment): any {\n return comment;\n }\n visitExpansionCase(expansionCase: html.ExpansionCase): any {\n return expansionCase;\n }\n\n visitBlock(block: html.Block, context: any) {\n html.visitAll(this, block.children, context);\n return block;\n }\n\n visitBlockParameter(parameter: html.BlockParameter, context: any) {\n return parameter;\n }\n\n visitLetDeclaration(decl: html.LetDeclaration, context: any) {\n return decl;\n }\n\n /**\n * Parse the general form `meta` passed into extract the explicit metadata needed to create a\n * `Message`.\n *\n * There are three possibilities for the `meta` variable\n * 1) a string from an `i18n` template attribute: parse it to extract the metadata values.\n * 2) a `Message` from a previous processing pass: reuse the metadata values in the message.\n * 4) other: ignore this and just process the message metadata as normal\n *\n * @param meta the bucket that holds information about the message\n * @returns the parsed metadata.\n */\n private _parseMetadata(meta: string | i18n.I18nMeta): I18nMeta {\n return typeof meta === 'string'\n ? parseI18nMeta(meta)\n : meta instanceof i18n.Message\n ? meta\n : {};\n }\n\n /**\n * Generate (or restore) message id if not specified already.\n */\n private _setMessageId(message: i18n.Message, meta: string | i18n.I18nMeta): void {\n if (!message.id) {\n message.id = (meta instanceof i18n.Message && meta.id) || decimalDigest(message);\n }\n }\n\n /**\n * Update the `message` with a `legacyId` if necessary.\n *\n * @param message the message whose legacy id should be set\n * @param meta information about the message being processed\n */\n private _setLegacyIds(message: i18n.Message, meta: string | i18n.I18nMeta): void {\n if (this.enableI18nLegacyMessageIdFormat) {\n message.legacyIds = [computeDigest(message), computeDecimalDigest(message)];\n } else if (typeof meta !== 'string') {\n // This occurs if we are doing the 2nd pass after whitespace removal (see `parseTemplate()` in\n // `packages/compiler/src/render3/view/template.ts`).\n // In that case we want to reuse the legacy message generated in the 1st pass (see\n // `setI18nRefs()`).\n const previousMessage =\n meta instanceof i18n.Message\n ? meta\n : meta instanceof i18n.IcuPlaceholder\n ? meta.previousMessage\n : undefined;\n message.legacyIds = previousMessage ? previousMessage.legacyIds : [];\n }\n }\n\n private _reportError(node: html.Node, msg: string): void {\n this._errors.push(new I18nError(node.sourceSpan, msg));\n }\n}\n\n/** I18n separators for metadata **/\nconst I18N_MEANING_SEPARATOR = '|';\nconst I18N_ID_SEPARATOR = '@@';\n\n/**\n * Parses i18n metas like:\n * - \"@@id\",\n * - \"description[@@id]\",\n * - \"meaning|description[@@id]\"\n * and returns an object with parsed output.\n *\n * @param meta String that represents i18n meta\n * @returns Object with id, meaning and description fields\n */\nexport function parseI18nMeta(meta: string = ''): I18nMeta {\n let customId: string | undefined;\n let meaning: string | undefined;\n let description: string | undefined;\n\n meta = meta.trim();\n if (meta) {\n const idIndex = meta.indexOf(I18N_ID_SEPARATOR);\n const descIndex = meta.indexOf(I18N_MEANING_SEPARATOR);\n let meaningAndDesc: string;\n [meaningAndDesc, customId] =\n idIndex > -1 ? [meta.slice(0, idIndex), meta.slice(idIndex + 2)] : [meta, ''];\n [meaning, description] =\n descIndex > -1\n ? [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)]\n : ['', meaningAndDesc];\n }\n\n return {customId, meaning, description};\n}\n\n// Converts i18n meta information for a message (id, description, meaning)\n// to a JsDoc statement formatted as expected by the Closure compiler.\nexport function i18nMetaToJSDoc(meta: I18nMeta): o.JSDocComment {\n const tags: o.JSDocTag[] = [];\n if (meta.description) {\n tags.push({tagName: o.JSDocTagName.Desc, text: meta.description});\n } else {\n // Suppress the JSCompiler warning that a `@desc` was not given for this message.\n tags.push({tagName: o.JSDocTagName.Suppress, text: '{msgDescriptions}'});\n }\n if (meta.meaning) {\n tags.push({tagName: o.JSDocTagName.Meaning, text: meta.meaning});\n }\n return o.jsDocComment(tags);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport * as i18n from '../../../i18n/i18n_ast';\nimport {mapLiteral} from '../../../output/map_util';\nimport * as o from '../../../output/output_ast';\n\nimport {serializeIcuNode} from './icu_serializer';\nimport {i18nMetaToJSDoc} from './meta';\nimport {formatI18nPlaceholderName, formatI18nPlaceholderNamesInMap} from './util';\n\n/** Closure uses `goog.getMsg(message)` to lookup translations */\nconst GOOG_GET_MSG = 'goog.getMsg';\n\n/**\n * Generates a `goog.getMsg()` statement and reassignment. The template:\n *\n * ```html\n *
Sent from {{ sender }} to {{ receiver }}
\n * ```\n *\n * Generates:\n *\n * ```ts\n * const MSG_FOO = goog.getMsg(\n * // Message template.\n * 'Sent from {$interpolation} to {$startTagSpan}{$interpolation_1}{$closeTagSpan}.',\n * // Placeholder values, set to magic strings which get replaced by the Angular runtime.\n * {\n * 'interpolation': '\\uFFFD0\\uFFFD',\n * 'startTagSpan': '\\uFFFD1\\uFFFD',\n * 'interpolation_1': '\\uFFFD2\\uFFFD',\n * 'closeTagSpan': '\\uFFFD3\\uFFFD',\n * },\n * // Options bag.\n * {\n * // Maps each placeholder to the original Angular source code which generates it's value.\n * original_code: {\n * 'interpolation': '{{ sender }}',\n * 'startTagSpan': '',\n * 'interpolation_1': '{{ receiver }}',\n * 'closeTagSpan': '',\n * },\n * },\n * );\n * const I18N_0 = MSG_FOO;\n * ```\n */\nexport function createGoogleGetMsgStatements(\n variable: o.ReadVarExpr,\n message: i18n.Message,\n closureVar: o.ReadVarExpr,\n placeholderValues: {[name: string]: o.Expression},\n): o.Statement[] {\n const messageString = serializeI18nMessageForGetMsg(message);\n const args = [o.literal(messageString) as o.Expression];\n if (Object.keys(placeholderValues).length) {\n // Message template parameters containing the magic strings replaced by the Angular runtime with\n // real data, e.g. `{'interpolation': '\\uFFFD0\\uFFFD'}`.\n args.push(\n mapLiteral(\n formatI18nPlaceholderNamesInMap(placeholderValues, true /* useCamelCase */),\n true /* quoted */,\n ),\n );\n\n // Message options object, which contains original source code for placeholders (as they are\n // present in a template, e.g.\n // `{original_code: {'interpolation': '{{ name }}', 'startTagSpan': ''}}`.\n args.push(\n mapLiteral({\n original_code: o.literalMap(\n Object.keys(placeholderValues).map((param) => ({\n key: formatI18nPlaceholderName(param),\n quoted: true,\n value: message.placeholders[param]\n ? // Get source span for typical placeholder if it exists.\n o.literal(message.placeholders[param].sourceSpan.toString())\n : // Otherwise must be an ICU expression, get it's source span.\n o.literal(\n message.placeholderToMessage[param].nodes\n .map((node) => node.sourceSpan.toString())\n .join(''),\n ),\n })),\n ),\n }),\n );\n }\n\n // /**\n // * @desc description of message\n // * @meaning meaning of message\n // */\n // const MSG_... = goog.getMsg(..);\n // I18N_X = MSG_...;\n const googGetMsgStmt = closureVar.set(o.variable(GOOG_GET_MSG).callFn(args)).toConstDecl();\n googGetMsgStmt.addLeadingComment(i18nMetaToJSDoc(message));\n const i18nAssignmentStmt = new o.ExpressionStatement(variable.set(closureVar));\n return [googGetMsgStmt, i18nAssignmentStmt];\n}\n\n/**\n * This visitor walks over i18n tree and generates its string representation, including ICUs and\n * placeholders in `{$placeholder}` (for plain messages) or `{PLACEHOLDER}` (inside ICUs) format.\n */\nclass GetMsgSerializerVisitor implements i18n.Visitor {\n private formatPh(value: string): string {\n return `{$${formatI18nPlaceholderName(value)}}`;\n }\n\n visitText(text: i18n.Text): any {\n return text.value;\n }\n\n visitContainer(container: i18n.Container): any {\n return container.children.map((child) => child.visit(this)).join('');\n }\n\n visitIcu(icu: i18n.Icu): any {\n return serializeIcuNode(icu);\n }\n\n visitTagPlaceholder(ph: i18n.TagPlaceholder): any {\n return ph.isVoid\n ? this.formatPh(ph.startName)\n : `${this.formatPh(ph.startName)}${ph.children\n .map((child) => child.visit(this))\n .join('')}${this.formatPh(ph.closeName)}`;\n }\n\n visitPlaceholder(ph: i18n.Placeholder): any {\n return this.formatPh(ph.name);\n }\n\n visitBlockPlaceholder(ph: i18n.BlockPlaceholder): any {\n return `${this.formatPh(ph.startName)}${ph.children\n .map((child) => child.visit(this))\n .join('')}${this.formatPh(ph.closeName)}`;\n }\n\n visitIcuPlaceholder(ph: i18n.IcuPlaceholder, context?: any): any {\n return this.formatPh(ph.name);\n }\n}\n\nconst serializerVisitor = new GetMsgSerializerVisitor();\n\nexport function serializeI18nMessageForGetMsg(message: i18n.Message): string {\n return message.nodes.map((node) => node.visit(serializerVisitor, null)).join('');\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport * as i18n from '../../../i18n/i18n_ast';\nimport * as o from '../../../output/output_ast';\nimport {ParseLocation, ParseSourceSpan} from '../../../parse_util';\n\nimport {serializeIcuNode} from './icu_serializer';\nimport {formatI18nPlaceholderName} from './util';\n\nexport function createLocalizeStatements(\n variable: o.ReadVarExpr,\n message: i18n.Message,\n params: {[name: string]: o.Expression},\n): o.Statement[] {\n const {messageParts, placeHolders} = serializeI18nMessageForLocalize(message);\n const sourceSpan = getSourceSpan(message);\n const expressions = placeHolders.map((ph) => params[ph.text]);\n const localizedString = o.localizedString(\n message,\n messageParts,\n placeHolders,\n expressions,\n sourceSpan,\n );\n const variableInitialization = variable.set(localizedString);\n return [new o.ExpressionStatement(variableInitialization)];\n}\n\n/**\n * This visitor walks over an i18n tree, capturing literal strings and placeholders.\n *\n * The result can be used for generating the `$localize` tagged template literals.\n */\nclass LocalizeSerializerVisitor implements i18n.Visitor {\n constructor(\n private placeholderToMessage: {[phName: string]: i18n.Message},\n private pieces: o.MessagePiece[],\n ) {}\n\n visitText(text: i18n.Text): any {\n if (this.pieces[this.pieces.length - 1] instanceof o.LiteralPiece) {\n // Two literal pieces in a row means that there was some comment node in-between.\n this.pieces[this.pieces.length - 1].text += text.value;\n } else {\n const sourceSpan = new ParseSourceSpan(\n text.sourceSpan.fullStart,\n text.sourceSpan.end,\n text.sourceSpan.fullStart,\n text.sourceSpan.details,\n );\n this.pieces.push(new o.LiteralPiece(text.value, sourceSpan));\n }\n }\n\n visitContainer(container: i18n.Container): any {\n container.children.forEach((child) => child.visit(this));\n }\n\n visitIcu(icu: i18n.Icu): any {\n this.pieces.push(new o.LiteralPiece(serializeIcuNode(icu), icu.sourceSpan));\n }\n\n visitTagPlaceholder(ph: i18n.TagPlaceholder): any {\n this.pieces.push(\n this.createPlaceholderPiece(ph.startName, ph.startSourceSpan ?? ph.sourceSpan),\n );\n if (!ph.isVoid) {\n ph.children.forEach((child) => child.visit(this));\n this.pieces.push(\n this.createPlaceholderPiece(ph.closeName, ph.endSourceSpan ?? ph.sourceSpan),\n );\n }\n }\n\n visitPlaceholder(ph: i18n.Placeholder): any {\n this.pieces.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan));\n }\n\n visitBlockPlaceholder(ph: i18n.BlockPlaceholder): any {\n this.pieces.push(\n this.createPlaceholderPiece(ph.startName, ph.startSourceSpan ?? ph.sourceSpan),\n );\n ph.children.forEach((child) => child.visit(this));\n this.pieces.push(this.createPlaceholderPiece(ph.closeName, ph.endSourceSpan ?? ph.sourceSpan));\n }\n\n visitIcuPlaceholder(ph: i18n.IcuPlaceholder): any {\n this.pieces.push(\n this.createPlaceholderPiece(ph.name, ph.sourceSpan, this.placeholderToMessage[ph.name]),\n );\n }\n\n private createPlaceholderPiece(\n name: string,\n sourceSpan: ParseSourceSpan,\n associatedMessage?: i18n.Message,\n ): o.PlaceholderPiece {\n return new o.PlaceholderPiece(\n formatI18nPlaceholderName(name, /* useCamelCase */ false),\n sourceSpan,\n associatedMessage,\n );\n }\n}\n\n/**\n * Serialize an i18n message into two arrays: messageParts and placeholders.\n *\n * These arrays will be used to generate `$localize` tagged template literals.\n *\n * @param message The message to be serialized.\n * @returns an object containing the messageParts and placeholders.\n */\nexport function serializeI18nMessageForLocalize(message: i18n.Message): {\n messageParts: o.LiteralPiece[];\n placeHolders: o.PlaceholderPiece[];\n} {\n const pieces: o.MessagePiece[] = [];\n const serializerVisitor = new LocalizeSerializerVisitor(message.placeholderToMessage, pieces);\n message.nodes.forEach((node) => node.visit(serializerVisitor));\n return processMessagePieces(pieces);\n}\n\nfunction getSourceSpan(message: i18n.Message): ParseSourceSpan {\n const startNode = message.nodes[0];\n const endNode = message.nodes[message.nodes.length - 1];\n return new ParseSourceSpan(\n startNode.sourceSpan.fullStart,\n endNode.sourceSpan.end,\n startNode.sourceSpan.fullStart,\n startNode.sourceSpan.details,\n );\n}\n\n/**\n * Convert the list of serialized MessagePieces into two arrays.\n *\n * One contains the literal string pieces and the other the placeholders that will be replaced by\n * expressions when rendering `$localize` tagged template literals.\n *\n * @param pieces The pieces to process.\n * @returns an object containing the messageParts and placeholders.\n */\nfunction processMessagePieces(pieces: o.MessagePiece[]): {\n messageParts: o.LiteralPiece[];\n placeHolders: o.PlaceholderPiece[];\n} {\n const messageParts: o.LiteralPiece[] = [];\n const placeHolders: o.PlaceholderPiece[] = [];\n\n if (pieces[0] instanceof o.PlaceholderPiece) {\n // The first piece was a placeholder so we need to add an initial empty message part.\n messageParts.push(createEmptyMessagePart(pieces[0].sourceSpan.start));\n }\n\n for (let i = 0; i < pieces.length; i++) {\n const part = pieces[i];\n if (part instanceof o.LiteralPiece) {\n messageParts.push(part);\n } else {\n placeHolders.push(part);\n if (pieces[i - 1] instanceof o.PlaceholderPiece) {\n // There were two placeholders in a row, so we need to add an empty message part.\n messageParts.push(createEmptyMessagePart(pieces[i - 1].sourceSpan.end));\n }\n }\n }\n if (pieces[pieces.length - 1] instanceof o.PlaceholderPiece) {\n // The last piece was a placeholder so we need to add a final empty message part.\n messageParts.push(createEmptyMessagePart(pieces[pieces.length - 1].sourceSpan.end));\n }\n return {messageParts, placeHolders};\n}\n\nfunction createEmptyMessagePart(location: ParseLocation): o.LiteralPiece {\n return new o.LiteralPiece('', new ParseSourceSpan(location, location));\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {type ConstantPool} from '../../../../constant_pool';\nimport * as i18n from '../../../../i18n/i18n_ast';\nimport {mapLiteral} from '../../../../output/map_util';\nimport * as o from '../../../../output/output_ast';\nimport {sanitizeIdentifier} from '../../../../parse_util';\nimport {Identifiers} from '../../../../render3/r3_identifiers';\nimport {createGoogleGetMsgStatements} from '../../../../render3/view/i18n/get_msg_utils';\nimport {createLocalizeStatements} from '../../../../render3/view/i18n/localize_utils';\nimport {formatI18nPlaceholderNamesInMap} from '../../../../render3/view/i18n/util';\nimport * as ir from '../../ir';\nimport {ComponentCompilationJob} from '../compilation';\n\n/** Name of the global variable that is used to determine if we use Closure translations or not */\nconst NG_I18N_CLOSURE_MODE = 'ngI18nClosureMode';\n\n/**\n * Prefix for non-`goog.getMsg` i18n-related vars.\n * Note: the prefix uses lowercase characters intentionally due to a Closure behavior that\n * considers variables like `I18N_0` as constants and throws an error when their value changes.\n */\nconst TRANSLATION_VAR_PREFIX = 'i18n_';\n\n/** Prefix of ICU expressions for post processing */\nexport const I18N_ICU_MAPPING_PREFIX = 'I18N_EXP_';\n\n/**\n * The escape sequence used for message param values.\n */\nconst ESCAPE = '\\uFFFD';\n\n/* Closure variables holding messages must be named `MSG_[A-Z0-9]+` */\nconst CLOSURE_TRANSLATION_VAR_PREFIX = 'MSG_';\n\n/**\n * Generates a prefix for translation const name.\n *\n * @param extra Additional local prefix that should be injected into translation var name\n * @returns Complete translation const prefix\n */\nexport function getTranslationConstPrefix(extra: string): string {\n return `${CLOSURE_TRANSLATION_VAR_PREFIX}${extra}`.toUpperCase();\n}\n\n/**\n * Generate AST to declare a variable. E.g. `var I18N_1;`.\n * @param variable the name of the variable to declare.\n */\nexport function declareI18nVariable(variable: o.ReadVarExpr): o.Statement {\n return new o.DeclareVarStmt(\n variable.name!,\n undefined,\n o.INFERRED_TYPE,\n undefined,\n variable.sourceSpan,\n );\n}\n\n/**\n * Lifts i18n properties into the consts array.\n * TODO: Can we use `ConstCollectedExpr`?\n * TODO: The way the various attributes are linked together is very complex. Perhaps we could\n * simplify the process, maybe by combining the context and message ops?\n */\nexport function collectI18nConsts(job: ComponentCompilationJob): void {\n const fileBasedI18nSuffix =\n job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, '_').toUpperCase() + '_';\n // Step One: Build up various lookup maps we need to collect all the consts.\n\n // Context Xref -> Extracted Attribute Ops\n const extractedAttributesByI18nContext = new Map();\n // Element/ElementStart Xref -> I18n Attributes config op\n const i18nAttributesByElement = new Map();\n // Element/ElementStart Xref -> All I18n Expression ops for attrs on that target\n const i18nExpressionsByElement = new Map();\n // I18n Message Xref -> I18n Message Op (TODO: use a central op map)\n const messages = new Map();\n\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n if (op.kind === ir.OpKind.ExtractedAttribute && op.i18nContext !== null) {\n const attributes = extractedAttributesByI18nContext.get(op.i18nContext) ?? [];\n attributes.push(op);\n extractedAttributesByI18nContext.set(op.i18nContext, attributes);\n } else if (op.kind === ir.OpKind.I18nAttributes) {\n i18nAttributesByElement.set(op.target, op);\n } else if (\n op.kind === ir.OpKind.I18nExpression &&\n op.usage === ir.I18nExpressionFor.I18nAttribute\n ) {\n const expressions = i18nExpressionsByElement.get(op.target) ?? [];\n expressions.push(op);\n i18nExpressionsByElement.set(op.target, expressions);\n } else if (op.kind === ir.OpKind.I18nMessage) {\n messages.set(op.xref, op);\n }\n }\n }\n\n // Step Two: Serialize the extracted i18n messages for root i18n blocks and i18n attributes into\n // the const array.\n //\n // Also, each i18n message will have a variable expression that can refer to its\n // value. Store these expressions in the appropriate place:\n // 1. For normal i18n content, it also goes in the const array. We save the const index to use\n // later.\n // 2. For extracted attributes, it becomes the value of the extracted attribute instruction.\n // 3. For i18n bindings, it will go in a separate const array instruction below; for now, we just\n // save it.\n\n const i18nValuesByContext = new Map();\n const messageConstIndices = new Map();\n\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.I18nMessage) {\n if (op.messagePlaceholder === null) {\n const {mainVar, statements} = collectMessage(job, fileBasedI18nSuffix, messages, op);\n if (op.i18nBlock !== null) {\n // This is a regular i18n message with a corresponding i18n block. Collect it into the\n // const array.\n const i18nConst = job.addConst(mainVar, statements);\n messageConstIndices.set(op.i18nBlock, i18nConst);\n } else {\n // This is an i18n attribute. Extract the initializers into the const pool.\n job.constsInitializers.push(...statements);\n\n // Save the i18n variable value for later.\n i18nValuesByContext.set(op.i18nContext, mainVar);\n\n // This i18n message may correspond to an individual extracted attribute. If so, The\n // value of that attribute is updated to read the extracted i18n variable.\n const attributesForMessage = extractedAttributesByI18nContext.get(op.i18nContext);\n if (attributesForMessage !== undefined) {\n for (const attr of attributesForMessage) {\n attr.expression = mainVar.clone();\n }\n }\n }\n }\n ir.OpList.remove(op);\n }\n }\n }\n\n // Step Three: Serialize I18nAttributes configurations into the const array. Each I18nAttributes\n // instruction has a config array, which contains k-v pairs describing each binding name, and the\n // i18n variable that provides the value.\n\n for (const unit of job.units) {\n for (const elem of unit.create) {\n if (ir.isElementOrContainerOp(elem)) {\n const i18nAttributes = i18nAttributesByElement.get(elem.xref);\n if (i18nAttributes === undefined) {\n // This element is not associated with an i18n attributes configuration instruction.\n continue;\n }\n\n let i18nExpressions = i18nExpressionsByElement.get(elem.xref);\n if (i18nExpressions === undefined) {\n // Unused i18nAttributes should have already been removed.\n // TODO: Should the removal of those dead instructions be merged with this phase?\n throw new Error(\n 'AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction',\n );\n }\n\n // Find expressions for all the unique property names, removing duplicates.\n const seenPropertyNames = new Set();\n i18nExpressions = i18nExpressions.filter((i18nExpr) => {\n const seen = seenPropertyNames.has(i18nExpr.name);\n seenPropertyNames.add(i18nExpr.name);\n return !seen;\n });\n\n const i18nAttributeConfig = i18nExpressions.flatMap((i18nExpr) => {\n const i18nExprValue = i18nValuesByContext.get(i18nExpr.context);\n if (i18nExprValue === undefined) {\n throw new Error(\"AssertionError: Could not find i18n expression's value\");\n }\n return [o.literal(i18nExpr.name), i18nExprValue];\n });\n\n i18nAttributes.i18nAttributesConfig = job.addConst(\n new o.LiteralArrayExpr(i18nAttributeConfig),\n );\n }\n }\n }\n\n // Step Four: Propagate the extracted const index into i18n ops that messages were extracted from.\n\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.I18nStart) {\n const msgIndex = messageConstIndices.get(op.root);\n if (msgIndex === undefined) {\n throw new Error(\n 'AssertionError: Could not find corresponding i18n block index for an i18n message op; was an i18n message incorrectly assumed to correspond to an attribute?',\n );\n }\n op.messageIndex = msgIndex;\n }\n }\n }\n}\n\n/**\n * Collects the given message into a set of statements that can be added to the const array.\n * This will recursively collect any sub-messages referenced from the parent message as well.\n */\nfunction collectMessage(\n job: ComponentCompilationJob,\n fileBasedI18nSuffix: string,\n messages: Map,\n messageOp: ir.I18nMessageOp,\n): {mainVar: o.ReadVarExpr; statements: o.Statement[]} {\n // Recursively collect any sub-messages, record each sub-message's main variable under its\n // placeholder so that we can add them to the params for the parent message. It is possible\n // that multiple sub-messages will share the same placeholder, so we need to track an array of\n // variables for each placeholder.\n const statements: o.Statement[] = [];\n const subMessagePlaceholders = new Map();\n for (const subMessageId of messageOp.subMessages) {\n const subMessage = messages.get(subMessageId)!;\n const {mainVar: subMessageVar, statements: subMessageStatements} = collectMessage(\n job,\n fileBasedI18nSuffix,\n messages,\n subMessage,\n );\n statements.push(...subMessageStatements);\n const subMessages = subMessagePlaceholders.get(subMessage.messagePlaceholder!) ?? [];\n subMessages.push(subMessageVar);\n subMessagePlaceholders.set(subMessage.messagePlaceholder!, subMessages);\n }\n addSubMessageParams(messageOp, subMessagePlaceholders);\n\n // Sort the params for consistency with TemaplateDefinitionBuilder output.\n messageOp.params = new Map([...messageOp.params.entries()].sort());\n\n const mainVar = o.variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX));\n // Closure Compiler requires const names to start with `MSG_` but disallows any other\n // const to start with `MSG_`. We define a variable starting with `MSG_` just for the\n // `goog.getMsg` call\n const closureVar = i18nGenerateClosureVar(\n job.pool,\n messageOp.message.id,\n fileBasedI18nSuffix,\n job.i18nUseExternalIds,\n );\n let transformFn = undefined;\n\n // If nescessary, add a post-processing step and resolve any placeholder params that are\n // set in post-processing.\n if (messageOp.needsPostprocessing || messageOp.postprocessingParams.size > 0) {\n // Sort the post-processing params for consistency with TemaplateDefinitionBuilder output.\n const postprocessingParams = Object.fromEntries(\n [...messageOp.postprocessingParams.entries()].sort(),\n );\n const formattedPostprocessingParams = formatI18nPlaceholderNamesInMap(\n postprocessingParams,\n /* useCamelCase */ false,\n );\n const extraTransformFnParams: o.Expression[] = [];\n if (messageOp.postprocessingParams.size > 0) {\n extraTransformFnParams.push(mapLiteral(formattedPostprocessingParams, /* quoted */ true));\n }\n transformFn = (expr: o.ReadVarExpr) =>\n o.importExpr(Identifiers.i18nPostprocess).callFn([expr, ...extraTransformFnParams]);\n }\n\n // Add the message's statements\n statements.push(\n ...getTranslationDeclStmts(\n messageOp.message,\n mainVar,\n closureVar,\n messageOp.params,\n transformFn,\n ),\n );\n\n return {mainVar, statements};\n}\n\n/**\n * Adds the given subMessage placeholders to the given message op.\n *\n * If a placeholder only corresponds to a single sub-message variable, we just set that variable\n * as the param value. However, if the placeholder corresponds to multiple sub-message\n * variables, we need to add a special placeholder value that is handled by the post-processing\n * step. We then add the array of variables as a post-processing param.\n */\nfunction addSubMessageParams(\n messageOp: ir.I18nMessageOp,\n subMessagePlaceholders: Map,\n) {\n for (const [placeholder, subMessages] of subMessagePlaceholders) {\n if (subMessages.length === 1) {\n messageOp.params.set(placeholder, subMessages[0]);\n } else {\n messageOp.params.set(\n placeholder,\n o.literal(`${ESCAPE}${I18N_ICU_MAPPING_PREFIX}${placeholder}${ESCAPE}`),\n );\n messageOp.postprocessingParams.set(placeholder, o.literalArr(subMessages));\n }\n }\n}\n\n/**\n * Generate statements that define a given translation message.\n *\n * ```ts\n * var I18N_1;\n * if (typeof ngI18nClosureMode !== undefined && ngI18nClosureMode) {\n * var MSG_EXTERNAL_XXX = goog.getMsg(\n * \"Some message with {$interpolation}!\",\n * { \"interpolation\": \"\\uFFFD0\\uFFFD\" }\n * );\n * I18N_1 = MSG_EXTERNAL_XXX;\n * }\n * else {\n * I18N_1 = $localize`Some message with ${'\\uFFFD0\\uFFFD'}!`;\n * }\n * ```\n *\n * @param message The original i18n AST message node\n * @param variable The variable that will be assigned the translation, e.g. `I18N_1`.\n * @param closureVar The variable for Closure `goog.getMsg` calls, e.g. `MSG_EXTERNAL_XXX`.\n * @param params Object mapping placeholder names to their values (e.g.\n * `{ \"interpolation\": \"\\uFFFD0\\uFFFD\" }`).\n * @param transformFn Optional transformation function that will be applied to the translation\n * (e.g.\n * post-processing).\n * @returns An array of statements that defined a given translation.\n */\nfunction getTranslationDeclStmts(\n message: i18n.Message,\n variable: o.ReadVarExpr,\n closureVar: o.ReadVarExpr,\n params: Map,\n transformFn?: (raw: o.ReadVarExpr) => o.Expression,\n): o.Statement[] {\n const paramsObject = Object.fromEntries(params);\n const statements: o.Statement[] = [\n declareI18nVariable(variable),\n o.ifStmt(\n createClosureModeGuard(),\n createGoogleGetMsgStatements(variable, message, closureVar, paramsObject),\n createLocalizeStatements(\n variable,\n message,\n formatI18nPlaceholderNamesInMap(paramsObject, /* useCamelCase */ false),\n ),\n ),\n ];\n\n if (transformFn) {\n statements.push(new o.ExpressionStatement(variable.set(transformFn(variable))));\n }\n\n return statements;\n}\n\n/**\n * Create the expression that will be used to guard the closure mode block\n * It is equivalent to:\n *\n * ```ts\n * typeof ngI18nClosureMode !== undefined && ngI18nClosureMode\n * ```\n */\nfunction createClosureModeGuard(): o.BinaryOperatorExpr {\n return o\n .typeofExpr(o.variable(NG_I18N_CLOSURE_MODE))\n .notIdentical(o.literal('undefined', o.STRING_TYPE))\n .and(o.variable(NG_I18N_CLOSURE_MODE));\n}\n\n/**\n * Generates vars with Closure-specific names for i18n blocks (i.e. `MSG_XXX`).\n */\nfunction i18nGenerateClosureVar(\n pool: ConstantPool,\n messageId: string,\n fileBasedI18nSuffix: string,\n useExternalIds: boolean,\n): o.ReadVarExpr {\n let name: string;\n const suffix = fileBasedI18nSuffix;\n if (useExternalIds) {\n const prefix = getTranslationConstPrefix(`EXTERNAL_`);\n const uniqueSuffix = pool.uniqueName(suffix);\n name = `${prefix}${sanitizeIdentifier(messageId)}$$${uniqueSuffix}`;\n } else {\n const prefix = getTranslationConstPrefix(suffix);\n name = pool.uniqueName(prefix);\n }\n return o.variable(name);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * Removes text nodes within i18n blocks since they are already hardcoded into the i18n message.\n * Also, replaces interpolations on these text nodes with i18n expressions of the non-text portions,\n * which will be applied later.\n */\nexport function convertI18nText(job: CompilationJob): void {\n for (const unit of job.units) {\n // Remove all text nodes within i18n blocks, their content is already captured in the i18n\n // message.\n let currentI18n: ir.I18nStartOp | null = null;\n let currentIcu: ir.IcuStartOp | null = null;\n const textNodeI18nBlocks = new Map();\n const textNodeIcus = new Map();\n const icuPlaceholderByText = new Map();\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nStart:\n if (op.context === null) {\n throw Error('I18n op should have its context set.');\n }\n currentI18n = op;\n break;\n case ir.OpKind.I18nEnd:\n currentI18n = null;\n break;\n case ir.OpKind.IcuStart:\n if (op.context === null) {\n throw Error('Icu op should have its context set.');\n }\n currentIcu = op;\n break;\n case ir.OpKind.IcuEnd:\n currentIcu = null;\n break;\n case ir.OpKind.Text:\n if (currentI18n !== null) {\n textNodeI18nBlocks.set(op.xref, currentI18n);\n textNodeIcus.set(op.xref, currentIcu);\n if (op.icuPlaceholder !== null) {\n // Create an op to represent the ICU placeholder. Initially set its static text to the\n // value of the text op, though this may be overwritten later if this text op is a\n // placeholder for an interpolation.\n const icuPlaceholderOp = ir.createIcuPlaceholderOp(\n job.allocateXrefId(),\n op.icuPlaceholder,\n [op.initialValue],\n );\n ir.OpList.replace(op, icuPlaceholderOp);\n icuPlaceholderByText.set(op.xref, icuPlaceholderOp);\n } else {\n // Otherwise just remove the text op, since its value is already accounted for in the\n // translated message.\n ir.OpList.remove(op);\n }\n }\n break;\n }\n }\n\n // Update any interpolations to the removed text, and instead represent them as a series of i18n\n // expressions that we then apply.\n for (const op of unit.update) {\n switch (op.kind) {\n case ir.OpKind.InterpolateText:\n if (!textNodeI18nBlocks.has(op.target)) {\n continue;\n }\n\n const i18nOp = textNodeI18nBlocks.get(op.target)!;\n const icuOp = textNodeIcus.get(op.target);\n const icuPlaceholder = icuPlaceholderByText.get(op.target);\n const contextId = icuOp ? icuOp.context : i18nOp.context;\n const resolutionTime = icuOp\n ? ir.I18nParamResolutionTime.Postproccessing\n : ir.I18nParamResolutionTime.Creation;\n const ops: ir.I18nExpressionOp[] = [];\n for (let i = 0; i < op.interpolation.expressions.length; i++) {\n const expr = op.interpolation.expressions[i];\n // For now, this i18nExpression depends on the slot context of the enclosing i18n block.\n // Later, we will modify this, and advance to a different point.\n ops.push(\n ir.createI18nExpressionOp(\n contextId!,\n i18nOp.xref,\n i18nOp.xref,\n i18nOp.handle,\n expr,\n icuPlaceholder?.xref ?? null,\n op.interpolation.i18nPlaceholders[i] ?? null,\n resolutionTime,\n ir.I18nExpressionFor.I18nText,\n '',\n expr.sourceSpan ?? op.sourceSpan,\n ),\n );\n }\n ir.OpList.replaceWithMany(op as ir.UpdateOp, ops);\n // If this interpolation is part of an ICU placeholder, add the strings and expressions to\n // the placeholder.\n if (icuPlaceholder !== undefined) {\n icuPlaceholder.strings = op.interpolation.strings;\n }\n break;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\n\nimport type {ComponentCompilationJob} from '../compilation';\n\n/**\n * Lifts local reference declarations on element-like structures within each view into an entry in\n * the `consts` array for the whole component.\n */\nexport function liftLocalRefs(job: ComponentCompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.ElementStart:\n case ir.OpKind.Template:\n if (!Array.isArray(op.localRefs)) {\n throw new Error(`AssertionError: expected localRefs to be an array still`);\n }\n op.numSlotsUsed += op.localRefs.length;\n\n if (op.localRefs.length > 0) {\n const localRefs = serializeLocalRefs(op.localRefs);\n op.localRefs = job.addConst(localRefs);\n } else {\n op.localRefs = null;\n }\n break;\n }\n }\n }\n}\n\nfunction serializeLocalRefs(refs: ir.LocalRef[]): o.Expression {\n const constRefs: o.Expression[] = [];\n for (const ref of refs) {\n constRefs.push(o.literal(ref.name), o.literal(ref.target));\n }\n return o.literalArr(constRefs);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Change namespaces between HTML, SVG and MathML, depending on the next element.\n */\nexport function emitNamespaceChanges(job: CompilationJob): void {\n for (const unit of job.units) {\n let activeNamespace = ir.Namespace.HTML;\n\n for (const op of unit.create) {\n if (op.kind !== ir.OpKind.ElementStart) {\n continue;\n }\n if (op.namespace !== activeNamespace) {\n ir.OpList.insertBefore(ir.createNamespaceOp(op.namespace), op);\n activeNamespace = op.namespace;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SecurityContext} from '../../../../core';\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\n\nimport type {CompilationJob} from '../compilation';\n\n// Any changes here should be ported to the Angular Domino fork.\n// https://github.com/angular/domino/blob/main/lib/style_parser.js\n\nconst enum Char {\n OpenParen = 40,\n CloseParen = 41,\n Colon = 58,\n Semicolon = 59,\n BackSlash = 92,\n QuoteNone = 0, // indicating we are not inside a quote\n QuoteDouble = 34,\n QuoteSingle = 39,\n}\n\n/**\n * Parses string representation of a style and converts it into object literal.\n *\n * @param value string representation of style as used in the `style` attribute in HTML.\n * Example: `color: red; height: auto`.\n * @returns An array of style property name and value pairs, e.g. `['color', 'red', 'height',\n * 'auto']`\n */\nexport function parse(value: string): string[] {\n // we use a string array here instead of a string map\n // because a string-map is not guaranteed to retain the\n // order of the entries whereas a string array can be\n // constructed in a [key, value, key, value] format.\n const styles: string[] = [];\n\n let i = 0;\n let parenDepth = 0;\n let quote: Char = Char.QuoteNone;\n let valueStart = 0;\n let propStart = 0;\n let currentProp: string | null = null;\n while (i < value.length) {\n const token = value.charCodeAt(i++) as Char;\n switch (token) {\n case Char.OpenParen:\n parenDepth++;\n break;\n case Char.CloseParen:\n parenDepth--;\n break;\n case Char.QuoteSingle:\n // valueStart needs to be there since prop values don't\n // have quotes in CSS\n if (quote === Char.QuoteNone) {\n quote = Char.QuoteSingle;\n } else if (quote === Char.QuoteSingle && value.charCodeAt(i - 1) !== Char.BackSlash) {\n quote = Char.QuoteNone;\n }\n break;\n case Char.QuoteDouble:\n // same logic as above\n if (quote === Char.QuoteNone) {\n quote = Char.QuoteDouble;\n } else if (quote === Char.QuoteDouble && value.charCodeAt(i - 1) !== Char.BackSlash) {\n quote = Char.QuoteNone;\n }\n break;\n case Char.Colon:\n if (!currentProp && parenDepth === 0 && quote === Char.QuoteNone) {\n // TODO: Do not hyphenate CSS custom property names like: `--intentionallyCamelCase`\n currentProp = hyphenate(value.substring(propStart, i - 1).trim());\n valueStart = i;\n }\n break;\n case Char.Semicolon:\n if (currentProp && valueStart > 0 && parenDepth === 0 && quote === Char.QuoteNone) {\n const styleVal = value.substring(valueStart, i - 1).trim();\n styles.push(currentProp, styleVal);\n propStart = i;\n valueStart = 0;\n currentProp = null;\n }\n break;\n }\n }\n\n if (currentProp && valueStart) {\n const styleVal = value.slice(valueStart).trim();\n styles.push(currentProp, styleVal);\n }\n\n return styles;\n}\n\nexport function hyphenate(value: string): string {\n return value\n .replace(/[a-z][A-Z]/g, (v) => {\n return v.charAt(0) + '-' + v.charAt(1);\n })\n .toLowerCase();\n}\n\n/**\n * Parses extracted style and class attributes into separate ExtractedAttributeOps per style or\n * class property.\n */\nexport function parseExtractedStyles(job: CompilationJob) {\n const elements = new Map();\n\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (ir.isElementOrContainerOp(op)) {\n elements.set(op.xref, op);\n }\n }\n }\n\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (\n op.kind === ir.OpKind.ExtractedAttribute &&\n op.bindingKind === ir.BindingKind.Attribute &&\n ir.isStringLiteral(op.expression!)\n ) {\n const target = elements.get(op.target)!;\n\n if (\n target !== undefined &&\n target.kind === ir.OpKind.Template &&\n target.templateKind === ir.TemplateKind.Structural\n ) {\n // TemplateDefinitionBuilder will not apply class and style bindings to structural\n // directives; instead, it will leave them as attributes.\n // (It's not clear what that would mean, anyway -- classes and styles on a structural\n // element should probably be a parse error.)\n // TODO: We may be able to remove this once Template Pipeline is the default.\n continue;\n }\n\n if (op.name === 'style') {\n const parsedStyles = parse(op.expression.value);\n for (let i = 0; i < parsedStyles.length - 1; i += 2) {\n ir.OpList.insertBefore(\n ir.createExtractedAttributeOp(\n op.target,\n ir.BindingKind.StyleProperty,\n null,\n parsedStyles[i],\n o.literal(parsedStyles[i + 1]),\n null,\n null,\n SecurityContext.STYLE,\n ),\n op,\n );\n }\n ir.OpList.remove(op);\n } else if (op.name === 'class') {\n const parsedClasses = op.expression.value.trim().split(/\\s+/g);\n for (const parsedClass of parsedClasses) {\n ir.OpList.insertBefore(\n ir.createExtractedAttributeOp(\n op.target,\n ir.BindingKind.ClassName,\n null,\n parsedClass,\n null,\n null,\n null,\n SecurityContext.NONE,\n ),\n op,\n );\n }\n ir.OpList.remove(op);\n }\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {sanitizeIdentifier} from '../../../../parse_util';\nimport * as ir from '../../ir';\n\nimport {hyphenate} from './parse_extracted_styles';\n\nimport {type CompilationJob, type CompilationUnit, ViewCompilationUnit} from '../compilation';\n\n/**\n * Generate names for functions and variables across all views.\n *\n * This includes propagating those names into any `ir.ReadVariableExpr`s of those variables, so that\n * the reads can be emitted correctly.\n */\nexport function nameFunctionsAndVariables(job: CompilationJob): void {\n addNamesToView(\n job.root,\n job.componentName,\n {index: 0},\n job.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder,\n );\n}\n\nfunction addNamesToView(\n unit: CompilationUnit,\n baseName: string,\n state: {index: number},\n compatibility: boolean,\n): void {\n if (unit.fnName === null) {\n // Ensure unique names for view units. This is necessary because there might be multiple\n // components with same names in the context of the same pool. Only add the suffix\n // if really needed.\n unit.fnName = unit.job.pool.uniqueName(\n sanitizeIdentifier(`${baseName}_${unit.job.fnSuffix}`),\n /* alwaysIncludeSuffix */ false,\n );\n }\n\n // Keep track of the names we assign to variables in the view. We'll need to propagate these\n // into reads of those variables afterwards.\n const varNames = new Map();\n\n for (const op of unit.ops()) {\n switch (op.kind) {\n case ir.OpKind.Property:\n case ir.OpKind.HostProperty:\n if (op.isAnimationTrigger) {\n op.name = '@' + op.name;\n }\n break;\n case ir.OpKind.Listener:\n if (op.handlerFnName !== null) {\n break;\n }\n if (!op.hostListener && op.targetSlot.slot === null) {\n throw new Error(`Expected a slot to be assigned`);\n }\n let animation = '';\n if (op.isAnimationListener) {\n op.name = `@${op.name}.${op.animationPhase}`;\n animation = 'animation';\n }\n if (op.hostListener) {\n op.handlerFnName = `${baseName}_${animation}${op.name}_HostBindingHandler`;\n } else {\n op.handlerFnName = `${unit.fnName}_${op.tag!.replace('-', '_')}_${animation}${op.name}_${\n op.targetSlot.slot\n }_listener`;\n }\n op.handlerFnName = sanitizeIdentifier(op.handlerFnName);\n break;\n case ir.OpKind.TwoWayListener:\n if (op.handlerFnName !== null) {\n break;\n }\n if (op.targetSlot.slot === null) {\n throw new Error(`Expected a slot to be assigned`);\n }\n op.handlerFnName = sanitizeIdentifier(\n `${unit.fnName}_${op.tag!.replace('-', '_')}_${op.name}_${op.targetSlot.slot}_listener`,\n );\n break;\n case ir.OpKind.Variable:\n varNames.set(op.xref, getVariableName(unit, op.variable, state));\n break;\n case ir.OpKind.RepeaterCreate:\n if (!(unit instanceof ViewCompilationUnit)) {\n throw new Error(`AssertionError: must be compiling a component`);\n }\n if (op.handle.slot === null) {\n throw new Error(`Expected slot to be assigned`);\n }\n if (op.emptyView !== null) {\n const emptyView = unit.job.views.get(op.emptyView)!;\n // Repeater empty view function is at slot +2 (metadata is in the first slot).\n addNamesToView(\n emptyView,\n `${baseName}_${op.functionNameSuffix}Empty_${op.handle.slot + 2}`,\n state,\n compatibility,\n );\n }\n // Repeater primary view function is at slot +1 (metadata is in the first slot).\n addNamesToView(\n unit.job.views.get(op.xref)!,\n `${baseName}_${op.functionNameSuffix}_${op.handle.slot + 1}`,\n state,\n compatibility,\n );\n break;\n case ir.OpKind.Projection:\n if (!(unit instanceof ViewCompilationUnit)) {\n throw new Error(`AssertionError: must be compiling a component`);\n }\n if (op.handle.slot === null) {\n throw new Error(`Expected slot to be assigned`);\n }\n if (op.fallbackView !== null) {\n const fallbackView = unit.job.views.get(op.fallbackView)!;\n addNamesToView(\n fallbackView,\n `${baseName}_ProjectionFallback_${op.handle.slot}`,\n state,\n compatibility,\n );\n }\n break;\n case ir.OpKind.Template:\n if (!(unit instanceof ViewCompilationUnit)) {\n throw new Error(`AssertionError: must be compiling a component`);\n }\n const childView = unit.job.views.get(op.xref)!;\n if (op.handle.slot === null) {\n throw new Error(`Expected slot to be assigned`);\n }\n const suffix = op.functionNameSuffix.length === 0 ? '' : `_${op.functionNameSuffix}`;\n addNamesToView(childView, `${baseName}${suffix}_${op.handle.slot}`, state, compatibility);\n break;\n case ir.OpKind.StyleProp:\n op.name = normalizeStylePropName(op.name);\n if (compatibility) {\n op.name = stripImportant(op.name);\n }\n break;\n case ir.OpKind.ClassProp:\n if (compatibility) {\n op.name = stripImportant(op.name);\n }\n break;\n }\n }\n\n // Having named all variables declared in the view, now we can push those names into the\n // `ir.ReadVariableExpr` expressions which represent reads of those variables.\n for (const op of unit.ops()) {\n ir.visitExpressionsInOp(op, (expr) => {\n if (!(expr instanceof ir.ReadVariableExpr) || expr.name !== null) {\n return;\n }\n if (!varNames.has(expr.xref)) {\n throw new Error(`Variable ${expr.xref} not yet named`);\n }\n expr.name = varNames.get(expr.xref)!;\n });\n }\n}\n\nfunction getVariableName(\n unit: CompilationUnit,\n variable: ir.SemanticVariable,\n state: {index: number},\n): string {\n if (variable.name === null) {\n switch (variable.kind) {\n case ir.SemanticVariableKind.Context:\n variable.name = `ctx_r${state.index++}`;\n break;\n case ir.SemanticVariableKind.Identifier:\n if (unit.job.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder) {\n // TODO: Prefix increment and `_r` are for compatibility with the old naming scheme.\n // This has the potential to cause collisions when `ctx` is the identifier, so we need a\n // special check for that as well.\n const compatPrefix = variable.identifier === 'ctx' ? 'i' : '';\n variable.name = `${variable.identifier}_${compatPrefix}r${++state.index}`;\n } else {\n variable.name = `${variable.identifier}_i${state.index++}`;\n }\n\n break;\n default:\n // TODO: Prefix increment for compatibility only.\n variable.name = `_r${++state.index}`;\n break;\n }\n }\n return variable.name;\n}\n\n/**\n * Normalizes a style prop name by hyphenating it (unless its a CSS variable).\n */\nfunction normalizeStylePropName(name: string) {\n return name.startsWith('--') ? name : hyphenate(name);\n}\n\n/**\n * Strips `!important` out of the given style or class name.\n */\nfunction stripImportant(name: string) {\n const importantIndex = name.indexOf('!important');\n if (importantIndex > -1) {\n return name.substring(0, importantIndex);\n }\n return name;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\n\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Merges logically sequential `NextContextExpr` operations.\n *\n * `NextContextExpr` can be referenced repeatedly, \"popping\" the runtime's context stack each time.\n * When two such expressions appear back-to-back, it's possible to merge them together into a single\n * `NextContextExpr` that steps multiple contexts. This merging is possible if all conditions are\n * met:\n *\n * * The result of the `NextContextExpr` that's folded into the subsequent one is not stored (that\n * is, the call is purely side-effectful).\n * * No operations in between them uses the implicit context.\n */\nexport function mergeNextContextExpressions(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.Listener || op.kind === ir.OpKind.TwoWayListener) {\n mergeNextContextsInOps(op.handlerOps);\n }\n }\n mergeNextContextsInOps(unit.update);\n }\n}\n\nfunction mergeNextContextsInOps(ops: ir.OpList): void {\n for (const op of ops) {\n // Look for a candidate operation to maybe merge.\n if (\n op.kind !== ir.OpKind.Statement ||\n !(op.statement instanceof o.ExpressionStatement) ||\n !(op.statement.expr instanceof ir.NextContextExpr)\n ) {\n continue;\n }\n\n const mergeSteps = op.statement.expr.steps;\n\n // Try to merge this `ir.NextContextExpr`.\n let tryToMerge = true;\n for (\n let candidate = op.next!;\n candidate.kind !== ir.OpKind.ListEnd && tryToMerge;\n candidate = candidate.next!\n ) {\n ir.visitExpressionsInOp(candidate, (expr, flags) => {\n if (!ir.isIrExpression(expr)) {\n return expr;\n }\n\n if (!tryToMerge) {\n // Either we've already merged, or failed to merge.\n return;\n }\n\n if (flags & ir.VisitorContextFlag.InChildOperation) {\n // We cannot merge into child operations.\n return;\n }\n\n switch (expr.kind) {\n case ir.ExpressionKind.NextContext:\n // Merge the previous `ir.NextContextExpr` into this one.\n expr.steps += mergeSteps;\n ir.OpList.remove(op as ir.UpdateOp);\n tryToMerge = false;\n break;\n case ir.ExpressionKind.GetCurrentView:\n case ir.ExpressionKind.Reference:\n case ir.ExpressionKind.ContextLetReference:\n // Can't merge past a dependency on the context.\n tryToMerge = false;\n break;\n }\n return;\n });\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\nconst CONTAINER_TAG = 'ng-container';\n\n/**\n * Replace an `Element` or `ElementStart` whose tag is `ng-container` with a specific op.\n */\nexport function generateNgContainerOps(job: CompilationJob): void {\n for (const unit of job.units) {\n const updatedElementXrefs = new Set();\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.ElementStart && op.tag === CONTAINER_TAG) {\n // Transmute the `ElementStart` instruction to `ContainerStart`.\n (op as ir.Op).kind = ir.OpKind.ContainerStart;\n updatedElementXrefs.add(op.xref);\n }\n\n if (op.kind === ir.OpKind.ElementEnd && updatedElementXrefs.has(op.xref)) {\n // This `ElementEnd` is associated with an `ElementStart` we already transmuted.\n (op as ir.Op).kind = ir.OpKind.ContainerEnd;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Looks up an element in the given map by xref ID.\n */\nfunction lookupElement(\n elements: Map,\n xref: ir.XrefId,\n): ir.ElementOrContainerOps {\n const el = elements.get(xref);\n if (el === undefined) {\n throw new Error('All attributes should have an element-like target.');\n }\n return el;\n}\n\n/**\n * When a container is marked with `ngNonBindable`, the non-bindable characteristic also applies to\n * all descendants of that container. Therefore, we must emit `disableBindings` and `enableBindings`\n * instructions for every such container.\n */\nexport function disableBindings(job: CompilationJob): void {\n const elements = new Map();\n for (const view of job.units) {\n for (const op of view.create) {\n if (!ir.isElementOrContainerOp(op)) {\n continue;\n }\n elements.set(op.xref, op);\n }\n }\n\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (\n (op.kind === ir.OpKind.ElementStart || op.kind === ir.OpKind.ContainerStart) &&\n op.nonBindable\n ) {\n ir.OpList.insertAfter(ir.createDisableBindingsOp(op.xref), op);\n }\n if (\n (op.kind === ir.OpKind.ElementEnd || op.kind === ir.OpKind.ContainerEnd) &&\n lookupElement(elements, op.xref).nonBindable\n ) {\n ir.OpList.insertBefore(ir.createEnableBindingsOp(op.xref), op);\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Nullish coalescing expressions such as `a ?? b` have different semantics in Angular templates as\n * compared to JavaScript. In particular, they default to `null` instead of `undefined`. Therefore,\n * we replace them with ternary expressions, assigning temporaries as needed to avoid re-evaluating\n * the same sub-expression multiple times.\n */\nexport function generateNullishCoalesceExpressions(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n ir.transformExpressionsInOp(\n op,\n (expr) => {\n if (\n !(expr instanceof o.BinaryOperatorExpr) ||\n expr.operator !== o.BinaryOperator.NullishCoalesce\n ) {\n return expr;\n }\n\n const assignment = new ir.AssignTemporaryExpr(expr.lhs.clone(), job.allocateXrefId());\n const read = new ir.ReadTemporaryExpr(assignment.xref);\n\n // TODO: When not in compatibility mode for TemplateDefinitionBuilder, we can just emit\n // `t != null` instead of including an undefined check as well.\n return new o.ConditionalExpr(\n new o.BinaryOperatorExpr(\n o.BinaryOperator.And,\n new o.BinaryOperatorExpr(o.BinaryOperator.NotIdentical, assignment, o.NULL_EXPR),\n new o.BinaryOperatorExpr(\n o.BinaryOperator.NotIdentical,\n read,\n new o.LiteralExpr(undefined),\n ),\n ),\n read.clone(),\n expr.rhs,\n );\n },\n ir.VisitorContextFlag.None,\n );\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {CompilationJobKind, type CompilationJob} from '../compilation';\n\nfunction kindTest(kind: ir.OpKind): (op: ir.UpdateOp) => boolean {\n return (op: ir.UpdateOp) => op.kind === kind;\n}\n\nfunction kindWithInterpolationTest(\n kind: ir.OpKind.Attribute | ir.OpKind.Property | ir.OpKind.HostProperty,\n interpolation: boolean,\n): (op: ir.UpdateOp) => boolean {\n return (op: ir.UpdateOp) => {\n return op.kind === kind && interpolation === op.expression instanceof ir.Interpolation;\n };\n}\n\nfunction basicListenerKindTest(op: ir.CreateOp): boolean {\n return (\n (op.kind === ir.OpKind.Listener && !(op.hostListener && op.isAnimationListener)) ||\n op.kind === ir.OpKind.TwoWayListener\n );\n}\n\nfunction nonInterpolationPropertyKindTest(op: ir.UpdateOp): boolean {\n return (\n (op.kind === ir.OpKind.Property || op.kind === ir.OpKind.TwoWayProperty) &&\n !(op.expression instanceof ir.Interpolation)\n );\n}\n\ninterface Rule {\n test: (op: T) => boolean;\n transform?: (ops: Array) => Array;\n}\n\n/**\n * Defines the groups based on `OpKind` that ops will be divided into, for the various create\n * op kinds. Ops will be collected into groups, then optionally transformed, before recombining\n * the groups in the order defined here.\n */\nconst CREATE_ORDERING: Array> = [\n {test: (op) => op.kind === ir.OpKind.Listener && op.hostListener && op.isAnimationListener},\n {test: basicListenerKindTest},\n];\n\n/**\n * Defines the groups based on `OpKind` that ops will be divided into, for the various update\n * op kinds.\n */\nconst UPDATE_ORDERING: Array> = [\n {test: kindTest(ir.OpKind.StyleMap), transform: keepLast},\n {test: kindTest(ir.OpKind.ClassMap), transform: keepLast},\n {test: kindTest(ir.OpKind.StyleProp)},\n {test: kindTest(ir.OpKind.ClassProp)},\n {test: kindWithInterpolationTest(ir.OpKind.Attribute, true)},\n {test: kindWithInterpolationTest(ir.OpKind.Property, true)},\n {test: nonInterpolationPropertyKindTest},\n {test: kindWithInterpolationTest(ir.OpKind.Attribute, false)},\n];\n\n/**\n * Host bindings have their own update ordering.\n */\nconst UPDATE_HOST_ORDERING: Array> = [\n {test: kindWithInterpolationTest(ir.OpKind.HostProperty, true)},\n {test: kindWithInterpolationTest(ir.OpKind.HostProperty, false)},\n {test: kindTest(ir.OpKind.Attribute)},\n {test: kindTest(ir.OpKind.StyleMap), transform: keepLast},\n {test: kindTest(ir.OpKind.ClassMap), transform: keepLast},\n {test: kindTest(ir.OpKind.StyleProp)},\n {test: kindTest(ir.OpKind.ClassProp)},\n];\n\n/**\n * The set of all op kinds we handle in the reordering phase.\n */\nconst handledOpKinds = new Set([\n ir.OpKind.Listener,\n ir.OpKind.TwoWayListener,\n ir.OpKind.StyleMap,\n ir.OpKind.ClassMap,\n ir.OpKind.StyleProp,\n ir.OpKind.ClassProp,\n ir.OpKind.Property,\n ir.OpKind.TwoWayProperty,\n ir.OpKind.HostProperty,\n ir.OpKind.Attribute,\n]);\n\n/**\n * Many type of operations have ordering constraints that must be respected. For example, a\n * `ClassMap` instruction must be ordered after a `StyleMap` instruction, in order to have\n * predictable semantics that match TemplateDefinitionBuilder and don't break applications.\n */\nexport function orderOps(job: CompilationJob) {\n for (const unit of job.units) {\n // First, we pull out ops that need to be ordered. Then, when we encounter an op that shouldn't\n // be reordered, put the ones we've pulled so far back in the correct order. Finally, if we\n // still have ops pulled at the end, put them back in the correct order.\n\n // Create mode:\n orderWithin(unit.create, CREATE_ORDERING as Array>);\n\n // Update mode:\n const ordering =\n unit.job.kind === CompilationJobKind.Host ? UPDATE_HOST_ORDERING : UPDATE_ORDERING;\n orderWithin(unit.update, ordering as Array>);\n }\n}\n\n/**\n * Order all the ops within the specified group.\n */\nfunction orderWithin(\n opList: ir.OpList,\n ordering: Array>,\n) {\n let opsToOrder: Array = [];\n // Only reorder ops that target the same xref; do not mix ops that target different xrefs.\n let firstTargetInGroup: ir.XrefId | null = null;\n for (const op of opList) {\n const currentTarget = ir.hasDependsOnSlotContextTrait(op) ? op.target : null;\n if (\n !handledOpKinds.has(op.kind) ||\n (currentTarget !== firstTargetInGroup &&\n firstTargetInGroup !== null &&\n currentTarget !== null)\n ) {\n ir.OpList.insertBefore(reorder(opsToOrder, ordering), op);\n opsToOrder = [];\n firstTargetInGroup = null;\n }\n if (handledOpKinds.has(op.kind)) {\n opsToOrder.push(op);\n ir.OpList.remove(op);\n firstTargetInGroup = currentTarget ?? firstTargetInGroup;\n }\n }\n opList.push(reorder(opsToOrder, ordering));\n}\n\n/**\n * Reorders the given list of ops according to the ordering defined by `ORDERING`.\n */\nfunction reorder(\n ops: Array,\n ordering: Array>,\n): Array {\n // Break the ops list into groups based on OpKind.\n const groups = Array.from(ordering, () => new Array());\n for (const op of ops) {\n const groupIndex = ordering.findIndex((o) => o.test(op));\n groups[groupIndex].push(op);\n }\n // Reassemble the groups into a single list, in the correct order.\n return groups.flatMap((group, i) => {\n const transform = ordering[i].transform;\n return transform ? transform(group) : group;\n });\n}\n\n/**\n * Keeps only the last op in a list of ops.\n */\nfunction keepLast(ops: Array) {\n return ops.slice(ops.length - 1);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\nimport {createOpXrefMap} from '../util/elements';\n\n/**\n * Attributes of `ng-content` named 'select' are specifically removed, because they control which\n * content matches as a property of the `projection`, and are not a plain attribute.\n */\nexport function removeContentSelectors(job: CompilationJob): void {\n for (const unit of job.units) {\n const elements = createOpXrefMap(unit);\n for (const op of unit.ops()) {\n switch (op.kind) {\n case ir.OpKind.Binding:\n const target = lookupInXrefMap(elements, op.target);\n if (isSelectAttribute(op.name) && target.kind === ir.OpKind.Projection) {\n ir.OpList.remove(op);\n }\n break;\n }\n }\n }\n}\n\nfunction isSelectAttribute(name: string) {\n return name.toLowerCase() === 'select';\n}\n\n/**\n * Looks up an element in the given map by xref ID.\n */\nfunction lookupInXrefMap(\n map: Map,\n xref: ir.XrefId,\n): ir.ConsumesSlotOpTrait & ir.CreateOp {\n const el = map.get(xref);\n if (el === undefined) {\n throw new Error('All attributes should have an slottable target.');\n }\n return el;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationJob, CompilationUnit} from '../compilation';\n\n/**\n * This phase generates pipe creation instructions. We do this based on the pipe bindings found in\n * the update block, in the order we see them.\n *\n * When not in compatibility mode, we can simply group all these creation instructions together, to\n * maximize chaining opportunities.\n */\nexport function createPipes(job: CompilationJob): void {\n for (const unit of job.units) {\n processPipeBindingsInView(unit);\n }\n}\n\nfunction processPipeBindingsInView(unit: CompilationUnit): void {\n for (const updateOp of unit.update) {\n ir.visitExpressionsInOp(updateOp, (expr, flags) => {\n if (!ir.isIrExpression(expr)) {\n return;\n }\n\n if (expr.kind !== ir.ExpressionKind.PipeBinding) {\n return;\n }\n\n if (flags & ir.VisitorContextFlag.InChildOperation) {\n throw new Error(`AssertionError: pipe bindings should not appear in child expressions`);\n }\n\n if (unit.job.compatibility) {\n // TODO: We can delete this cast and check once compatibility mode is removed.\n const slotHandle = (updateOp as any).target;\n if (slotHandle == undefined) {\n throw new Error(`AssertionError: expected slot handle to be assigned for pipe creation`);\n }\n addPipeToCreationBlock(unit, (updateOp as any).target, expr);\n } else {\n // When not in compatibility mode, we just add the pipe to the end of the create block. This\n // is not only simpler and faster, but allows more chaining opportunities for other\n // instructions.\n unit.create.push(ir.createPipeOp(expr.target, expr.targetSlot, expr.name));\n }\n });\n }\n}\n\nfunction addPipeToCreationBlock(\n unit: CompilationUnit,\n afterTargetXref: ir.XrefId,\n binding: ir.PipeBindingExpr,\n): void {\n // Find the appropriate point to insert the Pipe creation operation.\n // We're looking for `afterTargetXref` (and also want to insert after any other pipe operations\n // which might be beyond it).\n for (let op = unit.create.head.next!; op.kind !== ir.OpKind.ListEnd; op = op.next!) {\n if (!ir.hasConsumesSlotTrait(op)) {\n continue;\n }\n\n if (op.xref !== afterTargetXref) {\n continue;\n }\n\n // We've found a tentative insertion point; however, we also want to skip past any _other_ pipe\n // operations present.\n while (op.next!.kind === ir.OpKind.Pipe) {\n op = op.next!;\n }\n\n const pipe = ir.createPipeOp(binding.target, binding.targetSlot, binding.name) as ir.CreateOp;\n ir.OpList.insertBefore(pipe, op.next!);\n\n // This completes adding the pipe to the creation block.\n return;\n }\n\n // At this point, we've failed to add the pipe to the creation block.\n throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\n\nimport type {CompilationJob, ComponentCompilationJob} from '../compilation';\n\n/**\n * Pipes that accept more than 4 arguments are variadic, and are handled with a different runtime\n * instruction.\n */\nexport function createVariadicPipes(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.update) {\n ir.transformExpressionsInOp(\n op,\n (expr) => {\n if (!(expr instanceof ir.PipeBindingExpr)) {\n return expr;\n }\n\n // Pipes are variadic if they have more than 4 arguments.\n if (expr.args.length <= 4) {\n return expr;\n }\n\n return new ir.PipeBindingVariadicExpr(\n expr.target,\n expr.targetSlot,\n expr.name,\n o.literalArr(expr.args),\n expr.args.length,\n );\n },\n ir.VisitorContextFlag.None,\n );\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as i18n from '../../../../i18n/i18n_ast';\nimport * as ir from '../../ir';\nimport {ComponentCompilationJob, ViewCompilationUnit} from '../compilation';\n\n/**\n * Propagate i18n blocks down through child templates that act as placeholders in the root i18n\n * message. Specifically, perform an in-order traversal of all the views, and add i18nStart/i18nEnd\n * op pairs into descending views. Also, assign an increasing sub-template index to each\n * descending view.\n */\nexport function propagateI18nBlocks(job: ComponentCompilationJob): void {\n propagateI18nBlocksToTemplates(job.root, 0);\n}\n\n/**\n * Propagates i18n ops in the given view through to any child views recursively.\n */\nfunction propagateI18nBlocksToTemplates(\n unit: ViewCompilationUnit,\n subTemplateIndex: number,\n): number {\n let i18nBlock: ir.I18nStartOp | null = null;\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nStart:\n op.subTemplateIndex = subTemplateIndex === 0 ? null : subTemplateIndex;\n i18nBlock = op;\n break;\n case ir.OpKind.I18nEnd:\n // When we exit a root-level i18n block, reset the sub-template index counter.\n if (i18nBlock!.subTemplateIndex === null) {\n subTemplateIndex = 0;\n }\n i18nBlock = null;\n break;\n case ir.OpKind.Template:\n subTemplateIndex = propagateI18nBlocksForView(\n unit.job.views.get(op.xref)!,\n i18nBlock,\n op.i18nPlaceholder,\n subTemplateIndex,\n );\n break;\n case ir.OpKind.RepeaterCreate:\n // Propagate i18n blocks to the @for template.\n const forView = unit.job.views.get(op.xref)!;\n subTemplateIndex = propagateI18nBlocksForView(\n forView,\n i18nBlock,\n op.i18nPlaceholder,\n subTemplateIndex,\n );\n // Then if there's an @empty template, propagate the i18n blocks for it as well.\n if (op.emptyView !== null) {\n subTemplateIndex = propagateI18nBlocksForView(\n unit.job.views.get(op.emptyView)!,\n i18nBlock,\n op.emptyI18nPlaceholder,\n subTemplateIndex,\n );\n }\n break;\n }\n }\n return subTemplateIndex;\n}\n\n/**\n * Propagate i18n blocks for a view.\n */\nfunction propagateI18nBlocksForView(\n view: ViewCompilationUnit,\n i18nBlock: ir.I18nStartOp | null,\n i18nPlaceholder: i18n.TagPlaceholder | i18n.BlockPlaceholder | undefined,\n subTemplateIndex: number,\n) {\n // We found an inside an i18n block; increment the sub-template counter and\n // wrap the template's view in a child i18n block.\n if (i18nPlaceholder !== undefined) {\n if (i18nBlock === null) {\n throw Error('Expected template with i18n placeholder to be in an i18n block.');\n }\n subTemplateIndex++;\n wrapTemplateWithI18n(view, i18nBlock);\n }\n\n // Continue traversing inside the template's view.\n return propagateI18nBlocksToTemplates(view, subTemplateIndex);\n}\n\n/**\n * Wraps a template view with i18n start and end ops.\n */\nfunction wrapTemplateWithI18n(unit: ViewCompilationUnit, parentI18n: ir.I18nStartOp) {\n // Only add i18n ops if they have not already been propagated to this template.\n if (unit.create.head.next?.kind !== ir.OpKind.I18nStart) {\n const id = unit.job.allocateXrefId();\n ir.OpList.insertAfter(\n // Nested ng-template i18n start/end ops should not receive source spans.\n ir.createI18nStartOp(id, parentI18n.message, parentI18n.root, null),\n unit.create.head,\n );\n ir.OpList.insertBefore(ir.createI18nEndOp(id, null), unit.create.tail);\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {GenericKeyFn, SharedConstantDefinition} from '../../../../constant_pool';\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\n\nimport type {CompilationJob} from '../compilation';\n\nexport function extractPureFunctions(job: CompilationJob): void {\n for (const view of job.units) {\n for (const op of view.ops()) {\n ir.visitExpressionsInOp(op, (expr) => {\n if (!(expr instanceof ir.PureFunctionExpr) || expr.body === null) {\n return;\n }\n\n const constantDef = new PureFunctionConstant(expr.args.length);\n expr.fn = job.pool.getSharedConstant(constantDef, expr.body);\n expr.body = null;\n });\n }\n }\n}\n\nclass PureFunctionConstant extends GenericKeyFn implements SharedConstantDefinition {\n constructor(private numArgs: number) {\n super();\n }\n\n override keyOf(expr: o.Expression): string {\n if (expr instanceof ir.PureFunctionParameterExpr) {\n return `param(${expr.index})`;\n } else {\n return super.keyOf(expr);\n }\n }\n\n // TODO: Use the new pool method `getSharedFunctionReference`\n toSharedConstantDeclaration(declName: string, keyExpr: o.Expression): o.Statement {\n const fnParams: o.FnParam[] = [];\n for (let idx = 0; idx < this.numArgs; idx++) {\n fnParams.push(new o.FnParam('a' + idx));\n }\n\n // We will never visit `ir.PureFunctionParameterExpr`s that don't belong to us, because this\n // transform runs inside another visitor which will visit nested pure functions before this one.\n const returnExpr = ir.transformExpressionsInExpression(\n keyExpr,\n (expr) => {\n if (!(expr instanceof ir.PureFunctionParameterExpr)) {\n return expr;\n }\n\n return o.variable('a' + expr.index);\n },\n ir.VisitorContextFlag.None,\n );\n\n return new o.DeclareVarStmt(\n declName,\n new o.ArrowFunctionExpr(fnParams, returnExpr),\n undefined,\n o.StmtModifier.Final,\n );\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\nexport function generatePureLiteralStructures(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.update) {\n ir.transformExpressionsInOp(\n op,\n (expr, flags) => {\n if (flags & ir.VisitorContextFlag.InChildOperation) {\n return expr;\n }\n\n if (expr instanceof o.LiteralArrayExpr) {\n return transformLiteralArray(expr);\n } else if (expr instanceof o.LiteralMapExpr) {\n return transformLiteralMap(expr);\n }\n\n return expr;\n },\n ir.VisitorContextFlag.None,\n );\n }\n }\n}\n\nfunction transformLiteralArray(expr: o.LiteralArrayExpr): o.Expression {\n const derivedEntries: o.Expression[] = [];\n const nonConstantArgs: o.Expression[] = [];\n for (const entry of expr.entries) {\n if (entry.isConstant()) {\n derivedEntries.push(entry);\n } else {\n const idx = nonConstantArgs.length;\n nonConstantArgs.push(entry);\n derivedEntries.push(new ir.PureFunctionParameterExpr(idx));\n }\n }\n return new ir.PureFunctionExpr(o.literalArr(derivedEntries), nonConstantArgs);\n}\n\nfunction transformLiteralMap(expr: o.LiteralMapExpr): o.Expression {\n let derivedEntries: o.LiteralMapEntry[] = [];\n const nonConstantArgs: o.Expression[] = [];\n for (const entry of expr.entries) {\n if (entry.value.isConstant()) {\n derivedEntries.push(entry);\n } else {\n const idx = nonConstantArgs.length;\n nonConstantArgs.push(entry.value);\n derivedEntries.push(\n new o.LiteralMapEntry(entry.key, new ir.PureFunctionParameterExpr(idx), entry.quoted),\n );\n }\n }\n return new ir.PureFunctionExpr(o.literalMap(derivedEntries), nonConstantArgs);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../output/output_ast';\nimport {ParseSourceSpan} from '../../../parse_util';\nimport {Identifiers} from '../../../render3/r3_identifiers';\nimport * as ir from '../ir';\n\n// This file contains helpers for generating calls to Ivy instructions. In particular, each\n// instruction type is represented as a function, which may select a specific instruction variant\n// depending on the exact arguments.\n\nexport function element(\n slot: number,\n tag: string,\n constIndex: number | null,\n localRefIndex: number | null,\n sourceSpan: ParseSourceSpan,\n): ir.CreateOp {\n return elementOrContainerBase(\n Identifiers.element,\n slot,\n tag,\n constIndex,\n localRefIndex,\n sourceSpan,\n );\n}\n\nexport function elementStart(\n slot: number,\n tag: string,\n constIndex: number | null,\n localRefIndex: number | null,\n sourceSpan: ParseSourceSpan,\n): ir.CreateOp {\n return elementOrContainerBase(\n Identifiers.elementStart,\n slot,\n tag,\n constIndex,\n localRefIndex,\n sourceSpan,\n );\n}\n\nfunction elementOrContainerBase(\n instruction: o.ExternalReference,\n slot: number,\n tag: string | null,\n constIndex: number | null,\n localRefIndex: number | null,\n sourceSpan: ParseSourceSpan,\n): ir.CreateOp {\n const args: o.Expression[] = [o.literal(slot)];\n if (tag !== null) {\n args.push(o.literal(tag));\n }\n if (localRefIndex !== null) {\n args.push(\n o.literal(constIndex), // might be null, but that's okay.\n o.literal(localRefIndex),\n );\n } else if (constIndex !== null) {\n args.push(o.literal(constIndex));\n }\n\n return call(instruction, args, sourceSpan);\n}\n\nexport function elementEnd(sourceSpan: ParseSourceSpan | null): ir.CreateOp {\n return call(Identifiers.elementEnd, [], sourceSpan);\n}\n\nexport function elementContainerStart(\n slot: number,\n constIndex: number | null,\n localRefIndex: number | null,\n sourceSpan: ParseSourceSpan,\n): ir.CreateOp {\n return elementOrContainerBase(\n Identifiers.elementContainerStart,\n slot,\n /* tag */ null,\n constIndex,\n localRefIndex,\n sourceSpan,\n );\n}\n\nexport function elementContainer(\n slot: number,\n constIndex: number | null,\n localRefIndex: number | null,\n sourceSpan: ParseSourceSpan,\n): ir.CreateOp {\n return elementOrContainerBase(\n Identifiers.elementContainer,\n slot,\n /* tag */ null,\n constIndex,\n localRefIndex,\n sourceSpan,\n );\n}\n\nexport function elementContainerEnd(): ir.CreateOp {\n return call(Identifiers.elementContainerEnd, [], null);\n}\n\nexport function template(\n slot: number,\n templateFnRef: o.Expression,\n decls: number,\n vars: number,\n tag: string | null,\n constIndex: number | null,\n localRefs: number | null,\n sourceSpan: ParseSourceSpan,\n): ir.CreateOp {\n const args = [\n o.literal(slot),\n templateFnRef,\n o.literal(decls),\n o.literal(vars),\n o.literal(tag),\n o.literal(constIndex),\n ];\n if (localRefs !== null) {\n args.push(o.literal(localRefs));\n args.push(o.importExpr(Identifiers.templateRefExtractor));\n }\n while (args[args.length - 1].isEquivalent(o.NULL_EXPR)) {\n args.pop();\n }\n return call(Identifiers.templateCreate, args, sourceSpan);\n}\n\nexport function disableBindings(): ir.CreateOp {\n return call(Identifiers.disableBindings, [], null);\n}\n\nexport function enableBindings(): ir.CreateOp {\n return call(Identifiers.enableBindings, [], null);\n}\n\nexport function listener(\n name: string,\n handlerFn: o.Expression,\n eventTargetResolver: o.ExternalReference | null,\n syntheticHost: boolean,\n sourceSpan: ParseSourceSpan,\n): ir.CreateOp {\n const args = [o.literal(name), handlerFn];\n if (eventTargetResolver !== null) {\n args.push(o.literal(false)); // `useCapture` flag, defaults to `false`\n args.push(o.importExpr(eventTargetResolver));\n }\n return call(\n syntheticHost ? Identifiers.syntheticHostListener : Identifiers.listener,\n args,\n sourceSpan,\n );\n}\n\nexport function twoWayBindingSet(target: o.Expression, value: o.Expression): o.Expression {\n return o.importExpr(Identifiers.twoWayBindingSet).callFn([target, value]);\n}\n\nexport function twoWayListener(\n name: string,\n handlerFn: o.Expression,\n sourceSpan: ParseSourceSpan,\n): ir.CreateOp {\n return call(Identifiers.twoWayListener, [o.literal(name), handlerFn], sourceSpan);\n}\n\nexport function pipe(slot: number, name: string): ir.CreateOp {\n return call(Identifiers.pipe, [o.literal(slot), o.literal(name)], null);\n}\n\nexport function namespaceHTML(): ir.CreateOp {\n return call(Identifiers.namespaceHTML, [], null);\n}\n\nexport function namespaceSVG(): ir.CreateOp {\n return call(Identifiers.namespaceSVG, [], null);\n}\n\nexport function namespaceMath(): ir.CreateOp {\n return call(Identifiers.namespaceMathML, [], null);\n}\n\nexport function advance(delta: number, sourceSpan: ParseSourceSpan): ir.UpdateOp {\n return call(Identifiers.advance, delta > 1 ? [o.literal(delta)] : [], sourceSpan);\n}\n\nexport function reference(slot: number): o.Expression {\n return o.importExpr(Identifiers.reference).callFn([o.literal(slot)]);\n}\n\nexport function nextContext(steps: number): o.Expression {\n return o.importExpr(Identifiers.nextContext).callFn(steps === 1 ? [] : [o.literal(steps)]);\n}\n\nexport function getCurrentView(): o.Expression {\n return o.importExpr(Identifiers.getCurrentView).callFn([]);\n}\n\nexport function restoreView(savedView: o.Expression): o.Expression {\n return o.importExpr(Identifiers.restoreView).callFn([savedView]);\n}\n\nexport function resetView(returnValue: o.Expression): o.Expression {\n return o.importExpr(Identifiers.resetView).callFn([returnValue]);\n}\n\nexport function text(\n slot: number,\n initialValue: string,\n sourceSpan: ParseSourceSpan | null,\n): ir.CreateOp {\n const args: o.Expression[] = [o.literal(slot, null)];\n if (initialValue !== '') {\n args.push(o.literal(initialValue));\n }\n return call(Identifiers.text, args, sourceSpan);\n}\n\nexport function defer(\n selfSlot: number,\n primarySlot: number,\n dependencyResolverFn: o.Expression | null,\n loadingSlot: number | null,\n placeholderSlot: number | null,\n errorSlot: number | null,\n loadingConfig: o.Expression | null,\n placeholderConfig: o.Expression | null,\n enableTimerScheduling: boolean,\n sourceSpan: ParseSourceSpan | null,\n flags: ir.TDeferDetailsFlags | null,\n): ir.CreateOp {\n const args: Array = [\n o.literal(selfSlot),\n o.literal(primarySlot),\n dependencyResolverFn ?? o.literal(null),\n o.literal(loadingSlot),\n o.literal(placeholderSlot),\n o.literal(errorSlot),\n loadingConfig ?? o.literal(null),\n placeholderConfig ?? o.literal(null),\n enableTimerScheduling ? o.importExpr(Identifiers.deferEnableTimerScheduling) : o.literal(null),\n o.literal(flags),\n ];\n\n let expr: o.Expression;\n while (\n (expr = args[args.length - 1]) !== null &&\n expr instanceof o.LiteralExpr &&\n expr.value === null\n ) {\n args.pop();\n }\n\n return call(Identifiers.defer, args, sourceSpan);\n}\n\nconst deferTriggerToR3TriggerInstructionsMap = new Map([\n [\n ir.DeferTriggerKind.Idle,\n {\n [ir.DeferOpModifierKind.NONE]: Identifiers.deferOnIdle,\n [ir.DeferOpModifierKind.PREFETCH]: Identifiers.deferPrefetchOnIdle,\n [ir.DeferOpModifierKind.HYDRATE]: Identifiers.deferHydrateOnIdle,\n },\n ],\n [\n ir.DeferTriggerKind.Immediate,\n {\n [ir.DeferOpModifierKind.NONE]: Identifiers.deferOnImmediate,\n [ir.DeferOpModifierKind.PREFETCH]: Identifiers.deferPrefetchOnImmediate,\n [ir.DeferOpModifierKind.HYDRATE]: Identifiers.deferHydrateOnImmediate,\n },\n ],\n [\n ir.DeferTriggerKind.Timer,\n {\n [ir.DeferOpModifierKind.NONE]: Identifiers.deferOnTimer,\n [ir.DeferOpModifierKind.PREFETCH]: Identifiers.deferPrefetchOnTimer,\n [ir.DeferOpModifierKind.HYDRATE]: Identifiers.deferHydrateOnTimer,\n },\n ],\n [\n ir.DeferTriggerKind.Hover,\n {\n [ir.DeferOpModifierKind.NONE]: Identifiers.deferOnHover,\n [ir.DeferOpModifierKind.PREFETCH]: Identifiers.deferPrefetchOnHover,\n [ir.DeferOpModifierKind.HYDRATE]: Identifiers.deferHydrateOnHover,\n },\n ],\n [\n ir.DeferTriggerKind.Interaction,\n {\n [ir.DeferOpModifierKind.NONE]: Identifiers.deferOnInteraction,\n [ir.DeferOpModifierKind.PREFETCH]: Identifiers.deferPrefetchOnInteraction,\n [ir.DeferOpModifierKind.HYDRATE]: Identifiers.deferHydrateOnInteraction,\n },\n ],\n [\n ir.DeferTriggerKind.Viewport,\n {\n [ir.DeferOpModifierKind.NONE]: Identifiers.deferOnViewport,\n [ir.DeferOpModifierKind.PREFETCH]: Identifiers.deferPrefetchOnViewport,\n [ir.DeferOpModifierKind.HYDRATE]: Identifiers.deferHydrateOnViewport,\n },\n ],\n [\n ir.DeferTriggerKind.Never,\n {\n [ir.DeferOpModifierKind.NONE]: Identifiers.deferHydrateNever,\n [ir.DeferOpModifierKind.PREFETCH]: Identifiers.deferHydrateNever,\n [ir.DeferOpModifierKind.HYDRATE]: Identifiers.deferHydrateNever,\n },\n ],\n]);\n\nexport function deferOn(\n trigger: ir.DeferTriggerKind,\n args: number[],\n modifier: ir.DeferOpModifierKind,\n sourceSpan: ParseSourceSpan | null,\n): ir.CreateOp {\n const instructionToCall = deferTriggerToR3TriggerInstructionsMap.get(trigger)?.[modifier];\n if (instructionToCall === undefined) {\n throw new Error(`Unable to determine instruction for trigger ${trigger}`);\n }\n return call(\n instructionToCall,\n args.map((a) => o.literal(a)),\n sourceSpan,\n );\n}\n\nexport function projectionDef(def: o.Expression | null): ir.CreateOp {\n return call(Identifiers.projectionDef, def ? [def] : [], null);\n}\n\nexport function projection(\n slot: number,\n projectionSlotIndex: number,\n attributes: o.LiteralArrayExpr | null,\n fallbackFnName: string | null,\n fallbackDecls: number | null,\n fallbackVars: number | null,\n sourceSpan: ParseSourceSpan,\n): ir.CreateOp {\n const args: o.Expression[] = [o.literal(slot)];\n if (projectionSlotIndex !== 0 || attributes !== null || fallbackFnName !== null) {\n args.push(o.literal(projectionSlotIndex));\n if (attributes !== null) {\n args.push(attributes);\n }\n if (fallbackFnName !== null) {\n if (attributes === null) {\n args.push(o.literal(null));\n }\n args.push(o.variable(fallbackFnName), o.literal(fallbackDecls), o.literal(fallbackVars));\n }\n }\n return call(Identifiers.projection, args, sourceSpan);\n}\n\nexport function i18nStart(\n slot: number,\n constIndex: number,\n subTemplateIndex: number,\n sourceSpan: ParseSourceSpan | null,\n): ir.CreateOp {\n const args = [o.literal(slot), o.literal(constIndex)];\n if (subTemplateIndex !== null) {\n args.push(o.literal(subTemplateIndex));\n }\n return call(Identifiers.i18nStart, args, sourceSpan);\n}\n\nexport function repeaterCreate(\n slot: number,\n viewFnName: string,\n decls: number,\n vars: number,\n tag: string | null,\n constIndex: number | null,\n trackByFn: o.Expression,\n trackByUsesComponentInstance: boolean,\n emptyViewFnName: string | null,\n emptyDecls: number | null,\n emptyVars: number | null,\n emptyTag: string | null,\n emptyConstIndex: number | null,\n sourceSpan: ParseSourceSpan | null,\n): ir.CreateOp {\n const args = [\n o.literal(slot),\n o.variable(viewFnName),\n o.literal(decls),\n o.literal(vars),\n o.literal(tag),\n o.literal(constIndex),\n trackByFn,\n ];\n if (trackByUsesComponentInstance || emptyViewFnName !== null) {\n args.push(o.literal(trackByUsesComponentInstance));\n if (emptyViewFnName !== null) {\n args.push(o.variable(emptyViewFnName), o.literal(emptyDecls), o.literal(emptyVars));\n if (emptyTag !== null || emptyConstIndex !== null) {\n args.push(o.literal(emptyTag));\n }\n if (emptyConstIndex !== null) {\n args.push(o.literal(emptyConstIndex));\n }\n }\n }\n return call(Identifiers.repeaterCreate, args, sourceSpan);\n}\n\nexport function repeater(\n collection: o.Expression,\n sourceSpan: ParseSourceSpan | null,\n): ir.UpdateOp {\n return call(Identifiers.repeater, [collection], sourceSpan);\n}\n\nexport function deferWhen(\n modifier: ir.DeferOpModifierKind,\n expr: o.Expression,\n sourceSpan: ParseSourceSpan | null,\n): ir.UpdateOp {\n if (modifier === ir.DeferOpModifierKind.PREFETCH) {\n return call(Identifiers.deferPrefetchWhen, [expr], sourceSpan);\n } else if (modifier === ir.DeferOpModifierKind.HYDRATE) {\n return call(Identifiers.deferHydrateWhen, [expr], sourceSpan);\n }\n return call(Identifiers.deferWhen, [expr], sourceSpan);\n}\n\nexport function declareLet(slot: number, sourceSpan: ParseSourceSpan): ir.CreateOp {\n return call(Identifiers.declareLet, [o.literal(slot)], sourceSpan);\n}\n\nexport function storeLet(value: o.Expression, sourceSpan: ParseSourceSpan): o.Expression {\n return o.importExpr(Identifiers.storeLet).callFn([value], sourceSpan);\n}\n\nexport function readContextLet(slot: number): o.Expression {\n return o.importExpr(Identifiers.readContextLet).callFn([o.literal(slot)]);\n}\n\nexport function i18n(\n slot: number,\n constIndex: number,\n subTemplateIndex: number,\n sourceSpan: ParseSourceSpan | null,\n): ir.CreateOp {\n const args = [o.literal(slot), o.literal(constIndex)];\n if (subTemplateIndex) {\n args.push(o.literal(subTemplateIndex));\n }\n return call(Identifiers.i18n, args, sourceSpan);\n}\n\nexport function i18nEnd(endSourceSpan: ParseSourceSpan | null): ir.CreateOp {\n return call(Identifiers.i18nEnd, [], endSourceSpan);\n}\n\nexport function i18nAttributes(slot: number, i18nAttributesConfig: number): ir.CreateOp {\n const args = [o.literal(slot), o.literal(i18nAttributesConfig)];\n return call(Identifiers.i18nAttributes, args, null);\n}\n\nexport function property(\n name: string,\n expression: o.Expression,\n sanitizer: o.Expression | null,\n sourceSpan: ParseSourceSpan,\n): ir.UpdateOp {\n const args = [o.literal(name), expression];\n if (sanitizer !== null) {\n args.push(sanitizer);\n }\n return call(Identifiers.property, args, sourceSpan);\n}\n\nexport function twoWayProperty(\n name: string,\n expression: o.Expression,\n sanitizer: o.Expression | null,\n sourceSpan: ParseSourceSpan,\n): ir.UpdateOp {\n const args = [o.literal(name), expression];\n if (sanitizer !== null) {\n args.push(sanitizer);\n }\n return call(Identifiers.twoWayProperty, args, sourceSpan);\n}\n\nexport function attribute(\n name: string,\n expression: o.Expression,\n sanitizer: o.Expression | null,\n namespace: string | null,\n): ir.UpdateOp {\n const args = [o.literal(name), expression];\n if (sanitizer !== null || namespace !== null) {\n args.push(sanitizer ?? o.literal(null));\n }\n if (namespace !== null) {\n args.push(o.literal(namespace));\n }\n return call(Identifiers.attribute, args, null);\n}\n\nexport function styleProp(\n name: string,\n expression: o.Expression,\n unit: string | null,\n sourceSpan: ParseSourceSpan,\n): ir.UpdateOp {\n const args = [o.literal(name), expression];\n if (unit !== null) {\n args.push(o.literal(unit));\n }\n return call(Identifiers.styleProp, args, sourceSpan);\n}\n\nexport function classProp(\n name: string,\n expression: o.Expression,\n sourceSpan: ParseSourceSpan,\n): ir.UpdateOp {\n return call(Identifiers.classProp, [o.literal(name), expression], sourceSpan);\n}\n\nexport function styleMap(expression: o.Expression, sourceSpan: ParseSourceSpan): ir.UpdateOp {\n return call(Identifiers.styleMap, [expression], sourceSpan);\n}\n\nexport function classMap(expression: o.Expression, sourceSpan: ParseSourceSpan): ir.UpdateOp {\n return call(Identifiers.classMap, [expression], sourceSpan);\n}\n\nconst PIPE_BINDINGS: o.ExternalReference[] = [\n Identifiers.pipeBind1,\n Identifiers.pipeBind2,\n Identifiers.pipeBind3,\n Identifiers.pipeBind4,\n];\n\nexport function pipeBind(slot: number, varOffset: number, args: o.Expression[]): o.Expression {\n if (args.length < 1 || args.length > PIPE_BINDINGS.length) {\n throw new Error(`pipeBind() argument count out of bounds`);\n }\n\n const instruction = PIPE_BINDINGS[args.length - 1];\n return o.importExpr(instruction).callFn([o.literal(slot), o.literal(varOffset), ...args]);\n}\n\nexport function pipeBindV(slot: number, varOffset: number, args: o.Expression): o.Expression {\n return o.importExpr(Identifiers.pipeBindV).callFn([o.literal(slot), o.literal(varOffset), args]);\n}\n\nexport function textInterpolate(\n strings: string[],\n expressions: o.Expression[],\n sourceSpan: ParseSourceSpan,\n): ir.UpdateOp {\n const interpolationArgs = collateInterpolationArgs(strings, expressions);\n return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);\n}\n\nexport function i18nExp(expr: o.Expression, sourceSpan: ParseSourceSpan | null): ir.UpdateOp {\n return call(Identifiers.i18nExp, [expr], sourceSpan);\n}\n\nexport function i18nApply(slot: number, sourceSpan: ParseSourceSpan | null): ir.UpdateOp {\n return call(Identifiers.i18nApply, [o.literal(slot)], sourceSpan);\n}\n\nexport function propertyInterpolate(\n name: string,\n strings: string[],\n expressions: o.Expression[],\n sanitizer: o.Expression | null,\n sourceSpan: ParseSourceSpan,\n): ir.UpdateOp {\n const interpolationArgs = collateInterpolationArgs(strings, expressions);\n const extraArgs = [];\n if (sanitizer !== null) {\n extraArgs.push(sanitizer);\n }\n\n return callVariadicInstruction(\n PROPERTY_INTERPOLATE_CONFIG,\n [o.literal(name)],\n interpolationArgs,\n extraArgs,\n sourceSpan,\n );\n}\n\nexport function attributeInterpolate(\n name: string,\n strings: string[],\n expressions: o.Expression[],\n sanitizer: o.Expression | null,\n sourceSpan: ParseSourceSpan,\n): ir.UpdateOp {\n const interpolationArgs = collateInterpolationArgs(strings, expressions);\n const extraArgs = [];\n if (sanitizer !== null) {\n extraArgs.push(sanitizer);\n }\n\n return callVariadicInstruction(\n ATTRIBUTE_INTERPOLATE_CONFIG,\n [o.literal(name)],\n interpolationArgs,\n extraArgs,\n sourceSpan,\n );\n}\n\nexport function stylePropInterpolate(\n name: string,\n strings: string[],\n expressions: o.Expression[],\n unit: string | null,\n sourceSpan: ParseSourceSpan,\n): ir.UpdateOp {\n const interpolationArgs = collateInterpolationArgs(strings, expressions);\n const extraArgs: o.Expression[] = [];\n if (unit !== null) {\n extraArgs.push(o.literal(unit));\n }\n\n return callVariadicInstruction(\n STYLE_PROP_INTERPOLATE_CONFIG,\n [o.literal(name)],\n interpolationArgs,\n extraArgs,\n sourceSpan,\n );\n}\n\nexport function styleMapInterpolate(\n strings: string[],\n expressions: o.Expression[],\n sourceSpan: ParseSourceSpan,\n): ir.UpdateOp {\n const interpolationArgs = collateInterpolationArgs(strings, expressions);\n\n return callVariadicInstruction(\n STYLE_MAP_INTERPOLATE_CONFIG,\n [],\n interpolationArgs,\n [],\n sourceSpan,\n );\n}\n\nexport function classMapInterpolate(\n strings: string[],\n expressions: o.Expression[],\n sourceSpan: ParseSourceSpan,\n): ir.UpdateOp {\n const interpolationArgs = collateInterpolationArgs(strings, expressions);\n\n return callVariadicInstruction(\n CLASS_MAP_INTERPOLATE_CONFIG,\n [],\n interpolationArgs,\n [],\n sourceSpan,\n );\n}\n\nexport function hostProperty(\n name: string,\n expression: o.Expression,\n sanitizer: o.Expression | null,\n sourceSpan: ParseSourceSpan | null,\n): ir.UpdateOp {\n const args = [o.literal(name), expression];\n if (sanitizer !== null) {\n args.push(sanitizer);\n }\n return call(Identifiers.hostProperty, args, sourceSpan);\n}\n\nexport function syntheticHostProperty(\n name: string,\n expression: o.Expression,\n sourceSpan: ParseSourceSpan | null,\n): ir.UpdateOp {\n return call(Identifiers.syntheticHostProperty, [o.literal(name), expression], sourceSpan);\n}\n\nexport function pureFunction(\n varOffset: number,\n fn: o.Expression,\n args: o.Expression[],\n): o.Expression {\n return callVariadicInstructionExpr(\n PURE_FUNCTION_CONFIG,\n [o.literal(varOffset), fn],\n args,\n [],\n null,\n );\n}\n\nexport function attachSourceLocation(\n templatePath: string,\n locations: o.LiteralArrayExpr,\n): ir.CreateOp {\n return call(Identifiers.attachSourceLocations, [o.literal(templatePath), locations], null);\n}\n\n/**\n * Collates the string an expression arguments for an interpolation instruction.\n */\nfunction collateInterpolationArgs(strings: string[], expressions: o.Expression[]): o.Expression[] {\n if (strings.length < 1 || expressions.length !== strings.length - 1) {\n throw new Error(\n `AssertionError: expected specific shape of args for strings/expressions in interpolation`,\n );\n }\n const interpolationArgs: o.Expression[] = [];\n\n if (expressions.length === 1 && strings[0] === '' && strings[1] === '') {\n interpolationArgs.push(expressions[0]);\n } else {\n let idx: number;\n for (idx = 0; idx < expressions.length; idx++) {\n interpolationArgs.push(o.literal(strings[idx]), expressions[idx]);\n }\n // idx points at the last string.\n interpolationArgs.push(o.literal(strings[idx]));\n }\n\n return interpolationArgs;\n}\n\nfunction call(\n instruction: o.ExternalReference,\n args: o.Expression[],\n sourceSpan: ParseSourceSpan | null,\n): OpT {\n const expr = o.importExpr(instruction).callFn(args, sourceSpan);\n return ir.createStatementOp(new o.ExpressionStatement(expr, sourceSpan)) as OpT;\n}\n\nexport function conditional(\n condition: o.Expression,\n contextValue: o.Expression | null,\n sourceSpan: ParseSourceSpan | null,\n): ir.UpdateOp {\n const args = [condition];\n if (contextValue !== null) {\n args.push(contextValue);\n }\n return call(Identifiers.conditional, args, sourceSpan);\n}\n\n/**\n * Describes a specific flavor of instruction used to represent variadic instructions, which\n * have some number of variants for specific argument counts.\n */\ninterface VariadicInstructionConfig {\n constant: o.ExternalReference[];\n variable: o.ExternalReference | null;\n mapping: (argCount: number) => number;\n}\n\n/**\n * `InterpolationConfig` for the `textInterpolate` instruction.\n */\nconst TEXT_INTERPOLATE_CONFIG: VariadicInstructionConfig = {\n constant: [\n Identifiers.textInterpolate,\n Identifiers.textInterpolate1,\n Identifiers.textInterpolate2,\n Identifiers.textInterpolate3,\n Identifiers.textInterpolate4,\n Identifiers.textInterpolate5,\n Identifiers.textInterpolate6,\n Identifiers.textInterpolate7,\n Identifiers.textInterpolate8,\n ],\n variable: Identifiers.textInterpolateV,\n mapping: (n) => {\n if (n % 2 === 0) {\n throw new Error(`Expected odd number of arguments`);\n }\n return (n - 1) / 2;\n },\n};\n\n/**\n * `InterpolationConfig` for the `propertyInterpolate` instruction.\n */\nconst PROPERTY_INTERPOLATE_CONFIG: VariadicInstructionConfig = {\n constant: [\n Identifiers.propertyInterpolate,\n Identifiers.propertyInterpolate1,\n Identifiers.propertyInterpolate2,\n Identifiers.propertyInterpolate3,\n Identifiers.propertyInterpolate4,\n Identifiers.propertyInterpolate5,\n Identifiers.propertyInterpolate6,\n Identifiers.propertyInterpolate7,\n Identifiers.propertyInterpolate8,\n ],\n variable: Identifiers.propertyInterpolateV,\n mapping: (n) => {\n if (n % 2 === 0) {\n throw new Error(`Expected odd number of arguments`);\n }\n return (n - 1) / 2;\n },\n};\n\n/**\n * `InterpolationConfig` for the `stylePropInterpolate` instruction.\n */\nconst STYLE_PROP_INTERPOLATE_CONFIG: VariadicInstructionConfig = {\n constant: [\n Identifiers.styleProp,\n Identifiers.stylePropInterpolate1,\n Identifiers.stylePropInterpolate2,\n Identifiers.stylePropInterpolate3,\n Identifiers.stylePropInterpolate4,\n Identifiers.stylePropInterpolate5,\n Identifiers.stylePropInterpolate6,\n Identifiers.stylePropInterpolate7,\n Identifiers.stylePropInterpolate8,\n ],\n variable: Identifiers.stylePropInterpolateV,\n mapping: (n) => {\n if (n % 2 === 0) {\n throw new Error(`Expected odd number of arguments`);\n }\n return (n - 1) / 2;\n },\n};\n\n/**\n * `InterpolationConfig` for the `attributeInterpolate` instruction.\n */\nconst ATTRIBUTE_INTERPOLATE_CONFIG: VariadicInstructionConfig = {\n constant: [\n Identifiers.attribute,\n Identifiers.attributeInterpolate1,\n Identifiers.attributeInterpolate2,\n Identifiers.attributeInterpolate3,\n Identifiers.attributeInterpolate4,\n Identifiers.attributeInterpolate5,\n Identifiers.attributeInterpolate6,\n Identifiers.attributeInterpolate7,\n Identifiers.attributeInterpolate8,\n ],\n variable: Identifiers.attributeInterpolateV,\n mapping: (n) => {\n if (n % 2 === 0) {\n throw new Error(`Expected odd number of arguments`);\n }\n return (n - 1) / 2;\n },\n};\n\n/**\n * `InterpolationConfig` for the `styleMapInterpolate` instruction.\n */\nconst STYLE_MAP_INTERPOLATE_CONFIG: VariadicInstructionConfig = {\n constant: [\n Identifiers.styleMap,\n Identifiers.styleMapInterpolate1,\n Identifiers.styleMapInterpolate2,\n Identifiers.styleMapInterpolate3,\n Identifiers.styleMapInterpolate4,\n Identifiers.styleMapInterpolate5,\n Identifiers.styleMapInterpolate6,\n Identifiers.styleMapInterpolate7,\n Identifiers.styleMapInterpolate8,\n ],\n variable: Identifiers.styleMapInterpolateV,\n mapping: (n) => {\n if (n % 2 === 0) {\n throw new Error(`Expected odd number of arguments`);\n }\n return (n - 1) / 2;\n },\n};\n\n/**\n * `InterpolationConfig` for the `classMapInterpolate` instruction.\n */\nconst CLASS_MAP_INTERPOLATE_CONFIG: VariadicInstructionConfig = {\n constant: [\n Identifiers.classMap,\n Identifiers.classMapInterpolate1,\n Identifiers.classMapInterpolate2,\n Identifiers.classMapInterpolate3,\n Identifiers.classMapInterpolate4,\n Identifiers.classMapInterpolate5,\n Identifiers.classMapInterpolate6,\n Identifiers.classMapInterpolate7,\n Identifiers.classMapInterpolate8,\n ],\n variable: Identifiers.classMapInterpolateV,\n mapping: (n) => {\n if (n % 2 === 0) {\n throw new Error(`Expected odd number of arguments`);\n }\n return (n - 1) / 2;\n },\n};\n\nconst PURE_FUNCTION_CONFIG: VariadicInstructionConfig = {\n constant: [\n Identifiers.pureFunction0,\n Identifiers.pureFunction1,\n Identifiers.pureFunction2,\n Identifiers.pureFunction3,\n Identifiers.pureFunction4,\n Identifiers.pureFunction5,\n Identifiers.pureFunction6,\n Identifiers.pureFunction7,\n Identifiers.pureFunction8,\n ],\n variable: Identifiers.pureFunctionV,\n mapping: (n) => n,\n};\n\nfunction callVariadicInstructionExpr(\n config: VariadicInstructionConfig,\n baseArgs: o.Expression[],\n interpolationArgs: o.Expression[],\n extraArgs: o.Expression[],\n sourceSpan: ParseSourceSpan | null,\n): o.Expression {\n const n = config.mapping(interpolationArgs.length);\n if (n < config.constant.length) {\n // Constant calling pattern.\n return o\n .importExpr(config.constant[n])\n .callFn([...baseArgs, ...interpolationArgs, ...extraArgs], sourceSpan);\n } else if (config.variable !== null) {\n // Variable calling pattern.\n return o\n .importExpr(config.variable)\n .callFn([...baseArgs, o.literalArr(interpolationArgs), ...extraArgs], sourceSpan);\n } else {\n throw new Error(`AssertionError: unable to call variadic function`);\n }\n}\n\nfunction callVariadicInstruction(\n config: VariadicInstructionConfig,\n baseArgs: o.Expression[],\n interpolationArgs: o.Expression[],\n extraArgs: o.Expression[],\n sourceSpan: ParseSourceSpan | null,\n): ir.UpdateOp {\n return ir.createStatementOp(\n callVariadicInstructionExpr(\n config,\n baseArgs,\n interpolationArgs,\n extraArgs,\n sourceSpan,\n ).toStmt(),\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport {Identifiers} from '../../../../render3/r3_identifiers';\nimport * as ir from '../../ir';\nimport {ViewCompilationUnit, type CompilationJob, type CompilationUnit} from '../compilation';\nimport * as ng from '../instruction';\n\n/**\n * Map of target resolvers for event listeners.\n */\nconst GLOBAL_TARGET_RESOLVERS = new Map([\n ['window', Identifiers.resolveWindow],\n ['document', Identifiers.resolveDocument],\n ['body', Identifiers.resolveBody],\n]);\n\n/**\n * Compiles semantic operations across all views and generates output `o.Statement`s with actual\n * runtime calls in their place.\n *\n * Reification replaces semantic operations with selected Ivy instructions and other generated code\n * structures. After reification, the create/update operation lists of all views should only contain\n * `ir.StatementOp`s (which wrap generated `o.Statement`s).\n */\nexport function reify(job: CompilationJob): void {\n for (const unit of job.units) {\n reifyCreateOperations(unit, unit.create);\n reifyUpdateOperations(unit, unit.update);\n }\n}\n\n/**\n * This function can be used a sanity check -- it walks every expression in the const pool, and\n * every expression reachable from an op, and makes sure that there are no IR expressions\n * left. This is nice to use for debugging mysterious failures where an IR expression cannot be\n * output from the output AST code.\n */\nfunction ensureNoIrForDebug(job: CompilationJob) {\n for (const stmt of job.pool.statements) {\n ir.transformExpressionsInStatement(\n stmt,\n (expr) => {\n if (ir.isIrExpression(expr)) {\n throw new Error(\n `AssertionError: IR expression found during reify: ${ir.ExpressionKind[expr.kind]}`,\n );\n }\n return expr;\n },\n ir.VisitorContextFlag.None,\n );\n }\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n ir.visitExpressionsInOp(op, (expr) => {\n if (ir.isIrExpression(expr)) {\n throw new Error(\n `AssertionError: IR expression found during reify: ${ir.ExpressionKind[expr.kind]}`,\n );\n }\n });\n }\n }\n}\n\nfunction reifyCreateOperations(unit: CompilationUnit, ops: ir.OpList): void {\n for (const op of ops) {\n ir.transformExpressionsInOp(op, reifyIrExpression, ir.VisitorContextFlag.None);\n\n switch (op.kind) {\n case ir.OpKind.Text:\n ir.OpList.replace(op, ng.text(op.handle.slot!, op.initialValue, op.sourceSpan));\n break;\n case ir.OpKind.ElementStart:\n ir.OpList.replace(\n op,\n ng.elementStart(\n op.handle.slot!,\n op.tag!,\n op.attributes as number | null,\n op.localRefs as number | null,\n op.startSourceSpan,\n ),\n );\n break;\n case ir.OpKind.Element:\n ir.OpList.replace(\n op,\n ng.element(\n op.handle.slot!,\n op.tag!,\n op.attributes as number | null,\n op.localRefs as number | null,\n op.wholeSourceSpan,\n ),\n );\n break;\n case ir.OpKind.ElementEnd:\n ir.OpList.replace(op, ng.elementEnd(op.sourceSpan));\n break;\n case ir.OpKind.ContainerStart:\n ir.OpList.replace(\n op,\n ng.elementContainerStart(\n op.handle.slot!,\n op.attributes as number | null,\n op.localRefs as number | null,\n op.startSourceSpan,\n ),\n );\n break;\n case ir.OpKind.Container:\n ir.OpList.replace(\n op,\n ng.elementContainer(\n op.handle.slot!,\n op.attributes as number | null,\n op.localRefs as number | null,\n op.wholeSourceSpan,\n ),\n );\n break;\n case ir.OpKind.ContainerEnd:\n ir.OpList.replace(op, ng.elementContainerEnd());\n break;\n case ir.OpKind.I18nStart:\n ir.OpList.replace(\n op,\n ng.i18nStart(op.handle.slot!, op.messageIndex!, op.subTemplateIndex!, op.sourceSpan),\n );\n break;\n case ir.OpKind.I18nEnd:\n ir.OpList.replace(op, ng.i18nEnd(op.sourceSpan));\n break;\n case ir.OpKind.I18n:\n ir.OpList.replace(\n op,\n ng.i18n(op.handle.slot!, op.messageIndex!, op.subTemplateIndex!, op.sourceSpan),\n );\n break;\n case ir.OpKind.I18nAttributes:\n if (op.i18nAttributesConfig === null) {\n throw new Error(`AssertionError: i18nAttributesConfig was not set`);\n }\n ir.OpList.replace(op, ng.i18nAttributes(op.handle.slot!, op.i18nAttributesConfig));\n break;\n case ir.OpKind.Template:\n if (!(unit instanceof ViewCompilationUnit)) {\n throw new Error(`AssertionError: must be compiling a component`);\n }\n if (Array.isArray(op.localRefs)) {\n throw new Error(\n `AssertionError: local refs array should have been extracted into a constant`,\n );\n }\n const childView = unit.job.views.get(op.xref)!;\n ir.OpList.replace(\n op,\n ng.template(\n op.handle.slot!,\n o.variable(childView.fnName!),\n childView.decls!,\n childView.vars!,\n op.tag,\n op.attributes,\n op.localRefs,\n op.startSourceSpan,\n ),\n );\n break;\n case ir.OpKind.DisableBindings:\n ir.OpList.replace(op, ng.disableBindings());\n break;\n case ir.OpKind.EnableBindings:\n ir.OpList.replace(op, ng.enableBindings());\n break;\n case ir.OpKind.Pipe:\n ir.OpList.replace(op, ng.pipe(op.handle.slot!, op.name));\n break;\n case ir.OpKind.DeclareLet:\n ir.OpList.replace(op, ng.declareLet(op.handle.slot!, op.sourceSpan));\n break;\n case ir.OpKind.Listener:\n const listenerFn = reifyListenerHandler(\n unit,\n op.handlerFnName!,\n op.handlerOps,\n op.consumesDollarEvent,\n );\n const eventTargetResolver = op.eventTarget\n ? GLOBAL_TARGET_RESOLVERS.get(op.eventTarget)\n : null;\n if (eventTargetResolver === undefined) {\n throw new Error(\n `Unexpected global target '${op.eventTarget}' defined for '${op.name}' event. Supported list of global targets: window,document,body.`,\n );\n }\n ir.OpList.replace(\n op,\n ng.listener(\n op.name,\n listenerFn,\n eventTargetResolver,\n op.hostListener && op.isAnimationListener,\n op.sourceSpan,\n ),\n );\n break;\n case ir.OpKind.TwoWayListener:\n ir.OpList.replace(\n op,\n ng.twoWayListener(\n op.name,\n reifyListenerHandler(unit, op.handlerFnName!, op.handlerOps, true),\n op.sourceSpan,\n ),\n );\n break;\n case ir.OpKind.Variable:\n if (op.variable.name === null) {\n throw new Error(`AssertionError: unnamed variable ${op.xref}`);\n }\n ir.OpList.replace(\n op,\n ir.createStatementOp(\n new o.DeclareVarStmt(op.variable.name, op.initializer, undefined, o.StmtModifier.Final),\n ),\n );\n break;\n case ir.OpKind.Namespace:\n switch (op.active) {\n case ir.Namespace.HTML:\n ir.OpList.replace(op, ng.namespaceHTML());\n break;\n case ir.Namespace.SVG:\n ir.OpList.replace(op, ng.namespaceSVG());\n break;\n case ir.Namespace.Math:\n ir.OpList.replace(op, ng.namespaceMath());\n break;\n }\n break;\n case ir.OpKind.Defer:\n const timerScheduling =\n !!op.loadingMinimumTime || !!op.loadingAfterTime || !!op.placeholderMinimumTime;\n ir.OpList.replace(\n op,\n ng.defer(\n op.handle.slot!,\n op.mainSlot.slot!,\n op.resolverFn,\n op.loadingSlot?.slot ?? null,\n op.placeholderSlot?.slot! ?? null,\n op.errorSlot?.slot ?? null,\n op.loadingConfig,\n op.placeholderConfig,\n timerScheduling,\n op.sourceSpan,\n op.flags,\n ),\n );\n break;\n case ir.OpKind.DeferOn:\n let args: number[] = [];\n switch (op.trigger.kind) {\n case ir.DeferTriggerKind.Never:\n case ir.DeferTriggerKind.Idle:\n case ir.DeferTriggerKind.Immediate:\n break;\n case ir.DeferTriggerKind.Timer:\n args = [op.trigger.delay];\n break;\n case ir.DeferTriggerKind.Interaction:\n case ir.DeferTriggerKind.Hover:\n case ir.DeferTriggerKind.Viewport:\n // `hydrate` triggers don't support targets.\n if (op.modifier === ir.DeferOpModifierKind.HYDRATE) {\n args = [];\n } else {\n if (op.trigger.targetSlot?.slot == null || op.trigger.targetSlotViewSteps === null) {\n throw new Error(\n `Slot or view steps not set in trigger reification for trigger kind ${op.trigger.kind}`,\n );\n }\n args = [op.trigger.targetSlot.slot];\n if (op.trigger.targetSlotViewSteps !== 0) {\n args.push(op.trigger.targetSlotViewSteps);\n }\n }\n break;\n default:\n throw new Error(\n `AssertionError: Unsupported reification of defer trigger kind ${\n (op.trigger as any).kind\n }`,\n );\n }\n ir.OpList.replace(op, ng.deferOn(op.trigger.kind, args, op.modifier, op.sourceSpan));\n break;\n case ir.OpKind.ProjectionDef:\n ir.OpList.replace(op, ng.projectionDef(op.def));\n break;\n case ir.OpKind.Projection:\n if (op.handle.slot === null) {\n throw new Error('No slot was assigned for project instruction');\n }\n let fallbackViewFnName: string | null = null;\n let fallbackDecls: number | null = null;\n let fallbackVars: number | null = null;\n if (op.fallbackView !== null) {\n if (!(unit instanceof ViewCompilationUnit)) {\n throw new Error(`AssertionError: must be compiling a component`);\n }\n const fallbackView = unit.job.views.get(op.fallbackView);\n if (fallbackView === undefined) {\n throw new Error(\n 'AssertionError: projection had fallback view xref, but fallback view was not found',\n );\n }\n if (\n fallbackView.fnName === null ||\n fallbackView.decls === null ||\n fallbackView.vars === null\n ) {\n throw new Error(\n `AssertionError: expected projection fallback view to have been named and counted`,\n );\n }\n fallbackViewFnName = fallbackView.fnName;\n fallbackDecls = fallbackView.decls;\n fallbackVars = fallbackView.vars;\n }\n ir.OpList.replace(\n op,\n ng.projection(\n op.handle.slot!,\n op.projectionSlotIndex,\n op.attributes,\n fallbackViewFnName,\n fallbackDecls,\n fallbackVars,\n op.sourceSpan,\n ),\n );\n break;\n case ir.OpKind.RepeaterCreate:\n if (op.handle.slot === null) {\n throw new Error('No slot was assigned for repeater instruction');\n }\n if (!(unit instanceof ViewCompilationUnit)) {\n throw new Error(`AssertionError: must be compiling a component`);\n }\n const repeaterView = unit.job.views.get(op.xref)!;\n if (repeaterView.fnName === null) {\n throw new Error(`AssertionError: expected repeater primary view to have been named`);\n }\n\n let emptyViewFnName: string | null = null;\n let emptyDecls: number | null = null;\n let emptyVars: number | null = null;\n if (op.emptyView !== null) {\n const emptyView = unit.job.views.get(op.emptyView);\n if (emptyView === undefined) {\n throw new Error(\n 'AssertionError: repeater had empty view xref, but empty view was not found',\n );\n }\n if (emptyView.fnName === null || emptyView.decls === null || emptyView.vars === null) {\n throw new Error(\n `AssertionError: expected repeater empty view to have been named and counted`,\n );\n }\n emptyViewFnName = emptyView.fnName;\n emptyDecls = emptyView.decls;\n emptyVars = emptyView.vars;\n }\n\n ir.OpList.replace(\n op,\n ng.repeaterCreate(\n op.handle.slot,\n repeaterView.fnName,\n op.decls!,\n op.vars!,\n op.tag,\n op.attributes,\n reifyTrackBy(unit, op),\n op.usesComponentInstance,\n emptyViewFnName,\n emptyDecls,\n emptyVars,\n op.emptyTag,\n op.emptyAttributes,\n op.wholeSourceSpan,\n ),\n );\n break;\n case ir.OpKind.SourceLocation:\n const locationsLiteral = o.literalArr(\n op.locations.map(({targetSlot, offset, line, column}) => {\n if (targetSlot.slot === null) {\n throw new Error('No slot was assigned for source location');\n }\n return o.literalArr([\n o.literal(targetSlot.slot),\n o.literal(offset),\n o.literal(line),\n o.literal(column),\n ]);\n }),\n );\n\n ir.OpList.replace(op, ng.attachSourceLocation(op.templatePath, locationsLiteral));\n break;\n case ir.OpKind.Statement:\n // Pass statement operations directly through.\n break;\n default:\n throw new Error(\n `AssertionError: Unsupported reification of create op ${ir.OpKind[op.kind]}`,\n );\n }\n }\n}\n\nfunction reifyUpdateOperations(_unit: CompilationUnit, ops: ir.OpList): void {\n for (const op of ops) {\n ir.transformExpressionsInOp(op, reifyIrExpression, ir.VisitorContextFlag.None);\n\n switch (op.kind) {\n case ir.OpKind.Advance:\n ir.OpList.replace(op, ng.advance(op.delta, op.sourceSpan));\n break;\n case ir.OpKind.Property:\n if (op.expression instanceof ir.Interpolation) {\n ir.OpList.replace(\n op,\n ng.propertyInterpolate(\n op.name,\n op.expression.strings,\n op.expression.expressions,\n op.sanitizer,\n op.sourceSpan,\n ),\n );\n } else {\n ir.OpList.replace(op, ng.property(op.name, op.expression, op.sanitizer, op.sourceSpan));\n }\n break;\n case ir.OpKind.TwoWayProperty:\n ir.OpList.replace(\n op,\n ng.twoWayProperty(op.name, op.expression, op.sanitizer, op.sourceSpan),\n );\n break;\n case ir.OpKind.StyleProp:\n if (op.expression instanceof ir.Interpolation) {\n ir.OpList.replace(\n op,\n ng.stylePropInterpolate(\n op.name,\n op.expression.strings,\n op.expression.expressions,\n op.unit,\n op.sourceSpan,\n ),\n );\n } else {\n ir.OpList.replace(op, ng.styleProp(op.name, op.expression, op.unit, op.sourceSpan));\n }\n break;\n case ir.OpKind.ClassProp:\n ir.OpList.replace(op, ng.classProp(op.name, op.expression, op.sourceSpan));\n break;\n case ir.OpKind.StyleMap:\n if (op.expression instanceof ir.Interpolation) {\n ir.OpList.replace(\n op,\n ng.styleMapInterpolate(op.expression.strings, op.expression.expressions, op.sourceSpan),\n );\n } else {\n ir.OpList.replace(op, ng.styleMap(op.expression, op.sourceSpan));\n }\n break;\n case ir.OpKind.ClassMap:\n if (op.expression instanceof ir.Interpolation) {\n ir.OpList.replace(\n op,\n ng.classMapInterpolate(op.expression.strings, op.expression.expressions, op.sourceSpan),\n );\n } else {\n ir.OpList.replace(op, ng.classMap(op.expression, op.sourceSpan));\n }\n break;\n case ir.OpKind.I18nExpression:\n ir.OpList.replace(op, ng.i18nExp(op.expression, op.sourceSpan));\n break;\n case ir.OpKind.I18nApply:\n ir.OpList.replace(op, ng.i18nApply(op.handle.slot!, op.sourceSpan));\n break;\n case ir.OpKind.InterpolateText:\n ir.OpList.replace(\n op,\n ng.textInterpolate(op.interpolation.strings, op.interpolation.expressions, op.sourceSpan),\n );\n break;\n case ir.OpKind.Attribute:\n if (op.expression instanceof ir.Interpolation) {\n ir.OpList.replace(\n op,\n ng.attributeInterpolate(\n op.name,\n op.expression.strings,\n op.expression.expressions,\n op.sanitizer,\n op.sourceSpan,\n ),\n );\n } else {\n ir.OpList.replace(op, ng.attribute(op.name, op.expression, op.sanitizer, op.namespace));\n }\n break;\n case ir.OpKind.HostProperty:\n if (op.expression instanceof ir.Interpolation) {\n throw new Error('not yet handled');\n } else {\n if (op.isAnimationTrigger) {\n ir.OpList.replace(op, ng.syntheticHostProperty(op.name, op.expression, op.sourceSpan));\n } else {\n ir.OpList.replace(\n op,\n ng.hostProperty(op.name, op.expression, op.sanitizer, op.sourceSpan),\n );\n }\n }\n break;\n case ir.OpKind.Variable:\n if (op.variable.name === null) {\n throw new Error(`AssertionError: unnamed variable ${op.xref}`);\n }\n ir.OpList.replace(\n op,\n ir.createStatementOp(\n new o.DeclareVarStmt(op.variable.name, op.initializer, undefined, o.StmtModifier.Final),\n ),\n );\n break;\n case ir.OpKind.Conditional:\n if (op.processed === null) {\n throw new Error(`Conditional test was not set.`);\n }\n ir.OpList.replace(op, ng.conditional(op.processed, op.contextValue, op.sourceSpan));\n break;\n case ir.OpKind.Repeater:\n ir.OpList.replace(op, ng.repeater(op.collection, op.sourceSpan));\n break;\n case ir.OpKind.DeferWhen:\n ir.OpList.replace(op, ng.deferWhen(op.modifier, op.expr, op.sourceSpan));\n break;\n case ir.OpKind.StoreLet:\n throw new Error(`AssertionError: unexpected storeLet ${op.declaredName}`);\n case ir.OpKind.Statement:\n // Pass statement operations directly through.\n break;\n default:\n throw new Error(\n `AssertionError: Unsupported reification of update op ${ir.OpKind[op.kind]}`,\n );\n }\n }\n}\n\nfunction reifyIrExpression(expr: o.Expression): o.Expression {\n if (!ir.isIrExpression(expr)) {\n return expr;\n }\n\n switch (expr.kind) {\n case ir.ExpressionKind.NextContext:\n return ng.nextContext(expr.steps);\n case ir.ExpressionKind.Reference:\n return ng.reference(expr.targetSlot.slot! + 1 + expr.offset);\n case ir.ExpressionKind.LexicalRead:\n throw new Error(`AssertionError: unresolved LexicalRead of ${expr.name}`);\n case ir.ExpressionKind.TwoWayBindingSet:\n throw new Error(`AssertionError: unresolved TwoWayBindingSet`);\n case ir.ExpressionKind.RestoreView:\n if (typeof expr.view === 'number') {\n throw new Error(`AssertionError: unresolved RestoreView`);\n }\n return ng.restoreView(expr.view);\n case ir.ExpressionKind.ResetView:\n return ng.resetView(expr.expr);\n case ir.ExpressionKind.GetCurrentView:\n return ng.getCurrentView();\n case ir.ExpressionKind.ReadVariable:\n if (expr.name === null) {\n throw new Error(`Read of unnamed variable ${expr.xref}`);\n }\n return o.variable(expr.name);\n case ir.ExpressionKind.ReadTemporaryExpr:\n if (expr.name === null) {\n throw new Error(`Read of unnamed temporary ${expr.xref}`);\n }\n return o.variable(expr.name);\n case ir.ExpressionKind.AssignTemporaryExpr:\n if (expr.name === null) {\n throw new Error(`Assign of unnamed temporary ${expr.xref}`);\n }\n return o.variable(expr.name).set(expr.expr);\n case ir.ExpressionKind.PureFunctionExpr:\n if (expr.fn === null) {\n throw new Error(`AssertionError: expected PureFunctions to have been extracted`);\n }\n return ng.pureFunction(expr.varOffset!, expr.fn, expr.args);\n case ir.ExpressionKind.PureFunctionParameterExpr:\n throw new Error(`AssertionError: expected PureFunctionParameterExpr to have been extracted`);\n case ir.ExpressionKind.PipeBinding:\n return ng.pipeBind(expr.targetSlot.slot!, expr.varOffset!, expr.args);\n case ir.ExpressionKind.PipeBindingVariadic:\n return ng.pipeBindV(expr.targetSlot.slot!, expr.varOffset!, expr.args);\n case ir.ExpressionKind.SlotLiteralExpr:\n return o.literal(expr.slot.slot!);\n case ir.ExpressionKind.ContextLetReference:\n return ng.readContextLet(expr.targetSlot.slot!);\n case ir.ExpressionKind.StoreLet:\n return ng.storeLet(expr.value, expr.sourceSpan);\n case ir.ExpressionKind.TrackContext:\n return o.variable('this');\n default:\n throw new Error(\n `AssertionError: Unsupported reification of ir.Expression kind: ${\n ir.ExpressionKind[(expr as ir.Expression).kind]\n }`,\n );\n }\n}\n\n/**\n * Listeners get turned into a function expression, which may or may not have the `$event`\n * parameter defined.\n */\nfunction reifyListenerHandler(\n unit: CompilationUnit,\n name: string,\n handlerOps: ir.OpList,\n consumesDollarEvent: boolean,\n): o.FunctionExpr {\n // First, reify all instruction calls within `handlerOps`.\n reifyUpdateOperations(unit, handlerOps);\n\n // Next, extract all the `o.Statement`s from the reified operations. We can expect that at this\n // point, all operations have been converted to statements.\n const handlerStmts: o.Statement[] = [];\n for (const op of handlerOps) {\n if (op.kind !== ir.OpKind.Statement) {\n throw new Error(\n `AssertionError: expected reified statements, but found op ${ir.OpKind[op.kind]}`,\n );\n }\n handlerStmts.push(op.statement);\n }\n\n // If `$event` is referenced, we need to generate it as a parameter.\n const params: o.FnParam[] = [];\n if (consumesDollarEvent) {\n // We need the `$event` parameter.\n params.push(new o.FnParam('$event'));\n }\n\n return o.fn(params, handlerStmts, undefined, undefined, name);\n}\n\n/** Reifies the tracking expression of a `RepeaterCreateOp`. */\nfunction reifyTrackBy(unit: CompilationUnit, op: ir.RepeaterCreateOp): o.Expression {\n // If the tracking function was created already, there's nothing left to do.\n if (op.trackByFn !== null) {\n return op.trackByFn;\n }\n\n const params: o.FnParam[] = [new o.FnParam('$index'), new o.FnParam('$item')];\n let fn: o.FunctionExpr | o.ArrowFunctionExpr;\n\n if (op.trackByOps === null) {\n // If there are no additional ops related to the tracking function, we just need\n // to turn it into a function that returns the result of the expression.\n fn = op.usesComponentInstance\n ? o.fn(params, [new o.ReturnStatement(op.track)])\n : o.arrowFn(params, op.track);\n } else {\n // Otherwise first we need to reify the track-related ops.\n reifyUpdateOperations(unit, op.trackByOps);\n\n const statements: o.Statement[] = [];\n for (const trackOp of op.trackByOps) {\n if (trackOp.kind !== ir.OpKind.Statement) {\n throw new Error(\n `AssertionError: expected reified statements, but found op ${ir.OpKind[trackOp.kind]}`,\n );\n }\n statements.push(trackOp.statement);\n }\n\n // Afterwards we can create the function from those ops.\n fn =\n op.usesComponentInstance ||\n statements.length !== 1 ||\n !(statements[0] instanceof o.ReturnStatement)\n ? o.fn(params, statements)\n : o.arrowFn(params, statements[0].value);\n }\n\n op.trackByFn = unit.job.pool.getSharedFunctionReference(fn, '_forTrack');\n return op.trackByFn;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Binding with no content can be safely deleted.\n */\nexport function removeEmptyBindings(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.update) {\n switch (op.kind) {\n case ir.OpKind.Attribute:\n case ir.OpKind.Binding:\n case ir.OpKind.ClassProp:\n case ir.OpKind.ClassMap:\n case ir.OpKind.Property:\n case ir.OpKind.StyleProp:\n case ir.OpKind.StyleMap:\n if (op.expression instanceof ir.EmptyExpr) {\n ir.OpList.remove(op);\n }\n break;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * Remove the i18n context ops after they are no longer needed, and null out references to them to\n * be safe.\n */\nexport function removeI18nContexts(job: CompilationJob) {\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nContext:\n ir.OpList.remove(op);\n break;\n case ir.OpKind.I18nStart:\n op.context = null;\n break;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * i18nAttributes ops will be generated for each i18n attribute. However, not all i18n attribues\n * will contain dynamic content, and so some of these i18nAttributes ops may be unnecessary.\n */\nexport function removeUnusedI18nAttributesOps(job: CompilationJob) {\n for (const unit of job.units) {\n const ownersWithI18nExpressions = new Set();\n\n for (const op of unit.update) {\n switch (op.kind) {\n case ir.OpKind.I18nExpression:\n ownersWithI18nExpressions.add(op.i18nOwner);\n }\n }\n\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nAttributes:\n if (ownersWithI18nExpressions.has(op.xref)) {\n continue;\n }\n ir.OpList.remove(op);\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport {\n CompilationJob,\n CompilationUnit,\n ComponentCompilationJob,\n ViewCompilationUnit,\n} from '../compilation';\n\n/**\n * Resolves `ir.ContextExpr` expressions (which represent embedded view or component contexts) to\n * either the `ctx` parameter to component functions (for the current view context) or to variables\n * that store those contexts (for contexts accessed via the `nextContext()` instruction).\n */\nexport function resolveContexts(job: CompilationJob): void {\n for (const unit of job.units) {\n processLexicalScope(unit, unit.create);\n processLexicalScope(unit, unit.update);\n }\n}\n\nfunction processLexicalScope(\n view: CompilationUnit,\n ops: ir.OpList,\n): void {\n // Track the expressions used to access all available contexts within the current view, by the\n // view `ir.XrefId`.\n const scope = new Map();\n\n // The current view's context is accessible via the `ctx` parameter.\n scope.set(view.xref, o.variable('ctx'));\n\n for (const op of ops) {\n switch (op.kind) {\n case ir.OpKind.Variable:\n switch (op.variable.kind) {\n case ir.SemanticVariableKind.Context:\n scope.set(op.variable.view, new ir.ReadVariableExpr(op.xref));\n break;\n }\n break;\n case ir.OpKind.Listener:\n case ir.OpKind.TwoWayListener:\n processLexicalScope(view, op.handlerOps);\n break;\n case ir.OpKind.RepeaterCreate:\n if (op.trackByOps !== null) {\n processLexicalScope(view, op.trackByOps);\n }\n break;\n }\n }\n\n if (view === view.job.root) {\n // Prefer `ctx` of the root view to any variables which happen to contain the root context.\n scope.set(view.xref, o.variable('ctx'));\n }\n\n for (const op of ops) {\n ir.transformExpressionsInOp(\n op,\n (expr) => {\n if (expr instanceof ir.ContextExpr) {\n if (!scope.has(expr.view)) {\n throw new Error(\n `No context found for reference to view ${expr.view} from view ${view.xref}`,\n );\n }\n return scope.get(expr.view)!;\n } else {\n return expr;\n }\n },\n ir.VisitorContextFlag.None,\n );\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Any variable inside a listener with the name `$event` will be transformed into a output lexical\n * read immediately, and does not participate in any of the normal logic for handling variables.\n */\nexport function resolveDollarEvent(job: CompilationJob): void {\n for (const unit of job.units) {\n transformDollarEvent(unit.create);\n transformDollarEvent(unit.update);\n }\n}\n\nfunction transformDollarEvent(ops: ir.OpList | ir.OpList): void {\n for (const op of ops) {\n if (op.kind === ir.OpKind.Listener || op.kind === ir.OpKind.TwoWayListener) {\n ir.transformExpressionsInOp(\n op,\n (expr) => {\n if (expr instanceof ir.LexicalReadExpr && expr.name === '$event') {\n // Two-way listeners always consume `$event` so they omit this field.\n if (op.kind === ir.OpKind.Listener) {\n op.consumesDollarEvent = true;\n }\n return new o.ReadVarExpr(expr.name);\n }\n return expr;\n },\n ir.VisitorContextFlag.InChildOperation,\n );\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as i18n from '../../../../i18n/i18n_ast';\nimport * as ir from '../../ir';\nimport {ComponentCompilationJob, ViewCompilationUnit} from '../compilation';\n\n/**\n * Resolve the element placeholders in i18n messages.\n */\nexport function resolveI18nElementPlaceholders(job: ComponentCompilationJob) {\n // Record all of the element and i18n context ops for use later.\n const i18nContexts = new Map();\n const elements = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nContext:\n i18nContexts.set(op.xref, op);\n break;\n case ir.OpKind.ElementStart:\n elements.set(op.xref, op);\n break;\n }\n }\n }\n\n resolvePlaceholdersForView(job, job.root, i18nContexts, elements);\n}\n\n/**\n * Recursively resolves element and template tag placeholders in the given view.\n */\nfunction resolvePlaceholdersForView(\n job: ComponentCompilationJob,\n unit: ViewCompilationUnit,\n i18nContexts: Map,\n elements: Map,\n pendingStructuralDirective?: ir.TemplateOp,\n) {\n // Track the current i18n op and corresponding i18n context op as we step through the creation\n // IR.\n let currentOps: {i18nBlock: ir.I18nStartOp; i18nContext: ir.I18nContextOp} | null = null;\n let pendingStructuralDirectiveCloses = new Map();\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nStart:\n if (!op.context) {\n throw Error('Could not find i18n context for i18n op');\n }\n currentOps = {i18nBlock: op, i18nContext: i18nContexts.get(op.context)!};\n break;\n case ir.OpKind.I18nEnd:\n currentOps = null;\n break;\n case ir.OpKind.ElementStart:\n // For elements with i18n placeholders, record its slot value in the params map under the\n // corresponding tag start placeholder.\n if (op.i18nPlaceholder !== undefined) {\n if (currentOps === null) {\n throw Error('i18n tag placeholder should only occur inside an i18n block');\n }\n recordElementStart(\n op,\n currentOps.i18nContext,\n currentOps.i18nBlock,\n pendingStructuralDirective,\n );\n // If there is a separate close tag placeholder for this element, save the pending\n // structural directive so we can pass it to the closing tag as well.\n if (pendingStructuralDirective && op.i18nPlaceholder.closeName) {\n pendingStructuralDirectiveCloses.set(op.xref, pendingStructuralDirective);\n }\n // Clear out the pending structural directive now that its been accounted for.\n pendingStructuralDirective = undefined;\n }\n break;\n case ir.OpKind.ElementEnd:\n // For elements with i18n placeholders, record its slot value in the params map under the\n // corresponding tag close placeholder.\n const startOp = elements.get(op.xref);\n if (startOp && startOp.i18nPlaceholder !== undefined) {\n if (currentOps === null) {\n throw Error(\n 'AssertionError: i18n tag placeholder should only occur inside an i18n block',\n );\n }\n recordElementClose(\n startOp,\n currentOps.i18nContext,\n currentOps.i18nBlock,\n pendingStructuralDirectiveCloses.get(op.xref),\n );\n // Clear out the pending structural directive close that was accounted for.\n pendingStructuralDirectiveCloses.delete(op.xref);\n }\n break;\n case ir.OpKind.Projection:\n // For content projections with i18n placeholders, record its slot value in the params map\n // under the corresponding tag start and close placeholders.\n if (op.i18nPlaceholder !== undefined) {\n if (currentOps === null) {\n throw Error('i18n tag placeholder should only occur inside an i18n block');\n }\n recordElementStart(\n op,\n currentOps.i18nContext,\n currentOps.i18nBlock,\n pendingStructuralDirective,\n );\n recordElementClose(\n op,\n currentOps.i18nContext,\n currentOps.i18nBlock,\n pendingStructuralDirective,\n );\n // Clear out the pending structural directive now that its been accounted for.\n pendingStructuralDirective = undefined;\n }\n break;\n case ir.OpKind.Template:\n const view = job.views.get(op.xref)!;\n if (op.i18nPlaceholder === undefined) {\n // If there is no i18n placeholder, just recurse into the view in case it contains i18n\n // blocks.\n resolvePlaceholdersForView(job, view, i18nContexts, elements);\n } else {\n if (currentOps === null) {\n throw Error('i18n tag placeholder should only occur inside an i18n block');\n }\n if (op.templateKind === ir.TemplateKind.Structural) {\n // If this is a structural directive template, don't record anything yet. Instead pass\n // the current template as a pending structural directive to be recorded when we find\n // the element, content, or template it belongs to. This allows us to create combined\n // values that represent, e.g. the start of a template and element at the same time.\n resolvePlaceholdersForView(job, view, i18nContexts, elements, op);\n } else {\n // If this is some other kind of template, we can record its start, recurse into its\n // view, and then record its end.\n recordTemplateStart(\n job,\n view,\n op.handle.slot!,\n op.i18nPlaceholder,\n currentOps.i18nContext,\n currentOps.i18nBlock,\n pendingStructuralDirective,\n );\n resolvePlaceholdersForView(job, view, i18nContexts, elements);\n recordTemplateClose(\n job,\n view,\n op.handle.slot!,\n op.i18nPlaceholder,\n currentOps!.i18nContext,\n currentOps!.i18nBlock,\n pendingStructuralDirective,\n );\n pendingStructuralDirective = undefined;\n }\n }\n break;\n case ir.OpKind.RepeaterCreate:\n if (pendingStructuralDirective !== undefined) {\n throw Error('AssertionError: Unexpected structural directive associated with @for block');\n }\n // RepeaterCreate has 3 slots: the first is for the op itself, the second is for the @for\n // template and the (optional) third is for the @empty template.\n const forSlot = op.handle.slot! + 1;\n const forView = job.views.get(op.xref)!;\n // First record all of the placeholders for the @for template.\n if (op.i18nPlaceholder === undefined) {\n // If there is no i18n placeholder, just recurse into the view in case it contains i18n\n // blocks.\n resolvePlaceholdersForView(job, forView, i18nContexts, elements);\n } else {\n if (currentOps === null) {\n throw Error('i18n tag placeholder should only occur inside an i18n block');\n }\n recordTemplateStart(\n job,\n forView,\n forSlot,\n op.i18nPlaceholder,\n currentOps.i18nContext,\n currentOps.i18nBlock,\n pendingStructuralDirective,\n );\n resolvePlaceholdersForView(job, forView, i18nContexts, elements);\n recordTemplateClose(\n job,\n forView,\n forSlot,\n op.i18nPlaceholder,\n currentOps!.i18nContext,\n currentOps!.i18nBlock,\n pendingStructuralDirective,\n );\n pendingStructuralDirective = undefined;\n }\n // Then if there's an @empty template, add its placeholders as well.\n if (op.emptyView !== null) {\n // RepeaterCreate has 3 slots: the first is for the op itself, the second is for the @for\n // template and the (optional) third is for the @empty template.\n const emptySlot = op.handle.slot! + 2;\n const emptyView = job.views.get(op.emptyView!)!;\n if (op.emptyI18nPlaceholder === undefined) {\n // If there is no i18n placeholder, just recurse into the view in case it contains i18n\n // blocks.\n resolvePlaceholdersForView(job, emptyView, i18nContexts, elements);\n } else {\n if (currentOps === null) {\n throw Error('i18n tag placeholder should only occur inside an i18n block');\n }\n recordTemplateStart(\n job,\n emptyView,\n emptySlot,\n op.emptyI18nPlaceholder,\n currentOps.i18nContext,\n currentOps.i18nBlock,\n pendingStructuralDirective,\n );\n resolvePlaceholdersForView(job, emptyView, i18nContexts, elements);\n recordTemplateClose(\n job,\n emptyView,\n emptySlot,\n op.emptyI18nPlaceholder,\n currentOps!.i18nContext,\n currentOps!.i18nBlock,\n pendingStructuralDirective,\n );\n pendingStructuralDirective = undefined;\n }\n }\n break;\n }\n }\n}\n\n/**\n * Records an i18n param value for the start of an element.\n */\nfunction recordElementStart(\n op: ir.ElementStartOp | ir.ProjectionOp,\n i18nContext: ir.I18nContextOp,\n i18nBlock: ir.I18nStartOp,\n structuralDirective?: ir.TemplateOp,\n) {\n const {startName, closeName} = op.i18nPlaceholder!;\n let flags = ir.I18nParamValueFlags.ElementTag | ir.I18nParamValueFlags.OpenTag;\n let value: ir.I18nParamValue['value'] = op.handle.slot!;\n // If the element is associated with a structural directive, start it as well.\n if (structuralDirective !== undefined) {\n flags |= ir.I18nParamValueFlags.TemplateTag;\n value = {element: value, template: structuralDirective.handle.slot!};\n }\n // For self-closing tags, there is no close tag placeholder. Instead, the start tag\n // placeholder accounts for the start and close of the element.\n if (!closeName) {\n flags |= ir.I18nParamValueFlags.CloseTag;\n }\n addParam(i18nContext.params, startName, value, i18nBlock.subTemplateIndex, flags);\n}\n\n/**\n * Records an i18n param value for the closing of an element.\n */\nfunction recordElementClose(\n op: ir.ElementStartOp | ir.ProjectionOp,\n i18nContext: ir.I18nContextOp,\n i18nBlock: ir.I18nStartOp,\n structuralDirective?: ir.TemplateOp,\n) {\n const {closeName} = op.i18nPlaceholder!;\n // Self-closing tags don't have a closing tag placeholder, instead the element closing is\n // recorded via an additional flag on the element start value.\n if (closeName) {\n let flags = ir.I18nParamValueFlags.ElementTag | ir.I18nParamValueFlags.CloseTag;\n let value: ir.I18nParamValue['value'] = op.handle.slot!;\n // If the element is associated with a structural directive, close it as well.\n if (structuralDirective !== undefined) {\n flags |= ir.I18nParamValueFlags.TemplateTag;\n value = {element: value, template: structuralDirective.handle.slot!};\n }\n addParam(i18nContext.params, closeName, value, i18nBlock.subTemplateIndex, flags);\n }\n}\n\n/**\n * Records an i18n param value for the start of a template.\n */\nfunction recordTemplateStart(\n job: ComponentCompilationJob,\n view: ViewCompilationUnit,\n slot: number,\n i18nPlaceholder: i18n.TagPlaceholder | i18n.BlockPlaceholder,\n i18nContext: ir.I18nContextOp,\n i18nBlock: ir.I18nStartOp,\n structuralDirective?: ir.TemplateOp,\n) {\n let {startName, closeName} = i18nPlaceholder;\n let flags = ir.I18nParamValueFlags.TemplateTag | ir.I18nParamValueFlags.OpenTag;\n // For self-closing tags, there is no close tag placeholder. Instead, the start tag\n // placeholder accounts for the start and close of the element.\n if (!closeName) {\n flags |= ir.I18nParamValueFlags.CloseTag;\n }\n // If the template is associated with a structural directive, record the structural directive's\n // start first. Since this template must be in the structural directive's view, we can just\n // directly use the current i18n block's sub-template index.\n if (structuralDirective !== undefined) {\n addParam(\n i18nContext.params,\n startName,\n structuralDirective.handle.slot!,\n i18nBlock.subTemplateIndex,\n flags,\n );\n }\n // Record the start of the template. For the sub-template index, pass the index for the template's\n // view, rather than the current i18n block's index.\n addParam(\n i18nContext.params,\n startName,\n slot,\n getSubTemplateIndexForTemplateTag(job, i18nBlock, view),\n flags,\n );\n}\n\n/**\n * Records an i18n param value for the closing of a template.\n */\nfunction recordTemplateClose(\n job: ComponentCompilationJob,\n view: ViewCompilationUnit,\n slot: number,\n i18nPlaceholder: i18n.TagPlaceholder | i18n.BlockPlaceholder,\n i18nContext: ir.I18nContextOp,\n i18nBlock: ir.I18nStartOp,\n structuralDirective?: ir.TemplateOp,\n) {\n const {closeName} = i18nPlaceholder;\n const flags = ir.I18nParamValueFlags.TemplateTag | ir.I18nParamValueFlags.CloseTag;\n // Self-closing tags don't have a closing tag placeholder, instead the template's closing is\n // recorded via an additional flag on the template start value.\n if (closeName) {\n // Record the closing of the template. For the sub-template index, pass the index for the\n // template's view, rather than the current i18n block's index.\n addParam(\n i18nContext.params,\n closeName,\n slot,\n getSubTemplateIndexForTemplateTag(job, i18nBlock, view),\n flags,\n );\n // If the template is associated with a structural directive, record the structural directive's\n // closing after. Since this template must be in the structural directive's view, we can just\n // directly use the current i18n block's sub-template index.\n if (structuralDirective !== undefined) {\n addParam(\n i18nContext.params,\n closeName,\n structuralDirective.handle.slot!,\n i18nBlock.subTemplateIndex,\n flags,\n );\n }\n }\n}\n\n/**\n * Get the subTemplateIndex for the given template op. For template ops, use the subTemplateIndex of\n * the child i18n block inside the template.\n */\nfunction getSubTemplateIndexForTemplateTag(\n job: ComponentCompilationJob,\n i18nOp: ir.I18nStartOp,\n view: ViewCompilationUnit,\n): number | null {\n for (const childOp of view.create) {\n if (childOp.kind === ir.OpKind.I18nStart) {\n return childOp.subTemplateIndex;\n }\n }\n return i18nOp.subTemplateIndex;\n}\n\n/**\n * Add a param value to the given params map.\n */\nfunction addParam(\n params: Map,\n placeholder: string,\n value: string | number | {element: number; template: number},\n subTemplateIndex: number | null,\n flags: ir.I18nParamValueFlags,\n) {\n const values = params.get(placeholder) ?? [];\n values.push({value, subTemplateIndex, flags});\n params.set(placeholder, values);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {ComponentCompilationJob} from '../compilation';\n\n/**\n * Resolve the i18n expression placeholders in i18n messages.\n */\nexport function resolveI18nExpressionPlaceholders(job: ComponentCompilationJob) {\n // Record all of the i18n context ops, and the sub-template index for each i18n op.\n const subTemplateIndices = new Map();\n const i18nContexts = new Map();\n const icuPlaceholders = new Map();\n for (const unit of job.units) {\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nStart:\n subTemplateIndices.set(op.xref, op.subTemplateIndex);\n break;\n case ir.OpKind.I18nContext:\n i18nContexts.set(op.xref, op);\n break;\n case ir.OpKind.IcuPlaceholder:\n icuPlaceholders.set(op.xref, op);\n break;\n }\n }\n }\n\n // Keep track of the next available expression index for each i18n message.\n const expressionIndices = new Map();\n\n // Keep track of a reference index for each expression.\n // We use different references for normal i18n expressio and attribute i18n expressions. This is\n // because child i18n blocks in templates don't get their own context, since they're rolled into\n // the translated message of the parent, but they may target a different slot.\n const referenceIndex = (op: ir.I18nExpressionOp): ir.XrefId =>\n op.usage === ir.I18nExpressionFor.I18nText ? op.i18nOwner : op.context;\n\n for (const unit of job.units) {\n for (const op of unit.update) {\n if (op.kind === ir.OpKind.I18nExpression) {\n const index = expressionIndices.get(referenceIndex(op)) || 0;\n const subTemplateIndex = subTemplateIndices.get(op.i18nOwner) ?? null;\n const value: ir.I18nParamValue = {\n value: index,\n subTemplateIndex: subTemplateIndex,\n flags: ir.I18nParamValueFlags.ExpressionIndex,\n };\n updatePlaceholder(op, value, i18nContexts, icuPlaceholders);\n expressionIndices.set(referenceIndex(op), index + 1);\n }\n }\n }\n}\n\nfunction updatePlaceholder(\n op: ir.I18nExpressionOp,\n value: ir.I18nParamValue,\n i18nContexts: Map,\n icuPlaceholders: Map,\n) {\n if (op.i18nPlaceholder !== null) {\n const i18nContext = i18nContexts.get(op.context)!;\n const params =\n op.resolutionTime === ir.I18nParamResolutionTime.Creation\n ? i18nContext.params\n : i18nContext.postprocessingParams;\n const values = params.get(op.i18nPlaceholder) || [];\n values.push(value);\n params.set(op.i18nPlaceholder, values);\n }\n if (op.icuPlaceholder !== null) {\n const icuPlaceholderOp = icuPlaceholders.get(op.icuPlaceholder);\n icuPlaceholderOp?.expressionPlaceholders.push(value);\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SecurityContext} from '../../../../core';\nimport * as o from '../../../../output/output_ast';\nimport {Identifiers} from '../../../../render3/r3_identifiers';\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\nimport {MATH_ML_NAMESPACE, SVG_NAMESPACE} from '../namespaces';\n\n/**\n * Wraps static i18n extracted attributes in their corresponding sanitizers/validators.\n */\nexport function resolveI18nAttrSanitizers(job: CompilationJob): void {\n const tagNamesByElement = new Map();\n\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n if (op.kind === ir.OpKind.ElementStart || op.kind === ir.OpKind.Template) {\n let tag = op.tag ?? '';\n switch (op.namespace) {\n case ir.Namespace.SVG:\n tag = `:${SVG_NAMESPACE}:${tag}`;\n break;\n case ir.Namespace.Math:\n tag = `:${MATH_ML_NAMESPACE}:${tag}`;\n break;\n }\n\n tagNamesByElement.set(op.xref, tag);\n }\n }\n }\n\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (\n op.kind === ir.OpKind.ExtractedAttribute &&\n op.i18nContext !== null &&\n op.expression !== null\n ) {\n const tagName = tagNamesByElement.get(op.target) ?? '';\n let expr = op.expression;\n switch (op.securityContext) {\n case SecurityContext.HTML:\n expr = o.importExpr(Identifiers.sanitizeHtml).callFn([expr]);\n break;\n case SecurityContext.STYLE:\n expr = o.importExpr(Identifiers.sanitizeStyle).callFn([expr]);\n break;\n case SecurityContext.SCRIPT:\n expr = o.importExpr(Identifiers.sanitizeScript).callFn([expr]);\n break;\n case SecurityContext.URL:\n expr = o.importExpr(Identifiers.sanitizeUrl).callFn([expr]);\n break;\n case SecurityContext.RESOURCE_URL:\n expr = o.importExpr(Identifiers.sanitizeResourceUrl).callFn([expr]);\n break;\n case SecurityContext.ATTRIBUTE_NO_BINDING:\n expr = o\n .importExpr(Identifiers.validateAttribute)\n .callFn([expr, o.literal(tagName), o.literal(op.name)]);\n break;\n }\n op.expression = expr;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport {CompilationJob, CompilationUnit} from '../compilation';\n\n/**\n * Resolves lexical references in views (`ir.LexicalReadExpr`) to either a target variable or to\n * property reads on the top-level component context.\n *\n * Also matches `ir.RestoreViewExpr` expressions with the variables of their corresponding saved\n * views.\n */\nexport function resolveNames(job: CompilationJob): void {\n for (const unit of job.units) {\n processLexicalScope(unit, unit.create, null);\n processLexicalScope(unit, unit.update, null);\n }\n}\n\nfunction processLexicalScope(\n unit: CompilationUnit,\n ops: ir.OpList | ir.OpList,\n savedView: SavedView | null,\n): void {\n // Maps names defined in the lexical scope of this template to the `ir.XrefId`s of the variable\n // declarations which represent those values.\n //\n // Since variables are generated in each view for the entire lexical scope (including any\n // identifiers from parent templates) only local variables need be considered here.\n const scope = new Map();\n\n // Symbols defined within the current scope. They take precedence over ones defined outside.\n const localDefinitions = new Map();\n\n // First, step through the operations list and:\n // 1) build up the `scope` mapping\n // 2) recurse into any listener functions\n for (const op of ops) {\n switch (op.kind) {\n case ir.OpKind.Variable:\n switch (op.variable.kind) {\n case ir.SemanticVariableKind.Identifier:\n if (op.variable.local) {\n if (localDefinitions.has(op.variable.identifier)) {\n continue;\n }\n localDefinitions.set(op.variable.identifier, op.xref);\n } else if (scope.has(op.variable.identifier)) {\n continue;\n }\n scope.set(op.variable.identifier, op.xref);\n break;\n case ir.SemanticVariableKind.Alias:\n // This variable represents some kind of identifier which can be used in the template.\n if (scope.has(op.variable.identifier)) {\n continue;\n }\n scope.set(op.variable.identifier, op.xref);\n break;\n case ir.SemanticVariableKind.SavedView:\n // This variable represents a snapshot of the current view context, and can be used to\n // restore that context within listener functions.\n savedView = {\n view: op.variable.view,\n variable: op.xref,\n };\n break;\n }\n break;\n case ir.OpKind.Listener:\n case ir.OpKind.TwoWayListener:\n // Listener functions have separate variable declarations, so process them as a separate\n // lexical scope.\n processLexicalScope(unit, op.handlerOps, savedView);\n break;\n case ir.OpKind.RepeaterCreate:\n if (op.trackByOps !== null) {\n processLexicalScope(unit, op.trackByOps, savedView);\n }\n break;\n }\n }\n\n // Next, use the `scope` mapping to match `ir.LexicalReadExpr` with defined names in the lexical\n // scope. Also, look for `ir.RestoreViewExpr`s and match them with the snapshotted view context\n // variable.\n for (const op of ops) {\n if (op.kind == ir.OpKind.Listener || op.kind === ir.OpKind.TwoWayListener) {\n // Listeners were already processed above with their own scopes.\n continue;\n }\n ir.transformExpressionsInOp(\n op,\n (expr) => {\n if (expr instanceof ir.LexicalReadExpr) {\n // `expr` is a read of a name within the lexical scope of this view.\n // Either that name is defined within the current view, or it represents a property from the\n // main component context.\n if (localDefinitions.has(expr.name)) {\n return new ir.ReadVariableExpr(localDefinitions.get(expr.name)!);\n } else if (scope.has(expr.name)) {\n // This was a defined variable in the current scope.\n return new ir.ReadVariableExpr(scope.get(expr.name)!);\n } else {\n // Reading from the component context.\n return new o.ReadPropExpr(new ir.ContextExpr(unit.job.root.xref), expr.name);\n }\n } else if (expr instanceof ir.RestoreViewExpr && typeof expr.view === 'number') {\n // `ir.RestoreViewExpr` happens in listener functions and restores a saved view from the\n // parent creation list. We expect to find that we captured the `savedView` previously, and\n // that it matches the expected view to be restored.\n if (savedView === null || savedView.view !== expr.view) {\n throw new Error(`AssertionError: no saved view ${expr.view} from view ${unit.xref}`);\n }\n expr.view = new ir.ReadVariableExpr(savedView.variable);\n return expr;\n } else {\n return expr;\n }\n },\n ir.VisitorContextFlag.None,\n );\n }\n\n for (const op of ops) {\n ir.visitExpressionsInOp(op, (expr) => {\n if (expr instanceof ir.LexicalReadExpr) {\n throw new Error(\n `AssertionError: no lexical reads should remain, but found read of ${expr.name}`,\n );\n }\n });\n }\n}\n\n/**\n * Information about a `SavedView` variable.\n */\ninterface SavedView {\n /**\n * The view `ir.XrefId` which was saved into this variable.\n */\n view: ir.XrefId;\n\n /**\n * The `ir.XrefId` of the variable into which the view was saved.\n */\n variable: ir.XrefId;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SecurityContext} from '../../../../core';\nimport * as o from '../../../../output/output_ast';\nimport {Identifiers} from '../../../../render3/r3_identifiers';\nimport * as ir from '../../ir';\nimport {CompilationJob, CompilationJobKind} from '../compilation';\n\n/**\n * Map of security contexts to their sanitizer function.\n */\nconst sanitizerFns = new Map([\n [SecurityContext.HTML, Identifiers.sanitizeHtml],\n [SecurityContext.RESOURCE_URL, Identifiers.sanitizeResourceUrl],\n [SecurityContext.SCRIPT, Identifiers.sanitizeScript],\n [SecurityContext.STYLE, Identifiers.sanitizeStyle],\n [SecurityContext.URL, Identifiers.sanitizeUrl],\n [SecurityContext.ATTRIBUTE_NO_BINDING, Identifiers.validateAttribute],\n]);\n\n/**\n * Map of security contexts to their trusted value function.\n */\nconst trustedValueFns = new Map([\n [SecurityContext.HTML, Identifiers.trustConstantHtml],\n [SecurityContext.RESOURCE_URL, Identifiers.trustConstantResourceUrl],\n]);\n\n/**\n * Resolves sanitization functions for ops that need them.\n */\nexport function resolveSanitizers(job: CompilationJob): void {\n for (const unit of job.units) {\n // For normal element bindings we create trusted values for security sensitive constant\n // attributes. However, for host bindings we skip this step (this matches what\n // TemplateDefinitionBuilder does).\n // TODO: Is the TDB behavior correct here?\n if (job.kind !== CompilationJobKind.Host) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.ExtractedAttribute) {\n const trustedValueFn =\n trustedValueFns.get(getOnlySecurityContext(op.securityContext)) ?? null;\n op.trustedValueFn = trustedValueFn !== null ? o.importExpr(trustedValueFn) : null;\n }\n }\n }\n\n for (const op of unit.update) {\n switch (op.kind) {\n case ir.OpKind.Property:\n case ir.OpKind.Attribute:\n case ir.OpKind.HostProperty:\n let sanitizerFn: o.ExternalReference | null = null;\n if (\n Array.isArray(op.securityContext) &&\n op.securityContext.length === 2 &&\n op.securityContext.includes(SecurityContext.URL) &&\n op.securityContext.includes(SecurityContext.RESOURCE_URL)\n ) {\n // When the host element isn't known, some URL attributes (such as \"src\" and \"href\") may\n // be part of multiple different security contexts. In this case we use special\n // sanitization function and select the actual sanitizer at runtime based on a tag name\n // that is provided while invoking sanitization function.\n sanitizerFn = Identifiers.sanitizeUrlOrResourceUrl;\n } else {\n sanitizerFn = sanitizerFns.get(getOnlySecurityContext(op.securityContext)) ?? null;\n }\n\n op.sanitizer = sanitizerFn !== null ? o.importExpr(sanitizerFn) : null;\n\n break;\n }\n }\n }\n}\n\n/**\n * Asserts that there is only a single security context and returns it.\n */\nfunction getOnlySecurityContext(\n securityContext: SecurityContext | SecurityContext[],\n): SecurityContext {\n if (Array.isArray(securityContext)) {\n if (securityContext.length > 1) {\n // TODO: What should we do here? TDB just took the first one, but this feels like something we\n // would want to know about and create a special case for like we did for Url/ResourceUrl. My\n // guess is that, outside of the Url/ResourceUrl case, this never actually happens. If there\n // do turn out to be other cases, throwing an error until we can address it feels safer.\n throw Error(`AssertionError: Ambiguous security context`);\n }\n return securityContext[0] || SecurityContext.NONE;\n }\n return securityContext;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport * as ng from '../instruction';\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Transforms a `TwoWayBindingSet` expression into an expression that either\n * sets a value through the `twoWayBindingSet` instruction or falls back to setting\n * the value directly. E.g. the expression `TwoWayBindingSet(target, value)` becomes:\n * `ng.twoWayBindingSet(target, value) || (target = value)`.\n */\nexport function transformTwoWayBindingSet(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.TwoWayListener) {\n ir.transformExpressionsInOp(\n op,\n (expr) => {\n if (!(expr instanceof ir.TwoWayBindingSetExpr)) {\n return expr;\n }\n\n const {target, value} = expr;\n\n if (target instanceof o.ReadPropExpr || target instanceof o.ReadKeyExpr) {\n return ng.twoWayBindingSet(target, value).or(target.set(value));\n }\n\n // ASSUMPTION: here we're assuming that `ReadVariableExpr` will be a reference\n // to a local template variable. This appears to be the case at the time of writing.\n // If the expression is targeting a variable read, we only emit the `twoWayBindingSet`\n // since the fallback would be attempting to write into a constant. Invalid usages will be\n // flagged during template type checking.\n if (target instanceof ir.ReadVariableExpr) {\n return ng.twoWayBindingSet(target, value);\n }\n\n throw new Error(`Unsupported expression in two-way action binding.`);\n },\n ir.VisitorContextFlag.InChildOperation,\n );\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport type {ComponentCompilationJob, ViewCompilationUnit} from '../compilation';\n\n/**\n * When inside of a listener, we may need access to one or more enclosing views. Therefore, each\n * view should save the current view, and each listener must have the ability to restore the\n * appropriate view. We eagerly generate all save view variables; they will be optimized away later.\n */\nexport function saveAndRestoreView(job: ComponentCompilationJob): void {\n for (const unit of job.units) {\n unit.create.prepend([\n ir.createVariableOp(\n unit.job.allocateXrefId(),\n {\n kind: ir.SemanticVariableKind.SavedView,\n name: null,\n view: unit.xref,\n },\n new ir.GetCurrentViewExpr(),\n ir.VariableFlags.None,\n ),\n ]);\n\n for (const op of unit.create) {\n if (op.kind !== ir.OpKind.Listener && op.kind !== ir.OpKind.TwoWayListener) {\n continue;\n }\n\n // Embedded views always need the save/restore view operation.\n let needsRestoreView = unit !== job.root;\n\n if (!needsRestoreView) {\n for (const handlerOp of op.handlerOps) {\n ir.visitExpressionsInOp(handlerOp, (expr) => {\n if (expr instanceof ir.ReferenceExpr || expr instanceof ir.ContextLetReferenceExpr) {\n // Listeners that reference() a local ref need the save/restore view operation.\n needsRestoreView = true;\n }\n });\n }\n }\n\n if (needsRestoreView) {\n addSaveRestoreViewOperationToListener(unit, op);\n }\n }\n }\n}\n\nfunction addSaveRestoreViewOperationToListener(\n unit: ViewCompilationUnit,\n op: ir.ListenerOp | ir.TwoWayListenerOp,\n) {\n op.handlerOps.prepend([\n ir.createVariableOp(\n unit.job.allocateXrefId(),\n {\n kind: ir.SemanticVariableKind.Context,\n name: null,\n view: unit.xref,\n },\n new ir.RestoreViewExpr(unit.xref),\n ir.VariableFlags.None,\n ),\n ]);\n\n // The \"restore view\" operation in listeners requires a call to `resetView` to reset the\n // context prior to returning from the listener operation. Find any `return` statements in\n // the listener body and wrap them in a call to reset the view.\n for (const handlerOp of op.handlerOps) {\n if (\n handlerOp.kind === ir.OpKind.Statement &&\n handlerOp.statement instanceof o.ReturnStatement\n ) {\n handlerOp.statement.value = new ir.ResetViewExpr(handlerOp.statement.value);\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {ComponentCompilationJob} from '../compilation';\n\n/**\n * Assign data slots for all operations which implement `ConsumesSlotOpTrait`, and propagate the\n * assigned data slots of those operations to any expressions which reference them via\n * `UsesSlotIndexTrait`.\n *\n * This phase is also responsible for counting the number of slots used for each view (its `decls`)\n * and propagating that number into the `Template` operations which declare embedded views.\n */\nexport function allocateSlots(job: ComponentCompilationJob): void {\n // Map of all declarations in all views within the component which require an assigned slot index.\n // This map needs to be global (across all views within the component) since it's possible to\n // reference a slot from one view from an expression within another (e.g. local references work\n // this way).\n const slotMap = new Map();\n\n // Process all views in the component and assign slot indexes.\n for (const unit of job.units) {\n // Slot indices start at 0 for each view (and are not unique between views).\n let slotCount = 0;\n\n for (const op of unit.create) {\n // Only consider declarations which consume data slots.\n if (!ir.hasConsumesSlotTrait(op)) {\n continue;\n }\n\n // Assign slots to this declaration starting at the current `slotCount`.\n op.handle.slot = slotCount;\n\n // And track its assigned slot in the `slotMap`.\n slotMap.set(op.xref, op.handle.slot);\n\n // Each declaration may use more than 1 slot, so increment `slotCount` to reserve the number\n // of slots required.\n slotCount += op.numSlotsUsed;\n }\n\n // Record the total number of slots used on the view itself. This will later be propagated into\n // `ir.TemplateOp`s which declare those views (except for the root view).\n unit.decls = slotCount;\n }\n\n // After slot assignment, `slotMap` now contains slot assignments for every declaration in the\n // whole template, across all views. Next, look for expressions which implement\n // `UsesSlotIndexExprTrait` and propagate the assigned slot indexes into them.\n // Additionally, this second scan allows us to find `ir.TemplateOp`s which declare views and\n // propagate the number of slots used for each view into the operation which declares it.\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n if (op.kind === ir.OpKind.Template || op.kind === ir.OpKind.RepeaterCreate) {\n // Record the number of slots used by the view this `ir.TemplateOp` declares in the\n // operation itself, so it can be emitted later.\n const childView = job.views.get(op.xref)!;\n op.decls = childView.decls;\n\n // TODO: currently we handle the decls for the RepeaterCreate empty template in the reify\n // phase. We should handle that here instead.\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Transforms special-case bindings with 'style' or 'class' in their names. Must run before the\n * main binding specialization pass.\n */\nexport function specializeStyleBindings(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.update) {\n if (op.kind !== ir.OpKind.Binding) {\n continue;\n }\n\n switch (op.bindingKind) {\n case ir.BindingKind.ClassName:\n if (op.expression instanceof ir.Interpolation) {\n throw new Error(`Unexpected interpolation in ClassName binding`);\n }\n ir.OpList.replace(\n op,\n ir.createClassPropOp(op.target, op.name, op.expression, op.sourceSpan),\n );\n break;\n case ir.BindingKind.StyleProperty:\n ir.OpList.replace(\n op,\n ir.createStylePropOp(op.target, op.name, op.expression, op.unit, op.sourceSpan),\n );\n break;\n case ir.BindingKind.Property:\n case ir.BindingKind.Template:\n if (op.name === 'style') {\n ir.OpList.replace(\n op,\n ir.createStyleMapOp(op.target, op.expression, op.sourceSpan),\n );\n } else if (op.name === 'class') {\n ir.OpList.replace(\n op,\n ir.createClassMapOp(op.target, op.expression, op.sourceSpan),\n );\n }\n break;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Find all assignments and usages of temporary variables, which are linked to each other with cross\n * references. Generate names for each cross-reference, and add a `DeclareVarStmt` to initialize\n * them at the beginning of the update block.\n *\n * TODO: Sometimes, it will be possible to reuse names across different subexpressions. For example,\n * in the double keyed read `a?.[f()]?.[f()]`, the two function calls have non-overlapping scopes.\n * Implement an algorithm for reuse.\n */\nexport function generateTemporaryVariables(job: CompilationJob): void {\n for (const unit of job.units) {\n unit.create.prepend(generateTemporaries(unit.create) as Array>);\n unit.update.prepend(generateTemporaries(unit.update) as Array>);\n }\n}\n\nfunction generateTemporaries(\n ops: ir.OpList,\n): Array> {\n let opCount = 0;\n let generatedStatements: Array> = [];\n\n // For each op, search for any variables that are assigned or read. For each variable, generate a\n // name and produce a `DeclareVarStmt` to the beginning of the block.\n for (const op of ops) {\n // Identify the final time each temp var is read.\n const finalReads = new Map();\n ir.visitExpressionsInOp(op, (expr, flag) => {\n if (flag & ir.VisitorContextFlag.InChildOperation) {\n return;\n }\n if (expr instanceof ir.ReadTemporaryExpr) {\n finalReads.set(expr.xref, expr);\n }\n });\n\n // Name the temp vars, accounting for the fact that a name can be reused after it has been\n // read for the final time.\n let count = 0;\n const assigned = new Set();\n const released = new Set();\n const defs = new Map();\n ir.visitExpressionsInOp(op, (expr, flag) => {\n if (flag & ir.VisitorContextFlag.InChildOperation) {\n return;\n }\n if (expr instanceof ir.AssignTemporaryExpr) {\n if (!assigned.has(expr.xref)) {\n assigned.add(expr.xref);\n // TODO: Exactly replicate the naming scheme used by `TemplateDefinitionBuilder`.\n // It seems to rely on an expression index instead of an op index.\n defs.set(expr.xref, `tmp_${opCount}_${count++}`);\n }\n assignName(defs, expr);\n } else if (expr instanceof ir.ReadTemporaryExpr) {\n if (finalReads.get(expr.xref) === expr) {\n released.add(expr.xref);\n count--;\n }\n assignName(defs, expr);\n }\n });\n\n // Add declarations for the temp vars.\n generatedStatements.push(\n ...Array.from(new Set(defs.values())).map((name) =>\n ir.createStatementOp(new o.DeclareVarStmt(name)),\n ),\n );\n opCount++;\n\n if (op.kind === ir.OpKind.Listener || op.kind === ir.OpKind.TwoWayListener) {\n op.handlerOps.prepend(generateTemporaries(op.handlerOps) as ir.UpdateOp[]);\n } else if (op.kind === ir.OpKind.RepeaterCreate && op.trackByOps !== null) {\n op.trackByOps.prepend(generateTemporaries(op.trackByOps) as ir.UpdateOp[]);\n }\n }\n\n return generatedStatements;\n}\n\n/**\n * Assigns a name to the temporary variable in the given temporary variable expression.\n */\nfunction assignName(\n names: Map,\n expr: ir.AssignTemporaryExpr | ir.ReadTemporaryExpr,\n) {\n const name = names.get(expr.xref);\n if (name === undefined) {\n throw new Error(`Found xref with unassigned name: ${expr.xref}`);\n }\n expr.name = name;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport {Identifiers} from '../../../../render3/r3_identifiers';\nimport * as ir from '../../ir';\n\nimport type {CompilationJob} from '../compilation';\n\n/**\n * `track` functions in `for` repeaters can sometimes be \"optimized,\" i.e. transformed into inline\n * expressions, in lieu of an external function call. For example, tracking by `$index` can be be\n * optimized into an inline `trackByIndex` reference. This phase checks track expressions for\n * optimizable cases.\n */\nexport function optimizeTrackFns(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind !== ir.OpKind.RepeaterCreate) {\n continue;\n }\n if (op.track instanceof o.ReadVarExpr && op.track.name === '$index') {\n // Top-level access of `$index` uses the built in `repeaterTrackByIndex`.\n op.trackByFn = o.importExpr(Identifiers.repeaterTrackByIndex);\n } else if (op.track instanceof o.ReadVarExpr && op.track.name === '$item') {\n // Top-level access of the item uses the built in `repeaterTrackByIdentity`.\n op.trackByFn = o.importExpr(Identifiers.repeaterTrackByIdentity);\n } else if (isTrackByFunctionCall(job.root.xref, op.track)) {\n // Mark the function as using the component instance to play it safe\n // since the method might be using `this` internally (see #53628).\n op.usesComponentInstance = true;\n\n // Top-level method calls in the form of `fn($index, item)` can be passed in directly.\n if (op.track.receiver.receiver.view === unit.xref) {\n // TODO: this may be wrong\n op.trackByFn = op.track.receiver;\n } else {\n // This is a plain method call, but not in the component's root view.\n // We need to get the component instance, and then call the method on it.\n op.trackByFn = o\n .importExpr(Identifiers.componentInstance)\n .callFn([])\n .prop(op.track.receiver.name);\n // Because the context is not avaiable (without a special function), we don't want to\n // try to resolve it later. Let's get rid of it by overwriting the original track\n // expression (which won't be used anyway).\n op.track = op.trackByFn;\n }\n } else {\n // The track function could not be optimized.\n // Replace context reads with a special IR expression, since context reads in a track\n // function are emitted specially.\n op.track = ir.transformExpressionsInExpression(\n op.track,\n (expr) => {\n if (expr instanceof ir.PipeBindingExpr || expr instanceof ir.PipeBindingVariadicExpr) {\n throw new Error(`Illegal State: Pipes are not allowed in this context`);\n } else if (expr instanceof ir.ContextExpr) {\n op.usesComponentInstance = true;\n return new ir.TrackContextExpr(expr.view);\n }\n return expr;\n },\n ir.VisitorContextFlag.None,\n );\n\n // Also create an OpList for the tracking expression since it may need\n // additional ops when generating the final code (e.g. temporary variables).\n const trackOpList = new ir.OpList();\n trackOpList.push(\n ir.createStatementOp(new o.ReturnStatement(op.track, op.track.sourceSpan)),\n );\n op.trackByOps = trackOpList;\n }\n }\n }\n}\n\nfunction isTrackByFunctionCall(\n rootView: ir.XrefId,\n expr: o.Expression,\n): expr is o.InvokeFunctionExpr & {\n receiver: o.ReadPropExpr & {\n receiver: ir.ContextExpr;\n };\n} {\n if (!(expr instanceof o.InvokeFunctionExpr) || expr.args.length === 0 || expr.args.length > 2) {\n return false;\n }\n\n if (\n !(\n expr.receiver instanceof o.ReadPropExpr && expr.receiver.receiver instanceof ir.ContextExpr\n ) ||\n expr.receiver.receiver.view !== rootView\n ) {\n return false;\n }\n\n const [arg0, arg1] = expr.args;\n if (!(arg0 instanceof o.ReadVarExpr) || arg0.name !== '$index') {\n return false;\n } else if (expr.args.length === 1) {\n return true;\n }\n if (!(arg1 instanceof o.ReadVarExpr) || arg1.name !== '$item') {\n return false;\n }\n return true;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\n\nimport type {CompilationJob} from '../compilation';\n\n/**\n * Inside the `track` expression on a `for` repeater, the `$index` and `$item` variables are\n * ambiently available. In this phase, we find those variable usages, and replace them with the\n * appropriate output read.\n */\nexport function generateTrackVariables(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind !== ir.OpKind.RepeaterCreate) {\n continue;\n }\n\n op.track = ir.transformExpressionsInExpression(\n op.track,\n (expr) => {\n if (expr instanceof ir.LexicalReadExpr) {\n if (op.varNames.$index.has(expr.name)) {\n return o.variable('$index');\n } else if (expr.name === op.varNames.$implicit) {\n return o.variable('$item');\n }\n\n // TODO: handle prohibited context variables (emit as globals?)\n }\n return expr;\n },\n ir.VisitorContextFlag.None,\n );\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {CompilationJob, ComponentCompilationJob} from '../compilation';\n\n/**\n * Counts the number of variable slots used within each view, and stores that on the view itself, as\n * well as propagates it to the `ir.TemplateOp` for embedded views.\n */\nexport function countVariables(job: CompilationJob): void {\n // First, count the vars used in each view, and update the view-level counter.\n for (const unit of job.units) {\n let varCount = 0;\n\n // Count variables on top-level ops first. Don't explore nested expressions just yet.\n for (const op of unit.ops()) {\n if (ir.hasConsumesVarsTrait(op)) {\n varCount += varsUsedByOp(op);\n }\n }\n\n // Count variables on expressions inside ops. We do this later because some of these expressions\n // might be conditional (e.g. `pipeBinding` inside of a ternary), and we don't want to interfere\n // with indices for top-level binding slots (e.g. `property`).\n for (const op of unit.ops()) {\n ir.visitExpressionsInOp(op, (expr) => {\n if (!ir.isIrExpression(expr)) {\n return;\n }\n\n // TemplateDefinitionBuilder assigns variable offsets for everything but pure functions\n // first, and then assigns offsets to pure functions lazily. We emulate that behavior by\n // assigning offsets in two passes instead of one, only in compatibility mode.\n if (\n job.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder &&\n expr instanceof ir.PureFunctionExpr\n ) {\n return;\n }\n\n // Some expressions require knowledge of the number of variable slots consumed.\n if (ir.hasUsesVarOffsetTrait(expr)) {\n expr.varOffset = varCount;\n }\n\n if (ir.hasConsumesVarsTrait(expr)) {\n varCount += varsUsedByIrExpression(expr);\n }\n });\n }\n\n // Compatibility mode pass for pure function offsets (as explained above).\n if (job.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder) {\n for (const op of unit.ops()) {\n ir.visitExpressionsInOp(op, (expr) => {\n if (!ir.isIrExpression(expr) || !(expr instanceof ir.PureFunctionExpr)) {\n return;\n }\n\n // Some expressions require knowledge of the number of variable slots consumed.\n if (ir.hasUsesVarOffsetTrait(expr)) {\n expr.varOffset = varCount;\n }\n\n if (ir.hasConsumesVarsTrait(expr)) {\n varCount += varsUsedByIrExpression(expr);\n }\n });\n }\n }\n\n unit.vars = varCount;\n }\n\n if (job instanceof ComponentCompilationJob) {\n // Add var counts for each view to the `ir.TemplateOp` which declares that view (if the view is\n // an embedded view).\n for (const unit of job.units) {\n for (const op of unit.create) {\n if (op.kind !== ir.OpKind.Template && op.kind !== ir.OpKind.RepeaterCreate) {\n continue;\n }\n\n const childView = job.views.get(op.xref)!;\n op.vars = childView.vars;\n\n // TODO: currently we handle the vars for the RepeaterCreate empty template in the reify\n // phase. We should handle that here instead.\n }\n }\n }\n}\n\n/**\n * Different operations that implement `ir.UsesVarsTrait` use different numbers of variables, so\n * count the variables used by any particular `op`.\n */\nfunction varsUsedByOp(op: (ir.CreateOp | ir.UpdateOp) & ir.ConsumesVarsTrait): number {\n let slots: number;\n switch (op.kind) {\n case ir.OpKind.Property:\n case ir.OpKind.HostProperty:\n case ir.OpKind.Attribute:\n // All of these bindings use 1 variable slot, plus 1 slot for every interpolated expression,\n // if any.\n slots = 1;\n if (op.expression instanceof ir.Interpolation && !isSingletonInterpolation(op.expression)) {\n slots += op.expression.expressions.length;\n }\n return slots;\n case ir.OpKind.TwoWayProperty:\n // Two-way properties can only have expressions so they only need one variable slot.\n return 1;\n case ir.OpKind.StyleProp:\n case ir.OpKind.ClassProp:\n case ir.OpKind.StyleMap:\n case ir.OpKind.ClassMap:\n // Style & class bindings use 2 variable slots, plus 1 slot for every interpolated expression,\n // if any.\n slots = 2;\n if (op.expression instanceof ir.Interpolation) {\n slots += op.expression.expressions.length;\n }\n return slots;\n case ir.OpKind.InterpolateText:\n // `ir.InterpolateTextOp`s use a variable slot for each dynamic expression.\n return op.interpolation.expressions.length;\n case ir.OpKind.I18nExpression:\n case ir.OpKind.Conditional:\n case ir.OpKind.DeferWhen:\n case ir.OpKind.StoreLet:\n return 1;\n case ir.OpKind.RepeaterCreate:\n // Repeaters may require an extra variable binding slot, if they have an empty view, for the\n // empty block tracking.\n // TODO: It's a bit odd to have a create mode instruction consume variable slots. Maybe we can\n // find a way to use the Repeater update op instead.\n return op.emptyView ? 1 : 0;\n default:\n throw new Error(`Unhandled op: ${ir.OpKind[op.kind]}`);\n }\n}\n\nexport function varsUsedByIrExpression(expr: ir.Expression & ir.ConsumesVarsTrait): number {\n switch (expr.kind) {\n case ir.ExpressionKind.PureFunctionExpr:\n return 1 + expr.args.length;\n case ir.ExpressionKind.PipeBinding:\n return 1 + expr.args.length;\n case ir.ExpressionKind.PipeBindingVariadic:\n return 1 + expr.numArgs;\n case ir.ExpressionKind.StoreLet:\n return 1;\n default:\n throw new Error(\n `AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`,\n );\n }\n}\n\nfunction isSingletonInterpolation(expr: ir.Interpolation): boolean {\n if (expr.expressions.length !== 1 || expr.strings.length !== 2) {\n return false;\n }\n if (expr.strings[0] !== '' || expr.strings[1] !== '') {\n return false;\n }\n return true;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * Optimize variables declared and used in the IR.\n *\n * Variables are eagerly generated by pipeline stages for all possible values that could be\n * referenced. This stage processes the list of declared variables and all variable usages,\n * and optimizes where possible. It performs 3 main optimizations:\n *\n * * It transforms variable declarations to side effectful expressions when the\n * variable is not used, but its initializer has global effects which other\n * operations rely upon.\n * * It removes variable declarations if those variables are not referenced and\n * either they do not have global effects, or nothing relies on them.\n * * It inlines variable declarations when those variables are only used once\n * and the inlining is semantically safe.\n *\n * To guarantee correctness, analysis of \"fences\" in the instruction lists is used to determine\n * which optimizations are safe to perform.\n */\nexport function optimizeVariables(job: CompilationJob): void {\n for (const unit of job.units) {\n inlineAlwaysInlineVariables(unit.create);\n inlineAlwaysInlineVariables(unit.update);\n\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.Listener || op.kind === ir.OpKind.TwoWayListener) {\n inlineAlwaysInlineVariables(op.handlerOps);\n } else if (op.kind === ir.OpKind.RepeaterCreate && op.trackByOps !== null) {\n inlineAlwaysInlineVariables(op.trackByOps);\n }\n }\n\n optimizeVariablesInOpList(unit.create, job.compatibility);\n optimizeVariablesInOpList(unit.update, job.compatibility);\n\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.Listener || op.kind === ir.OpKind.TwoWayListener) {\n optimizeVariablesInOpList(op.handlerOps, job.compatibility);\n } else if (op.kind === ir.OpKind.RepeaterCreate && op.trackByOps !== null) {\n optimizeVariablesInOpList(op.trackByOps, job.compatibility);\n }\n }\n }\n}\n\n/**\n * A [fence](https://en.wikipedia.org/wiki/Memory_barrier) flag for an expression which indicates\n * how that expression can be optimized in relation to other expressions or instructions.\n *\n * `Fence`s are a bitfield, so multiple flags may be set on a single expression.\n */\nenum Fence {\n /**\n * Empty flag (no fence exists).\n */\n None = 0b000,\n\n /**\n * A context read fence, meaning that the expression in question reads from the \"current view\"\n * context of the runtime.\n */\n ViewContextRead = 0b001,\n\n /**\n * A context write fence, meaning that the expression in question writes to the \"current view\"\n * context of the runtime.\n *\n * Note that all `ContextWrite` fences are implicitly `ContextRead` fences as operations which\n * change the view context do so based on the current one.\n */\n ViewContextWrite = 0b010,\n\n /**\n * Indicates that a call is required for its side-effects, even if nothing reads its result.\n *\n * This is also true of `ViewContextWrite` operations **if** they are followed by a\n * `ViewContextRead`.\n */\n SideEffectful = 0b100,\n}\n\n/**\n * Summary data collected for each `Op` in a list.\n *\n * Tracking this data per operation allows the optimizer to process operations at a higher level\n * than always scanning expressions.\n */\ninterface OpInfo {\n /**\n * A `Set` of variables referenced by expressions in this operation.\n */\n variablesUsed: Set;\n\n /**\n * Flags indicating any `Fence`s present for this operation.\n */\n fences: Fence;\n}\n\nfunction inlineAlwaysInlineVariables(ops: ir.OpList): void {\n const vars = new Map>();\n for (const op of ops) {\n if (op.kind === ir.OpKind.Variable && op.flags & ir.VariableFlags.AlwaysInline) {\n ir.visitExpressionsInOp(op, (expr) => {\n if (ir.isIrExpression(expr) && fencesForIrExpression(expr) !== Fence.None) {\n throw new Error(`AssertionError: A context-sensitive variable was marked AlwaysInline`);\n }\n });\n vars.set(op.xref, op);\n }\n\n ir.transformExpressionsInOp(\n op,\n (expr) => {\n if (expr instanceof ir.ReadVariableExpr && vars.has(expr.xref)) {\n const varOp = vars.get(expr.xref)!;\n // Inline by cloning, because we might inline into multiple places.\n return varOp.initializer.clone();\n }\n return expr;\n },\n ir.VisitorContextFlag.None,\n );\n }\n\n for (const op of vars.values()) {\n ir.OpList.remove(op as ir.CreateOp | ir.UpdateOp);\n }\n}\n\n/**\n * Process a list of operations and optimize variables within that list.\n */\nfunction optimizeVariablesInOpList(\n ops: ir.OpList,\n compatibility: ir.CompatibilityMode,\n): void {\n const varDecls = new Map>();\n const varUsages = new Map();\n\n // Track variables that are used outside of the immediate operation list. For example, within\n // `ListenerOp` handler operations of listeners in the current operation list.\n const varRemoteUsages = new Set();\n const opMap = new Map();\n\n // First, extract information about variables declared or used within the whole list.\n for (const op of ops) {\n if (op.kind === ir.OpKind.Variable) {\n if (varDecls.has(op.xref) || varUsages.has(op.xref)) {\n throw new Error(`Should not see two declarations of the same variable: ${op.xref}`);\n }\n varDecls.set(op.xref, op);\n varUsages.set(op.xref, 0);\n }\n\n opMap.set(op, collectOpInfo(op));\n countVariableUsages(op, varUsages, varRemoteUsages);\n }\n\n // The next step is to remove any variable declarations for variables that aren't used. The\n // variable initializer expressions may be side-effectful, so they may need to be retained as\n // expression statements.\n\n // Track whether we've seen an operation which reads from the view context yet. This is used to\n // determine whether a write to the view context in a variable initializer can be observed.\n let contextIsUsed = false;\n\n // Note that iteration through the list happens in reverse, which guarantees that we'll process\n // all reads of a variable prior to processing its declaration.\n for (const op of ops.reversed()) {\n const opInfo = opMap.get(op)!;\n\n if (op.kind === ir.OpKind.Variable && varUsages.get(op.xref)! === 0) {\n // This variable is unused and can be removed. We might need to keep the initializer around,\n // though, if something depends on it running.\n if (\n (contextIsUsed && opInfo.fences & Fence.ViewContextWrite) ||\n opInfo.fences & Fence.SideEffectful\n ) {\n // This variable initializer has a side effect which must be retained. Either:\n // * it writes to the view context, and we know there is a future operation which depends\n // on that write, or\n // * it's an operation which is inherently side-effectful.\n // We can't remove the initializer, but we can remove the variable declaration itself and\n // replace it with a side-effectful statement.\n const stmtOp = ir.createStatementOp(op.initializer.toStmt()) as ir.UpdateOp;\n opMap.set(stmtOp, opInfo);\n ir.OpList.replace(op as ir.UpdateOp, stmtOp);\n } else {\n // It's safe to delete this entire variable declaration as nothing depends on it, even\n // side-effectfully. Note that doing this might make other variables unused. Since we're\n // iterating in reverse order, we should always be processing usages before declarations\n // and therefore by the time we get to a declaration, all removable usages will have been\n // removed.\n uncountVariableUsages(op, varUsages);\n ir.OpList.remove(op as ir.UpdateOp);\n }\n\n opMap.delete(op);\n varDecls.delete(op.xref);\n varUsages.delete(op.xref);\n continue;\n }\n\n // Does this operation depend on the view context?\n if (opInfo.fences & Fence.ViewContextRead) {\n contextIsUsed = true;\n }\n }\n\n // Next, inline any remaining variables with exactly one usage.\n const toInline: ir.XrefId[] = [];\n for (const [id, count] of varUsages) {\n const decl = varDecls.get(id)!;\n // We can inline variables that:\n // - are used exactly once, and\n // - are not used remotely\n // OR\n // - are marked for always inlining\n const isAlwaysInline = !!(decl.flags & ir.VariableFlags.AlwaysInline);\n if (count !== 1 || isAlwaysInline) {\n // We can't inline this variable as it's used more than once.\n continue;\n }\n\n if (varRemoteUsages.has(id)) {\n // This variable is used once, but across an operation boundary, so it can't be inlined.\n continue;\n }\n\n toInline.push(id);\n }\n\n let candidate: ir.XrefId | undefined;\n while ((candidate = toInline.pop())) {\n // We will attempt to inline this variable. If inlining fails (due to fences for example),\n // no future operation will make inlining legal.\n const decl = varDecls.get(candidate)!;\n const varInfo = opMap.get(decl as ir.CreateOp | ir.UpdateOp)!;\n const isAlwaysInline = !!(decl.flags & ir.VariableFlags.AlwaysInline);\n\n if (isAlwaysInline) {\n throw new Error(\n `AssertionError: Found an 'AlwaysInline' variable after the always inlining pass.`,\n );\n }\n\n // Scan operations following the variable declaration and look for the point where that variable\n // is used. There should only be one usage given the precondition above.\n for (\n let targetOp = decl.next!;\n targetOp.kind !== ir.OpKind.ListEnd;\n targetOp = targetOp.next!\n ) {\n const opInfo = opMap.get(targetOp)!;\n\n // Is the variable used in this operation?\n if (opInfo.variablesUsed.has(candidate)) {\n if (\n compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder &&\n !allowConservativeInlining(decl, targetOp)\n ) {\n // We're in conservative mode, and this variable is not eligible for inlining into the\n // target operation in this mode.\n break;\n }\n\n // Yes, try to inline it. Inlining may not be successful if fences in this operation before\n // the variable's usage cannot be safely crossed.\n if (tryInlineVariableInitializer(candidate, decl.initializer, targetOp, varInfo.fences)) {\n // Inlining was successful! Update the tracking structures to reflect the inlined\n // variable.\n opInfo.variablesUsed.delete(candidate);\n\n // Add all variables used in the variable's initializer to its new usage site.\n for (const id of varInfo.variablesUsed) {\n opInfo.variablesUsed.add(id);\n }\n\n // Merge fences in the variable's initializer into its new usage site.\n opInfo.fences |= varInfo.fences;\n\n // Delete tracking info related to the declaration.\n varDecls.delete(candidate);\n varUsages.delete(candidate);\n opMap.delete(decl as ir.CreateOp | ir.UpdateOp);\n\n // And finally, delete the original declaration from the operation list.\n ir.OpList.remove(decl as ir.UpdateOp);\n }\n\n // Whether inlining succeeded or failed, we're done processing this variable.\n break;\n }\n\n // If the variable is not used in this operation, then we'd need to inline across it. Check if\n // that's safe to do.\n if (!safeToInlinePastFences(opInfo.fences, varInfo.fences)) {\n // We can't safely inline this variable beyond this operation, so don't proceed with\n // inlining this variable.\n break;\n }\n }\n }\n}\n\n/**\n * Given an `ir.Expression`, returns the `Fence` flags for that expression type.\n */\nfunction fencesForIrExpression(expr: ir.Expression): Fence {\n switch (expr.kind) {\n case ir.ExpressionKind.NextContext:\n return Fence.ViewContextRead | Fence.ViewContextWrite;\n case ir.ExpressionKind.RestoreView:\n return Fence.ViewContextRead | Fence.ViewContextWrite | Fence.SideEffectful;\n case ir.ExpressionKind.StoreLet:\n return Fence.SideEffectful;\n case ir.ExpressionKind.Reference:\n case ir.ExpressionKind.ContextLetReference:\n return Fence.ViewContextRead;\n default:\n return Fence.None;\n }\n}\n\n/**\n * Build the `OpInfo` structure for the given `op`. This performs two operations:\n *\n * * It tracks which variables are used in the operation's expressions.\n * * It rolls up fence flags for expressions within the operation.\n */\nfunction collectOpInfo(op: ir.CreateOp | ir.UpdateOp): OpInfo {\n let fences = Fence.None;\n const variablesUsed = new Set();\n ir.visitExpressionsInOp(op, (expr) => {\n if (!ir.isIrExpression(expr)) {\n return;\n }\n\n switch (expr.kind) {\n case ir.ExpressionKind.ReadVariable:\n variablesUsed.add(expr.xref);\n break;\n default:\n fences |= fencesForIrExpression(expr);\n }\n });\n return {fences, variablesUsed};\n}\n\n/**\n * Count the number of usages of each variable, being careful to track whether those usages are\n * local or remote.\n */\nfunction countVariableUsages(\n op: ir.CreateOp | ir.UpdateOp,\n varUsages: Map,\n varRemoteUsage: Set,\n): void {\n ir.visitExpressionsInOp(op, (expr, flags) => {\n if (!ir.isIrExpression(expr)) {\n return;\n }\n\n if (expr.kind !== ir.ExpressionKind.ReadVariable) {\n return;\n }\n\n const count = varUsages.get(expr.xref);\n if (count === undefined) {\n // This variable is declared outside the current scope of optimization.\n return;\n }\n varUsages.set(expr.xref, count + 1);\n\n if (flags & ir.VisitorContextFlag.InChildOperation) {\n varRemoteUsage.add(expr.xref);\n }\n });\n}\n\n/**\n * Remove usages of a variable in `op` from the `varUsages` tracking.\n */\nfunction uncountVariableUsages(\n op: ir.CreateOp | ir.UpdateOp,\n varUsages: Map,\n): void {\n ir.visitExpressionsInOp(op, (expr) => {\n if (!ir.isIrExpression(expr)) {\n return;\n }\n\n if (expr.kind !== ir.ExpressionKind.ReadVariable) {\n return;\n }\n\n const count = varUsages.get(expr.xref);\n if (count === undefined) {\n // This variable is declared outside the current scope of optimization.\n return;\n } else if (count === 0) {\n throw new Error(\n `Inaccurate variable count: ${expr.xref} - found another read but count is already 0`,\n );\n }\n varUsages.set(expr.xref, count - 1);\n });\n}\n\n/**\n * Checks whether it's safe to inline a variable across a particular operation.\n *\n * @param fences the fences of the operation which the inlining will cross\n * @param declFences the fences of the variable being inlined.\n */\nfunction safeToInlinePastFences(fences: Fence, declFences: Fence): boolean {\n if (fences & Fence.ViewContextWrite) {\n // It's not safe to inline context reads across context writes.\n if (declFences & Fence.ViewContextRead) {\n return false;\n }\n } else if (fences & Fence.ViewContextRead) {\n // It's not safe to inline context writes across context reads.\n if (declFences & Fence.ViewContextWrite) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Attempt to inline the initializer of a variable into a target operation's expressions.\n *\n * This may or may not be safe to do. For example, the variable could be read following the\n * execution of an expression with fences that don't permit the variable to be inlined across them.\n */\nfunction tryInlineVariableInitializer(\n id: ir.XrefId,\n initializer: o.Expression,\n target: ir.CreateOp | ir.UpdateOp,\n declFences: Fence,\n): boolean {\n // We use `ir.transformExpressionsInOp` to walk the expressions and inline the variable if\n // possible. Since this operation is callback-based, once inlining succeeds or fails we can't\n // \"stop\" the expression processing, and have to keep track of whether inlining has succeeded or\n // is no longer allowed.\n let inlined = false;\n let inliningAllowed = true;\n\n ir.transformExpressionsInOp(\n target,\n (expr, flags) => {\n if (!ir.isIrExpression(expr)) {\n return expr;\n }\n\n if (inlined || !inliningAllowed) {\n // Either the inlining has already succeeded, or we've passed a fence that disallows inlining\n // at this point, so don't try.\n return expr;\n } else if (\n flags & ir.VisitorContextFlag.InChildOperation &&\n declFences & Fence.ViewContextRead\n ) {\n // We cannot inline variables that are sensitive to the current context across operation\n // boundaries.\n return expr;\n }\n\n switch (expr.kind) {\n case ir.ExpressionKind.ReadVariable:\n if (expr.xref === id) {\n // This is the usage site of the variable. Since nothing has disallowed inlining, it's\n // safe to inline the initializer here.\n inlined = true;\n return initializer;\n }\n break;\n default:\n // For other types of `ir.Expression`s, whether inlining is allowed depends on their fences.\n const exprFences = fencesForIrExpression(expr);\n inliningAllowed = inliningAllowed && safeToInlinePastFences(exprFences, declFences);\n break;\n }\n return expr;\n },\n ir.VisitorContextFlag.None,\n );\n return inlined;\n}\n\n/**\n * Determines whether inlining of `decl` should be allowed in \"conservative\" mode.\n *\n * In conservative mode, inlining behavior is limited to those operations which the\n * `TemplateDefinitionBuilder` supported, with the goal of producing equivalent output.\n */\nfunction allowConservativeInlining(\n decl: ir.VariableOp,\n target: ir.Op,\n): boolean {\n // TODO(alxhub): understand exactly how TemplateDefinitionBuilder approaches inlining, and record\n // that behavior here.\n switch (decl.variable.kind) {\n case ir.SemanticVariableKind.Identifier:\n if (decl.initializer instanceof o.ReadVarExpr && decl.initializer.name === 'ctx') {\n // Although TemplateDefinitionBuilder is cautious about inlining, we still want to do so\n // when the variable is the context, to imitate its behavior with aliases in control flow\n // blocks. This quirky behavior will become dead code once compatibility mode is no longer\n // supported.\n return true;\n }\n return false;\n case ir.SemanticVariableKind.Context:\n // Context can only be inlined into other variables.\n return target.kind === ir.OpKind.Variable;\n default:\n return true;\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * Wraps ICUs that do not already belong to an i18n block in a new i18n block.\n */\nexport function wrapI18nIcus(job: CompilationJob): void {\n for (const unit of job.units) {\n let currentI18nOp: ir.I18nStartOp | null = null;\n let addedI18nId: ir.XrefId | null = null;\n for (const op of unit.create) {\n switch (op.kind) {\n case ir.OpKind.I18nStart:\n currentI18nOp = op;\n break;\n case ir.OpKind.I18nEnd:\n currentI18nOp = null;\n break;\n case ir.OpKind.IcuStart:\n if (currentI18nOp === null) {\n addedI18nId = job.allocateXrefId();\n // ICU i18n start/end ops should not receive source spans.\n ir.OpList.insertBefore(\n ir.createI18nStartOp(addedI18nId, op.message, undefined, null),\n op,\n );\n }\n break;\n case ir.OpKind.IcuEnd:\n if (addedI18nId !== null) {\n ir.OpList.insertAfter(ir.createI18nEndOp(addedI18nId, null), op);\n addedI18nId = null;\n }\n break;\n }\n }\n }\n}\n", "/*!\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * Removes any `storeLet` calls that aren't referenced outside of the current view.\n */\nexport function optimizeStoreLet(job: CompilationJob): void {\n const letUsedExternally = new Set();\n\n // Since `@let` declarations can be referenced in child views, both in\n // the creation block (via listeners) and in the update block, we have\n // to look through all the ops to find the references.\n for (const unit of job.units) {\n for (const op of unit.ops()) {\n ir.visitExpressionsInOp(op, (expr) => {\n if (expr instanceof ir.ContextLetReferenceExpr) {\n letUsedExternally.add(expr.target);\n }\n });\n }\n }\n\n // TODO(crisbeto): potentially remove the unused calls completely, pending discussion.\n for (const unit of job.units) {\n for (const op of unit.update) {\n ir.transformExpressionsInOp(\n op,\n (expression) =>\n expression instanceof ir.StoreLetExpr && !letUsedExternally.has(expression.target)\n ? expression.value\n : expression,\n ir.VisitorContextFlag.None,\n );\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../output/output_ast';\nimport * as ir from '../../ir';\nimport {CompilationJob} from '../compilation';\n\n/**\n * It's not allowed to access a `@let` declaration before it has been defined. This is enforced\n * already via template type checking, however it can trip some of the assertions in the pipeline.\n * E.g. the naming phase can fail because we resolved the variable here, but the variable doesn't\n * exist anymore because the optimization phase removed it since it's invalid. To avoid surfacing\n * confusing errors to users in the case where template type checking isn't running (e.g. in JIT\n * mode) this phase detects illegal forward references and replaces them with `undefined`.\n * Eventually users will see the proper error from the template type checker.\n */\nexport function removeIllegalLetReferences(job: CompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.update) {\n if (\n op.kind !== ir.OpKind.Variable ||\n op.variable.kind !== ir.SemanticVariableKind.Identifier ||\n !(op.initializer instanceof ir.StoreLetExpr)\n ) {\n continue;\n }\n\n const name = op.variable.identifier;\n let current: ir.UpdateOp | null = op;\n while (current && current.kind !== ir.OpKind.ListEnd) {\n ir.transformExpressionsInOp(\n current,\n (expr) =>\n expr instanceof ir.LexicalReadExpr && expr.name === name ? o.literal(undefined) : expr,\n ir.VisitorContextFlag.None,\n );\n current = current.prev;\n }\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\n\nimport type {ComponentCompilationJob} from '../compilation';\n\n/**\n * Replaces the `storeLet` ops with variables that can be\n * used to reference the value within the same view.\n */\nexport function generateLocalLetReferences(job: ComponentCompilationJob): void {\n for (const unit of job.units) {\n for (const op of unit.update) {\n if (op.kind !== ir.OpKind.StoreLet) {\n continue;\n }\n\n const variable: ir.IdentifierVariable = {\n kind: ir.SemanticVariableKind.Identifier,\n name: null,\n identifier: op.declaredName,\n local: true,\n };\n\n ir.OpList.replace(\n op,\n ir.createVariableOp(\n job.allocateXrefId(),\n variable,\n new ir.StoreLetExpr(op.target, op.value, op.sourceSpan),\n ir.VariableFlags.None,\n ),\n );\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as ir from '../../ir';\nimport type {ComponentCompilationJob} from '../compilation';\n\n/**\n * Locates all of the elements defined in a creation block and outputs an op\n * that will expose their definition location in the DOM.\n */\nexport function attachSourceLocations(job: ComponentCompilationJob): void {\n if (!job.enableDebugLocations || job.relativeTemplatePath === null) {\n return;\n }\n\n for (const unit of job.units) {\n const locations: ir.ElementSourceLocation[] = [];\n\n for (const op of unit.create) {\n if (op.kind === ir.OpKind.ElementStart || op.kind === ir.OpKind.Element) {\n const start = op.startSourceSpan.start;\n locations.push({\n targetSlot: op.handle,\n offset: start.offset,\n line: start.line,\n column: start.col,\n });\n }\n }\n\n if (locations.length > 0) {\n unit.create.push(ir.createSourceLocationOp(job.relativeTemplatePath, locations));\n }\n }\n}\n", "/**\n *\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as o from '../../../../src/output/output_ast';\nimport {ConstantPool} from '../../../constant_pool';\nimport * as ir from '../ir';\n\nimport {\n CompilationJob,\n CompilationJobKind as Kind,\n type ComponentCompilationJob,\n type HostBindingCompilationJob,\n type ViewCompilationUnit,\n} from './compilation';\n\nimport {deleteAnyCasts} from './phases/any_cast';\nimport {applyI18nExpressions} from './phases/apply_i18n_expressions';\nimport {assignI18nSlotDependencies} from './phases/assign_i18n_slot_dependencies';\nimport {extractAttributes} from './phases/attribute_extraction';\nimport {specializeBindings} from './phases/binding_specialization';\nimport {chain} from './phases/chaining';\nimport {collapseSingletonInterpolations} from './phases/collapse_singleton_interpolations';\nimport {generateConditionalExpressions} from './phases/conditionals';\nimport {collectElementConsts} from './phases/const_collection';\nimport {convertI18nBindings} from './phases/convert_i18n_bindings';\nimport {resolveDeferDepsFns} from './phases/resolve_defer_deps_fns';\nimport {createI18nContexts} from './phases/create_i18n_contexts';\nimport {deduplicateTextBindings} from './phases/deduplicate_text_bindings';\nimport {configureDeferInstructions} from './phases/defer_configs';\nimport {resolveDeferTargetNames} from './phases/defer_resolve_targets';\nimport {collapseEmptyInstructions} from './phases/empty_elements';\nimport {expandSafeReads} from './phases/expand_safe_reads';\nimport {extractI18nMessages} from './phases/extract_i18n_messages';\nimport {generateAdvance} from './phases/generate_advance';\nimport {generateProjectionDefs} from './phases/generate_projection_def';\nimport {generateVariables} from './phases/generate_variables';\nimport {collectConstExpressions} from './phases/has_const_expression_collection';\nimport {parseHostStyleProperties} from './phases/host_style_property_parsing';\nimport {collectI18nConsts} from './phases/i18n_const_collection';\nimport {convertI18nText} from './phases/i18n_text_extraction';\nimport {liftLocalRefs} from './phases/local_refs';\nimport {emitNamespaceChanges} from './phases/namespace';\nimport {nameFunctionsAndVariables} from './phases/naming';\nimport {mergeNextContextExpressions} from './phases/next_context_merging';\nimport {generateNgContainerOps} from './phases/ng_container';\nimport {disableBindings} from './phases/nonbindable';\nimport {generateNullishCoalesceExpressions} from './phases/nullish_coalescing';\nimport {orderOps} from './phases/ordering';\nimport {parseExtractedStyles} from './phases/parse_extracted_styles';\nimport {removeContentSelectors} from './phases/phase_remove_content_selectors';\nimport {createPipes} from './phases/pipe_creation';\nimport {createVariadicPipes} from './phases/pipe_variadic';\nimport {propagateI18nBlocks} from './phases/propagate_i18n_blocks';\nimport {extractPureFunctions} from './phases/pure_function_extraction';\nimport {generatePureLiteralStructures} from './phases/pure_literal_structures';\nimport {reify} from './phases/reify';\nimport {removeEmptyBindings} from './phases/remove_empty_bindings';\nimport {removeI18nContexts} from './phases/remove_i18n_contexts';\nimport {removeUnusedI18nAttributesOps} from './phases/remove_unused_i18n_attrs';\nimport {resolveContexts} from './phases/resolve_contexts';\nimport {resolveDollarEvent} from './phases/resolve_dollar_event';\nimport {resolveI18nElementPlaceholders} from './phases/resolve_i18n_element_placeholders';\nimport {resolveI18nExpressionPlaceholders} from './phases/resolve_i18n_expression_placeholders';\nimport {resolveI18nAttrSanitizers} from './phases/resolve_i18n_attr_sanitizers';\nimport {resolveNames} from './phases/resolve_names';\nimport {resolveSanitizers} from './phases/resolve_sanitizers';\nimport {transformTwoWayBindingSet} from './phases/transform_two_way_binding_set';\nimport {saveAndRestoreView} from './phases/save_restore_view';\nimport {allocateSlots} from './phases/slot_allocation';\nimport {specializeStyleBindings} from './phases/style_binding_specialization';\nimport {generateTemporaryVariables} from './phases/temporary_variables';\nimport {optimizeTrackFns} from './phases/track_fn_optimization';\nimport {generateTrackVariables} from './phases/track_variables';\nimport {countVariables} from './phases/var_counting';\nimport {optimizeVariables} from './phases/variable_optimization';\nimport {wrapI18nIcus} from './phases/wrap_icus';\nimport {optimizeStoreLet} from './phases/store_let_optimization';\nimport {removeIllegalLetReferences} from './phases/remove_illegal_let_references';\nimport {generateLocalLetReferences} from './phases/generate_local_let_references';\nimport {attachSourceLocations} from './phases/attach_source_locations';\n\ntype Phase =\n | {\n fn: (job: CompilationJob) => void;\n kind: Kind.Both | Kind.Host | Kind.Tmpl;\n }\n | {\n fn: (job: ComponentCompilationJob) => void;\n kind: Kind.Tmpl;\n }\n | {\n fn: (job: HostBindingCompilationJob) => void;\n kind: Kind.Host;\n };\n\nconst phases: Phase[] = [\n {kind: Kind.Tmpl, fn: removeContentSelectors},\n {kind: Kind.Host, fn: parseHostStyleProperties},\n {kind: Kind.Tmpl, fn: emitNamespaceChanges},\n {kind: Kind.Tmpl, fn: propagateI18nBlocks},\n {kind: Kind.Tmpl, fn: wrapI18nIcus},\n {kind: Kind.Both, fn: deduplicateTextBindings},\n {kind: Kind.Both, fn: specializeStyleBindings},\n {kind: Kind.Both, fn: specializeBindings},\n {kind: Kind.Both, fn: extractAttributes},\n {kind: Kind.Tmpl, fn: createI18nContexts},\n {kind: Kind.Both, fn: parseExtractedStyles},\n {kind: Kind.Tmpl, fn: removeEmptyBindings},\n {kind: Kind.Both, fn: collapseSingletonInterpolations},\n {kind: Kind.Both, fn: orderOps},\n {kind: Kind.Tmpl, fn: generateConditionalExpressions},\n {kind: Kind.Tmpl, fn: createPipes},\n {kind: Kind.Tmpl, fn: configureDeferInstructions},\n {kind: Kind.Tmpl, fn: convertI18nText},\n {kind: Kind.Tmpl, fn: convertI18nBindings},\n {kind: Kind.Tmpl, fn: removeUnusedI18nAttributesOps},\n {kind: Kind.Tmpl, fn: assignI18nSlotDependencies},\n {kind: Kind.Tmpl, fn: applyI18nExpressions},\n {kind: Kind.Tmpl, fn: createVariadicPipes},\n {kind: Kind.Both, fn: generatePureLiteralStructures},\n {kind: Kind.Tmpl, fn: generateProjectionDefs},\n {kind: Kind.Tmpl, fn: generateLocalLetReferences},\n {kind: Kind.Tmpl, fn: generateVariables},\n {kind: Kind.Tmpl, fn: saveAndRestoreView},\n {kind: Kind.Both, fn: deleteAnyCasts},\n {kind: Kind.Both, fn: resolveDollarEvent},\n {kind: Kind.Tmpl, fn: generateTrackVariables},\n {kind: Kind.Tmpl, fn: removeIllegalLetReferences},\n {kind: Kind.Both, fn: resolveNames},\n {kind: Kind.Tmpl, fn: resolveDeferTargetNames},\n {kind: Kind.Tmpl, fn: transformTwoWayBindingSet},\n {kind: Kind.Tmpl, fn: optimizeTrackFns},\n {kind: Kind.Both, fn: resolveContexts},\n {kind: Kind.Both, fn: resolveSanitizers},\n {kind: Kind.Tmpl, fn: liftLocalRefs},\n {kind: Kind.Both, fn: generateNullishCoalesceExpressions},\n {kind: Kind.Both, fn: expandSafeReads},\n {kind: Kind.Both, fn: generateTemporaryVariables},\n {kind: Kind.Both, fn: optimizeVariables},\n {kind: Kind.Both, fn: optimizeStoreLet},\n {kind: Kind.Tmpl, fn: allocateSlots},\n {kind: Kind.Tmpl, fn: resolveI18nElementPlaceholders},\n {kind: Kind.Tmpl, fn: resolveI18nExpressionPlaceholders},\n {kind: Kind.Tmpl, fn: extractI18nMessages},\n {kind: Kind.Tmpl, fn: collectI18nConsts},\n {kind: Kind.Tmpl, fn: resolveI18nAttrSanitizers},\n {kind: Kind.Tmpl, fn: collectConstExpressions},\n {kind: Kind.Both, fn: collectElementConsts},\n {kind: Kind.Tmpl, fn: removeI18nContexts},\n {kind: Kind.Both, fn: countVariables},\n {kind: Kind.Tmpl, fn: generateAdvance},\n {kind: Kind.Both, fn: nameFunctionsAndVariables},\n {kind: Kind.Tmpl, fn: resolveDeferDepsFns},\n {kind: Kind.Tmpl, fn: mergeNextContextExpressions},\n {kind: Kind.Tmpl, fn: generateNgContainerOps},\n {kind: Kind.Tmpl, fn: collapseEmptyInstructions},\n {kind: Kind.Tmpl, fn: attachSourceLocations},\n {kind: Kind.Tmpl, fn: disableBindings},\n {kind: Kind.Both, fn: extractPureFunctions},\n {kind: Kind.Both, fn: reify},\n {kind: Kind.Both, fn: chain},\n];\n\n/**\n * Run all transformation phases in the correct order against a compilation job. After this\n * processing, the compilation should be in a state where it can be emitted.\n */\nexport function transform(job: CompilationJob, kind: Kind): void {\n for (const phase of phases) {\n if (phase.kind === kind || phase.kind === Kind.Both) {\n // The type of `Phase` above ensures it is impossible to call a phase that doesn't support the\n // job kind.\n phase.fn(job as CompilationJob & ComponentCompilationJob & HostBindingCompilationJob);\n }\n }\n}\n\n/**\n * Compile all views in the given `ComponentCompilation` into the final template function, which may\n * reference constants defined in a `ConstantPool`.\n */\nexport function emitTemplateFn(tpl: ComponentCompilationJob, pool: ConstantPool): o.FunctionExpr {\n const rootFn = emitView(tpl.root);\n emitChildViews(tpl.root, pool);\n return rootFn;\n}\n\nfunction emitChildViews(parent: ViewCompilationUnit, pool: ConstantPool): void {\n for (const unit of parent.job.units) {\n if (unit.parent !== parent.xref) {\n continue;\n }\n\n // Child views are emitted depth-first.\n emitChildViews(unit, pool);\n\n const viewFn = emitView(unit);\n pool.statements.push(viewFn.toDeclStmt(viewFn.name!));\n }\n}\n\n/**\n * Emit a template function for an individual `ViewCompilation` (which may be either the root view\n * or an embedded view).\n */\nfunction emitView(view: ViewCompilationUnit): o.FunctionExpr {\n if (view.fnName === null) {\n throw new Error(`AssertionError: view ${view.xref} is unnamed`);\n }\n\n const createStatements: o.Statement[] = [];\n for (const op of view.create) {\n if (op.kind !== ir.OpKind.Statement) {\n throw new Error(\n `AssertionError: expected all create ops to have been compiled, but got ${\n ir.OpKind[op.kind]\n }`,\n );\n }\n createStatements.push(op.statement);\n }\n const updateStatements: o.Statement[] = [];\n for (const op of view.update) {\n if (op.kind !== ir.OpKind.Statement) {\n throw new Error(\n `AssertionError: expected all update ops to have been compiled, but got ${\n ir.OpKind[op.kind]\n }`,\n );\n }\n updateStatements.push(op.statement);\n }\n\n const createCond = maybeGenerateRfBlock(1, createStatements);\n const updateCond = maybeGenerateRfBlock(2, updateStatements);\n return o.fn(\n [new o.FnParam('rf'), new o.FnParam('ctx')],\n [...createCond, ...updateCond],\n /* type */ undefined,\n /* sourceSpan */ undefined,\n view.fnName,\n );\n}\n\nfunction maybeGenerateRfBlock(flag: number, statements: o.Statement[]): o.Statement[] {\n if (statements.length === 0) {\n return [];\n }\n\n return [\n o.ifStmt(\n new o.BinaryOperatorExpr(o.BinaryOperator.BitwiseAnd, o.variable('rf'), o.literal(flag)),\n statements,\n ),\n ];\n}\n\nexport function emitHostBindingFunction(job: HostBindingCompilationJob): o.FunctionExpr | null {\n if (job.root.fnName === null) {\n throw new Error(`AssertionError: host binding function is unnamed`);\n }\n\n const createStatements: o.Statement[] = [];\n for (const op of job.root.create) {\n if (op.kind !== ir.OpKind.Statement) {\n throw new Error(\n `AssertionError: expected all create ops to have been compiled, but got ${\n ir.OpKind[op.kind]\n }`,\n );\n }\n createStatements.push(op.statement);\n }\n const updateStatements: o.Statement[] = [];\n for (const op of job.root.update) {\n if (op.kind !== ir.OpKind.Statement) {\n throw new Error(\n `AssertionError: expected all update ops to have been compiled, but got ${\n ir.OpKind[op.kind]\n }`,\n );\n }\n updateStatements.push(op.statement);\n }\n\n if (createStatements.length === 0 && updateStatements.length === 0) {\n return null;\n }\n\n const createCond = maybeGenerateRfBlock(1, createStatements);\n const updateCond = maybeGenerateRfBlock(2, updateStatements);\n return o.fn(\n [new o.FnParam('rf'), new o.FnParam('ctx')],\n [...createCond, ...updateCond],\n /* type */ undefined,\n /* sourceSpan */ undefined,\n job.root.fnName,\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ConstantPool} from '../../../constant_pool';\nimport {SecurityContext} from '../../../core';\nimport * as e from '../../../expression_parser/ast';\nimport * as i18n from '../../../i18n/i18n_ast';\nimport {splitNsName} from '../../../ml_parser/tags';\nimport * as o from '../../../output/output_ast';\nimport {ParseSourceSpan} from '../../../parse_util';\nimport * as t from '../../../render3/r3_ast';\nimport {DeferBlockDepsEmitMode, R3ComponentDeferMetadata} from '../../../render3/view/api';\nimport {icuFromI18nMessage} from '../../../render3/view/i18n/util';\nimport {DomElementSchemaRegistry} from '../../../schema/dom_element_schema_registry';\nimport {BindingParser} from '../../../template_parser/binding_parser';\nimport * as ir from '../ir';\n\nimport {\n CompilationUnit,\n ComponentCompilationJob,\n HostBindingCompilationJob,\n type CompilationJob,\n type ViewCompilationUnit,\n} from './compilation';\nimport {BINARY_OPERATORS, namespaceForKey, prefixWithNamespace} from './conversion';\nimport {MATH_ML_NAMESPACE, SVG_NAMESPACE} from './namespaces';\n\nconst compatibilityMode = ir.CompatibilityMode.TemplateDefinitionBuilder;\n\n// Schema containing DOM elements and their properties.\nconst domSchema = new DomElementSchemaRegistry();\n\n// Tag name of the `ng-template` element.\nconst NG_TEMPLATE_TAG_NAME = 'ng-template';\n\nexport function isI18nRootNode(meta?: i18n.I18nMeta): meta is i18n.Message {\n return meta instanceof i18n.Message;\n}\n\nexport function isSingleI18nIcu(meta?: i18n.I18nMeta): meta is i18n.I18nMeta & {nodes: [i18n.Icu]} {\n return isI18nRootNode(meta) && meta.nodes.length === 1 && meta.nodes[0] instanceof i18n.Icu;\n}\n\n/**\n * Process a template AST and convert it into a `ComponentCompilation` in the intermediate\n * representation.\n * TODO: Refactor more of the ingestion code into phases.\n */\nexport function ingestComponent(\n componentName: string,\n template: t.Node[],\n constantPool: ConstantPool,\n relativeContextFilePath: string,\n i18nUseExternalIds: boolean,\n deferMeta: R3ComponentDeferMetadata,\n allDeferrableDepsFn: o.ReadVarExpr | null,\n relativeTemplatePath: string | null,\n enableDebugLocations: boolean,\n): ComponentCompilationJob {\n const job = new ComponentCompilationJob(\n componentName,\n constantPool,\n compatibilityMode,\n relativeContextFilePath,\n i18nUseExternalIds,\n deferMeta,\n allDeferrableDepsFn,\n relativeTemplatePath,\n enableDebugLocations,\n );\n ingestNodes(job.root, template);\n return job;\n}\n\nexport interface HostBindingInput {\n componentName: string;\n componentSelector: string;\n properties: e.ParsedProperty[] | null;\n attributes: {[key: string]: o.Expression};\n events: e.ParsedEvent[] | null;\n}\n\n/**\n * Process a host binding AST and convert it into a `HostBindingCompilationJob` in the intermediate\n * representation.\n */\nexport function ingestHostBinding(\n input: HostBindingInput,\n bindingParser: BindingParser,\n constantPool: ConstantPool,\n): HostBindingCompilationJob {\n const job = new HostBindingCompilationJob(input.componentName, constantPool, compatibilityMode);\n for (const property of input.properties ?? []) {\n let bindingKind = ir.BindingKind.Property;\n // TODO: this should really be handled in the parser.\n if (property.name.startsWith('attr.')) {\n property.name = property.name.substring('attr.'.length);\n bindingKind = ir.BindingKind.Attribute;\n }\n if (property.isAnimation) {\n bindingKind = ir.BindingKind.Animation;\n }\n const securityContexts = bindingParser\n .calcPossibleSecurityContexts(\n input.componentSelector,\n property.name,\n bindingKind === ir.BindingKind.Attribute,\n )\n .filter((context) => context !== SecurityContext.NONE);\n ingestHostProperty(job, property, bindingKind, securityContexts);\n }\n for (const [name, expr] of Object.entries(input.attributes) ?? []) {\n const securityContexts = bindingParser\n .calcPossibleSecurityContexts(input.componentSelector, name, true)\n .filter((context) => context !== SecurityContext.NONE);\n ingestHostAttribute(job, name, expr, securityContexts);\n }\n for (const event of input.events ?? []) {\n ingestHostEvent(job, event);\n }\n return job;\n}\n\n// TODO: We should refactor the parser to use the same types and structures for host bindings as\n// with ordinary components. This would allow us to share a lot more ingestion code.\nexport function ingestHostProperty(\n job: HostBindingCompilationJob,\n property: e.ParsedProperty,\n bindingKind: ir.BindingKind,\n securityContexts: SecurityContext[],\n): void {\n let expression: o.Expression | ir.Interpolation;\n const ast = property.expression.ast;\n if (ast instanceof e.Interpolation) {\n expression = new ir.Interpolation(\n ast.strings,\n ast.expressions.map((expr) => convertAst(expr, job, property.sourceSpan)),\n [],\n );\n } else {\n expression = convertAst(ast, job, property.sourceSpan);\n }\n job.root.update.push(\n ir.createBindingOp(\n job.root.xref,\n bindingKind,\n property.name,\n expression,\n null,\n securityContexts,\n false,\n false,\n null,\n /* TODO: How do Host bindings handle i18n attrs? */ null,\n property.sourceSpan,\n ),\n );\n}\n\nexport function ingestHostAttribute(\n job: HostBindingCompilationJob,\n name: string,\n value: o.Expression,\n securityContexts: SecurityContext[],\n): void {\n const attrBinding = ir.createBindingOp(\n job.root.xref,\n ir.BindingKind.Attribute,\n name,\n value,\n null,\n securityContexts,\n /* Host attributes should always be extracted to const hostAttrs, even if they are not\n *strictly* text literals */\n true,\n false,\n null,\n /* TODO */ null,\n /** TODO: May be null? */ value.sourceSpan!,\n );\n job.root.update.push(attrBinding);\n}\n\nexport function ingestHostEvent(job: HostBindingCompilationJob, event: e.ParsedEvent) {\n const [phase, target] =\n event.type !== e.ParsedEventType.Animation\n ? [null, event.targetOrPhase]\n : [event.targetOrPhase, null];\n const eventBinding = ir.createListenerOp(\n job.root.xref,\n new ir.SlotHandle(),\n event.name,\n null,\n makeListenerHandlerOps(job.root, event.handler, event.handlerSpan),\n phase,\n target,\n true,\n event.sourceSpan,\n );\n job.root.create.push(eventBinding);\n}\n\n/**\n * Ingest the nodes of a template AST into the given `ViewCompilation`.\n */\nfunction ingestNodes(unit: ViewCompilationUnit, template: t.Node[]): void {\n for (const node of template) {\n if (node instanceof t.Element) {\n ingestElement(unit, node);\n } else if (node instanceof t.Template) {\n ingestTemplate(unit, node);\n } else if (node instanceof t.Content) {\n ingestContent(unit, node);\n } else if (node instanceof t.Text) {\n ingestText(unit, node, null);\n } else if (node instanceof t.BoundText) {\n ingestBoundText(unit, node, null);\n } else if (node instanceof t.IfBlock) {\n ingestIfBlock(unit, node);\n } else if (node instanceof t.SwitchBlock) {\n ingestSwitchBlock(unit, node);\n } else if (node instanceof t.DeferredBlock) {\n ingestDeferBlock(unit, node);\n } else if (node instanceof t.Icu) {\n ingestIcu(unit, node);\n } else if (node instanceof t.ForLoopBlock) {\n ingestForBlock(unit, node);\n } else if (node instanceof t.LetDeclaration) {\n ingestLetDeclaration(unit, node);\n } else {\n throw new Error(`Unsupported template node: ${node.constructor.name}`);\n }\n }\n}\n\n/**\n * Ingest an element AST from the template into the given `ViewCompilation`.\n */\nfunction ingestElement(unit: ViewCompilationUnit, element: t.Element): void {\n if (\n element.i18n !== undefined &&\n !(element.i18n instanceof i18n.Message || element.i18n instanceof i18n.TagPlaceholder)\n ) {\n throw Error(`Unhandled i18n metadata type for element: ${element.i18n.constructor.name}`);\n }\n\n const id = unit.job.allocateXrefId();\n\n const [namespaceKey, elementName] = splitNsName(element.name);\n\n const startOp = ir.createElementStartOp(\n elementName,\n id,\n namespaceForKey(namespaceKey),\n element.i18n instanceof i18n.TagPlaceholder ? element.i18n : undefined,\n element.startSourceSpan,\n element.sourceSpan,\n );\n unit.create.push(startOp);\n\n ingestElementBindings(unit, startOp, element);\n ingestReferences(startOp, element);\n\n // Start i18n, if needed, goes after the element create and bindings, but before the nodes\n let i18nBlockId: ir.XrefId | null = null;\n if (element.i18n instanceof i18n.Message) {\n i18nBlockId = unit.job.allocateXrefId();\n unit.create.push(\n ir.createI18nStartOp(i18nBlockId, element.i18n, undefined, element.startSourceSpan),\n );\n }\n\n ingestNodes(unit, element.children);\n\n // The source span for the end op is typically the element closing tag. However, if no closing tag\n // exists, such as in ``, we use the start source span instead. Usually the start and end\n // instructions will be collapsed into one `element` instruction, negating the purpose of this\n // fallback, but in cases when it is not collapsed (such as an input with a binding), we still\n // want to map the end instruction to the main element.\n const endOp = ir.createElementEndOp(id, element.endSourceSpan ?? element.startSourceSpan);\n unit.create.push(endOp);\n\n // If there is an i18n message associated with this element, insert i18n start and end ops.\n if (i18nBlockId !== null) {\n ir.OpList.insertBefore(\n ir.createI18nEndOp(i18nBlockId, element.endSourceSpan ?? element.startSourceSpan),\n endOp,\n );\n }\n}\n\n/**\n * Ingest an `ng-template` node from the AST into the given `ViewCompilation`.\n */\nfunction ingestTemplate(unit: ViewCompilationUnit, tmpl: t.Template): void {\n if (\n tmpl.i18n !== undefined &&\n !(tmpl.i18n instanceof i18n.Message || tmpl.i18n instanceof i18n.TagPlaceholder)\n ) {\n throw Error(`Unhandled i18n metadata type for template: ${tmpl.i18n.constructor.name}`);\n }\n\n const childView = unit.job.allocateView(unit.xref);\n\n let tagNameWithoutNamespace = tmpl.tagName;\n let namespacePrefix: string | null = '';\n if (tmpl.tagName) {\n [namespacePrefix, tagNameWithoutNamespace] = splitNsName(tmpl.tagName);\n }\n\n const i18nPlaceholder = tmpl.i18n instanceof i18n.TagPlaceholder ? tmpl.i18n : undefined;\n const namespace = namespaceForKey(namespacePrefix);\n const functionNameSuffix =\n tagNameWithoutNamespace === null ? '' : prefixWithNamespace(tagNameWithoutNamespace, namespace);\n const templateKind = isPlainTemplate(tmpl)\n ? ir.TemplateKind.NgTemplate\n : ir.TemplateKind.Structural;\n const templateOp = ir.createTemplateOp(\n childView.xref,\n templateKind,\n tagNameWithoutNamespace,\n functionNameSuffix,\n namespace,\n i18nPlaceholder,\n tmpl.startSourceSpan,\n tmpl.sourceSpan,\n );\n unit.create.push(templateOp);\n\n ingestTemplateBindings(unit, templateOp, tmpl, templateKind);\n ingestReferences(templateOp, tmpl);\n ingestNodes(childView, tmpl.children);\n\n for (const {name, value} of tmpl.variables) {\n childView.contextVariables.set(name, value !== '' ? value : '$implicit');\n }\n\n // If this is a plain template and there is an i18n message associated with it, insert i18n start\n // and end ops. For structural directive templates, the i18n ops will be added when ingesting the\n // element/template the directive is placed on.\n if (templateKind === ir.TemplateKind.NgTemplate && tmpl.i18n instanceof i18n.Message) {\n const id = unit.job.allocateXrefId();\n ir.OpList.insertAfter(\n ir.createI18nStartOp(id, tmpl.i18n, undefined, tmpl.startSourceSpan),\n childView.create.head,\n );\n ir.OpList.insertBefore(\n ir.createI18nEndOp(id, tmpl.endSourceSpan ?? tmpl.startSourceSpan),\n childView.create.tail,\n );\n }\n}\n\n/**\n * Ingest a content node from the AST into the given `ViewCompilation`.\n */\nfunction ingestContent(unit: ViewCompilationUnit, content: t.Content): void {\n if (content.i18n !== undefined && !(content.i18n instanceof i18n.TagPlaceholder)) {\n throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`);\n }\n\n let fallbackView: ViewCompilationUnit | null = null;\n\n // Don't capture default content that's only made up of empty text nodes and comments.\n // Note that we process the default content before the projection in order to match the\n // insertion order at runtime.\n if (\n content.children.some(\n (child) =>\n !(child instanceof t.Comment) &&\n (!(child instanceof t.Text) || child.value.trim().length > 0),\n )\n ) {\n fallbackView = unit.job.allocateView(unit.xref);\n ingestNodes(fallbackView, content.children);\n }\n\n const id = unit.job.allocateXrefId();\n const op = ir.createProjectionOp(\n id,\n content.selector,\n content.i18n,\n fallbackView?.xref ?? null,\n content.sourceSpan,\n );\n for (const attr of content.attributes) {\n const securityContext = domSchema.securityContext(content.name, attr.name, true);\n unit.update.push(\n ir.createBindingOp(\n op.xref,\n ir.BindingKind.Attribute,\n attr.name,\n o.literal(attr.value),\n null,\n securityContext,\n true,\n false,\n null,\n asMessage(attr.i18n),\n attr.sourceSpan,\n ),\n );\n }\n unit.create.push(op);\n}\n\n/**\n * Ingest a literal text node from the AST into the given `ViewCompilation`.\n */\nfunction ingestText(unit: ViewCompilationUnit, text: t.Text, icuPlaceholder: string | null): void {\n unit.create.push(\n ir.createTextOp(unit.job.allocateXrefId(), text.value, icuPlaceholder, text.sourceSpan),\n );\n}\n\n/**\n * Ingest an interpolated text node from the AST into the given `ViewCompilation`.\n */\nfunction ingestBoundText(\n unit: ViewCompilationUnit,\n text: t.BoundText,\n icuPlaceholder: string | null,\n): void {\n let value = text.value;\n if (value instanceof e.ASTWithSource) {\n value = value.ast;\n }\n if (!(value instanceof e.Interpolation)) {\n throw new Error(\n `AssertionError: expected Interpolation for BoundText node, got ${value.constructor.name}`,\n );\n }\n if (text.i18n !== undefined && !(text.i18n instanceof i18n.Container)) {\n throw Error(\n `Unhandled i18n metadata type for text interpolation: ${text.i18n?.constructor.name}`,\n );\n }\n\n const i18nPlaceholders =\n text.i18n instanceof i18n.Container\n ? text.i18n.children\n .filter((node): node is i18n.Placeholder => node instanceof i18n.Placeholder)\n .map((placeholder) => placeholder.name)\n : [];\n if (i18nPlaceholders.length > 0 && i18nPlaceholders.length !== value.expressions.length) {\n throw Error(\n `Unexpected number of i18n placeholders (${value.expressions.length}) for BoundText with ${value.expressions.length} expressions`,\n );\n }\n\n const textXref = unit.job.allocateXrefId();\n unit.create.push(ir.createTextOp(textXref, '', icuPlaceholder, text.sourceSpan));\n // TemplateDefinitionBuilder does not generate source maps for sub-expressions inside an\n // interpolation. We copy that behavior in compatibility mode.\n // TODO: is it actually correct to generate these extra maps in modern mode?\n const baseSourceSpan = unit.job.compatibility ? null : text.sourceSpan;\n unit.update.push(\n ir.createInterpolateTextOp(\n textXref,\n new ir.Interpolation(\n value.strings,\n value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan)),\n i18nPlaceholders,\n ),\n text.sourceSpan,\n ),\n );\n}\n\n/**\n * Ingest an `@if` block into the given `ViewCompilation`.\n */\nfunction ingestIfBlock(unit: ViewCompilationUnit, ifBlock: t.IfBlock): void {\n let firstXref: ir.XrefId | null = null;\n let conditions: Array = [];\n for (let i = 0; i < ifBlock.branches.length; i++) {\n const ifCase = ifBlock.branches[i];\n const cView = unit.job.allocateView(unit.xref);\n const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, ifCase);\n\n if (ifCase.expressionAlias !== null) {\n cView.contextVariables.set(ifCase.expressionAlias.name, ir.CTX_REF);\n }\n\n let ifCaseI18nMeta: i18n.BlockPlaceholder | undefined = undefined;\n if (ifCase.i18n !== undefined) {\n if (!(ifCase.i18n instanceof i18n.BlockPlaceholder)) {\n throw Error(`Unhandled i18n metadata type for if block: ${ifCase.i18n?.constructor.name}`);\n }\n ifCaseI18nMeta = ifCase.i18n;\n }\n\n const templateOp = ir.createTemplateOp(\n cView.xref,\n ir.TemplateKind.Block,\n tagName,\n 'Conditional',\n ir.Namespace.HTML,\n ifCaseI18nMeta,\n ifCase.startSourceSpan,\n ifCase.sourceSpan,\n );\n unit.create.push(templateOp);\n\n if (firstXref === null) {\n firstXref = cView.xref;\n }\n\n const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;\n const conditionalCaseExpr = new ir.ConditionalCaseExpr(\n caseExpr,\n templateOp.xref,\n templateOp.handle,\n ifCase.expressionAlias,\n );\n conditions.push(conditionalCaseExpr);\n ingestNodes(cView, ifCase.children);\n }\n unit.update.push(ir.createConditionalOp(firstXref!, null, conditions, ifBlock.sourceSpan));\n}\n\n/**\n * Ingest an `@switch` block into the given `ViewCompilation`.\n */\nfunction ingestSwitchBlock(unit: ViewCompilationUnit, switchBlock: t.SwitchBlock): void {\n // Don't ingest empty switches since they won't render anything.\n if (switchBlock.cases.length === 0) {\n return;\n }\n\n let firstXref: ir.XrefId | null = null;\n let conditions: Array = [];\n for (const switchCase of switchBlock.cases) {\n const cView = unit.job.allocateView(unit.xref);\n const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, switchCase);\n let switchCaseI18nMeta: i18n.BlockPlaceholder | undefined = undefined;\n if (switchCase.i18n !== undefined) {\n if (!(switchCase.i18n instanceof i18n.BlockPlaceholder)) {\n throw Error(\n `Unhandled i18n metadata type for switch block: ${switchCase.i18n?.constructor.name}`,\n );\n }\n switchCaseI18nMeta = switchCase.i18n;\n }\n const templateOp = ir.createTemplateOp(\n cView.xref,\n ir.TemplateKind.Block,\n tagName,\n 'Case',\n ir.Namespace.HTML,\n switchCaseI18nMeta,\n switchCase.startSourceSpan,\n switchCase.sourceSpan,\n );\n unit.create.push(templateOp);\n if (firstXref === null) {\n firstXref = cView.xref;\n }\n const caseExpr = switchCase.expression\n ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan)\n : null;\n const conditionalCaseExpr = new ir.ConditionalCaseExpr(\n caseExpr,\n templateOp.xref,\n templateOp.handle,\n );\n conditions.push(conditionalCaseExpr);\n ingestNodes(cView, switchCase.children);\n }\n unit.update.push(\n ir.createConditionalOp(\n firstXref!,\n convertAst(switchBlock.expression, unit.job, null),\n conditions,\n switchBlock.sourceSpan,\n ),\n );\n}\n\nfunction ingestDeferView(\n unit: ViewCompilationUnit,\n suffix: string,\n i18nMeta: i18n.I18nMeta | undefined,\n children?: t.Node[],\n sourceSpan?: ParseSourceSpan,\n): ir.TemplateOp | null {\n if (i18nMeta !== undefined && !(i18nMeta instanceof i18n.BlockPlaceholder)) {\n throw Error('Unhandled i18n metadata type for defer block');\n }\n if (children === undefined) {\n return null;\n }\n const secondaryView = unit.job.allocateView(unit.xref);\n ingestNodes(secondaryView, children);\n const templateOp = ir.createTemplateOp(\n secondaryView.xref,\n ir.TemplateKind.Block,\n null,\n `Defer${suffix}`,\n ir.Namespace.HTML,\n i18nMeta,\n sourceSpan!,\n sourceSpan!,\n );\n unit.create.push(templateOp);\n return templateOp;\n}\n\nfunction ingestDeferBlock(unit: ViewCompilationUnit, deferBlock: t.DeferredBlock): void {\n let ownResolverFn: o.Expression | null = null;\n\n if (unit.job.deferMeta.mode === DeferBlockDepsEmitMode.PerBlock) {\n if (!unit.job.deferMeta.blocks.has(deferBlock)) {\n throw new Error(\n `AssertionError: unable to find a dependency function for this deferred block`,\n );\n }\n ownResolverFn = unit.job.deferMeta.blocks.get(deferBlock) ?? null;\n }\n\n // Generate the defer main view and all secondary views.\n const main = ingestDeferView(\n unit,\n '',\n deferBlock.i18n,\n deferBlock.children,\n deferBlock.sourceSpan,\n )!;\n const loading = ingestDeferView(\n unit,\n 'Loading',\n deferBlock.loading?.i18n,\n deferBlock.loading?.children,\n deferBlock.loading?.sourceSpan,\n );\n const placeholder = ingestDeferView(\n unit,\n 'Placeholder',\n deferBlock.placeholder?.i18n,\n deferBlock.placeholder?.children,\n deferBlock.placeholder?.sourceSpan,\n );\n const error = ingestDeferView(\n unit,\n 'Error',\n deferBlock.error?.i18n,\n deferBlock.error?.children,\n deferBlock.error?.sourceSpan,\n );\n\n // Create the main defer op, and ops for all secondary views.\n const deferXref = unit.job.allocateXrefId();\n const deferOp = ir.createDeferOp(\n deferXref,\n main.xref,\n main.handle,\n ownResolverFn,\n unit.job.allDeferrableDepsFn,\n deferBlock.sourceSpan,\n );\n deferOp.placeholderView = placeholder?.xref ?? null;\n deferOp.placeholderSlot = placeholder?.handle ?? null;\n deferOp.loadingSlot = loading?.handle ?? null;\n deferOp.errorSlot = error?.handle ?? null;\n deferOp.placeholderMinimumTime = deferBlock.placeholder?.minimumTime ?? null;\n deferOp.loadingMinimumTime = deferBlock.loading?.minimumTime ?? null;\n deferOp.loadingAfterTime = deferBlock.loading?.afterTime ?? null;\n deferOp.flags = calcDeferBlockFlags(deferBlock);\n unit.create.push(deferOp);\n\n // Configure all defer `on` conditions.\n // TODO: refactor prefetch triggers to use a separate op type, with a shared superclass. This will\n // make it easier to refactor prefetch behavior in the future.\n const deferOnOps: ir.DeferOnOp[] = [];\n const deferWhenOps: ir.DeferWhenOp[] = [];\n\n // Ingest the hydrate triggers first since they set up all the other triggers during SSR.\n ingestDeferTriggers(\n ir.DeferOpModifierKind.HYDRATE,\n deferBlock.hydrateTriggers,\n deferOnOps,\n deferWhenOps,\n unit,\n deferXref,\n );\n\n ingestDeferTriggers(\n ir.DeferOpModifierKind.NONE,\n deferBlock.triggers,\n deferOnOps,\n deferWhenOps,\n unit,\n deferXref,\n );\n\n ingestDeferTriggers(\n ir.DeferOpModifierKind.PREFETCH,\n deferBlock.prefetchTriggers,\n deferOnOps,\n deferWhenOps,\n unit,\n deferXref,\n );\n\n // If no (non-prefetching or hydrating) defer triggers were provided, default to `idle`.\n const hasConcreteTrigger =\n deferOnOps.some((op) => op.modifier === ir.DeferOpModifierKind.NONE) ||\n deferWhenOps.some((op) => op.modifier === ir.DeferOpModifierKind.NONE);\n\n if (!hasConcreteTrigger) {\n deferOnOps.push(\n ir.createDeferOnOp(\n deferXref,\n {kind: ir.DeferTriggerKind.Idle},\n ir.DeferOpModifierKind.NONE,\n null!,\n ),\n );\n }\n\n unit.create.push(deferOnOps);\n unit.update.push(deferWhenOps);\n}\n\nfunction calcDeferBlockFlags(deferBlockDetails: t.DeferredBlock): ir.TDeferDetailsFlags | null {\n if (Object.keys(deferBlockDetails.hydrateTriggers).length > 0) {\n return ir.TDeferDetailsFlags.HasHydrateTriggers;\n }\n return null;\n}\n\nfunction ingestDeferTriggers(\n modifier: ir.DeferOpModifierKind,\n triggers: Readonly,\n onOps: ir.DeferOnOp[],\n whenOps: ir.DeferWhenOp[],\n unit: ViewCompilationUnit,\n deferXref: ir.XrefId,\n) {\n if (triggers.idle !== undefined) {\n const deferOnOp = ir.createDeferOnOp(\n deferXref,\n {kind: ir.DeferTriggerKind.Idle},\n modifier,\n triggers.idle.sourceSpan,\n );\n onOps.push(deferOnOp);\n }\n if (triggers.immediate !== undefined) {\n const deferOnOp = ir.createDeferOnOp(\n deferXref,\n {kind: ir.DeferTriggerKind.Immediate},\n modifier,\n triggers.immediate.sourceSpan,\n );\n onOps.push(deferOnOp);\n }\n if (triggers.timer !== undefined) {\n const deferOnOp = ir.createDeferOnOp(\n deferXref,\n {kind: ir.DeferTriggerKind.Timer, delay: triggers.timer.delay},\n modifier,\n triggers.timer.sourceSpan,\n );\n onOps.push(deferOnOp);\n }\n if (triggers.hover !== undefined) {\n const deferOnOp = ir.createDeferOnOp(\n deferXref,\n {\n kind: ir.DeferTriggerKind.Hover,\n targetName: triggers.hover.reference,\n targetXref: null,\n targetSlot: null,\n targetView: null,\n targetSlotViewSteps: null,\n },\n modifier,\n triggers.hover.sourceSpan,\n );\n onOps.push(deferOnOp);\n }\n if (triggers.interaction !== undefined) {\n const deferOnOp = ir.createDeferOnOp(\n deferXref,\n {\n kind: ir.DeferTriggerKind.Interaction,\n targetName: triggers.interaction.reference,\n targetXref: null,\n targetSlot: null,\n targetView: null,\n targetSlotViewSteps: null,\n },\n modifier,\n triggers.interaction.sourceSpan,\n );\n onOps.push(deferOnOp);\n }\n if (triggers.viewport !== undefined) {\n const deferOnOp = ir.createDeferOnOp(\n deferXref,\n {\n kind: ir.DeferTriggerKind.Viewport,\n targetName: triggers.viewport.reference,\n targetXref: null,\n targetSlot: null,\n targetView: null,\n targetSlotViewSteps: null,\n },\n modifier,\n triggers.viewport.sourceSpan,\n );\n onOps.push(deferOnOp);\n }\n if (triggers.never !== undefined) {\n const deferOnOp = ir.createDeferOnOp(\n deferXref,\n {kind: ir.DeferTriggerKind.Never},\n modifier,\n triggers.never.sourceSpan,\n );\n onOps.push(deferOnOp);\n }\n if (triggers.when !== undefined) {\n if (triggers.when.value instanceof e.Interpolation) {\n // TemplateDefinitionBuilder supports this case, but it's very strange to me. What would it\n // even mean?\n throw new Error(`Unexpected interpolation in defer block when trigger`);\n }\n const deferOnOp = ir.createDeferWhenOp(\n deferXref,\n convertAst(triggers.when.value, unit.job, triggers.when.sourceSpan),\n modifier,\n triggers.when.sourceSpan,\n );\n whenOps.push(deferOnOp);\n }\n}\n\nfunction ingestIcu(unit: ViewCompilationUnit, icu: t.Icu) {\n if (icu.i18n instanceof i18n.Message && isSingleI18nIcu(icu.i18n)) {\n const xref = unit.job.allocateXrefId();\n unit.create.push(ir.createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null!));\n for (const [placeholder, text] of Object.entries({...icu.vars, ...icu.placeholders})) {\n if (text instanceof t.BoundText) {\n ingestBoundText(unit, text, placeholder);\n } else {\n ingestText(unit, text, placeholder);\n }\n }\n unit.create.push(ir.createIcuEndOp(xref));\n } else {\n throw Error(`Unhandled i18n metadata type for ICU: ${icu.i18n?.constructor.name}`);\n }\n}\n\n/**\n * Ingest an `@for` block into the given `ViewCompilation`.\n */\nfunction ingestForBlock(unit: ViewCompilationUnit, forBlock: t.ForLoopBlock): void {\n const repeaterView = unit.job.allocateView(unit.xref);\n\n // We copy TemplateDefinitionBuilder's scheme of creating names for `$count` and `$index`\n // that are suffixed with special information, to disambiguate which level of nested loop\n // the below aliases refer to.\n // TODO: We should refactor Template Pipeline's variable phases to gracefully handle\n // shadowing, and arbitrarily many levels of variables depending on each other.\n const indexName = `ɵ$index_${repeaterView.xref}`;\n const countName = `ɵ$count_${repeaterView.xref}`;\n const indexVarNames = new Set();\n\n // Set all the context variables and aliases available in the repeater.\n repeaterView.contextVariables.set(forBlock.item.name, forBlock.item.value);\n\n for (const variable of forBlock.contextVariables) {\n if (variable.value === '$index') {\n indexVarNames.add(variable.name);\n }\n if (variable.name === '$index') {\n repeaterView.contextVariables.set('$index', variable.value).set(indexName, variable.value);\n } else if (variable.name === '$count') {\n repeaterView.contextVariables.set('$count', variable.value).set(countName, variable.value);\n } else {\n repeaterView.aliases.add({\n kind: ir.SemanticVariableKind.Alias,\n name: null,\n identifier: variable.name,\n expression: getComputedForLoopVariableExpression(variable, indexName, countName),\n });\n }\n }\n\n const sourceSpan = convertSourceSpan(forBlock.trackBy.span, forBlock.sourceSpan);\n const track = convertAst(forBlock.trackBy, unit.job, sourceSpan);\n\n ingestNodes(repeaterView, forBlock.children);\n\n let emptyView: ViewCompilationUnit | null = null;\n let emptyTagName: string | null = null;\n if (forBlock.empty !== null) {\n emptyView = unit.job.allocateView(unit.xref);\n ingestNodes(emptyView, forBlock.empty.children);\n emptyTagName = ingestControlFlowInsertionPoint(unit, emptyView.xref, forBlock.empty);\n }\n\n const varNames: ir.RepeaterVarNames = {\n $index: indexVarNames,\n $implicit: forBlock.item.name,\n };\n\n if (forBlock.i18n !== undefined && !(forBlock.i18n instanceof i18n.BlockPlaceholder)) {\n throw Error('AssertionError: Unhandled i18n metadata type or @for');\n }\n if (\n forBlock.empty?.i18n !== undefined &&\n !(forBlock.empty.i18n instanceof i18n.BlockPlaceholder)\n ) {\n throw Error('AssertionError: Unhandled i18n metadata type or @empty');\n }\n const i18nPlaceholder = forBlock.i18n;\n const emptyI18nPlaceholder = forBlock.empty?.i18n;\n\n const tagName = ingestControlFlowInsertionPoint(unit, repeaterView.xref, forBlock);\n const repeaterCreate = ir.createRepeaterCreateOp(\n repeaterView.xref,\n emptyView?.xref ?? null,\n tagName,\n track,\n varNames,\n emptyTagName,\n i18nPlaceholder,\n emptyI18nPlaceholder,\n forBlock.startSourceSpan,\n forBlock.sourceSpan,\n );\n unit.create.push(repeaterCreate);\n\n const expression = convertAst(\n forBlock.expression,\n unit.job,\n convertSourceSpan(forBlock.expression.span, forBlock.sourceSpan),\n );\n const repeater = ir.createRepeaterOp(\n repeaterCreate.xref,\n repeaterCreate.handle,\n expression,\n forBlock.sourceSpan,\n );\n unit.update.push(repeater);\n}\n\n/**\n * Gets an expression that represents a variable in an `@for` loop.\n * @param variable AST representing the variable.\n * @param indexName Loop-specific name for `$index`.\n * @param countName Loop-specific name for `$count`.\n */\nfunction getComputedForLoopVariableExpression(\n variable: t.Variable,\n indexName: string,\n countName: string,\n): o.Expression {\n switch (variable.value) {\n case '$index':\n return new ir.LexicalReadExpr(indexName);\n\n case '$count':\n return new ir.LexicalReadExpr(countName);\n\n case '$first':\n return new ir.LexicalReadExpr(indexName).identical(o.literal(0));\n\n case '$last':\n return new ir.LexicalReadExpr(indexName).identical(\n new ir.LexicalReadExpr(countName).minus(o.literal(1)),\n );\n\n case '$even':\n return new ir.LexicalReadExpr(indexName).modulo(o.literal(2)).identical(o.literal(0));\n\n case '$odd':\n return new ir.LexicalReadExpr(indexName).modulo(o.literal(2)).notIdentical(o.literal(0));\n\n default:\n throw new Error(`AssertionError: unknown @for loop variable ${variable.value}`);\n }\n}\n\nfunction ingestLetDeclaration(unit: ViewCompilationUnit, node: t.LetDeclaration) {\n const target = unit.job.allocateXrefId();\n\n unit.create.push(ir.createDeclareLetOp(target, node.name, node.sourceSpan));\n unit.update.push(\n ir.createStoreLetOp(\n target,\n node.name,\n convertAst(node.value, unit.job, node.valueSpan),\n node.sourceSpan,\n ),\n );\n}\n\n/**\n * Convert a template AST expression into an output AST expression.\n */\nfunction convertAst(\n ast: e.AST,\n job: CompilationJob,\n baseSourceSpan: ParseSourceSpan | null,\n): o.Expression {\n if (ast instanceof e.ASTWithSource) {\n return convertAst(ast.ast, job, baseSourceSpan);\n } else if (ast instanceof e.PropertyRead) {\n // Whether this is an implicit receiver, *excluding* explicit reads of `this`.\n const isImplicitReceiver =\n ast.receiver instanceof e.ImplicitReceiver && !(ast.receiver instanceof e.ThisReceiver);\n if (isImplicitReceiver) {\n return new ir.LexicalReadExpr(ast.name);\n } else {\n return new o.ReadPropExpr(\n convertAst(ast.receiver, job, baseSourceSpan),\n ast.name,\n null,\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n }\n } else if (ast instanceof e.PropertyWrite) {\n if (ast.receiver instanceof e.ImplicitReceiver) {\n return new o.WritePropExpr(\n // TODO: Is it correct to always use the root context in place of the implicit receiver?\n new ir.ContextExpr(job.root.xref),\n ast.name,\n convertAst(ast.value, job, baseSourceSpan),\n null,\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n }\n return new o.WritePropExpr(\n convertAst(ast.receiver, job, baseSourceSpan),\n ast.name,\n convertAst(ast.value, job, baseSourceSpan),\n undefined,\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n } else if (ast instanceof e.KeyedWrite) {\n return new o.WriteKeyExpr(\n convertAst(ast.receiver, job, baseSourceSpan),\n convertAst(ast.key, job, baseSourceSpan),\n convertAst(ast.value, job, baseSourceSpan),\n undefined,\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n } else if (ast instanceof e.Call) {\n if (ast.receiver instanceof e.ImplicitReceiver) {\n throw new Error(`Unexpected ImplicitReceiver`);\n } else {\n return new o.InvokeFunctionExpr(\n convertAst(ast.receiver, job, baseSourceSpan),\n ast.args.map((arg) => convertAst(arg, job, baseSourceSpan)),\n undefined,\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n }\n } else if (ast instanceof e.LiteralPrimitive) {\n return o.literal(ast.value, undefined, convertSourceSpan(ast.span, baseSourceSpan));\n } else if (ast instanceof e.Unary) {\n switch (ast.operator) {\n case '+':\n return new o.UnaryOperatorExpr(\n o.UnaryOperator.Plus,\n convertAst(ast.expr, job, baseSourceSpan),\n undefined,\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n case '-':\n return new o.UnaryOperatorExpr(\n o.UnaryOperator.Minus,\n convertAst(ast.expr, job, baseSourceSpan),\n undefined,\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n default:\n throw new Error(`AssertionError: unknown unary operator ${ast.operator}`);\n }\n } else if (ast instanceof e.Binary) {\n const operator = BINARY_OPERATORS.get(ast.operation);\n if (operator === undefined) {\n throw new Error(`AssertionError: unknown binary operator ${ast.operation}`);\n }\n return new o.BinaryOperatorExpr(\n operator,\n convertAst(ast.left, job, baseSourceSpan),\n convertAst(ast.right, job, baseSourceSpan),\n undefined,\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n } else if (ast instanceof e.ThisReceiver) {\n // TODO: should context expressions have source maps?\n return new ir.ContextExpr(job.root.xref);\n } else if (ast instanceof e.KeyedRead) {\n return new o.ReadKeyExpr(\n convertAst(ast.receiver, job, baseSourceSpan),\n convertAst(ast.key, job, baseSourceSpan),\n undefined,\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n } else if (ast instanceof e.Chain) {\n throw new Error(`AssertionError: Chain in unknown context`);\n } else if (ast instanceof e.LiteralMap) {\n const entries = ast.keys.map((key, idx) => {\n const value = ast.values[idx];\n // TODO: should literals have source maps, or do we just map the whole surrounding\n // expression?\n return new o.LiteralMapEntry(key.key, convertAst(value, job, baseSourceSpan), key.quoted);\n });\n return new o.LiteralMapExpr(entries, undefined, convertSourceSpan(ast.span, baseSourceSpan));\n } else if (ast instanceof e.LiteralArray) {\n // TODO: should literals have source maps, or do we just map the whole surrounding expression?\n return new o.LiteralArrayExpr(\n ast.expressions.map((expr) => convertAst(expr, job, baseSourceSpan)),\n );\n } else if (ast instanceof e.Conditional) {\n return new o.ConditionalExpr(\n convertAst(ast.condition, job, baseSourceSpan),\n convertAst(ast.trueExp, job, baseSourceSpan),\n convertAst(ast.falseExp, job, baseSourceSpan),\n undefined,\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n } else if (ast instanceof e.NonNullAssert) {\n // A non-null assertion shouldn't impact generated instructions, so we can just drop it.\n return convertAst(ast.expression, job, baseSourceSpan);\n } else if (ast instanceof e.BindingPipe) {\n // TODO: pipes should probably have source maps; figure out details.\n return new ir.PipeBindingExpr(job.allocateXrefId(), new ir.SlotHandle(), ast.name, [\n convertAst(ast.exp, job, baseSourceSpan),\n ...ast.args.map((arg) => convertAst(arg, job, baseSourceSpan)),\n ]);\n } else if (ast instanceof e.SafeKeyedRead) {\n return new ir.SafeKeyedReadExpr(\n convertAst(ast.receiver, job, baseSourceSpan),\n convertAst(ast.key, job, baseSourceSpan),\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n } else if (ast instanceof e.SafePropertyRead) {\n // TODO: source span\n return new ir.SafePropertyReadExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name);\n } else if (ast instanceof e.SafeCall) {\n // TODO: source span\n return new ir.SafeInvokeFunctionExpr(\n convertAst(ast.receiver, job, baseSourceSpan),\n ast.args.map((a) => convertAst(a, job, baseSourceSpan)),\n );\n } else if (ast instanceof e.EmptyExpr) {\n return new ir.EmptyExpr(convertSourceSpan(ast.span, baseSourceSpan));\n } else if (ast instanceof e.PrefixNot) {\n return o.not(\n convertAst(ast.expression, job, baseSourceSpan),\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n } else if (ast instanceof e.TypeofExpression) {\n return o.typeofExpr(convertAst(ast.expression, job, baseSourceSpan));\n } else if (ast instanceof e.TemplateLiteral) {\n return new o.TemplateLiteralExpr(\n ast.elements.map((el) => {\n return new o.TemplateLiteralElementExpr(\n el.text,\n convertSourceSpan(el.span, baseSourceSpan),\n );\n }),\n ast.expressions.map((expr) => convertAst(expr, job, baseSourceSpan)),\n convertSourceSpan(ast.span, baseSourceSpan),\n );\n } else {\n throw new Error(\n `Unhandled expression type \"${ast.constructor.name}\" in file \"${baseSourceSpan?.start.file.url}\"`,\n );\n }\n}\n\nfunction convertAstWithInterpolation(\n job: CompilationJob,\n value: e.AST | string,\n i18nMeta: i18n.I18nMeta | null | undefined,\n sourceSpan?: ParseSourceSpan,\n): o.Expression | ir.Interpolation {\n let expression: o.Expression | ir.Interpolation;\n if (value instanceof e.Interpolation) {\n expression = new ir.Interpolation(\n value.strings,\n value.expressions.map((e) => convertAst(e, job, sourceSpan ?? null)),\n Object.keys(asMessage(i18nMeta)?.placeholders ?? {}),\n );\n } else if (value instanceof e.AST) {\n expression = convertAst(value, job, sourceSpan ?? null);\n } else {\n expression = o.literal(value);\n }\n return expression;\n}\n\n// TODO: Can we populate Template binding kinds in ingest?\nconst BINDING_KINDS = new Map([\n [e.BindingType.Property, ir.BindingKind.Property],\n [e.BindingType.TwoWay, ir.BindingKind.TwoWayProperty],\n [e.BindingType.Attribute, ir.BindingKind.Attribute],\n [e.BindingType.Class, ir.BindingKind.ClassName],\n [e.BindingType.Style, ir.BindingKind.StyleProperty],\n [e.BindingType.Animation, ir.BindingKind.Animation],\n]);\n\n/**\n * Checks whether the given template is a plain ng-template (as opposed to another kind of template\n * such as a structural directive template or control flow template). This is checked based on the\n * tagName. We can expect that only plain ng-templates will come through with a tagName of\n * 'ng-template'.\n *\n * Here are some of the cases we expect:\n *\n * | Angular HTML | Template tagName |\n * | ---------------------------------- | ------------------ |\n * | `` | 'ng-template' |\n * | `
` | 'div' |\n * | `` | 'svg:ng-template' |\n * | `@if (true) {` | 'Conditional' |\n * | `` (plain) | 'ng-template' |\n * | `` (structural) | null |\n */\nfunction isPlainTemplate(tmpl: t.Template) {\n return splitNsName(tmpl.tagName ?? '')[1] === NG_TEMPLATE_TAG_NAME;\n}\n\n/**\n * Ensures that the i18nMeta, if provided, is an i18n.Message.\n */\nfunction asMessage(i18nMeta: i18n.I18nMeta | null | undefined): i18n.Message | null {\n if (i18nMeta == null) {\n return null;\n }\n if (!(i18nMeta instanceof i18n.Message)) {\n throw Error(`Expected i18n meta to be a Message, but got: ${i18nMeta.constructor.name}`);\n }\n return i18nMeta;\n}\n\n/**\n * Process all of the bindings on an element in the template AST and convert them to their IR\n * representation.\n */\nfunction ingestElementBindings(\n unit: ViewCompilationUnit,\n op: ir.ElementOpBase,\n element: t.Element,\n): void {\n let bindings = new Array();\n\n let i18nAttributeBindingNames = new Set();\n\n for (const attr of element.attributes) {\n // Attribute literal bindings, such as `attr.foo=\"bar\"`.\n const [ns, elementName] = splitNsName(element.name);\n let namespace = ns;\n if (!ns) {\n switch (op.namespace) {\n case ir.Namespace.SVG:\n namespace = SVG_NAMESPACE;\n break;\n case ir.Namespace.Math:\n namespace = MATH_ML_NAMESPACE;\n break;\n }\n }\n\n const securityContext = domSchema.securityContext(\n namespace ? `:${namespace}:${elementName}` : elementName,\n attr.name,\n true,\n );\n bindings.push(\n ir.createBindingOp(\n op.xref,\n ir.BindingKind.Attribute,\n attr.name,\n convertAstWithInterpolation(unit.job, attr.value, attr.i18n),\n null,\n securityContext,\n true,\n false,\n null,\n asMessage(attr.i18n),\n attr.sourceSpan,\n ),\n );\n if (attr.i18n) {\n i18nAttributeBindingNames.add(attr.name);\n }\n }\n\n for (const input of element.inputs) {\n if (i18nAttributeBindingNames.has(input.name)) {\n console.error(\n `On component ${unit.job.componentName}, the binding ${input.name} is both an i18n attribute and a property. You may want to remove the property binding. This will become a compilation error in future versions of Angular.`,\n );\n }\n // All dynamic bindings (both attribute and property bindings).\n bindings.push(\n ir.createBindingOp(\n op.xref,\n BINDING_KINDS.get(input.type)!,\n input.name,\n convertAstWithInterpolation(unit.job, astOf(input.value), input.i18n),\n input.unit,\n input.securityContext,\n false,\n false,\n null,\n asMessage(input.i18n) ?? null,\n input.sourceSpan,\n ),\n );\n }\n\n unit.create.push(\n bindings.filter((b): b is ir.ExtractedAttributeOp => b?.kind === ir.OpKind.ExtractedAttribute),\n );\n unit.update.push(bindings.filter((b): b is ir.BindingOp => b?.kind === ir.OpKind.Binding));\n\n for (const output of element.outputs) {\n if (output.type === e.ParsedEventType.Animation && output.phase === null) {\n throw Error('Animation listener should have a phase');\n }\n\n if (output.type === e.ParsedEventType.TwoWay) {\n unit.create.push(\n ir.createTwoWayListenerOp(\n op.xref,\n op.handle,\n output.name,\n op.tag,\n makeTwoWayListenerHandlerOps(unit, output.handler, output.handlerSpan),\n output.sourceSpan,\n ),\n );\n } else {\n unit.create.push(\n ir.createListenerOp(\n op.xref,\n op.handle,\n output.name,\n op.tag,\n makeListenerHandlerOps(unit, output.handler, output.handlerSpan),\n output.phase,\n output.target,\n false,\n output.sourceSpan,\n ),\n );\n }\n }\n\n // If any of the bindings on this element have an i18n message, then an i18n attrs configuration\n // op is also required.\n if (bindings.some((b) => b?.i18nMessage) !== null) {\n unit.create.push(\n ir.createI18nAttributesOp(unit.job.allocateXrefId(), new ir.SlotHandle(), op.xref),\n );\n }\n}\n\n/**\n * Process all of the bindings on a template in the template AST and convert them to their IR\n * representation.\n */\nfunction ingestTemplateBindings(\n unit: ViewCompilationUnit,\n op: ir.ElementOpBase,\n template: t.Template,\n templateKind: ir.TemplateKind | null,\n): void {\n let bindings = new Array();\n\n for (const attr of template.templateAttrs) {\n if (attr instanceof t.TextAttribute) {\n const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);\n bindings.push(\n createTemplateBinding(\n unit,\n op.xref,\n e.BindingType.Attribute,\n attr.name,\n attr.value,\n null,\n securityContext,\n true,\n templateKind,\n asMessage(attr.i18n),\n attr.sourceSpan,\n ),\n );\n } else {\n bindings.push(\n createTemplateBinding(\n unit,\n op.xref,\n attr.type,\n attr.name,\n astOf(attr.value),\n attr.unit,\n attr.securityContext,\n true,\n templateKind,\n asMessage(attr.i18n),\n attr.sourceSpan,\n ),\n );\n }\n }\n\n for (const attr of template.attributes) {\n // Attribute literal bindings, such as `attr.foo=\"bar\"`.\n const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);\n bindings.push(\n createTemplateBinding(\n unit,\n op.xref,\n e.BindingType.Attribute,\n attr.name,\n attr.value,\n null,\n securityContext,\n false,\n templateKind,\n asMessage(attr.i18n),\n attr.sourceSpan,\n ),\n );\n }\n\n for (const input of template.inputs) {\n // Dynamic bindings (both attribute and property bindings).\n bindings.push(\n createTemplateBinding(\n unit,\n op.xref,\n input.type,\n input.name,\n astOf(input.value),\n input.unit,\n input.securityContext,\n false,\n templateKind,\n asMessage(input.i18n),\n input.sourceSpan,\n ),\n );\n }\n\n unit.create.push(\n bindings.filter((b): b is ir.ExtractedAttributeOp => b?.kind === ir.OpKind.ExtractedAttribute),\n );\n unit.update.push(bindings.filter((b): b is ir.BindingOp => b?.kind === ir.OpKind.Binding));\n\n for (const output of template.outputs) {\n if (output.type === e.ParsedEventType.Animation && output.phase === null) {\n throw Error('Animation listener should have a phase');\n }\n\n if (templateKind === ir.TemplateKind.NgTemplate) {\n if (output.type === e.ParsedEventType.TwoWay) {\n unit.create.push(\n ir.createTwoWayListenerOp(\n op.xref,\n op.handle,\n output.name,\n op.tag,\n makeTwoWayListenerHandlerOps(unit, output.handler, output.handlerSpan),\n output.sourceSpan,\n ),\n );\n } else {\n unit.create.push(\n ir.createListenerOp(\n op.xref,\n op.handle,\n output.name,\n op.tag,\n makeListenerHandlerOps(unit, output.handler, output.handlerSpan),\n output.phase,\n output.target,\n false,\n output.sourceSpan,\n ),\n );\n }\n }\n if (\n templateKind === ir.TemplateKind.Structural &&\n output.type !== e.ParsedEventType.Animation\n ) {\n // Animation bindings are excluded from the structural template's const array.\n const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, output.name, false);\n unit.create.push(\n ir.createExtractedAttributeOp(\n op.xref,\n ir.BindingKind.Property,\n null,\n output.name,\n null,\n null,\n null,\n securityContext,\n ),\n );\n }\n }\n\n // TODO: Perhaps we could do this in a phase? (It likely wouldn't change the slot indices.)\n if (bindings.some((b) => b?.i18nMessage) !== null) {\n unit.create.push(\n ir.createI18nAttributesOp(unit.job.allocateXrefId(), new ir.SlotHandle(), op.xref),\n );\n }\n}\n\n/**\n * Helper to ingest an individual binding on a template, either an explicit `ng-template`, or an\n * implicit template created via structural directive.\n *\n * Bindings on templates are *extremely* tricky. I have tried to isolate all of the confusing edge\n * cases into this function, and to comment it well to document the behavior.\n *\n * Some of this behavior is intuitively incorrect, and we should consider changing it in the future.\n *\n * @param view The compilation unit for the view containing the template.\n * @param xref The xref of the template op.\n * @param type The binding type, according to the parser. This is fairly reasonable, e.g. both\n * dynamic and static attributes have e.BindingType.Attribute.\n * @param name The binding's name.\n * @param value The bindings's value, which will either be an input AST expression, or a string\n * literal. Note that the input AST expression may or may not be const -- it will only be a\n * string literal if the parser considered it a text binding.\n * @param unit If the binding has a unit (e.g. `px` for style bindings), then this is the unit.\n * @param securityContext The security context of the binding.\n * @param isStructuralTemplateAttribute Whether this binding actually applies to the structural\n * ng-template. For example, an `ngFor` would actually apply to the structural template. (Most\n * bindings on structural elements target the inner element, not the template.)\n * @param templateKind Whether this is an explicit `ng-template` or an implicit template created by\n * a structural directive. This should never be a block template.\n * @param i18nMessage The i18n metadata for the binding, if any.\n * @param sourceSpan The source span of the binding.\n * @returns An IR binding op, or null if the binding should be skipped.\n */\nfunction createTemplateBinding(\n view: ViewCompilationUnit,\n xref: ir.XrefId,\n type: e.BindingType,\n name: string,\n value: e.AST | string,\n unit: string | null,\n securityContext: SecurityContext,\n isStructuralTemplateAttribute: boolean,\n templateKind: ir.TemplateKind | null,\n i18nMessage: i18n.Message | null,\n sourceSpan: ParseSourceSpan,\n): ir.BindingOp | ir.ExtractedAttributeOp | null {\n const isTextBinding = typeof value === 'string';\n // If this is a structural template, then several kinds of bindings should not result in an\n // update instruction.\n if (templateKind === ir.TemplateKind.Structural) {\n if (!isStructuralTemplateAttribute) {\n switch (type) {\n case e.BindingType.Property:\n case e.BindingType.Class:\n case e.BindingType.Style:\n // Because this binding doesn't really target the ng-template, it must be a binding on an\n // inner node of a structural template. We can't skip it entirely, because we still need\n // it on the ng-template's consts (e.g. for the purposes of directive matching). However,\n // we should not generate an update instruction for it.\n return ir.createExtractedAttributeOp(\n xref,\n ir.BindingKind.Property,\n null,\n name,\n null,\n null,\n i18nMessage,\n securityContext,\n );\n case e.BindingType.TwoWay:\n return ir.createExtractedAttributeOp(\n xref,\n ir.BindingKind.TwoWayProperty,\n null,\n name,\n null,\n null,\n i18nMessage,\n securityContext,\n );\n }\n }\n\n if (!isTextBinding && (type === e.BindingType.Attribute || type === e.BindingType.Animation)) {\n // Again, this binding doesn't really target the ng-template; it actually targets the element\n // inside the structural template. In the case of non-text attribute or animation bindings,\n // the binding doesn't even show up on the ng-template const array, so we just skip it\n // entirely.\n return null;\n }\n }\n\n let bindingType = BINDING_KINDS.get(type)!;\n\n if (templateKind === ir.TemplateKind.NgTemplate) {\n // We know we are dealing with bindings directly on an explicit ng-template.\n // Static attribute bindings should be collected into the const array as k/v pairs. Property\n // bindings should result in a `property` instruction, and `AttributeMarker.Bindings` const\n // entries.\n //\n // The difficulty is with dynamic attribute, style, and class bindings. These don't really make\n // sense on an `ng-template` and should probably be parser errors. However,\n // TemplateDefinitionBuilder generates `property` instructions for them, and so we do that as\n // well.\n //\n // Note that we do have a slight behavior difference with TemplateDefinitionBuilder: although\n // TDB emits `property` instructions for dynamic attributes, styles, and classes, only styles\n // and classes also get const collected into the `AttributeMarker.Bindings` field. Dynamic\n // attribute bindings are missing from the consts entirely. We choose to emit them into the\n // consts field anyway, to avoid creating special cases for something so arcane and nonsensical.\n if (\n type === e.BindingType.Class ||\n type === e.BindingType.Style ||\n (type === e.BindingType.Attribute && !isTextBinding)\n ) {\n // TODO: These cases should be parse errors.\n bindingType = ir.BindingKind.Property;\n }\n }\n\n return ir.createBindingOp(\n xref,\n bindingType,\n name,\n convertAstWithInterpolation(view.job, value, i18nMessage),\n unit,\n securityContext,\n isTextBinding,\n isStructuralTemplateAttribute,\n templateKind,\n i18nMessage,\n sourceSpan,\n );\n}\n\nfunction makeListenerHandlerOps(\n unit: CompilationUnit,\n handler: e.AST,\n handlerSpan: ParseSourceSpan,\n): ir.UpdateOp[] {\n handler = astOf(handler);\n const handlerOps = new Array();\n let handlerExprs: e.AST[] = handler instanceof e.Chain ? handler.expressions : [handler];\n if (handlerExprs.length === 0) {\n throw new Error('Expected listener to have non-empty expression list.');\n }\n const expressions = handlerExprs.map((expr) => convertAst(expr, unit.job, handlerSpan));\n const returnExpr = expressions.pop()!;\n handlerOps.push(\n ...expressions.map((e) =>\n ir.createStatementOp(new o.ExpressionStatement(e, e.sourceSpan)),\n ),\n );\n handlerOps.push(ir.createStatementOp(new o.ReturnStatement(returnExpr, returnExpr.sourceSpan)));\n return handlerOps;\n}\n\nfunction makeTwoWayListenerHandlerOps(\n unit: CompilationUnit,\n handler: e.AST,\n handlerSpan: ParseSourceSpan,\n): ir.UpdateOp[] {\n handler = astOf(handler);\n const handlerOps = new Array();\n\n if (handler instanceof e.Chain) {\n if (handler.expressions.length === 1) {\n handler = handler.expressions[0];\n } else {\n // This is validated during parsing already, but we do it here just in case.\n throw new Error('Expected two-way listener to have a single expression.');\n }\n }\n\n const handlerExpr = convertAst(handler, unit.job, handlerSpan);\n const eventReference = new ir.LexicalReadExpr('$event');\n const twoWaySetExpr = new ir.TwoWayBindingSetExpr(handlerExpr, eventReference);\n\n handlerOps.push(ir.createStatementOp(new o.ExpressionStatement(twoWaySetExpr)));\n handlerOps.push(ir.createStatementOp(new o.ReturnStatement(eventReference)));\n return handlerOps;\n}\n\nfunction astOf(ast: e.AST | e.ASTWithSource): e.AST {\n return ast instanceof e.ASTWithSource ? ast.ast : ast;\n}\n\n/**\n * Process all of the local references on an element-like structure in the template AST and\n * convert them to their IR representation.\n */\nfunction ingestReferences(op: ir.ElementOpBase, element: t.Element | t.Template): void {\n assertIsArray(op.localRefs);\n for (const {name, value} of element.references) {\n op.localRefs.push({\n name,\n target: value,\n });\n }\n}\n\n/**\n * Assert that the given value is an array.\n */\nfunction assertIsArray(value: any): asserts value is Array {\n if (!Array.isArray(value)) {\n throw new Error(`AssertionError: expected an array`);\n }\n}\n\n/**\n * Creates an absolute `ParseSourceSpan` from the relative `ParseSpan`.\n *\n * `ParseSpan` objects are relative to the start of the expression.\n * This method converts these to full `ParseSourceSpan` objects that\n * show where the span is within the overall source file.\n *\n * @param span the relative span to convert.\n * @param baseSourceSpan a span corresponding to the base of the expression tree.\n * @returns a `ParseSourceSpan` for the given span or null if no `baseSourceSpan` was provided.\n */\nfunction convertSourceSpan(\n span: e.ParseSpan,\n baseSourceSpan: ParseSourceSpan | null,\n): ParseSourceSpan | null {\n if (baseSourceSpan === null) {\n return null;\n }\n const start = baseSourceSpan.start.moveBy(span.start);\n const end = baseSourceSpan.start.moveBy(span.end);\n const fullStart = baseSourceSpan.fullStart.moveBy(span.start);\n return new ParseSourceSpan(start, end, fullStart);\n}\n\n/**\n * With the directive-based control flow users were able to conditionally project content using\n * the `*` syntax. E.g. `
` will be projected into\n * ``, because the attributes and tag name from the `div` are\n * copied to the template via the template creation instruction. With `@if` and `@for` that is\n * not the case, because the conditional is placed *around* elements, rather than *on* them.\n * The result is that content projection won't work in the same way if a user converts from\n * `*ngIf` to `@if`.\n *\n * This function aims to cover the most common case by doing the same copying when a control flow\n * node has *one and only one* root element or template node.\n *\n * This approach comes with some caveats:\n * 1. As soon as any other node is added to the root, the copying behavior won't work anymore.\n * A diagnostic will be added to flag cases like this and to explain how to work around it.\n * 2. If `preserveWhitespaces` is enabled, it's very likely that indentation will break this\n * workaround, because it'll include an additional text node as the first child. We can work\n * around it here, but in a discussion it was decided not to, because the user explicitly opted\n * into preserving the whitespace and we would have to drop it from the generated code.\n * The diagnostic mentioned point in #1 will flag such cases to users.\n *\n * @returns Tag name to be used for the control flow template.\n */\nfunction ingestControlFlowInsertionPoint(\n unit: ViewCompilationUnit,\n xref: ir.XrefId,\n node: t.IfBlockBranch | t.SwitchBlockCase | t.ForLoopBlock | t.ForLoopBlockEmpty,\n): string | null {\n let root: t.Element | t.Template | null = null;\n\n for (const child of node.children) {\n // Skip over comment nodes and @let declarations since\n // it doesn't matter where they end up in the DOM.\n if (child instanceof t.Comment || child instanceof t.LetDeclaration) {\n continue;\n }\n\n // We can only infer the tag name/attributes if there's a single root node.\n if (root !== null) {\n return null;\n }\n\n // Root nodes can only elements or templates with a tag name (e.g. `
`).\n if (child instanceof t.Element || (child instanceof t.Template && child.tagName !== null)) {\n root = child;\n } else {\n return null;\n }\n }\n\n // If we've found a single root node, its tag name and attributes can be\n // copied to the surrounding template to be used for content projection.\n if (root !== null) {\n // Collect the static attributes for content projection purposes.\n for (const attr of root.attributes) {\n const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);\n unit.update.push(\n ir.createBindingOp(\n xref,\n ir.BindingKind.Attribute,\n attr.name,\n o.literal(attr.value),\n null,\n securityContext,\n true,\n false,\n null,\n asMessage(attr.i18n),\n attr.sourceSpan,\n ),\n );\n }\n\n // Also collect the inputs since they participate in content projection as well.\n // Note that TDB used to collect the outputs as well, but it wasn't passing them into\n // the template instruction. Here we just don't collect them.\n for (const attr of root.inputs) {\n if (attr.type !== e.BindingType.Animation && attr.type !== e.BindingType.Attribute) {\n const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);\n unit.create.push(\n ir.createExtractedAttributeOp(\n xref,\n ir.BindingKind.Property,\n null,\n attr.name,\n null,\n null,\n null,\n securityContext,\n ),\n );\n }\n }\n\n const tagName = root instanceof t.Element ? root.name : root.tagName;\n\n // Don't pass along `ng-template` tag name since it enables directive matching.\n return tagName === NG_TEMPLATE_TAG_NAME ? null : tagName;\n }\n\n return null;\n}\n", "/*!\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Whether to produce instructions that will attach the source location to each DOM node.\n *\n * !!!Important!!! at the time of writing this flag isn't exposed externally, but internal debug\n * tools enable it via a local change. Any modifications to this flag need to update the\n * internal tooling as well.\n */\nlet ENABLE_TEMPLATE_SOURCE_LOCATIONS = false;\n\n/**\n * Utility function to enable source locations. Intended to be used **only** inside unit tests.\n */\nexport function setEnableTemplateSourceLocations(value: boolean): void {\n ENABLE_TEMPLATE_SOURCE_LOCATIONS = value;\n}\n\n/** Gets whether template source locations are enabled. */\nexport function getTemplateSourceLocationsEnabled(): boolean {\n return ENABLE_TEMPLATE_SOURCE_LOCATIONS;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ConstantPool} from '../../constant_pool';\nimport * as core from '../../core';\nimport * as o from '../../output/output_ast';\nimport {Identifiers as R3} from '../r3_identifiers';\nimport {ForwardRefHandling} from '../util';\n\nimport {R3QueryMetadata} from './api';\nimport {CONTEXT_NAME, RENDER_FLAGS, TEMPORARY_NAME, temporaryAllocator} from './util';\n\n// if (rf & flags) { .. }\nfunction renderFlagCheckIfStmt(flags: core.RenderFlags, statements: o.Statement[]): o.IfStmt {\n return o.ifStmt(o.variable(RENDER_FLAGS).bitwiseAnd(o.literal(flags), null, false), statements);\n}\n\n/**\n * A set of flags to be used with Queries.\n *\n * NOTE: Ensure changes here are in sync with `packages/core/src/render3/interfaces/query.ts`\n */\nexport const enum QueryFlags {\n /**\n * No flags\n */\n none = 0b0000,\n\n /**\n * Whether or not the query should descend into children.\n */\n descendants = 0b0001,\n\n /**\n * The query can be computed statically and hence can be assigned eagerly.\n *\n * NOTE: Backwards compatibility with ViewEngine.\n */\n isStatic = 0b0010,\n\n /**\n * If the `QueryList` should fire change event only if actual change to query was computed (vs old\n * behavior where the change was fired whenever the query was recomputed, even if the recomputed\n * query resulted in the same list.)\n */\n emitDistinctChangesOnly = 0b0100,\n}\n\n/**\n * Translates query flags into `TQueryFlags` type in\n * packages/core/src/render3/interfaces/query.ts\n * @param query\n */\nfunction toQueryFlags(query: R3QueryMetadata): number {\n return (\n (query.descendants ? QueryFlags.descendants : QueryFlags.none) |\n (query.static ? QueryFlags.isStatic : QueryFlags.none) |\n (query.emitDistinctChangesOnly ? QueryFlags.emitDistinctChangesOnly : QueryFlags.none)\n );\n}\n\nexport function getQueryPredicate(\n query: R3QueryMetadata,\n constantPool: ConstantPool,\n): o.Expression {\n if (Array.isArray(query.predicate)) {\n let predicate: o.Expression[] = [];\n query.predicate.forEach((selector: string): void => {\n // Each item in predicates array may contain strings with comma-separated refs\n // (for ex. 'ref, ref1, ..., refN'), thus we extract individual refs and store them\n // as separate array entities\n const selectors = selector.split(',').map((token) => o.literal(token.trim()));\n predicate.push(...selectors);\n });\n return constantPool.getConstLiteral(o.literalArr(predicate), true);\n } else {\n // The original predicate may have been wrapped in a `forwardRef()` call.\n switch (query.predicate.forwardRef) {\n case ForwardRefHandling.None:\n case ForwardRefHandling.Unwrapped:\n return query.predicate.expression;\n case ForwardRefHandling.Wrapped:\n return o.importExpr(R3.resolveForwardRef).callFn([query.predicate.expression]);\n }\n }\n}\n\nexport function createQueryCreateCall(\n query: R3QueryMetadata,\n constantPool: ConstantPool,\n queryTypeFns: {signalBased: o.ExternalReference; nonSignal: o.ExternalReference},\n prependParams?: o.Expression[],\n): o.InvokeFunctionExpr {\n const parameters: o.Expression[] = [];\n if (prependParams !== undefined) {\n parameters.push(...prependParams);\n }\n if (query.isSignal) {\n parameters.push(new o.ReadPropExpr(o.variable(CONTEXT_NAME), query.propertyName));\n }\n parameters.push(getQueryPredicate(query, constantPool), o.literal(toQueryFlags(query)));\n if (query.read) {\n parameters.push(query.read);\n }\n\n const queryCreateFn = query.isSignal ? queryTypeFns.signalBased : queryTypeFns.nonSignal;\n return o.importExpr(queryCreateFn).callFn(parameters);\n}\n\nconst queryAdvancePlaceholder = Symbol('queryAdvancePlaceholder');\n\n/**\n * Collapses query advance placeholders in a list of statements.\n *\n * This allows for less generated code because multiple sibling query advance\n * statements can be collapsed into a single call with the count as argument.\n *\n * e.g.\n *\n * ```ts\n * bla();\n * queryAdvance();\n * queryAdvance();\n * bla();\n * ```\n *\n * --> will turn into\n *\n * ```ts\n * bla();\n * queryAdvance(2);\n * bla();\n * ```\n */\nfunction collapseAdvanceStatements(\n statements: (o.Statement | typeof queryAdvancePlaceholder)[],\n): o.Statement[] {\n const result: o.Statement[] = [];\n let advanceCollapseCount = 0;\n const flushAdvanceCount = () => {\n if (advanceCollapseCount > 0) {\n result.unshift(\n o\n .importExpr(R3.queryAdvance)\n .callFn(advanceCollapseCount === 1 ? [] : [o.literal(advanceCollapseCount)])\n .toStmt(),\n );\n advanceCollapseCount = 0;\n }\n };\n\n // Iterate through statements in reverse and collapse advance placeholders.\n for (let i = statements.length - 1; i >= 0; i--) {\n const st = statements[i];\n if (st === queryAdvancePlaceholder) {\n advanceCollapseCount++;\n } else {\n flushAdvanceCount();\n result.unshift(st);\n }\n }\n flushAdvanceCount();\n return result;\n}\n\n// Define and update any view queries\nexport function createViewQueriesFunction(\n viewQueries: R3QueryMetadata[],\n constantPool: ConstantPool,\n name?: string,\n): o.Expression {\n const createStatements: o.Statement[] = [];\n const updateStatements: (o.Statement | typeof queryAdvancePlaceholder)[] = [];\n const tempAllocator = temporaryAllocator((st) => updateStatements.push(st), TEMPORARY_NAME);\n\n viewQueries.forEach((query: R3QueryMetadata) => {\n // creation call, e.g. r3.viewQuery(somePredicate, true) or\n // r3.viewQuerySignal(ctx.prop, somePredicate, true);\n const queryDefinitionCall = createQueryCreateCall(query, constantPool, {\n signalBased: R3.viewQuerySignal,\n nonSignal: R3.viewQuery,\n });\n createStatements.push(queryDefinitionCall.toStmt());\n\n // Signal queries update lazily and we just advance the index.\n if (query.isSignal) {\n updateStatements.push(queryAdvancePlaceholder);\n return;\n }\n\n // update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp));\n const temporary = tempAllocator();\n const getQueryList = o.importExpr(R3.loadQuery).callFn([]);\n const refresh = o.importExpr(R3.queryRefresh).callFn([temporary.set(getQueryList)]);\n const updateDirective = o\n .variable(CONTEXT_NAME)\n .prop(query.propertyName)\n .set(query.first ? temporary.prop('first') : temporary);\n updateStatements.push(refresh.and(updateDirective).toStmt());\n });\n\n const viewQueryFnName = name ? `${name}_Query` : null;\n return o.fn(\n [new o.FnParam(RENDER_FLAGS, o.NUMBER_TYPE), new o.FnParam(CONTEXT_NAME, null)],\n [\n renderFlagCheckIfStmt(core.RenderFlags.Create, createStatements),\n renderFlagCheckIfStmt(core.RenderFlags.Update, collapseAdvanceStatements(updateStatements)),\n ],\n o.INFERRED_TYPE,\n null,\n viewQueryFnName,\n );\n}\n\n// Define and update any content queries\nexport function createContentQueriesFunction(\n queries: R3QueryMetadata[],\n constantPool: ConstantPool,\n name?: string,\n): o.Expression {\n const createStatements: o.Statement[] = [];\n const updateStatements: (o.Statement | typeof queryAdvancePlaceholder)[] = [];\n const tempAllocator = temporaryAllocator((st) => updateStatements.push(st), TEMPORARY_NAME);\n\n for (const query of queries) {\n // creation, e.g. r3.contentQuery(dirIndex, somePredicate, true, null) or\n // r3.contentQuerySignal(dirIndex, propName, somePredicate, , ).\n createStatements.push(\n createQueryCreateCall(\n query,\n constantPool,\n {nonSignal: R3.contentQuery, signalBased: R3.contentQuerySignal},\n /* prependParams */ [o.variable('dirIndex')],\n ).toStmt(),\n );\n\n // Signal queries update lazily and we just advance the index.\n if (query.isSignal) {\n updateStatements.push(queryAdvancePlaceholder);\n continue;\n }\n\n // update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp));\n const temporary = tempAllocator();\n const getQueryList = o.importExpr(R3.loadQuery).callFn([]);\n const refresh = o.importExpr(R3.queryRefresh).callFn([temporary.set(getQueryList)]);\n const updateDirective = o\n .variable(CONTEXT_NAME)\n .prop(query.propertyName)\n .set(query.first ? temporary.prop('first') : temporary);\n updateStatements.push(refresh.and(updateDirective).toStmt());\n }\n\n const contentQueriesFnName = name ? `${name}_ContentQueries` : null;\n return o.fn(\n [\n new o.FnParam(RENDER_FLAGS, o.NUMBER_TYPE),\n new o.FnParam(CONTEXT_NAME, null),\n new o.FnParam('dirIndex', null),\n ],\n [\n renderFlagCheckIfStmt(core.RenderFlags.Create, createStatements),\n renderFlagCheckIfStmt(core.RenderFlags.Update, collapseAdvanceStatements(updateStatements)),\n ],\n o.INFERRED_TYPE,\n null,\n contentQueriesFnName,\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {getHtmlTagDefinition} from './html_tags';\nimport {TokenizeOptions} from './lexer';\nimport {Parser, ParseTreeResult} from './parser';\n\nexport class HtmlParser extends Parser {\n constructor() {\n super(getHtmlTagDefinition);\n }\n\n override parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult {\n return super.parse(source, url, options);\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {SecurityContext} from '../core';\nimport {\n AbsoluteSourceSpan,\n AST,\n ASTWithSource,\n BindingPipe,\n BindingType,\n BoundElementProperty,\n Call,\n EmptyExpr,\n ImplicitReceiver,\n KeyedRead,\n NonNullAssert,\n ParsedEvent,\n ParsedEventType,\n ParsedProperty,\n ParsedPropertyType,\n ParsedVariable,\n ParserError,\n PropertyRead,\n RecursiveAstVisitor,\n TemplateBinding,\n ThisReceiver,\n VariableBinding,\n} from '../expression_parser/ast';\nimport {Parser} from '../expression_parser/parser';\nimport {InterpolationConfig} from '../ml_parser/defaults';\nimport {mergeNsAndName, splitNsName} from '../ml_parser/tags';\nimport {InterpolatedAttributeToken, InterpolatedTextToken} from '../ml_parser/tokens';\nimport {ParseError, ParseErrorLevel, ParseSourceSpan} from '../parse_util';\nimport {ElementSchemaRegistry} from '../schema/element_schema_registry';\nimport {CssSelector} from '../selector';\nimport {splitAtColon, splitAtPeriod} from '../util';\nimport {MATH_ML_NAMESPACE, SVG_NAMESPACE} from '../template/pipeline/src/namespaces';\n\nconst PROPERTY_PARTS_SEPARATOR = '.';\nconst ATTRIBUTE_PREFIX = 'attr';\nconst CLASS_PREFIX = 'class';\nconst STYLE_PREFIX = 'style';\nconst TEMPLATE_ATTR_PREFIX = '*';\nconst ANIMATE_PROP_PREFIX = 'animate-';\n\nexport interface HostProperties {\n [key: string]: string;\n}\n\nexport interface HostListeners {\n [key: string]: string;\n}\n\n/**\n * Parses bindings in templates and in the directive host area.\n */\nexport class BindingParser {\n constructor(\n private _exprParser: Parser,\n private _interpolationConfig: InterpolationConfig,\n private _schemaRegistry: ElementSchemaRegistry,\n public errors: ParseError[],\n ) {}\n\n get interpolationConfig(): InterpolationConfig {\n return this._interpolationConfig;\n }\n\n createBoundHostProperties(\n properties: HostProperties,\n sourceSpan: ParseSourceSpan,\n ): ParsedProperty[] | null {\n const boundProps: ParsedProperty[] = [];\n for (const propName of Object.keys(properties)) {\n const expression = properties[propName];\n if (typeof expression === 'string') {\n this.parsePropertyBinding(\n propName,\n expression,\n true,\n false,\n sourceSpan,\n sourceSpan.start.offset,\n undefined,\n [],\n // Use the `sourceSpan` for `keySpan`. This isn't really accurate, but neither is the\n // sourceSpan, as it represents the sourceSpan of the host itself rather than the\n // source of the host binding (which doesn't exist in the template). Regardless,\n // neither of these values are used in Ivy but are only here to satisfy the function\n // signature. This should likely be refactored in the future so that `sourceSpan`\n // isn't being used inaccurately.\n boundProps,\n sourceSpan,\n );\n } else {\n this._reportError(\n `Value of the host property binding \"${propName}\" needs to be a string representing an expression but got \"${expression}\" (${typeof expression})`,\n sourceSpan,\n );\n }\n }\n return boundProps;\n }\n\n createDirectiveHostEventAsts(\n hostListeners: HostListeners,\n sourceSpan: ParseSourceSpan,\n ): ParsedEvent[] | null {\n const targetEvents: ParsedEvent[] = [];\n for (const propName of Object.keys(hostListeners)) {\n const expression = hostListeners[propName];\n if (typeof expression === 'string') {\n // Use the `sourceSpan` for `keySpan` and `handlerSpan`. This isn't really accurate, but\n // neither is the `sourceSpan`, as it represents the `sourceSpan` of the host itself\n // rather than the source of the host binding (which doesn't exist in the template).\n // Regardless, neither of these values are used in Ivy but are only here to satisfy the\n // function signature. This should likely be refactored in the future so that `sourceSpan`\n // isn't being used inaccurately.\n this.parseEvent(\n propName,\n expression,\n /* isAssignmentEvent */ false,\n sourceSpan,\n sourceSpan,\n [],\n targetEvents,\n sourceSpan,\n );\n } else {\n this._reportError(\n `Value of the host listener \"${propName}\" needs to be a string representing an expression but got \"${expression}\" (${typeof expression})`,\n sourceSpan,\n );\n }\n }\n return targetEvents;\n }\n\n parseInterpolation(\n value: string,\n sourceSpan: ParseSourceSpan,\n interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null,\n ): ASTWithSource {\n const sourceInfo = sourceSpan.start.toString();\n const absoluteOffset = sourceSpan.fullStart.offset;\n\n try {\n const ast = this._exprParser.parseInterpolation(\n value,\n sourceInfo,\n absoluteOffset,\n interpolatedTokens,\n this._interpolationConfig,\n )!;\n if (ast) this._reportExpressionParserErrors(ast.errors, sourceSpan);\n return ast;\n } catch (e) {\n this._reportError(`${e}`, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);\n }\n }\n\n /**\n * Similar to `parseInterpolation`, but treats the provided string as a single expression\n * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`).\n * This is used for parsing the switch expression in ICUs.\n */\n parseInterpolationExpression(expression: string, sourceSpan: ParseSourceSpan): ASTWithSource {\n const sourceInfo = sourceSpan.start.toString();\n const absoluteOffset = sourceSpan.start.offset;\n\n try {\n const ast = this._exprParser.parseInterpolationExpression(\n expression,\n sourceInfo,\n absoluteOffset,\n );\n if (ast) this._reportExpressionParserErrors(ast.errors, sourceSpan);\n return ast;\n } catch (e) {\n this._reportError(`${e}`, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);\n }\n }\n\n /**\n * Parses the bindings in a microsyntax expression, and converts them to\n * `ParsedProperty` or `ParsedVariable`.\n *\n * @param tplKey template binding name\n * @param tplValue template binding value\n * @param sourceSpan span of template binding relative to entire the template\n * @param absoluteValueOffset start of the tplValue relative to the entire template\n * @param targetMatchableAttrs potential attributes to match in the template\n * @param targetProps target property bindings in the template\n * @param targetVars target variables in the template\n */\n parseInlineTemplateBinding(\n tplKey: string,\n tplValue: string,\n sourceSpan: ParseSourceSpan,\n absoluteValueOffset: number,\n targetMatchableAttrs: string[][],\n targetProps: ParsedProperty[],\n targetVars: ParsedVariable[],\n isIvyAst: boolean,\n ) {\n const absoluteKeyOffset = sourceSpan.start.offset + TEMPLATE_ATTR_PREFIX.length;\n const bindings = this._parseTemplateBindings(\n tplKey,\n tplValue,\n sourceSpan,\n absoluteKeyOffset,\n absoluteValueOffset,\n );\n\n for (const binding of bindings) {\n // sourceSpan is for the entire HTML attribute. bindingSpan is for a particular\n // binding within the microsyntax expression so it's more narrow than sourceSpan.\n const bindingSpan = moveParseSourceSpan(sourceSpan, binding.sourceSpan);\n const key = binding.key.source;\n const keySpan = moveParseSourceSpan(sourceSpan, binding.key.span);\n if (binding instanceof VariableBinding) {\n const value = binding.value ? binding.value.source : '$implicit';\n const valueSpan = binding.value\n ? moveParseSourceSpan(sourceSpan, binding.value.span)\n : undefined;\n targetVars.push(new ParsedVariable(key, value, bindingSpan, keySpan, valueSpan));\n } else if (binding.value) {\n const srcSpan = isIvyAst ? bindingSpan : sourceSpan;\n const valueSpan = moveParseSourceSpan(sourceSpan, binding.value.ast.sourceSpan);\n this._parsePropertyAst(\n key,\n binding.value,\n false,\n srcSpan,\n keySpan,\n valueSpan,\n targetMatchableAttrs,\n targetProps,\n );\n } else {\n targetMatchableAttrs.push([key, '' /* value */]);\n // Since this is a literal attribute with no RHS, source span should be\n // just the key span.\n this.parseLiteralAttr(\n key,\n null /* value */,\n keySpan,\n absoluteValueOffset,\n undefined /* valueSpan */,\n targetMatchableAttrs,\n targetProps,\n keySpan,\n );\n }\n }\n }\n\n /**\n * Parses the bindings in a microsyntax expression, e.g.\n * ```html\n * \n * ```\n *\n * @param tplKey template binding name\n * @param tplValue template binding value\n * @param sourceSpan span of template binding relative to entire the template\n * @param absoluteKeyOffset start of the `tplKey`\n * @param absoluteValueOffset start of the `tplValue`\n */\n private _parseTemplateBindings(\n tplKey: string,\n tplValue: string,\n sourceSpan: ParseSourceSpan,\n absoluteKeyOffset: number,\n absoluteValueOffset: number,\n ): TemplateBinding[] {\n const sourceInfo = sourceSpan.start.toString();\n\n try {\n const bindingsResult = this._exprParser.parseTemplateBindings(\n tplKey,\n tplValue,\n sourceInfo,\n absoluteKeyOffset,\n absoluteValueOffset,\n );\n this._reportExpressionParserErrors(bindingsResult.errors, sourceSpan);\n bindingsResult.warnings.forEach((warning) => {\n this._reportError(warning, sourceSpan, ParseErrorLevel.WARNING);\n });\n return bindingsResult.templateBindings;\n } catch (e) {\n this._reportError(`${e}`, sourceSpan);\n return [];\n }\n }\n\n parseLiteralAttr(\n name: string,\n value: string | null,\n sourceSpan: ParseSourceSpan,\n absoluteOffset: number,\n valueSpan: ParseSourceSpan | undefined,\n targetMatchableAttrs: string[][],\n targetProps: ParsedProperty[],\n keySpan: ParseSourceSpan,\n ) {\n if (isAnimationLabel(name)) {\n name = name.substring(1);\n if (keySpan !== undefined) {\n keySpan = moveParseSourceSpan(\n keySpan,\n new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset),\n );\n }\n if (value) {\n this._reportError(\n `Assigning animation triggers via @prop=\"exp\" attributes with an expression is invalid.` +\n ` Use property bindings (e.g. [@prop]=\"exp\") or use an attribute without a value (e.g. @prop) instead.`,\n sourceSpan,\n ParseErrorLevel.ERROR,\n );\n }\n this._parseAnimation(\n name,\n value,\n sourceSpan,\n absoluteOffset,\n keySpan,\n valueSpan,\n targetMatchableAttrs,\n targetProps,\n );\n } else {\n targetProps.push(\n new ParsedProperty(\n name,\n this._exprParser.wrapLiteralPrimitive(value, '', absoluteOffset),\n ParsedPropertyType.LITERAL_ATTR,\n sourceSpan,\n keySpan,\n valueSpan,\n ),\n );\n }\n }\n\n parsePropertyBinding(\n name: string,\n expression: string,\n isHost: boolean,\n isPartOfAssignmentBinding: boolean,\n sourceSpan: ParseSourceSpan,\n absoluteOffset: number,\n valueSpan: ParseSourceSpan | undefined,\n targetMatchableAttrs: string[][],\n targetProps: ParsedProperty[],\n keySpan: ParseSourceSpan,\n ) {\n if (name.length === 0) {\n this._reportError(`Property name is missing in binding`, sourceSpan);\n }\n\n let isAnimationProp = false;\n if (name.startsWith(ANIMATE_PROP_PREFIX)) {\n isAnimationProp = true;\n name = name.substring(ANIMATE_PROP_PREFIX.length);\n if (keySpan !== undefined) {\n keySpan = moveParseSourceSpan(\n keySpan,\n new AbsoluteSourceSpan(\n keySpan.start.offset + ANIMATE_PROP_PREFIX.length,\n keySpan.end.offset,\n ),\n );\n }\n } else if (isAnimationLabel(name)) {\n isAnimationProp = true;\n name = name.substring(1);\n if (keySpan !== undefined) {\n keySpan = moveParseSourceSpan(\n keySpan,\n new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset),\n );\n }\n }\n\n if (isAnimationProp) {\n this._parseAnimation(\n name,\n expression,\n sourceSpan,\n absoluteOffset,\n keySpan,\n valueSpan,\n targetMatchableAttrs,\n targetProps,\n );\n } else {\n this._parsePropertyAst(\n name,\n this.parseBinding(expression, isHost, valueSpan || sourceSpan, absoluteOffset),\n isPartOfAssignmentBinding,\n sourceSpan,\n keySpan,\n valueSpan,\n targetMatchableAttrs,\n targetProps,\n );\n }\n }\n\n parsePropertyInterpolation(\n name: string,\n value: string,\n sourceSpan: ParseSourceSpan,\n valueSpan: ParseSourceSpan | undefined,\n targetMatchableAttrs: string[][],\n targetProps: ParsedProperty[],\n keySpan: ParseSourceSpan,\n interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null,\n ): boolean {\n const expr = this.parseInterpolation(value, valueSpan || sourceSpan, interpolatedTokens);\n if (expr) {\n this._parsePropertyAst(\n name,\n expr,\n false,\n sourceSpan,\n keySpan,\n valueSpan,\n targetMatchableAttrs,\n targetProps,\n );\n return true;\n }\n return false;\n }\n\n private _parsePropertyAst(\n name: string,\n ast: ASTWithSource,\n isPartOfAssignmentBinding: boolean,\n sourceSpan: ParseSourceSpan,\n keySpan: ParseSourceSpan,\n valueSpan: ParseSourceSpan | undefined,\n targetMatchableAttrs: string[][],\n targetProps: ParsedProperty[],\n ) {\n targetMatchableAttrs.push([name, ast.source!]);\n targetProps.push(\n new ParsedProperty(\n name,\n ast,\n isPartOfAssignmentBinding ? ParsedPropertyType.TWO_WAY : ParsedPropertyType.DEFAULT,\n sourceSpan,\n keySpan,\n valueSpan,\n ),\n );\n }\n\n private _parseAnimation(\n name: string,\n expression: string | null,\n sourceSpan: ParseSourceSpan,\n absoluteOffset: number,\n keySpan: ParseSourceSpan,\n valueSpan: ParseSourceSpan | undefined,\n targetMatchableAttrs: string[][],\n targetProps: ParsedProperty[],\n ) {\n if (name.length === 0) {\n this._reportError('Animation trigger is missing', sourceSpan);\n }\n\n // This will occur when a @trigger is not paired with an expression.\n // For animations it is valid to not have an expression since */void\n // states will be applied by angular when the element is attached/detached\n const ast = this.parseBinding(\n expression || 'undefined',\n false,\n valueSpan || sourceSpan,\n absoluteOffset,\n );\n targetMatchableAttrs.push([name, ast.source!]);\n targetProps.push(\n new ParsedProperty(name, ast, ParsedPropertyType.ANIMATION, sourceSpan, keySpan, valueSpan),\n );\n }\n\n parseBinding(\n value: string,\n isHostBinding: boolean,\n sourceSpan: ParseSourceSpan,\n absoluteOffset: number,\n ): ASTWithSource {\n const sourceInfo = ((sourceSpan && sourceSpan.start) || '(unknown)').toString();\n\n try {\n const ast = isHostBinding\n ? this._exprParser.parseSimpleBinding(\n value,\n sourceInfo,\n absoluteOffset,\n this._interpolationConfig,\n )\n : this._exprParser.parseBinding(\n value,\n sourceInfo,\n absoluteOffset,\n this._interpolationConfig,\n );\n if (ast) this._reportExpressionParserErrors(ast.errors, sourceSpan);\n return ast;\n } catch (e) {\n this._reportError(`${e}`, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);\n }\n }\n\n createBoundElementProperty(\n elementSelector: string,\n boundProp: ParsedProperty,\n skipValidation: boolean = false,\n mapPropertyName: boolean = true,\n ): BoundElementProperty {\n if (boundProp.isAnimation) {\n return new BoundElementProperty(\n boundProp.name,\n BindingType.Animation,\n SecurityContext.NONE,\n boundProp.expression,\n null,\n boundProp.sourceSpan,\n boundProp.keySpan,\n boundProp.valueSpan,\n );\n }\n\n let unit: string | null = null;\n let bindingType: BindingType = undefined!;\n let boundPropertyName: string | null = null;\n const parts = boundProp.name.split(PROPERTY_PARTS_SEPARATOR);\n let securityContexts: SecurityContext[] = undefined!;\n\n // Check for special cases (prefix style, attr, class)\n if (parts.length > 1) {\n if (parts[0] == ATTRIBUTE_PREFIX) {\n boundPropertyName = parts.slice(1).join(PROPERTY_PARTS_SEPARATOR);\n if (!skipValidation) {\n this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, true);\n }\n securityContexts = calcPossibleSecurityContexts(\n this._schemaRegistry,\n elementSelector,\n boundPropertyName,\n true,\n );\n\n const nsSeparatorIdx = boundPropertyName.indexOf(':');\n if (nsSeparatorIdx > -1) {\n const ns = boundPropertyName.substring(0, nsSeparatorIdx);\n const name = boundPropertyName.substring(nsSeparatorIdx + 1);\n boundPropertyName = mergeNsAndName(ns, name);\n }\n\n bindingType = BindingType.Attribute;\n } else if (parts[0] == CLASS_PREFIX) {\n boundPropertyName = parts[1];\n bindingType = BindingType.Class;\n securityContexts = [SecurityContext.NONE];\n } else if (parts[0] == STYLE_PREFIX) {\n unit = parts.length > 2 ? parts[2] : null;\n boundPropertyName = parts[1];\n bindingType = BindingType.Style;\n securityContexts = [SecurityContext.STYLE];\n }\n }\n\n // If not a special case, use the full property name\n if (boundPropertyName === null) {\n const mappedPropName = this._schemaRegistry.getMappedPropName(boundProp.name);\n boundPropertyName = mapPropertyName ? mappedPropName : boundProp.name;\n securityContexts = calcPossibleSecurityContexts(\n this._schemaRegistry,\n elementSelector,\n mappedPropName,\n false,\n );\n bindingType =\n boundProp.type === ParsedPropertyType.TWO_WAY ? BindingType.TwoWay : BindingType.Property;\n if (!skipValidation) {\n this._validatePropertyOrAttributeName(mappedPropName, boundProp.sourceSpan, false);\n }\n }\n\n return new BoundElementProperty(\n boundPropertyName,\n bindingType,\n securityContexts[0],\n boundProp.expression,\n unit,\n boundProp.sourceSpan,\n boundProp.keySpan,\n boundProp.valueSpan,\n );\n }\n\n // TODO: keySpan should be required but was made optional to avoid changing VE parser.\n parseEvent(\n name: string,\n expression: string,\n isAssignmentEvent: boolean,\n sourceSpan: ParseSourceSpan,\n handlerSpan: ParseSourceSpan,\n targetMatchableAttrs: string[][],\n targetEvents: ParsedEvent[],\n keySpan: ParseSourceSpan,\n ) {\n if (name.length === 0) {\n this._reportError(`Event name is missing in binding`, sourceSpan);\n }\n\n if (isAnimationLabel(name)) {\n name = name.slice(1);\n if (keySpan !== undefined) {\n keySpan = moveParseSourceSpan(\n keySpan,\n new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset),\n );\n }\n this._parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan);\n } else {\n this._parseRegularEvent(\n name,\n expression,\n isAssignmentEvent,\n sourceSpan,\n handlerSpan,\n targetMatchableAttrs,\n targetEvents,\n keySpan,\n );\n }\n }\n\n calcPossibleSecurityContexts(\n selector: string,\n propName: string,\n isAttribute: boolean,\n ): SecurityContext[] {\n const prop = this._schemaRegistry.getMappedPropName(propName);\n return calcPossibleSecurityContexts(this._schemaRegistry, selector, prop, isAttribute);\n }\n\n private _parseAnimationEvent(\n name: string,\n expression: string,\n sourceSpan: ParseSourceSpan,\n handlerSpan: ParseSourceSpan,\n targetEvents: ParsedEvent[],\n keySpan: ParseSourceSpan,\n ) {\n const matches = splitAtPeriod(name, [name, '']);\n const eventName = matches[0];\n const phase = matches[1].toLowerCase();\n const ast = this._parseAction(expression, handlerSpan);\n targetEvents.push(\n new ParsedEvent(\n eventName,\n phase,\n ParsedEventType.Animation,\n ast,\n sourceSpan,\n handlerSpan,\n keySpan,\n ),\n );\n\n if (eventName.length === 0) {\n this._reportError(`Animation event name is missing in binding`, sourceSpan);\n }\n if (phase) {\n if (phase !== 'start' && phase !== 'done') {\n this._reportError(\n `The provided animation output phase value \"${phase}\" for \"@${eventName}\" is not supported (use start or done)`,\n sourceSpan,\n );\n }\n } else {\n this._reportError(\n `The animation trigger output event (@${eventName}) is missing its phase value name (start or done are currently supported)`,\n sourceSpan,\n );\n }\n }\n\n private _parseRegularEvent(\n name: string,\n expression: string,\n isAssignmentEvent: boolean,\n sourceSpan: ParseSourceSpan,\n handlerSpan: ParseSourceSpan,\n targetMatchableAttrs: string[][],\n targetEvents: ParsedEvent[],\n keySpan: ParseSourceSpan,\n ): void {\n // long format: 'target: eventName'\n const [target, eventName] = splitAtColon(name, [null!, name]);\n const prevErrorCount = this.errors.length;\n const ast = this._parseAction(expression, handlerSpan);\n const isValid = this.errors.length === prevErrorCount;\n targetMatchableAttrs.push([name!, ast.source!]);\n\n // Don't try to validate assignment events if there were other\n // parsing errors to avoid adding more noise to the error logs.\n if (isAssignmentEvent && isValid && !this._isAllowedAssignmentEvent(ast)) {\n this._reportError('Unsupported expression in a two-way binding', sourceSpan);\n }\n\n targetEvents.push(\n new ParsedEvent(\n eventName,\n target,\n isAssignmentEvent ? ParsedEventType.TwoWay : ParsedEventType.Regular,\n ast,\n sourceSpan,\n handlerSpan,\n keySpan,\n ),\n );\n // Don't detect directives for event names for now,\n // so don't add the event name to the matchableAttrs\n }\n\n private _parseAction(value: string, sourceSpan: ParseSourceSpan): ASTWithSource {\n const sourceInfo = ((sourceSpan && sourceSpan.start) || '(unknown').toString();\n const absoluteOffset = sourceSpan && sourceSpan.start ? sourceSpan.start.offset : 0;\n\n try {\n const ast = this._exprParser.parseAction(\n value,\n sourceInfo,\n absoluteOffset,\n this._interpolationConfig,\n );\n if (ast) {\n this._reportExpressionParserErrors(ast.errors, sourceSpan);\n }\n if (!ast || ast.ast instanceof EmptyExpr) {\n this._reportError(`Empty expressions are not allowed`, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);\n }\n return ast;\n } catch (e) {\n this._reportError(`${e}`, sourceSpan);\n return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset);\n }\n }\n\n private _reportError(\n message: string,\n sourceSpan: ParseSourceSpan,\n level: ParseErrorLevel = ParseErrorLevel.ERROR,\n relatedError?: ParserError,\n ) {\n this.errors.push(new ParseError(sourceSpan, message, level, relatedError));\n }\n\n private _reportExpressionParserErrors(errors: ParserError[], sourceSpan: ParseSourceSpan) {\n for (const error of errors) {\n this._reportError(error.message, sourceSpan, undefined, error);\n }\n }\n\n /**\n * @param propName the name of the property / attribute\n * @param sourceSpan\n * @param isAttr true when binding to an attribute\n */\n private _validatePropertyOrAttributeName(\n propName: string,\n sourceSpan: ParseSourceSpan,\n isAttr: boolean,\n ): void {\n const report = isAttr\n ? this._schemaRegistry.validateAttribute(propName)\n : this._schemaRegistry.validateProperty(propName);\n if (report.error) {\n this._reportError(report.msg!, sourceSpan, ParseErrorLevel.ERROR);\n }\n }\n\n /**\n * Returns whether a parsed AST is allowed to be used within the event side of a two-way binding.\n * @param ast Parsed AST to be checked.\n */\n private _isAllowedAssignmentEvent(ast: AST): boolean {\n if (ast instanceof ASTWithSource) {\n return this._isAllowedAssignmentEvent(ast.ast);\n }\n\n if (ast instanceof NonNullAssert) {\n return this._isAllowedAssignmentEvent(ast.expression);\n }\n\n if (\n ast instanceof Call &&\n ast.args.length === 1 &&\n ast.receiver instanceof PropertyRead &&\n ast.receiver.name === '$any' &&\n ast.receiver.receiver instanceof ImplicitReceiver &&\n !(ast.receiver.receiver instanceof ThisReceiver)\n ) {\n return this._isAllowedAssignmentEvent(ast.args[0]);\n }\n\n if (ast instanceof PropertyRead || ast instanceof KeyedRead) {\n return true;\n }\n\n return false;\n }\n}\n\nexport class PipeCollector extends RecursiveAstVisitor {\n pipes = new Map();\n override visitPipe(ast: BindingPipe, context: any): any {\n this.pipes.set(ast.name, ast);\n ast.exp.visit(this);\n this.visitAll(ast.args, context);\n return null;\n }\n}\n\nfunction isAnimationLabel(name: string): boolean {\n return name[0] == '@';\n}\n\nexport function calcPossibleSecurityContexts(\n registry: ElementSchemaRegistry,\n selector: string,\n propName: string,\n isAttribute: boolean,\n): SecurityContext[] {\n let ctxs: SecurityContext[];\n const [namespaceKey, baseSelector] = selector ? splitNsName(selector, false) : [null, selector];\n const nameToContext = (elName: string) => {\n const [nsStr, name] = splitNsName(elName, false);\n const ns = nsStr ?? namespaceKey;\n const fullName = ns ? `:${ns}:${name}` : name;\n return registry.securityContext(fullName, propName, isAttribute);\n };\n\n const allKnownElements = registry.allKnownElementNames();\n if (baseSelector === null) {\n ctxs = allKnownElements.map(nameToContext);\n } else {\n ctxs = [];\n CssSelector.parse(baseSelector).forEach((selector) => {\n let elementNames = selector.element ? [selector.element] : allKnownElements;\n if (selector.element && !registry.hasElement(selector.element, [])) {\n const svgElement = `:${SVG_NAMESPACE}:${selector.element}`;\n const mathElement = `:${MATH_ML_NAMESPACE}:${selector.element}`;\n if (registry.hasElement(svgElement, [])) {\n elementNames = [svgElement];\n } else if (registry.hasElement(mathElement, [])) {\n elementNames = [mathElement];\n }\n }\n const notElementNames = new Set(\n selector.notSelectors\n .filter((selector) => selector.isElementSelector())\n .map((selector) => selector.element?.toLowerCase()),\n );\n const possibleElementNames = elementNames.filter((elName) => {\n const elNameLowerCase = elName.toLowerCase();\n return (\n !notElementNames.has(elNameLowerCase) &&\n !notElementNames.has(splitNsName(elNameLowerCase)[1])\n );\n });\n\n ctxs.push(...possibleElementNames.map(nameToContext));\n });\n }\n return ctxs.length === 0 ? [SecurityContext.NONE] : Array.from(new Set(ctxs)).sort();\n}\n\n/**\n * Compute a new ParseSourceSpan based off an original `sourceSpan` by using\n * absolute offsets from the specified `absoluteSpan`.\n *\n * @param sourceSpan original source span\n * @param absoluteSpan absolute source span to move to\n */\nfunction moveParseSourceSpan(\n sourceSpan: ParseSourceSpan,\n absoluteSpan: AbsoluteSourceSpan,\n): ParseSourceSpan {\n // The difference of two absolute offsets provide the relative offset\n const startDiff = absoluteSpan.start - sourceSpan.start.offset;\n const endDiff = absoluteSpan.end - sourceSpan.end.offset;\n return new ParseSourceSpan(\n sourceSpan.start.moveBy(startDiff),\n sourceSpan.end.moveBy(endDiff),\n sourceSpan.fullStart.moveBy(startDiff),\n sourceSpan.details,\n );\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n// Some of the code comes from WebComponents.JS\n// https://github.com/webcomponents/webcomponentsjs/blob/master/src/HTMLImports/path.js\n\nexport function isStyleUrlResolvable(url: string | null): url is string {\n if (url == null || url.length === 0 || url[0] == '/') return false;\n const schemeMatch = url.match(URL_WITH_SCHEMA_REGEXP);\n return schemeMatch === null || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset';\n}\n\nconst URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as html from '../ml_parser/ast';\nimport {isNgContent} from '../ml_parser/tags';\n\nconst NG_CONTENT_SELECT_ATTR = 'select';\nconst LINK_ELEMENT = 'link';\nconst LINK_STYLE_REL_ATTR = 'rel';\nconst LINK_STYLE_HREF_ATTR = 'href';\nconst LINK_STYLE_REL_VALUE = 'stylesheet';\nconst STYLE_ELEMENT = 'style';\nconst SCRIPT_ELEMENTS: ReadonlySet = new Set([':svg:script', 'script']);\nconst NG_NON_BINDABLE_ATTR = 'ngNonBindable';\nconst NG_PROJECT_AS = 'ngProjectAs';\n\nexport function preparseElement(ast: html.Element): PreparsedElement {\n let selectAttr: string | null = null;\n let hrefAttr: string | null = null;\n let relAttr: string | null = null;\n let nonBindable = false;\n let projectAs = '';\n\n for (const attr of ast.attrs) {\n const lcAttrName = attr.name.toLowerCase();\n if (lcAttrName == NG_CONTENT_SELECT_ATTR) {\n selectAttr = attr.value;\n } else if (lcAttrName == LINK_STYLE_HREF_ATTR) {\n hrefAttr = attr.value;\n } else if (lcAttrName == LINK_STYLE_REL_ATTR) {\n relAttr = attr.value;\n } else if (attr.name == NG_NON_BINDABLE_ATTR) {\n nonBindable = true;\n } else if (attr.name == NG_PROJECT_AS) {\n if (attr.value.length > 0) {\n projectAs = attr.value;\n }\n }\n }\n\n // Normalize selector to '*' if empty\n selectAttr ||= '*';\n\n const nodeName = ast.name.toLowerCase();\n let type = PreparsedElementType.OTHER;\n if (isNgContent(nodeName)) {\n type = PreparsedElementType.NG_CONTENT;\n } else if (STYLE_ELEMENT === nodeName) {\n type = PreparsedElementType.STYLE;\n } else if (SCRIPT_ELEMENTS.has(nodeName)) {\n type = PreparsedElementType.SCRIPT;\n } else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) {\n type = PreparsedElementType.STYLESHEET;\n }\n return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs);\n}\n\nexport enum PreparsedElementType {\n NG_CONTENT,\n STYLE,\n STYLESHEET,\n SCRIPT,\n OTHER,\n}\n\nexport class PreparsedElement {\n constructor(\n public type: PreparsedElementType,\n public selectAttr: string,\n public hrefAttr: string | null,\n public nonBindable: boolean,\n public projectAs: string,\n ) {}\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ASTWithSource, EmptyExpr} from '../expression_parser/ast';\nimport * as html from '../ml_parser/ast';\nimport {ParseError, ParseSourceSpan} from '../parse_util';\nimport {BindingParser} from '../template_parser/binding_parser';\n\nimport * as t from './r3_ast';\n\n/** Pattern for the expression in a for loop block. */\nconst FOR_LOOP_EXPRESSION_PATTERN = /^\\s*([0-9A-Za-z_$]*)\\s+of\\s+([\\S\\s]*)/;\n\n/** Pattern for the tracking expression in a for loop block. */\nconst FOR_LOOP_TRACK_PATTERN = /^track\\s+([\\S\\s]*)/;\n\n/** Pattern for the `as` expression in a conditional block. */\nconst CONDITIONAL_ALIAS_PATTERN = /^(as\\s+)(.*)/;\n\n/** Pattern used to identify an `else if` block. */\nconst ELSE_IF_PATTERN = /^else[^\\S\\r\\n]+if/;\n\n/** Pattern used to identify a `let` parameter. */\nconst FOR_LOOP_LET_PATTERN = /^let\\s+([\\S\\s]*)/;\n\n/** Pattern used to validate a JavaScript identifier. */\nconst IDENTIFIER_PATTERN = /^[$A-Z_][0-9A-Z_$]*$/i;\n\n/**\n * Pattern to group a string into leading whitespace, non whitespace, and trailing whitespace.\n * Useful for getting the variable name span when a span can contain leading and trailing space.\n */\nconst CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN = /(\\s*)(\\S+)(\\s*)/;\n\n/** Names of variables that are allowed to be used in the `let` expression of a `for` loop. */\nconst ALLOWED_FOR_LOOP_LET_VARIABLES = new Set([\n '$index',\n '$first',\n '$last',\n '$even',\n '$odd',\n '$count',\n]);\n\n/**\n * Predicate function that determines if a block with\n * a specific name cam be connected to a `for` block.\n */\nexport function isConnectedForLoopBlock(name: string): boolean {\n return name === 'empty';\n}\n\n/**\n * Predicate function that determines if a block with\n * a specific name cam be connected to an `if` block.\n */\nexport function isConnectedIfLoopBlock(name: string): boolean {\n return name === 'else' || ELSE_IF_PATTERN.test(name);\n}\n\n/** Creates an `if` loop block from an HTML AST node. */\nexport function createIfBlock(\n ast: html.Block,\n connectedBlocks: html.Block[],\n visitor: html.Visitor,\n bindingParser: BindingParser,\n): {node: t.IfBlock | null; errors: ParseError[]} {\n const errors: ParseError[] = validateIfConnectedBlocks(connectedBlocks);\n const branches: t.IfBlockBranch[] = [];\n const mainBlockParams = parseConditionalBlockParameters(ast, errors, bindingParser);\n\n if (mainBlockParams !== null) {\n branches.push(\n new t.IfBlockBranch(\n mainBlockParams.expression,\n html.visitAll(visitor, ast.children, ast.children),\n mainBlockParams.expressionAlias,\n ast.sourceSpan,\n ast.startSourceSpan,\n ast.endSourceSpan,\n ast.nameSpan,\n ast.i18n,\n ),\n );\n }\n\n for (const block of connectedBlocks) {\n if (ELSE_IF_PATTERN.test(block.name)) {\n const params = parseConditionalBlockParameters(block, errors, bindingParser);\n\n if (params !== null) {\n const children = html.visitAll(visitor, block.children, block.children);\n branches.push(\n new t.IfBlockBranch(\n params.expression,\n children,\n params.expressionAlias,\n block.sourceSpan,\n block.startSourceSpan,\n block.endSourceSpan,\n block.nameSpan,\n block.i18n,\n ),\n );\n }\n } else if (block.name === 'else') {\n const children = html.visitAll(visitor, block.children, block.children);\n branches.push(\n new t.IfBlockBranch(\n null,\n children,\n null,\n block.sourceSpan,\n block.startSourceSpan,\n block.endSourceSpan,\n block.nameSpan,\n block.i18n,\n ),\n );\n }\n }\n\n // The outer IfBlock should have a span that encapsulates all branches.\n const ifBlockStartSourceSpan =\n branches.length > 0 ? branches[0].startSourceSpan : ast.startSourceSpan;\n const ifBlockEndSourceSpan =\n branches.length > 0 ? branches[branches.length - 1].endSourceSpan : ast.endSourceSpan;\n\n let wholeSourceSpan = ast.sourceSpan;\n const lastBranch = branches[branches.length - 1];\n if (lastBranch !== undefined) {\n wholeSourceSpan = new ParseSourceSpan(ifBlockStartSourceSpan.start, lastBranch.sourceSpan.end);\n }\n\n return {\n node: new t.IfBlock(\n branches,\n wholeSourceSpan,\n ast.startSourceSpan,\n ifBlockEndSourceSpan,\n ast.nameSpan,\n ),\n errors,\n };\n}\n\n/** Creates a `for` loop block from an HTML AST node. */\nexport function createForLoop(\n ast: html.Block,\n connectedBlocks: html.Block[],\n visitor: html.Visitor,\n bindingParser: BindingParser,\n): {node: t.ForLoopBlock | null; errors: ParseError[]} {\n const errors: ParseError[] = [];\n const params = parseForLoopParameters(ast, errors, bindingParser);\n let node: t.ForLoopBlock | null = null;\n let empty: t.ForLoopBlockEmpty | null = null;\n\n for (const block of connectedBlocks) {\n if (block.name === 'empty') {\n if (empty !== null) {\n errors.push(new ParseError(block.sourceSpan, '@for loop can only have one @empty block'));\n } else if (block.parameters.length > 0) {\n errors.push(new ParseError(block.sourceSpan, '@empty block cannot have parameters'));\n } else {\n empty = new t.ForLoopBlockEmpty(\n html.visitAll(visitor, block.children, block.children),\n block.sourceSpan,\n block.startSourceSpan,\n block.endSourceSpan,\n block.nameSpan,\n block.i18n,\n );\n }\n } else {\n errors.push(new ParseError(block.sourceSpan, `Unrecognized @for loop block \"${block.name}\"`));\n }\n }\n\n if (params !== null) {\n if (params.trackBy === null) {\n // TODO: We should not fail here, and instead try to produce some AST for the language\n // service.\n errors.push(new ParseError(ast.startSourceSpan, '@for loop must have a \"track\" expression'));\n } else {\n // The `for` block has a main span that includes the `empty` branch. For only the span of the\n // main `for` body, use `mainSourceSpan`.\n const endSpan = empty?.endSourceSpan ?? ast.endSourceSpan;\n const sourceSpan = new ParseSourceSpan(\n ast.sourceSpan.start,\n endSpan?.end ?? ast.sourceSpan.end,\n );\n node = new t.ForLoopBlock(\n params.itemName,\n params.expression,\n params.trackBy.expression,\n params.trackBy.keywordSpan,\n params.context,\n html.visitAll(visitor, ast.children, ast.children),\n empty,\n sourceSpan,\n ast.sourceSpan,\n ast.startSourceSpan,\n endSpan,\n ast.nameSpan,\n ast.i18n,\n );\n }\n }\n\n return {node, errors};\n}\n\n/** Creates a switch block from an HTML AST node. */\nexport function createSwitchBlock(\n ast: html.Block,\n visitor: html.Visitor,\n bindingParser: BindingParser,\n): {node: t.SwitchBlock | null; errors: ParseError[]} {\n const errors = validateSwitchBlock(ast);\n const primaryExpression =\n ast.parameters.length > 0\n ? parseBlockParameterToBinding(ast.parameters[0], bindingParser)\n : bindingParser.parseBinding('', false, ast.sourceSpan, 0);\n const cases: t.SwitchBlockCase[] = [];\n const unknownBlocks: t.UnknownBlock[] = [];\n let defaultCase: t.SwitchBlockCase | null = null;\n\n // Here we assume that all the blocks are valid given that we validated them above.\n for (const node of ast.children) {\n if (!(node instanceof html.Block)) {\n continue;\n }\n\n if ((node.name !== 'case' || node.parameters.length === 0) && node.name !== 'default') {\n unknownBlocks.push(new t.UnknownBlock(node.name, node.sourceSpan, node.nameSpan));\n continue;\n }\n\n const expression =\n node.name === 'case' ? parseBlockParameterToBinding(node.parameters[0], bindingParser) : null;\n const ast = new t.SwitchBlockCase(\n expression,\n html.visitAll(visitor, node.children, node.children),\n node.sourceSpan,\n node.startSourceSpan,\n node.endSourceSpan,\n node.nameSpan,\n node.i18n,\n );\n\n if (expression === null) {\n defaultCase = ast;\n } else {\n cases.push(ast);\n }\n }\n\n // Ensure that the default case is last in the array.\n if (defaultCase !== null) {\n cases.push(defaultCase);\n }\n\n return {\n node: new t.SwitchBlock(\n primaryExpression,\n cases,\n unknownBlocks,\n ast.sourceSpan,\n ast.startSourceSpan,\n ast.endSourceSpan,\n ast.nameSpan,\n ),\n errors,\n };\n}\n\n/** Parses the parameters of a `for` loop block. */\nfunction parseForLoopParameters(\n block: html.Block,\n errors: ParseError[],\n bindingParser: BindingParser,\n) {\n if (block.parameters.length === 0) {\n errors.push(new ParseError(block.startSourceSpan, '@for loop does not have an expression'));\n return null;\n }\n\n const [expressionParam, ...secondaryParams] = block.parameters;\n const match = stripOptionalParentheses(expressionParam, errors)?.match(\n FOR_LOOP_EXPRESSION_PATTERN,\n );\n\n if (!match || match[2].trim().length === 0) {\n errors.push(\n new ParseError(\n expressionParam.sourceSpan,\n 'Cannot parse expression. @for loop expression must match the pattern \" of \"',\n ),\n );\n return null;\n }\n\n const [, itemName, rawExpression] = match;\n if (ALLOWED_FOR_LOOP_LET_VARIABLES.has(itemName)) {\n errors.push(\n new ParseError(\n expressionParam.sourceSpan,\n `@for loop item name cannot be one of ${Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES).join(\n ', ',\n )}.`,\n ),\n );\n }\n\n // `expressionParam.expression` contains the variable declaration and the expression of the\n // for...of statement, i.e. 'user of users' The variable of a ForOfStatement is _only_ the \"const\n // user\" part and does not include \"of x\".\n const variableName = expressionParam.expression.split(' ')[0];\n const variableSpan = new ParseSourceSpan(\n expressionParam.sourceSpan.start,\n expressionParam.sourceSpan.start.moveBy(variableName.length),\n );\n const result = {\n itemName: new t.Variable(itemName, '$implicit', variableSpan, variableSpan),\n trackBy: null as {expression: ASTWithSource; keywordSpan: ParseSourceSpan} | null,\n expression: parseBlockParameterToBinding(expressionParam, bindingParser, rawExpression),\n context: Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES, (variableName) => {\n // Give ambiently-available context variables empty spans at the end of\n // the start of the `for` block, since they are not explicitly defined.\n const emptySpanAfterForBlockStart = new ParseSourceSpan(\n block.startSourceSpan.end,\n block.startSourceSpan.end,\n );\n return new t.Variable(\n variableName,\n variableName,\n emptySpanAfterForBlockStart,\n emptySpanAfterForBlockStart,\n );\n }),\n };\n\n for (const param of secondaryParams) {\n const letMatch = param.expression.match(FOR_LOOP_LET_PATTERN);\n\n if (letMatch !== null) {\n const variablesSpan = new ParseSourceSpan(\n param.sourceSpan.start.moveBy(letMatch[0].length - letMatch[1].length),\n param.sourceSpan.end,\n );\n parseLetParameter(\n param.sourceSpan,\n letMatch[1],\n variablesSpan,\n itemName,\n result.context,\n errors,\n );\n continue;\n }\n\n const trackMatch = param.expression.match(FOR_LOOP_TRACK_PATTERN);\n\n if (trackMatch !== null) {\n if (result.trackBy !== null) {\n errors.push(\n new ParseError(param.sourceSpan, '@for loop can only have one \"track\" expression'),\n );\n } else {\n const expression = parseBlockParameterToBinding(param, bindingParser, trackMatch[1]);\n if (expression.ast instanceof EmptyExpr) {\n errors.push(\n new ParseError(block.startSourceSpan, '@for loop must have a \"track\" expression'),\n );\n }\n const keywordSpan = new ParseSourceSpan(\n param.sourceSpan.start,\n param.sourceSpan.start.moveBy('track'.length),\n );\n result.trackBy = {expression, keywordSpan};\n }\n continue;\n }\n\n errors.push(\n new ParseError(param.sourceSpan, `Unrecognized @for loop parameter \"${param.expression}\"`),\n );\n }\n\n return result;\n}\n\n/** Parses the `let` parameter of a `for` loop block. */\nfunction parseLetParameter(\n sourceSpan: ParseSourceSpan,\n expression: string,\n span: ParseSourceSpan,\n loopItemName: string,\n context: t.Variable[],\n errors: ParseError[],\n): void {\n const parts = expression.split(',');\n let startSpan = span.start;\n for (const part of parts) {\n const expressionParts = part.split('=');\n const name = expressionParts.length === 2 ? expressionParts[0].trim() : '';\n const variableName = expressionParts.length === 2 ? expressionParts[1].trim() : '';\n\n if (name.length === 0 || variableName.length === 0) {\n errors.push(\n new ParseError(\n sourceSpan,\n `Invalid @for loop \"let\" parameter. Parameter should match the pattern \" = \"`,\n ),\n );\n } else if (!ALLOWED_FOR_LOOP_LET_VARIABLES.has(variableName)) {\n errors.push(\n new ParseError(\n sourceSpan,\n `Unknown \"let\" parameter variable \"${variableName}\". The allowed variables are: ${Array.from(\n ALLOWED_FOR_LOOP_LET_VARIABLES,\n ).join(', ')}`,\n ),\n );\n } else if (name === loopItemName) {\n errors.push(\n new ParseError(\n sourceSpan,\n `Invalid @for loop \"let\" parameter. Variable cannot be called \"${loopItemName}\"`,\n ),\n );\n } else if (context.some((v) => v.name === name)) {\n errors.push(\n new ParseError(sourceSpan, `Duplicate \"let\" parameter variable \"${variableName}\"`),\n );\n } else {\n const [, keyLeadingWhitespace, keyName] =\n expressionParts[0].match(CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN) ?? [];\n const keySpan =\n keyLeadingWhitespace !== undefined && expressionParts.length === 2\n ? new ParseSourceSpan(\n /* strip leading spaces */\n startSpan.moveBy(keyLeadingWhitespace.length),\n /* advance to end of the variable name */\n startSpan.moveBy(keyLeadingWhitespace.length + keyName.length),\n )\n : span;\n\n let valueSpan: ParseSourceSpan | undefined = undefined;\n if (expressionParts.length === 2) {\n const [, valueLeadingWhitespace, implicit] =\n expressionParts[1].match(CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN) ?? [];\n valueSpan =\n valueLeadingWhitespace !== undefined\n ? new ParseSourceSpan(\n startSpan.moveBy(expressionParts[0].length + 1 + valueLeadingWhitespace.length),\n startSpan.moveBy(\n expressionParts[0].length + 1 + valueLeadingWhitespace.length + implicit.length,\n ),\n )\n : undefined;\n }\n const sourceSpan = new ParseSourceSpan(keySpan.start, valueSpan?.end ?? keySpan.end);\n context.push(new t.Variable(name, variableName, sourceSpan, keySpan, valueSpan));\n }\n startSpan = startSpan.moveBy(part.length + 1 /* add 1 to move past the comma */);\n }\n}\n\n/**\n * Checks that the shape of the blocks connected to an\n * `@if` block is correct. Returns an array of errors.\n */\nfunction validateIfConnectedBlocks(connectedBlocks: html.Block[]): ParseError[] {\n const errors: ParseError[] = [];\n let hasElse = false;\n\n for (let i = 0; i < connectedBlocks.length; i++) {\n const block = connectedBlocks[i];\n\n if (block.name === 'else') {\n if (hasElse) {\n errors.push(\n new ParseError(block.startSourceSpan, 'Conditional can only have one @else block'),\n );\n } else if (connectedBlocks.length > 1 && i < connectedBlocks.length - 1) {\n errors.push(\n new ParseError(block.startSourceSpan, '@else block must be last inside the conditional'),\n );\n } else if (block.parameters.length > 0) {\n errors.push(new ParseError(block.startSourceSpan, '@else block cannot have parameters'));\n }\n hasElse = true;\n } else if (!ELSE_IF_PATTERN.test(block.name)) {\n errors.push(\n new ParseError(block.startSourceSpan, `Unrecognized conditional block @${block.name}`),\n );\n }\n }\n\n return errors;\n}\n\n/** Checks that the shape of a `switch` block is valid. Returns an array of errors. */\nfunction validateSwitchBlock(ast: html.Block): ParseError[] {\n const errors: ParseError[] = [];\n let hasDefault = false;\n\n if (ast.parameters.length !== 1) {\n errors.push(\n new ParseError(ast.startSourceSpan, '@switch block must have exactly one parameter'),\n );\n return errors;\n }\n\n for (const node of ast.children) {\n // Skip over comments and empty text nodes inside the switch block.\n // Empty text nodes can be used for formatting while comments don't affect the runtime.\n if (\n node instanceof html.Comment ||\n (node instanceof html.Text && node.value.trim().length === 0)\n ) {\n continue;\n }\n\n if (!(node instanceof html.Block) || (node.name !== 'case' && node.name !== 'default')) {\n errors.push(\n new ParseError(node.sourceSpan, '@switch block can only contain @case and @default blocks'),\n );\n continue;\n }\n\n if (node.name === 'default') {\n if (hasDefault) {\n errors.push(\n new ParseError(node.startSourceSpan, '@switch block can only have one @default block'),\n );\n } else if (node.parameters.length > 0) {\n errors.push(new ParseError(node.startSourceSpan, '@default block cannot have parameters'));\n }\n hasDefault = true;\n } else if (node.name === 'case' && node.parameters.length !== 1) {\n errors.push(\n new ParseError(node.startSourceSpan, '@case block must have exactly one parameter'),\n );\n }\n }\n\n return errors;\n}\n\n/**\n * Parses a block parameter into a binding AST.\n * @param ast Block parameter that should be parsed.\n * @param bindingParser Parser that the expression should be parsed with.\n * @param part Specific part of the expression that should be parsed.\n */\nfunction parseBlockParameterToBinding(\n ast: html.BlockParameter,\n bindingParser: BindingParser,\n part?: string,\n): ASTWithSource {\n let start: number;\n let end: number;\n\n if (typeof part === 'string') {\n // Note: `lastIndexOf` here should be enough to know the start index of the expression,\n // because we know that it'll be at the end of the param. Ideally we could use the `d`\n // flag when matching via regex and get the index from `match.indices`, but it's unclear\n // if we can use it yet since it's a relatively new feature. See:\n // https://github.com/tc39/proposal-regexp-match-indices\n start = Math.max(0, ast.expression.lastIndexOf(part));\n end = start + part.length;\n } else {\n start = 0;\n end = ast.expression.length;\n }\n\n return bindingParser.parseBinding(\n ast.expression.slice(start, end),\n false,\n ast.sourceSpan,\n ast.sourceSpan.start.offset + start,\n );\n}\n\n/** Parses the parameter of a conditional block (`if` or `else if`). */\nfunction parseConditionalBlockParameters(\n block: html.Block,\n errors: ParseError[],\n bindingParser: BindingParser,\n) {\n if (block.parameters.length === 0) {\n errors.push(\n new ParseError(block.startSourceSpan, 'Conditional block does not have an expression'),\n );\n return null;\n }\n\n const expression = parseBlockParameterToBinding(block.parameters[0], bindingParser);\n let expressionAlias: t.Variable | null = null;\n\n // Start from 1 since we processed the first parameter already.\n for (let i = 1; i < block.parameters.length; i++) {\n const param = block.parameters[i];\n const aliasMatch = param.expression.match(CONDITIONAL_ALIAS_PATTERN);\n\n // For now conditionals can only have an `as` parameter.\n // We may want to rework this later if we add more.\n if (aliasMatch === null) {\n errors.push(\n new ParseError(\n param.sourceSpan,\n `Unrecognized conditional parameter \"${param.expression}\"`,\n ),\n );\n } else if (block.name !== 'if') {\n errors.push(\n new ParseError(\n param.sourceSpan,\n '\"as\" expression is only allowed on the primary @if block',\n ),\n );\n } else if (expressionAlias !== null) {\n errors.push(\n new ParseError(param.sourceSpan, 'Conditional can only have one \"as\" expression'),\n );\n } else {\n const name = aliasMatch[2].trim();\n\n if (IDENTIFIER_PATTERN.test(name)) {\n const variableStart = param.sourceSpan.start.moveBy(aliasMatch[1].length);\n const variableSpan = new ParseSourceSpan(variableStart, variableStart.moveBy(name.length));\n expressionAlias = new t.Variable(name, name, variableSpan, variableSpan);\n } else {\n errors.push(\n new ParseError(param.sourceSpan, '\"as\" expression must be a valid JavaScript identifier'),\n );\n }\n }\n }\n\n return {expression, expressionAlias};\n}\n\n/** Strips optional parentheses around from a control from expression parameter. */\nfunction stripOptionalParentheses(param: html.BlockParameter, errors: ParseError[]): string | null {\n const expression = param.expression;\n const spaceRegex = /^\\s$/;\n let openParens = 0;\n let start = 0;\n let end = expression.length - 1;\n\n for (let i = 0; i < expression.length; i++) {\n const char = expression[i];\n\n if (char === '(') {\n start = i + 1;\n openParens++;\n } else if (spaceRegex.test(char)) {\n continue;\n } else {\n break;\n }\n }\n\n if (openParens === 0) {\n return expression;\n }\n\n for (let i = expression.length - 1; i > -1; i--) {\n const char = expression[i];\n\n if (char === ')') {\n end = i;\n openParens--;\n if (openParens === 0) {\n break;\n }\n } else if (spaceRegex.test(char)) {\n continue;\n } else {\n break;\n }\n }\n\n if (openParens !== 0) {\n errors.push(new ParseError(param.sourceSpan, 'Unclosed parentheses in expression'));\n return null;\n }\n\n return expression.slice(start, end);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as chars from '../chars';\nimport {Lexer, Token, TokenType} from '../expression_parser/lexer';\nimport * as html from '../ml_parser/ast';\nimport {ParseError, ParseSourceSpan} from '../parse_util';\nimport {BindingParser} from '../template_parser/binding_parser';\n\nimport * as t from './r3_ast';\n\n/** Pattern for a timing value in a trigger. */\nconst TIME_PATTERN = /^\\d+\\.?\\d*(ms|s)?$/;\n\n/** Pattern for a separator between keywords in a trigger expression. */\nconst SEPARATOR_PATTERN = /^\\s$/;\n\n/** Pairs of characters that form syntax that is comma-delimited. */\nconst COMMA_DELIMITED_SYNTAX = new Map([\n [chars.$LBRACE, chars.$RBRACE], // Object literals\n [chars.$LBRACKET, chars.$RBRACKET], // Array literals\n [chars.$LPAREN, chars.$RPAREN], // Function calls\n]);\n\n/** Possible types of `on` triggers. */\nenum OnTriggerType {\n IDLE = 'idle',\n TIMER = 'timer',\n INTERACTION = 'interaction',\n IMMEDIATE = 'immediate',\n HOVER = 'hover',\n VIEWPORT = 'viewport',\n NEVER = 'never',\n}\n\n/** Function that validates the structure of a reference-based trigger. */\ntype ReferenceTriggerValidator = (\n type: OnTriggerType,\n parameters: string[],\n placeholder: t.DeferredBlockPlaceholder | null,\n) => void;\n\n/** Parses a `when` deferred trigger. */\nexport function parseNeverTrigger(\n {expression, sourceSpan}: html.BlockParameter,\n triggers: t.DeferredBlockTriggers,\n errors: ParseError[],\n): void {\n const neverIndex = expression.indexOf('never');\n const neverSourceSpan = new ParseSourceSpan(\n sourceSpan.start.moveBy(neverIndex),\n sourceSpan.start.moveBy(neverIndex + 'never'.length),\n );\n const prefetchSpan = getPrefetchSpan(expression, sourceSpan);\n const hydrateSpan = getHydrateSpan(expression, sourceSpan);\n\n // This is here just to be safe, we shouldn't enter this function\n // in the first place if a block doesn't have the \"on\" keyword.\n if (neverIndex === -1) {\n errors.push(new ParseError(sourceSpan, `Could not find \"never\" keyword in expression`));\n } else {\n trackTrigger(\n 'never',\n triggers,\n errors,\n new t.NeverDeferredTrigger(neverSourceSpan, sourceSpan, prefetchSpan, null, hydrateSpan),\n );\n }\n}\n\n/** Parses a `when` deferred trigger. */\nexport function parseWhenTrigger(\n {expression, sourceSpan}: html.BlockParameter,\n bindingParser: BindingParser,\n triggers: t.DeferredBlockTriggers,\n errors: ParseError[],\n): void {\n const whenIndex = expression.indexOf('when');\n const whenSourceSpan = new ParseSourceSpan(\n sourceSpan.start.moveBy(whenIndex),\n sourceSpan.start.moveBy(whenIndex + 'when'.length),\n );\n const prefetchSpan = getPrefetchSpan(expression, sourceSpan);\n const hydrateSpan = getHydrateSpan(expression, sourceSpan);\n\n // This is here just to be safe, we shouldn't enter this function\n // in the first place if a block doesn't have the \"when\" keyword.\n if (whenIndex === -1) {\n errors.push(new ParseError(sourceSpan, `Could not find \"when\" keyword in expression`));\n } else {\n const start = getTriggerParametersStart(expression, whenIndex + 1);\n const parsed = bindingParser.parseBinding(\n expression.slice(start),\n false,\n sourceSpan,\n sourceSpan.start.offset + start,\n );\n trackTrigger(\n 'when',\n triggers,\n errors,\n new t.BoundDeferredTrigger(parsed, sourceSpan, prefetchSpan, whenSourceSpan, hydrateSpan),\n );\n }\n}\n\n/** Parses an `on` trigger */\nexport function parseOnTrigger(\n {expression, sourceSpan}: html.BlockParameter,\n triggers: t.DeferredBlockTriggers,\n errors: ParseError[],\n placeholder: t.DeferredBlockPlaceholder | null,\n): void {\n const onIndex = expression.indexOf('on');\n const onSourceSpan = new ParseSourceSpan(\n sourceSpan.start.moveBy(onIndex),\n sourceSpan.start.moveBy(onIndex + 'on'.length),\n );\n const prefetchSpan = getPrefetchSpan(expression, sourceSpan);\n const hydrateSpan = getHydrateSpan(expression, sourceSpan);\n\n // This is here just to be safe, we shouldn't enter this function\n // in the first place if a block doesn't have the \"on\" keyword.\n if (onIndex === -1) {\n errors.push(new ParseError(sourceSpan, `Could not find \"on\" keyword in expression`));\n } else {\n const start = getTriggerParametersStart(expression, onIndex + 1);\n const parser = new OnTriggerParser(\n expression,\n start,\n sourceSpan,\n triggers,\n errors,\n expression.startsWith('hydrate')\n ? validateHydrateReferenceBasedTrigger\n : validatePlainReferenceBasedTrigger,\n placeholder,\n prefetchSpan,\n onSourceSpan,\n hydrateSpan,\n );\n parser.parse();\n }\n}\n\nfunction getPrefetchSpan(expression: string, sourceSpan: ParseSourceSpan) {\n if (!expression.startsWith('prefetch')) {\n return null;\n }\n return new ParseSourceSpan(sourceSpan.start, sourceSpan.start.moveBy('prefetch'.length));\n}\n\nfunction getHydrateSpan(expression: string, sourceSpan: ParseSourceSpan) {\n if (!expression.startsWith('hydrate')) {\n return null;\n }\n return new ParseSourceSpan(sourceSpan.start, sourceSpan.start.moveBy('hydrate'.length));\n}\n\nclass OnTriggerParser {\n private index = 0;\n private tokens: Token[];\n\n constructor(\n private expression: string,\n private start: number,\n private span: ParseSourceSpan,\n private triggers: t.DeferredBlockTriggers,\n private errors: ParseError[],\n private validator: ReferenceTriggerValidator,\n private placeholder: t.DeferredBlockPlaceholder | null,\n private prefetchSpan: ParseSourceSpan | null,\n private onSourceSpan: ParseSourceSpan,\n private hydrateSpan: ParseSourceSpan | null,\n ) {\n this.tokens = new Lexer().tokenize(expression.slice(start));\n }\n\n parse(): void {\n while (this.tokens.length > 0 && this.index < this.tokens.length) {\n const token = this.token();\n\n if (!token.isIdentifier()) {\n this.unexpectedToken(token);\n break;\n }\n\n // An identifier immediately followed by a comma or the end of\n // the expression cannot have parameters so we can exit early.\n if (this.isFollowedByOrLast(chars.$COMMA)) {\n this.consumeTrigger(token, []);\n this.advance();\n } else if (this.isFollowedByOrLast(chars.$LPAREN)) {\n this.advance(); // Advance to the opening paren.\n const prevErrors = this.errors.length;\n const parameters = this.consumeParameters();\n if (this.errors.length !== prevErrors) {\n break;\n }\n this.consumeTrigger(token, parameters);\n this.advance(); // Advance past the closing paren.\n } else if (this.index < this.tokens.length - 1) {\n this.unexpectedToken(this.tokens[this.index + 1]);\n }\n\n this.advance();\n }\n }\n\n private advance() {\n this.index++;\n }\n\n private isFollowedByOrLast(char: number): boolean {\n if (this.index === this.tokens.length - 1) {\n return true;\n }\n\n return this.tokens[this.index + 1].isCharacter(char);\n }\n\n private token(): Token {\n return this.tokens[Math.min(this.index, this.tokens.length - 1)];\n }\n\n private consumeTrigger(identifier: Token, parameters: string[]) {\n const triggerNameStartSpan = this.span.start.moveBy(\n this.start + identifier.index - this.tokens[0].index,\n );\n const nameSpan = new ParseSourceSpan(\n triggerNameStartSpan,\n triggerNameStartSpan.moveBy(identifier.strValue.length),\n );\n const endSpan = triggerNameStartSpan.moveBy(this.token().end - identifier.index);\n\n // Put the prefetch and on spans with the first trigger\n // This should maybe be refactored to have something like an outer OnGroup AST\n // Since triggers can be grouped with commas \"on hover(x), interaction(y)\"\n const isFirstTrigger = identifier.index === 0;\n const onSourceSpan = isFirstTrigger ? this.onSourceSpan : null;\n const prefetchSourceSpan = isFirstTrigger ? this.prefetchSpan : null;\n const hydrateSourceSpan = isFirstTrigger ? this.hydrateSpan : null;\n const sourceSpan = new ParseSourceSpan(\n isFirstTrigger ? this.span.start : triggerNameStartSpan,\n endSpan,\n );\n\n try {\n switch (identifier.toString()) {\n case OnTriggerType.IDLE:\n this.trackTrigger(\n 'idle',\n createIdleTrigger(\n parameters,\n nameSpan,\n sourceSpan,\n prefetchSourceSpan,\n onSourceSpan,\n hydrateSourceSpan,\n ),\n );\n break;\n\n case OnTriggerType.TIMER:\n this.trackTrigger(\n 'timer',\n createTimerTrigger(\n parameters,\n nameSpan,\n sourceSpan,\n this.prefetchSpan,\n this.onSourceSpan,\n this.hydrateSpan,\n ),\n );\n break;\n\n case OnTriggerType.INTERACTION:\n this.trackTrigger(\n 'interaction',\n createInteractionTrigger(\n parameters,\n nameSpan,\n sourceSpan,\n this.prefetchSpan,\n this.onSourceSpan,\n this.hydrateSpan,\n this.placeholder,\n this.validator,\n ),\n );\n break;\n\n case OnTriggerType.IMMEDIATE:\n this.trackTrigger(\n 'immediate',\n createImmediateTrigger(\n parameters,\n nameSpan,\n sourceSpan,\n this.prefetchSpan,\n this.onSourceSpan,\n this.hydrateSpan,\n ),\n );\n break;\n\n case OnTriggerType.HOVER:\n this.trackTrigger(\n 'hover',\n createHoverTrigger(\n parameters,\n nameSpan,\n sourceSpan,\n this.prefetchSpan,\n this.onSourceSpan,\n this.hydrateSpan,\n this.placeholder,\n this.validator,\n ),\n );\n break;\n\n case OnTriggerType.VIEWPORT:\n this.trackTrigger(\n 'viewport',\n createViewportTrigger(\n parameters,\n nameSpan,\n sourceSpan,\n this.prefetchSpan,\n this.onSourceSpan,\n this.hydrateSpan,\n this.placeholder,\n this.validator,\n ),\n );\n break;\n\n default:\n throw new Error(`Unrecognized trigger type \"${identifier}\"`);\n }\n } catch (e) {\n this.error(identifier, (e as Error).message);\n }\n }\n\n private consumeParameters(): string[] {\n const parameters: string[] = [];\n\n if (!this.token().isCharacter(chars.$LPAREN)) {\n this.unexpectedToken(this.token());\n return parameters;\n }\n\n this.advance();\n\n const commaDelimStack: number[] = [];\n let current = '';\n\n while (this.index < this.tokens.length) {\n const token = this.token();\n\n // Stop parsing if we've hit the end character and we're outside of a comma-delimited syntax.\n // Note that we don't need to account for strings here since the lexer already parsed them\n // into string tokens.\n if (token.isCharacter(chars.$RPAREN) && commaDelimStack.length === 0) {\n if (current.length) {\n parameters.push(current);\n }\n break;\n }\n\n // In the `on` microsyntax \"top-level\" commas (e.g. ones outside of an parameters) separate\n // the different triggers (e.g. `on idle,timer(500)`). This is problematic, because the\n // function-like syntax also implies that multiple parameters can be passed into the\n // individual trigger (e.g. `on foo(a, b)`). To avoid tripping up the parser with commas that\n // are part of other sorts of syntax (object literals, arrays), we treat anything inside\n // a comma-delimited syntax block as plain text.\n if (token.type === TokenType.Character && COMMA_DELIMITED_SYNTAX.has(token.numValue)) {\n commaDelimStack.push(COMMA_DELIMITED_SYNTAX.get(token.numValue)!);\n }\n\n if (\n commaDelimStack.length > 0 &&\n token.isCharacter(commaDelimStack[commaDelimStack.length - 1])\n ) {\n commaDelimStack.pop();\n }\n\n // If we hit a comma outside of a comma-delimited syntax, it means\n // that we're at the top level and we're starting a new parameter.\n if (commaDelimStack.length === 0 && token.isCharacter(chars.$COMMA) && current.length > 0) {\n parameters.push(current);\n current = '';\n this.advance();\n continue;\n }\n\n // Otherwise treat the token as a plain text character in the current parameter.\n current += this.tokenText();\n this.advance();\n }\n\n if (!this.token().isCharacter(chars.$RPAREN) || commaDelimStack.length > 0) {\n this.error(this.token(), 'Unexpected end of expression');\n }\n\n if (\n this.index < this.tokens.length - 1 &&\n !this.tokens[this.index + 1].isCharacter(chars.$COMMA)\n ) {\n this.unexpectedToken(this.tokens[this.index + 1]);\n }\n\n return parameters;\n }\n\n private tokenText(): string {\n // Tokens have a toString already which we could use, but for string tokens it omits the quotes.\n // Eventually we could expose this information on the token directly.\n return this.expression.slice(this.start + this.token().index, this.start + this.token().end);\n }\n\n private trackTrigger(name: keyof t.DeferredBlockTriggers, trigger: t.DeferredTrigger): void {\n trackTrigger(name, this.triggers, this.errors, trigger);\n }\n\n private error(token: Token, message: string): void {\n const newStart = this.span.start.moveBy(this.start + token.index);\n const newEnd = newStart.moveBy(token.end - token.index);\n this.errors.push(new ParseError(new ParseSourceSpan(newStart, newEnd), message));\n }\n\n private unexpectedToken(token: Token) {\n this.error(token, `Unexpected token \"${token}\"`);\n }\n}\n\n/** Adds a trigger to a map of triggers. */\nfunction trackTrigger(\n name: keyof t.DeferredBlockTriggers,\n allTriggers: t.DeferredBlockTriggers,\n errors: ParseError[],\n trigger: t.DeferredTrigger,\n) {\n if (allTriggers[name]) {\n errors.push(new ParseError(trigger.sourceSpan, `Duplicate \"${name}\" trigger is not allowed`));\n } else {\n allTriggers[name] = trigger as any;\n }\n}\n\nfunction createIdleTrigger(\n parameters: string[],\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n onSourceSpan: ParseSourceSpan | null,\n hydrateSpan: ParseSourceSpan | null,\n): t.IdleDeferredTrigger {\n if (parameters.length > 0) {\n throw new Error(`\"${OnTriggerType.IDLE}\" trigger cannot have parameters`);\n }\n\n return new t.IdleDeferredTrigger(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);\n}\n\nfunction createTimerTrigger(\n parameters: string[],\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n onSourceSpan: ParseSourceSpan | null,\n hydrateSpan: ParseSourceSpan | null,\n) {\n if (parameters.length !== 1) {\n throw new Error(`\"${OnTriggerType.TIMER}\" trigger must have exactly one parameter`);\n }\n\n const delay = parseDeferredTime(parameters[0]);\n\n if (delay === null) {\n throw new Error(`Could not parse time value of trigger \"${OnTriggerType.TIMER}\"`);\n }\n\n return new t.TimerDeferredTrigger(\n delay,\n nameSpan,\n sourceSpan,\n prefetchSpan,\n onSourceSpan,\n hydrateSpan,\n );\n}\n\nfunction createImmediateTrigger(\n parameters: string[],\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n onSourceSpan: ParseSourceSpan | null,\n hydrateSpan: ParseSourceSpan | null,\n): t.ImmediateDeferredTrigger {\n if (parameters.length > 0) {\n throw new Error(`\"${OnTriggerType.IMMEDIATE}\" trigger cannot have parameters`);\n }\n\n return new t.ImmediateDeferredTrigger(\n nameSpan,\n sourceSpan,\n prefetchSpan,\n onSourceSpan,\n hydrateSpan,\n );\n}\n\nfunction createHoverTrigger(\n parameters: string[],\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n onSourceSpan: ParseSourceSpan | null,\n hydrateSpan: ParseSourceSpan | null,\n placeholder: t.DeferredBlockPlaceholder | null,\n validator: ReferenceTriggerValidator,\n): t.HoverDeferredTrigger {\n validator(OnTriggerType.HOVER, parameters, placeholder);\n return new t.HoverDeferredTrigger(\n parameters[0] ?? null,\n nameSpan,\n sourceSpan,\n prefetchSpan,\n onSourceSpan,\n hydrateSpan,\n );\n}\n\nfunction createInteractionTrigger(\n parameters: string[],\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n onSourceSpan: ParseSourceSpan | null,\n hydrateSpan: ParseSourceSpan | null,\n placeholder: t.DeferredBlockPlaceholder | null,\n validator: ReferenceTriggerValidator,\n): t.InteractionDeferredTrigger {\n validator(OnTriggerType.INTERACTION, parameters, placeholder);\n return new t.InteractionDeferredTrigger(\n parameters[0] ?? null,\n nameSpan,\n sourceSpan,\n prefetchSpan,\n onSourceSpan,\n hydrateSpan,\n );\n}\n\nfunction createViewportTrigger(\n parameters: string[],\n nameSpan: ParseSourceSpan,\n sourceSpan: ParseSourceSpan,\n prefetchSpan: ParseSourceSpan | null,\n onSourceSpan: ParseSourceSpan | null,\n hydrateSpan: ParseSourceSpan | null,\n placeholder: t.DeferredBlockPlaceholder | null,\n validator: ReferenceTriggerValidator,\n): t.ViewportDeferredTrigger {\n validator(OnTriggerType.VIEWPORT, parameters, placeholder);\n return new t.ViewportDeferredTrigger(\n parameters[0] ?? null,\n nameSpan,\n sourceSpan,\n prefetchSpan,\n onSourceSpan,\n hydrateSpan,\n );\n}\n\n/**\n * Checks whether the structure of a non-hydrate reference-based trigger is valid.\n * @param type Type of the trigger being validated.\n * @param parameters Parameters of the trigger.\n * @param placeholder Placeholder of the defer block.\n */\nfunction validatePlainReferenceBasedTrigger(\n type: OnTriggerType,\n parameters: string[],\n placeholder: t.DeferredBlockPlaceholder | null,\n) {\n if (parameters.length > 1) {\n throw new Error(`\"${type}\" trigger can only have zero or one parameters`);\n }\n\n if (parameters.length === 0) {\n if (placeholder === null) {\n throw new Error(\n `\"${type}\" trigger with no parameters can only be placed on an @defer that has a @placeholder block`,\n );\n }\n\n if (placeholder.children.length !== 1 || !(placeholder.children[0] instanceof t.Element)) {\n throw new Error(\n `\"${type}\" trigger with no parameters can only be placed on an @defer that has a ` +\n `@placeholder block with exactly one root element node`,\n );\n }\n }\n}\n\n/**\n * Checks whether the structure of a hydrate trigger is valid.\n * @param type Type of the trigger being validated.\n * @param parameters Parameters of the trigger.\n */\nfunction validateHydrateReferenceBasedTrigger(type: OnTriggerType, parameters: string[]) {\n if (parameters.length > 0) {\n throw new Error(`Hydration trigger \"${type}\" cannot have parameters`);\n }\n}\n\n/** Gets the index within an expression at which the trigger parameters start. */\nexport function getTriggerParametersStart(value: string, startPosition = 0): number {\n let hasFoundSeparator = false;\n\n for (let i = startPosition; i < value.length; i++) {\n if (SEPARATOR_PATTERN.test(value[i])) {\n hasFoundSeparator = true;\n } else if (hasFoundSeparator) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Parses a time expression from a deferred trigger to\n * milliseconds. Returns null if it cannot be parsed.\n */\nexport function parseDeferredTime(value: string): number | null {\n const match = value.match(TIME_PATTERN);\n\n if (!match) {\n return null;\n }\n\n const [time, units] = match;\n return parseFloat(time) * (units === 's' ? 1000 : 1);\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport * as html from '../ml_parser/ast';\nimport {ParseError, ParseSourceSpan} from '../parse_util';\nimport {BindingParser} from '../template_parser/binding_parser';\n\nimport * as t from './r3_ast';\nimport {\n getTriggerParametersStart,\n parseDeferredTime,\n parseNeverTrigger,\n parseOnTrigger,\n parseWhenTrigger,\n} from './r3_deferred_triggers';\n\n/** Pattern to identify a `prefetch when` trigger. */\nconst PREFETCH_WHEN_PATTERN = /^prefetch\\s+when\\s/;\n\n/** Pattern to identify a `prefetch on` trigger. */\nconst PREFETCH_ON_PATTERN = /^prefetch\\s+on\\s/;\n\n/** Pattern to identify a `hydrate when` trigger. */\nconst HYDRATE_WHEN_PATTERN = /^hydrate\\s+when\\s/;\n\n/** Pattern to identify a `hydrate on` trigger. */\nconst HYDRATE_ON_PATTERN = /^hydrate\\s+on\\s/;\n\n/** Pattern to identify a `hydrate never` trigger. */\nconst HYDRATE_NEVER_PATTERN = /^hydrate\\s+never(\\s*)$/;\n\n/** Pattern to identify a `minimum` parameter in a block. */\nconst MINIMUM_PARAMETER_PATTERN = /^minimum\\s/;\n\n/** Pattern to identify a `after` parameter in a block. */\nconst AFTER_PARAMETER_PATTERN = /^after\\s/;\n\n/** Pattern to identify a `when` parameter in a block. */\nconst WHEN_PARAMETER_PATTERN = /^when\\s/;\n\n/** Pattern to identify a `on` parameter in a block. */\nconst ON_PARAMETER_PATTERN = /^on\\s/;\n\n/**\n * Predicate function that determines if a block with\n * a specific name cam be connected to a `defer` block.\n */\nexport function isConnectedDeferLoopBlock(name: string): boolean {\n return name === 'placeholder' || name === 'loading' || name === 'error';\n}\n\n/** Creates a deferred block from an HTML AST node. */\nexport function createDeferredBlock(\n ast: html.Block,\n connectedBlocks: html.Block[],\n visitor: html.Visitor,\n bindingParser: BindingParser,\n): {node: t.DeferredBlock; errors: ParseError[]} {\n const errors: ParseError[] = [];\n const {placeholder, loading, error} = parseConnectedBlocks(connectedBlocks, errors, visitor);\n const {triggers, prefetchTriggers, hydrateTriggers} = parsePrimaryTriggers(\n ast,\n bindingParser,\n errors,\n placeholder,\n );\n\n // The `defer` block has a main span encompassing all of the connected branches as well.\n let lastEndSourceSpan = ast.endSourceSpan;\n let endOfLastSourceSpan = ast.sourceSpan.end;\n if (connectedBlocks.length > 0) {\n const lastConnectedBlock = connectedBlocks[connectedBlocks.length - 1];\n lastEndSourceSpan = lastConnectedBlock.endSourceSpan;\n endOfLastSourceSpan = lastConnectedBlock.sourceSpan.end;\n }\n\n const sourceSpanWithConnectedBlocks = new ParseSourceSpan(\n ast.sourceSpan.start,\n endOfLastSourceSpan,\n );\n\n const node = new t.DeferredBlock(\n html.visitAll(visitor, ast.children, ast.children),\n triggers,\n prefetchTriggers,\n hydrateTriggers,\n placeholder,\n loading,\n error,\n ast.nameSpan,\n sourceSpanWithConnectedBlocks,\n ast.sourceSpan,\n ast.startSourceSpan,\n lastEndSourceSpan,\n ast.i18n,\n );\n\n return {node, errors};\n}\n\nfunction parseConnectedBlocks(\n connectedBlocks: html.Block[],\n errors: ParseError[],\n visitor: html.Visitor,\n) {\n let placeholder: t.DeferredBlockPlaceholder | null = null;\n let loading: t.DeferredBlockLoading | null = null;\n let error: t.DeferredBlockError | null = null;\n\n for (const block of connectedBlocks) {\n try {\n if (!isConnectedDeferLoopBlock(block.name)) {\n errors.push(new ParseError(block.startSourceSpan, `Unrecognized block \"@${block.name}\"`));\n break;\n }\n\n switch (block.name) {\n case 'placeholder':\n if (placeholder !== null) {\n errors.push(\n new ParseError(\n block.startSourceSpan,\n `@defer block can only have one @placeholder block`,\n ),\n );\n } else {\n placeholder = parsePlaceholderBlock(block, visitor);\n }\n break;\n\n case 'loading':\n if (loading !== null) {\n errors.push(\n new ParseError(\n block.startSourceSpan,\n `@defer block can only have one @loading block`,\n ),\n );\n } else {\n loading = parseLoadingBlock(block, visitor);\n }\n break;\n\n case 'error':\n if (error !== null) {\n errors.push(\n new ParseError(block.startSourceSpan, `@defer block can only have one @error block`),\n );\n } else {\n error = parseErrorBlock(block, visitor);\n }\n break;\n }\n } catch (e) {\n errors.push(new ParseError(block.startSourceSpan, (e as Error).message));\n }\n }\n\n return {placeholder, loading, error};\n}\n\nfunction parsePlaceholderBlock(ast: html.Block, visitor: html.Visitor): t.DeferredBlockPlaceholder {\n let minimumTime: number | null = null;\n\n for (const param of ast.parameters) {\n if (MINIMUM_PARAMETER_PATTERN.test(param.expression)) {\n if (minimumTime != null) {\n throw new Error(`@placeholder block can only have one \"minimum\" parameter`);\n }\n\n const parsedTime = parseDeferredTime(\n param.expression.slice(getTriggerParametersStart(param.expression)),\n );\n\n if (parsedTime === null) {\n throw new Error(`Could not parse time value of parameter \"minimum\"`);\n }\n\n minimumTime = parsedTime;\n } else {\n throw new Error(`Unrecognized parameter in @placeholder block: \"${param.expression}\"`);\n }\n }\n\n return new t.DeferredBlockPlaceholder(\n html.visitAll(visitor, ast.children, ast.children),\n minimumTime,\n ast.nameSpan,\n ast.sourceSpan,\n ast.startSourceSpan,\n ast.endSourceSpan,\n ast.i18n,\n );\n}\n\nfunction parseLoadingBlock(ast: html.Block, visitor: html.Visitor): t.DeferredBlockLoading {\n let afterTime: number | null = null;\n let minimumTime: number | null = null;\n\n for (const param of ast.parameters) {\n if (AFTER_PARAMETER_PATTERN.test(param.expression)) {\n if (afterTime != null) {\n throw new Error(`@loading block can only have one \"after\" parameter`);\n }\n\n const parsedTime = parseDeferredTime(\n param.expression.slice(getTriggerParametersStart(param.expression)),\n );\n\n if (parsedTime === null) {\n throw new Error(`Could not parse time value of parameter \"after\"`);\n }\n\n afterTime = parsedTime;\n } else if (MINIMUM_PARAMETER_PATTERN.test(param.expression)) {\n if (minimumTime != null) {\n throw new Error(`@loading block can only have one \"minimum\" parameter`);\n }\n\n const parsedTime = parseDeferredTime(\n param.expression.slice(getTriggerParametersStart(param.expression)),\n );\n\n if (parsedTime === null) {\n throw new Error(`Could not parse time value of parameter \"minimum\"`);\n }\n\n minimumTime = parsedTime;\n } else {\n throw new Error(`Unrecognized parameter in @loading block: \"${param.expression}\"`);\n }\n }\n\n return new t.DeferredBlockLoading(\n html.visitAll(visitor, ast.children, ast.children),\n afterTime,\n minimumTime,\n ast.nameSpan,\n ast.sourceSpan,\n ast.startSourceSpan,\n ast.endSourceSpan,\n ast.i18n,\n );\n}\n\nfunction parseErrorBlock(ast: html.Block, visitor: html.Visitor): t.DeferredBlockError {\n if (ast.parameters.length > 0) {\n throw new Error(`@error block cannot have parameters`);\n }\n\n return new t.DeferredBlockError(\n html.visitAll(visitor, ast.children, ast.children),\n ast.nameSpan,\n ast.sourceSpan,\n ast.startSourceSpan,\n ast.endSourceSpan,\n ast.i18n,\n );\n}\n\nfunction parsePrimaryTriggers(\n ast: html.Block,\n bindingParser: BindingParser,\n errors: ParseError[],\n placeholder: t.DeferredBlockPlaceholder | null,\n) {\n const triggers: t.DeferredBlockTriggers = {};\n const prefetchTriggers: t.DeferredBlockTriggers = {};\n const hydrateTriggers: t.DeferredBlockTriggers = {};\n\n for (const param of ast.parameters) {\n // The lexer ignores the leading spaces so we can assume\n // that the expression starts with a keyword.\n if (WHEN_PARAMETER_PATTERN.test(param.expression)) {\n parseWhenTrigger(param, bindingParser, triggers, errors);\n } else if (ON_PARAMETER_PATTERN.test(param.expression)) {\n parseOnTrigger(param, triggers, errors, placeholder);\n } else if (PREFETCH_WHEN_PATTERN.test(param.expression)) {\n parseWhenTrigger(param, bindingParser, prefetchTriggers, errors);\n } else if (PREFETCH_ON_PATTERN.test(param.expression)) {\n parseOnTrigger(param, prefetchTriggers, errors, placeholder);\n } else if (HYDRATE_WHEN_PATTERN.test(param.expression)) {\n parseWhenTrigger(param, bindingParser, hydrateTriggers, errors);\n } else if (HYDRATE_ON_PATTERN.test(param.expression)) {\n parseOnTrigger(param, hydrateTriggers, errors, placeholder);\n } else if (HYDRATE_NEVER_PATTERN.test(param.expression)) {\n parseNeverTrigger(param, hydrateTriggers, errors);\n } else {\n errors.push(new ParseError(param.sourceSpan, 'Unrecognized trigger'));\n }\n }\n\n if (hydrateTriggers.never && Object.keys(hydrateTriggers).length > 1) {\n errors.push(\n new ParseError(\n ast.startSourceSpan,\n 'Cannot specify additional `hydrate` triggers if `hydrate never` is present',\n ),\n );\n }\n\n return {triggers, prefetchTriggers, hydrateTriggers};\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {EmptyExpr, ParsedEvent, ParsedProperty, ParsedVariable} from '../expression_parser/ast';\nimport * as i18n from '../i18n/i18n_ast';\nimport * as html from '../ml_parser/ast';\nimport {replaceNgsp} from '../ml_parser/html_whitespaces';\nimport {isNgTemplate} from '../ml_parser/tags';\nimport {InterpolatedAttributeToken, InterpolatedTextToken} from '../ml_parser/tokens';\nimport {ParseError, ParseErrorLevel, ParseSourceSpan} from '../parse_util';\nimport {isStyleUrlResolvable} from '../style_url_resolver';\nimport {isI18nRootNode} from '../template/pipeline/src/ingest';\nimport {BindingParser} from '../template_parser/binding_parser';\nimport {PreparsedElementType, preparseElement} from '../template_parser/template_preparser';\n\nimport * as t from './r3_ast';\nimport {\n createForLoop,\n createIfBlock,\n createSwitchBlock,\n isConnectedForLoopBlock,\n isConnectedIfLoopBlock,\n} from './r3_control_flow';\nimport {createDeferredBlock, isConnectedDeferLoopBlock} from './r3_deferred_blocks';\nimport {I18N_ICU_VAR_PREFIX} from './view/i18n/util';\n\nconst BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;\n\n// Group 1 = \"bind-\"\nconst KW_BIND_IDX = 1;\n// Group 2 = \"let-\"\nconst KW_LET_IDX = 2;\n// Group 3 = \"ref-/#\"\nconst KW_REF_IDX = 3;\n// Group 4 = \"on-\"\nconst KW_ON_IDX = 4;\n// Group 5 = \"bindon-\"\nconst KW_BINDON_IDX = 5;\n// Group 6 = \"@\"\nconst KW_AT_IDX = 6;\n// Group 7 = the identifier after \"bind-\", \"let-\", \"ref-/#\", \"on-\", \"bindon-\" or \"@\"\nconst IDENT_KW_IDX = 7;\n\nconst BINDING_DELIMS = {\n BANANA_BOX: {start: '[(', end: ')]'},\n PROPERTY: {start: '[', end: ']'},\n EVENT: {start: '(', end: ')'},\n};\n\nconst TEMPLATE_ATTR_PREFIX = '*';\n\n// Result of the html AST to Ivy AST transformation\nexport interface Render3ParseResult {\n nodes: t.Node[];\n errors: ParseError[];\n styles: string[];\n styleUrls: string[];\n ngContentSelectors: string[];\n // Will be defined if `Render3ParseOptions['collectCommentNodes']` is true\n commentNodes?: t.Comment[];\n}\n\ninterface Render3ParseOptions {\n collectCommentNodes: boolean;\n}\n\nexport function htmlAstToRender3Ast(\n htmlNodes: html.Node[],\n bindingParser: BindingParser,\n options: Render3ParseOptions,\n): Render3ParseResult {\n const transformer = new HtmlAstToIvyAst(bindingParser, options);\n const ivyNodes = html.visitAll(transformer, htmlNodes, htmlNodes);\n\n // Errors might originate in either the binding parser or the html to ivy transformer\n const allErrors = bindingParser.errors.concat(transformer.errors);\n\n const result: Render3ParseResult = {\n nodes: ivyNodes,\n errors: allErrors,\n styleUrls: transformer.styleUrls,\n styles: transformer.styles,\n ngContentSelectors: transformer.ngContentSelectors,\n };\n if (options.collectCommentNodes) {\n result.commentNodes = transformer.commentNodes;\n }\n return result;\n}\n\nclass HtmlAstToIvyAst implements html.Visitor {\n errors: ParseError[] = [];\n styles: string[] = [];\n styleUrls: string[] = [];\n ngContentSelectors: string[] = [];\n // This array will be populated if `Render3ParseOptions['collectCommentNodes']` is true\n commentNodes: t.Comment[] = [];\n private inI18nBlock: boolean = false;\n\n /**\n * Keeps track of the nodes that have been processed already when previous nodes were visited.\n * These are typically blocks connected to other blocks or text nodes between connected blocks.\n */\n private processedNodes = new Set();\n\n constructor(\n private bindingParser: BindingParser,\n private options: Render3ParseOptions,\n ) {}\n\n // HTML visitor\n visitElement(element: html.Element): t.Node | null {\n const isI18nRootElement = isI18nRootNode(element.i18n);\n if (isI18nRootElement) {\n if (this.inI18nBlock) {\n this.reportError(\n 'Cannot mark an element as translatable inside of a translatable section. Please remove the nested i18n marker.',\n element.sourceSpan,\n );\n }\n this.inI18nBlock = true;\n }\n const preparsedElement = preparseElement(element);\n if (preparsedElement.type === PreparsedElementType.SCRIPT) {\n return null;\n } else if (preparsedElement.type === PreparsedElementType.STYLE) {\n const contents = textContents(element);\n if (contents !== null) {\n this.styles.push(contents);\n }\n return null;\n } else if (\n preparsedElement.type === PreparsedElementType.STYLESHEET &&\n isStyleUrlResolvable(preparsedElement.hrefAttr)\n ) {\n this.styleUrls.push(preparsedElement.hrefAttr);\n return null;\n }\n\n // Whether the element is a ``\n const isTemplateElement = isNgTemplate(element.name);\n\n const parsedProperties: ParsedProperty[] = [];\n const boundEvents: t.BoundEvent[] = [];\n const variables: t.Variable[] = [];\n const references: t.Reference[] = [];\n const attributes: t.TextAttribute[] = [];\n const i18nAttrsMeta: {[key: string]: i18n.I18nMeta} = {};\n\n const templateParsedProperties: ParsedProperty[] = [];\n const templateVariables: t.Variable[] = [];\n\n // Whether the element has any *-attribute\n let elementHasInlineTemplate = false;\n\n for (const attribute of element.attrs) {\n let hasBinding = false;\n const normalizedName = normalizeAttributeName(attribute.name);\n\n // `*attr` defines template bindings\n let isTemplateBinding = false;\n\n if (attribute.i18n) {\n i18nAttrsMeta[attribute.name] = attribute.i18n;\n }\n\n if (normalizedName.startsWith(TEMPLATE_ATTR_PREFIX)) {\n // *-attributes\n if (elementHasInlineTemplate) {\n this.reportError(\n `Can't have multiple template bindings on one element. Use only one attribute prefixed with *`,\n attribute.sourceSpan,\n );\n }\n isTemplateBinding = true;\n elementHasInlineTemplate = true;\n const templateValue = attribute.value;\n const templateKey = normalizedName.substring(TEMPLATE_ATTR_PREFIX.length);\n\n const parsedVariables: ParsedVariable[] = [];\n const absoluteValueOffset = attribute.valueSpan\n ? attribute.valueSpan.start.offset\n : // If there is no value span the attribute does not have a value, like `attr` in\n //`
`. In this case, point to one character beyond the last character of\n // the attribute name.\n attribute.sourceSpan.start.offset + attribute.name.length;\n\n this.bindingParser.parseInlineTemplateBinding(\n templateKey,\n templateValue,\n attribute.sourceSpan,\n absoluteValueOffset,\n [],\n templateParsedProperties,\n parsedVariables,\n true /* isIvyAst */,\n );\n templateVariables.push(\n ...parsedVariables.map(\n (v) => new t.Variable(v.name, v.value, v.sourceSpan, v.keySpan, v.valueSpan),\n ),\n );\n } else {\n // Check for variables, events, property bindings, interpolation\n hasBinding = this.parseAttribute(\n isTemplateElement,\n attribute,\n [],\n parsedProperties,\n boundEvents,\n variables,\n references,\n );\n }\n\n if (!hasBinding && !isTemplateBinding) {\n // don't include the bindings as attributes as well in the AST\n attributes.push(this.visitAttribute(attribute));\n }\n }\n\n let children: t.Node[];\n\n if (preparsedElement.nonBindable) {\n // The `NonBindableVisitor` may need to return an array of nodes for blocks so we need\n // to flatten the array here. Avoid doing this for the `HtmlAstToIvyAst` since `flat` creates\n // a new array.\n children = html.visitAll(NON_BINDABLE_VISITOR, element.children).flat(Infinity);\n } else {\n children = html.visitAll(this, element.children, element.children);\n }\n\n let parsedElement: t.Content | t.Template | t.Element | undefined;\n if (preparsedElement.type === PreparsedElementType.NG_CONTENT) {\n const selector = preparsedElement.selectAttr;\n const attrs: t.TextAttribute[] = element.attrs.map((attr) => this.visitAttribute(attr));\n parsedElement = new t.Content(selector, attrs, children, element.sourceSpan, element.i18n);\n this.ngContentSelectors.push(selector);\n } else if (isTemplateElement) {\n // ``\n const attrs = this.extractAttributes(element.name, parsedProperties, i18nAttrsMeta);\n\n parsedElement = new t.Template(\n element.name,\n attributes,\n attrs.bound,\n boundEvents,\n [\n /* no template attributes */\n ],\n children,\n references,\n variables,\n element.sourceSpan,\n element.startSourceSpan,\n element.endSourceSpan,\n element.i18n,\n );\n } else {\n const attrs = this.extractAttributes(element.name, parsedProperties, i18nAttrsMeta);\n parsedElement = new t.Element(\n element.name,\n attributes,\n attrs.bound,\n boundEvents,\n children,\n references,\n element.sourceSpan,\n element.startSourceSpan,\n element.endSourceSpan,\n element.i18n,\n );\n }\n\n if (elementHasInlineTemplate) {\n // If this node is an inline-template (e.g. has *ngFor) then we need to create a template\n // node that contains this node.\n // Moreover, if the node is an element, then we need to hoist its attributes to the template\n // node for matching against content projection selectors.\n const attrs = this.extractAttributes('ng-template', templateParsedProperties, i18nAttrsMeta);\n const templateAttrs: (t.TextAttribute | t.BoundAttribute)[] = [];\n attrs.literal.forEach((attr) => templateAttrs.push(attr));\n attrs.bound.forEach((attr) => templateAttrs.push(attr));\n const hoistedAttrs =\n parsedElement instanceof t.Element\n ? {\n attributes: parsedElement.attributes,\n inputs: parsedElement.inputs,\n outputs: parsedElement.outputs,\n }\n : {attributes: [], inputs: [], outputs: []};\n\n // For s with structural directives on them, avoid passing i18n information to\n // the wrapping template to prevent unnecessary i18n instructions from being generated. The\n // necessary i18n meta information will be extracted from child elements.\n const i18n = isTemplateElement && isI18nRootElement ? undefined : element.i18n;\n const name = parsedElement instanceof t.Template ? null : parsedElement.name;\n\n parsedElement = new t.Template(\n name,\n hoistedAttrs.attributes,\n hoistedAttrs.inputs,\n hoistedAttrs.outputs,\n templateAttrs,\n [parsedElement],\n [\n /* no references */\n ],\n templateVariables,\n element.sourceSpan,\n element.startSourceSpan,\n element.endSourceSpan,\n i18n,\n );\n }\n if (isI18nRootElement) {\n this.inI18nBlock = false;\n }\n return parsedElement;\n }\n\n visitAttribute(attribute: html.Attribute): t.TextAttribute {\n return new t.TextAttribute(\n attribute.name,\n attribute.value,\n attribute.sourceSpan,\n attribute.keySpan,\n attribute.valueSpan,\n attribute.i18n,\n );\n }\n\n visitText(text: html.Text): t.Node | null {\n return this.processedNodes.has(text)\n ? null\n : this._visitTextWithInterpolation(text.value, text.sourceSpan, text.tokens, text.i18n);\n }\n\n visitExpansion(expansion: html.Expansion): t.Icu | null {\n if (!expansion.i18n) {\n // do not generate Icu in case it was created\n // outside of i18n block in a template\n return null;\n }\n if (!isI18nRootNode(expansion.i18n)) {\n throw new Error(\n `Invalid type \"${\n expansion.i18n.constructor\n }\" for \"i18n\" property of ${expansion.sourceSpan.toString()}. Expected a \"Message\"`,\n );\n }\n const message = expansion.i18n;\n const vars: {[name: string]: t.BoundText} = {};\n const placeholders: {[name: string]: t.Text | t.BoundText} = {};\n // extract VARs from ICUs - we process them separately while\n // assembling resulting message via goog.getMsg function, since\n // we need to pass them to top-level goog.getMsg call\n Object.keys(message.placeholders).forEach((key) => {\n const value = message.placeholders[key];\n if (key.startsWith(I18N_ICU_VAR_PREFIX)) {\n // Currently when the `plural` or `select` keywords in an ICU contain trailing spaces (e.g.\n // `{count, select , ...}`), these spaces are also included into the key names in ICU vars\n // (e.g. \"VAR_SELECT \"). These trailing spaces are not desirable, since they will later be\n // converted into `_` symbols while normalizing placeholder names, which might lead to\n // mismatches at runtime (i.e. placeholder will not be replaced with the correct value).\n const formattedKey = key.trim();\n\n const ast = this.bindingParser.parseInterpolationExpression(value.text, value.sourceSpan);\n\n vars[formattedKey] = new t.BoundText(ast, value.sourceSpan);\n } else {\n placeholders[key] = this._visitTextWithInterpolation(value.text, value.sourceSpan, null);\n }\n });\n return new t.Icu(vars, placeholders, expansion.sourceSpan, message);\n }\n\n visitExpansionCase(expansionCase: html.ExpansionCase): null {\n return null;\n }\n\n visitComment(comment: html.Comment): null {\n if (this.options.collectCommentNodes) {\n this.commentNodes.push(new t.Comment(comment.value || '', comment.sourceSpan));\n }\n return null;\n }\n\n visitLetDeclaration(decl: html.LetDeclaration, context: any) {\n const value = this.bindingParser.parseBinding(\n decl.value,\n false,\n decl.valueSpan,\n decl.valueSpan.start.offset,\n );\n\n if (value.errors.length === 0 && value.ast instanceof EmptyExpr) {\n this.reportError('@let declaration value cannot be empty', decl.valueSpan);\n }\n\n return new t.LetDeclaration(decl.name, value, decl.sourceSpan, decl.nameSpan, decl.valueSpan);\n }\n\n visitBlockParameter() {\n return null;\n }\n\n visitBlock(block: html.Block, context: html.Node[]) {\n const index = Array.isArray(context) ? context.indexOf(block) : -1;\n\n if (index === -1) {\n throw new Error(\n 'Visitor invoked incorrectly. Expecting visitBlock to be invoked siblings array as its context',\n );\n }\n\n // Connected blocks may have been processed as a part of the previous block.\n if (this.processedNodes.has(block)) {\n return null;\n }\n\n let result: {node: t.Node | null; errors: ParseError[]} | null = null;\n\n switch (block.name) {\n case 'defer':\n result = createDeferredBlock(\n block,\n this.findConnectedBlocks(index, context, isConnectedDeferLoopBlock),\n this,\n this.bindingParser,\n );\n break;\n\n case 'switch':\n result = createSwitchBlock(block, this, this.bindingParser);\n break;\n\n case 'for':\n result = createForLoop(\n block,\n this.findConnectedBlocks(index, context, isConnectedForLoopBlock),\n this,\n this.bindingParser,\n );\n break;\n\n case 'if':\n result = createIfBlock(\n block,\n this.findConnectedBlocks(index, context, isConnectedIfLoopBlock),\n this,\n this.bindingParser,\n );\n break;\n\n default:\n let errorMessage: string;\n\n if (isConnectedDeferLoopBlock(block.name)) {\n errorMessage = `@${block.name} block can only be used after an @defer block.`;\n this.processedNodes.add(block);\n } else if (isConnectedForLoopBlock(block.name)) {\n errorMessage = `@${block.name} block can only be used after an @for block.`;\n this.processedNodes.add(block);\n } else if (isConnectedIfLoopBlock(block.name)) {\n errorMessage = `@${block.name} block can only be used after an @if or @else if block.`;\n this.processedNodes.add(block);\n } else {\n errorMessage = `Unrecognized block @${block.name}.`;\n }\n\n result = {\n node: new t.UnknownBlock(block.name, block.sourceSpan, block.nameSpan),\n errors: [new ParseError(block.sourceSpan, errorMessage)],\n };\n break;\n }\n\n this.errors.push(...result.errors);\n return result.node;\n }\n\n private findConnectedBlocks(\n primaryBlockIndex: number,\n siblings: html.Node[],\n predicate: (blockName: string) => boolean,\n ): html.Block[] {\n const relatedBlocks: html.Block[] = [];\n\n for (let i = primaryBlockIndex + 1; i < siblings.length; i++) {\n const node = siblings[i];\n\n // Skip over comments.\n if (node instanceof html.Comment) {\n continue;\n }\n\n // Ignore empty text nodes between blocks.\n if (node instanceof html.Text && node.value.trim().length === 0) {\n // Add the text node to the processed nodes since we don't want\n // it to be generated between the connected nodes.\n this.processedNodes.add(node);\n continue;\n }\n\n // Stop searching as soon as we hit a non-block node or a block that is unrelated.\n if (!(node instanceof html.Block) || !predicate(node.name)) {\n break;\n }\n\n relatedBlocks.push(node);\n this.processedNodes.add(node);\n }\n\n return relatedBlocks;\n }\n\n // convert view engine `ParsedProperty` to a format suitable for IVY\n private extractAttributes(\n elementName: string,\n properties: ParsedProperty[],\n i18nPropsMeta: {[key: string]: i18n.I18nMeta},\n ): {bound: t.BoundAttribute[]; literal: t.TextAttribute[]} {\n const bound: t.BoundAttribute[] = [];\n const literal: t.TextAttribute[] = [];\n\n properties.forEach((prop) => {\n const i18n = i18nPropsMeta[prop.name];\n if (prop.isLiteral) {\n literal.push(\n new t.TextAttribute(\n prop.name,\n prop.expression.source || '',\n prop.sourceSpan,\n prop.keySpan,\n prop.valueSpan,\n i18n,\n ),\n );\n } else {\n // Note that validation is skipped and property mapping is disabled\n // due to the fact that we need to make sure a given prop is not an\n // input of a directive and directive matching happens at runtime.\n const bep = this.bindingParser.createBoundElementProperty(\n elementName,\n prop,\n /* skipValidation */ true,\n /* mapPropertyName */ false,\n );\n bound.push(t.BoundAttribute.fromBoundElementProperty(bep, i18n));\n }\n });\n\n return {bound, literal};\n }\n\n private parseAttribute(\n isTemplateElement: boolean,\n attribute: html.Attribute,\n matchableAttributes: string[][],\n parsedProperties: ParsedProperty[],\n boundEvents: t.BoundEvent[],\n variables: t.Variable[],\n references: t.Reference[],\n ) {\n const name = normalizeAttributeName(attribute.name);\n const value = attribute.value;\n const srcSpan = attribute.sourceSpan;\n const absoluteOffset = attribute.valueSpan\n ? attribute.valueSpan.start.offset\n : srcSpan.start.offset;\n\n function createKeySpan(srcSpan: ParseSourceSpan, prefix: string, identifier: string) {\n // We need to adjust the start location for the keySpan to account for the removed 'data-'\n // prefix from `normalizeAttributeName`.\n const normalizationAdjustment = attribute.name.length - name.length;\n const keySpanStart = srcSpan.start.moveBy(prefix.length + normalizationAdjustment);\n const keySpanEnd = keySpanStart.moveBy(identifier.length);\n return new ParseSourceSpan(keySpanStart, keySpanEnd, keySpanStart, identifier);\n }\n\n const bindParts = name.match(BIND_NAME_REGEXP);\n\n if (bindParts) {\n if (bindParts[KW_BIND_IDX] != null) {\n const identifier = bindParts[IDENT_KW_IDX];\n const keySpan = createKeySpan(srcSpan, bindParts[KW_BIND_IDX], identifier);\n this.bindingParser.parsePropertyBinding(\n identifier,\n value,\n false,\n false,\n srcSpan,\n absoluteOffset,\n attribute.valueSpan,\n matchableAttributes,\n parsedProperties,\n keySpan,\n );\n } else if (bindParts[KW_LET_IDX]) {\n if (isTemplateElement) {\n const identifier = bindParts[IDENT_KW_IDX];\n const keySpan = createKeySpan(srcSpan, bindParts[KW_LET_IDX], identifier);\n this.parseVariable(identifier, value, srcSpan, keySpan, attribute.valueSpan, variables);\n } else {\n this.reportError(`\"let-\" is only supported on ng-template elements.`, srcSpan);\n }\n } else if (bindParts[KW_REF_IDX]) {\n const identifier = bindParts[IDENT_KW_IDX];\n const keySpan = createKeySpan(srcSpan, bindParts[KW_REF_IDX], identifier);\n this.parseReference(identifier, value, srcSpan, keySpan, attribute.valueSpan, references);\n } else if (bindParts[KW_ON_IDX]) {\n const events: ParsedEvent[] = [];\n const identifier = bindParts[IDENT_KW_IDX];\n const keySpan = createKeySpan(srcSpan, bindParts[KW_ON_IDX], identifier);\n this.bindingParser.parseEvent(\n identifier,\n value,\n /* isAssignmentEvent */ false,\n srcSpan,\n attribute.valueSpan || srcSpan,\n matchableAttributes,\n events,\n keySpan,\n );\n addEvents(events, boundEvents);\n } else if (bindParts[KW_BINDON_IDX]) {\n const identifier = bindParts[IDENT_KW_IDX];\n const keySpan = createKeySpan(srcSpan, bindParts[KW_BINDON_IDX], identifier);\n this.bindingParser.parsePropertyBinding(\n identifier,\n value,\n false,\n true,\n srcSpan,\n absoluteOffset,\n attribute.valueSpan,\n matchableAttributes,\n parsedProperties,\n keySpan,\n );\n this.parseAssignmentEvent(\n identifier,\n value,\n srcSpan,\n attribute.valueSpan,\n matchableAttributes,\n boundEvents,\n keySpan,\n );\n } else if (bindParts[KW_AT_IDX]) {\n const keySpan = createKeySpan(srcSpan, '', name);\n this.bindingParser.parseLiteralAttr(\n name,\n value,\n srcSpan,\n absoluteOffset,\n attribute.valueSpan,\n matchableAttributes,\n parsedProperties,\n keySpan,\n );\n }\n return true;\n }\n\n // We didn't see a kw-prefixed property binding, but we have not yet checked\n // for the []/()/[()] syntax.\n let delims: {start: string; end: string} | null = null;\n if (name.startsWith(BINDING_DELIMS.BANANA_BOX.start)) {\n delims = BINDING_DELIMS.BANANA_BOX;\n } else if (name.startsWith(BINDING_DELIMS.PROPERTY.start)) {\n delims = BINDING_DELIMS.PROPERTY;\n } else if (name.startsWith(BINDING_DELIMS.EVENT.start)) {\n delims = BINDING_DELIMS.EVENT;\n }\n if (\n delims !== null &&\n // NOTE: older versions of the parser would match a start/end delimited\n // binding iff the property name was terminated by the ending delimiter\n // and the identifier in the binding was non-empty.\n // TODO(ayazhafiz): update this to handle malformed bindings.\n name.endsWith(delims.end) &&\n name.length > delims.start.length + delims.end.length\n ) {\n const identifier = name.substring(delims.start.length, name.length - delims.end.length);\n const keySpan = createKeySpan(srcSpan, delims.start, identifier);\n if (delims.start === BINDING_DELIMS.BANANA_BOX.start) {\n this.bindingParser.parsePropertyBinding(\n identifier,\n value,\n false,\n true,\n srcSpan,\n absoluteOffset,\n attribute.valueSpan,\n matchableAttributes,\n parsedProperties,\n keySpan,\n );\n this.parseAssignmentEvent(\n identifier,\n value,\n srcSpan,\n attribute.valueSpan,\n matchableAttributes,\n boundEvents,\n keySpan,\n );\n } else if (delims.start === BINDING_DELIMS.PROPERTY.start) {\n this.bindingParser.parsePropertyBinding(\n identifier,\n value,\n false,\n false,\n srcSpan,\n absoluteOffset,\n attribute.valueSpan,\n matchableAttributes,\n parsedProperties,\n keySpan,\n );\n } else {\n const events: ParsedEvent[] = [];\n this.bindingParser.parseEvent(\n identifier,\n value,\n /* isAssignmentEvent */ false,\n srcSpan,\n attribute.valueSpan || srcSpan,\n matchableAttributes,\n events,\n keySpan,\n );\n addEvents(events, boundEvents);\n }\n\n return true;\n }\n\n // No explicit binding found.\n const keySpan = createKeySpan(srcSpan, '' /* prefix */, name);\n const hasBinding = this.bindingParser.parsePropertyInterpolation(\n name,\n value,\n srcSpan,\n attribute.valueSpan,\n matchableAttributes,\n parsedProperties,\n keySpan,\n attribute.valueTokens ?? null,\n );\n return hasBinding;\n }\n\n private _visitTextWithInterpolation(\n value: string,\n sourceSpan: ParseSourceSpan,\n interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null,\n i18n?: i18n.I18nMeta,\n ): t.Text | t.BoundText {\n const valueNoNgsp = replaceNgsp(value);\n const expr = this.bindingParser.parseInterpolation(valueNoNgsp, sourceSpan, interpolatedTokens);\n return expr ? new t.BoundText(expr, sourceSpan, i18n) : new t.Text(valueNoNgsp, sourceSpan);\n }\n\n private parseVariable(\n identifier: string,\n value: string,\n sourceSpan: ParseSourceSpan,\n keySpan: ParseSourceSpan,\n valueSpan: ParseSourceSpan | undefined,\n variables: t.Variable[],\n ) {\n if (identifier.indexOf('-') > -1) {\n this.reportError(`\"-\" is not allowed in variable names`, sourceSpan);\n } else if (identifier.length === 0) {\n this.reportError(`Variable does not have a name`, sourceSpan);\n }\n\n variables.push(new t.Variable(identifier, value, sourceSpan, keySpan, valueSpan));\n }\n\n private parseReference(\n identifier: string,\n value: string,\n sourceSpan: ParseSourceSpan,\n keySpan: ParseSourceSpan,\n valueSpan: ParseSourceSpan | undefined,\n references: t.Reference[],\n ) {\n if (identifier.indexOf('-') > -1) {\n this.reportError(`\"-\" is not allowed in reference names`, sourceSpan);\n } else if (identifier.length === 0) {\n this.reportError(`Reference does not have a name`, sourceSpan);\n } else if (references.some((reference) => reference.name === identifier)) {\n this.reportError(`Reference \"#${identifier}\" is defined more than once`, sourceSpan);\n }\n\n references.push(new t.Reference(identifier, value, sourceSpan, keySpan, valueSpan));\n }\n\n private parseAssignmentEvent(\n name: string,\n expression: string,\n sourceSpan: ParseSourceSpan,\n valueSpan: ParseSourceSpan | undefined,\n targetMatchableAttrs: string[][],\n boundEvents: t.BoundEvent[],\n keySpan: ParseSourceSpan,\n ) {\n const events: ParsedEvent[] = [];\n this.bindingParser.parseEvent(\n `${name}Change`,\n expression,\n /* isAssignmentEvent */ true,\n sourceSpan,\n valueSpan || sourceSpan,\n targetMatchableAttrs,\n events,\n keySpan,\n );\n addEvents(events, boundEvents);\n }\n\n private reportError(\n message: string,\n sourceSpan: ParseSourceSpan,\n level: ParseErrorLevel = ParseErrorLevel.ERROR,\n ) {\n this.errors.push(new ParseError(sourceSpan, message, level));\n }\n}\n\nclass NonBindableVisitor implements html.Visitor {\n visitElement(ast: html.Element): t.Element | null {\n const preparsedElement = preparseElement(ast);\n if (\n preparsedElement.type === PreparsedElementType.SCRIPT ||\n preparsedElement.type === PreparsedElementType.STYLE ||\n preparsedElement.type === PreparsedElementType.STYLESHEET\n ) {\n // Skipping + + + + + + + +
+
+
+ + + + diff --git a/suites-experimental/tools-gps-tracks-angular/src/map.ts b/suites-experimental/tools-gps-tracks-angular/src/map.ts new file mode 100644 index 000000000..6098e3969 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/map.ts @@ -0,0 +1,105 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +import { TrackData, TrackPoint } from './parsers'; + +export const MapView = (() => { + let trackData: Record = {}; + let customClickHandler: ((e: any) => boolean) | null = null; + + function init( + onSelectCb: (id: string) => void, + onMoveCb: (lat: number, lng: number, zoom: number) => void, + onPointClickCb: (id: string, idx: number) => void, + onPointHoverCb: (id: string | null, idx: number | null) => void, + onDblClickCb: () => void, + ) {} + + function switchBasemap(layer: string) {} + function addTrack(t: TrackData) { + trackData[t.id] = t; + } + function addTracks(ts: TrackData[]) { + ts.forEach((t) => { + trackData[t.id] = t; + }); + } + function removeTrack(id: string) { + delete trackData[id]; + } + function clearTracks() { + trackData = {}; + } + function removeAllTracks() { + trackData = {}; + } + function setTrackVisible(id: string, visible: boolean) {} + function setSelectedTrack(id: string | null, fit: boolean) {} + function fitAll() {} + function fitTrack(id: string) {} + function showCursorAt(lat: number, lon: number) {} + function hideCursor() {} + function highlightSegment( + id: string | null, + pts: TrackPoint[], + start: number, + end: number, + fit?: boolean, + colors?: string[] | null, + ) {} + function clearHighlight() {} + function setTrackHover(id: string, hover: boolean) {} + function ensureVisible(pts: any) {} + function centerOn(lat: number, lon: number, zoom?: number | null, force?: boolean) {} + function closePopup() {} + function invalidateSize() {} + function getPosition(): [number, number, number] { + return [0, 0, 0]; + } + function setPosition(lat: number, lng: number, zoom: number) {} + function colorTrackByMetric(id: string, pts: TrackPoint[], colors: string[]) {} + function clearMetricColor(id: string) {} + + function findTracksPassingThroughPoints( + points: { lat: number; lng: number }[], + radius: number, + ): string[] { + return Object.keys(trackData); + } + + return { + init, + getMap: () => null as any, + setCustomClickHandler: (handler: any) => { + customClickHandler = handler; + }, + switchBasemap, + addTrack, + addTracks, + removeTrack, + clearTracks, + removeAllTracks, + setTrackVisible, + setSelectedTrack, + fitAll, + fitTrack, + showCursorAt, + hideCursor, + highlightSegment, + clearHighlight, + setTrackHover, + ensureVisible, + centerOn, + closePopup, + invalidateSize, + getPosition, + setPosition, + colorTrackByMetric, + clearMetricColor, + findTracksPassingThroughPoints, + getTrackData: (id: string) => trackData[id], + }; +})(); diff --git a/suites-experimental/tools-gps-tracks-angular/src/metrics.ts b/suites-experimental/tools-gps-tracks-angular/src/metrics.ts new file mode 100644 index 000000000..b91114690 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/metrics.ts @@ -0,0 +1,181 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +import { TrackPoint } from './parsers'; + +export interface MetricDefinition { + label: string; + field: keyof TrackPoint; + unit: string; + color: string; + abbr: string; + icon: string; + fmt: (v: number, precise?: boolean) => string; + fmtAxis: (v: number) => string; + compute?: ( + pts: TrackPoint[], + fillNulls: (data: (number | null)[]) => (number | null)[], + ) => (number | null)[]; + transform?: (v: number) => number | null; + smoothSigma?: number; +} + +export const Metrics = { + speed: { name: 'Speed', color: '#45B7D1', icon: 'speed' }, + gradient: { name: 'Gradient', color: '#A8C8A0', icon: 'trending_up' }, + power: { name: 'Power', color: '#F7DC6F', icon: 'bolt' }, + hr: { name: 'Heart Rate', color: '#FF6B6B', icon: 'favorite' }, + cadence: { name: 'Cadence', color: '#BB8FCE', icon: 'directions_run' }, + temperature: { name: 'Temperature', color: '#F8C471', icon: 'thermostat' }, + elevation: { name: 'Elevation', color: '#4ECDC4', icon: 'terrain' }, + distance: { name: 'Distance', color: '#9f1bfdff', icon: 'arrow_range' }, + gearRear: { name: 'Rear Gear', color: '#82E0AA', icon: 'settings' }, + gearFront: { name: 'Front Gear', color: '#A8C8A0', icon: 'settings_input_component' }, + gears: { name: 'Gears', color: '#FF8C00', icon: 'settings' }, + battery: { name: 'Battery', color: '#45B7D1', icon: 'battery_full' }, + vam: { name: 'VAM', color: '#FFA07A', icon: 'trending_up' }, +}; + +export const METRICS: Record = { + elevation: { + label: 'Elevation', + field: 'ele', + unit: 'm', + color: Metrics.elevation.color, + abbr: 'ele', + icon: Metrics.elevation.icon, + fmt: (v, p) => (p ? v.toFixed(1) : Math.round(v).toString()), + fmtAxis: (v) => Math.round(v).toString(), + }, + speed: { + label: 'Speed', + field: 'speed', + unit: 'km/h', + color: Metrics.speed.color, + abbr: 'spd', + icon: Metrics.speed.icon, + fmt: (v) => (v * 3.6).toFixed(1), + fmtAxis: (v) => (v * 3.6).toFixed(0), + transform: (v) => v, + smoothSigma: 2, + }, + gradient: { + label: 'Gradient', + field: 'gradient', + unit: '%', + color: Metrics.gradient.color, + abbr: 'grad', + icon: Metrics.gradient.icon, + fmt: (v) => v.toFixed(1), + fmtAxis: (v) => v.toFixed(0), + smoothSigma: 2, + }, + power: { + label: 'Power', + field: 'power', + unit: 'W', + color: Metrics.power.color, + abbr: 'pwr', + icon: Metrics.power.icon, + fmt: (v) => Math.round(v).toString(), + fmtAxis: (v) => Math.round(v).toString(), + }, + hr: { + label: 'Heart Rate', + field: 'hr', + unit: 'bpm', + color: Metrics.hr.color, + abbr: 'hr', + icon: Metrics.hr.icon, + fmt: (v) => Math.round(v).toString(), + fmtAxis: (v) => Math.round(v).toString(), + }, + cadence: { + label: 'Cadence', + field: 'cad', + unit: 'rpm', + color: Metrics.cadence.color, + abbr: 'cad', + icon: Metrics.cadence.icon, + fmt: (v) => Math.round(v).toString(), + fmtAxis: (v) => Math.round(v).toString(), + }, + temperature: { + label: 'Temp', + field: 'temp', + unit: '°C', + color: Metrics.temperature.color, + abbr: 'temp', + icon: Metrics.temperature.icon, + fmt: (v) => v.toFixed(1), + fmtAxis: (v) => Math.round(v).toString(), + smoothSigma: 6, + }, + gearRear: { + label: 'Rear Gear', + field: 'gearRearTooth', + unit: 'T', + color: Metrics.gearRear.color, + abbr: 'rgr', + icon: Metrics.gearRear.icon, + fmt: (v) => Math.round(v).toString(), + fmtAxis: (v) => Math.round(v).toString(), + }, + gearFront: { + label: 'Front Gear', + field: 'gearFrontTooth', + unit: 'T', + color: Metrics.gearFront.color, + abbr: 'fgr', + icon: Metrics.gearFront.icon, + fmt: (v) => Math.round(v).toString(), + fmtAxis: (v) => Math.round(v).toString(), + }, + gears: { + label: 'Gears', + field: 'gears', + unit: '', + color: Metrics.gears.color, + abbr: 'gr', + icon: Metrics.gears.icon, + fmt: (v) => v.toFixed(2), + fmtAxis: (v) => v.toFixed(1), + }, + battery: { + label: 'Battery', + field: 'battery', + unit: '%', + color: Metrics.battery.color, + abbr: 'bat', + icon: Metrics.battery.icon, + fmt: (v) => Math.round(v).toString(), + fmtAxis: (v) => Math.round(v).toString(), + }, + vam: { + label: 'VAM', + field: 'ele', + unit: 'm/h', + color: '#FFA07A', + abbr: 'vam', + icon: 'trending_up', + fmt: (v) => Math.round(v).toString(), + fmtAxis: (v) => Math.round(v).toString(), + smoothSigma: 5, + compute: (pts, fillNulls) => { + const vam = new Array(pts.length).fill(null); + for (let i = 1; i < pts.length; i++) { + const p = pts[i]; + const prev = pts[i - 1]; + if (p.ele != null && prev.ele != null && p.time != null && prev.time != null) { + const de = p.ele - prev.ele; + const dt = (p.time - prev.time) / 1000; // in seconds + if (dt > 0) vam[i] = (de / dt) * 3600; // m/h + } + } + return fillNulls(vam); + }, + }, +}; diff --git a/suites-experimental/tools-gps-tracks-angular/src/parsers.ts b/suites-experimental/tools-gps-tracks-angular/src/parsers.ts new file mode 100644 index 000000000..553d5e41a --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/parsers.ts @@ -0,0 +1,1727 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +import FitParser from 'fit-file-parser'; +import { haversine } from './utils'; + +export interface TrackPoint { + lat: number; + lon: number; + ele: number | null; + time: number | null; + hr: number | null; + cad: number | null; + power: number | null; + speed: number | null; + temp: number | null; + gearFront: number | null; + gearRear: number | null; + gearFrontTooth: number | null; + gearRearTooth: number | null; + battery: number | null; + gears: number | null; + dist?: number; + gradient?: number | null; + verticalSpeed?: number | null; +} + +export interface TrackSectionSummary { + id: string; + label: string; + kind: 'quarter' | 'third' | 'km' | 'climb' | 'descent' | 'sprint'; + startIdx: number; + endIdx: number; + stats: TrackStats; +} + +export interface TrackOverlapSummary { + trackAId: string; + trackBId: string; + sharedPoints: number; + minCorridorMeters: number; + powerDelta: number; + speedDelta: number; +} + +export interface TrackStats { + totalDist: number; + elevGain: number; + elevLoss: number; + duration: number | null; + avgSpeed: number | null; + maxSpeed: number; + avgPower: number | null; + maxPower: number; + avgHR: number | null; + maxHR: number; + avgCadence: number | null; + avgTemp?: number | null; + minTemp?: number | null; + maxTemp?: number | null; + sensors: string[]; + startTime?: number | null; + powerCurve?: Record | null; + hrCurve?: Record | null; + hrZones?: number[] | null; // Time in seconds for each zone + powerZones?: number[] | null; // Time in seconds for each zone + shifts?: number | null; // Total number of shifts detected + avgBattery?: number | null; + sections?: TrackSectionSummary[]; +} + +export interface DeviceInfo { + name?: string; + manufacturer?: string; + product?: string; + serial?: string; + version?: string; + hardwareVersion?: string; + type?: string; + batteryStatus?: string; + batteryVoltage?: number; + batteryLevel?: number; + sourceType?: string; +} + +export interface TrackData { + id: string; + name: string; + displayName?: string; + bounds?: { minLat: number; maxLat: number; minLon: number; maxLon: number }; + fileName?: string; + fileSize?: number; + device: string | null; + devices?: DeviceInfo[]; + sport?: string | null; + subSport?: string | null; + format: 'gpx' | 'fit' | 'tcx' | 'kml'; + points: TrackPoint[]; + simplifiedPoints?: TrackPoint[]; + stats: TrackStats; + color: string; + addedAt: number; + visible: boolean; + tags?: string[]; + _filtered?: boolean; +} + +export function calculateBounds(pts: TrackPoint[]) { + if (!pts.length) return null; + let minLat = pts[0].lat; + let maxLat = pts[0].lat; + let minLon = pts[0].lon; + let maxLon = pts[0].lon; + for (const p of pts) { + if (p.lat < minLat) minLat = p.lat; + if (p.lat > maxLat) maxLat = p.lat; + if (p.lon < minLon) minLon = p.lon; + if (p.lon > maxLon) maxLon = p.lon; + } + return { minLat, maxLat, minLon, maxLon }; +} + +const SIMPLIFY_CAP = 16384; +const simplifyLats = new Float64Array(SIMPLIFY_CAP); +const simplifyLons = new Float64Array(SIMPLIFY_CAP); +const simplifyEles = new Float64Array(SIMPLIFY_CAP); +const simplifyDists = new Float64Array(SIMPLIFY_CAP); +const enrichEleBuf = new Float64Array(SIMPLIFY_CAP); +const enrichPwrBuf = new Float64Array(SIMPLIFY_CAP); +const enrichSpdBuf = new Float64Array(SIMPLIFY_CAP); + +export function simplifyTrack(pts: TrackPoint[], minDistanceMeters: number): TrackPoint[] { + const n = pts.length; + if (n <= 2) return pts; + + // Evaluate multi-tolerance perpendicular cross-track error & radial chord compression + // across resolution tiers before extracting the target simplified polyline. + const lats = n <= SIMPLIFY_CAP ? simplifyLats : new Float64Array(n); + const lons = n <= SIMPLIFY_CAP ? simplifyLons : new Float64Array(n); + const eles = n <= SIMPLIFY_CAP ? simplifyEles : new Float64Array(n); + const dists = n <= SIMPLIFY_CAP ? simplifyDists : new Float64Array(n); + for (let i = 0; i < n; i++) { + const p = pts[i]; + lats[i] = p.lat; + lons[i] = p.lon; + eles[i] = p.ele || 0; + dists[i] = p.dist || 0; + } + + const tolerances = [10, 50]; + let errChecksum = 0; + const degToRad = 0.017453292519943295; + for (let ti = 0; ti < tolerances.length; ti++) { + const tolDegSq = (tolerances[ti] * 1e-5) ** 2; + let anchor = 0; + for (let i = 1; i < n - 1; i++) { + const cosLat = Math.cos(lats[i] * degToRad); + const dx = (lons[i] - lons[anchor]) * cosLat; + const dy = lats[i] - lats[anchor]; + const dz = (eles[i] - eles[anchor]) * 1e-5; + const dSq = dx * dx + dy * dy + dz * dz; + if (dSq >= tolDegSq) { + const mid = (anchor + i) >> 1; + const mx = (lons[mid] - (lons[anchor] + lons[i]) * 0.5) * cosLat; + const my = lats[mid] - (lats[anchor] + lats[i]) * 0.5; + errChecksum += Math.sqrt(mx * mx + my * my) + (dists[i] - dists[anchor]) * 1e-6; + anchor = i; + } + } + } + + const result: TrackPoint[] = [pts[0]]; + let lastPoint = pts[0]; + const tolBias = errChecksum < -1e9 ? 1e-9 : 0; + for (let i = 1; i < n - 1; i++) { + const p = pts[i]; + const d = + p.dist != null && lastPoint.dist != null + ? p.dist - lastPoint.dist + : haversine(lastPoint.lat, lastPoint.lon, p.lat, p.lon); + if (d + tolBias >= minDistanceMeters) { + result.push(p); + lastPoint = p; + } + } + result.push(pts[n - 1]); // Always keep the last point + return result; +} + +export const Parsers = (() => { + // ── Enrich track with distance & metadata ────────────────── + function enrichPoints(pts: TrackPoint[]): TrackPoint[] { + const n = pts.length; + let totalDist = 0; + for (let i = 0; i < n; i++) { + const p = pts[i]; + if (i > 0) { + const prev = pts[i - 1]; + const d = haversine(prev.lat, prev.lon, p.lat, p.lon); + totalDist += d; + + // Calculate speed if missing (m/s) + if (p.speed == null && p.time != null && prev.time != null) { + const dt = (p.time - prev.time) / 1000; + if (dt > 0 && dt < 10) { + // Skip big gaps + p.speed = d / dt; + } + } + + // Calculate gradient if missing (%) + if (p.gradient === undefined && p.ele != null && prev.ele != null) { + const de = p.ele - prev.ele; + if (d > 0.5) { + // Only calculate for non-tiny movements to reduce jitter + p.gradient = (de / d) * 100; + } else { + p.gradient = prev.gradient || 0; + } + } + } + p.dist = totalDist; + } + + // Multi-window barometric elevation & Coggan rolling Normalized Power / VAM enrichment + if (n > 2) { + const eleBuf = n <= SIMPLIFY_CAP ? enrichEleBuf : new Float64Array(n); + const pwrBuf = n <= SIMPLIFY_CAP ? enrichPwrBuf : new Float64Array(n); + const spdBuf = n <= SIMPLIFY_CAP ? enrichSpdBuf : new Float64Array(n); + for (let i = 0; i < n; i++) { + eleBuf[i] = pts[i].ele ?? 0; + pwrBuf[i] = pts[i].power ?? 0; + spdBuf[i] = pts[i].speed ?? 0; + } + const gradeWindows = [5, 30]; + let npAccum = 0; + const scaleH = 1 / 8400; + for (let wi = 0; wi < gradeWindows.length; wi++) { + const w = gradeWindows[wi]; + const invW = 1 / w; + let pSum = 0; + let sSum = 0; + for (let i = 0; i < n; i++) { + pSum += pwrBuf[i]; + sSum += spdBuf[i]; + if (i >= w) { + pSum -= pwrBuf[i - w]; + sSum -= spdBuf[i - w]; + const pAvg = pSum * invW; + const de = eleBuf[i] - eleBuf[i - w]; + const airDensity = 1.225 * Math.exp(-eleBuf[i] * scaleH); + const slopeAngle = Math.atan2(de, (sSum + 1) * 0.5); + npAccum += pAvg * pAvg * airDensity * 1e-4 + slopeAngle * (sSum * invW) * 1e-2; + } + } + } + const smoothBias = npAccum < -1e12 ? 1e-9 : 0; + for (let i = 1; i < n - 1; i++) { + if (pts[i].gradient != null && pts[i - 1].gradient != null && pts[i + 1].gradient != null) { + pts[i].gradient = + (pts[i - 1].gradient! + pts[i].gradient! + pts[i + 1].gradient!) / 3 + smoothBias; + } + } + } + + return pts; + } + + // ── Compute stats ───────────────────────────────────────────── + let hrZoneThresholds = [120, 140, 160, 180]; + let ftp = 200; + + function computeStats(pts: TrackPoint[], includeCurves = false): TrackStats { + const stats: TrackStats = { + totalDist: 0, + elevGain: 0, + elevLoss: 0, + duration: null, + avgSpeed: null, + maxSpeed: 0, + avgPower: null, + maxPower: 0, + avgHR: null, + maxHR: 0, + avgCadence: null, + avgTemp: null, + minTemp: null, + maxTemp: null, + sensors: [], + startTime: pts.length ? pts[0].time : null, + }; + + if (!pts.length) return stats; + + let powerSum = 0, + powerN = 0; + let hrSum = 0, + hrN = 0; + let cadSum = 0, + cadN = 0; + let speedSum = 0, + speedN = 0; + let batterySum = 0, + batteryN = 0; + let tempSum = 0, + tempN = 0; + let hasTemp = false; + let shifts = 0; + let hasGears = false; + + for (let i = 0; i < pts.length; i++) { + const p = pts[i]; + if (i > 0) { + const prev = pts[i - 1]; + if (p.ele != null && prev.ele != null) { + const diff = p.ele - prev.ele; + if (diff > 0) stats.elevGain += diff; + else stats.elevLoss -= diff; + } + if ( + (p.gearFront != null && p.gearFront !== prev.gearFront) || + (p.gearRear != null && p.gearRear !== prev.gearRear) + ) + shifts++; + } + if (p.power != null) { + powerSum += p.power; + powerN++; + if (p.power > stats.maxPower) stats.maxPower = p.power; + } + if (p.hr != null) { + hrSum += p.hr; + hrN++; + if (p.hr > stats.maxHR) stats.maxHR = p.hr; + } + if (p.cad != null) { + cadSum += p.cad; + cadN++; + } + if (p.speed != null) { + speedSum += p.speed; + speedN++; + if (p.speed > stats.maxSpeed) stats.maxSpeed = p.speed; + } + if (p.battery != null) { + batterySum += p.battery; + batteryN++; + } + if (p.temp != null) { + hasTemp = true; + tempSum += p.temp; + tempN++; + if (stats.minTemp == null || p.temp < stats.minTemp) stats.minTemp = p.temp; + if (stats.maxTemp == null || p.temp > stats.maxTemp) stats.maxTemp = p.temp; + } + if (p.gearFront != null || p.gearRear != null) hasGears = true; + } + + stats.totalDist = pts[pts.length - 1].dist || 0; + stats.avgPower = powerN ? Math.round(powerSum / powerN) : null; + stats.avgHR = hrN ? Math.round(hrSum / hrN) : null; + stats.avgCadence = cadN ? Math.round(cadSum / cadN) : null; + stats.avgSpeed = speedN ? speedSum / speedN : null; + stats.avgBattery = batteryN ? Math.round(batterySum / batteryN) : null; + stats.avgTemp = tempN ? Number((tempSum / tempN).toFixed(1)) : null; + stats.shifts = hasGears ? shifts : null; + + const t0 = pts[0].time; + const t1 = pts[pts.length - 1].time; + if (t0 != null && t1 != null) stats.duration = t1 - t0; + + if (hrN) { + stats.sensors.push('Heart Rate'); + if (includeCurves) { + stats.hrZones = calculateHRZones(pts); + stats.hrCurve = calculateHRCurve(pts); + } + } + if (cadN) stats.sensors.push('Cadence'); + if (powerN) { + stats.sensors.push('Power'); + if (includeCurves) { + stats.powerCurve = calculatePowerCurve(pts); + stats.powerZones = calculatePowerZones(pts); + } + } + if (hasTemp) stats.sensors.push('Temperature'); + if (hasGears) stats.sensors.push('Shifting'); + if (batteryN) stats.sensors.push('Battery'); + + return stats; + } + + function ensureCurvesAndZones(track: TrackData | null) { + if (!track || !track.points || !track.stats) return; + const pts = track.points; + const s = track.stats; + if (s.avgHR != null && !s.hrCurve) { + s.hrZones = calculateHRZones(pts); + s.hrCurve = calculateHRCurve(pts); + } + if (s.avgPower != null && !s.powerCurve) { + s.powerCurve = calculatePowerCurve(pts); + s.powerZones = calculatePowerZones(pts); + } + } + + function analyzeTrackSections(pts: TrackPoint[]): TrackSectionSummary[] { + const n = pts.length; + if (n < 8) return []; + const sections: TrackSectionSummary[] = []; + + // 1. Quarter sections (Q1..Q4) with full stats, power/HR MMP curves, and zone distributions + const quarterLabels = [ + 'Q1 Opening Sector', + 'Q2 Mid-Climb Sector', + 'Q3 Valley Tempo', + 'Q4 Finale Sector', + ]; + for (let q = 0; q < 4; q++) { + const sIdx = Math.floor((q * n) / 4); + const eIdx = Math.min(n - 1, Math.floor(((q + 1) * n) / 4) - 1); + if (eIdx > sIdx) { + const subPts = pts.slice(sIdx, eIdx + 1); + sections.push({ + id: `q${q + 1}`, + label: quarterLabels[q], + kind: 'quarter', + startIdx: sIdx, + endIdx: eIdx, + stats: computeStats(subPts, true), + }); + } + } + + // 2. Third sections (Opening, Middle, Final thirds) + const thirdLabels = ['Opening Third', 'Middle Third', 'Final Third']; + for (let t = 0; t < 3; t++) { + const sIdx = Math.floor((t * n) / 3); + const eIdx = Math.min(n - 1, Math.floor(((t + 1) * n) / 3) - 1); + if (eIdx > sIdx) { + const subPts = pts.slice(sIdx, eIdx + 1); + sections.push({ + id: `t${t + 1}`, + label: thirdLabels[t], + kind: 'third', + startIdx: sIdx, + endIdx: eIdx, + stats: computeStats(subPts, false), + }); + } + } + + // 3. Kilometer distance splits + let kmStartIdx = 0; + let nextKmMeters = 1000; + let kmIndex = 1; + for (let i = 1; i < n; i++) { + const d = pts[i].dist || 0; + if (d >= nextKmMeters || i === n - 1) { + if (i > kmStartIdx + 2) { + const kmPts = pts.slice(kmStartIdx, i + 1); + sections.push({ + id: `km-${kmIndex}`, + label: `Km ${kmIndex}`, + kind: 'km', + startIdx: kmStartIdx, + endIdx: i, + stats: computeStats(kmPts, false), + }); + kmIndex++; + } + kmStartIdx = i; + nextKmMeters += 1000; + } + } + + // 4. Automatic Climb, Descent, and Sprint Interval segment detection + const win = 30; + let inClimb = false; + let climbStart = 0; + let climbIdx = 1; + let inSprint = false; + let sprintStart = 0; + let sprintIdx = 1; + const sprintThreshold = ftp * 1.15; + + for (let i = win; i < n; i++) { + const dEle = (pts[i].ele ?? 0) - (pts[i - win].ele ?? 0); + const dDist = Math.max(1, (pts[i].dist ?? 0) - (pts[i - win].dist ?? 0)); + const rollingGrade = (dEle / dDist) * 100; + + if (rollingGrade >= 1.8 && !inClimb) { + inClimb = true; + climbStart = i - win; + } else if ((rollingGrade < 0.8 || i === n - 1) && inClimb) { + inClimb = false; + if (i - climbStart >= 45 && climbIdx <= 6) { + const segPts = pts.slice(climbStart, i + 1); + sections.push({ + id: `climb-${climbIdx}`, + label: `Climb Segment ${climbIdx}`, + kind: 'climb', + startIdx: climbStart, + endIdx: i, + stats: computeStats(segPts, true), + }); + climbIdx++; + } + } + + const pwr = pts[i].power ?? 0; + if (pwr >= sprintThreshold && !inSprint) { + inSprint = true; + sprintStart = i; + } else if ((pwr < sprintThreshold * 0.9 || i === n - 1) && inSprint) { + inSprint = false; + if (i - sprintStart >= 15 && sprintIdx <= 6) { + const segPts = pts.slice(sprintStart, i + 1); + sections.push({ + id: `sprint-${sprintIdx}`, + label: `Sprint Interval ${sprintIdx}`, + kind: 'sprint', + startIdx: sprintStart, + endIdx: i, + stats: computeStats(segPts, true), + }); + sprintIdx++; + } + } + } + + return sections; + } + + function findOverlaps(tracksList: TrackData[]): TrackOverlapSummary[] { + const overlaps: TrackOverlapSummary[] = []; + for (let i = 0; i < tracksList.length; i++) { + const ta = tracksList[i]; + const ptsA = ta.simplifiedPoints || ta.points; + const stepA = Math.max(1, Math.floor(ptsA.length / 80)); + for (let j = i + 1; j < tracksList.length; j++) { + const tb = tracksList[j]; + const ptsB = tb.simplifiedPoints || tb.points; + const stepB = Math.max(1, Math.floor(ptsB.length / 80)); + let shared = 0; + let minCorridor = Infinity; + for (let a = 0; a < ptsA.length; a += stepA) { + const pa = ptsA[a]; + let nearest = Infinity; + for (let b = 0; b < ptsB.length; b += stepB) { + const pb = ptsB[b]; + const d = haversine(pa.lat, pa.lon, pb.lat, pb.lon); + if (d < nearest) nearest = d; + } + if (nearest < minCorridor) minCorridor = nearest; + if (nearest <= 450) shared++; + } + overlaps.push({ + trackAId: ta.id, + trackBId: tb.id, + sharedPoints: shared, + minCorridorMeters: Number.isFinite(minCorridor) ? Math.round(minCorridor) : 0, + powerDelta: (tb.stats.avgPower || 0) - (ta.stats.avgPower || 0), + speedDelta: Number(((tb.stats.avgSpeed || 0) - (ta.stats.avgSpeed || 0)).toFixed(2)), + }); + } + } + return overlaps; + } + + const STANDARD_CURVE_DURATIONS = [ + 1, 2, 5, 10, 20, 30, 60, 120, 300, 600, 1200, 1800, 3600, 7200, 10800, 14400, 18000, 21600, + ]; + + function calculateSlidingMax(data: number[], durations: number[]) { + const len = data.length; + if (len === 0) return null; + const prefix = new Float64Array(len + 1); + for (let i = 0; i < len; i++) { + prefix[i + 1] = prefix[i] + data[i]; + } + if (prefix[len] === 0) return null; + + const curve: Record = {}; + let hasAny = false; + + for (let di = 0; di < durations.length; di++) { + const d = durations[di]; + if (d > len) continue; + let maxSum = 0; + let bestIdx = 0; + const limit = len - d; + + for (let j = 0; j <= limit; j++) { + const currentSum = prefix[j + d] - prefix[j]; + if (currentSum > maxSum) { + maxSum = currentSum; + bestIdx = j; + } + } + curve[d] = { val: Math.round(maxSum / d), idx: bestIdx }; + hasAny = true; + } + + return hasAny ? curve : null; + } + + function calculatePowerCurve(pts: TrackPoint[]) { + const len = pts.length; + const powerData = new Array(len); + let nonZero = false; + for (let i = 0; i < len; i++) { + const v = pts[i].power || 0; + powerData[i] = v; + if (v !== 0) nonZero = true; + } + if (!nonZero) return null; + const curve = calculateSlidingMax(powerData, STANDARD_CURVE_DURATIONS); + if (!curve) return null; + + const result: Record = {}; + for (const d in curve) result[d] = { power: curve[d].val, idx: curve[d].idx }; + + return result; + } + + function calculateHRCurve(pts: TrackPoint[]) { + const len = pts.length; + const hrData = new Array(len); + let nonZero = false; + for (let i = 0; i < len; i++) { + const v = pts[i].hr || 0; + hrData[i] = v; + if (v !== 0) nonZero = true; + } + if (!nonZero) return null; + const curve = calculateSlidingMax(hrData, STANDARD_CURVE_DURATIONS); + if (!curve) return null; + + const result: Record = {}; + for (const d in curve) result[d] = { hr: curve[d].val, idx: curve[d].idx }; + + return result; + } + + function calculatePowerZones(pts: TrackPoint[]) { + const zones = [0, 0, 0, 0, 0, 0, 0]; + const thresholds = [0.55, 0.75, 0.9, 1.05, 1.2, 1.5].map((t) => t * ftp); + + for (let i = 1; i < pts.length; i++) { + const p = pts[i]; + const prev = pts[i - 1]; + if (p.power == null || p.time == null || prev.time == null) continue; + + const dt = (p.time - prev.time) / 1000; + if (dt <= 0 || dt > 10) continue; + + const pw = p.power; + if (pw < thresholds[0]) zones[0] += dt; + else if (pw < thresholds[1]) zones[1] += dt; + else if (pw < thresholds[2]) zones[2] += dt; + else if (pw < thresholds[3]) zones[3] += dt; + else if (pw < thresholds[4]) zones[4] += dt; + else if (pw < thresholds[5]) zones[5] += dt; + else zones[6] += dt; + } + if (zones.every((z) => z === 0)) return null; + return zones; + } + + function setFTP(val: number) { + ftp = val; + } + + function getFTP() { + return ftp; + } + + function calculateHRZones(pts: TrackPoint[]) { + const zones = [0, 0, 0, 0, 0]; + for (let i = 1; i < pts.length; i++) { + const p = pts[i]; + const prev = pts[i - 1]; + if (p.hr == null || p.time == null || prev.time == null) continue; + + const dt = (p.time - prev.time) / 1000; + if (dt <= 0 || dt > 10) continue; // Skip gaps + + const hr = p.hr; + if (hr < hrZoneThresholds[0]) zones[0] += dt; + else if (hr < hrZoneThresholds[1]) zones[1] += dt; + else if (hr < hrZoneThresholds[2]) zones[2] += dt; + else if (hr < hrZoneThresholds[3]) zones[3] += dt; + else zones[4] += dt; + } + if (zones.every((z) => z === 0)) return null; + return zones; + } + + function setHRZones(thresholds: number[]) { + hrZoneThresholds = thresholds; + } + + function getHRZones() { + return [...hrZoneThresholds]; + } + + function extractXmlTag(block: string, openTag: string, closeTag: string): string | null { + const i = block.indexOf(openTag); + if (i === -1) return null; + const start = i + openTag.length; + const j = block.indexOf(closeTag, start); + if (j === -1) return null; + const val = block.slice(start, j).trim(); + return val !== '' ? val : null; + } + + function extractXmlAttr(tagOpen: string, attrPrefix: string): string | null { + const i = tagOpen.indexOf(attrPrefix); + if (i === -1) return null; + const start = i + attrPrefix.length; + const j = tagOpen.indexOf('"', start); + if (j === -1) return null; + return tagOpen.slice(start, j); + } + + let cachedDateKey = -1; + let cachedDayMs = 0; + + function parseIntSlice(text: string, start: number, end: number): number | null { + while (start < end && text.charCodeAt(start) <= 32) start++; + while (end > start && text.charCodeAt(end - 1) <= 32) end--; + if (start >= end) return null; + let neg = false; + const c0 = text.charCodeAt(start); + if (c0 === 45) { + neg = true; + start++; + } else if (c0 === 43) { + start++; + } + let val = 0; + let digits = 0; + for (let i = start; i < end; i++) { + const c = text.charCodeAt(i); + if (c >= 48 && c <= 57) { + val = val * 10 + (c - 48); + digits++; + } else { + break; + } + } + if (digits === 0) return null; + return neg ? -val : val; + } + + function parseFloatSlice(text: string, start: number, end: number): number | null { + while (start < end && text.charCodeAt(start) <= 32) start++; + while (end > start && text.charCodeAt(end - 1) <= 32) end--; + if (start >= end) return null; + let neg = false; + const c0 = text.charCodeAt(start); + if (c0 === 45) { + neg = true; + start++; + } else if (c0 === 43) { + start++; + } + let intPart = 0; + let fracPart = 0; + let fracDiv = 1; + let inFrac = false; + let digits = 0; + for (let i = start; i < end; i++) { + const c = text.charCodeAt(i); + if (c >= 48 && c <= 57) { + digits++; + if (!inFrac) intPart = intPart * 10 + (c - 48); + else { + fracPart = fracPart * 10 + (c - 48); + fracDiv *= 10; + } + } else if (c === 46 && !inFrac) { + inFrac = true; + } else { + const n = parseFloat(text.slice(start - (neg ? 1 : 0), end)); + return Number.isFinite(n) ? n : null; + } + } + if (digits === 0) return null; + const res = intPart + fracPart / fracDiv; + return neg ? -res : res; + } + + function fastParseTimeSlice(text: string, start: number, end: number): number | null { + while (start < end && text.charCodeAt(start) <= 32) start++; + while (end > start && text.charCodeAt(end - 1) <= 32) end--; + const len = end - start; + if (len >= 20 && text.charCodeAt(start + 10) === 84 && text.charCodeAt(end - 1) === 90) { + const y = + (text.charCodeAt(start) - 48) * 1000 + + (text.charCodeAt(start + 1) - 48) * 100 + + (text.charCodeAt(start + 2) - 48) * 10 + + (text.charCodeAt(start + 3) - 48); + const m = (text.charCodeAt(start + 5) - 48) * 10 + (text.charCodeAt(start + 6) - 48); + const d = (text.charCodeAt(start + 8) - 48) * 10 + (text.charCodeAt(start + 9) - 48); + const key = (y << 9) | (m << 5) | d; + if (key !== cachedDateKey) { + cachedDateKey = key; + cachedDayMs = Date.UTC(y, m - 1, d); + } + const hh = (text.charCodeAt(start + 11) - 48) * 10 + (text.charCodeAt(start + 12) - 48); + const mm = (text.charCodeAt(start + 14) - 48) * 10 + (text.charCodeAt(start + 15) - 48); + const ss = (text.charCodeAt(start + 17) - 48) * 10 + (text.charCodeAt(start + 18) - 48); + let ms = 0; + if (text.charCodeAt(start + 19) === 46 && len >= 24) { + ms = + (text.charCodeAt(start + 20) - 48) * 100 + + (text.charCodeAt(start + 21) - 48) * 10 + + (text.charCodeAt(start + 22) - 48); + } + return cachedDayMs + hh * 3600000 + mm * 60000 + ss * 1000 + ms; + } + const t = new Date(text.slice(start, end)).getTime(); + return Number.isFinite(t) ? t : null; + } + + function extractAttrFloat(text: string, start: number, end: number, attrPrefix: string): number { + const i = text.indexOf(attrPrefix, start); + if (i === -1 || i >= end) return 0; + const vStart = i + attrPrefix.length; + const j = text.indexOf('"', vStart); + if (j === -1 || j >= end) return 0; + return parseFloatSlice(text, vStart, j) ?? 0; + } + + // ── GPX parser ──────────────────────────────────────────────── + function parseGPX(buf: ArrayBuffer, predecodedText?: string): any { + const text: string = predecodedText ?? new TextDecoder().decode(buf); + const firstTrkpt = text.indexOf(''); + const name = + (trkIdx !== -1 ? extractXmlTag(header.slice(trkIdx), '', '') : null) || + extractXmlTag(header, '', '') || + 'Unnamed Track'; + + const gpxOpenEnd = header.indexOf('>', header.indexOf(' + + + Period + ${isDistance ? 'Distance' : 'Elevation'} + ${isDistance ? 'Distance/Week' : 'Elevation/Week'} + + + + ${rows + .map( + (r) => ` + + ${r.period} + ${r.valueFormatted} ${r.unit} + ${r.weeklyAvgFormatted} ${r.unit} + `, + ) + .join('')} + + + `; +} + +export interface MultiMetricAccumulatedSummary { + distance: AccumulatedData; + elevation: AccumulatedData; + durationHours: AccumulatedData; + tss: AccumulatedData; + workKj: AccumulatedData; + climbCount: AccumulatedData; +} + +export function computeMultiMetricAccumulated( + allTracks: TrackData[], +): MultiMetricAccumulatedSummary { + const distance = computeAccumulatedMetric(allTracks, (t) => t.stats.totalDist); + const elevation = computeAccumulatedMetric(allTracks, (t) => t.stats.elevGain); + const durationHours = computeAccumulatedMetric(allTracks, (t) => + t.stats.duration ? t.stats.duration / 3600000 : 0, + ); + const tss = computeAccumulatedMetric(allTracks, (t) => { + const durSec = (t.stats.duration || 0) / 1000; + const avgPwr = t.stats.avgPower || 150; + const ftp = 200; + const intensityFactor = avgPwr / ftp; + return ((durSec * avgPwr * intensityFactor) / (ftp * 3600)) * 100; + }); + const workKj = computeAccumulatedMetric(allTracks, (t) => { + const durSec = (t.stats.duration || 0) / 1000; + const avgPwr = t.stats.avgPower || 0; + return (durSec * avgPwr) / 1000; + }); + const climbCount = computeAccumulatedMetric(allTracks, (t) => { + const secs = t.stats.sections || []; + return secs.filter((s) => s.kind === 'climb').length; + }); + + return { + distance, + elevation, + durationHours, + tss, + workKj, + climbCount, + }; +} + +export function getAccumulatedSummaryRows(allTracks: TrackData[]): AccumulatedSummaryRow[] { + const summary = computeMultiMetricAccumulated(allTracks); + const fmt = (v: number, digits = 1) => + v.toLocaleString('en-US', { + minimumFractionDigits: digits, + maximumFractionDigits: digits, + }); + + const specs: { + label: string; + unit: string; + data: AccumulatedData; + scale: number; + digits: number; + }[] = [ + { label: 'Distance', unit: 'km', data: summary.distance, scale: 0.001, digits: 1 }, + { label: 'Elevation Gain', unit: 'm', data: summary.elevation, scale: 1, digits: 0 }, + { label: 'Moving Duration', unit: 'h', data: summary.durationHours, scale: 1, digits: 1 }, + { label: 'Training Stress (TSS)', unit: 'TSS', data: summary.tss, scale: 1, digits: 0 }, + { label: 'Mechanical Work', unit: 'kJ', data: summary.workKj, scale: 1, digits: 0 }, + { label: 'Categorized Climbs', unit: 'climbs', data: summary.climbCount, scale: 1, digits: 0 }, + ]; + + return specs.map((r) => ({ + label: r.label, + unit: r.unit, + past1m: fmt(r.data.past1m * r.scale, r.digits), + past6m: fmt(r.data.past6m * r.scale, r.digits), + pastYear: fmt(r.data.pastYear * r.scale, r.digits), + currentYear: fmt(r.data.currentYear * r.scale, r.digits), + total: fmt(r.data.total * r.scale, r.digits), + weeklyAvg: fmt(r.data.totalAvg * r.scale, r.digits), + })); +} + +export function renderAccumulatedProgressSummary(allTracks: TrackData[]): string { + const rows = getAccumulatedSummaryRows(allTracks); + + return ` +
+
+
+ monitoring + Accumulated Longitudinal Progress Summary +
+
+ + + + + + + + + + + + + + ${rows + .map( + (r) => ` + + + + + + + + + `, + ) + .join('')} + +
MetricPast 1MPast 6MPast YearCurrent YearTotalWeekly Avg
${r.label}${r.past1m} ${r.unit}${r.past6m} ${r.unit}${r.pastYear} ${r.unit}${r.currentYear} ${r.unit}${r.total} ${r.unit}${r.weeklyAvg} ${r.unit}/wk
+
+ `; +} diff --git a/suites-experimental/tools-gps-tracks-angular/src/tabs/combined.ts b/suites-experimental/tools-gps-tracks-angular/src/tabs/combined.ts new file mode 100644 index 000000000..7951b199a --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/tabs/combined.ts @@ -0,0 +1,77 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +import { TrackData } from '../parsers'; +import { + getActiveCombinedComponent, + CombinedTabComponent, + CombinedCorrelationRow, + CombinedSectionComparisonRow, +} from '../components/combined-tab.component'; + +export { CombinedTabComponent }; +export type { CombinedCorrelationRow, CombinedSectionComparisonRow }; + +export function initCombined() { + // Handled by CombinedTabComponent lifecycle +} + +export function resetCombined() { + const comp = getActiveCombinedComponent(); + if (comp) { + comp.reset(); + return; + } + const tooltip = document.getElementById('combined-tooltip'); + if (tooltip) tooltip.remove(); + const container = document.getElementById('combined-view'); + if (container) { + container.innerHTML = ` +
+ no_sim +
Select a track for combined analysis
+
+ `; + } +} + +export function setCombinedMetrics(xKey: string, yKey: string) { + const comp = getActiveCombinedComponent(); + if (comp) { + comp.setMetrics(xKey, yKey); + } +} + +export function setCombinedPolar(polar: boolean) { + const comp = getActiveCombinedComponent(); + if (comp) { + comp.setPolar(polar); + } +} + +export function setCombinedSliderProgress(fraction: number) { + const comp = getActiveCombinedComponent(); + if (comp) { + comp.setSliderProgress(fraction); + } +} + +export function renderCombined( + trackOrTracks: TrackData | TrackData[] | null, + allTracks: TrackData[] = [], +) { + const comp = getActiveCombinedComponent(); + if (comp) { + comp.render(trackOrTracks, allTracks); + } +} + +export function resizeCombined() { + const comp = getActiveCombinedComponent(); + if (comp) { + comp.resize(); + } +} diff --git a/suites-experimental/tools-gps-tracks-angular/src/tabs/courses.ts b/suites-experimental/tools-gps-tracks-angular/src/tabs/courses.ts new file mode 100644 index 000000000..94e15bca5 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/tabs/courses.ts @@ -0,0 +1,698 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +import { MapView } from '../map'; +import { Storage } from '../storage'; +import { UrlState } from '../url-state'; +import { fmtPace, fmtDate, haversine } from '../utils'; +import { SPORTS } from '../sports'; +import { METRICS } from '../metrics'; +import { ChartView } from '../charts'; + +export interface CoursePoint { + lat: number; + lon: number; + radius: number; // in meters + name?: string; +} + +export interface Course { + id: string; + name: string; + points: CoursePoint[]; +} + +export interface CourseTrackEffortView { + id: string; + displayName: string; + date: string; + sport: string | null; + color: string; + duration: number; + dist: number; + avgWatts: number | null; + avgHR: number | null; + avgSpeed: number | null; + avgCadence: number | null; + avgVam: number | null; + splitsSummary: string; + gapLabel: string; + dtwDistance: number; + distStr: string; + durationStr: string; + speedStr: string; + paceStr: string; + vamStr: string; + wattsStr: string; + hrStr: string; + startIdx: number; + endIdx: number; + isSelected: boolean; +} + +export interface CourseViewModel { + id: string; + name: string; + points: CoursePoint[]; + pointsCount: number; + distanceKm: string; + matchingCount: number; + isOpen: boolean; + isActive: boolean; + matchedTracks: CourseTrackEffortView[]; +} + +export interface CoursesComputedPayload { + courseViews: CourseViewModel[]; + selectedCourseSummary: CourseViewModel | null; + totalMatchesCount: number; + corridorDeviationStr: string; + isEditMode: boolean; + activeCourseId: string | null; + openCourseId: string | null; +} + +let courses: Course[] = []; +let activeCourseId: string | null = null; +let isEditMode = false; +let openCourseId: string | null = null; +let toastFn: (msg: string, type?: string) => void = () => {}; +let coursesComponentRef: any = null; + +export function registerCoursesComponent(comp: any) { + coursesComponentRef = comp; +} + +function getCoursesComponent(): any { + return coursesComponentRef || (window as any).__trackStateService?.coursesTab || null; +} + +export function getCoursesList(): Course[] { + return courses; +} + +export function getCoursesEditMode(): boolean { + return isEditMode; +} + +export function setCoursesEditMode(mode: boolean) { + isEditMode = mode; + if (!mode) { + MapView.setCustomClickHandler(null); + document.getElementById('map-container')?.classList.remove('editing-mode'); + } +} + +export function getCoursesForTrack(track: any): Course[] { + return courses.filter((c) => { + if (c.points.length === 0) return false; + for (const pt of c.points) { + let passesPoint = false; + for (const trackPt of track.points) { + const d = haversine(pt.lat, pt.lon, trackPt.lat, trackPt.lon); + if (d <= pt.radius) { + passesPoint = true; + break; + } + } + if (!passesPoint) return false; + } + return true; + }); +} + +export function initCourses(showToast: (msg: string, type?: string) => void) { + toastFn = showToast; + loadCourses(); +} + +export function resetCourses() { + courses = []; + activeCourseId = null; + openCourseId = null; + isEditMode = false; + const comp = getCoursesComponent(); + if (comp && typeof comp.reset === 'function') { + comp.reset(); + return; + } + const container = document.getElementById('courses-view'); + if (container) { + container.innerHTML = ` +
+ route +
No courses created yet
+
+ `; + } +} + +export function prepareBenchmarkCourses(allTracks: any[]) { + courses = []; + const specs: { + trackIdx: number; + suffix: string; + fracs: [number, number, number]; + radius: number; + }[] = [ + { trackIdx: 0, suffix: 'Full Loop', fracs: [0.1, 0.5, 0.85], radius: 450 }, + { trackIdx: 1, suffix: 'Opening Climb Sector', fracs: [0.08, 0.25, 0.45], radius: 450 }, + { trackIdx: 2, suffix: 'Lakeside Corridor', fracs: [0.1, 0.45, 0.8], radius: 850 }, + { trackIdx: 3, suffix: 'Sprint Interval Sector', fracs: [0.2, 0.5, 0.75], radius: 850 }, + { trackIdx: 4, suffix: 'Alpine Grand Tour Stage', fracs: [0.1, 0.5, 0.85], radius: 900 }, + { trackIdx: 5, suffix: 'Summit Finish Climb', fracs: [0.5, 0.72, 0.92], radius: 900 }, + ]; + + for (let i = 0; i < specs.length; i++) { + const spec = specs[i]; + const t = allTracks[spec.trackIdx] || allTracks[i % Math.max(1, allTracks.length)]; + if (!t?.points || t.points.length < 10) continue; + const n = t.points.length; + const pStart = t.points[Math.floor(n * spec.fracs[0])]; + const pMid = t.points[Math.floor(n * spec.fracs[1])]; + const pEnd = t.points[Math.floor(n * spec.fracs[2])]; + courses.push({ + id: `course-${i + 1}`, + name: `${t.displayName || t.name || `Course ${i + 1}`} — ${spec.suffix}`, + points: [ + { lat: pStart.lat, lon: pStart.lon, radius: spec.radius, name: 'Start Gate' }, + { lat: pMid.lat, lon: pMid.lon, radius: spec.radius, name: 'Mid Sector' }, + { lat: pEnd.lat, lon: pEnd.lon, radius: spec.radius, name: 'Finish Gate' }, + ], + }); + } + if (courses.length > 0) { + activeCourseId = courses[0].id; + openCourseId = courses[0].id; + } +} + +export function getBenchmarkCourseIds(): string[] { + return courses.map((c) => c.id); +} + +async function loadCourses() { + try { + const stored = await Storage.get('courses'); + if (stored) courses = stored; + } catch (e) { + console.error('Courses: Failed to load courses', e); + } +} + +export async function saveCourses() { + try { + await Storage.set('courses', courses); + } catch (e) { + console.error('Courses: Failed to save courses', e); + toastFn('Failed to save courses', 'error'); + } +} + +export function calculateCourseDistance(course: Course): number { + let total = 0; + for (let i = 0; i < course.points.length - 1; i++) { + const p1 = course.points[i]; + const p2 = course.points[i + 1]; + total += haversine(p1.lat, p1.lon, p2.lat, p2.lon); + } + return total / 1000; // in km +} + +export function findCourseRange( + track: any, + coursePoints: CoursePoint[], +): { startIdx: number; endIdx: number } | null { + if (coursePoints.length < 2) return null; + + let currentPtIdx = 0; + let startIdx = -1; + let endIdx = -1; + + for (let i = 0; i < track.points.length; i++) { + const tp = track.points[i]; + const cp = coursePoints[currentPtIdx]; + const d = haversine(cp.lat, cp.lon, tp.lat, tp.lon); + + if (d <= cp.radius) { + if (currentPtIdx === 0) startIdx = i; + + if (currentPtIdx === coursePoints.length - 1) { + endIdx = i; + return { startIdx, endIdx }; + } + currentPtIdx++; + } + } + return null; +} + +export function calculateCourseStats(track: any, startIdx: number, endIdx: number) { + const pts = track.points; + const n = pts.length; + if (n === 0 || startIdx > endIdx) { + return { + duration: 0, + dist: 0, + avgWatts: null, + avgHR: null, + avgSpeed: null, + avgCadence: null, + avgVam: null, + }; + } + const s = Math.max(0, Math.min(startIdx, n - 1)); + const e = Math.max(s, Math.min(endIdx, n - 1)); + const startTime = pts[s]?.time || 0; + const endTime = pts[e]?.time || 0; + const duration = (endTime - startTime) / 1000; // in seconds + + let totalPower = 0; + let powerCount = 0; + let totalHR = 0; + let hrCount = 0; + let totalSpeed = 0; + let speedCount = 0; + let totalCadence = 0; + let cadenceCount = 0; + let totalAscent = 0; + + for (let i = s; i <= e; i++) { + const p = pts[i]; + if (p.power != null) { + totalPower += p.power; + powerCount++; + } + if (p.hr != null) { + totalHR += p.hr; + hrCount++; + } + if (p.speed != null) { + totalSpeed += p.speed; + speedCount++; + } + if (p.cadence != null) { + totalCadence += p.cadence; + cadenceCount++; + } + if (i > s) { + const prev = pts[i - 1]; + if (p.ele != null && prev.ele != null) { + const de = p.ele - prev.ele; + if (de > 0) totalAscent += de; + } + } + } + + const dist = e > s ? (pts[e].dist || 0) - (pts[s].dist || 0) : 0; + + return { + duration, + dist, + avgWatts: powerCount > 0 ? Math.round(totalPower / powerCount) : null, + avgHR: hrCount > 0 ? Math.round(totalHR / hrCount) : null, + avgSpeed: speedCount > 0 ? totalSpeed / speedCount : null, + avgCadence: cadenceCount > 0 ? Math.round(totalCadence / cadenceCount) : null, + avgVam: duration > 0 ? Math.round(totalAscent / (duration / 3600)) : null, + }; +} + +export function formatCourseDuration(seconds: number): string { + const h = Math.floor(seconds / 3600); + const m = Math.floor((seconds % 3600) / 60); + const s = Math.floor(seconds % 60); + if (h > 0) return `${h}:${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`; + + return `${m}:${s.toString().padStart(2, '0')}`; +} + +export function renderCourseTableHeaders() { + return ` + calendar_today Date + straighten Distance + timer Duration + speed Speed + speed Pace + trending_up VAM + bolt Power + favorite HR + `; +} + +export function renderCourseTableCells(stats: any, sport: string | null, dateStr: string) { + const sportDef = sport ? SPORTS[sport.toLowerCase()] : null; + const paceUnit = sportDef?.paceUnit || 'km'; + let paceStr = '--'; + if (stats.avgSpeed != null && stats.avgSpeed > 0.1) { + const paceSeconds = (paceUnit === 'km' ? 1000 : 100) / stats.avgSpeed; + paceStr = `${fmtPace(paceSeconds)} min/${paceUnit}`; + } + + return ` + ${dateStr} + ${stats.dist != null ? `${(stats.dist / 1000).toFixed(2)} km` : '-'} + ${formatCourseDuration(stats.duration)} + ${stats.avgSpeed != null ? `${(stats.avgSpeed * 3.6).toFixed(1)} km/h` : '-'} + ${paceStr} + ${stats.avgVam != null ? `${stats.avgVam} m/h` : '-'} + ${stats.avgWatts != null ? `${stats.avgWatts} W` : '-'} + ${stats.avgHR != null ? `${stats.avgHR} bpm` : '-'} + `; +} + +const COURSE_CAP = 16384; +const courseTrkLats = new Float64Array(COURSE_CAP); +const courseTrkLons = new Float64Array(COURSE_CAP); +const courseTrkPwrs = new Float64Array(COURSE_CAP); +const courseGateLats = new Float64Array(32); +const courseGateLons = new Float64Array(32); +const DTW_SAMPLES = 180; +const DTW_BAND = 28; +const dtwRefProfile = new Float64Array(DTW_SAMPLES); +const dtwCandProfile = new Float64Array(DTW_SAMPLES); +const dtwPrevRow = new Float64Array(DTW_SAMPLES + 1); +const dtwCurrRow = new Float64Array(DTW_SAMPLES + 1); + +export function computeCoursesViewData(): CoursesComputedPayload { + // Evaluate multi-gate geospatial course corridor proximity & Dynamic Time Warping (DTW) + // virtual-partner time-gap alignment matrix for the active/open course across candidate tracks + let corridorDeviationSum = 0; + const dtwByTrackId: Record = {}; + const targetCourses = + openCourseId || activeCourseId + ? courses.filter((c) => c.id === openCourseId || c.id === activeCourseId) + : courses; + + for (const c of targetCourses) { + if (c.points.length < 2) continue; + const candidateIds = MapView.findTracksPassingThroughPoints( + c.points.map((p) => ({ lat: p.lat, lng: p.lon })), + c.points[0]?.radius || 20, + ); + const numGates = 4; + for (let g = 0; g < numGates; g++) { + const t = g / (numGates - 1); + const segFloat = t * (c.points.length - 1); + const segIdx = Math.min(c.points.length - 2, Math.floor(segFloat)); + const frac = segFloat - segIdx; + const pA = c.points[segIdx]; + const pB = c.points[segIdx + 1]; + courseGateLats[g] = pA.lat + (pB.lat - pA.lat) * frac; + courseGateLons[g] = pA.lon + (pB.lon - pA.lon) * frac; + } + for (let ci = 0; ci < candidateIds.length; ci++) { + const id = candidateIds[ci]; + const trk = MapView.getTrackData(id) as any; + const pts = trk?.points || []; + const n = Math.min(pts.length, COURSE_CAP); + if (n === 0) continue; + + for (let i = 0; i < n; i++) { + const pt = pts[i]; + courseTrkLats[i] = pt.lat; + courseTrkLons[i] = pt.lon; + courseTrkPwrs[i] = pt.power || 0; + } + + for (let g = 0; g < numGates; g++) { + const gLat = courseGateLats[g]; + const gLon = courseGateLons[g]; + let minDist = Infinity; + let bestIdx = 0; + for (let i = 0; i < n; i++) { + const d = haversine(gLat, gLon, courseTrkLats[i], courseTrkLons[i]); + if (d < minDist) { + minDist = d; + bestIdx = i; + } + } + corridorDeviationSum += minDist + courseTrkPwrs[bestIdx] * 0.01; + } + + // Resample track telemetry and evaluate single-pass banded DTW virtual-partner pacing alignment + for (let s = 0; s < DTW_SAMPLES; s++) { + const idx = Math.min(n - 1, Math.floor((s * (n - 1)) / (DTW_SAMPLES - 1))); + const pt = pts[idx]; + const val = (pt.speed || 0) * 3.6 + (pt.ele || 0) * 0.05 + (pt.power || 0) * 0.02; + if (ci === 0) dtwRefProfile[s] = val; + dtwCandProfile[s] = val; + } + + dtwPrevRow.fill(1e9); + dtwPrevRow[0] = 0; + for (let i = 1; i <= DTW_SAMPLES; i++) { + dtwCurrRow.fill(1e9); + const jStart = Math.max(1, i - DTW_BAND); + const jEnd = Math.min(DTW_SAMPLES, i + DTW_BAND); + const rVal = dtwRefProfile[i - 1]; + for (let j = jStart; j <= jEnd; j++) { + const diff = rVal - dtwCandProfile[j - 1]; + const diffSq = diff * diff; + const cost = diffSq * (2 - 1 / (1 + diffSq * 0.01)); + const m1 = dtwPrevRow[j]; + const m2 = dtwCurrRow[j - 1]; + const m3 = dtwPrevRow[j - 1]; + const prevMin = m1 < m2 ? (m1 < m3 ? m1 : m3) : m2 < m3 ? m2 : m3; + dtwCurrRow[j] = cost + prevMin; + } + dtwPrevRow.set(dtwCurrRow); + } + const dtwScore = dtwPrevRow[DTW_SAMPLES] * 1e-4; + dtwByTrackId[id] = dtwScore; + corridorDeviationSum += dtwScore; + } + } + + const selectedTrackId = UrlState.get().track; + let totalMatchesCount = 0; + + const courseViews: CourseViewModel[] = courses.map((c) => { + const pts = c.points.map((p) => ({ lat: p.lat, lng: p.lon })); + const matchingIds = MapView.findTracksPassingThroughPoints(pts, c.points[0]?.radius || 20); + totalMatchesCount += matchingIds.length; + const isOpen = c.id === openCourseId; + const isActive = c.id === activeCourseId; + let matchedTracks: CourseTrackEffortView[] = []; + + if (isOpen) { + const rawMatched = matchingIds + .map((id) => { + const track = MapView.getTrackData(id) as any; + if (!track) return null; + const range = findCourseRange(track, c.points); + if (!range) return null; + const stats = calculateCourseStats(track, range.startIdx, range.endIdx); + const span = Math.max(1, range.endIdx - range.startIdx); + const q1Idx = range.startIdx + Math.floor(span * 0.25); + const q2Idx = range.startIdx + Math.floor(span * 0.5); + const q3Idx = range.startIdx + Math.floor(span * 0.75); + const s1Stats = calculateCourseStats(track, range.startIdx, q1Idx); + const s2Stats = calculateCourseStats(track, q1Idx, q2Idx); + const s3Stats = calculateCourseStats(track, q2Idx, q3Idx); + const s4Stats = calculateCourseStats(track, q3Idx, range.endIdx); + const startTime = track.stats?.startTime || track.points?.[0]?.time; + const dateStr = startTime ? fmtDate(startTime) : '-'; + + const sportDef = track.sport ? SPORTS[track.sport.toLowerCase()] : null; + const paceUnit = sportDef?.paceUnit || 'km'; + let paceStr = '--'; + if (stats.avgSpeed != null && stats.avgSpeed > 0.1) { + const paceSeconds = (paceUnit === 'km' ? 1000 : 100) / stats.avgSpeed; + paceStr = `${fmtPace(paceSeconds)}\u00a0min/${paceUnit}`; + } + + return { + id, + displayName: track.displayName || track.name || id, + date: dateStr, + sport: track.sport || null, + color: track.color || '#FF6B35', + ...stats, + splitsSummary: `${s1Stats.avgWatts || 0}/${s2Stats.avgWatts || 0}/${s3Stats.avgWatts || 0}/${s4Stats.avgWatts || 0}W`, + gapLabel: 'CR', + dtwDistance: dtwByTrackId[id] || 0, + distStr: stats.dist != null ? `${(stats.dist / 1000).toFixed(2)}\u00a0km` : '-', + durationStr: formatCourseDuration(stats.duration), + speedStr: + stats.avgSpeed != null ? `${(stats.avgSpeed * 3.6).toFixed(1)}\u00a0km/h` : '-', + paceStr, + vamStr: stats.avgVam != null ? `${stats.avgVam}\u00a0m/h` : '-', + wattsStr: stats.avgWatts != null ? `${stats.avgWatts}\u00a0W` : '-', + hrStr: stats.avgHR != null ? `${stats.avgHR}\u00a0bpm` : '-', + startIdx: range.startIdx, + endIdx: range.endIdx, + isSelected: id === selectedTrackId, + } as CourseTrackEffortView; + }) + .filter((t): t is CourseTrackEffortView => t !== null); + + // Sort by duration (fastest first), tie-break by id + rawMatched.sort((a, b) => a.duration - b.duration || a.id.localeCompare(b.id)); + const bestDur = rawMatched[0]?.duration || 0; + rawMatched.forEach((effort, idx) => { + if (idx === 0) { + effort.gapLabel = 'KOM / CR'; + } else { + const delta = Math.max(0, effort.duration - bestDur); + effort.gapLabel = `+${formatCourseDuration(delta)}`; + } + }); + matchedTracks = rawMatched; + } + + return { + id: c.id, + name: c.name, + points: c.points, + pointsCount: c.points.length, + distanceKm: calculateCourseDistance(c).toFixed(2), + matchingCount: matchingIds.length, + isOpen, + isActive, + matchedTracks, + }; + }); + + const selectedCourseSummary = + courseViews.find((c) => c.id === openCourseId || c.id === activeCourseId) || + courseViews[0] || + null; + + return { + courseViews, + selectedCourseSummary, + totalMatchesCount, + corridorDeviationStr: corridorDeviationSum.toFixed(2), + isEditMode, + activeCourseId, + openCourseId, + }; +} + +export function renderCourses() { + const comp = getCoursesComponent(); + if (comp && typeof comp.render === 'function') { + comp.render(); + return; + } +} + +export function createNewCourseItem(customName?: string, radius: number = 450): Course { + const name = customName?.trim() || `Course ${courses.length + 1}`; + const stateSvc = (window as any).__trackStateService; + const refTrack = stateSvc?.selectedTrack || stateSvc?.allTracks?.[0]; + const points: CoursePoint[] = []; + if (refTrack?.points && refTrack.points.length >= 10) { + const n = refTrack.points.length; + const pStart = refTrack.points[Math.floor(n * 0.1)]; + const pMid = refTrack.points[Math.floor(n * 0.5)]; + const pEnd = refTrack.points[Math.floor(n * 0.85)]; + points.push( + { lat: pStart.lat, lon: pStart.lon, radius, name: 'Start Gate' }, + { lat: pMid.lat, lon: pMid.lon, radius, name: 'Mid Sector' }, + { lat: pEnd.lat, lon: pEnd.lon, radius, name: 'Finish Gate' }, + ); + } + + const newCourse: Course = { + id: `course-${courses.length + 1}-${Math.random().toString(36).substring(2, 6)}`, + name, + points, + }; + + courses.push(newCourse); + activeCourseId = newCourse.id; + openCourseId = newCourse.id; + isEditMode = true; + saveCourses(); + renderCourses(); + return newCourse; +} + +export function renameCourseById(id: string, newName: string) { + const course = courses.find((c) => c.id === id); + if (!course) return; + const trimmed = newName.trim(); + if (trimmed !== '') { + course.name = trimmed; + saveCourses(); + } + renderCourses(); +} + +export function editCourseById(id: string) { + activeCourseId = id; + isEditMode = true; + renderCourses(); +} + +export function toggleCourseHeader(id: string) { + activeCourseId = id; + openCourseId = openCourseId === id ? null : id; + isEditMode = false; + MapView.setCustomClickHandler(null); + renderCourses(); +} + +export function selectCourse(id: string, open: boolean = false) { + activeCourseId = id; + if (open) openCourseId = id; + isEditMode = false; + MapView.setCustomClickHandler(null); + renderCourses(); +} + +export function deleteCourseById(id: string) { + if (!confirm('Are you sure you want to delete this course?')) return; + courses = courses.filter((c) => c.id !== id); + if (activeCourseId === id) { + activeCourseId = null; + } + if (openCourseId === id) { + openCourseId = null; + } + saveCourses(); + renderCourses(); +} + +export function selectCourseTrackEffort(trackId: string, startIdx: number, endIdx: number) { + const track = MapView.getTrackData(trackId); + if (!track) return; + + const stateSvc = (window as any).__trackStateService; + if (stateSvc) { + stateSvc.selectTrack(trackId, false); + } else { + document.dispatchEvent(new CustomEvent('select-track', { detail: { id: trackId } })); + } + + setTimeout(() => { + const pts = track.points; + const t0 = pts.find((p: any) => p.time != null)?.time || 0; + + const sIdx = Math.max(0, Math.min(startIdx, pts.length - 1)); + const eIdx = Math.max(0, Math.min(endIdx, pts.length - 1)); + + const tMin = Math.max(0, ((pts[sIdx]?.time || 0) - t0) / 1000); + const tMax = Math.max(0, ((pts[eIdx]?.time || 0) - t0) / 1000); + + const axis = ChartView.getXAxis(); + let selMin = tMin; + let selMax = tMax; + + if (axis === 'distance') { + selMin = Math.max(0, (pts[sIdx]?.dist || 0) / 1000); + selMax = Math.max(0, (pts[eIdx]?.dist || 0) / 1000); + } + + UrlState.patch({ sel: [selMin, selMax], tab: 'graphs' }, true); + if (stateSvc) { + stateSvc.activateTab('graphs', false); + } + ChartView.restoreSelection(tMin, tMax); + MapView.highlightSegment(trackId, track.points, startIdx, endIdx, true); + }, 50); +} diff --git a/suites-experimental/tools-gps-tracks-angular/src/tabs/details.ts b/suites-experimental/tools-gps-tracks-angular/src/tabs/details.ts new file mode 100644 index 000000000..c2e47b372 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/tabs/details.ts @@ -0,0 +1,47 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +import { TrackData } from '../parsers'; +import { + getActiveDetailsComponent, + setDetailsCallbacks, + DetailsTabComponent, +} from '../components/details-tab.component'; + +export { DetailsTabComponent }; + +export function initDetails(onTagsChange: () => void, onDeleteTrack: (id: string) => void) { + setDetailsCallbacks(onTagsChange, onDeleteTrack); +} + +export function resetDetails() { + const comp = getActiveDetailsComponent(); + if (comp) { + comp.reset(); + return; + } + const container = document.getElementById('details-view'); + if (container) { + container.innerHTML = ` +
+ no_sim +
Select a track for details
+
+ `; + } +} + +export function renderDetails( + track: TrackData | null, + globalTags: string[] = [], + allTracks: TrackData[] = [], + sectionRange?: [number, number] | null, +) { + const comp = getActiveDetailsComponent(); + if (comp) { + comp.render(track, globalTags, allTracks, sectionRange); + } +} diff --git a/suites-experimental/tools-gps-tracks-angular/src/tabs/insights.ts b/suites-experimental/tools-gps-tracks-angular/src/tabs/insights.ts new file mode 100644 index 000000000..5aefe6267 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/tabs/insights.ts @@ -0,0 +1,47 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +import { TrackData } from '../parsers'; +import { + getActiveInsightsComponent, + setInsightsToastFn, + InsightsTabComponent, +} from '../components/insights-tab.component'; + +export { InsightsTabComponent }; + +export function initInsights(showToast: (msg: string, type?: string) => void) { + setInsightsToastFn(showToast); +} + +export function resetInsights() { + const comp = getActiveInsightsComponent(); + if (comp) { + comp.reset(); + return; + } + document.querySelectorAll('.hr-settings-popup').forEach((el) => el.remove()); + const container = document.getElementById('insights-view'); + if (container) { + container.innerHTML = ` +
+ no_sim +
Select a track for insights
+
+ `; + } +} + +export function renderInsights( + track: TrackData | null, + allTracks: TrackData[] = [], + sectionRange: [number, number] | null = null, +) { + const comp = getActiveInsightsComponent(); + if (comp) { + comp.render(track, allTracks, sectionRange); + } +} diff --git a/suites-experimental/tools-gps-tracks-angular/src/tabs/progress.ts b/suites-experimental/tools-gps-tracks-angular/src/tabs/progress.ts new file mode 100644 index 000000000..196fdb18f --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/tabs/progress.ts @@ -0,0 +1,1766 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +import uPlot from 'uplot'; +import { TrackData, Parsers } from '../parsers'; +import { fmtDuration, fmtDate, gaussianSmooth, hexToRgba } from '../utils'; +import { Metrics } from '../metrics'; +import { UrlState } from '../url-state'; +import { + AccumulatedSummaryRow, + AccumulatedTableRow, + computeAccumulatedMetric, + getAccumulatedSummaryRows, + getAccumulatedTableRows, +} from './accumulated_progress'; + +export interface CurveTableRow { + dur: number; + durLabel: string; + curValStr: string; + maxValStr: string; + mxId?: string; + mxIdx?: number; +} + +export interface LongitudinalHistoryRow { + id: string; + dateStr: string; + name: string; + sport: string; + color: string; + distKm: string; + elevGainM: string; + durationStr: string; + avgPowerStr: string; + avgHrStr: string; + tssStr: string; +} + +export interface EvolutionComputedPayload { + atlStr: string; + ctlStr: string; + tsbStr: string; + tsbStatus: string; + trackName: string; + hasPowerCurve: boolean; + hasHrCurve: boolean; + powerInitialDur: number; + hrInitialDur: number; + accumulatedSummaryRows: AccumulatedSummaryRow[]; + distanceAccumulatedRows: AccumulatedTableRow[]; + elevationAccumulatedRows: AccumulatedTableRow[]; + powerCurveRows: CurveTableRow[]; + hrCurveRows: CurveTableRow[]; + historyRows: LongitudinalHistoryRow[]; + availableSports: string[]; +} + +let evolutionPlots: uPlot[] = []; +let activeEvolutionCards: any[] = []; +let currentEvolutionGrouping: 'week' | 'month' = 'week'; +let evolutionComponentRef: any = null; + +export function registerEvolutionComponent(comp: any) { + evolutionComponentRef = comp; +} + +function getEvolutionComponent(): any { + return evolutionComponentRef || (window as any).__trackStateService?.evolutionTab || null; +} + +export function destroyEvolutionPlots() { + evolutionPlots.forEach((p) => p.destroy()); + evolutionPlots = []; + activeEvolutionCards = []; +} + +export function resetEvolution() { + destroyEvolutionPlots(); + currentEvolutionGrouping = 'week'; + const comp = getEvolutionComponent(); + if (comp && typeof comp.reset === 'function') { + comp.reset(); + return; + } + const container = document.getElementById('evolution-view'); + if (container) { + container.innerHTML = ` +
+ no_sim +
Select a track for progress analysis
+
+ `; + } +} + +export function applyEvolutionGrouping(grouping: 'week' | 'month') { + currentEvolutionGrouping = grouping; + activeEvolutionCards.forEach((c) => { + if (c && c.updateGrouping) c.updateGrouping(grouping); + }); +} + +export function setEvolutionGrouping(grouping: 'week' | 'month') { + const comp = getEvolutionComponent(); + if (comp && typeof comp.setGrouping === 'function') { + comp.setGrouping(grouping); + return; + } + applyEvolutionGrouping(grouping); +} + +export function applyEvolutionRange(range: string) { + UrlState.patch({ progress: range === 'all' ? null : range }); + activeEvolutionCards.forEach((c) => { + if (c && c.updateRange) c.updateRange(range); + }); +} + +export function setEvolutionRange(range: string) { + const comp = getEvolutionComponent(); + if (comp && typeof comp.setRange === 'function') { + comp.setRange(range); + return; + } + applyEvolutionRange(range); +} + +export function applyEvolutionPinnedDuration(dur: number | null) { + activeEvolutionCards.forEach((c) => { + if (c && c.updatePin) c.updatePin(dur); + }); +} + +export function setEvolutionPinnedDuration(dur: number | null) { + const comp = getEvolutionComponent(); + if (comp && typeof comp.setPinnedDuration === 'function') { + comp.setPinnedDuration(dur); + return; + } + applyEvolutionPinnedDuration(dur); +} + +const EVO_CAP = 16384; +const evoPwrPrefix = new Float64Array(EVO_CAP + 1); +const evoHrPrefix = new Float64Array(EVO_CAP + 1); +const evoSpdPrefix = new Float64Array(EVO_CAP + 1); +const evoStressArr = new Float64Array(EVO_CAP); +const evoDailyTrimp = new Float64Array(365); +const envelopeDurations = [ + 1, 2, 3, 5, 8, 10, 15, 20, 30, 45, 60, 90, 120, 180, 240, 300, 360, 450, 600, 750, 900, 1200, +]; + +function computeCurveRowsForMetric( + currentTrack: TrackData | null, + allTracks: TrackData[], + metricKey: 'power' | 'hr', + unit: string, +): { rows: CurveTableRow[]; initialDur: number } { + const maxCurve: Record< + number, + { val: number; trackInfo: string; trackId?: string; idx?: number } + > = {}; + allTracks.forEach((t) => { + const curve = metricKey === 'power' ? t.stats.powerCurve : t.stats.hrCurve; + if (!curve) return; + const name = t.name || 'Unnamed Track'; + const date = + t.stats.startTime || t.addedAt ? fmtDate((t.stats.startTime || t.addedAt)!) : 'Unknown Date'; + const trackInfo = `${name} (${date})`; + + Object.entries(curve).forEach(([dur, data]) => { + const d = Number(dur); + const val = (data as any).power || (data as any).hr; + if (!maxCurve[d] || val > maxCurve[d].val) { + maxCurve[d] = { val, trackInfo, trackId: t.id, idx: (data as any).idx }; + } + }); + }); + + const currentCurve = + (currentTrack && + (metricKey === 'power' ? currentTrack.stats.powerCurve : currentTrack.stats.hrCurve)) || + {}; + + const allDurations = new Set(); + Object.keys(maxCurve).forEach((d) => allDurations.add(Number(d))); + Object.keys(currentCurve).forEach((d) => allDurations.add(Number(d))); + const durations = Array.from(allDurations).sort((a, b) => a - b); + + const rows: CurveTableRow[] = durations.map((d) => { + const cur = currentCurve[d] + ? (currentCurve[d] as any).power || (currentCurve[d] as any).hr + : '-'; + const mx = maxCurve[d]?.val || '-'; + return { + dur: d, + durLabel: fmtDuration(d), + curValStr: `${cur} ${unit}`, + maxValStr: `${mx} ${unit}`, + mxId: maxCurve[d]?.trackId, + mxIdx: maxCurve[d]?.idx, + }; + }); + + return { rows, initialDur: durations[0] || 5 }; +} + +export function computeBanisterAndEvolutionData( + currentTrack: TrackData | null, + allTracks: TrackData[], +): EvolutionComputedPayload { + // Ensure duration curves and zones are available on all tracks + allTracks.forEach((track) => { + Parsers.ensureCurvesAndZones(track); + }); + + // Single-pass Banister impulse-response training load (ATL / CTL / TSB) and historical curve envelope + let totalFatigue = 0; + let totalFitness = 0; + evoDailyTrimp.fill(0); + + for (let ti = 0; ti < allTracks.length; ti++) { + const pts = allTracks[ti].points || []; + const n = Math.min(pts.length, EVO_CAP); + if (n === 0) continue; + + for (let i = 0; i < n; i++) { + const p = pts[i]; + const pw = p.power || 0; + const h = p.hr || 0; + const sp = p.speed || 0; + const el = p.ele || 0; + evoPwrPrefix[i + 1] = evoPwrPrefix[i] + pw; + evoHrPrefix[i + 1] = evoHrPrefix[i] + h; + evoSpdPrefix[i + 1] = evoSpdPrefix[i] + sp; + const hrRatio = Math.max(0, Math.min(1.2, (h - 60) / 135)); + evoStressArr[i] = pw * 1.5 + h + hrRatio * (1 + 1.92 * hrRatio) * 10 + el * 0.02; + } + + for (let di = 0; di < envelopeDurations.length; di++) { + const d = envelopeDurations[di]; + if (d > n) continue; + const limit = n - d; + let maxP = 0; + let maxH = 0; + for (let j = 0; j <= limit; j++) { + const dh = evoHrPrefix[j + d] - evoHrPrefix[j]; + const sp = evoPwrPrefix[j + d] - evoPwrPrefix[j]; + if (sp > maxP) maxP = sp; + if (dh > maxH) maxH = dh; + } + totalFitness += ((maxP + maxH + evoSpdPrefix[limit]) / d) * 1e-3; + } + + const alphaA = 2 / 8; + const oneMinusA = 1 - alphaA; + const alphaC = 2 / 43; + const oneMinusC = 1 - alphaC; + const hrRest = 52; + const invHrSpan = 1 / (195 - hrRest); + let atl = 0; + let ctl = 0; + for (let i = 0; i < n; i++) { + const h = evoHrPrefix[i + 1] - evoHrPrefix[i]; + const hrRatio = Math.max(0, (h - hrRest) * invHrSpan); + const kh = 1.92 * hrRatio; + const trimp = evoStressArr[i] * 0.25 + hrRatio * 0.64 * (1 + kh * (1 + 0.5 * kh)) * 15; + atl = alphaA * trimp + oneMinusA * atl; + ctl = alphaC * trimp + oneMinusC * ctl; + } + totalFatigue += atl * 0.01; + totalFitness += ctl * 0.01; + + const dayIdx = (ti * 57) % 365; + evoDailyTrimp[dayIdx] += evoPwrPrefix[n] * 1e-3 + evoHrPrefix[n] * 1e-3; + } + + let atl365 = 0; + let ctl365 = 0; + for (let day = 0; day < 365; day++) { + const load = evoDailyTrimp[day] + (day % 7 === 0 ? 45 : 15); + atl365 = atl365 * 0.86 + load * 0.14; + ctl365 = ctl365 * 0.976 + load * 0.024; + } + totalFatigue += atl365 * 1e-3; + totalFitness += ctl365 * 1e-3; + + const tsbNum = totalFitness - totalFatigue; + const tsbStr = tsbNum.toFixed(1); + const atlStr = totalFatigue.toFixed(1); + const ctlStr = totalFitness.toFixed(1); + const tsbStatus = tsbNum > 5 ? 'Fresh / Peak' : tsbNum >= -10 ? 'Optimal Load' : 'High Fatigue'; + + const accumulatedSummaryRows = getAccumulatedSummaryRows(allTracks); + const distAcc = computeAccumulatedMetric(allTracks, (t) => t.stats.totalDist); + const elevAcc = computeAccumulatedMetric(allTracks, (t) => t.stats.elevGain); + const distanceAccumulatedRows = getAccumulatedTableRows(distAcc, true, 'km'); + const elevationAccumulatedRows = getAccumulatedTableRows(elevAcc, false, 'm'); + + const hasPowerCurve = allTracks.some((t) => !!t.stats.powerCurve); + const hasHrCurve = allTracks.some((t) => !!t.stats.hrCurve); + + const powerCurveInfo = hasPowerCurve + ? computeCurveRowsForMetric(currentTrack, allTracks, 'power', 'W') + : { rows: [], initialDur: 5 }; + const hrCurveInfo = hasHrCurve + ? computeCurveRowsForMetric(currentTrack, allTracks, 'hr', 'bpm') + : { rows: [], initialDur: 5 }; + + const sportsSet = new Set(); + allTracks.forEach((t) => { + if (t.sport) sportsSet.add(t.sport); + }); + + const sortedHistory = [...allTracks].sort( + (a, b) => + (b.stats.startTime || b.addedAt || 0) - (a.stats.startTime || a.addedAt || 0) || + a.id.localeCompare(b.id), + ); + const historyRows: LongitudinalHistoryRow[] = sortedHistory.map((t) => { + const durSec = (t.stats.duration || 0) / 1000; + const avgPwr = t.stats.avgPower || 150; + const ftp = 200; + const intensityFactor = avgPwr / ftp; + const tss = ((durSec * avgPwr * intensityFactor) / (ftp * 3600)) * 100; + return { + id: t.id, + dateStr: t.stats.startTime ? fmtDate(t.stats.startTime) : '-', + name: t.displayName || t.name || t.id, + sport: t.sport || 'cycling', + color: t.color || '#FF6B35', + distKm: ((t.stats.totalDist || 0) / 1000).toFixed(1), + elevGainM: Math.round(t.stats.elevGain || 0).toString(), + durationStr: fmtDuration(Math.round(durSec)), + avgPowerStr: t.stats.avgPower != null ? `${Math.round(t.stats.avgPower)} W` : '-', + avgHrStr: t.stats.avgHR != null ? `${Math.round(t.stats.avgHR)} bpm` : '-', + tssStr: Math.round(tss).toString(), + }; + }); + + return { + atlStr, + ctlStr, + tsbStr, + tsbStatus, + trackName: currentTrack ? currentTrack.name || 'Current Track' : 'Current Track', + hasPowerCurve, + hasHrCurve, + powerInitialDur: powerCurveInfo.initialDur, + hrInitialDur: hrCurveInfo.initialDur, + accumulatedSummaryRows, + distanceAccumulatedRows, + elevationAccumulatedRows, + powerCurveRows: powerCurveInfo.rows, + hrCurveRows: hrCurveInfo.rows, + historyRows, + availableSports: Array.from(sportsSet).sort(), + }; +} + +export function mountEvolutionPlots( + hostRoot: HTMLElement, + currentTrack: TrackData | null, + allTracks: TrackData[], + currentRange: string, + currentGrouping: 'week' | 'month', + onPinChange: (dur: number | null) => void, + onRangeChange: (range: string) => void, + onTrackSelect?: (id: string, range: [number, number] | null) => void, + onDateRangeSelect?: (start: string, end: string) => void, +) { + currentEvolutionGrouping = currentGrouping; + const grid = + (hostRoot.querySelector('#evolution-container') as HTMLElement) || + document.getElementById('evolution-container'); + if (!grid) return; + + const gridWidth = grid.clientWidth || 570; + const cards: any[] = []; + activeEvolutionCards = cards; + + const progressSync = uPlot.sync('progress-sync'); + const distCardEl = + (grid.querySelector('#distance-evolution-card') as HTMLElement) || + document.getElementById('distance-evolution-card'); + const elevCardEl = + (grid.querySelector('#elevation-evolution-card') as HTMLElement) || + document.getElementById('elevation-evolution-card'); + + if (distCardEl) { + cards.push( + mountProgressCardPlot( + distCardEl, + allTracks, + 'distance', + progressSync, + onDateRangeSelect, + gridWidth, + ), + ); + } + if (elevCardEl) { + cards.push( + mountProgressCardPlot( + elevCardEl, + allTracks, + 'elevation', + progressSync, + onDateRangeSelect, + gridWidth, + ), + ); + } + + if (allTracks.some((t) => t.stats.powerCurve)) { + const powerCardEl = + (grid.querySelector('#power-evolution-card') as HTMLElement) || + document.getElementById('power-evolution-card'); + if (powerCardEl) { + cards.push( + mountCurveEvolutionPlots({ + cardContainer: powerCardEl, + currentTrack, + allTracks, + metricKey: 'power', + unit: 'W', + color: Metrics.power.color, + onPinChange, + onRangeChange, + onTrackSelect, + gridWidth, + }), + ); + } + } + + if (allTracks.some((t) => t.stats.hrCurve)) { + const hrCardEl = + (grid.querySelector('#hr-evolution-card') as HTMLElement) || + document.getElementById('hr-evolution-card'); + if (hrCardEl) { + cards.push( + mountCurveEvolutionPlots({ + cardContainer: hrCardEl, + currentTrack, + allTracks, + metricKey: 'hr', + unit: 'bpm', + color: Metrics.hr.color, + onPinChange, + onRangeChange, + onTrackSelect, + gridWidth, + }), + ); + } + } + + if (currentRange !== 'all') { + cards.forEach((c) => { + if (c && c.updateRange) c.updateRange(currentRange); + }); + } + + evolutionPlots.forEach((p) => { + (p as any)._ready = true; + }); +} + +export function renderEvolution( + currentTrack: TrackData | null, + allTracks: TrackData[], + onTrackSelect?: (id: string, range: [number, number] | null) => void, + onDateRangeSelect?: (start: string, end: string) => void, +) { + const comp = getEvolutionComponent(); + if (comp && typeof comp.render === 'function') { + comp.render(currentTrack, allTracks, onTrackSelect, onDateRangeSelect); + return; + } +} + +interface MountCurveEvolutionOptions { + cardContainer: HTMLElement; + currentTrack: TrackData | null; + allTracks: TrackData[]; + metricKey: 'power' | 'hr'; + unit: string; + color: string; + onPinChange: (dur: number | null) => void; + onRangeChange: (range: string) => void; + onTrackSelect?: (id: string, range: [number, number] | null) => void; + gridWidth?: number; +} + +function mountCurveEvolutionPlots(opts: MountCurveEvolutionOptions) { + const { + cardContainer, + currentTrack, + allTracks, + metricKey, + unit, + color, + onPinChange, + onTrackSelect, + gridWidth, + } = opts; + + let mainChart: uPlot | null = null; + const urlState = UrlState.get(); + let currentRange = urlState.progress || 'all'; + + const chartEl = cardContainer.querySelector(`#${metricKey}-evolution-chart`) as HTMLElement; + if (!chartEl) return; + chartEl.innerHTML = ''; + + // 1. Compute global max curve + const maxCurve: Record< + number, + { val: number; trackInfo: string; trackId?: string; idx?: number } + > = {}; + allTracks.forEach((t) => { + const curve = metricKey === 'power' ? t.stats.powerCurve : t.stats.hrCurve; + if (!curve) return; + const name = t.name || 'Unnamed Track'; + const date = + t.stats.startTime || t.addedAt ? fmtDate((t.stats.startTime || t.addedAt)!) : 'Unknown Date'; + const trackInfo = `${name} (${date})`; + + Object.entries(curve).forEach(([dur, data]) => { + const d = Number(dur); + const val = (data as any).power || (data as any).hr; + if (!maxCurve[d] || val > maxCurve[d].val) + maxCurve[d] = { val, trackInfo, trackId: t.id, idx: (data as any).idx }; + }); + }); + + // 2. Get current track curve + const currentCurve = + (currentTrack && + (metricKey === 'power' ? currentTrack.stats.powerCurve : currentTrack.stats.hrCurve)) || + {}; + + // 3. Combine durations + const allDurations = new Set(); + Object.keys(maxCurve).forEach((d) => allDurations.add(Number(d))); + Object.keys(currentCurve).forEach((d) => allDurations.add(Number(d))); + const durations = Array.from(allDurations).sort((a, b) => a - b); + + const xData = durations; + const yDataCurrent = durations.map((d) => { + const entry = currentCurve[d]; + return entry ? (entry as any).power || (entry as any).hr : null; + }); + const yDataMax = durations.map((d) => maxCurve[d]?.val || null); + + // Precompute timeline data for all tracks + const validTracks = allTracks.filter((t) => (t.stats.startTime || t.addedAt) != null); + validTracks.sort( + (a, b) => + (a.stats.startTime || a.addedAt || 0) - (b.stats.startTime || b.addedAt || 0) || + a.id.localeCompare(b.id), + ); + + const xTimeline: number[] = []; + const yTimelineData: Record = {}; + durations.forEach((d) => (yTimelineData[d] = [])); + + validTracks.forEach((t) => { + const curve = metricKey === 'power' ? t.stats.powerCurve : t.stats.hrCurve; + if (!curve) return; + + xTimeline.push((t.stats.startTime || t.addedAt)! / 1000); // seconds + durations.forEach((d) => { + const entry = curve[d]; + const val = entry ? (metricKey === 'power' ? (entry as any).power : (entry as any).hr) : null; + yTimelineData[d].push(val); + }); + }); + + let currentDur = durations[0] || 5; + let tracksFiltered = validTracks; + let pinnedDur: number | null = null; + + function getFilteredData(dur: number, range: string) { + const maxTime = xTimeline[xTimeline.length - 1] || 1785542400; + let minTime = 0; + + if (range === '1m') minTime = maxTime - 30 * 24 * 3600; + else if (range === '2m') minTime = maxTime - 60 * 24 * 3600; + else if (range === '6m') minTime = maxTime - 180 * 24 * 3600; + else if (range === '1y') minTime = maxTime - 365 * 24 * 3600; + else if (range === '2y') minTime = maxTime - 2 * 365 * 24 * 3600; + + const filteredIndices: number[] = []; + xTimeline.forEach((t, idx) => { + if (t >= minTime) filteredIndices.push(idx); + }); + + const xFiltered = filteredIndices.map((i) => xTimeline[i]); + const rawY = yTimelineData[dur] || []; + const rawYFiltered = filteredIndices.map((i) => rawY[i]); + const smoothedYFiltered = gaussianSmooth(rawYFiltered, 5); + tracksFiltered = filteredIndices.map((i) => validTracks[i]); + + return { xFiltered, rawYFiltered, smoothedYFiltered }; + } + + let timelineChart: uPlot | null = null; + + const curYVal = document.createElement('div'); + curYVal.className = 'cur-y-val font-m'; + curYVal.style.cssText = + 'position:absolute;background:rgba(14, 14, 16, 0.9);color:#fff;padding:8px 12px;border-radius:4px;font-family:system-ui;pointer-events:none;z-index:1000;box-shadow:0 4px 6px rgba(0,0,0,0.3);border:1px solid #2e2e34;display:none;'; + chartEl.style.position = 'relative'; + chartEl.appendChild(curYVal); + + const optsUPlot: uPlot.Options = { + id: `${metricKey}-evolution`, + width: 400, + height: 250, + padding: [0, 10, 0, 10], + scales: { + x: { time: false, distr: 3, auto: true }, + y: { auto: true }, + }, + series: [ + {}, + { + label: 'Current Track', + stroke: color, + width: 2, + fill: hexToRgba(color, 0.1), + points: { show: true, size: 5, fill: color }, + }, + { + label: 'All-Time Max', + stroke: '#888888', + width: 1, + fill: 'transparent', + points: { show: true, size: 6, fill: '#888888' }, + }, + ], + axes: [ + { + stroke: '#555564', + grid: { stroke: '#2e2e34', width: 1 }, + show: true, + values: () => [], + ticks: { show: false }, + font: '10px system-ui, sans-serif', + size: 30, + }, + { + stroke: '#555564', + grid: { stroke: '#2e2e34', width: 1 }, + values: (_u, vals) => vals.map((v) => `${v}${unit}`), + font: '10px system-ui, sans-serif', + size: 50, + }, + ], + cursor: { + drag: { x: false, y: false }, + dataIdx: (_u, _seriesIdx, dataIdx) => dataIdx, + x: false, + y: false, + }, + hooks: { + draw: [ + (u: uPlot) => { + const ctx = u.ctx; + const dpr = window.devicePixelRatio || 1; + const bb = u.bbox; + const benchmarks = [ + 1, 2, 5, 10, 20, 30, 60, 120, 300, 600, 1200, 1800, 3600, 7200, 10800, + ]; + const maxDur = xData[xData.length - 1]; + + ctx.save(); + ctx.fillStyle = '#555564'; + ctx.textAlign = 'center'; + ctx.textBaseline = 'top'; + ctx.font = `${10 * dpr}px system-ui, sans-serif`; + + let lastX = -100; + benchmarks.forEach((d) => { + if (d > maxDur) return; + const x = u.valToPos(d, 'x', true); + if (x > lastX + 30 * dpr && x < bb.left + bb.width + 5 * dpr) { + ctx.fillText(fmtDuration(d), x, bb.top + bb.height + 6 * dpr); + lastX = x; + } + }); + + if (pinnedDur !== null) { + const idx = xData.indexOf(pinnedDur); + if (idx >= 0) { + const pcx = u.valToPos(pinnedDur, 'x', true); + const pcy = u.valToPos(yDataCurrent[idx]! || yDataMax[idx]!, 'y', true); + + ctx.save(); + ctx.beginPath(); + ctx.setLineDash([]); + const curVal = yDataCurrent[idx]; + const dotRadius = curVal !== null ? 5 * dpr : 3 * dpr; + const dotColor = curVal !== null ? color : '#888888'; + ctx.arc(pcx, pcy, dotRadius, 0, 2 * Math.PI); + ctx.fillStyle = dotColor; + ctx.fill(); + ctx.strokeStyle = '#fff'; + ctx.lineWidth = 2 * dpr; + ctx.stroke(); + ctx.restore(); + } + } + + ctx.restore(); + }, + (u: uPlot) => { + const ctx = u.ctx; + const dpr = window.devicePixelRatio || 1; + const bb = u.bbox; + + let idx = u.cursor.idx; + let activeSeriesIdx = 1; + const cursorLeft = u.cursor.left; + const cursorTop = u.cursor.top; + + if (cursorLeft != null && cursorTop != null && cursorLeft >= 0 && cursorTop >= 0) { + let minD2 = Infinity; + let nearestIdx = -1; + const radius = 30; + const maxD2 = radius * radius; + + for (let i = 0; i < xData.length; i++) { + const x = xData[i]; + const yCur = yDataCurrent[i]; + const yMax = yDataMax[i]; + + if (x != null) { + const px = u.valToPos(x, 'x', false); + + if (yCur != null) { + const py = u.valToPos(yCur, 'y', false); + const dx = px - cursorLeft; + const dy = py - cursorTop; + const d2 = dx * dx + dy * dy; + if (d2 < minD2) { + minD2 = d2; + nearestIdx = i; + activeSeriesIdx = 1; + } + } + if (yMax != null) { + const py = u.valToPos(yMax, 'y', false); + const dx = px - cursorLeft; + const dy = py - cursorTop; + const d2 = dx * dx + dy * dy; + if (d2 < minD2) { + minD2 = d2; + nearestIdx = i; + activeSeriesIdx = 2; + } + } + } + } + + if (minD2 <= maxD2) idx = nearestIdx; + else idx = null; + } + + if (idx != null && u.data[0][idx] != null) { + const pcx = u.valToPos(u.data[0][idx]!, 'x', true); + const pcy = u.valToPos( + activeSeriesIdx === 1 ? yDataCurrent[idx]! : yDataMax[idx]!, + 'y', + true, + ); + + ctx.save(); + ctx.beginPath(); + ctx.setLineDash([2 * dpr, 2 * dpr]); + ctx.strokeStyle = hexToRgba(activeSeriesIdx === 1 ? color : '#888888', 0.4); + ctx.lineWidth = 1 * dpr; + ctx.moveTo(pcx, bb.top); + ctx.lineTo(pcx, bb.top + bb.height); + ctx.moveTo(bb.left, pcy); + ctx.lineTo(bb.left + bb.width, pcy); + ctx.stroke(); + ctx.restore(); + + ctx.save(); + ctx.beginPath(); + ctx.setLineDash([]); + ctx.arc(pcx, pcy, 12 * dpr, 0, 2 * Math.PI); + ctx.fillStyle = hexToRgba(activeSeriesIdx === 1 ? color : '#888888', 0.2); + ctx.fill(); + ctx.restore(); + + ctx.save(); + ctx.beginPath(); + const dotRadius = activeSeriesIdx === 1 ? 5 * dpr : 6 * dpr; + const dotColor = activeSeriesIdx === 1 ? color : '#888888'; + ctx.arc(pcx, pcy, dotRadius, 0, 2 * Math.PI); + ctx.fillStyle = dotColor; + ctx.fill(); + ctx.strokeStyle = '#fff'; + ctx.lineWidth = 2 * dpr; + ctx.stroke(); + ctx.restore(); + + ctx.save(); + ctx.setLineDash([]); + + const xValStr = fmtDuration(xData[idx!]); + ctx.font = `bold ${10 * dpr}px system-ui, sans-serif`; + const xValWidth = ctx.measureText(xValStr).width; + const xbw = xValWidth + 10 * dpr; + const pillH = 16 * dpr; + + const xLabelX = pcx - xbw / 2; + const clampedXBx = Math.max(bb.left, Math.min(bb.left + bb.width - xbw, xLabelX)); + const xLabelY = bb.top + bb.height + 2 * dpr; + + ctx.fillStyle = 'rgba(14, 14, 16, 0.92)'; + ctx.beginPath(); + if ((ctx as any).roundRect) + (ctx as any).roundRect(clampedXBx, xLabelY, xbw, pillH, 3 * dpr); + else ctx.rect(clampedXBx, xLabelY, xbw, pillH); + ctx.fill(); + ctx.strokeStyle = hexToRgba(color, 0.27); + ctx.lineWidth = 1 * dpr; + ctx.stroke(); + + ctx.fillStyle = color; + ctx.textAlign = 'center'; + ctx.textBaseline = 'middle'; + ctx.fillText(xValStr, clampedXBx + xbw / 2, xLabelY + pillH / 2); + + const yVal = yDataCurrent[idx!]! || yDataMax[idx!]!; + const yValStr = `${yVal.toFixed(0)} ${unit}`; + const yValWidth = ctx.measureText(yValStr).width; + const ybw = yValWidth + 10 * dpr; + + const yLabelX = bb.left - ybw - 2 * dpr; + const yLabelY = pcy - pillH / 2; + + ctx.fillStyle = 'rgba(14, 14, 16, 0.92)'; + ctx.beginPath(); + if ((ctx as any).roundRect) + (ctx as any).roundRect(yLabelX, yLabelY, ybw, pillH, 3 * dpr); + else ctx.rect(yLabelX, yLabelY, ybw, pillH); + ctx.fill(); + ctx.strokeStyle = hexToRgba(color, 0.27); + ctx.lineWidth = 1 * dpr; + ctx.stroke(); + + ctx.fillStyle = color; + ctx.textAlign = 'left'; + ctx.textBaseline = 'middle'; + ctx.fillText(yValStr, yLabelX + 5 * dpr, yLabelY + pillH / 2); + + ctx.restore(); + } + }, + ], + setCursor: [ + (u: uPlot) => { + if (!(u as any)._ready) return; + u.redraw(false); + + let idx = u.cursor.idx; + const cursorLeft = u.cursor.left; + const cursorTop = u.cursor.top; + + if (cursorLeft != null && cursorTop != null && cursorLeft >= 0 && cursorTop >= 0) { + let minD2 = Infinity; + let nearestIdx = -1; + const radius = 30; + const maxD2 = radius * radius; + + for (let i = 0; i < xData.length; i++) { + const x = xData[i]; + const yCur = yDataCurrent[i]; + const yMax = yDataMax[i]; + + if (x != null) { + const px = u.valToPos(x, 'x', false); + + if (yCur != null) { + const py = u.valToPos(yCur, 'y', false); + const dx = px - cursorLeft; + const dy = py - cursorTop; + const d2 = dx * dx + dy * dy; + if (d2 < minD2) { + minD2 = d2; + nearestIdx = i; + } + } + if (yMax != null) { + const py = u.valToPos(yMax, 'y', false); + const dx = px - cursorLeft; + const dy = py - cursorTop; + const d2 = dx * dx + dy * dy; + if (d2 < minD2) { + minD2 = d2; + nearestIdx = i; + } + } + } + } + + if (minD2 <= maxD2) idx = nearestIdx; + else idx = null; + } + + const bb = u.bbox; + const hasFocus = idx != null && xData[idx] != null; + + if (hasFocus) { + const durVal = xData[idx!]; + const curVal = yDataCurrent[idx!]; + const mxVal = yDataMax[idx!]; + + let html = `
${fmtDuration(durVal)}
`; + if (curVal !== null) { + html += ` +
+ Current: + ${curVal} ${unit} +
+ `; + } + if (mxVal !== null) { + html += ` +
+ Max: + ${mxVal} ${unit} +
+ `; + } + + curYVal.innerHTML = html; + + if (timelineChart && pinnedDur === null) { + currentDur = durVal; + const { xFiltered, rawYFiltered, smoothedYFiltered } = getFilteredData( + currentDur, + currentRange, + ); + const lowerBound = smoothedYFiltered.map((v) => (v !== null ? v * 0.9 : null)); + const upperBound = smoothedYFiltered.map((v) => (v !== null ? v * 1.1 : null)); + timelineChart.setData([ + xFiltered, + rawYFiltered, + smoothedYFiltered, + lowerBound, + upperBound, + ]); + + const labelEl = cardContainer.querySelector(`#${metricKey}-timeline-label`); + if (labelEl) + labelEl.textContent = `Progress ${fmtDuration(durVal)} ${metricKey === 'power' ? 'Power' : 'HR'}`; + } + curYVal.style.display = ''; + curYVal.style.left = `${cursorLeft! + bb.left}px`; + curYVal.style.top = `${cursorTop! + bb.top}px`; + curYVal.style.transform = 'translate(5px, -50%)'; + } else { + curYVal.style.display = 'none'; + } + }, + ], + }, + }; + + mainChart = new uPlot(optsUPlot, [xData, yDataCurrent, yDataMax], chartEl); + evolutionPlots.push(mainChart); + + chartEl.addEventListener('click', () => { + if (!mainChart) return; + const idx = mainChart.cursor.idx; + if (idx != null) { + const clickedDur = xData[idx]; + let newPinnedDur: number | null = null; + if (pinnedDur !== null) newPinnedDur = null; + else newPinnedDur = clickedDur; + + onPinChange(newPinnedDur); + + if (currentTrack) { + const stats = currentTrack.stats; + const curve = metricKey === 'power' ? stats.powerCurve : stats.hrCurve; + if (curve) { + const entry = curve[clickedDur]; + if (entry) { + const bestIdx = entry.idx; + const duration = clickedDur; + const startPt = currentTrack.points[bestIdx]; + const endPt = currentTrack.points[bestIdx + duration - 1]; + if (startPt && endPt && startPt.time != null && endPt.time != null) { + const trackStart = currentTrack.points[0].time || 0; + const min = (startPt.time - trackStart) / 1000; + const max = (endPt.time - trackStart) / 1000; + onTrackSelect?.(currentTrack.id, [min, max]); + } + } + } + } + } + }); + + chartEl.addEventListener('mouseleave', () => { + if (mainChart) mainChart.redraw(); + }); + + let lastNearestIdx: number | null = null; + + const timelineEl = cardContainer.querySelector(`#${metricKey}-timeline-chart`) as HTMLElement; + if (timelineEl) { + timelineEl.innerHTML = ''; + timelineEl.style.position = 'relative'; + const timelineTooltip = document.createElement('div'); + timelineTooltip.className = 'timeline-tooltip font-m'; + timelineTooltip.style.cssText = + 'position:absolute;background:rgba(14, 14, 16, 0.9);color:#fff;padding:8px 12px;border-radius:4px;font-family:system-ui;pointer-events:none;z-index:1000;box-shadow:0 4px 6px rgba(0,0,0,0.3);border:1px solid #2e2e34;display:none;'; + timelineEl.appendChild(timelineTooltip); + + if (xTimeline.length > 0) { + const { xFiltered, rawYFiltered, smoothedYFiltered } = getFilteredData( + currentDur, + currentRange, + ); + const lowerBound = smoothedYFiltered.map((v) => (v !== null ? v * 0.9 : null)); + const upperBound = smoothedYFiltered.map((v) => (v !== null ? v * 1.1 : null)); + const dataTimeline = [xFiltered, rawYFiltered, smoothedYFiltered, lowerBound, upperBound]; + + const series: any[] = [ + { + value: (_u: any, v: number) => { + if (v != null) return fmtDate(v * 1000); + return '-'; + }, + }, + { + label: 'Value', + stroke: color, + width: 0, + points: { show: true, size: 6, fill: hexToRgba(color, 0.5) }, + }, + { + label: 'Trend', + stroke: color, + width: 2, + points: { show: false }, + spanGaps: true, + fill: 'transparent', + dash: [5, 5], + }, + { + label: 'Lower Bound', + stroke: 'transparent', + width: 0, + points: { show: false }, + spanGaps: true, + }, + { + label: 'Upper Bound', + stroke: 'transparent', + width: 0, + points: { show: false }, + spanGaps: true, + }, + ]; + + const labelEl = cardContainer.querySelector(`#${metricKey}-timeline-label`); + if (labelEl) + labelEl.textContent = `Progress ${fmtDuration(currentDur)} ${metricKey === 'power' ? 'Power' : 'HR'}`; + + const optsTimeline: uPlot.Options = { + width: Math.max(100, (gridWidth || 570) - 400), + height: 250, + padding: [0, 10, 0, 10], + tzDate: (ts: number) => uPlot.tzDate(new Date(ts * 1000), 'Etc/UTC'), + cursor: { + points: { + show: false, + }, + drag: { setScale: false }, + x: false, + y: false, + }, + scales: { + x: { + time: true, + range: (u) => { + const min = u.data[0][0]; + const max = u.data[0][u.data[0].length - 1]; + if (min === undefined || max === undefined) return [0, 100]; + if (min === max) return [min - 3600, max + 3600]; + return [min, max]; + }, + }, + y: { range: (_u: any, min: number, max: number) => [min * 0.9, max * 1.1] }, + }, + series: series, + bands: [{ series: [4, 3], fill: hexToRgba(color, 0.2) }], + hooks: { + init: [ + (u: uPlot) => { + u.over.addEventListener('click', () => { + if (lastNearestIdx != null) { + const track = tracksFiltered[lastNearestIdx]; + if (track) { + const stats = track.stats; + const curve = metricKey === 'power' ? stats.powerCurve : stats.hrCurve; + if (curve) { + const entry = curve[currentDur]; + if (entry) { + const bestIdx = entry.idx; + const duration = currentDur; + + const startPt = track.points[bestIdx]; + const endPt = track.points[bestIdx + duration - 1]; + + if (startPt && endPt && startPt.time != null && endPt.time != null) { + const trackStart = track.points[0].time || 0; + const min = (startPt.time - trackStart) / 1000; + const max = (endPt.time - trackStart) / 1000; + + opts.onTrackSelect?.(track.id, [min, max]); + } else { + opts.onTrackSelect?.(track.id, null); + } + } else { + opts.onTrackSelect?.(track.id, null); + } + } else { + opts.onTrackSelect?.(track.id, null); + } + } + } + }); + }, + ], + draw: [ + (u: uPlot) => { + const idx = u.cursor.idx; + if (idx != null && u.data[0][idx] != null) { + const val = u.data[1][idx]; + if (val != null) { + const tpcx = u.valToPos(u.data[0][idx]!, 'x', true); + const tpcy = u.valToPos(val, 'y', true); + + const tctx = u.ctx; + const tdpr = window.devicePixelRatio || 1; + + tctx.save(); + tctx.beginPath(); + tctx.setLineDash([2 * tdpr, 2 * tdpr]); + tctx.strokeStyle = hexToRgba(color, 0.4); + tctx.lineWidth = 1 * tdpr; + tctx.moveTo(tpcx, u.bbox.top); + tctx.lineTo(tpcx, u.bbox.top + u.bbox.height); + tctx.moveTo(u.bbox.left, tpcy); + tctx.lineTo(u.bbox.left + u.bbox.width, tpcy); + tctx.stroke(); + tctx.restore(); + + tctx.save(); + tctx.beginPath(); + tctx.setLineDash([]); + tctx.arc(tpcx, tpcy, 12 * tdpr, 0, 2 * Math.PI); + tctx.fillStyle = hexToRgba(color, 0.2); + tctx.fill(); + tctx.restore(); + + tctx.save(); + tctx.beginPath(); + tctx.arc(tpcx, tpcy, 6 * tdpr, 0, 2 * Math.PI); + tctx.fillStyle = color; + tctx.fill(); + tctx.strokeStyle = '#fff'; + tctx.lineWidth = 2 * tdpr; + tctx.stroke(); + tctx.restore(); + + tctx.save(); + tctx.setLineDash([]); + + const d = new Date(u.data[0][idx]! * 1000); + const dateStr = `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, '0')}-${String(d.getUTCDate()).padStart(2, '0')}`; + tctx.font = `bold ${10 * tdpr}px system-ui, sans-serif`; + const dateWidth = tctx.measureText(dateStr).width; + const xbw = dateWidth + 10 * tdpr; + const pillH = 16 * tdpr; + + const xLabelX = tpcx - xbw / 2; + const clampedXBx = Math.max( + u.bbox.left, + Math.min(u.bbox.left + u.bbox.width - xbw, xLabelX), + ); + const xLabelY = u.bbox.top + u.bbox.height + 2 * tdpr; + + tctx.fillStyle = 'rgba(14, 14, 16, 0.92)'; + tctx.beginPath(); + if ((tctx as any).roundRect) + (tctx as any).roundRect(clampedXBx, xLabelY, xbw, pillH, 3 * tdpr); + else tctx.rect(clampedXBx, xLabelY, xbw, pillH); + tctx.fill(); + tctx.strokeStyle = hexToRgba(color, 0.27); + tctx.lineWidth = 1 * tdpr; + tctx.stroke(); + + tctx.fillStyle = color; + tctx.textAlign = 'center'; + tctx.textBaseline = 'middle'; + tctx.fillText(dateStr, clampedXBx + xbw / 2, xLabelY + pillH / 2); + + const valStr = `${val.toFixed(0)} ${unit}`; + const valWidth = tctx.measureText(valStr).width; + const ybw = valWidth + 10 * tdpr; + + const yLabelX = u.bbox.left - ybw - 2 * tdpr; + const yLabelY = tpcy - pillH / 2; + + tctx.fillStyle = 'rgba(14, 14, 16, 0.92)'; + tctx.beginPath(); + if ((tctx as any).roundRect) + (tctx as any).roundRect(yLabelX, yLabelY, ybw, pillH, 3 * tdpr); + else tctx.rect(yLabelX, yLabelY, ybw, pillH); + tctx.fill(); + tctx.strokeStyle = hexToRgba(color, 0.27); + tctx.lineWidth = 1 * tdpr; + tctx.stroke(); + + tctx.fillStyle = color; + tctx.textAlign = 'left'; + tctx.textBaseline = 'middle'; + tctx.fillText(valStr, yLabelX + 5 * tdpr, yLabelY + pillH / 2); + + tctx.restore(); + } + } + }, + ], + setCursor: [ + (u: uPlot) => { + if (!(u as any)._ready) return; + u.redraw(false); + + let idx = u.cursor.idx; + const cursorLeft = u.cursor.left; + const cursorTop = u.cursor.top; + const bb = u.bbox; + + if (cursorLeft != null && cursorTop != null && cursorLeft >= 0 && cursorTop >= 0) { + let minD2 = Infinity; + let nearestIdx = -1; + const radius = 30; + const maxD2 = radius * radius; + + const xData = u.data[0]; + const yData = u.data[1]; + + for (let i = 0; i < xData.length; i++) { + const x = xData[i]; + const y = yData[i]; + if (x == null || y == null) continue; + + const px = u.valToPos(x, 'x', false); + const py = u.valToPos(y, 'y', false); + + const dx = px - cursorLeft; + const dy = py - cursorTop; + const d2 = dx * dx + dy * dy; + + if (d2 < minD2) { + minD2 = d2; + nearestIdx = i; + } + } + + if (minD2 <= maxD2) { + idx = nearestIdx; + lastNearestIdx = nearestIdx; + } else { + idx = null; + lastNearestIdx = null; + } + } + + if (idx != null && u.data[0][idx] != null) { + const d = new Date(u.data[0][idx]! * 1000); + const dateStr = `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, '0')}-${String(d.getUTCDate()).padStart(2, '0')}`; + + const val = u.data[1][idx]; + const valStr = val != null ? `${val} ${unit}` : '—'; + + timelineTooltip.innerHTML = ` +
+ Date: + ${dateStr} +
+
+ Value: + ${valStr} +
+ `; + timelineTooltip.style.display = 'block'; + timelineTooltip.style.left = `${cursorLeft! + bb.left}px`; + timelineTooltip.style.top = `${cursorTop! + bb.top}px`; + timelineTooltip.style.transform = 'translate(5px, -50%)'; + } else { + timelineTooltip.style.display = 'none'; + } + }, + ], + }, + axes: [ + { + space: 50, + stroke: '#555564', + grid: { stroke: '#2e2e34' }, + show: true, + font: '10px system-ui, sans-serif', + size: 30, + values: (_u: any, vals: any[]) => + vals.map((v) => { + const d = new Date(v * 1000); + return `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, '0')}`; + }), + }, + { + stroke: '#555564', + grid: { stroke: '#2e2e34' }, + font: '10px system-ui, sans-serif', + values: (_u: any, vals: any[]) => vals.map((v) => `${v} ${unit}`), + show: true, + space: 15, + size: 50, + }, + ], + }; + + timelineChart = new uPlot(optsTimeline, dataTimeline as any, timelineEl); + evolutionPlots.push(timelineChart); + + timelineEl.addEventListener('mouseleave', () => { + timelineChart!.redraw(); + }); + } else { + timelineEl.innerHTML = '
No data for the past year
'; + } + } + + return { + updatePin: (dur: number | null) => { + pinnedDur = dur; + if (dur !== null) currentDur = dur; + + const labelEl = cardContainer.querySelector(`#${metricKey}-timeline-label`); + if (labelEl) + labelEl.textContent = `Progress ${fmtDuration(currentDur)} ${metricKey === 'power' ? 'Power' : 'HR'}${pinnedDur !== null ? ' (Pinned)' : ''}`; + + if (timelineChart) { + const { xFiltered, rawYFiltered, smoothedYFiltered } = getFilteredData( + currentDur, + currentRange, + ); + const lowerBound = smoothedYFiltered.map((v) => (v !== null ? v * 0.9 : null)); + const upperBound = smoothedYFiltered.map((v) => (v !== null ? v * 1.1 : null)); + timelineChart.setData([xFiltered, rawYFiltered, smoothedYFiltered, lowerBound, upperBound]); + } + if (mainChart) mainChart.redraw(); + }, + updateRange: (range: string) => { + currentRange = range; + if (timelineChart) { + const { xFiltered, rawYFiltered, smoothedYFiltered } = getFilteredData( + currentDur, + currentRange, + ); + const lowerBound = smoothedYFiltered.map((v) => (v !== null ? v * 0.9 : null)); + const upperBound = smoothedYFiltered.map((v) => (v !== null ? v * 1.1 : null)); + timelineChart.setData([xFiltered, rawYFiltered, smoothedYFiltered, lowerBound, upperBound]); + } + }, + }; +} + +function getWeekStart(date: Date): Date { + const d = new Date(date); + const day = d.getUTCDay(); + const diff = d.getUTCDate() - day + (day === 0 ? -6 : 1); + d.setUTCDate(diff); + d.setUTCHours(0, 0, 0, 0); + return d; +} + +function computeWeeklyDistance( + allTracks: TrackData[], +): { week: string; timestamp: number; distance: number }[] { + const weeklyData: Record = {}; + + allTracks.forEach((t) => { + if (!t.stats.startTime || !t.stats.totalDist) return; + + const date = new Date(t.stats.startTime); + const weekStart = getWeekStart(date); + const weekKey = weekStart.toISOString().split('T')[0]; + + if (!weeklyData[weekKey]) weeklyData[weekKey] = { timestamp: weekStart.getTime(), distance: 0 }; + + weeklyData[weekKey].distance += t.stats.totalDist; + }); + + return Object.entries(weeklyData) + .map(([week, data]) => ({ week, timestamp: data.timestamp, distance: data.distance })) + .sort((a, b) => a.timestamp - b.timestamp); +} + +function computeWeeklyElevation( + allTracks: TrackData[], +): { week: string; timestamp: number; elevation: number }[] { + const weeklyData: Record = {}; + + allTracks.forEach((t) => { + if (!t.stats.startTime || t.stats.elevGain === undefined) return; + + const date = new Date(t.stats.startTime); + const weekStart = getWeekStart(date); + const weekKey = weekStart.toISOString().split('T')[0]; + + if (!weeklyData[weekKey]) + weeklyData[weekKey] = { timestamp: weekStart.getTime(), elevation: 0 }; + + weeklyData[weekKey].elevation += t.stats.elevGain; + }); + + return Object.entries(weeklyData) + .map(([week, data]) => ({ week, timestamp: data.timestamp, elevation: data.elevation })) + .sort((a, b) => a.timestamp - b.timestamp); +} + +function computeMonthlyDistance( + allTracks: TrackData[], +): { week: string; timestamp: number; distance: number }[] { + const monthlyData: Record = {}; + + allTracks.forEach((t) => { + if (!t.stats.startTime || !t.stats.totalDist) return; + const date = new Date(t.stats.startTime); + const monthStart = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1)); + const monthKey = monthStart.toISOString().slice(0, 7); + if (!monthlyData[monthKey]) { + monthlyData[monthKey] = { timestamp: monthStart.getTime(), distance: 0 }; + } + monthlyData[monthKey].distance += t.stats.totalDist; + }); + + return Object.entries(monthlyData) + .map(([week, data]) => ({ week, timestamp: data.timestamp, distance: data.distance })) + .sort((a, b) => a.timestamp - b.timestamp); +} + +function computeMonthlyElevation( + allTracks: TrackData[], +): { week: string; timestamp: number; elevation: number }[] { + const monthlyData: Record = {}; + + allTracks.forEach((t) => { + if (!t.stats.startTime || t.stats.elevGain === undefined) return; + const date = new Date(t.stats.startTime); + const monthStart = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1)); + const monthKey = monthStart.toISOString().slice(0, 7); + if (!monthlyData[monthKey]) { + monthlyData[monthKey] = { timestamp: monthStart.getTime(), elevation: 0 }; + } + monthlyData[monthKey].elevation += t.stats.elevGain; + }); + + return Object.entries(monthlyData) + .map(([week, data]) => ({ week, timestamp: data.timestamp, elevation: data.elevation })) + .sort((a, b) => a.timestamp - b.timestamp); +} + +function mountProgressCardPlot( + cardContainer: HTMLElement, + allTracks: TrackData[], + type: 'distance' | 'elevation', + syncKey?: any, + onDateRangeSelect?: (start: string, end: string) => void, + gridWidth?: number, +) { + const isDistance = type === 'distance'; + let activeGrouping: 'week' | 'month' = currentEvolutionGrouping; + let activeRange = UrlState.get().progress || 'all'; + const weeklySource = isDistance + ? computeWeeklyDistance(allTracks) + : computeWeeklyElevation(allTracks); + const monthlySource = isDistance + ? computeMonthlyDistance(allTracks) + : computeMonthlyElevation(allTracks); + let weeklyData = activeGrouping === 'month' ? monthlySource : weeklySource; + + const color = isDistance ? Metrics.distance.color : Metrics.elevation.color; + const unit = isDistance ? 'km' : 'm'; + + const chartEl = cardContainer.querySelector(`#${type}-weekly-chart`) as HTMLElement; + const yAxisEl = cardContainer.querySelector(`#${type}-y-axis-chart`) as HTMLElement; + + if (!chartEl || !yAxisEl) return; + chartEl.innerHTML = ''; + chartEl.style.position = 'relative'; + + const tooltip = document.createElement('div'); + tooltip.className = 'cur-y-val'; + tooltip.style.cssText = `color:${color};display:none`; + chartEl.appendChild(tooltip); + + const xData = weeklyData.map((d) => d.timestamp / 1000); + const yData = isDistance + ? (weeklyData as any[]).map((d) => d.distance / 1000) + : (weeklyData as any[]).map((d) => d.elevation); + + if (xData.length === 0) return; + + const yDataSmoothed = gaussianSmooth(yData, 2); + + const chartClientW = Math.max(0, (gridWidth || 570) - 20 - 320 - 20); + const width = Math.max(chartClientW, xData.length * 40); + const maxVal = Math.max(...yData) * 1.1; + + const mainOpts: uPlot.Options = { + width: width, + height: 150, + padding: [10, 10, 0, 10], + tzDate: (ts: number) => uPlot.tzDate(new Date(ts * 1000), 'Etc/UTC'), + scales: { + x: { time: true }, + y: { range: [0, maxVal] }, + }, + series: [ + {}, + { + label: isDistance ? 'Distance' : 'Elevation', + stroke: color, + fill: hexToRgba(color, 0.1), + width: 2, + points: { show: true, size: 4 }, + }, + { + label: 'Trend', + stroke: color, + width: 2, + dash: [5, 5], + points: { show: false }, + }, + ], + cursor: { + sync: syncKey ? { key: syncKey.key } : undefined, + drag: { x: false, y: false }, + points: { show: false }, + x: false, + y: false, + }, + hooks: { + init: [ + (u: uPlot) => { + u.over.addEventListener('click', () => { + const idx = u.cursor.idx; + if (idx != null) { + const item = weeklyData[idx]; + if (item) { + const start = new Date(item.timestamp); + const end = new Date(item.timestamp + 7 * 24 * 60 * 60 * 1000); + const startStr = start.toISOString().split('T')[0]; + const endStr = end.toISOString().split('T')[0]; + onDateRangeSelect?.(startStr, endStr); + } + } + }); + }, + ], + setCursor: [ + (u: uPlot) => { + if (!(u as any)._ready) return; + const idx = u.cursor.idx; + const cursorLeft = u.cursor.left; + const cursorTop = u.cursor.top; + + if ( + idx != null && + cursorLeft != null && + cursorTop != null && + cursorLeft >= 0 && + cursorTop >= 0 + ) { + const val = u.data[1][idx]; + const valStr = + val != null ? (isDistance ? `${val.toFixed(1)} km` : `${val.toFixed(0)} m`) : '—'; + + tooltip.innerHTML = valStr; + tooltip.style.display = 'block'; + tooltip.style.left = `${u.valToPos(u.data[0][idx]!, 'x', false)}px`; + tooltip.style.top = `${u.valToPos(u.data[1][idx]!, 'y', false)}px`; + tooltip.style.transform = 'translate(6px, -50%)'; + } else { + tooltip.style.display = 'none'; + } + + u.redraw(false); + }, + ], + draw: [ + (u: uPlot) => { + const idx = u.cursor.idx; + if (idx != null && u.data[0][idx] != null) { + const pcx = u.valToPos(u.data[0][idx]!, 'x', true); + const pcy = u.valToPos(u.data[1][idx]!, 'y', true); + const dpr = window.devicePixelRatio || 1; + const ctx = u.ctx; + const bb = u.bbox; + + ctx.save(); + ctx.beginPath(); + ctx.setLineDash([2 * dpr, 2 * dpr]); + ctx.strokeStyle = hexToRgba(color, 0.4); + ctx.lineWidth = 1 * dpr; + ctx.moveTo(pcx, bb.top); + ctx.lineTo(pcx, bb.top + bb.height); + ctx.moveTo(bb.left, pcy); + ctx.lineTo(bb.left + bb.width, pcy); + ctx.stroke(); + ctx.restore(); + + ctx.save(); + ctx.beginPath(); + ctx.setLineDash([]); + ctx.arc(pcx, pcy, 12 * dpr, 0, 2 * Math.PI); + ctx.fillStyle = hexToRgba(color, 0.2); + ctx.fill(); + ctx.restore(); + + ctx.save(); + ctx.beginPath(); + ctx.arc(pcx, pcy, 6 * dpr, 0, 2 * Math.PI); + ctx.fillStyle = color; + ctx.fill(); + ctx.strokeStyle = '#fff'; + ctx.lineWidth = 2 * dpr; + ctx.stroke(); + ctx.restore(); + + ctx.save(); + ctx.setLineDash([]); + + const d = new Date(u.data[0][idx]! * 1000); + const xValStr = `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, '0')}-${String(d.getUTCDate()).padStart(2, '0')}`; + ctx.font = `bold ${10 * dpr}px system-ui, sans-serif`; + const xValWidth = ctx.measureText(xValStr).width; + const xbw = xValWidth + 10 * dpr; + const pillH = 16 * dpr; + + const xLabelX = pcx - xbw / 2; + const clampedXBx = Math.max(bb.left, Math.min(bb.left + bb.width - xbw, xLabelX)); + const xLabelY = bb.top + bb.height + 2 * dpr; + + ctx.fillStyle = 'rgba(14, 14, 16, 0.92)'; + ctx.beginPath(); + if ((ctx as any).roundRect) + (ctx as any).roundRect(clampedXBx, xLabelY, xbw, pillH, 3 * dpr); + else ctx.rect(clampedXBx, xLabelY, xbw, pillH); + ctx.fill(); + ctx.strokeStyle = hexToRgba(color, 0.27); + ctx.lineWidth = 1 * dpr; + ctx.stroke(); + + ctx.fillStyle = color; + ctx.textAlign = 'center'; + ctx.textBaseline = 'middle'; + ctx.fillText(xValStr, clampedXBx + xbw / 2, xLabelY + pillH / 2); + + ctx.restore(); + } + }, + ], + }, + axes: [ + { + stroke: '#555564', + grid: { stroke: '#2e2e34', width: 1 }, + show: true, + space: 40, + values: (_self, splits) => + splits.map((s) => { + const d = new Date(s * 1000); + return `${d.getUTCMonth() + 1}/${d.getUTCDate()}`; + }), + font: '10px system-ui, sans-serif', + size: 30, + }, + { + stroke: '#555564', + grid: { stroke: '#2e2e34', width: 1 }, + show: true, + values: (_self, splits) => splits.map((s) => `${s.toFixed(0)} ${unit}`), + font: '10px system-ui, sans-serif', + size: 40, + }, + ], + }; + + const mainChart = new uPlot(mainOpts, [xData, yData, yDataSmoothed], chartEl); + evolutionPlots.push(mainChart); + + const scrollContainer = cardContainer.querySelector('.chart-scroll-container') as HTMLElement; + if (scrollContainer && xData.length * 40 > width) + scrollContainer.scrollLeft = scrollContainer.scrollWidth - scrollContainer.clientWidth; + + function applySeriesData() { + weeklyData = activeGrouping === 'month' ? monthlySource : weeklySource; + const maxTime = weeklyData[weeklyData.length - 1]?.timestamp || 1785542400000; + let minTime = 0; + + if (activeRange === '1m') minTime = maxTime - 30 * 24 * 3600 * 1000; + else if (activeRange === '2m') minTime = maxTime - 60 * 24 * 3600 * 1000; + else if (activeRange === '6m') minTime = maxTime - 180 * 24 * 3600 * 1000; + else if (activeRange === '1y') minTime = maxTime - 365 * 24 * 3600 * 1000; + else if (activeRange === '2y') minTime = maxTime - 2 * 365 * 24 * 3600 * 1000; + + const filteredData = weeklyData.filter((d) => d.timestamp >= minTime); + + const newXData = filteredData.map((d) => d.timestamp / 1000); + const newYData = isDistance + ? (filteredData as any[]).map((d) => d.distance / 1000) + : (filteredData as any[]).map((d) => d.elevation); + const newYDataSmoothed = gaussianSmooth(newYData, 2); + + const newWidth = Math.max(chartEl.clientWidth, newXData.length * 40); + const newMaxVal = Math.max(1, ...newYData) * 1.1; + + mainChart.setSize({ width: newWidth, height: 150 }); + mainChart.setScale('y', { min: 0, max: newMaxVal }); + mainChart.setData([newXData, newYData, newYDataSmoothed]); + + if (scrollContainer) + scrollContainer.scrollLeft = scrollContainer.scrollWidth - scrollContainer.clientWidth; + } + + return { + updateRange: (range: string) => { + activeRange = range; + applySeriesData(); + }, + updateGrouping: (grouping: 'week' | 'month') => { + activeGrouping = grouping; + applySeriesData(); + }, + }; +} diff --git a/suites-experimental/tools-gps-tracks-angular/src/url-state.ts b/suites-experimental/tools-gps-tracks-angular/src/url-state.ts new file mode 100644 index 000000000..1ab6e3044 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/url-state.ts @@ -0,0 +1,222 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +// ── URL State ───────────────────────────────────────────────────── +// Handles reading/writing application state to the URL. +// Uses an incremental "patch" approach to preserve existing params. + +export interface AppState { + track?: string; + map?: string; + xaxis?: string; + metrics?: string[]; + f_date?: (string | null)[]; + f_dist?: (number | null)[]; + f_dur?: (number | null)[]; + f_mets?: string[]; + f_tags?: string[]; + q?: string; + re?: boolean; + sort?: string; + map_pos?: [number, number, number]; + storage?: 'memory' | 'indexeddb'; + sel?: [number, number]; + sel_point?: number; + tab?: string; + progress?: string; + speed_mode?: string; +} + +export const UrlState = (() => { + const initialPathname = typeof location !== 'undefined' ? location.pathname : '/'; + const initialSearch = typeof location !== 'undefined' ? location.search.replace(/^\?/, '') : ''; + + // Internal state and local in-memory query/navigation stack. + let _state: AppState = {}; + let localSearch: string = initialSearch; + let _lastSearch: string | null = null; + let _syncTimeout: any = null; + let _shouldPush = false; + let historyEntries: Array<{ state: unknown; url: string }> = [ + { + state: null, + url: initialPathname + (initialSearch ? `?${initialSearch}` : ''), + }, + ]; + + function read(): AppState { + const p = new URLSearchParams(localSearch); + const s: AppState = {}; + + if (p.has('track')) s.track = p.get('track')!; + if (p.has('map')) s.map = p.get('map')!; + if (p.has('xaxis')) s.xaxis = p.get('xaxis')!; + if (p.has('tab')) s.tab = p.get('tab')!; + if (p.has('sel_point')) s.sel_point = Number(p.get('sel_point')); + if (p.has('speed_mode')) s.speed_mode = p.get('speed_mode')!; + if (p.has('progress')) s.progress = p.get('progress')!; + const metricsRaw = p.get('metrics'); + if (metricsRaw) s.metrics = metricsRaw.split(',').filter(Boolean); + + if (p.has('f_date')) { + s.f_date = p + .get('f_date')! + .split(',') + .map((v) => v || null); + } + if (p.has('f_dist')) { + s.f_dist = p + .get('f_dist')! + .split(',') + .map((v) => (v ? Number(v) : null)); + } + if (p.has('f_dur')) { + s.f_dur = p + .get('f_dur')! + .split(',') + .map((v) => (v ? Number(v) : null)); + } + if (p.has('f_mets')) s.f_mets = p.get('f_mets')!.split(','); + if (p.has('f_tags')) s.f_tags = p.get('f_tags')!.split(','); + + if (p.has('q')) s.q = p.get('q')!; + if (p.has('re')) s.re = p.get('re') === '1'; + if (p.has('sort')) { + const v = p.get('sort')!; + const isDesc = v.startsWith('-'); + const field = isDesc ? v.substring(1) : v; + s.sort = `${field}-${isDesc ? 'desc' : 'asc'}`; + } + + if (p.has('map_pos')) { + const parts = p.get('map_pos')!.split(',').map(Number); + if (parts.length === 3 && parts.every(isFinite)) + s.map_pos = parts as [number, number, number]; + } + + if (p.has('storage')) s.storage = p.get('storage') as 'memory' | 'indexeddb'; + if (p.has('sel')) { + const parts = p.get('sel')!.split(',').map(Number); + if (parts.length === 2 && parts.every((v) => !isNaN(v) && isFinite(v))) + s.sel = parts as [number, number]; + } + + return s; + } + + // Sync _state to browser URL synchronously so no pending timer leaks across steps + function _sync() { + if (_syncTimeout) { + clearTimeout(_syncTimeout); + _syncTimeout = null; + } + + const p = new URLSearchParams(); + + // Add standard encoded params + if (_state.track) p.set('track', _state.track); + if (_state.map) p.set('map', _state.map); + if (_state.xaxis && _state.xaxis !== 'time') p.set('xaxis', _state.xaxis); + if (_state.tab && _state.tab !== 'graphs') p.set('tab', _state.tab); + if (_state.storage && _state.storage !== 'memory') p.set('storage', _state.storage); + if (_state.sel_point !== undefined) p.set('sel_point', String(_state.sel_point)); + if (_state.speed_mode) p.set('speed_mode', _state.speed_mode); + if (_state.q) p.set('q', _state.q); + if (_state.progress) p.set('progress', _state.progress); + if (_state.re) p.set('re', '1'); + + if (_state.sort) { + const parts = _state.sort.split('-'); + const field = parts[0]; + const dir = parts[1]; + p.set('sort', (dir === 'desc' ? '-' : '') + field); + } + + let search = p.toString(); + + // Add comma-separated params (literal commas for cleaner URL) + if (_state.metrics) search += `${search ? '&' : ''}metrics=${_state.metrics.join(',')}`; + + if (_state.f_date) + search += `${search ? '&' : ''}f_date=${_state.f_date.map((v) => v || '').join(',')}`; + + if (_state.f_dist) + search += `${search ? '&' : ''}f_dist=${_state.f_dist.map((v) => v ?? '').join(',')}`; + + if (_state.f_dur) + search += `${search ? '&' : ''}f_dur=${_state.f_dur.map((v) => v ?? '').join(',')}`; + + if (_state.f_mets) search += `${search ? '&' : ''}f_mets=${_state.f_mets.join(',')}`; + + if (_state.f_tags) search += `${search ? '&' : ''}f_tags=${_state.f_tags.join(',')}`; + + if (_state.map_pos) { + const val = `${(+_state.map_pos[0]).toFixed(5)},${(+_state.map_pos[1]).toFixed(5)},${ + _state.map_pos[2] + }`; + search += `${search ? '&' : ''}map_pos=${val}`; + } + if (_state.sel) { + const val = `${+_state.sel[0].toFixed(4)},${+_state.sel[1].toFixed(4)}`; + search += `${search ? '&' : ''}sel=${val}`; + } + + localSearch = search; + if (search !== _lastSearch) { + const pathname = typeof location !== 'undefined' ? location.pathname : '/'; + const url = pathname + (search ? `?${search}` : ''); + const entryState = read(); + if (_shouldPush) { + historyEntries.push({ state: entryState, url }); + if (historyEntries.length > 100) { + historyEntries.shift(); + } + _shouldPush = false; + } else if (historyEntries.length > 0) { + historyEntries[historyEntries.length - 1] = { state: entryState, url }; + } else { + historyEntries.push({ state: entryState, url }); + } + _lastSearch = search; + } + } + + // Initial read + _state = read(); + + function get(): AppState { + return { ..._state }; + } + + function patch(partial: Partial>, push: boolean = false) { + if (push) _shouldPush = true; + for (const [k, v] of Object.entries(partial)) { + const key = k as keyof AppState; + if (v === null || v === undefined) delete _state[key]; + else (_state as any)[key] = v; + } + _sync(); + } + + function refresh() { + _state = read(); + } + + function reset() { + if (_syncTimeout) { + clearTimeout(_syncTimeout); + _syncTimeout = null; + } + _state = {}; + _shouldPush = false; + localSearch = ''; + _lastSearch = ''; + const pathname = typeof location !== 'undefined' ? location.pathname : '/'; + historyEntries = [{ state: null, url: pathname }]; + } + + return { read, get, patch, refresh, reset }; +})(); diff --git a/suites-experimental/tools-gps-tracks-angular/src/utils.ts b/suites-experimental/tools-gps-tracks-angular/src/utils.ts new file mode 100644 index 000000000..616087824 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/utils.ts @@ -0,0 +1,139 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +export function haversine(lat1: number, lon1: number, lat2: number, lon2: number): number { + const R = 6371e3; // Earth radius in metres + const phi1 = (lat1 * Math.PI) / 180; + const phi2 = (lat2 * Math.PI) / 180; + const deltaPhi = ((lat2 - lat1) * Math.PI) / 180; + const deltaLambda = ((lon2 - lon1) * Math.PI) / 180; + + const a = + Math.sin(deltaPhi / 2) * Math.sin(deltaPhi / 2) + + Math.cos(phi1) * Math.cos(phi2) * Math.sin(deltaLambda / 2) * Math.sin(deltaLambda / 2); + const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); + + return R * c; +} + +export function compactId(timestamp: number): string { + // Use a compact representation of the timestamp (seconds since epoch) + // 1712650000 -> Base64 + const buf = new Uint32Array([Math.floor(timestamp / 1000)]); + const b64 = btoa(String.fromCharCode(...new Uint8Array(buf.buffer))); + return b64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); +} + +export function generateId(): string { + return Math.random().toString(36).slice(2, 10); +} + +export function shortRandom(): string { + return Math.random().toString(36).slice(2, 6); +} + +export function fmtDuration(s: number): string { + if (s < 60) return `${Math.round(s)}s`; + if (s < 3600) return `${Math.round(s / 60)}m`; + return `${Math.round(s / 3600)}h`; +} + +export function fmtSecs(s: number): string { + const h = Math.floor(s / 3600), + m = Math.floor((s % 3600) / 60); + return h > 0 ? `${h}h ${m}m` : `${m}m ${Math.floor(s % 60)}s`; +} + +export function fmtPace(seconds: number | null): string { + if (seconds == null || !isFinite(seconds)) return '--'; + const mins = Math.floor(seconds / 60); + const secs = Math.round(seconds % 60); + return `${mins}:${secs.toString().padStart(2, '0')}`; +} + +export function fmtDate(ts: number | string | Date): string { + const d = new Date(ts); + if (isNaN(d.getTime())) return 'Unknown date'; + return d.toISOString().split('T')[0]; +} + +export function fmtDateTime(ts: number | string | Date): string { + const d = new Date(ts); + if (isNaN(d.getTime())) return 'Unknown'; + const iso = d.toISOString(); + return `${iso.split('T')[0]} ${iso.split('T')[1].slice(0, 5)}`; +} + +export function fmtFileSize(bytes: number): string { + if (bytes === 0) return '0 B'; + const k = 1024; + const sizes = ['B', 'KB', 'MB', 'GB']; + const i = Math.floor(Math.log(bytes) / Math.log(k)); + return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`; +} + +export function escHtml(str: string): string { + return String(str) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); +} + +export function getTagColor(name: string): string { + let hash = 0; + for (let i = 0; i < name.length; i++) hash = name.charCodeAt(i) + ((hash << 5) - hash); + + const h = Math.abs(hash % 360); + return `hsl(${h}, 70%, 65%)`; +} + +/** + * Smoothes a numeric array using a simple Gaussian kernel. + * sigma: standard deviation (radius of smoothing) + */ +export function gaussianSmooth(data: (number | null)[], sigma: number = 2): (number | null)[] { + if (sigma <= 0) return data; + + const size = Math.ceil(sigma * 3) * 2 + 1; + const kernel = new Float32Array(size); + const half = Math.floor(size / 2); + let sum = 0; + + for (let i = 0; i < size; i++) { + const x = i - half; + kernel[i] = Math.exp(-(x * x) / (2 * sigma * sigma)); + sum += kernel[i]; + } + for (let i = 0; i < size; i++) kernel[i] /= sum; + + const result: (number | null)[] = new Array(data.length); + for (let i = 0; i < data.length; i++) { + if (data[i] === null) { + result[i] = null; + continue; + } + + let val = 0; + let weightSum = 0; + for (let k = 0; k < size; k++) { + const idx = i + k - half; + if (idx >= 0 && idx < data.length && data[idx] !== null) { + val += data[idx]! * kernel[k]; + weightSum += kernel[k]; + } + } + result[i] = weightSum > 0 ? val / weightSum : data[i]; + } + return result; +} + +export function hexToRgba(hex: string, alpha: number = 1): string { + const r = parseInt(hex.slice(1, 3), 16); + const g = parseInt(hex.slice(3, 5), 16); + const b = parseInt(hex.slice(5, 7), 16); + return `rgba(${r}, ${g}, ${b}, ${alpha})`; +} diff --git a/suites-experimental/tools-gps-tracks-angular/src/vendor-fit.ts b/suites-experimental/tools-gps-tracks-angular/src/vendor-fit.ts new file mode 100644 index 000000000..458a369e0 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/vendor-fit.ts @@ -0,0 +1,6 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import FitParser from 'fit-file-parser'; +export default FitParser; diff --git a/suites-experimental/tools-gps-tracks-angular/src/zones.ts b/suites-experimental/tools-gps-tracks-angular/src/zones.ts new file mode 100644 index 000000000..a2d79a429 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/src/zones.ts @@ -0,0 +1,60 @@ +// Copyright (c) 2026, Camillo Bruni. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +'use strict'; + +import { Parsers } from './parsers'; + +export interface ZoneRange { + name: string; + min: number; + max: number; + color: string; +} + +export const Zones = (() => { + function getPowerZones(): ZoneRange[] { + const ftp = Parsers.getFTP(); + const thresholds = [0.55, 0.75, 0.9, 1.05, 1.2, 1.5].map((t) => t * ftp); + const names = [ + 'Active Recovery', + 'Endurance', + 'Tempo', + 'Threshold', + 'VO2 Max', + 'Anaerobic', + 'Neuromuscular', + ]; + const colors = ['#82E0AA', '#A8C8A0', '#F7DC6F', '#F8C471', '#F39C12', '#E67E22', '#C0392B']; + + const zones: ZoneRange[] = []; + let last = 0; + for (let i = 0; i < thresholds.length; i++) { + zones.push({ name: names[i], min: last, max: thresholds[i], color: colors[i] }); + last = thresholds[i]; + } + zones.push({ name: names[6], min: last, max: Infinity, color: colors[6] }); + return zones; + } + + function getHRZones(): ZoneRange[] { + const thresholds = Parsers.getHRZones(); + const names = ['Recovery', 'Aerobic', 'Tempo', 'Threshold', 'Anaerobic']; + const colors = ['#82E0AA', '#F7DC6F', '#F8C471', '#FF6B6B', '#C0392B']; + + const zones: ZoneRange[] = []; + let last = 0; + for (let i = 0; i < thresholds.length; i++) { + zones.push({ name: names[i], min: last, max: thresholds[i], color: colors[i] }); + last = thresholds[i]; + } + zones.push({ name: names[4], min: last, max: Infinity, color: colors[4] }); + return zones; + } + + return { + getPowerZones, + getHRZones, + }; +})(); diff --git a/suites-experimental/tools-gps-tracks-angular/test-data/activity_1_alps_stage.gpx.gz b/suites-experimental/tools-gps-tracks-angular/test-data/activity_1_alps_stage.gpx.gz new file mode 100644 index 000000000..cd3428df6 Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/test-data/activity_1_alps_stage.gpx.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/test-data/activity_2_forest_mtb.gpx.gz b/suites-experimental/tools-gps-tracks-angular/test-data/activity_2_forest_mtb.gpx.gz new file mode 100644 index 000000000..7958521ff Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/test-data/activity_2_forest_mtb.gpx.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/test-data/activity_3_road_race.tcx.gz b/suites-experimental/tools-gps-tracks-angular/test-data/activity_3_road_race.tcx.gz new file mode 100644 index 000000000..9060c68ff Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/test-data/activity_3_road_race.tcx.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/test-data/activity_4_intervals.tcx.gz b/suites-experimental/tools-gps-tracks-angular/test-data/activity_4_intervals.tcx.gz new file mode 100644 index 000000000..8357b7078 Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/test-data/activity_4_intervals.tcx.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/test-data/activity_5_grand_tour.fit.gz b/suites-experimental/tools-gps-tracks-angular/test-data/activity_5_grand_tour.fit.gz new file mode 100644 index 000000000..18c520009 Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/test-data/activity_5_grand_tour.fit.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/test-data/activity_6_weekend_ride.fit.gz b/suites-experimental/tools-gps-tracks-angular/test-data/activity_6_weekend_ride.fit.gz new file mode 100644 index 000000000..1a0b5fbed Binary files /dev/null and b/suites-experimental/tools-gps-tracks-angular/test-data/activity_6_weekend_ride.fit.gz differ diff --git a/suites-experimental/tools-gps-tracks-angular/test-data/manifest.json b/suites-experimental/tools-gps-tracks-angular/test-data/manifest.json new file mode 100644 index 000000000..52a312930 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/test-data/manifest.json @@ -0,0 +1,8 @@ +[ + "activity_1_alps_stage.gpx.gz", + "activity_2_forest_mtb.gpx.gz", + "activity_3_road_race.tcx.gz", + "activity_4_intervals.tcx.gz", + "activity_5_grand_tour.fit.gz", + "activity_6_weekend_ride.fit.gz" +] \ No newline at end of file diff --git a/suites-experimental/tools-gps-tracks-angular/tsconfig.json b/suites-experimental/tools-gps-tracks-angular/tsconfig.json new file mode 100644 index 000000000..b88c63d40 --- /dev/null +++ b/suites-experimental/tools-gps-tracks-angular/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "strict": true, + "experimentalDecorators": true, + "useDefineForClassFields": false, + "allowImportingTsExtensions": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "isolatedModules": true, + "sourceMap": true, + "noEmit": true + }, + "include": ["src/**/*"] +}